From 7ae052d141e69fe9e19392172fc2960134a03232 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期一, 01 十二月 2025 15:54:52 +0800
Subject: [PATCH] 1.采购入库单列表、直接调拨单列表、其他出库单列表、生产入库列表、销售出库单列表:layui中开发 查看包装明细

---
 WebTM/views/质量管理/质量报表/QC_RegistrationForTestingReport.html |  176 +++++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 155 insertions(+), 21 deletions(-)

diff --git "a/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\350\264\250\351\207\217\346\212\245\350\241\250/QC_RegistrationForTestingReport.html" "b/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\350\264\250\351\207\217\346\212\245\350\241\250/QC_RegistrationForTestingReport.html"
index d17a999..6e62de4 100644
--- "a/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\350\264\250\351\207\217\346\212\245\350\241\250/QC_RegistrationForTestingReport.html"
+++ "b/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\350\264\250\351\207\217\346\212\245\350\241\250/QC_RegistrationForTestingReport.html"
@@ -102,6 +102,7 @@
                         </div>
                         <script type="text/html" id="toolbarDemo1">
                             <div class="layui-btn-container">
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn_Export" id="btn_Export"><i class="layui-icon layui-icon-export"></i>瀵煎嚭</button>
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn"><i class="layui-icon layui-icon-form"></i>鍒楄缃�</button>
                             </div>
                         </script>
@@ -117,7 +118,7 @@
         base: '../../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰�
     }).extend({
         index: 'lib/index', //涓诲叆鍙fā鍧�
-    }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate','soulTable'], function () {
+    }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate', 'soulTable'], function () {
 
         //#region 鍏叡鍙橀噺
         var $ = layui.$
@@ -131,8 +132,9 @@
             , soulTable = layui.soulTable
         var sWhere = "";
         var option = [];
+        var ins;                //鐢ㄤ簬瀵煎嚭excel
         var HModName = "QC_RegistrationForTestingReport";
-        var titleData = ["HInterID", "HEntryID", "HBadReasonID", "HSourceInterID", "HSourceEntryID"];//瀛愯〃涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
+        var titleData = ["HInterID", "HEntryID", "HBadReasonID", "HSourceInterID", "HSourceEntryID", "HInterIDLKY","HInterIDSZB"];//瀛愯〃涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
 
         //#endregion
 
@@ -152,6 +154,9 @@
             switch (obj.event) {
                 //鍒楄缃�
                 case 'set_HideColumn': get_HideColumn();
+                    break;
+                //瀵煎嚭鎸夐挳
+                case 'btn_Export': btn_Export();
                     break;
             };
         });
@@ -216,20 +221,20 @@
 
             var columns = [];
             columns.push({ type: 'checkbox', fixed: 'left', totalRowText: '鍚堣' });
-            columns.push({ field: '鏃ユ湡', title: '鏃ユ湡', sort: true, width: 180});
+            columns.push({ field: '鏃ユ湡', title: '鏃ユ湡', sort: true, width: 180 });
             columns.push({ field: '鐗╂枡浠g爜', title: '鐗╂枡浠g爜', sort: true, width: 180 });
             columns.push({ field: '鐗╂枡', title: '鐗╂枡', sort: true, width: 110 });
             columns.push({ field: '宸ュ簭', title: '宸ュ簭', sort: true, width: 110 });
             columns.push({ field: '鎵规鍙�', title: '鎵规鍙�', sort: true, width: 110 });
-            columns.push({ field: '(1)浜у搧鍗曢噸/g', title: '(1)浜у搧鍗曢噸/g', sort: true, totalRow: true, width: 140});
-            columns.push({ field: '(2)浜у搧鍗曢噸/g', title: '(2)浜у搧鍗曢噸/g', sort: true, totalRow: true, width: 140});
-            columns.push({ field: '(3)浜у搧鍗曢噸/g', title: '(3)浜у搧鍗曢噸/g', sort: true, totalRow: true, width: 140});
-            columns.push({ field: '閫佹祴鍐呭', title: '閫佹祴鍐呭', sort: true, width: 110});
-            columns.push({ field: '閫佹祴鏁伴噺', title: '閫佹祴鏁伴噺', sort: true, totalRow: true, width: 110});
-            columns.push({ field: '閫佹祴鏃堕棿', title: '閫佹祴鏃堕棿', sort: true, width: 180});
-            columns.push({ field: '鍒ゅ畾缁撴灉', title: '鍒ゅ畾缁撴灉', sort: true, width: 110});
-            columns.push({ field: '鍥炴敹鏁伴噺', title: '鍥炴敹鏁伴噺', sort: true, totalRow: true, width: 110});
-            columns.push({ field: '鍥炴敹鏃堕棿', title: '鍥炴敹鏃堕棿', sort: true, width: 180});
+            columns.push({ field: '(1)浜у搧鍗曢噸/g', title: '(1)浜у搧鍗曢噸/g', sort: true, totalRow: true, width: 140 });
+            columns.push({ field: '(2)浜у搧鍗曢噸/g', title: '(2)浜у搧鍗曢噸/g', sort: true, totalRow: true, width: 140 });
+            columns.push({ field: '(3)浜у搧鍗曢噸/g', title: '(3)浜у搧鍗曢噸/g', sort: true, totalRow: true, width: 140 });
+            columns.push({ field: '閫佹祴鍐呭', title: '閫佹祴鍐呭', sort: true, width: 110 });
+            columns.push({ field: '閫佹祴鏁伴噺', title: '閫佹祴鏁伴噺', sort: true, totalRow: true, width: 110 });
+            columns.push({ field: '閫佹祴鏃堕棿', title: '閫佹祴鏃堕棿', sort: true, width: 180 });
+            columns.push({ field: '鍒ゅ畾缁撴灉', title: '鍒ゅ畾缁撴灉', sort: true, width: 110 });
+            columns.push({ field: '鍥炴敹鏁伴噺', title: '鍥炴敹鏁伴噺', sort: true, totalRow: true, width: 110 });
+            columns.push({ field: '鍥炴敹鏃堕棿', title: '鍥炴敹鏃堕棿', sort: true, width: 180 });
             option = {
                 elem: '#mainTable'
                 , toolbar: '#toolbarDemo1'
@@ -238,7 +243,7 @@
                 //, cellMinWidth: 'auto'
                 , totalRow: true
                 , limit: 500
-                , data:[]
+                , data: []
                 , limits: [50, 500, 5000, 20000]
                 //, done: function (res, curr, count) {
                 //    soulTable.render(this);
@@ -272,6 +277,20 @@
                             for (var i = 0; i < data.length; i++) {
                                 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 == '涓夊潗鏍�') {//娣诲姞瓒呴摼鎺�
+                                    col.push({
+                                        field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200, event: '涓夊潗鏍�', templet: function (d) {
+                                            return '<span style="color: blue;">' + d.涓夊潗鏍� + '</span>'
+                                        }, style: 'cursor: pointer;'
+                                    });
+                                }
+                                else if (data[i].name == '杞粨浠�') {//娣诲姞瓒呴摼鎺�
+                                    col.push({
+                                        field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200, event: '杞粨浠�', templet: function (d) {
+                                            return '<span style="color: blue;">' + d.杞粨浠� + '</span>'
+                                        }, style: 'cursor: pointer;'
+                                    });
                                 }
                                 else {
                                     switch (data[i].Type) {
@@ -311,15 +330,10 @@
                             option.data = data1.data
                         }
 
-                  
                         table.render(option);
-
+                        ins = table.render(option);
                         //鍒锋柊琛ㄦ牸鏁版嵁
                         DisPlay_HideColumn();
-
-                        //if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") {
-                        //    ColFilter();
-                        //}
 
                         layer.close(ajaxLoad);
                     } else {
@@ -343,10 +357,10 @@
             var HProject = $("#HProject").val();//椤圭洰鍙�
             var HBatchWork = $("#HBatchWork").val();//鏄惁閲忎骇
             var HDivisionName = $("#HDivisionName").val();//浜嬩笟閮�
-        
+
             sWhere = {
                 HBeginDate: HBeginDate
-                ,HEndDate: HEndDate
+                , HEndDate: HEndDate
                 , HMaterID: HMaterID
                 , HBatchNo: HBatchNo
                 , HProject: HProject
@@ -422,6 +436,126 @@
         //#endregion
 
 
+        table.on('tool(mainTable)', function (obj) {
+            var data = obj.data;
+            if (obj.event == '涓夊潗鏍�') {
+                const HBillNo = data.涓夊潗鏍�.substring(0, 2);
+                var linterid = data.HInterIDSZB;
+                if (HBillNo == "SJ") {
+                    layer.open({
+                        type: 2
+                        , area: ['100%', '100%']
+                        , title: '鏌ョ湅棣栦欢妫�楠屽崟'
+                        , closeBtn: 1
+                        , shade: 0.6 //閬僵閫忔槑搴�
+                        , maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲
+                        , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
+                        , content: '../棣栦欢妫�楠屽崟/QC_Add_Edit_FirstPieceCheckBill.html?OperationType=3&linterid=' + linterid + '&HSouceBillType=0'
+                        , resize: false,
+                        end: function () {
+                        }
+                        , cancel: function () {
+                        }
+                    })
+                }
+                else if (HBillNo == "XJ") {
+                    layer.open({
+                        type: 2
+                        , area: ['100%', '100%']
+                        , title: '鏌ョ湅宸℃璁板綍鍗�'
+                        , closeBtn: 1
+                        , shade: 0.6 //閬僵閫忔槑搴�
+                        , maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲
+                        , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
+                        , content: '../宸℃璁板綍鍗�/QC_Add_Edit_PatrolProcCheckOtherill.html?OperationType=3&linterid=' + linterid + '&HSouceBillType=0'
+                        , resize: false,
+                        end: function () {
+                        }
+                        , cancel: function () {
+                        }
+                    })
+                }
+                else if (HBillNo == "GX") {
+                    layer.open({
+                        type: 2
+                        , area: ['100%', '100%']
+                        , title: '鏌ョ湅鏈妫�楠屽崟'
+                        , closeBtn: 1
+                        , shade: 0.6 //閬僵閫忔槑搴�
+                        , maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲
+                        , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
+                        , content: '../宸ュ簭妫�楠屽崟/QC_ProcessCheckBill.html?OperationType=3&linterid=' + linterid + '&HSouceBillType=0'
+                        , resize: false,
+                        end: function () {
+                        }
+                        , cancel: function () {
+                        }
+                    })
+                }
+            }
+            if (obj.event == '杞粨浠�') {
+                const HBillNo = data.杞粨浠�.substring(0, 2);
+                var linterid = data.HInterIDLKY;
+                if (HBillNo == "SJ") {
+                    layer.open({
+                        type: 2
+                        , area: ['100%', '100%']
+                        , title: '鏌ョ湅棣栦欢妫�楠屽崟'
+                        , closeBtn: 1
+                        , shade: 0.6 //閬僵閫忔槑搴�
+                        , maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲
+                        , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
+                        , content: '../棣栦欢妫�楠屽崟/QC_Add_Edit_FirstPieceCheckBill.html?OperationType=3&linterid=' + linterid + '&HSouceBillType=0'
+                        , resize: false,
+                        end: function () {
+                        }
+                        , cancel: function () {
+                        }
+                    })
+                }
+                else if (HBillNo == "XJ") {
+                    layer.open({
+                        type: 2
+                        , area: ['100%', '100%']
+                        , title: '鏌ョ湅宸℃璁板綍鍗�'
+                        , closeBtn: 1
+                        , shade: 0.6 //閬僵閫忔槑搴�
+                        , maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲
+                        , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
+                        , content: '../宸℃璁板綍鍗�/QC_Add_Edit_PatrolProcCheckOtherill.html?OperationType=3&linterid=' + linterid + '&HSouceBillType=0'
+                        , resize: false,
+                        end: function () {
+                        }
+                        , cancel: function () {
+                        }
+                    })
+                }
+                else if (HBillNo == "GX") {
+                    layer.open({
+                        type: 2
+                        , area: ['100%', '100%']
+                        , title: '鏌ョ湅鏈妫�楠屽崟'
+                        , closeBtn: 1
+                        , shade: 0.6 //閬僵閫忔槑搴�
+                        , maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲
+                        , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
+                        , content: '../宸ュ簭妫�楠屽崟/QC_ProcessCheckBill.html?OperationType=3&linterid=' + linterid + '&HSouceBillType=0'
+                        , resize: false,
+                        end: function () {
+                        }
+                        , cancel: function () {
+                        }
+                    })
+                }
+            }
+        });
+    
+        //#region 瀵煎嚭Execel
+        function btn_Export() {
+            table.exportFile(ins.config.id, option.data, "xls");
+        }
+        //#endregion
+
         //闅愯棌鍒楄缃�
         function get_HideColumn() {
             var colName = "";

--
Gitblit v1.9.1