From 40bf4e328668fd9673fd60a67b551c2f8d8d5445 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期五, 05 一月 2024 14:03:42 +0800
Subject: [PATCH] 生产订单:下查(工序流转卡、工序进站接收单、工序出站汇报单、指引卡开工单、指引卡完工单、生产领料单)

---
 WebTM/views/设备管理/设备档案/Gy_EquipFileMainList.html |  245 ++++++++++++++++++++++++------------------------
 1 files changed, 121 insertions(+), 124 deletions(-)

diff --git "a/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/\350\256\276\345\244\207\346\241\243\346\241\210/Gy_EquipFileMainList.html" "b/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/\350\256\276\345\244\207\346\241\243\346\241\210/Gy_EquipFileMainList.html"
index 22c49c0..1d0165d 100644
--- "a/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/\350\256\276\345\244\207\346\241\243\346\241\210/Gy_EquipFileMainList.html"
+++ "b/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/\350\256\276\345\244\207\346\241\243\346\241\210/Gy_EquipFileMainList.html"
@@ -10,6 +10,7 @@
     <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
     <style type="text/css"></style>
     <script src="../../../layuiadmin/layui/layui.js"></script>
+    <script src="../../../layuiadmin/soulTable.slim.js"></script>
 </head>
 <body>
     <div class="layui-fluid">
@@ -52,14 +53,12 @@
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="btndelete"><i class="layui-icon layui-icon-delete"></i>鍒犻櫎</button>
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-view"><i class="layui-icon layui-icon-tips"></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-Audit"><i class="layui-icon layui-icon-radio"></i>瀹℃牳</button>
-                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-DeAudit"><i class="layui-icon layui-icon-circle"></i>鍙嶅鏍�</button>-->
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_CheckBill" id="CheckBill"><i class="layui-icon layui-icon-form"></i>瀹℃牳</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_AbandonCheck" id="AbandonCheck"><i class="layui-icon layui-icon-form"></i>鍙嶅鏍�</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_CloseBill" id="set_CloseBill"><i class="layui-icon layui-icon-form"></i>鍏抽棴</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_CancelCloseBill" id="set_CancelCloseBill"><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>
@@ -77,7 +76,7 @@
             base: '../../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰�
         }).extend({
             index: 'lib/index', //涓诲叆鍙fā鍧�
-        }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate'], function () {
+        }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate','soulTable'], function () {
             //#region 鍏叡鍙橀噺
             var $ = layui.$
             , admin = layui.admin
@@ -87,6 +86,7 @@
             , element = layui.element
             , laypage = layui.laypage
             , laydate = layui.laydate
+            , soulTable = layui.soulTable
             var sWhere = "";
             var option = [];
             //#endregion
@@ -114,11 +114,17 @@
                     //鍒犻櫎鎸夐挳
                     case 'btndelete': set_DeleteBill();
                         break;
-                    //瀹℃牳鎸夐挳
-                    case 'btn-Audit': set_CheckBill();
+                    //瀹℃牳
+                    case 'set_CheckBill': set_CheckBill(1);
                         break;
-                    //鍙嶅鏍告寜閽�
-                    case 'btn-DeAudit': set_AbandonCheck();
+                    //鍙嶅鏍�
+                    case 'set_AbandonCheck': set_CheckBill(2);
+                        break;
+                    //鍏抽棴
+                    case 'set_CloseBill': set_CloseBill(1);
+                        break;
+                    //鍙嶅叧闂�
+                    case 'set_CancelCloseBill': set_CloseBill(2);
                         break;
                     //鍒锋柊
                     case 'get_Refresh': get_Refresh();
@@ -133,7 +139,10 @@
                 get_FastQuery();
             });
 
-
+            //閲嶇疆鎸夐挳
+            form.on('submit(btnReSearch)', function (data) {
+                get_Refresh();
+            });
 
             //#endregion
 
@@ -157,54 +166,57 @@
                     , limits: [50, 500, 5000, 20000]
                     , limit: 50 //姣忛〉榛樿鏄剧ず鐨勬暟閲�
                     , cellMinWidth: 200
+                    , done: function (res, curr, count) {
+                        soulTable.render(this);
+                    }
                     , cols: [[
                         { type: 'checkbox', fixed: 'left' }
                         , { field: 'hmainid', title: 'hmainid', sort: true, hide: true }
-                        , { field: '鏃ユ湡', title: '鏃ユ湡', templet: "<div>{{d.鏃ユ湡 ==null ?'':layui.util.toDateString(d.鏃ユ湡, 'yyyy-MM-dd')}}</div>"}
-                        , { field: '鏉″舰鐮�', title: '鏉$爜缂栧彿' }
-                        , { field: 'HMaterID', title: 'HMaterID', hide: true }
-                        , { field: '鐗╂枡鍚嶇О', title: '鐗╂枡鍚嶇О' }
-                        , { field: '璁惧浠g爜', title: '璁惧浠g爜' }
-                        , { field: '璁惧缂栫爜', title: '璁惧缂栫爜' }
-                        , { field: '璁惧鍚嶇О', title: '璁惧鍚嶇О' }
-                        , { field: '璁惧瑙勬牸', title: '璁惧瑙勬牸' }
-                        , { field: '璁惧鍨嬪彿', title: '璁惧鍨嬪彿' }
-                        , { field: 'HUnitID', title: 'HUnitID', hide: true }
-                        , { field: '鍗曚綅', title: '鍗曚綅' }
-                        , { field: '璁惧鍑哄巶鏃ユ湡', title: '璁惧鍑哄巶鏃ユ湡', templet: "<div>{{d.璁惧鍑哄巶鏃ユ湡 ==null ?'':layui.util.toDateString(d.璁惧鍑哄巶鏃ユ湡, 'yyyy-MM-dd')}}</div>" }
-                        , { field: '璁惧鍑哄巶缂栧彿', title: '璁惧鍑哄巶缂栧彿' }
-                        , { field: 'HDeptID', title: 'HDeptID', hide: true }
-                        , { field: '浣跨敤閮ㄩ棬', title: '浣跨敤閮ㄩ棬' }
-                        , { field: 'HUseEmpID', title: 'HUseEmpID', hide: true }
-                        , { field: '浣跨敤璐熻矗浜�', title: '浣跨敤璐熻矗浜�' }
-                        , { field: 'HRepairEmpID', title: 'HRepairEmpID', hide: true }
-                        , { field: '缁存姢璐熻矗浜�', title: '缁存姢璐熻矗浜�' }
-                        , { field: '瀹夎鍦扮偣', title: '瀹夎鍦扮偣' }
-                        , { field: '瀹夎鏃ユ湡', title: '瀹夎鏃ユ湡', templet: "<div>{{d.瀹夎鏃ユ湡 ==null ?'':layui.util.toDateString(d.瀹夎鏃ユ湡, 'yyyy-MM-dd')}}</div>" }
-                        , { field: '杩愯寮�濮嬫棩鏈�', title: '杩愯寮�濮嬫棩鏈�', templet: "<div>{{d.杩愯寮�濮嬫棩鏈� ==null ?'':layui.util.toDateString(d.杩愯寮�濮嬫棩鏈�, 'yyyy-MM-dd')}}</div>" }
-                        , { field: '褰撳墠鐘舵��', title: '褰撳墠鐘舵��' }
-                        , { field: 'HEquipFileTypeID', title: 'HEquipFileTypeID', hide: true }
-                        , { field: '璁惧绫诲瀷', title: '璁惧绫诲瀷' }
-                        , { field: '宸ョ▼缂栫爜', title: '宸ョ▼缂栫爜' }
-                        , { field: '浜у搧', title: '浜у搧' }
-                        , { field: '鍝佺墝', title: '鍝佺墝' }
-                        , { field: 'HSellSupID', title: 'HSellSupID', hide: true }
-                        , { field: '渚涘簲鍟�', title: '渚涘簲鍟�' }
-                        , { field: 'HMakeSupID', title: 'HMakeSupID', hide: true }
-                        , { field: '鍒堕�犲晢', title: '鍒堕�犲晢' }
-                        , { field: '鍒跺崟浜�', title: '鍒跺崟浜�' }
-                        , { field: '鍒跺崟鏃ユ湡', title: '鍒跺崟鏃ユ湡', templet: "<div>{{d.鍒跺崟鏃ユ湡 ==null ?'':layui.util.toDateString(d.鍒跺崟鏃ユ湡, 'yyyy-MM-dd')}}</div>"}
-                        , { field: '瀹℃牳浜�', title: '瀹℃牳浜�' }
-                        , { field: '瀹℃牳鏃ユ湡', title: '瀹℃牳鏃ユ湡', templet: "<div>{{d.瀹℃牳鏃ユ湡 ==null ?'':layui.util.toDateString(d.瀹℃牳鏃ユ湡, 'yyyy-MM-dd')}}</div>"}
-                        , { field: '淇敼浜�', title: '淇敼浜�' }
-                        , { field: '淇敼鏃ユ湡', title: '淇敼鏃ユ湡', templet: "<div>{{d.淇敼鏃ユ湡 ==null ?'':layui.util.toDateString(d.淇敼鏃ユ湡, 'yyyy-MM-dd')}}</div>"}
-                        , { field: '鍏抽棴浜�', title: '鍏抽棴浜�' }
-                        , { field: '鍏抽棴鏃ユ湡', title: '鍏抽棴鏃ユ湡', templet: "<div>{{d.鍏抽棴鏃ユ湡 ==null ?'':layui.util.toDateString(d.鍏抽棴鏃ユ湡, 'yyyy-MM-dd')}}</div>" }
-                        , { field: 'hbilltype', title: 'hbilltype', hide: true }
-                        , { field: '鍗曟嵁鍙�', title: '鍗曟嵁鍙�' }
-                        , { field: '鍗曟嵁绫诲瀷', title: '鍗曟嵁绫诲瀷' }
-                        , { field: 'HMoudType', title: 'HMoudType', hide: true }
-                        , { field: 'hsubid', title: 'hsubid', hide: true }
+                        , { field: '鏃ユ湡', title: '鏃ユ湡', templet: "<div>{{d.鏃ユ湡 ==null ?'':layui.util.toDateString(d.鏃ユ湡, 'yyyy-MM-dd')}}</div>", sort: true }
+                        , { field: '鏉″舰鐮�', title: '鏉$爜缂栧彿', sort: true }
+                        , { field: 'HMaterID', title: 'HMaterID', hide: true, sort: true }
+                        , { field: '鐗╂枡鍚嶇О', title: '鐗╂枡鍚嶇О', sort: true }
+                        , { field: '璁惧浠g爜', title: '璁惧浠g爜', sort: true }
+                        , { field: '璁惧缂栫爜', title: '璁惧缂栫爜', sort: true }
+                        , { field: '璁惧鍚嶇О', title: '璁惧鍚嶇О', sort: true }
+                        , { field: '璁惧瑙勬牸', title: '璁惧瑙勬牸', sort: true }
+                        , { field: '璁惧鍨嬪彿', title: '璁惧鍨嬪彿', sort: true }
+                        , { field: 'HUnitID', title: 'HUnitID', hide: true, sort: true }
+                        , { field: '鍗曚綅', title: '鍗曚綅', sort: true }
+                        , { field: '璁惧鍑哄巶鏃ユ湡', title: '璁惧鍑哄巶鏃ユ湡', templet: "<div>{{d.璁惧鍑哄巶鏃ユ湡 ==null ?'':layui.util.toDateString(d.璁惧鍑哄巶鏃ユ湡, 'yyyy-MM-dd')}}</div>", sort: true }
+                        , { field: '璁惧鍑哄巶缂栧彿', title: '璁惧鍑哄巶缂栧彿', sort: true }
+                        , { field: 'HDeptID', title: 'HDeptID', hide: true, sort: true }
+                        , { field: '浣跨敤閮ㄩ棬', title: '浣跨敤閮ㄩ棬', sort: true }
+                        , { field: 'HUseEmpID', title: 'HUseEmpID', hide: true, sort: true }
+                        , { field: '浣跨敤璐熻矗浜�', title: '浣跨敤璐熻矗浜�', sort: true }
+                        , { field: 'HRepairEmpID', title: 'HRepairEmpID', hide: true, sort: true }
+                        , { field: '缁存姢璐熻矗浜�', title: '缁存姢璐熻矗浜�', sort: true }
+                        , { field: '瀹夎鍦扮偣', title: '瀹夎鍦扮偣', sort: true }
+                        , { field: '瀹夎鏃ユ湡', title: '瀹夎鏃ユ湡', templet: "<div>{{d.瀹夎鏃ユ湡 ==null ?'':layui.util.toDateString(d.瀹夎鏃ユ湡, 'yyyy-MM-dd')}}</div>", sort: true }
+                        , { field: '杩愯寮�濮嬫棩鏈�', title: '杩愯寮�濮嬫棩鏈�', templet: "<div>{{d.杩愯寮�濮嬫棩鏈� ==null ?'':layui.util.toDateString(d.杩愯寮�濮嬫棩鏈�, 'yyyy-MM-dd')}}</div>", sort: true }
+                        , { field: '褰撳墠鐘舵��', title: '褰撳墠鐘舵��', sort: true }
+                        , { field: 'HEquipFileTypeID', title: 'HEquipFileTypeID', hide: true, sort: true }
+                        , { field: '璁惧绫诲瀷', title: '璁惧绫诲瀷', sort: true }
+                        , { field: '宸ョ▼缂栫爜', title: '宸ョ▼缂栫爜', sort: true }
+                        , { field: '浜у搧', title: '浜у搧', sort: true }
+                        , { field: '鍝佺墝', title: '鍝佺墝', sort: true }
+                        , { field: 'HSellSupID', title: 'HSellSupID', hide: true, sort: true }
+                        , { field: '渚涘簲鍟�', title: '渚涘簲鍟�', sort: true }
+                        , { field: 'HMakeSupID', title: 'HMakeSupID', hide: true, sort: true }
+                        , { field: '鍒堕�犲晢', title: '鍒堕�犲晢', sort: true }
+                        , { field: '鍒跺崟浜�', title: '鍒跺崟浜�', sort: true }
+                        , { field: '鍒跺崟鏃ユ湡', title: '鍒跺崟鏃ユ湡', templet: "<div>{{d.鍒跺崟鏃ユ湡 ==null ?'':layui.util.toDateString(d.鍒跺崟鏃ユ湡, 'yyyy-MM-dd')}}</div>", sort: true }
+                        , { field: '瀹℃牳浜�', title: '瀹℃牳浜�', sort: true }
+                        , { field: '瀹℃牳鏃ユ湡', title: '瀹℃牳鏃ユ湡', templet: "<div>{{d.瀹℃牳鏃ユ湡 ==null ?'':layui.util.toDateString(d.瀹℃牳鏃ユ湡, 'yyyy-MM-dd')}}</div>", sort: true }
+                        , { field: '淇敼浜�', title: '淇敼浜�', sort: true }
+                        , { field: '淇敼鏃ユ湡', title: '淇敼鏃ユ湡', templet: "<div>{{d.淇敼鏃ユ湡 ==null ?'':layui.util.toDateString(d.淇敼鏃ユ湡, 'yyyy-MM-dd')}}</div>", sort: true }
+                        , { field: '鍏抽棴浜�', title: '鍏抽棴浜�', sort: true }
+                        , { field: '鍏抽棴鏃ユ湡', title: '鍏抽棴鏃ユ湡', templet: "<div>{{d.鍏抽棴鏃ユ湡 ==null ?'':layui.util.toDateString(d.鍏抽棴鏃ユ湡, 'yyyy-MM-dd')}}</div>", sort: true }
+                        , { field: 'hbilltype', title: 'hbilltype', hide: true, sort: true }
+                        , { field: '鍗曟嵁鍙�', title: '鍗曟嵁鍙�', sort: true }
+                        , { field: '鍗曟嵁绫诲瀷', title: '鍗曟嵁绫诲瀷', sort: true }
+                        , { field: 'HMoudType', title: 'HMoudType', hide: true, sort: true }
+                        , { field: 'hsubid', title: 'hsubid', hide: true, sort: true }
                     ]]
                 };
             }
@@ -239,7 +251,7 @@
                 var HNumber = $("#HNumber").val();
                 var HName = $("#HName").val();
                 if (HNumber) {
-                    sWhere += " and 璁惧缂栧彿 like '%" + HNumber + "%'";
+                    sWhere += " and 璁惧浠g爜 like '%" + HNumber + "%'";
                 }
                 if (HName) {
                     sWhere += " and 璁惧鍚嶇О like '%" + HName + "%'";
@@ -341,86 +353,71 @@
                 }
             }
 
-            //瀹℃牳
-            function set_CheckBill() {
+            //瀹℃牳/鍙嶅鏍�
+            function set_CheckBill(num) {
                 var checkStatus = table.checkStatus('mainTable')
                     , data = checkStatus.data;
-                if (checkStatus.data.length === 1) {
-                    var HBillStatus = data[0].HBillStatus.toString(); //鍗曟嵁鐘舵��
-                    var HInterID = data[0].hmainid.toString();
-                    if (HBillStatus > 0) {
-                        layer.msg('鍗曟嵁涓嶄负鏈鏍哥姸鎬侊紒');
-                        return false;
-                    }
-                    //閫昏緫瀹℃牳鏂规硶
-                    $.ajax({
-                        type: "GET",
-                        url: GetWEBURL() + "/Gy_Mould/AuditProcessReportList", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
-                        data: { "HInterID": HInterID,"IsAudit": 0, "CurUserName": sessionStorage["HUserName"] },
-                        success: function (result) {
-                            if (result.count == 1) {
-                                layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
-                                    // 寰楀埌frame绱㈠紩
-                                    var index = layer.getFrameIndex(window.name);
-                                    //鍏抽棴褰撳墠frame
-                                    layer.close(index);
-                                    //淇敼涓哄姛鍚庡埛鏂扮晫闈�
-                                    $("#btnSearch").trigger('click');
-                                });
 
-                            } else {
-                                layer.alert(result.code + result.Message, { icon: 5 });
+                if (data.length == 1) {
+                    layer.confirm("纭瑕佸鏍稿悧?", function (index) {
+                        var wait = layer.load();
+                        var HInterID = data[0].hmainid;
+                        $.ajax({
+                            url: GetWEBURL() + '/Gy_EquipFileBill/CheckGy_EquipFileBill',
+                            type: "GET",
+                            data: { "HInterID": HInterID, "Type": num, "user": sessionStorage["HUserName"] },
+                            success: function (result) {
+                                if (result.count == 1) {
+                                    get_FastQuery();
+                                    layer.msg(result.Message, { icon: 1 });
+                                    layer.close(wait);
+                                } else {
+                                    layer.alert(result.code + result.Message, { icon: 5 });
+                                    layer.close(wait);
+                                }
+                            }, error: function () {
+                                layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                                layer.close(wait);
                             }
-                        }, error: function () {
-                            layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
-                        }
-                    });
-                }
-                else {
-                    layer.msg('璇烽�夋嫨涓�琛屾暟鎹鏍革紒');
+                        });
+                    })
+                } else {
+                    layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�!");
                 }
             }
 
-            //鍙嶅鏍�
-            function set_AbandonCheck() {
+            //鍏抽棴/鍙嶅叧闂�
+            function set_CloseBill(num) {
                 var checkStatus = table.checkStatus('mainTable')
                     , data = checkStatus.data;
-                if (checkStatus.data.length === 1) {
-                    var HBillStatus = data[0].HBillStatus.toString(); //鍗曟嵁鐘舵��
-                    var HInterID = data[0].hmainid.toString();
-                    if (HBillStatus = 0) {
-                        layer.msg('鍗曟嵁宸蹭负鏈鏍哥姸鎬�,鏃犻渶鍙嶅鏍革紒');
-                        return false;
-                    }
-                    //閫昏緫瀹℃牳鏂规硶
-                    $.ajax({
-                        type: "GET",
-                        url: GetWEBURL() + "/Gy_Mould/AuditProcessReportList", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
-                        data: { "HInterID": HInterID, "IsAudit": 1, "CurUserName": sessionStorage["HUserName"] },
-                        success: function (result) {
-                            if (result.count == 1) {
-                                layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
-                                    // 寰楀埌frame绱㈠紩
-                                    var index = layer.getFrameIndex(window.name);
-                                    //鍏抽棴褰撳墠frame
-                                    layer.close(index);
-                                    //淇敼涓哄姛鍚庡埛鏂扮晫闈�
-                                    $("#btnSearch").trigger('click');
-                                });
 
-                            } else {
-                                layer.alert(result.code + result.Message, { icon: 5 });
+                if (data.length == 1) {
+                    layer.confirm("纭瑕佸叧闂悧?", function (index) {
+                        var wait = layer.load();
+                        var HInterID = data[0].hmainid;
+                        $.ajax({
+                            url: GetWEBURL() + '/Gy_EquipFileBill/CloseGy_EquipFileBill',
+                            type: "GET",
+                            data: { "HInterID": HInterID, "Type": num, "user": sessionStorage["HUserName"] },
+                            success: function (result) {
+                                if (result.count == 1) {
+                                    layer.msg(result.Message, { icon: 1 });
+                                    layer.close(wait);
+                                } else {
+                                    layer.alert(result.code + result.Message, { icon: 5 });
+                                    layer.close(wait);
+                                }
+                            }, error: function () {
+                                layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                                layer.close(wait);
                             }
-                        }, error: function () {
-                            layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
-                        }
-                    });
+                        });
+                    })
                 }
                 else {
-                    layer.msg('璇烽�夋嫨涓�琛屾暟鎹鏍革紒');
+                    layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�!");
                 }
-
-            }
+            }  
 
             //棰勮
             function get_ViewReport() {

--
Gitblit v1.9.1