| | |
| | | <script src="../../../layuiadmin/Scripts/webConfig.js"></script> |
| | | <script src="../../../layuiadmin/PubCustom.js"></script> |
| | | <script src="../../../layuiadmin/soulTable.slim.js"></script> |
| | | <script src="../../../layuiadmin/SetColumn.js"></script> |
| | | </head> |
| | | <body> |
| | | <div class="layui-fluid"> |
| | |
| | | </div> |
| | | <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">æ¥è¯¢</button> |
| | | <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch">éç½®</button> |
| | | <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnGetWorkBill" id="btnGetWorkBill">çææäº§è®¡å</button> |
| | | <div class="layui-colla-content" style="padding: 0px; margin-left: 6%;"> |
| | | <div class="layui-row" style="margin: 10px 0 10px;"> |
| | | <div class="layui-inline"> |
| | |
| | | </div> |
| | | </div> |
| | | <table class="" id="mainTable" lay-filter="mainTable"></table> |
| | | <script type="text/html" id="toolbarDemo"> |
| | | <div class="layui-btn-container"> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="HideColumn"><i class="layui-icon layui-icon-form"></i>éèå设置</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="get_export" id="get_export"><i class="layui-icon layui-icon-export"></i>导åº</button> |
| | | </div> |
| | | </script> |
| | | </form> |
| | | </div> |
| | | </div> |
| | |
| | | , soulTable = layui.soulTable |
| | | var sWhere = ""; |
| | | var option = []; |
| | | var HModName = "ReportWorkDemandPlanBill"; |
| | | var ins = []; |
| | | //#endregion |
| | | |
| | | //#region è¿å
¥é¡µé¢å³å è½½ |
| | |
| | | //#endregion |
| | | |
| | | //#region 触åäºä»¶ï¼å
æ¬form.on(){}æ ¼å¼çææç¹å»äºä»¶ãéæ©äºä»¶ç |
| | | |
| | | //头工å
·æ äºä»¶ |
| | | table.on('toolbar(mainTable)', function (obj) { |
| | | switch (obj.event) { |
| | | //éèå设置 |
| | | case 'HideColumn': |
| | | get_HideColumnNoPageForPlan(HModName, option, get_FastQuery); |
| | | break; |
| | | //导åºexcel |
| | | case 'get_export': |
| | | get_Export(); |
| | | break; |
| | | }; |
| | | }); |
| | | |
| | | //#region 产åç¼ç |
| | | form.on('submit(btnHMATERIALID)', function (data) { |
| | |
| | | btnHDeptID(); |
| | | }); |
| | | //#endregion |
| | | |
| | | //#region çäº§è½¦é´ |
| | | form.on('submit(btnGetWorkBill)', function (data) { |
| | | btnGetWorkBill(); |
| | | }); |
| | | //#endregion |
| | | |
| | | |
| | | //#region éç½®æé® |
| | | form.on('submit(btnReSearch)', function (data) { |
| | |
| | | columns.push({ type: 'checkbox', fixed: 'left', sort: true}); |
| | | columns.push({ field: 'ç»ç»', title: 'ç产ç»ç»', sort: true}); |
| | | columns.push({ field: 'é¨é¨', title: 'ç产车é´', sort: true}); |
| | | columns.push({ field: 'FSUMQTY', title: 'å计', sort: true}); |
| | | columns.push({ field: 'FSUMQTY', title: 'å计', sort: true }); |
| | | columns.push({ field: '客æ·è®¢åå·', title: '客æ·è®¢åå·', sort: true }); |
| | | columns.push({ field: 'ç©æåç§°', title: 'ç©æåç§°', sort: true}); |
| | | columns.push({ field: 'è§æ ¼åå·', title: 'ç©æè§æ ¼', sort: true}); |
| | | columns.push({ field: 'HICMOBillNo', title: 'ç产订åå·', sort: true}); |
| | |
| | | |
| | | var k = 0;//æ¶éå¾ªç¯æ¬¡æ° |
| | | for (var j = 0; j <= (Days - k); j++) { |
| | | columns.push({ field: Format(yyyy + '/' + MM + '/' + (HBEGINDATE + j), 'yyyy-MM-dd'), title: Format(yyyy + '/' + MM + '/' + (HBEGINDATE + j), 'MM.dd'), width: 70, totalRow: true}) |
| | | columns.push({ field: Format(yyyy + '/' + MM + '/' + (HBEGINDATE + j), 'yyyy-MM-dd'), title: Format(yyyy + '/' + MM + '/' + (HBEGINDATE + j), 'MM-dd'), width: 70, totalRow: true}) |
| | | //跨年çè¯ ä¼ä»ä¸æä¸å·å¼å§ |
| | | if (MM == 12 && (HBEGINDATE + j) == 31) { |
| | | yyyy += 1; |
| | |
| | | j = 0; |
| | | } |
| | | } |
| | | columns.push({ field: '', title: '计åæç»_å计' }); |
| | | columns.push({ field: '计åæç»_å计', title: '计åæç»_å计' }); |
| | | |
| | | option = { |
| | | elem: '#mainTable' |
| | | , toolbar: '#toolbarDemo' |
| | | , height: 'full-50' |
| | | , page: false |
| | | , title: "è¦æè®¡åæ¥è¡¨" |
| | | , page: true |
| | | , cellMinWidth: 90 |
| | | , limit: 20000 |
| | | , limit: 500 |
| | | , totalRow: true |
| | | , limits: [50, 500, 5000, 20000] |
| | | , loading: false |
| | |
| | | }) |
| | | } |
| | | |
| | | function get_Export() { |
| | | var data = option.data; |
| | | data.forEach((item) => { |
| | | for (let itemobj in item) { |
| | | if (item[itemobj] == null) { |
| | | item[itemobj] = ""; |
| | | } |
| | | if (item[itemobj].length > 0) { // åè®¾åæ®µå为field |
| | | item[itemobj] = item[itemobj].toString().replaceAll(/[\r\n]+/g, ''); // å°æ¢è¡ç¬¦æ¿æ¢ä¸ºç©ºå符串 |
| | | } |
| | | } |
| | | }); |
| | | table.exportFile(ins.config.id, data, "xls"); |
| | | } |
| | | |
| | | //#region æ¥è¯¢ |
| | | function get_Display(sWhere) { |
| | | var ajaxLoad = layer.load(); |
| | |
| | | success: function (result) { |
| | | if (result.count == 1) { |
| | | option.data = result.data; |
| | | table.render(option); |
| | | //å设置 |
| | | DisPlay_HideColumnForPlan(HModName, sessionStorage["HUserName"], option); |
| | | ins = table.render(option); |
| | | layer.close(ajaxLoad); |
| | | //layer.alert("æ¥è¯¢æå", { icon: 1 }); |
| | | } else { |
| | |
| | | } |
| | | //#endregion |
| | | |
| | | //#region è¦æè®¡åçææäº§è®¡å |
| | | function btnGetWorkBill() { |
| | | var ajaxLoad = layer.load(); |
| | | var sql = "exec h_p_JIT_WorkBillSortBill_WorkDemandPlan_sansheng " + $("#HDeptID").val()+",'" +sessionStorage["HUserName"] + "','" + sessionStorage["OrganizationID"] + "'"; |
| | | $.ajax({ |
| | | url: GetWEBURL() + '/CommonModel/searchMethod', |
| | | type: "GET", |
| | | data: { "sql": sql, "user": sessionStorage["HUserName"], "ModRightNameCheck": "" }, |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | get_FastQuery(2); |
| | | layer.msg(data1.data[0]["Column1"]); |
| | | layer.close(ajaxLoad); |
| | | } else { |
| | | layer.alert(data1.code + data1.Message, { icon: 5 }); |
| | | layer.close(ajaxLoad); |
| | | } |
| | | }, error: function () { |
| | | layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | layer.close(ajaxLoad); |
| | | } |
| | | }); |
| | | } |
| | | //#endregion |
| | | |
| | | |
| | | //ç©æå表 |
| | | function btnHMATERIALID() { |
| | | layer.open({ |