var g; var myCols = [{ display: '保供电任务名称', name: 'TASK_NAME_615', width: 150, align: 'left' ,editor: { type: 'text'} },{ display: '任务时间', name: 'TASK_TIME_615', width: 150, align: 'left' ,editor: { type: 'text'} },{ display: '投入人员(人次)', name: 'INPUT_MEM_615', width: 150, align: 'left' ,editor: { type: 'text'} },{ display: '投入车辆(台次) ', name: 'INPUT_CAR_615', width: 150, align: 'left' ,editor: { type: 'text'} },{ display: '级别', name: 'LEVEL_615', width: 150, align: 'left' ,editor: { type: 'text'} },{ display: '单位', name: 'DEPT_615', width: 150, align: 'left' ,editor: { type: 'text'} } ]; function initComplete(){ initGrid(); } function initGrid(){ g = $("#maingrid").quiGrid({ columns: [ { name: 'FD_OBJECTID615', hide : true}, { display: '保供电查询统计明细表', columns: myCols, width: "100%"} ], url :$.pathname() + '/ws/service0/BGDmingxibiao/importExpert', //params : {fileName:"C:\Users\云涛\Desktop"}, pageSize: 10, sortName: '', rownumbers:true, height: '100%', width:"100%", checkbox:true, multihead:true, enabledEdit: true, //编辑用 percentWidthMode:true, toolbar:{ items:[ {text: '批量保存', click: saveAll, iconClass: 'icon_add'}, { line : true } ] } }); } function saveAll(){ var rows=g.getSelectedRows(); var rowsLength = rows.length; if (rowsLength == 0) { top.Dialog.alert("请选中要导入的信息!"); return; } // alert(JSON.stringify(rows)); var json=JSON.stringify(rows); // $("#infotab").init(); var url = $.pathname() + "/ws/service0/BGDmingxibiao/saveBGDmingxibiao"; // alert(url); var params = { classId : '615', json:json }; $.ajax({ url : url, type : 'post', timeout : 15000, data : params, dataType : 'json', success : function(data) { // $.messager.alert('保存成功', null, null); window.location.href="List.jsp"; // var url = "/nwyj/page/business/am/resource/ledger/generator-car.jsp"; // window.parent.parent.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url)); // window.history.back(); }, error : function(e) { $.messager.alert('系统提示信息', '访问服务失败!', 'error'); } }); }