| | |
| | | , laypage = layui.laypage |
| | | , laydate = layui.laydate |
| | | , util = layui.util |
| | | //æ¥è¯¢æ¡ä»¶ |
| | | var sWhere = ""; |
| | | //å
¬ç¨åé |
| | | var option = []; |
| | | |
| | | var option = { |
| | | //åå§åè¡¨æ ¼ |
| | | set_InitGrid(); |
| | | //å è½½æ°æ®å°ç½æ ¼ |
| | | get_Display(sWhere); |
| | | |
| | | //头工å
·æ äºä»¶ |
| | | table.on('toolbar(mainTable)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id); |
| | | switch (obj.event) { |
| | | //æ°å¢æé® |
| | | case 'btn-Add': |
| | | set_AddNew(); |
| | | break; |
| | | case 'btn-Edit': |
| | | set_ShowBill(); |
| | | break; |
| | | case 'btn-Delete': |
| | | set_DeleteBill(); |
| | | break; |
| | | //å®¡æ ¸æé® |
| | | case 'btn-Audit': |
| | | set_CheckBill(); |
| | | break; |
| | | //åå®¡æ ¸æé® |
| | | case 'btn-DeAudit': |
| | | set_AbandonCheck(); |
| | | break; |
| | | //é¢è§æé® |
| | | case 'btn-Print': |
| | | get_PrintReport(); |
| | | break; |
| | | //éåºæé® |
| | | case 'btn-Close': |
| | | parent.layui.admin.events.closeThisTabs(); |
| | | break; |
| | | }; |
| | | }); |
| | | |
| | | //éç½®æé® |
| | | form.on('submit(btnReSearch)', function (data) { |
| | | set_ClearQuery(); |
| | | }); |
| | | //éç½®è¿æ»¤æ¡ä»¶ |
| | | function set_ClearQuery() { |
| | | $("#HNumber").val(""); |
| | | $("#HName").val(""); |
| | | } |
| | | |
| | | //æ¥è¯¢æé® |
| | | form.on('submit(btnSearch)', function (data) { |
| | | get_FastQuery(table, option); |
| | | }); |
| | | |
| | | //å¿«éè¿æ»¤ |
| | | function get_FastQuery(table, option) { |
| | | //var HNumber = $("#HNumber").val(); |
| | | //var HName = $("#HName").val(); |
| | | //if (HNumber) { |
| | | // sWhere += " and èå代ç like '%" + HNumber + "%'"; |
| | | //} |
| | | //if (HName) { |
| | | // sWhere += " and èååç§° like '%" + HName + "%'"; |
| | | //} |
| | | var index = layer.load(0); |
| | | get_Display(sWhere); |
| | | sWhere = "";//è°ç¨æ¥å£åæ¸
空sWhereç¼å |
| | | } |
| | | |
| | | function set_InitGrid() { |
| | | option = { |
| | | elem: '#mainTable' |
| | | , toolbar: '#toolbarDemo' |
| | | , height: 'full-50' |
| | |
| | | , { field: 'æºåç±»å', title: 'æºåç±»å', width: 200 } |
| | | , { field: 'hbilltype', title: 'hbilltype', width: 200 } |
| | | ]] |
| | | }; |
| | | |
| | | } |
| | | } |
| | | var index = layer.load(0); |
| | | |
| | | //头工å
·æ äºä»¶ |
| | | table.on('toolbar(mainTable)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id); |
| | | switch (obj.event) { |
| | | case 'btn-Add': |
| | | //æ°å¢ |
| | | function set_AddNew() { |
| | | //页é¢å±-èªå®ä¹ |
| | | layer.open({ |
| | | type: 2, |
| | |
| | | |
| | | } |
| | | }); |
| | | break; |
| | | case 'btn-Edit': |
| | | } |
| | | //ç¼è¾åæ® |
| | | function set_ShowBill() { |
| | | var checkStatus = table.checkStatus('mainTable') |
| | | , data = checkStatus.data; |
| | | if (checkStatus.data.length === 1) { |
| | |
| | | } else { |
| | | layer.msg('è¯·éæ©ä¸è¡æ°æ®ç¼è¾ï¼'); |
| | | } |
| | | |
| | | break; |
| | | case 'btn-Delete': |
| | | } |
| | | //å é¤ |
| | | function set_DeleteBill() { |
| | | var checkStatus = table.checkStatus('mainTable') |
| | | , data = checkStatus.data; |
| | | if (checkStatus.data.length === 1) { |
| | |
| | | else { |
| | | layer.msg('è¯·éæ©ä¸è¡æ°æ®å é¤ï¼'); |
| | | } |
| | | break; |
| | | }; |
| | | }); |
| | | } |
| | | |
| | | //è¿å
¥é¡µé¢æ¾ç¤ºçç¼åå表 |
| | | function get_Display(sWhere) { |
| | | $.ajax({ |
| | | //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum", |
| | | url: GetWEBURL() + '/Sb_EquipMaintainPlanBill/GetEquipMaintainPlanBillList', |
| | |
| | | layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | } |
| | | }); |
| | | |
| | | //éç½®æé® |
| | | //form.on('submit(btnReSearch)', function (data) { |
| | | // $("#HBillType").val("");//åæ®ç±»å |
| | | // $("#HBillNo").val("");//åæ®å· |
| | | // $("#HSourceBillNo").val("");//æºåå· |
| | | // $("#HCreateBy").val("");//å¶å人 |
| | | // $("#BenginHCreateDate").val("");//å¼å§å¶åæ¶é´ |
| | | // $("#EndHCreateDate").val("");//ç»æå¶åæ¶é´ |
| | | // $("#btnSearch").click(); |
| | | //}); |
| | | |
| | | //æ¥è¯¢æé® |
| | | form.on('submit(btnSearch)', function (data) {//éæ©ä»ä½ |
| | | //var HBillType = $("#HBillType").val();//åæ®ç±»å |
| | | //var HBillNo = $("#HBillNo").val();//åæ®å· |
| | | //var HCreateBy = $("#HCreateBy").val();//å¶å人 |
| | | //var BenginHCreateDate = $("#BenginHCreateDate").val();//å¼å§å¶åæ¶é´ |
| | | //var EndHCreateDate = $("#EndHCreateDate").val();//ç»æå¶åæ¶é´ |
| | | //if (HBillNo) { |
| | | // sWhere += " and HBillNo like '%" + HBillNo + "%'"; |
| | | //} |
| | | //if (HCreateBy) { |
| | | // sWhere += " and HCreateBy like '%" + HCreateBy + "%'"; |
| | | //} |
| | | //if (BenginHCreateDate) { |
| | | // sWhere += " and CONVERT(varchar(100),HCreateDate, 23) >= '" + BenginHCreateDate + "'"; |
| | | //} |
| | | //if (EndHCreateDate) { |
| | | // sWhere += " and CONVERT(varchar(100),HCreateDate, 23) <= '" + EndHCreateDate + "'"; |
| | | //} |
| | | var index = layer.load(0); |
| | | $.ajax({ |
| | | //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum", |
| | | url: GetWEBURL() + '/Sb_EquipMaintainPlanBill/GetEquipMaintainPlanBillList', |
| | | type: "GET", |
| | | data: { "sWhere": sWhere}, |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | option.data = data1.data; |
| | | table.render(option); |
| | | layer.close(index); |
| | | layer.alert("æ¥è¯¢æå", { icon: 1 }); |
| | | } else { |
| | | layer.close(index); |
| | | layer.alert(data1.code + data1.Message, { icon: 5 }); |
| | | } |
| | | }, error: function () { |
| | | layer.close(index); |
| | | layer.alert("æ¥å£å¤±æ!", { icon: 5 }); |
| | | |
| | | //å®¡æ ¸ |
| | | function set_CheckBill() { |
| | | } |
| | | }); |
| | | //è°ç¨æ¥å£åæ¸
空sWhereç¼å |
| | | sWhere = ""; |
| | | //$("#HBillType").val("");//åæ®ç±»å |
| | | //$("#HBillNo").val("");//åæ®å· |
| | | //$("#HSourceBillNo").val("");//æºåå· |
| | | //$("#HCreateBy").val("");//å¶å人 |
| | | //$("#BenginHCreateDate").val("");//å¼å§å¶åæ¶é´ |
| | | //$("#EndHCreateDate").val("");//ç»æå¶åæ¶é´ |
| | | }); |
| | | |
| | | //çå¬è¡åå»äºä»¶ |
| | | table.on('rowDouble(mainTable)', function (obj) { |
| | | layer.alert("åå»äºä»¶", { icon: 1 }); |
| | | }); |
| | | //åå®¡æ ¸ |
| | | function set_AbandonCheck() { |
| | | } |
| | | |
| | | |
| | | //laydate.render({ |
| | | // elem: '#HDate' |
| | | // , type: 'datetime' |
| | | // , trigger: 'click' |
| | | // , format:'yyyy-MM-dd HH:mm' |
| | | //}); |
| | | |
| | | |
| | | //以䏿¯layui模å |
| | | }); |
| | | |
| | | |