From 9a3387ef0ce5d0ebb61b2e2a7edb564f579f3dfe Mon Sep 17 00:00:00 2001
From: 仲国强 <519541279@qq.com>
Date: 星期三, 08 九月 2021 14:31:58 +0800
Subject: [PATCH] 来料检验单列表优化sz

---
 WebTM/views/质量管理/来料检验单/QC_POStockInCheckBillList.html |  303 ++++++++++++++++++++++++++++----------------------
 1 files changed, 170 insertions(+), 133 deletions(-)

diff --git "a/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\346\235\245\346\226\231\346\243\200\351\252\214\345\215\225/QC_POStockInCheckBillList.html" "b/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\346\235\245\346\226\231\346\243\200\351\252\214\345\215\225/QC_POStockInCheckBillList.html"
index 1827504..8226a51 100644
--- "a/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\346\235\245\346\226\231\346\243\200\351\252\214\345\215\225/QC_POStockInCheckBillList.html"
+++ "b/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\346\235\245\346\226\231\346\243\200\351\252\214\345\215\225/QC_POStockInCheckBillList.html"
@@ -8,10 +8,19 @@
     <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
     <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
     <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
+    <!--<script src="../../../layuiadmin/layui/layui.js"></script>
     <script src="../../../layuiadmin/layui/layui.js"></script>
+    <script src="../../../layuiadmin/Scripts/json2.js"></script>
+    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
+    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>-->
+    <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
+    <script src="../../../layuiadmin/layui/layui.js"></script>
+    <script src="../../../layuiadmin/Scripts/json2.js"></script>
+    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
+    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
+    <script src="../../../layuiadmin/PubCustom.js"></script>
 </head>
 <body>
-
     <div class="layui-card layadmin-header">
         <div class="layui-breadcrumb" lay-filter="breadcrumb">
             <a lay-href="">涓婚〉</a>
@@ -21,63 +30,55 @@
         </div>
     </div>
 
-    <div class="layui-fluid">
-        <div class="layui-row layui-col-space15">
-            <div class="layui-col-md12">
-                <div class="layui-card">
 
-                    <div class="layui-card-body">
-                        <!--<div class="test-table-reload-btn" style="margin-bottom: 10px;">-->
-                        <form class="layui-form" action="">
-                            <div class="layui-form-item">
+    <div class="layui-fluid">
+        <div class="layui-col-md12">
+            <div class="layui-card" style="padding: 1px">
+                <div class="layui-card-body" style="padding: 1px;">
+                    <form class="layui-form" action="" lay-filter="component-form-group">
+                        <div class="layui-collapse">
+                            <div class="layui-colla-item">
                                 <div class="layui-inline">
-                                    <label class="layui-form-label">鍗曟嵁鍙�</label>
-                                    <div class="layui-input-block">
+                                    <label class="layui-form-label" style="width: 85px;">鍗曟嵁鍙�</label>
+                                    <div class="layui-input-block" style="margin-left: 120px;">
                                         <input type="text" class="layui-input" name="HBillNo" id="HBillNo">
                                     </div>
                                 </div>
-
                                 <div class="layui-inline">
-                                    <label class="layui-form-label">寮�濮嬫棩鏈�</label>
-                                    <div class="layui-input-block">
+                                    <label class="layui-form-label" style="width: 85px;">寮�濮嬫棩鏈�</label>
+                                    <div class="layui-input-block" style="margin-left: 120px;">
                                         <input type="text" class="layui-input" name="HDate1" id="HDate1">
                                     </div>
                                 </div>
                                 <div class="layui-inline">
-                                    <label class="layui-form-label">缁撴潫鏃ユ湡</label>
-                                    <div class="layui-input-block">
+                                    <label class="layui-form-label" style="width: 85px;">缁撴潫鏃ユ湡</label>
+                                    <div class="layui-input-block" style="margin-left: 120px;">
                                         <input type="text" class="layui-input" name="HDate2" id="HDate2">
                                     </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>
-                                    </button>
-                                </div>
+                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">
+                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
+                                </button>
+                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch" style="padding:0 5px">閲嶇疆</button>
                             </div>
-
-                        </form>
-                        <!--</div>-->
-                    </div>
-
-
-                    <table class="layui-hide" 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="btn-Edit"><i class="layui-icon layui-icon-form"></i>缂栬緫</button>
-                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Delete"><i class="layui-icon layui-icon-form"></i>鍒犻櫎</button>
                         </div>
-                    </script>
+                        <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="btn-Edit"><i class="layui-icon layui-icon-form"></i>缂栬緫</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Delete"><i class="layui-icon layui-icon-form"></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="get_Exit"><i class="layui-icon layui-icon-logout"></i>閫�鍑�</button>
+                            </div>
+                        </script>
+                    </form>
                 </div>
             </div>
         </div>
     </div>
 
     <!--<script src="../../layuiadmin/layui/lay/modules/mobile/jquery-3.3.1.min.js"></script>-->
-    <script src="../../../layuiadmin/layui/layui.js"></script>
-    <script src="../../../layuiadmin/Scripts/json2.js"></script>
-    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
-    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
+
     <script>
         var _cur_page = 1;
         var sql = " ";
@@ -130,12 +131,12 @@
             index: 'lib/index' //涓诲叆鍙fā鍧�
         }).use(['index', 'form', 'laydate', 'code', 'table', 'element', 'layer'], function () {
             var $ = layui.$
-            , admin = layui.admin
-            , layer = layui.layer
-            , laydate = layui.laydate
-            , table = layui.table
-            , form = layui.form
-            , element = layui.element;
+                , admin = layui.admin
+                , layer = layui.layer
+                , laydate = layui.laydate
+                , table = layui.table
+                , form = layui.form
+                , element = layui.element;
             //甯歌鐢ㄦ硶
             laydate.render({
                 elem: '#HDate1'
@@ -146,6 +147,8 @@
             //layui.code();
             RoadHBillNo(sql);
             layer.load(3)
+            $("#HDate1").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
+            $("#HDate2").val(Format(new Date(), "yyyy-MM-dd"));
             //鏂规硶绾ф覆鏌�
             table.render({
                 elem: '#mainTable'
@@ -156,45 +159,66 @@
                 , toolbar: '#toolbarDemo' //寮�鍚ご閮ㄥ伐鍏锋爮锛屽苟涓哄叾缁戝畾宸︿晶妯℃澘
                 , defaultToolbar: ['filter', 'exports', 'print']
                 // , where: { msg: "", NowPage: 1, OnePage: 10 }
-              , cellMinWidth: 100
-              , cols: [[
-                  { type: 'checkbox', fixed: 'left' }
-                  , { field: 'hmainid', title: 'hmainid', sort: true, fixed: true, hide: true }
-                  , { field: 'hsubid', title: 'hsubid' ,hide: true }
-                  , { field: '鏃ユ湡', title: '鏃ユ湡', sort: true, width: 120 }
-                  , { field: '鍗曟嵁鍙�', title: '鍗曟嵁鍙�', sort: true, width: 170 }
-                  , { field: '琛ㄥご澶囨敞 ', title: '琛ㄥご澶囨敞', width: 105 }
-                  , { field: '渚涘簲鍟嗗悕绉�', title: '渚涘簲鍟嗗悕绉�' }
-                  , { field: '渚涘簲鍟嗕唬鐮�', title: '渚涘簲鍟嗕唬鐮�' }
-                  , { field: '浜у搧鍐呯爜', title: '浜у搧鍐呯爜' }
-                  , { field: '浜у搧鍚嶇О', title: '浜у搧鍚嶇О' }
-                  , { field: '浜у搧鍨嬪彿', title: '浜у搧鍨嬪彿', width: 115 }
-                  , { field: '妫�楠屽憳浠g爜', title: '妫�楠屽憳浠g爜', width: 115 }
-                  , { field: '妫�楠屽憳鍚嶇О', title: '妫�楠屽憳鍚嶇О' }
-                  , { field: '鍒跺崟浜�', title: '鍒跺崟浜�', width: 160 }
-                  , { field: '鍒跺崟鏃ユ湡', title: '鍒跺崟鏃ユ湡', width: 160 }
-                  , { field: '瀹℃牳浜�', title: '瀹℃牳浜�', width: 160 }
-                  , { field: '瀹℃牳鏃ユ湡', title: '瀹℃牳鏃ユ湡', width: 160 }
-                  , { field: '淇敼浜�', title: '淇敼浜�', width: 160 }
-                  , { field: '淇敼鏃ユ湡', title: '淇敼鏃ユ湡', width: 160 }
-                  , { field: '鍏抽棴浜�', title: '鍏抽棴浜�', width: 160 }
-                  , { field: '鍏抽棴鏃ユ湡', title: '鍏抽棴鏃ユ湡', width: 160 }
-                  , { field: '浣滃簾浜�', title: '浣滃簾浜�', hide: true, width: 160 }
-                  , { field: '浣滃簾鏃ユ湡 ', title: '浣滃簾鏃ユ湡', width: 215 }
-                  , { field: '鍗曟嵁绫诲瀷 ', title: '鍗曟嵁绫诲瀷 ', width: 115 }
-              ]]
+                , cellMinWidth: 100
+                , cols: [[
+                    { type: 'checkbox', fixed: 'left' }
+                    , { field: 'hmainid', title: 'hmainid', sort: true, fixed: true, hide: true }
+                    , { field: 'hsubid', title: 'hsubid', hide: true }
+                    , { field: '鏃ユ湡', title: '鏃ユ湡', sort: true, width: 120 }
+                    , { field: '鍗曟嵁鍙�', title: '鍗曟嵁鍙�', sort: true, width: 170 }
+                    , { field: '琛ㄥご澶囨敞 ', title: '琛ㄥご澶囨敞', width: 105 }
+                    , { field: '渚涘簲鍟嗗悕绉�', title: '渚涘簲鍟嗗悕绉�' }
+                    , { field: '渚涘簲鍟嗕唬鐮�', title: '渚涘簲鍟嗕唬鐮�' }
+                    , { field: '浜у搧鍐呯爜', title: '浜у搧鍐呯爜' }
+                    , { field: '浜у搧鍚嶇О', title: '浜у搧鍚嶇О' }
+                    , { field: '浜у搧鍨嬪彿', title: '浜у搧鍨嬪彿', width: 115 }
+                    , { field: '妫�楠屽憳浠g爜', title: '妫�楠屽憳浠g爜', width: 115 }
+                    , { field: '妫�楠屽憳鍚嶇О', title: '妫�楠屽憳鍚嶇О' }
+                    , { field: '鍒跺崟浜�', title: '鍒跺崟浜�', width: 160 }
+                    , { field: '鍒跺崟鏃ユ湡', title: '鍒跺崟鏃ユ湡', width: 160 }
+                    , { field: '瀹℃牳浜�', title: '瀹℃牳浜�', width: 160 }
+                    , { field: '瀹℃牳鏃ユ湡', title: '瀹℃牳鏃ユ湡', width: 160 }
+                    , { field: '淇敼浜�', title: '淇敼浜�', width: 160 }
+                    , { field: '淇敼鏃ユ湡', title: '淇敼鏃ユ湡', width: 160 }
+                    , { field: '鍏抽棴浜�', title: '鍏抽棴浜�', width: 160 }
+                    , { field: '鍏抽棴鏃ユ湡', title: '鍏抽棴鏃ユ湡', width: 160 }
+                    , { field: '浣滃簾浜�', title: '浣滃簾浜�', hide: true, width: 160 }
+                    , { field: '浣滃簾鏃ユ湡 ', title: '浣滃簾鏃ユ湡', width: 215 }
+                    , { field: '鍗曟嵁绫诲瀷 ', title: '鍗曟嵁绫诲瀷 ', width: 115 }
+                ]]
                 //, skin: 'row' //琛ㄦ牸椋庢牸
                 // , even: true
-            , page: true //鏄惁鏄剧ず鍒嗛〉
-            , limits: [10, 20, 50, 100]
-            , limit: 50 //姣忛〉榛樿鏄剧ず鐨勬暟閲�
+                , page: true //鏄惁鏄剧ず鍒嗛〉
+                , limits: [10, 20, 50, 100]
+                , limit: 50 //姣忛〉榛樿鏄剧ず鐨勬暟閲�
                 //, height: 500
-            , done: function (res, curr, count) {
-                _cur_page = curr;
-                layer.closeAll("loading");
-            }
+                , done: function (res, curr, count) {
+                    _cur_page = curr;
+                    layer.closeAll("loading");
+                }
             });
+            //#region 閲嶇疆鎸夐挳
+            form.on('submit(btnReSearch)', function (data) {
+                set_ClearQuery();
+            });
+            //#endregion
 
+            //#region 鏌ヨ鎸夐挳
+            form.on('submit(btnSearch)', function (data) {
+                get_FastQuery();
+            });
+            //#endregion
+
+            //#region 閲嶇疆杩囨护鏉′欢鏂规硶
+            function set_ClearQuery() {
+                $("#HBillNo").val("");
+                $("#HNumber").val("");
+                $("#HName").val("");
+                $("#HDate1").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
+                $("#HDate2").val(Format(new Date(), "yyyy-MM-dd"));
+                sqlWhere = "";
+            }
+            //#endregion
             //澶村伐鍏锋爮浜嬩欢
             table.on('toolbar(mainTable)', function (obj) {
                 var checkStatus = table.checkStatus(obj.config.id);
@@ -233,36 +257,48 @@
                             , data = checkStatus.data;
                         if (checkStatus.data.length === 1) {
                             var InterID = data[0].hmainid.toString();
-                            //閫昏緫鍒犻櫎鏂规硶
-                            $.ajax({
-                                url: GetWEBURL() + 'DeltetQC_POStockInCheck',
-                                type: "GET",
-                                data: { "HInterID": InterID },
-                                success: function (result) {
-                                    console.log('gouba' + result);
-                                    if (result.count == 1) {
-                                        layer.msg(result.Message, { icon: 1 }, function () {
-                                            // 寰楀埌frame绱㈠紩
-                                            var index = layer.getFrameIndex(window.name);
-                                            //鍏抽棴褰撳墠frame
-                                            layer.close(index);
-                                            //淇敼涓哄姛鍚庡埛鏂扮晫闈�
-                                            window.location.reload();
-                                        });
+                            layer.confirm("纭瑕佸垹闄ゅ悧锛屽垹闄ゅ悗涓嶈兘鎭㈠", { title: "鍒犻櫎纭" }, function (index) {
+                                var index = layer.load();
+                                //閫昏緫鍒犻櫎鏂规硶
+                                $.ajax({
+                                    url: GetWEBURL() + 'DeltetQC_POStockInCheck',
+                                    type: "GET",
+                                    data: { "HInterID": InterID },
+                                    success: function (result) {
+                                        console.log('gouba' + result);
+                                        if (result.count == 1) {
+                                            layer.msg(result.Message, { icon: 1 }, function () {
+                                                // 寰楀埌frame绱㈠紩
+                                                var index = layer.getFrameIndex(window.name);
+                                                //鍏抽棴褰撳墠frame
+                                                layer.close(index);
+                                                //淇敼涓哄姛鍚庡埛鏂扮晫闈�
+                                                window.location.reload();
+                                            });
 
-                                    } else {
-                                        layer.alert(result.code + result.Message, { icon: 5 });
+                                        } else {
+                                            layer.alert(result.code + result.Message, { icon: 5 });
+                                            layer.close(index);
+                                        }
+                                    }, error: function () {
+                                        layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                                        layer.close(index);
                                     }
-                                }, error: function () {
-                                    layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
-                                }
-                            });
+                                });
+                            })
                         }
                         else {
                             layer.msg('璇烽�夋嫨涓�琛屾暟鎹垹闄わ紒');
                         }
                         break;
-                   
+                    case 'get_Refresh':
+                        set_ClearQuery();
+                        RoadHBillNo(sqlWhere);
+                        break;
+                    case 'get_Exit':
+                        Pub_Close(2);
+                        break;
+
                 };
             });
 
@@ -270,37 +306,42 @@
 
             ///鍔犺浇鏄剧ず鏁版嵁
             function RoadHBillNo(sqlWhere) {
+                var ajaxLoad = layer.load();
                 where = sqlWhere;
                 $.ajax({
                     type: "get",
-                    url: GetWEBURL() +"/QC_Management/MES_QC_POStockInCheckBillList_Json",
+                    url: GetWEBURL() + "/QC_Management/MES_QC_POStockInCheckBillList_Json",
                     async: true,
                     data: { "sqlWhere": sqlWhere },//"HSupNo": sessionStorage["HUserName"],
                     success: function (result) {
                         if (result.count == 1) {
-                        ajaxReturnData = JSON.parse(JSON.stringify(result)).data;
-                        table.reload('mainTable', {
-                            data: ajaxReturnData
-                            , height: 'full-10'
-                            , page: {
-                                curr: _cur_page //蹇呴』浠庣 1 椤靛紑濮�
-                            }
-                            , loading: false
-                            , done: function (index, res) {
+                            ajaxReturnData = JSON.parse(JSON.stringify(result)).data;
+                            table.reload('mainTable', {
+                                data: ajaxReturnData
+                                , height: 'full-10'
+                                , page: {
+                                    curr: _cur_page //蹇呴』浠庣 1 椤靛紑濮�
+                                }
+                                , loading: false
+                                , done: function (index, res) {
 
-                            }
-                        });
-                    } else {
+                                }
+                            });
+                            layer.close(ajaxLoad);
+                        } else {
+                            layer.close(ajaxLoad);
                             layer.alert(result.code + result.Message, { icon: 5 });
-                    }
+                        }
 
                     },
                     error: function (result) {
-                    layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                        layer.close(ajaxLoad);
+                        layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
                     }
                 });
             };
-            form.on('submit(f_Query)', function (data) {//鏌ヨ
+            //#region 蹇�熻繃婊�
+            function get_FastQuery() {
                 var sqlWhere = " and 1=1 ";
                 //if ($("#HStatus").val() != "")
                 //    sqlWhere += " and 鐘舵�� like ^^%" + $("#HStatus").val() + "%^^";
@@ -312,34 +353,19 @@
                 var HDate2 = $("#HDate2").val();//缁撴潫鏃ユ湡
 
                 if (HBillNo)
-                    sqlWhere += " and 鍗曟嵁鍙� like '%" + HBillNo+ "%'";
+                    sqlWhere += " and 鍗曟嵁鍙� like '%" + HBillNo + "%'";
                 if (HNumber)
                     sqlWhere += " and 鐗╂枡浠g爜 like '%" + HNumber + "%'";
                 if (HName)
                     sqlWhere += " and 鐗╂枡鍚嶇О like '%" + HName + "%'";
                 if (HModel)
                     sqlWhere += " and 瑙勬牸鍨嬪彿 like '%" + HModel + "%'";
-                //if ($("#HClStatus").val() != "")
-                //    sqlWhere += " and 鍏抽棴鐘舵�� like ^^%" + $("#HClStatus").val() + "%^^";
-                //if ($("#HPURCHASEORGID").val() != "")
-                //    sqlWhere += " and 閲囪喘缁勭粐 like ^^%" + $("#HPURCHASEORGID").val() + "%^^";
                 if (HDate1) {
                     sqlWhere += " and 鏃ユ湡 >= '" + HDate1 + "'";
                 }
                 if (HDate2) {
                     sqlWhere += " and 鏃ユ湡 <= '" + HDate2 + "'";
                 }
-                //if ($("#HISGenerate").val() != "") {
-                //    if ($("#HISGenerate").val() == "鏄�")
-                //    {
-                //        sqlWhere += " and 鏈叧鑱旀暟閲� <= 0";
-                //    }
-                //    else if ($("#HISGenerate").val() == "鍚�") {
-                //        sqlWhere += " and 鏈叧鑱旀暟閲� > 0";
-                //    }
-                //}
-
-
                 var Time = $("#Time").val();
                 var dd = new Date();
                 var dt;
@@ -373,7 +399,9 @@
                 //浠庣涓�椤靛紑濮�
                 _cur_page = 1;
                 RoadHBillNo(sqlWhere);
-            });
+                sqlWhere = "";
+            }
+            //#endregion
             var $ = layui.$, active = {
                 f_Query: function () { //鏌ヨ
 
@@ -399,6 +427,15 @@
                 //    });
                 //}
             };
+            //閫�鍑烘寜閽�
+            form.on('submit(get_Exit)', function () {
+                if (OperationType == 1) {
+                    Pub_Close(2);
+                }
+                else if (OperationType == 2) {
+                    Pub_Close(1);
+                }
+            })
             $('.test-table-reload-btn .layui-btn').on('click', function () {
                 var type = $(this).data('type');
                 active[type] ? active[type].call(this) : '';

--
Gitblit v1.9.1