From f340127c4b0bd34aa8a39dec7a46678d8310b7d5 Mon Sep 17 00:00:00 2001 From: wtt <1985833171@qq.com> Date: 星期三, 18 十二月 2024 14:42:14 +0800 Subject: [PATCH] 工作任务维护,任务汇报列表,工程项目维护,工作周计划列表,工作周总结列表 把分页模式 全部改为 数据库分页; --- WebTM/views/项目管理/周计划/PM_WorkTaskWeekBillList.html | 104 ++++++ WebTM/views/领料发货/销售出库/Kf_SellOutBill.html | 257 ++++++++++++--- WebTM/views/验收入库/外购入库/Kf_POStockInBillList.html | 10 WebTM/views/项目管理/工作任务/PM_WorkTaskBillList.html | 90 +++++ WebTM/views/项目管理/周计划/PM_WorkReportWeekBillMainList.html | 95 +++++ WebTM/views/项目管理/工程项目/PM_ProjectBillList.html | 108 ++++++ WebTM/views/项目管理/工程项目/PM_ProjectBill.html | 8 WebTM/views/项目管理/工作任务/PM_WorkTaskReportBillList.html | 93 +++++ WebTM/views/领料发货/销售出库/Kf_SellOutBillList.html | 159 --------- 9 files changed, 691 insertions(+), 233 deletions(-) diff --git "a/WebTM/views/\351\241\271\347\233\256\347\256\241\347\220\206/\345\221\250\350\256\241\345\210\222/PM_WorkReportWeekBillMainList.html" "b/WebTM/views/\351\241\271\347\233\256\347\256\241\347\220\206/\345\221\250\350\256\241\345\210\222/PM_WorkReportWeekBillMainList.html" index 6f5f63f..01e951c 100644 --- "a/WebTM/views/\351\241\271\347\233\256\347\256\241\347\220\206/\345\221\250\350\256\241\345\210\222/PM_WorkReportWeekBillMainList.html" +++ "b/WebTM/views/\351\241\271\347\233\256\347\256\241\347\220\206/\345\221\250\350\256\241\345\210\222/PM_WorkReportWeekBillMainList.html" @@ -200,11 +200,12 @@ </div> </div> <table class="" id="mainTable" lay-filter="mainTable"></table> + <div id="page" style="position: relative; bottom: 0;"></div> <script type="text/html" id="toolbarDemo"> <div class="layui-btn-container"> <button type="button" class="layui-btn layui-btn-sm" lay-event="set_AddNew"><i class="layui-icon layui-icon-file-b"></i>鏂板</button> <button type="button" class="layui-btn layui-btn-sm" lay-event="set_ShowBill"><i class="layui-icon layui-icon-form"></i>缂栬緫</button> - + <button type="button" class="layui-btn layui-btn-sm" lay-event="set_DeleteBill"><i class="layui-icon layui-icon-delete"></i>鍒犻櫎</button> <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Refresh"><i class="layui-icon layui-icon-refresh-3"></i>鍒锋柊</button> <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Audit"><i class="layui-icon layui-icon-radio"></i>瀹℃牳</button> @@ -242,7 +243,7 @@ var option = []; var sWhere = ""; var HModName = "h_v_PM_WorkReportWeekBillMainList"; - + var optionPage = []; //#region 銆愬姩鎬佽幏鍙栨ā鍧楀悕绉般�� var HModuleType = "4757"; //閫氳繃鍗曟嵁绫诲瀷锛屼粠鏁版嵁搴撳姩鎬佽幏鍙栧崟鎹ā鍧楀懡鍚�,寮曠敤js鏂囦欢 PageTitle.js @@ -348,12 +349,14 @@ //#region 閲嶇疆鎸夐挳 form.on('submit(btnReSearch)', function (data) { + optionPage.curr = 1; set_ClearQuery(); }); //#endregion //#region 鏌ヨ鎸夐挳 form.on('submit(btnSearch)', function (data) { + optionPage.curr = 1; get_FastQuery(2); }); //#endregion @@ -384,7 +387,7 @@ elem: '#mainTable' , toolbar: '#toolbarDemo' , height: 'full-50' - , page: true + , page: false , totalRow: true //, cellMinWidth: 90 , limit: 50 @@ -393,6 +396,26 @@ soulTable.render(this); } }; + optionPage = { + elem: 'page', //娉ㄦ剰锛岃繖閲岀殑 page 鏄� ID锛屼笉鐢ㄥ姞 # 鍙� + count: 10000, //鏁版嵁鎬绘暟锛屼粠鏈嶅姟绔緱鍒� + limit: 50, + limits: [50, 500, 1000, 2000], + layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'], + jump: function (obj, first) { + //console.log(obj) + //obj鍖呭惈浜嗗綋鍓嶅垎椤电殑鎵�鏈夊弬鏁帮紝姣斿锛� + //console.log(obj.curr); //寰楀埌褰撳墠椤碉紝浠ヤ究鍚戞湇鍔$璇锋眰瀵瑰簲椤电殑鏁版嵁銆� + //console.log(obj.limit); //寰楀埌姣忛〉鏄剧ず鐨勬潯鏁� + + //棣栨涓嶆墽琛� + if (!first) { + //do something + get_FastQuery(); + } + } + } + laypage.render(optionPage); } //#endregion @@ -460,6 +483,70 @@ }); } + + //鍒嗛〉 + function get_DisplayPage(sWhere) { + var ajaxLoad = layer.load(); + //杩涘叆椤甸潰鏄剧ず鐨勭紦瀛樺垪琛� + $.ajax({ + url: GetWEBURL() + '/PM_WorkTaskWeekBill/PM_WorkReportWeekBillpage', + type: "GET", + async: false, + data: { "sWhere": sWhere, "user": sessionStorage["HUserName"], "page": optionPage.curr, "size": optionPage.limit }, + success: function (data1) { + option.limit = optionPage.limit;//鏀瑰彉琛ㄦ牸椤靛ぇ灏� + if (data1.code == 1) { + optionPage.count = data1.count;//鏀瑰彉鍒楄〃鏁版嵁鎬绘暟 + var totalArray = ["璁″垝宸ユ椂", "娑堣�楀伐鏃�", "鏈夋晥宸ユ椂", "寤舵湡浠诲姟", "瓒呭墠浠诲姟"]; + var data = []; + var col = []; + //缁欑┖鐨勬暟缁勮祴鍊� + for (var key in data1.list) { + data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType }); + } + //鍦ㄥ垪琛ㄥ乏杈规坊鍔犲嬀閫夋 + col.push({ type: 'checkbox', fixed: 'left' }); + for (var i = 0; i < data.length; i++) { + // if (data[i].name == 'HInterID' || data[i].name == 'HBillType' || data[i].name == 'hmainid') { + if ($.inArray(data[i].name, titleData) > -1) { + col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //闅愯棌id鍒� + } + else if ($.inArray(data[i].name, totalArray) > -1) { + col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, totalRow: true, width: 120 }); + } else { + switch (data[i].Type) { + //int + case 'DateTime': + col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd')}}</div>", width: 120 }); + break; + default: + col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 120 }); + } + } + } + //璁剧疆鍒� + option.cols = [col]; + //澶勭悊骞惰缃〃鏍兼暟鎹� + option.data = data1.data; + laypage.render(optionPage); + table.render(option); + //鍒锋柊琛ㄦ牸鏁版嵁 + DisPlay_HideColumn(); + if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") { + ColFilter(); + } + layer.close(ajaxLoad); + } else { + layer.close(ajaxLoad); + layer.alert(data1.code + data1.Message, { icon: 5 }); + } + }, error: function () { + layer.close(ajaxLoad); + layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 }); + } + }); + } + //#endregion //#region 蹇�熻繃婊� @@ -556,7 +643,7 @@ } - get_Display(sWhere); + get_DisplayPage(sWhere); sWhere = "";//璋冪敤鎺ュ彛鍚庢竻绌簊Where缂撳瓨 } //#endregion diff --git "a/WebTM/views/\351\241\271\347\233\256\347\256\241\347\220\206/\345\221\250\350\256\241\345\210\222/PM_WorkTaskWeekBillList.html" "b/WebTM/views/\351\241\271\347\233\256\347\256\241\347\220\206/\345\221\250\350\256\241\345\210\222/PM_WorkTaskWeekBillList.html" index cdf315d..2da7b96 100644 --- "a/WebTM/views/\351\241\271\347\233\256\347\256\241\347\220\206/\345\221\250\350\256\241\345\210\222/PM_WorkTaskWeekBillList.html" +++ "b/WebTM/views/\351\241\271\347\233\256\347\256\241\347\220\206/\345\221\250\350\256\241\345\210\222/PM_WorkTaskWeekBillList.html" @@ -170,6 +170,7 @@ </div> </div> <table class="" id="mainTable" lay-filter="mainTable"></table> + <div id="page" style="position: relative; bottom: 0;"></div> <script type="text/html" id="toolbarDemo"> <div class="layui-btn-container"> <button type="button" class="layui-btn layui-btn-sm" lay-event="set_AddNew"><i class="layui-icon layui-icon-file-b"></i>鏂板</button> @@ -185,7 +186,7 @@ <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-DeDrop"><i class="layui-icon layui-icon-radio"></i>鍙嶄綔搴�</button> <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="set_ShowBill_dh"><i class="layui-icon layui-icon-radio"></i>鎵归噺涓嬫帹</button>--> <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Stop"><i class="layui-icon layui-icon-radio"></i>绂佺敤</button> - <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-DeStop"><i class="layui-icon layui-icon-radio"></i>鍙嶇鐢�</button>--> + <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-DeStop"><i class="layui-icon layui-icon-radio"></i>鍙嶇鐢�</button>--> <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Exit"><i class="layui-icon layui-icon-logout"></i>閫�鍑�</button> <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn"><i class="layui-icon layui-icon-form"></i>鍒楄缃�</button> <button type="button" class="layui-btn layui-btn-sm" lay-event="set_SaveScheme" id="set_SaveScheme"><i class="layui-icon layui-icon-template"></i>淇濆瓨鏂规</button> @@ -217,7 +218,7 @@ var option = []; var sWhere = ""; var HModName = "h_v_PM_WorkTaskWeekBillList"; - + var optionPage = []; //#region 銆愬姩鎬佽幏鍙栨ā鍧楀悕绉般�� var HModuleType = "4756"; //閫氳繃鍗曟嵁绫诲瀷锛屼粠鏁版嵁搴撳姩鎬佽幏鍙栧崟鎹ā鍧楀懡鍚�,寮曠敤js鏂囦欢 PageTitle.js @@ -334,12 +335,14 @@ //#region 閲嶇疆鎸夐挳 form.on('submit(btnReSearch)', function (data) { + optionPage.curr = 1; set_ClearQuery(); }); //#endregion //#region 鏌ヨ鎸夐挳 form.on('submit(btnSearch)', function (data) { + optionPage.curr = 1; get_FastQuery(2); }); //#endregion @@ -371,7 +374,7 @@ elem: '#mainTable' , toolbar: '#toolbarDemo' , height: 'full-50' - , page: true + , page: false , totalRow: true //, cellMinWidth: 90 , limit: 50 @@ -380,6 +383,26 @@ soulTable.render(this); } }; + optionPage = { + elem: 'page', //娉ㄦ剰锛岃繖閲岀殑 page 鏄� ID锛屼笉鐢ㄥ姞 # 鍙� + count: 10000, //鏁版嵁鎬绘暟锛屼粠鏈嶅姟绔緱鍒� + limit: 50, + limits: [50, 500, 1000, 2000], + layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'], + jump: function (obj, first) { + //console.log(obj) + //obj鍖呭惈浜嗗綋鍓嶅垎椤电殑鎵�鏈夊弬鏁帮紝姣斿锛� + //console.log(obj.curr); //寰楀埌褰撳墠椤碉紝浠ヤ究鍚戞湇鍔$璇锋眰瀵瑰簲椤电殑鏁版嵁銆� + //console.log(obj.limit); //寰楀埌姣忛〉鏄剧ず鐨勬潯鏁� + + //棣栨涓嶆墽琛� + if (!first) { + //do something + get_FastQuery(); + } + } + } + laypage.render(optionPage); } //#endregion @@ -528,6 +551,79 @@ }); } + + //鍒嗛〉 + function get_DisplayPage(sWhere) { + var ajaxLoad = layer.load(); + //杩涘叆椤甸潰鏄剧ず鐨勭紦瀛樺垪琛� + $.ajax({ + url: GetWEBURL() + '/PM_WorkTaskWeekBill/page', + type: "GET", + async: false, + data: { "sWhere": sWhere, "user": sessionStorage["HUserName"], "page": optionPage.curr, "size": optionPage.limit }, + success: function (data1) { + option.limit = optionPage.limit;//鏀瑰彉琛ㄦ牸椤靛ぇ灏� + if (data1.code == 1) { + optionPage.count = data1.count;//鏀瑰彉鍒楄〃鏁版嵁鎬绘暟 + var totalArray = ["棰勮鏃堕棿", "宸叉眹鎶ユ椂闂�"]; + var data = []; + var col = []; + //缁欑┖鐨勬暟缁勮祴鍊� + for (var key in data1.list) { + data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType }); + } + //鍦ㄥ垪琛ㄥ乏杈规坊鍔犲嬀閫夋 + col.push({ type: 'checkbox', fixed: 'left' }); + for (var i = 0; i < data.length; i++) { + // if (data[i].name == 'HInterID' || data[i].name == 'HBillType' || data[i].name == 'hmainid') { + if ($.inArray(data[i].name, titleData) > -1) { + col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //闅愯棌id鍒� + } + else if ($.inArray(data[i].name, totalArray) > -1) { + col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, totalRow: true, width: 120 }); + } else { + switch (data[i].Type) { + //int + case 'DateTime': + col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd')}}</div>", width: 120 }); + break; + default: + col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 120 }); + } + } + } + //鎵嬪姩娣诲姞鍛ㄤ竴鑷冲懆鏃ュ瓧娈� + col.push({ field: "HMonday", title: "鍛ㄤ竴", align: 'center', sort: true, width: 120 }); + col.push({ field: "HTuesday", title: "鍛ㄤ簩", align: 'center', sort: true, width: 120 }) + col.push({ field: "HWednesday", title: "鍛ㄤ笁", align: 'center', sort: true, width: 120 }) + col.push({ field: "HThursday", title: "鍛ㄥ洓", align: 'center', sort: true, width: 120 }) + col.push({ field: "HFriday", title: "鍛ㄤ簲", align: 'center', sort: true, width: 120 }) + col.push({ field: "HSaturday", title: "鍛ㄥ叚", align: 'center', sort: true, width: 120 }) + col.push({ field: "HSunday", title: "鍛ㄦ棩", align: 'center', sort: true, width: 120 }) + //璁剧疆鍒� + option.cols = [col]; + //澶勭悊骞惰缃〃鏍兼暟鎹� + option.data = dealSearchData(data1.data); + laypage.render(optionPage); + table.render(option); + //鍒锋柊琛ㄦ牸鏁版嵁 + DisPlay_HideColumn(); + if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") { + ColFilter(); + } + layer.close(ajaxLoad); + } else { + layer.close(ajaxLoad); + layer.alert(data1.code + data1.Message, { icon: 5 }); + } + }, error: function () { + layer.close(ajaxLoad); + layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 }); + } + }); + } + + //#endregion //#region 蹇�熻繃婊� @@ -644,7 +740,7 @@ sWhere += " and 璁″垝浜� like '%" + HPlanEmp + "%'"; } - get_Display(sWhere); + get_DisplayPage(sWhere); sWhere = "";//璋冪敤鎺ュ彛鍚庢竻绌簊Where缂撳瓨 } //#endregion diff --git "a/WebTM/views/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\344\275\234\344\273\273\345\212\241/PM_WorkTaskBillList.html" "b/WebTM/views/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\344\275\234\344\273\273\345\212\241/PM_WorkTaskBillList.html" index 9fc09b5..41e4d4a 100644 --- "a/WebTM/views/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\344\275\234\344\273\273\345\212\241/PM_WorkTaskBillList.html" +++ "b/WebTM/views/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\344\275\234\344\273\273\345\212\241/PM_WorkTaskBillList.html" @@ -169,6 +169,7 @@ </div> </div> <table class="" id="mainTable" lay-filter="mainTable"></table> + <div id="page" style="position: relative; bottom: 0;"></div> <script type="text/html" id="toolbarDemo"> <div class="layui-btn-container"> <button type="button" class="layui-btn layui-btn-sm" lay-event="set_AddNew"><i class="layui-icon layui-icon-file-b"></i>鏂板</button> @@ -226,7 +227,7 @@ var option = []; var sWhere = ""; var HModName = "PM_WorkTaskBillList"; - + var optionPage = []; //#region 銆愬姩鎬佽幏鍙栨ā鍧楀悕绉般�� var HModuleType = "4753"; //閫氳繃鍗曟嵁绫诲瀷锛屼粠鏁版嵁搴撳姩鎬佽幏鍙栧崟鎹ā鍧楀懡鍚�,寮曠敤js鏂囦欢 PageTitle.js @@ -383,12 +384,14 @@ //#region 閲嶇疆鎸夐挳 form.on('submit(btnReSearch)', function (data) { + optionPage.curr = 1; set_ClearQuery(); }); //#endregion //#region 鏌ヨ鎸夐挳 form.on('submit(btnSearch)', function (data) { + optionPage.curr = 1; get_FastQuery(2); }); //#endregion @@ -422,7 +425,7 @@ elem: '#mainTable' , toolbar: '#toolbarDemo' , height: 'full-50' - , page: true + , page: false , sort: true //閲嶇偣1锛氳繖閲岀殑sort琛ㄧず table琛ㄥ湪鍙栧緱鎺ュ彛鏁版嵁鍚庯紝瀵归〉闈㈡覆鏌撳悗鐨則able鏁版嵁杩涜鎺掑簭銆傚悓鏃讹紝杩欓噷鐨則rue 浼氬奖鍝嶉〉闈ort 涓婁笅灏忕澶寸殑 鏄剧ず鏁堟灉 , totalRow: true //, cellMinWidth: 90 @@ -432,6 +435,26 @@ soulTable.render(this); } }; + optionPage = { + elem: 'page', //娉ㄦ剰锛岃繖閲岀殑 page 鏄� ID锛屼笉鐢ㄥ姞 # 鍙� + count: 10000, //鏁版嵁鎬绘暟锛屼粠鏈嶅姟绔緱鍒� + limit: 50, + limits: [50, 500, 1000, 2000], + layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'], + jump: function (obj, first) { + //console.log(obj) + //obj鍖呭惈浜嗗綋鍓嶅垎椤电殑鎵�鏈夊弬鏁帮紝姣斿锛� + //console.log(obj.curr); //寰楀埌褰撳墠椤碉紝浠ヤ究鍚戞湇鍔$璇锋眰瀵瑰簲椤电殑鏁版嵁銆� + //console.log(obj.limit); //寰楀埌姣忛〉鏄剧ず鐨勬潯鏁� + + //棣栨涓嶆墽琛� + if (!first) { + //do something + get_FastQuery(); + } + } + } + laypage.render(optionPage); } //#endregion @@ -521,6 +544,67 @@ }); } + //鍒嗛〉 + function get_DisplayPage() { + var ajaxLoad = layer.load(); + //杩涘叆椤甸潰鏄剧ず鐨勭紦瀛樺垪琛� + $.ajax({ + url: GetWEBURL() + '/PM_WorkTaskBill/page', + type: "GET", + async: false, + data: { "sWhere": sWhere, "user": sessionStorage["HUserName"], "page": optionPage.curr, "size": optionPage.limit }, + success: function (data1) { + option.limit = optionPage.limit;//鏀瑰彉琛ㄦ牸椤靛ぇ灏� + if (data1.code == 1) { + optionPage.count = data1.count;//鏀瑰彉鍒楄〃鏁版嵁鎬绘暟 + var totalArray = ["璇勪及宸ユ椂", "鑷瘎宸ユ椂", "宸茶�楃敤宸ユ椂"]; + var data = []; + var col = []; + //缁欑┖鐨勬暟缁勮祴鍊� + for (var key in data1.list) { + data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType }); + } + //鍦ㄥ垪琛ㄥ乏杈规坊鍔犲嬀閫夋 + col.push({ type: 'checkbox', fixed: 'left' }); + for (var i = 0; i < data.length; i++) { + // if (data[i].name == 'HInterID' || data[i].name == 'HBillType' || data[i].name == 'hmainid') { + if ($.inArray(data[i].name, titleData) > -1) { + col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //闅愯棌id鍒� + } + else if ($.inArray(data[i].name, totalArray) > -1) { + col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, totalRow: true, width: 120 }); + } else { + switch (data[i].Type) { + //int + case 'DateTime': + col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd')}}</div>", width: 120 }); + break; + default: + col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 120 }); + } + } + } + option.cols = [col]; + option.data = data1.data; + laypage.render(optionPage); + table.render(option); + //鍒锋柊琛ㄦ牸鏁版嵁 + DisPlay_HideColumn(); + if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") { + ColFilter(); + } + layer.close(ajaxLoad); + } else { + layer.close(ajaxLoad); + layer.alert(data1.code + data1.Message, { icon: 5 }); + } + }, error: function () { + layer.close(ajaxLoad); + layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 }); + } + }); + } + //#endregion //#region 蹇�熻繃婊� @@ -635,7 +719,7 @@ sWhere += " and 鎺ュ崟浜� like '%" + HReceiveEmp + "%'"; } - get_Display(sWhere); + get_DisplayPage(sWhere); sWhere = "";//璋冪敤鎺ュ彛鍚庢竻绌簊Where缂撳瓨 } //#endregion diff --git "a/WebTM/views/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\344\275\234\344\273\273\345\212\241/PM_WorkTaskReportBillList.html" "b/WebTM/views/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\344\275\234\344\273\273\345\212\241/PM_WorkTaskReportBillList.html" index 82f8b0e..58dd2a2 100644 --- "a/WebTM/views/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\344\275\234\344\273\273\345\212\241/PM_WorkTaskReportBillList.html" +++ "b/WebTM/views/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\344\275\234\344\273\273\345\212\241/PM_WorkTaskReportBillList.html" @@ -171,6 +171,7 @@ </div> </div> <table class="" id="mainTable" lay-filter="mainTable"></table> + <div id="page" style="position: relative; bottom: 0;"></div> <script type="text/html" id="toolbarDemo"> <div class="layui-btn-container"> <button type="button" class="layui-btn layui-btn-sm" lay-event="set_AddNew"><i class="layui-icon layui-icon-file-b"></i>鏂板</button> @@ -187,7 +188,7 @@ <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Drop"><i class="layui-icon layui-icon-radio"></i>浣滃簾</button> <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-DeDrop"><i class="layui-icon layui-icon-radio"></i>鍙嶄綔搴�</button> <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Stop"><i class="layui-icon layui-icon-radio"></i>绂佺敤</button> - <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-DeStop"><i class="layui-icon layui-icon-radio"></i>鍙嶇鐢�</button>--> + <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-DeStop"><i class="layui-icon layui-icon-radio"></i>鍙嶇鐢�</button>--> <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Exit"><i class="layui-icon layui-icon-logout"></i>閫�鍑�</button> <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn"><i class="layui-icon layui-icon-form"></i>鍒楄缃�</button> <button type="button" class="layui-btn layui-btn-sm" lay-event="set_SaveScheme" id="set_SaveScheme"><i class="layui-icon layui-icon-template"></i>淇濆瓨鏂规</button> @@ -226,7 +227,7 @@ var option = []; var sWhere = ""; var HModName = "PM_WorkTaskReportBillList"; - + var optionPage = []; //#region 銆愬姩鎬佽幏鍙栨ā鍧楀悕绉般�� var HModuleType = "4754"; //閫氳繃鍗曟嵁绫诲瀷锛屼粠鏁版嵁搴撳姩鎬佽幏鍙栧崟鎹ā鍧楀懡鍚�,寮曠敤js鏂囦欢 PageTitle.js @@ -358,12 +359,14 @@ //#region 閲嶇疆鎸夐挳 form.on('submit(btnReSearch)', function (data) { + optionPage.curr = 1; set_ClearQuery(); }); //#endregion //#region 鏌ヨ鎸夐挳 form.on('submit(btnSearch)', function (data) { + optionPage.curr = 1; get_FastQuery(2); }); //#endregion @@ -395,7 +398,7 @@ elem: '#mainTable' , toolbar: '#toolbarDemo' , height: 'full-50' - , page: true + , page: false , totalRow: true //, cellMinWidth: 90 , limit: 50 @@ -404,6 +407,26 @@ soulTable.render(this); } }; + optionPage = { + elem: 'page', //娉ㄦ剰锛岃繖閲岀殑 page 鏄� ID锛屼笉鐢ㄥ姞 # 鍙� + count: 10000, //鏁版嵁鎬绘暟锛屼粠鏈嶅姟绔緱鍒� + limit: 50, + limits: [50, 500, 1000, 2000], + layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'], + jump: function (obj, first) { + //console.log(obj) + //obj鍖呭惈浜嗗綋鍓嶅垎椤电殑鎵�鏈夊弬鏁帮紝姣斿锛� + //console.log(obj.curr); //寰楀埌褰撳墠椤碉紝浠ヤ究鍚戞湇鍔$璇锋眰瀵瑰簲椤电殑鏁版嵁銆� + //console.log(obj.limit); //寰楀埌姣忛〉鏄剧ず鐨勬潯鏁� + + //棣栨涓嶆墽琛� + if (!first) { + //do something + get_FastQuery(); + } + } + } + laypage.render(optionPage); } //#endregion @@ -494,6 +517,68 @@ }); } + + //鍒嗛〉 + function get_DisplayPage(sWhere) { + var ajaxLoad = layer.load(); + //杩涘叆椤甸潰鏄剧ず鐨勭紦瀛樺垪琛� + $.ajax({ + url: GetWEBURL() + '/PM_WorkTaskReportBill/page', + type: "GET", + async: false, + data: { "sWhere": sWhere, "user": sessionStorage["HUserName"], "page": optionPage.curr, "size": optionPage.limit }, + success: function (data1) { + option.limit = optionPage.limit;//鏀瑰彉琛ㄦ牸椤靛ぇ灏� + if (data1.code == 1) { + optionPage.count = data1.count;//鏀瑰彉鍒楄〃鏁版嵁鎬绘暟 + var totalArray = ["璇勪及宸ユ椂", "鑷瘎宸ユ椂", "宸茶�楃敤宸ユ椂"]; + var data = []; + var col = []; + //缁欑┖鐨勬暟缁勮祴鍊� + for (var key in data1.list) { + data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType }); + } + //鍦ㄥ垪琛ㄥ乏杈规坊鍔犲嬀閫夋 + col.push({ type: 'checkbox', fixed: 'left' }); + for (var i = 0; i < data.length; i++) { + // if (data[i].name == 'HInterID' || data[i].name == 'HBillType' || data[i].name == 'hmainid') { + if ($.inArray(data[i].name, titleData) > -1) { + col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //闅愯棌id鍒� + } + else if ($.inArray(data[i].name, totalArray) > -1) { + col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, totalRow: true, width: 120 }); + } else { + switch (data[i].Type) { + //int + case 'DateTime': + col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd')}}</div>", width: 120 }); + break; + default: + col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 120 }); + } + } + } + option.cols = [col]; + option.data = data1.data; + laypage.render(optionPage); + table.render(option); + //鍒锋柊琛ㄦ牸鏁版嵁 + DisPlay_HideColumn(); + if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") { + ColFilter(); + } + layer.close(ajaxLoad); + } else { + layer.close(ajaxLoad); + layer.alert(data1.code + data1.Message, { icon: 5 }); + } + }, error: function () { + layer.close(ajaxLoad); + layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 }); + } + }); + } + //#endregion //#region 蹇�熻繃婊� @@ -611,7 +696,7 @@ sWhere += " and 姹囨姤浜� like '%" + HReportEmp + "%'"; } - get_Display(sWhere); + get_DisplayPage(sWhere); sWhere = "";//璋冪敤鎺ュ彛鍚庢竻绌簊Where缂撳瓨 } //#endregion diff --git "a/WebTM/views/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\347\250\213\351\241\271\347\233\256/PM_ProjectBill.html" "b/WebTM/views/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\347\250\213\351\241\271\347\233\256/PM_ProjectBill.html" index e4ec414..c0afe51 100644 --- "a/WebTM/views/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\347\250\213\351\241\271\347\233\256/PM_ProjectBill.html" +++ "b/WebTM/views/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\347\250\213\351\241\271\347\233\256/PM_ProjectBill.html" @@ -984,10 +984,10 @@ $('li[lay-id="3"]').hide(); $('li[lay-id="4"]').hide(); } else if (HBillSubType == "浠诲姟绫�") { - $('li[lay-id="2"]').hide(); + $('li[lay-id="2"]').first().hide(); $('li[lay-id="3"]').hide(); } else { - $('li[lay-id="2"]').hide(); + $('li[lay-id="2"]').first().hide(); $('li[lay-id="4"]').hide(); } //#region 銆愬姩鎬佽幏鍙栨ā鍧楀悕绉般�� @@ -2231,10 +2231,10 @@ $('li[lay-id="3"]').hide(); $('li[lay-id="4"]').hide(); } else if (HBillSubType == "浠诲姟绫�") { - $('li[lay-id="2"]').hide(); + $('li[lay-id="2"]').first().hide(); $('li[lay-id="3"]').hide(); } else { - $('li[lay-id="2"]').hide(); + $('li[lay-id="2"]').first().hide(); $('li[lay-id="4"]').hide(); } //涓昏〃 璧嬪�� diff --git "a/WebTM/views/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\347\250\213\351\241\271\347\233\256/PM_ProjectBillList.html" "b/WebTM/views/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\347\250\213\351\241\271\347\233\256/PM_ProjectBillList.html" index add7db4..78b1d58 100644 --- "a/WebTM/views/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\347\250\213\351\241\271\347\233\256/PM_ProjectBillList.html" +++ "b/WebTM/views/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\347\250\213\351\241\271\347\233\256/PM_ProjectBillList.html" @@ -101,6 +101,7 @@ </div> </div> <table class="" id="mainTable" lay-filter="mainTable"></table> + <div id="page" style="position: relative; bottom: 0;"></div> <script type="text/html" id="toolbarDemo"> <div class="layui-btn-container"> <button type="button" class="layui-btn layui-btn-sm" lay-event="set_AddNew"><i class="layui-icon layui-icon-file-b"></i>鏂板</button> @@ -117,7 +118,7 @@ <button type="button" class="layui-btn layui-btn-sm" lay-event="set_ProjectReport"><i class="layui-icon layui-icon-radio"></i>涓嬫帹(闃舵姹囨姤)</button> <button type="button" class="layui-btn layui-btn-sm" lay-event="set_WorkTask"><i class="layui-icon layui-icon-radio"></i>涓嬫帹(宸ヤ綔浠诲姟)</button> <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Stop"><i class="layui-icon layui-icon-radio"></i>绂佺敤</button> - <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-DeStop"><i class="layui-icon layui-icon-radio"></i>鍙嶇鐢�</button>--> + <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-DeStop"><i class="layui-icon layui-icon-radio"></i>鍙嶇鐢�</button>--> <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Exit"><i class="layui-icon layui-icon-logout"></i>閫�鍑�</button> <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn"><i class="layui-icon layui-icon-form"></i>鍒楄缃�</button> <button type="button" class="layui-btn layui-btn-sm" lay-event="set_SaveScheme" id="set_SaveScheme"><i class="layui-icon layui-icon-template"></i>淇濆瓨鏂规</button> @@ -148,7 +149,7 @@ var option = []; var sWhere = ""; var HModName = "PM_ProjectBillList"; - + var optionPage = []; //#region 銆愬姩鎬佽幏鍙栨ā鍧楀悕绉般�� var HModuleType = "4750"; //閫氳繃鍗曟嵁绫诲瀷锛屼粠鏁版嵁搴撳姩鎬佽幏鍙栧崟鎹ā鍧楀懡鍚�,寮曠敤js鏂囦欢 PageTitle.js @@ -284,12 +285,14 @@ //#region 閲嶇疆鎸夐挳 form.on('submit(btnReSearch)', function (data) { + optionPage.curr = 1; set_ClearQuery(); }); //#endregion //#region 鏌ヨ鎸夐挳 form.on('submit(btnSearch)', function (data) { + optionPage.curr = 1; get_FastQuery(2); }); //#endregion @@ -328,7 +331,7 @@ elem: '#mainTable' , toolbar: '#toolbarDemo' , height: 'full-50' - , page: true + , page: false , totalRow: true //, cellMinWidth: 90 , limit: 50 @@ -337,6 +340,26 @@ soulTable.render(this); } }; + optionPage = { + elem: 'page', //娉ㄦ剰锛岃繖閲岀殑 page 鏄� ID锛屼笉鐢ㄥ姞 # 鍙� + count: 10000, //鏁版嵁鎬绘暟锛屼粠鏈嶅姟绔緱鍒� + limit: 50, + limits: [50, 500, 1000, 2000], + layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'], + jump: function (obj, first) { + //console.log(obj) + //obj鍖呭惈浜嗗綋鍓嶅垎椤电殑鎵�鏈夊弬鏁帮紝姣斿锛� + //console.log(obj.curr); //寰楀埌褰撳墠椤碉紝浠ヤ究鍚戞湇鍔$璇锋眰瀵瑰簲椤电殑鏁版嵁銆� + //console.log(obj.limit); //寰楀埌姣忛〉鏄剧ず鐨勬潯鏁� + + //棣栨涓嶆墽琛� + if (!first) { + //do something + get_FastQuery(); + } + } + } + laypage.render(optionPage); } //#endregion @@ -427,6 +450,68 @@ }); } + //鍒嗛〉 + function get_DisplayPage(sWhere) { + var ajaxLoad = layer.load(); + //杩涘叆椤甸潰鏄剧ず鐨勭紦瀛樺垪琛� + $.ajax({ + url: GetWEBURL() + '/PM_ProjectBill/page', + type: "GET", + async: false, + data: { "sWhere": sWhere, "user": sessionStorage["HUserName"], "page": optionPage.curr, "size": optionPage.limit }, + success: function (data1) { + option.limit = optionPage.limit;//鏀瑰彉琛ㄦ牸椤靛ぇ灏� + if (data1.code == 1) { + optionPage.count = data1.count;//鏀瑰彉鍒楄〃鏁版嵁鎬绘暟 + var totalArray = ["鍚堝悓鎬婚噾棰�", "浜у搧璐�", "瀹炴柦璐�", "鍏跺畠璐圭敤", "鍚堝悓瀹炴柦浜哄ぉ", "棰勪及浜屾寮�鍙戜汉澶�", "缁撶畻閲戦", "闃舵涓氱哗鍗犳瘮"]; + var data = []; + var col = []; + //缁欑┖鐨勬暟缁勮祴鍊� + for (var key in data1.list) { + data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType }); + } + //鍦ㄥ垪琛ㄥ乏杈规坊鍔犲嬀閫夋 + col.push({ type: 'checkbox', fixed: 'left' }); + for (var i = 0; i < data.length; i++) { + // if (data[i].name == 'HInterID' || data[i].name == 'HBillType' || data[i].name == 'hmainid') { + if ($.inArray(data[i].name, titleData) > -1) { + col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //闅愯棌id鍒� + } + else if ($.inArray(data[i].name, totalArray) > -1) { + col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, totalRow: true, width: 120 }); + } else { + switch (data[i].Type) { + //int + case 'DateTime': + col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd')}}</div>", width: 120 }); + break; + default: + col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 120 }); + } + } + } + option.cols = [col]; + option.data = data1.data; + laypage.render(optionPage); + table.render(option); + //鍒锋柊琛ㄦ牸鏁版嵁 + DisPlay_HideColumn(); + if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") { + ColFilter(); + } + layer.close(ajaxLoad); + } else { + layer.close(ajaxLoad); + layer.alert(data1.code + data1.Message, { icon: 5 }); + } + }, error: function () { + layer.close(ajaxLoad); + layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 }); + } + }); + } + + //#endregion //#region 鍙屽嚮杩斿洖鏁版嵁 @@ -495,8 +580,8 @@ sWhere += " and 椤圭洰缁忕悊 = '" + UserName + "' and 鍗曟嵁鐘舵�� != '宸插叧闂�' "; } } - addSWhereByOpenType(); - get_Display(sWhere); + //addSWhereByOpenType(); + get_DisplayPage(sWhere); sWhere = "";//璋冪敤鎺ュ彛鍚庢竻绌簊Where缂撳瓨 } //#endregion @@ -992,17 +1077,18 @@ var openType = params[params[0]]; //浠庡弬鏁颁腑鑾峰彇 鎵撳紑鏂瑰紡 1鐩存帴鎵撳紑 2鍏跺畠椤甸潰閫氳繃閫夋嫨鎸夐挳鎵撳紑 var HOrgID = params[params[1]]; HBillSubType = (decodeURI(params[params[2]]) != "宸ョ▼绫�" && decodeURI(params[params[2]]) != "浠诲姟绫�") ? "椤圭洰绫�" : decodeURI(params[params[2]]);//鑻ヨВ鐮佸悗type涓嶄负宸ョ▼鎴栦换鍔″己鍒跺彉涓洪」鐩� + if (HBillSubType == "宸ョ▼绫�") { + sWhere += " and 鍗曟嵁瀛愮被鍨�='宸ョ▼绫�' " + } else if (HBillSubType == "浠诲姟绫�") { + sWhere += " and 鍗曟嵁瀛愮被鍨�='浠诲姟绫�' " + } if (openType == 2) { sWhere += " and ISNULL(鍏抽棴浜�,'') = '' and ISNULL(浣滃簾浜�,'') = '' "; - if (HBillSubType == "宸ョ▼绫�") { - sWhere += " and 鍗曟嵁瀛愮被鍨�='宸ョ▼绫�' " - } else if (HBillSubType == "浠诲姟绫�") { - sWhere += " and 鍗曟嵁瀛愮被鍨�='浠诲姟绫�' " - } $("#HOrgID").val(HOrgID); form.render("select"); return true; } + return false; } //#endregion @@ -1045,7 +1131,7 @@ //闅愯棌鏄剧ず杩囨护鏂规鐨勬爣绛句俊鎭� document.getElementById("HFilterScheme_Now").style.display = "none"; //鎵ц鏌ヨ鏂规硶 - get_FastQuery(); + //get_FastQuery(); form.render("select"); } }, error: function () { diff --git "a/WebTM/views/\351\242\206\346\226\231\345\217\221\350\264\247/\351\224\200\345\224\256\345\207\272\345\272\223/Kf_SellOutBill.html" "b/WebTM/views/\351\242\206\346\226\231\345\217\221\350\264\247/\351\224\200\345\224\256\345\207\272\345\272\223/Kf_SellOutBill.html" index eb5052c..ffe9c0d 100644 --- "a/WebTM/views/\351\242\206\346\226\231\345\217\221\350\264\247/\351\224\200\345\224\256\345\207\272\345\272\223/Kf_SellOutBill.html" +++ "b/WebTM/views/\351\242\206\346\226\231\345\217\221\350\264\247/\351\224\200\345\224\256\345\207\272\345\272\223/Kf_SellOutBill.html" @@ -3144,53 +3144,114 @@ var iframeWindow = window["layui-layer-iframe" + index];//鑾峰彇寮规椤甸潰 var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//鑾峰彇閫変腑鐨勬暟鎹� - if (checkStatus.data.length != 1) { - return layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�"); + if (checkStatus.data.length < 1) { + return layer.msg("璇烽�夋嫨鑷冲皯涓�鏉℃暟鎹�"); } - + var HTaxRate = 0; + //閫氳繃渚涘簲鍟唅d鑾峰彇绋庣巼 var HSupID = $("#HSupID").val(); if (HSupID != 0) { $.ajax({ url: GetWEBURL() + "/Gy_Customer/xg", type: "GET", + async: false, data: { "HInterID": HSupID }, success: function (d) { - var HTaxRate = parseInt(d.data[0].澧炲�肩◣鐜�) * 0.01; - //鏁版嵁鏍¢獙鍚堟牸锛岄噸绠楄褰� - var HQty = obj.data.HQty * 1; //鏁伴噺 - var HPrice = obj.data.HPrice * 1; //鍗曚环 - var HMoney = HQty * HPrice; //閲戦=鏁伴噺*鍗曚环 - var HTaxMoney = Number((HMoney * HTaxRate).toFixed(4)); //绋庨=閲戦*绋庣巼 - var HlineTotal = HMoney + HTaxMoney; //浠风◣鍚堣=閲戦+绋庨 - var HTaxPrice = Number((HPrice * (1 + HTaxRate)).toFixed(4)); //鍚◣鍗曚环=鍗曚环*(1+绋庣巼) - obj.update({ //鏇存柊琛ㄦ牸鏁版嵁 - "HMaterID": checkStatus.data[0].HItemID - , "鐗╂枡浠g爜": checkStatus.data[0].鐗╂枡浠g爜 - , "鐗╂枡鍚嶇О": checkStatus.data[0].鐗╂枡鍚嶇О - , "瑙勬牸鍨嬪彿": checkStatus.data[0].瑙勬牸鍨嬪彿 - , "HUnitID": checkStatus.data[0].HUnitID - , "璁¢噺鍗曚綅": checkStatus.data[0].璁¢噺鍗曚綅鍚嶇О - , "HTaxRate": HTaxRate * 100 - , HQty: HQty //鏇存柊HQty瀛楁锛孒Qty - , HPrice: HPrice //鏇存柊HPrice瀛楁锛孒Price - , HMoney: HMoney //鏇存柊HMoney瀛楁锛孒Money - , HTaxMoney: HTaxMoney //鏇存柊HTaxMoney瀛楁锛孒TaxMoney - , HlineTotal: HlineTotal //鏇存柊HlineTotal瀛楁锛孒lineTotal - , HTaxPrice, HTaxPrice //鏇存柊HTaxPrice瀛楁锛孒TaxPrice - }) + HTaxRate = parseInt(d.data[0].澧炲�肩◣鐜�) * 0.01; } }); + } + if (checkStatus.data.length > 1) { + var rowIndex = $(obj.tr).attr("data-index") * 1; + for (var i = 0; i < checkStatus.data.length; i++) { + if (rowIndex + i >= option.data.length) { + var NewRow = { + "HMaterID": "0" + , "鐗╂枡浠g爜": "" + , "鐗╂枡鍚嶇О": "" + , "瑙勬牸鍨嬪彿": "" + , "HUnitID": "0" + , "璁¢噺鍗曚綅": "" + , "HQtyMust": "0" + , "HQty": "0" + , "HPieceQty": "0" + , "HPrice": "0" + , "HTaxPrice": "0" + , "HTaxRate": "0" + , "HMoney": "0" + , "HTaxMoney": "0" + , "HWHID": $("#HWHID").val() + , "鍙戣揣浠撳簱": $("#HWHName").val() + , "HRemark": "" + + , "HQty_Full": "0" + , "HQty_Empty": "0" + , "HQty_Back": "0" + , "HCostPrice": "0" + , "HCostMoney": "0" + , "HSalePrice": "0" + + , "HSeOrderInterID": 0 + , "HSeOrderEntryID": 0 + , "HSeOrderBillNo": "" + + , "HSourceInterID": "0" + , "HSourceEntryID": "0" + , "HSourceBillNo": "" + , "HSourceBillType": "" + , "HRelationQty": "0" + , "HRelationMoney": "0" + + , 'HSPID': "0" + , 'HSPName': "" + , 'HSPGroupID': "0" + , "HSPGroupName": "" + , 'HSCWHID': "0" + , 'HSCWHName': "" + , 'HSCSPID': "0" + , 'HSCSPName': "" + , 'HBatchNo': "" + , 'HPOOrderInterID': "0" + , 'HPOOrderEntryID': "0" + , 'HPOOrderBillNo': "" + + , 'HPropertyID': "0" + , 'HPropertyName': "" + , 'HSecUnitID': "0" + , 'HSecUnitName': "" + , 'HSecUnitRate': "0" + + + , 'HEngineNum': "" + , 'HUnderPanNum': "" + , 'HLeaveFactCard': "" + }; + table.cache["mainTable"].push(NewRow); + option.data = table.cache["mainTable"]; + table.render(option); + } + var HQty = option.data[rowIndex + i].HQty * 1; //鏁伴噺 + var HPrice = option.data[rowIndex + i].HPrice * 1; //鍗曚环 + var HMoney = HQty * HPrice; //閲戦=鏁伴噺*鍗曚环 + var HTaxMoney = Number((HMoney * HTaxRate).toFixed(4)); //绋庨=閲戦*绋庣巼 + var HlineTotal = HMoney + HTaxMoney; //浠风◣鍚堣=閲戦+绋庨 + var HTaxPrice = Number((HPrice * (1 + HTaxRate)).toFixed(4)); //鍚◣鍗曚环=鍗曚环*(1+绋庣巼) + option.data[rowIndex + i].HMaterID = checkStatus.data[i].HItemID; + option.data[rowIndex + i].鐗╂枡浠g爜 = checkStatus.data[i].鐗╂枡浠g爜; + option.data[rowIndex + i].鐗╂枡鍚嶇О = checkStatus.data[i].鐗╂枡鍚嶇О; + option.data[rowIndex + i].瑙勬牸鍨嬪彿 = checkStatus.data[i].瑙勬牸鍨嬪彿; + option.data[rowIndex + i].HUnitID = checkStatus.data[i].HUnitID; + option.data[rowIndex + i].璁¢噺鍗曚綅 = checkStatus.data[i].璁¢噺鍗曚綅鍚嶇О; + option.data[rowIndex + i].HTaxMoney = HTaxMoney; + option.data[rowIndex + i].HlineTotal = HlineTotal; + option.data[rowIndex + i].HTaxPrice = HTaxPrice; + + } + table.render(option); } else { - obj.update({ //鏇存柊琛ㄦ牸鏁版嵁 - "HMaterID": checkStatus.data[0].HItemID - , "鐗╂枡浠g爜": checkStatus.data[0].鐗╂枡浠g爜 - , "鐗╂枡鍚嶇О": checkStatus.data[0].鐗╂枡鍚嶇О - , "瑙勬牸鍨嬪彿": checkStatus.data[0].瑙勬牸鍨嬪彿 - , "HUnitID": checkStatus.data[0].HUnitID - , "璁¢噺鍗曚綅": checkStatus.data[0].璁¢噺鍗曚綅鍚嶇О - }) + HDataTemp = checkStatus.data[0]; } layer.close(index);//鍏抽棴寮圭獥 @@ -3384,21 +3445,121 @@ var iframeWindow = window["layui-layer-iframe" + index];//鑾峰彇寮规椤甸潰 var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//鑾峰彇閫変腑鐨勬暟鎹� - if (checkStatus.data.length != 1) { - return layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�"); + if (checkStatus.data.length < 1) { + return layer.msg("璇烽�夋嫨鑷冲皯涓�鏉℃暟鎹�"); } + var HTaxRate = 0; + //閫氳繃渚涘簲鍟唅d鑾峰彇绋庣巼 + var HSupID = $("#HSupID").val(); + if (HSupID != 0) { + $.ajax({ + url: GetWEBURL() + "/Gy_Customer/xg", + type: "GET", + async: false, + data: { + "HInterID": HSupID + }, + success: function (d) { + HTaxRate = parseInt(d.data[0].澧炲�肩◣鐜�) * 0.01; + } + }); + } + if (checkStatus.data.length > 1) { + var rowIndex = $(obj.tr).attr("data-index") * 1; + for (var i = 0; i < checkStatus.data.length; i++) { + if (rowIndex + i >= option.data.length) { + var NewRow = { + "HMaterID": "0" + , "鐗╂枡浠g爜": "" + , "鐗╂枡鍚嶇О": "" + , "瑙勬牸鍨嬪彿": "" + , "HUnitID": "0" + , "璁¢噺鍗曚綅": "" + , "HQtyMust": "0" + , "HQty": "0" + , "HPieceQty": "0" + , "HPrice": "0" + , "HTaxPrice": "0" + , "HTaxRate": "0" + , "HMoney": "0" + , "HTaxMoney": "0" + , "HWHID": $("#HWHID").val() + , "鍙戣揣浠撳簱": $("#HWHName").val() + , "HRemark": "" - HDataTemp = checkStatus.data[0]; + , "HQty_Full": "0" + , "HQty_Empty": "0" + , "HQty_Back": "0" + , "HCostPrice": "0" + , "HCostMoney": "0" + , "HSalePrice": "0" + + , "HSeOrderInterID": 0 + , "HSeOrderEntryID": 0 + , "HSeOrderBillNo": "" + + , "HSourceInterID": "0" + , "HSourceEntryID": "0" + , "HSourceBillNo": "" + , "HSourceBillType": "" + , "HRelationQty": "0" + , "HRelationMoney": "0" + + , 'HSPID': "0" + , 'HSPName': "" + , 'HSPGroupID': "0" + , "HSPGroupName": "" + , 'HSCWHID': "0" + , 'HSCWHName': "" + , 'HSCSPID': "0" + , 'HSCSPName': "" + , 'HBatchNo': "" + , 'HPOOrderInterID': "0" + , 'HPOOrderEntryID': "0" + , 'HPOOrderBillNo': "" + + , 'HPropertyID': "0" + , 'HPropertyName': "" + , 'HSecUnitID': "0" + , 'HSecUnitName': "" + , 'HSecUnitRate': "0" + + + , 'HEngineNum': "" + , 'HUnderPanNum': "" + , 'HLeaveFactCard': "" + }; + table.cache["mainTable"].push(NewRow); + option.data = table.cache["mainTable"]; + table.render(option); + } + var HQty = option.data[rowIndex + i].HQty * 1; //鏁伴噺 + var HPrice = option.data[rowIndex + i].HPrice * 1; //鍗曚环 + var HMoney = HQty * HPrice; //閲戦=鏁伴噺*鍗曚环 + var HTaxMoney = Number((HMoney * HTaxRate).toFixed(4)); //绋庨=閲戦*绋庣巼 + var HlineTotal = HMoney + HTaxMoney; //浠风◣鍚堣=閲戦+绋庨 + var HTaxPrice = Number((HPrice * (1 + HTaxRate)).toFixed(4)); //鍚◣鍗曚环=鍗曚环*(1+绋庣巼) + option.data[rowIndex + i].HMaterID = checkStatus.data[i].HItemID; + option.data[rowIndex + i].鐗╂枡浠g爜 = checkStatus.data[i].鐗╂枡浠g爜; + option.data[rowIndex + i].鐗╂枡鍚嶇О = checkStatus.data[i].鐗╂枡鍚嶇О; + option.data[rowIndex + i].瑙勬牸鍨嬪彿 = checkStatus.data[i].瑙勬牸鍨嬪彿; + option.data[rowIndex + i].HUnitID = checkStatus.data[i].HUnitID; + option.data[rowIndex + i].璁¢噺鍗曚綅 = checkStatus.data[i].璁¢噺鍗曚綅鍚嶇О; + option.data[rowIndex + i].HTaxMoney = HTaxMoney; + option.data[rowIndex + i].HlineTotal = HlineTotal; + option.data[rowIndex + i].HTaxPrice = HTaxPrice; + + } + table.render(option); + } else { + HDataTemp = checkStatus.data[0]; + } layer.close(index);//鍏抽棴寮圭獥 } , end: function () { if (typeof (HDataTemp.HItemID) != "undefined") { //閫氳繃渚涘簲鍟唅d鑾峰彇绋庣巼 - var Dec = getDecByMaterID(obj.data.HMaterID) //鑾峰彇绮惧害 - var HQtyDec = (Dec["HQtyDec"] == null || Dec["HQtyDec"] == 0) ? 4 : Dec["HQtyDec"]; //鏁伴噺绮惧害 - var HPriceDec = (Dec["HPriceDec"] == null || Dec["HPriceDec"] == 0) ? 4 : Dec["HPriceDec"]; //鍗曚环绮惧害 - var HMoneyDec = (Dec["HMoneyDec"] == null || Dec["HMoneyDec"] == 0) ? 2 : Dec["HMoneyDec"]; //閲戦绮惧害 var HSupID = $("#HSupID").val(); if (HSupID != 0) { $.ajax({ @@ -3414,14 +3575,9 @@ var HQty = obj.data.HQty * 1; //鏁伴噺 var HPrice = obj.data.HPrice * 1; //鍗曚环 var HMoney = HQty * HPrice; //閲戦=鏁伴噺*鍗曚环 - var HTaxMoney = HMoney * (1 + HTaxRate); - var HTaxPrice = Number((HPrice * (1 + HTaxRate))); //鍚◣鍗曚环=鍗曚环*(1+绋庣巼) - //鏁板瓧绮惧害 - HQty = Number(HQty.toFixed(HQtyDec)); - HPrice = Number(HPrice.toFixed(HPriceDec)); - HMoney = Number(HMoney.toFixed(HMoneyDec)); - HTaxMoney = Number(HTaxMoney.toFixed(HMoneyDec)); - HTaxPrice = Number(HTaxPrice.toFixed(HPriceDec)); + var HTaxMoney = Number((HMoney * HTaxRate).toFixed(4)); //绋庨=閲戦*绋庣巼 + var HlineTotal = HMoney + HTaxMoney; //浠风◣鍚堣=閲戦+绋庨 + var HTaxPrice = Number((HPrice * (1 + HTaxRate)).toFixed(4)); //鍚◣鍗曚环=鍗曚环*(1+绋庣巼) obj.update({ //鏇存柊琛ㄦ牸鏁版嵁 "HMaterID": HDataTemp.HItemID , "鐗╂枡浠g爜": HDataTemp.鐗╂枡浠g爜 @@ -3434,7 +3590,8 @@ , HPrice: HPrice //鏇存柊HPrice瀛楁锛孒Price , HMoney: HMoney //鏇存柊HMoney瀛楁锛孒Money , HTaxMoney: HTaxMoney //鏇存柊HTaxMoney瀛楁锛孒TaxMoney - , HTaxPrice: HTaxPrice //鏇存柊HTaxPrice瀛楁锛孒TaxPrice + , HlineTotal: HlineTotal //鏇存柊HlineTotal瀛楁锛孒lineTotal + , HTaxPrice, HTaxPrice //鏇存柊HTaxPrice瀛楁锛孒TaxPrice }) } }); diff --git "a/WebTM/views/\351\242\206\346\226\231\345\217\221\350\264\247/\351\224\200\345\224\256\345\207\272\345\272\223/Kf_SellOutBillList.html" "b/WebTM/views/\351\242\206\346\226\231\345\217\221\350\264\247/\351\224\200\345\224\256\345\207\272\345\272\223/Kf_SellOutBillList.html" index 8394e47..576797e 100644 --- "a/WebTM/views/\351\242\206\346\226\231\345\217\221\350\264\247/\351\224\200\345\224\256\345\207\272\345\272\223/Kf_SellOutBillList.html" +++ "b/WebTM/views/\351\242\206\346\226\231\345\217\221\350\264\247/\351\224\200\345\224\256\345\207\272\345\272\223/Kf_SellOutBillList.html" @@ -260,7 +260,7 @@ //鏌ヨ鏉′欢 var sWhere = ""; var option = []; - + var optionPage = []; var HModName = "Kf_SellOutBillList"; var HBillType = "1205"; var HBillSubType = ""; @@ -408,7 +408,7 @@ break; //闅愯棌鍒楄缃� case 'HideColumn': - get_HideColumn(); + get_HideColumn(HModName, sessionStorage["HUserName"], option, optionPage, get_FastQuery); break; //鎸夐挳璁剧疆 case 'set_HideButton': @@ -547,7 +547,6 @@ DisPlay_HideColumn_GetPageSize(HModName, sessionStorage["HUserName"], optionPage); //鏌ヨ get_FastQuery(table, option); - DisPlay_HideColumn(); //鏌ヨ褰撳墠鐧诲綍鐢ㄦ埛鏈夋病鏈夊湪褰撳墠妯″潡璁剧疆榛樿杩囨护鏂规 get_DefaultModule(); } @@ -870,14 +869,13 @@ } } - - - option.data = result; - ins = table.render(option); laypage.render(optionPage); - DisPlay_HideColumn(); + //鍒楄缃� + DisPlay_HideColumn(HModName, sessionStorage["HUserName"], option); + //琛ㄦ牸鍔犺浇蹇呴渶鍦ㄦ寜閽樉绀哄墠 + ins = table.render(option); //鍒锋柊鎸夐挳鏄剧ず var btns = document.getElementsByTagName("button"); //鑾峰彇鏈〉鎵�鏈夋寜閽璞� Display_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]); @@ -897,8 +895,6 @@ layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 }); } }); - - DisPlay_HideColumn(); layer.close(wait); } @@ -1765,138 +1761,6 @@ } //#endregion - //#region 闅愯棌鍒楄缃� - function get_HideColumn() { - var colName = ""; - for (var i = 1; i < option.cols[0].length - 1; i++) { - colName += option.cols[0][i]["field"] + ","; - } - - colName = encodeURI(colName.substring(0, colName.length - 1));//瀵� URI 杩涜缂栫爜 - layer.open({ - type: 2 - , skin: "layui-layer-rim" //鍔犱笂杈规 - , title: "闅愯棌鍒楄缃�" //鏍囬 - , closeBtn: 1 //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡 - , shift: 2 //寮瑰嚭鍔ㄧ敾 - , area: ["50%", "90%"] //绐椾綋澶у皬 - , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀� - , content: ['../../鍩虹璧勬枡/闅愯棌鍒楄缃�/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName, "yes"] - , btn: ["纭畾", "鍙栨秷"] - , btn1: function (index, laero) { - //鍒濆鍖栭〉澶у皬 - DisPlay_HideColumn_GetPageSize(HModName, sessionStorage["HUserName"], optionPage); - //鐩存帴鎵ц鍒楄〃绛涢�� 鍔犺浇鏁版嵁鍒扮綉鏍� - get_FastQuery(table, option); - //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹� - layer.close(index);//鍏抽棴寮圭獥 - } - }) - } - //#endregion - - //#region 鏄剧ず鍒楁暟鎹� - function DisPlay_HideColumn() { - $.ajax({ - url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList', - async: false, - type: "GET", - async: false, - data: { "HModName": HModName, "user": sessionStorage["HUserName"] }, - success: function (data1) { - if (data1.data.length != 0) { - - var dataCol = [];//鏁版嵁搴撴煡璇㈠嚭鐨勫垪鏁版嵁 - //var titleData = ["hmainid", "hsupid", "HEmpID", "hmanagerid", "hsecmanagerid", "鍙戣揣浜�", "hkeeperid", "淇濈鍛�", "HDeptID", "閿�鍞柟寮�", "hsubid", "hmaterid","hunitid", "HWHID"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞� - - dataCol = data1.data[0].HGridString.split(','); - - for (var i = 0; i < option.cols[0].length - 2; i++) { - if (dataCol.length <= i) { - break; - } - var dataCols = dataCol[i].split('|'); - //闅愯棌鍒� - if (dataCols[1] == 1) { - option.cols[0][i + 1]["hide"] = true; - } - //璁剧疆鍐呭瀛椾綋澶у皬 - if (data1.data[0].HFontSize != 0) { - option.cols[0][i + 1]["style"] = "font-size:" + data1.data[0].HFontSize + "px;"; - } else { - option.cols[0][i + 1]["style"] = "font-size:100%"; - } - //璁剧疆鍒楀 - if (dataCols[3] > 0) { - option.cols[0][i + 1]["width"] = dataCols[3]; - } - //鏄剧ず鍒� - if (dataCols[1] == 0 && $.inArray(option.cols[0][i + 1]["title"], titleData) == -1) { - option.cols[0][i + 1]["hide"] = false; - } - //瀛椾綋鎵�鍦ㄤ綅缃�(宸� 灞呬腑 鍙�) - switch (dataCols[2]) { - case "L": - option.cols[0][i + 1]["align"] = "left"; - break; - case "M": - option.cols[0][i + 1]["align"] = "center"; - break; - case "R": - option.cols[0][i + 1]["align"] = "right"; - break; - } - - //璁剧疆琛ㄦ牸title灞炴�ф樉绀哄埆鍚� - //if (dataCols[4] != null && dataCols[4] != "") { - // option.cols[0][i + 1]["title"] = dataCols[4]; - //} - } - - //鍙栨秷鍐荤粨鍒� - for (var i = 1; i < option.cols[0].length - 1; i++) { - if (option.cols[0][i]["fixed"] != null) { - option.cols[0][i]["fixed"] = null; - } - else { - break; - } - } - //鍐荤粨鍒� - if (data1.data[0].HFixCols != 0) { - for (var i = 0; i < data1.data[0].HFixCols; i++) { - if ($.inArray(option.cols[0][i + 1]["title"], titleData) != -1) { - data1.data[0].HFixCols += 1; - } - option.cols[0][i + 1]["fixed"] = "left"; - } - } - //璁剧疆鍒楁帓搴� - for (var i = 1; i < option.cols[0].length; i++) { - if (data1.data[0].HSortFlag == "鏄�") { - option.cols[0][i]["sort"] = true; - } - else { - option.cols[0][i]["sort"] = false; - } - } - table.render(option); - //鍒锋柊鎸夐挳鏄剧ず - var btns = document.getElementsByTagName("button"); //鑾峰彇鏈〉鎵�鏈夋寜閽璞� - Display_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]); - } else { - table.render(option); - //鍒锋柊鎸夐挳鏄剧ず - var btns = document.getElementsByTagName("button"); //鑾峰彇鏈〉鎵�鏈夋寜閽璞� - Display_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]); - } - }, error: function () { - layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 }); - } - }) - } - //#endregion - //#region 鍒楁槑鏄剧ず涓嬫媺妗� function ColFilter() { var Organization = '<option value="0" selected="selected" ></option>'; @@ -1990,12 +1854,11 @@ if (openType == 2) { addSWhere = " and 鐘舵�� = '宸插鏍�' and HOrgID = " + HOrgID; - if (HBillSubType == "宸ョ▼绫�") { - addSWhere += "and HBillSubType='宸ョ▼绫�'" - } else if (HBillSubType == "浠诲姟绫�") { - addSWhere += "and HBillSubType='浠诲姟绫�'" - } - + } + if (HBillSubType == "宸ョ▼绫�") { + addSWhere += "and HBillSubType='宸ョ▼绫�'" + } else if (HBillSubType == "浠诲姟绫�") { + addSWhere += "and HBillSubType='浠诲姟绫�'" } return addSWhere; } diff --git "a/WebTM/views/\351\252\214\346\224\266\345\205\245\345\272\223/\345\244\226\350\264\255\345\205\245\345\272\223/Kf_POStockInBillList.html" "b/WebTM/views/\351\252\214\346\224\266\345\205\245\345\272\223/\345\244\226\350\264\255\345\205\245\345\272\223/Kf_POStockInBillList.html" index 12b2ec1..cb2a817 100644 --- "a/WebTM/views/\351\252\214\346\224\266\345\205\245\345\272\223/\345\244\226\350\264\255\345\205\245\345\272\223/Kf_POStockInBillList.html" +++ "b/WebTM/views/\351\252\214\346\224\266\345\205\245\345\272\223/\345\244\226\350\264\255\345\205\245\345\272\223/Kf_POStockInBillList.html" @@ -1641,11 +1641,11 @@ if (openType == 2) { addSWhere = " and 鐘舵�� = '宸插鏍�' and 琛岀姸鎬� = '' and HOrgID = " + HOrgID; - if (HBillSubType == "宸ョ▼绫�") { - addSWhere += "and HBillSubType='宸ョ▼绫�'" - } else if (HBillSubType == "浠诲姟绫�") { - addSWhere += "and HBillSubType='浠诲姟绫�'" - } + } + if (HBillSubType == "宸ョ▼绫�") { + addSWhere += "and HBillSubType='宸ョ▼绫�'" + } else if (HBillSubType == "浠诲姟绫�") { + addSWhere += "and HBillSubType='浠诲姟绫�'" } return addSWhere; } -- Gitblit v1.9.1