From b28c9a27dfefb67600192dcd587efdf0cf64cc98 Mon Sep 17 00:00:00 2001 From: yusijie <ysj@hz-kingdee.com> Date: 星期二, 24 九月 2024 10:00:38 +0800 Subject: [PATCH] 不同订单类型不能合并下推送货单;设置默认打印模板;一键打印 --- WebSRM/layuiAdmin.std-v1.2.1/src/views/SRM/SRM_POInStockBackBillList.html | 388 +++++++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 318 insertions(+), 70 deletions(-) diff --git a/WebSRM/layuiAdmin.std-v1.2.1/src/views/SRM/SRM_POInStockBackBillList.html b/WebSRM/layuiAdmin.std-v1.2.1/src/views/SRM/SRM_POInStockBackBillList.html index bbfb7b0..e198907 100644 --- a/WebSRM/layuiAdmin.std-v1.2.1/src/views/SRM/SRM_POInStockBackBillList.html +++ b/WebSRM/layuiAdmin.std-v1.2.1/src/views/SRM/SRM_POInStockBackBillList.html @@ -30,7 +30,7 @@ <div class="layui-card-body"> <form class="layui-form" action=""> <div class="layui-form-item"> - <div class="layui-inline"> + <div class="layui-inline" style="display:none;"> <label class="layui-form-label">璁㈠崟鐘舵��</label> <div class="layui-input-block"> <select name="HStatus" id="HStatus" lay-filter=""> @@ -38,40 +38,6 @@ <option value="鏈‘璁�">鏈‘璁�</option> <option value="宸茬‘璁�">宸茬‘璁�</option> <option value="宸查┏鍥�">宸查┏鍥�</option> - </select> - </div> - </div> - <div class="layui-inline"> - <label class="layui-form-label">鍗曟嵁鍙�</label> - <div class="layui-input-block"> - <input type="text" class="layui-input" name="HBillNo" id="HBillNo"> - </div> - </div> - <div class="layui-inline"> - <label class="layui-form-label">鐗╂枡浠g爜</label> - <div class="layui-input-block"> - <input type="text" class="layui-input" name="HNumber" id="HNumber"> - </div> - </div> - <div class="layui-inline"> - <label class="layui-form-label">浜у搧鍚嶇О</label> - <div class="layui-input-block"> - <input type="text" class="layui-input" name="HName" id="HName"> - </div> - </div> - <div class="layui-inline"> - <label class="layui-form-label">瑙勬牸鍨嬪彿</label> - <div class="layui-input-block"> - <input type="text" class="layui-input" name="HModel" id="HModel"> - </div> - </div> - <div class="layui-inline"> - <label class="layui-form-label">鍏抽棴鐘舵��</label> - <div class="layui-input-block"> - <select id="HClStatus" name="HClStatus" lay-filter=""> - <option value="">鍏ㄩ儴</option> - <option value="鏈叧闂�" selected="">鏈叧闂�</option> - <option value="宸插叧闂�">宸插叧闂�</option> </select> </div> </div> @@ -87,16 +53,73 @@ <input type="text" class="layui-input" name="HDate2" id="HDate2"> </div> </div> - <div class="layui-inline"> - <label class="layui-form-label">閲囪喘缁勭粐</label> + <label class="layui-form-label">鐗╂枡缂栫爜</label> <div class="layui-input-block"> - <select id="HPURCHASEORGID" name="HPURCHASEORGID" lay-filter=""> - <option value="">缁勭粐1</option> - <option value="">缁勭粐2</option> + <input type="text" class="layui-input" name="HNumber" id="HNumber"> + </div> + </div> + <div class="layui-inline"> + <label class="layui-form-label">渚涘簲鍟嗗搴旂墿鏂欎唬鐮�</label> + <div class="layui-input-block"> + <input type="text" class="layui-input" name="HSupNumber" id="HSupNumber" style="margin-top:10px"> + </div> + </div> + <div class="layui-inline"> + <label class="layui-form-label">瑙勬牸鍨嬪彿</label> + <div class="layui-input-block"> + <input type="text" class="layui-input" name="HModel" id="HModel"> + </div> + </div> + <div class="layui-inline"> + <label class="layui-form-label">閫�鏂欐柟寮�</label> + <div class="layui-input-block" style="width:185px;"> + <select id="HReturnMethod" name="HReturnMethod" lay-filter=""> + <option value="" selected="">鍏ㄩ儴</option> + <option value="閫�鏂欒ˉ鏂�">閫�鏂欒ˉ鏂�</option> + <option value="閫�鏂欏苟鎵f">閫�鏂欏苟鎵f</option> </select> </div> </div> + <div class="layui-inline"> + <label class="layui-form-label">渚涘簲鍟�</label> + <div class="layui-input-block"> + <input type="text" class="layui-input" name="HSupName" id="HSupName"> + </div> + </div> + + <div class="layui-inline" style="display:none;"> + <label class="layui-form-label">鍗曟嵁鍙�</label> + <div class="layui-input-block"> + <input type="text" class="layui-input" name="HBillNo" id="HBillNo"> + </div> + </div> + + <div class="layui-inline" style="display:none;"> + <label class="layui-form-label">浜у搧鍚嶇О</label> + <div class="layui-input-block"> + <input type="text" class="layui-input" name="HName" id="HName"> + </div> + </div> + + <div class="layui-inline" style="display:none;"> + <label class="layui-form-label">鍏抽棴鐘舵��</label> + <div class="layui-input-block"> + <select id="HClStatus" name="HClStatus" lay-filter=""> + <option value="" selected="">鍏ㄩ儴</option> + <option value="鏈叧闂�">鏈叧闂�</option> + <option value="宸插叧闂�">宸插叧闂�</option> + </select> + </div> + </div> + + <div class="layui-inline" style="display:none;"> + <label class="layui-form-label">閫�鏂欑粍缁�</label> + <div class="layui-input-block"> + <select id="HSTOCKORGID" name="HSTOCKORGID" lay-filter=""> + </select> + </div> + </div> <div class="layui-inline"> <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="f_Query"> <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i> @@ -112,12 +135,13 @@ <script type="text/html" id="toolbarDemo"> <div class="layui-btn-container"> <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-getCheckData"><i class="layui-icon layui-icon-tips"></i>棰勮</button>--> - <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-reload"><i class="layui-icon layui-icon-refresh"></i>鍒锋柊</button> + <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-reload"><i class="layui-icon layui-icon-refresh"></i>鍒锋柊</button>--> <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-confirm"><i class="layui-icon layui-icon-ok-circle"></i>纭鏀惰揣</button> <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-back"><i class="layui-icon layui-icon-close-fill"></i>鏀惰揣寮傚父</button>--> <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-details"><i class="layui-icon layui-icon-form"></i>璇︽儏</button>--> <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-print"><i class="layui-icon layui-icon-print"></i>鎵撳嵃閫�璐у崟</button> <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-generate"><i class="layui-icon layui-icon-file"></i>鐢熸垚鏉$爜</button>--> + <button type="button" class="layui-btn layui-btn-sm" id="btn_HideColumn" lay-event="btn-HideColumn"><i class="layui-icon layui-icon-return"></i>闅愯棌鍒楄缃�</button> <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-exit"><i class="layui-icon layui-icon-return"></i>閫�鍑�</button> </div> @@ -132,7 +156,7 @@ <script src="../../../../Scripts/webConfig.js"></script> <script> var _cur_page = 1; - var sql = " and 1=1"; + var sql = ""; var options = document.getElementById('HStatus').children; function getUrlVars() { var vars = [], hash; @@ -195,7 +219,29 @@ elem: '#HDate2' }); //layui.code(); - RoadHBillNo(sql); + //RoadHBillNo(sql); + + //涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞� + var titleData = ["hsupid","FSTOCKORGID"]; + var option = []; + var HModName = "SRM_POInStockBackBillList"; + + set_ClearBill(); + //#region 姝ら〉闈㈡墍鏈夋柟娉� + function set_ClearBill() { + //娓叉煋閫�鏂欑粍缁� + var Organization = '<option value=' + sessionStorage["OrganizationID"] + ' style="color:red;">' + sessionStorage["Organization"] + '</option>'; + $("#HSTOCKORGID").append(Organization); + form.render('select'); + //鍒濆鍖栬〃鏍� + //set_InitGrid(); + //鏄剧ず鍒楁暟鎹� + //DisPlay_HideColumn(); + //鐩存帴鎵ц鍒楄〃绛涢�� 鍔犺浇鏁版嵁鍒扮綉鏍� + get_FastQuery(table, option) + } + + //get_Display(sql); layer.load(3) //鏂规硶绾ф覆鏌� table.render({ @@ -209,7 +255,7 @@ // , where: { msg: "", NowPage: 1, OnePage: 10 } , cellMinWidth: 100 , cols: [[ - { checkbox: true, fixed: true } + { checkbox: true, fixed: true, totalRowText: '鍚堣' } , { field: '鐘舵��', title: '鐘舵��', width: 100, sort: true, fixed: true } , { field: '鍗曟嵁鍙�', title: '鍗曟嵁鍙�', width: 200, sort: true, fixed: true } , { field: '婧愬崟鍗曞彿', title: '婧愬崟鍗曞彿', width: 150 } @@ -218,12 +264,13 @@ , { field: '鐗╂枡', title: '鐗╂枡鍚嶇О', width: 200 } , { field: '瑙勬牸鍨嬪彿', title: '瑙勬牸鍨嬪彿', width: 200 } , { field: '璁¢噺鍗曚綅', title: '璁¢噺鍗曚綅', width: 80, sort: true } - , { field: '鏁伴噺', title: '鏁伴噺', width: 130 } - , { field: '鍚堟牸鏁伴噺', title: '鍚堟牸鏁伴噺', width: 130 } - , { field: '涓嶅悎鏍兼暟閲�', title: '涓嶅悎鏍兼暟閲�', width: 130 } + , { field: '鏁伴噺', title: '鏁伴噺', width: 130, totalRow: true} + , { field: '鍚堟牸鏁伴噺', title: '鍚堟牸鏁伴噺', width: 130, totalRow: true} + , { field: '涓嶅悎鏍兼暟閲�', title: '涓嶅悎鏍兼暟閲�', width: 130, totalRow: true} , { field: '鏃ユ湡', title: '鏃ユ湡', width: 150 } ]] , page: true //鏄惁鏄剧ず鍒嗛〉 + , totalRow: true , limits: [10, 20, 50, 100] , limit: 50 //姣忛〉榛樿鏄剧ず鐨勬暟閲� //, height: 500 @@ -292,8 +339,88 @@ case 'btn-exit': parent.layui.admin.events.closeThisTabs(); break; + case 'btn-HideColumn': + get_HideColumn(); + break; }; }); + + //鍔犺浇鏄剧ず鏁版嵁 + function get_Display(sqlWhere) { + var wait = layer.load();//閬僵 + $.ajax({ + type: "POST", + url: GetWEBURL() + "GetPOInStockBackBill", + async: true, + data: { "HSupNo": sessionStorage["HUserName"], "sqlWhere": sqlWhere }, + success: function (data1) { + if (data1.Message == "鑾峰彇鎴愬姛") { + 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', totalRowText: '鍚堣' }); + 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 (data[i].name.indexOf('id') > -1) { + col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //id鍒� + } + 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: 200 }); + break; + default: + if ( data[i].name == '瀹為��鏁伴噺') { + col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200, totalRow: true }); + } else if (data[i].name == '鍗曟嵁缂栧彿' || data[i].name == '閫�鏂欐棩鏈�') { + col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 135 }); + } else if (data[i].name == '渚涘簲鍟�' ) { + col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 220 }); + } else if (data[i].name == '瑙勬牸鍨嬪彿' || data[i].name == '澶囨敞') { + col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 515 }); + } else { + col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 }); + } + } + } + } + //鍔ㄦ�佹樉绀哄垪鍚� + option = { + elem: '#mainTable' + , toolbar: '#toolbarDemo' + , cols: [col] + , data: data1.data + , height: 'full-80' + , totalRow: true + , page: true + , cellMinWidth: 90 + , limit: 500 + , limits: [50, 500, 5000, 20000] + } + table.render(option); + //鍒锋柊琛ㄦ牸鏁版嵁 + DisPlay_HideColumn(); + layer.close(wait); + } else { + layer.close(wait); + layer.msg(data1.Message, {time:2000, icon: 5 }); + } + }, + error: function (result) { + layer.close(wait); + layer.alert(result.Message, { icon: 5 }); + } + }); + }; + ///鍔犺浇鏄剧ず鏁版嵁 function RoadHBillNo(sqlWhere) { @@ -323,33 +450,48 @@ } }); }; - form.on('submit(f_Query)', function (data) {//鏌ヨ - var sqlWhere = " and 1=1 "; - if ($("#HStatus").val() != "") - sqlWhere += " and 鐘舵�� like ^^%" + $("#HStatus").val() + "%^^"; - if ($("#HBillNo").val() != "") - sqlWhere += " and 鍗曟嵁鍙� like ^^%" + $("#HBillNo").val() + "%^^"; - if ($("#HNumber").val() != "") - sqlWhere += " and 鐗╂枡浠g爜 like ^^%" + $("#HNumber").val() + "%^^"; - if ($("#HName").val() != "") - sqlWhere += " and 鐗╂枡鍚嶇О like ^^%" + $("#HName").val() + "%^^"; - if ($("#HModel").val() != "") - sqlWhere += " and 瑙勬牸鍨嬪彿 like ^^%" + $("#HModel").val() + "%^^"; - if ($("#HClStatus").val() != "") - sqlWhere += " and 鍏抽棴鐘舵�� like ^^%" + $("#HClStatus").val() + "%^^"; - if ($("#HPURCHASEORGID").val() != "") - sqlWhere += " and 閲囪喘缁勭粐 like ^^%" + $("#HPURCHASEORGID").val() + "%^^"; + + function get_FastQuery(table, option) { + var sqlWhere = " "; if ($("#HDate1").val() != "") { - sqlWhere += " and 鏃ユ湡 >= ^^" + $("#HDate1").val() + "^^"; + sqlWhere += " and 閫�鏂欐棩鏈� >= ^^" + $("#HDate1").val() + "^^"; } if ($("#HDate2").val() != "") { - sqlWhere += " and 鏃ユ湡 <= ^^" + $("#HDate2").val() + "^^"; + sqlWhere += " and 閫�鏂欐棩鏈� <= ^^" + $("#HDate2").val() + "^^"; } + if ($("#HNumber").val() != "") + sqlWhere += " and 鐗╂枡缂栫爜 like ^^%" + $("#HNumber").val() + "%^^"; + if ($("#HSupNumber").val() != "") + sqlWhere += " and 渚涘簲鍟嗗搴旂墿鏂欎唬鐮� like ^^%" + $("#HSupNumber").val() + "%^^"; + if ($("#HModel").val() != "") + sqlWhere += " and 瑙勬牸鍨嬪彿 like ^^%" + $("#HModel").val() + "%^^"; + if ($("#HReturnMethod").val() != "") + sqlWhere += " and 閫�鏂欐柟寮� like ^^%" + $("#HReturnMethod").val() + "%^^"; + if ($("#HSupName").val() != "") + sqlWhere += " and 渚涘簲鍟� like ^^%" + $("#HSupName").val() + "%^^"; + + if ($("#HSTOCKORGID").val() != "" && $("#HSTOCKORGID option:selected").text() != "瀹夌憺闆嗗洟") + sqlWhere += " and FSTOCKORGID = ^^" + $("#HSTOCKORGID").val() + "^^"; + //if ($("#HStatus").val() != "") + // sqlWhere += " and 鐘舵�� like ^^%" + $("#HStatus").val() + "%^^"; + //if ($("#HBillNo").val() != "") + // sqlWhere += " and 鍗曟嵁鍙� like ^^%" + $("#HBillNo").val() + "%^^"; + //if ($("#HName").val() != "") + // sqlWhere += " and 鐗╂枡鍚嶇О like ^^%" + $("#HName").val() + "%^^"; + //if ($("#HClStatus").val() != "") + // sqlWhere += " and 鍏抽棴鐘舵�� like ^^%" + $("#HClStatus").val() + "%^^"; + //if ($("#HPURCHASEORGID").val() != "") + // sqlWhere += " and 閲囪喘缁勭粐 like ^^%" + $("#HPURCHASEORGID").val() + "%^^"; sql = sqlWhere; //浠庣涓�椤靛紑濮� _cur_page = 1; - RoadHBillNo(sqlWhere); + //RoadHBillNo(sqlWhere); + get_Display(sqlWhere); + } + + form.on('submit(f_Query)', function (data) {//鏌ヨ + get_FastQuery(table, option); }); var $ = layui.$, active = { reload: function () { @@ -367,16 +509,122 @@ }); }, f_Query: function () { //鏌ヨ - //var sqlWhere = " and 1=1 "; - //if ($("#HBillNo").val() != "") - // sqlWhere += " and 鍗曟嵁鍙� like ''%" + $("#HBillNo").val() + "%''"; - //RoadHBillNo(sqlWhere); }, }; $('.test-table-reload-btn .layui-btn').on('click', function () { var type = $(this).data('type'); active[type] ? active[type].call(this) : ''; }); + + //闅愯棌鍒楄缃� + function get_HideColumn() { + var colName = ""; + for (var i = 1; i < option.cols[0].length - 1; i++) { + colName += option.cols[0][i]["title"] + ","; + } + + 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(); + //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹� + layer.close(index);//鍏抽棴寮圭獥 + } + }) + } + //鏄剧ず鍒楁暟鎹� + function DisPlay_HideColumn() { + $.ajax({ + url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList', + type: "GET", + data: { "HModName": HModName, "user": sessionStorage["HUserName"] }, + success: function (data1) { + if (data1.data.length != 0) { + var dataCol = [];//鏁版嵁搴撴煡璇㈠嚭鐨勫垪鏁版嵁 + dataCol = data1.data[0].HGridString.split(','); + for (var i = 0; i < dataCol.length; i++) { + var dataCols = dataCol[i].split('|'); + //闅愯棌鍒� + if (dataCols[1] == 1) { + option.cols[0][i + 1]["hide"] = true; + } + //鏄剧ず鍒� + if (dataCols[1] == 0 && $.inArray(option.cols[0][i + 1]["title"], titleData) == -1) { + option.cols[0][i + 1]["hide"] = false; + } + //闅愯棌id + //璁剧疆鍒楀 + if (dataCols[3] > 0) { + if (option.cols[0][i + 1]["field"] == '渚涘簲鍟嗕氦鏈熷洖澶�') { + option.cols[0][i + 1]["width"] = 120; + } else { + option.cols[0][i + 1]["width"] = dataCols[3]; + } + } + //璁剧疆鍐呭瀛椾綋澶у皬 + 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 (data1.data[0].HColumnWidth != 0) { + // option.cols[0][i + 1]["width"] = data1.data[0].HColumnWidth + "px;"; + //} else { + // option.cols[0][i + 1]["width"] = ""; + //} + + //瀛椾綋鎵�鍦ㄤ綅缃�(宸� 灞呬腑 鍙�) + 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; + } + } + //鍙栨秷鍐荤粨鍒� + 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"; + } + } + table.render(option); + } else { + table.render(option); + } + }, error: function () { + layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 }); + } + }) + } + }); </script> </body> -- Gitblit v1.9.1