From a463d1c073a1f4e48a409cf7f3b5b7482c5aea59 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期四, 26 十月 2023 13:28:43 +0800
Subject: [PATCH] 收款单:界面调整

---
 WebTM/views/生产管理/异常反馈单/Sc_MESExecptFeedBackBillList.html |  124 ++++++++++++++++++++++++++--------------
 1 files changed, 80 insertions(+), 44 deletions(-)

diff --git "a/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\345\274\202\345\270\270\345\217\215\351\246\210\345\215\225/Sc_MESExecptFeedBackBillList.html" "b/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\345\274\202\345\270\270\345\217\215\351\246\210\345\215\225/Sc_MESExecptFeedBackBillList.html"
index adcd9d4..536e107 100644
--- "a/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\345\274\202\345\270\270\345\217\215\351\246\210\345\215\225/Sc_MESExecptFeedBackBillList.html"
+++ "b/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\345\274\202\345\270\270\345\217\215\351\246\210\345\215\225/Sc_MESExecptFeedBackBillList.html"
@@ -41,7 +41,7 @@
                                 <div class="layui-inline">
                                     <label class="layui-form-label">闃呰鐘舵��</label>
                                     <div class="layui-input-block">
-                                        <select name="HReadFlag" lay-filter="HReadFlag" style="width:190px;">
+                                        <select id="HReadFlag" name="HReadFlag" lay-filter="HReadFlag" style="width:190px;">
                                             <option value="-1" selected="selected">鍏ㄩ儴</option>
                                             <option value="0">鏈槄</option>
                                             <option value="1">宸查槄</option>
@@ -80,10 +80,10 @@
                                     <div class="layui-inline">
                                         <label class="layui-form-label">绱ф�ョ▼搴�</label>
                                         <div class="layui-input-block">
-                                            <select name="HLevel" lay-filter="HLevel" style="width:190px;">
-                                                <option value="-1" selected="selected">鍏ㄩ儴</option>
-                                                <option value="0">鏅��</option>
-                                                <option value="1">绱ф��</option>
+                                            <select id="HLevel" name="HLevel" lay-filter="HLevel" style="width:190px;">
+                                                <option value="鍏ㄩ儴" selected="selected">鍏ㄩ儴</option>
+                                                <option value="鏅��">鏅��</option>
+                                                <option value="绱ф��">绱ф��</option>
                                             </select>
                                         </div>
                                     </div>
@@ -130,6 +130,7 @@
             //鏌ヨ鏉′欢
             var sWhere = "";
             var option = [];
+            var titleData = ["HInterID", "HEntryID", "HDeptID","HBillStatus"];
             //#endregion
 
             var HModName = "Sc_MESExecptFeedBackBillList";
@@ -154,10 +155,10 @@
                     case 'btn-Delete':set_DeleteBill();
                         break;
                     //瀹℃牳鎸夐挳
-                    case 'btn-Audit': set_CheckBill();
+                    case 'btn-Audit': set_AuditBill();
                         break;
                     //鍙嶅鏍告寜閽�
-                    case 'btn-DeAudit': set_AbandonCheck();
+                    case 'btn-DeAudit': set_DeAuditBill();
                         break;
                     //鍒锋柊
                     case 'get_Refresh': set_Refresh();
@@ -184,8 +185,8 @@
 
 
             //#region 姝ら〉闈㈡墍鏈夋柟娉�
-                //鍒濆鍖栬〃鏍�
-                function set_InitGrid() {
+            //鍒濆鍖栬〃鏍�
+            function set_InitGrid() {
                 $("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
                 $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
                 var columns = [
@@ -232,7 +233,7 @@
             }
             //鍔犺浇缃戞牸
             function get_Display(sWhere) {
-                var wait = layer.load();//閬僵
+                var ajaxLoad = layer.load();//閬僵
 
                 $.ajax({
                     url: GetWEBURL() + '/Sc_MESTransFerWorkBill/Get_TransFerBillList',
@@ -240,16 +241,43 @@
                     data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                     success: function (data1) {
                         if (data1.count == 1) {
-                            DataList = data1.data;
+                            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 {
+                                    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;
                             table.render(option);
-                            layer.close(wait);
+
+                            layer.close(ajaxLoad);
+                            //layer.alert("鏌ヨ鎴愬姛", { icon: 1 });
                         } else {
-                            layer.close(wait);
-                            layer.alert(data1.Message, { icon: 5 });
+                            layer.close(ajaxLoad);
+                            layer.alert(data1.code + data1.Message, { icon: 5 });
                         }
                     }, error: function () {
-                        layer.close(wait);
+                        layer.close(ajaxLoad);
                         layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
                     }
                 });
@@ -257,14 +285,22 @@
             }
 
 
-            //闅愯棌鍒楄缃�
+            //#region 闅愯棌鍒楄缃�
             function get_HideColumn() {
                 var colName = "";
-                for (var i = 1; i < option.cols[0].length - 1; i++) {
+                var contentUrl = "";
+                for (var i = 1; i < option.cols[0].length; i++) {
                     colName += option.cols[0][i]["title"] + ",";
                 }
-
+                var urlStr = window.document.location.pathname;//鑾峰彇鏂囦欢璺緞
+                var urlLen = urlStr.split('/');
+                for (var i = 0; i < urlLen.length - 4; i++) {
+                    contentUrl += "../";
+                }
                 colName = encodeURI(colName.substring(0, colName.length - 1));//瀵� URI 杩涜缂栫爜
+
+                contentUrl += '鍩虹璧勬枡/闅愯棌鍒楄缃�/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName;
+
                 layer.open({
                     type: 2
                     , skin: "layui-layer-rim" //鍔犱笂杈规
@@ -273,7 +309,7 @@
                     , shift: 2 //寮瑰嚭鍔ㄧ敾
                     , area: ["50%", "90%"] //绐椾綋澶у皬
                     , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀�
-                    , content: ['../../鍩虹璧勬枡/闅愯棌鍒楄缃�/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName, "yes"]
+                    , content: [contentUrl, "yes"]
                     , btn: ["纭畾", "鍙栨秷"]
                     , btn1: function (index, laero) {
                         //鍒锋柊琛ㄦ牸鏁版嵁
@@ -283,8 +319,8 @@
                     }
                 })
             }
-
-            //鏄剧ず鍒楁暟鎹�
+            //#endregion
+            //#region 鏄剧ず鍒楁暟鎹�
             function DisPlay_HideColumn() {
                 $.ajax({
                     url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList',
@@ -293,13 +329,12 @@
                     success: function (data1) {
                         if (data1.data.length != 0) {
 
-
                             var dataCol = [];//鏁版嵁搴撴煡璇㈠嚭鐨勫垪鏁版嵁
-                            var titleData = ["HMaterID", "HUnitID", "HICMOEmpID"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
+                            //var titleData = ["鍗曟嵁ID", "HMouldID", "hsubid", "HManagerID", "婧愬崟涓诲唴鐮�", "婧愬崟瀛愬唴鐮�"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
 
                             dataCol = data1.data[0].HGridString.split(',');
 
-                            for (var i = 0; i < option.cols[0].length - 2; i++) {
+                            for (var i = 0; i < option.cols[0].length - 1; i++) {
                                 var dataCols = dataCol[i].split('|');
                                 //闅愯棌鍒�
                                 if (dataCols[1] == 1) {
@@ -366,6 +401,7 @@
                     }
                 })
             }
+            //#endregion
 
 
 
@@ -425,9 +461,9 @@
                 var checkStatus = table.checkStatus('mainTable')
                     , data = checkStatus.data;
                 if (checkStatus.data.length === 1) {
-                    var InterID = data[0].hmainid.toString();
+                    var InterID = data[0].HInterID.toString();
                     var HEntryID = data[0].HEntryID.toString();
-                    var HReadFlag = data[0].HReadFlag.toString();
+                    var HReadFlag = data[0].闃呰鐘舵��.toString();
                     if (HReadFlag == "鏈槄") {
                         //閫昏緫鍒犻櫎鏂规硶
                         layer.confirm("纭瑕佸垹闄ゅ悧锛屽垹闄ゅ悗涓嶈兘鎭㈠", { title: "鍒犻櫎纭" }, function (index) {
@@ -473,44 +509,44 @@
             }
 
             function get_FastQuery() {
-                var HStatus = $("select[name='HReadFlag']").val();//鐘舵��
+                var HStatus = $("#HReadFlag").val();//闃呰鐘舵��
                 var HBeginDate = $("#HBeginDate").val();//寮�濮嬫棩鏈�
                 var HEndDate = $("#HEndDate").val();//缁撴潫鏃ユ湡
                 var HSendMan = $("#HSendMan").val();//鍙戦�佷汉
-                var HLevel = $("select[name='HLevel']").val();//绱ф�ョ▼搴�
+                var HLevel = $("#HLevel").val();//绱ф�ョ▼搴�
                 if (HStatus) {
                     switch (HStatus) {
                         case '-1':   //鍏ㄩ儴
                             sWhere += "";
                             break;
                         case '0':    //鏈槄
-                            sWhere += " and B.HReadFlag='0'";
+                            sWhere += " and 闃呰鐘舵�� = '鏈槄'";
                             break;
                         case '1':    //宸查槄
-                            sWhere += " and B.HReadFlag='1'";
+                            sWhere += " and 闃呰鐘舵�� = '宸查槄'";
                             break;
                         default:
                     }
                 }
                 if (HBeginDate) {
-                    sWhere += " and CONVERT(varchar(100),A.HDate, 23) >= '" + HBeginDate + "'";
+                    sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) >= '" + HBeginDate + "'";
                 }
                 if (HEndDate) {
-                    sWhere += " and CONVERT(varchar(100),A.HDate, 23) <= '" + HEndDate + "'";
+                    sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) <= '" + HEndDate + "'";
                 }
                 if (HSendMan) {
-                    sWhere += " and A.HSendMan like '%" + HSendMan + "%'";
+                    sWhere += " and 鍙戦�佷汉 like '%" + HSendMan + "%'";
                 }
                 if (HLevel) {
                     switch (HLevel) {
-                        case '-1':   //鍏ㄩ儴
+                        case '鍏ㄩ儴':   //鍏ㄩ儴
                             sWhere += "";
                             break;
-                        case '0':    //鏅��
-                            sWhere += " and A.HLevel='0'";
+                        case '鏅��':    //鏅��
+                            sWhere += " and 绱ф�ョ▼搴� ='鏅��'";
                             break;
-                        case '1':    //绱ф��
-                            sWhere += " and A.HLevel='1'";
+                        case '绱ф��':    //绱ф��
+                            sWhere += " and 绱ф�ョ▼搴� ='绱ф��'";
                             break;
                         default:
                     }
@@ -522,11 +558,11 @@
 
             //閲嶇疆杩囨护鏉′欢
             function set_ClearQuery() {
-                $('#HReadFlag').find("option[value='-1']").attr("selected", true);
+                $('#HReadFlag').val("-1");
                 $("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
                 $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
                 $("#HSendMan").val("");
-                $('#HLevel').find("option[value='-1']").attr("selected", true);
+                $('#HLevel').val("鏅��");
                 sWhere = "";
                 get_Display(sWhere);
             }
@@ -538,8 +574,8 @@
                     , data = checkStatus.data;
                 if (checkStatus.data.length === 1) {
                     var HBillStatus = data[0].HBillStatus.toString(); //鍗曟嵁鐘舵��
-                    var InterID = data[0].hmainid.toString();
-                    if (HBillStatus > 0) {
+                    var InterID = data[0].HInterID.toString();
+                    if (HBillStatus > 1) {
                         layer.msg('鍗曟嵁涓嶄负鏈鏍哥姸鎬�,涓嶈兘鍐嶆瀹℃牳锛�');
                         return false;
                     }
@@ -579,8 +615,8 @@
                     , data = checkStatus.data;
                 if (checkStatus.data.length === 1) {
                     var HBillStatus = data[0].HBillStatus.toString(); //鍗曟嵁鐘舵��
-                    var InterID = data[0].hmainid.toString();
-                    if (HBillStatus=0) {
+                    var InterID = data[0].HInterID.toString();
+                    if (HBillStatus==1) {
                         layer.msg('鍗曟嵁鏈鏍哥姸鎬�,鏃犻渶鍙嶅鏍革紒');
                         return false;
                     }

--
Gitblit v1.9.1