From 3d240d150e6e1a4e2df1a9f87d00ddd03ace4ee5 Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期五, 17 一月 2025 10:06:37 +0800
Subject: [PATCH] 增加 BOM层级展开报表,修复全程追溯报表 黑白标页签导出失败,工艺路线的表头查询优化页面排序

---
 WebTM/views/计划管理/工艺路线/Gy_MaterialTechParamBillMain.html |  274 +++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 246 insertions(+), 28 deletions(-)

diff --git "a/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_MaterialTechParamBillMain.html" "b/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_MaterialTechParamBillMain.html"
index 39c9b8d..4bd3d76 100644
--- "a/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_MaterialTechParamBillMain.html"
+++ "b/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_MaterialTechParamBillMain.html"
@@ -177,6 +177,30 @@
                                     </div>
                                     <div class="layui-row">
                                         <div class="layui-inline">
+                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">妯″叿缂栫爜</label>
+                                            <div class="layui-input-block" style="margin-left: 77px;">
+                                                <input type="text" class="layui-input" lay-verify="HMouldNumber" name="HMouldNumber" id="HMouldNumber" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
+                                                <input type="hidden" name="HMouldID" id="HMouldID" lay-verify="HMouldID" value="0">
+                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchHMould" id="btnSearchHMould" style="padding: 0 10px;float: right;margin-right: 3px;">
+                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
+                                                </button>
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label" style="width: 75px;">妯″叿鍚嶇О</label>
+                                            <div class="layui-input-block" style="margin-left: 120px;">
+                                                <input type="text" class="layui-input" name="HMouldName" lay-verify="HMouldName" id="HMouldName" style="background-color:#efefef4d;" readonly>
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline">
+                                            <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="HMouldModel" lay-verify="HMouldModel" id="HMouldModel" style="background-color:#efefef4d;" readonly>
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="layui-row">
+                                        <div class="layui-inline">
                                             <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="HRemark" id="HRemark" lay-verify="HRemark" style=" width: 500px;">
@@ -389,27 +413,27 @@
                 $("#HMaker").val(sessionStorage["HUserName"]);
                 $("#HMakerDate").val(Format(new Date(), "yyyy-MM-dd"));
             }
-            //else if (OperationType == 2) {
-
-            //    RoadBillMain(linterid);
-            //    $.ajax({
-            //        url: GetWEBURL() + "/Web/GetMAXNum",
-            //        type: "GET",
-            //        async: false,
-            //        data: { "HBillType": '3301' },
-            //        success: function (d) {
-            //            $("#HInterID").val(d.data[0].HInterID);
-            //            $("#HBillNo").val(d.data[0].HBillNo);
-            //            $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
-            //        }
-            //    });
-            //}
+            else if (OperationType == 2) {
+                //鍒濆鍖栬〃鏍�
+                get_InitGrid();
+                RoadBillMain(linterid);
+                $.ajax({
+                    url: GetWEBURL() + "/Web/GetMAXNum",
+                    type: "GET",
+                    async: false,
+                    data: { "HBillType": '3334' },
+                    success: function (d) {
+                        $("#HInterID").val(d.data[0].HInterID);
+                        $("#HBillNo").val(d.data[0].HBillNo);
+                        $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
+                    }
+                });
+            }
             else if (OperationType == 3) {
 
                 //绂佺敤鎸夐挳
                 var num = 1;
                 HfBtn(num);
-                debugger;
                 //鍒濆鍖栬〃鏍�
                 get_InitGrid();
 
@@ -459,6 +483,12 @@
             //#region 閫夋嫨宸ュ簭鎸夐挳
             form.on('submit(btnSearchHProc)', function () {
                 get_checkSearchHProc();
+            });
+            //#endregion
+
+            //#region 閫夋嫨妯″叿鎸夐挳
+            form.on('submit(btnSearchHMould)', function () {
+                get_checkSearchHMould();
             });
             //#endregion
 
@@ -529,10 +559,10 @@
 
                 //鏂板琛岃〃鏍兼暟鎹�
                 var NewRow = {
-                    "HTechParamID": "",
+                    "HTechParamID": 0,
                     "HTechParamNumber": "",
                     "HTechParamName": "",
-                    "HTechParamUnitID": "",
+                    "HTechParamUnitID": 0,
                     "HTechParamUnitName": "",
                     "HStd": "0",
                     "HMax": "0",
@@ -540,6 +570,10 @@
                     "HDataForm": "璁惧閲囬泦",
                     "HDataUnit": "绉�",
                     "HDataTimes": "0",
+                    "HTechParamClassID": "0",
+                    "HSNO": "0",
+                    "HStdNextTimes": "0",
+                    "HTechParamIDStd":"0",
                     "HSourceBillNo": "0",
                     "HSourceBillType": "0",
                     "HSourceEntryID": "0",
@@ -627,13 +661,43 @@
                         , { field: 'HTechParamUnitName', title: '宸ヨ壓鍙傛暟鍗曚綅鍚嶇О', edit: 'text', event: "HTechParamUnitName" }     //f7
                         , { field: 'HStd', title: '鏍囧噯鍊�', edit: 'text', totalRow: true }
                         , { field: 'HMax', title: '涓婇檺', edit: 'text', totalRow: true }
+                        , { field: 'HMin', title: '涓嬮檺', edit: 'text', totalRow: true }
                         , { field: 'HDataForm', title: '閲囬泦鏉ユ簮', templet: '#HDataForm-select' }
                         , { field: 'HDataUnit', title: '閲囬泦鏃堕棿鍗曚綅', templet: '#HDataUnit-select' }
                         , { field: 'HDataTimes', title: '閲囬泦鍛ㄦ湡棰戠巼', edit: 'text', totalRow: true }
+                        , { field: 'HTechParamClassID', title: '宸ヨ壓鍙傛暟澶х被', hide: true }
+                        , { field: 'HTechParamClassName', title: '宸ヨ壓鍙傛暟澶х被鍚嶇О', edit: 'text', event: "HTechParamClassName" }     //f7
+                        , { field: 'HSNO', title: '宸ヨ壓娆″簭', edit: 'text', totalRow: true }
+                        , { field: 'HStdNextTimes', title: '鐞嗚娆″簭闂撮殧', edit: 'text', totalRow: true }
+                        , { field: 'HTechParamIDStd', title: '瀵瑰簲璁惧畾鍊煎伐鑹哄弬鏁�', hide: true }
+                        , { field: 'HTechParamIDStdName', title: '瀵瑰簲璁惧畾鍊煎伐鑹哄弬鏁板��', edit: 'text', event: "HTechParamIDStdName  " }     //f7
                         , { fixed: 'right', title: '鎿嶄綔', toolbar: '#barDemo' }
                     ]]
                 }
-                option.data = [];
+                var rowdata = [
+                    {
+                        "HTechParamID": 0,
+                        "HTechParamNumber": "",
+                        "HTechParamName": "",
+                        "HTechParamUnitID": 0,
+                        "HTechParamUnitName": "",
+                        "HStd": "0",
+                        "HMax": "0",
+                        "HMin": "0",
+                        "HDataForm": "璁惧閲囬泦",
+                        "HDataUnit": "绉�",
+                        "HDataTimes": "0",
+                        "HTechParamClassID": "0",
+                        "HSNO": "0",
+                        "HStdNextTimes": "0",
+                        "HTechParamIDStd": "0",
+                        "HSourceBillNo": "0",
+                        "HSourceBillType": "0",
+                        "HSourceEntryID": "0",
+                        "HSourceInterID": "0"
+                    }
+                ];
+                option.data = rowdata;
                 table.render(option);
 
             }
@@ -846,17 +910,44 @@
             }
             //#endregion
 
+            //#region 妯″叿閫夋嫨椤甸潰
+            function get_checkSearchHMould() {
+                layer.open({
+                    type: 2//寮圭獥绫诲瀷
+                    , skin: 'layui-layer-rim' //鍔犱笂杈规
+                    , area: ['90%', '90%']//澶у皬
+                    , title: '宸ュ簭琛�'//鏍囬
+                    , shift: 2//寮瑰嚭鍔ㄧ敾
+                    , content: ['../../妯℃不鍏风鐞�/妯℃不鍏风鐞�/Gy_MouldFileList.html', 'yes']
+                    , btn: ['纭畾', '鍙栨秷']
+                    , btn1: function (index, layero) {//鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
+                        var iframeWindow = window['layui-layer-iframe' + index]  //鑾峰彇寮规椤甸潰
+                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//鑾峰彇table鐨別lem:"#test"
+                        if (checkStatus.data.length === 0) {
+                            return layer.msg('璇烽�夋嫨鏁版嵁');
+                        }
+                        //鑾峰彇鏁版嵁
+                        $("#HMouldID").val(checkStatus.data[0].hmainid);
+                        $("#HMouldNumber").val(checkStatus.data[0].妯″叿缂栧彿);
+                        $("#HMouldName").val(checkStatus.data[0].妯″叿鍚嶇О);
+                        $("#HMouldModel").val(checkStatus.data[0].妯″叿鍨嬪彿);
+                        layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+                    }
+                    , btn2: function (index, layero) { }
+                })
+            }
+            //#endregion
+
             //#region 瀛愯〃锛氬揩鎹烽敭(F7)鎵撳紑寮圭獥
             function set_GridCellCheck(obj) {
                 $(document).off('keydown', ".layui-table-edit").on('keydown', '.layui-table-edit', function (e) {
                     if (event.key == "F7") {
                         //宸ヨ壓鍙傛暟
                         if (obj.event == "HTechParamNumber") {
-                            //鎵撳紑鍣ㄥ叿绠$悊灏忕獥浣�
                             layer.open({
                                 type: 2,
                                 skin: 'layui-layer-rim', //鍔犱笂杈规
-                                title: '妯″叿鍒楄〃',
+                                title: '宸ヨ壓鍒楄〃',
                                 closeBtn: 1,
                                 shift: 2,
                                 area: ['80%', '80%'],
@@ -870,12 +961,52 @@
                                     if (checkStatus.data.length === 0) {
                                         return layer.msg('璇烽�夋嫨鏁版嵁');
                                     }
-                                    obj.update({
-                                        "HTechParamID": checkStatus.data[0].HItemID,
-                                        "HTechParamNumber": checkStatus.data[0].宸ヨ壓鍙傛暟浠g爜,
-                                        "HTechParamName": checkStatus.data[0].宸ヨ壓鍙傛暟鍚嶇О,
 
-                                    });
+                                   // table.cache["mainTable"].splice(0, 1);
+                                    table.cache["mainTable"] = table.cache["mainTable"].filter(row => row.HTechParamID !== 0 && row.HTechParamID !== undefined);
+                                    for (var rowData of checkStatus.data) {
+                                        var NewRow = {
+                                            "HTechParamID": rowData.HItemID,
+                                            "HTechParamNumber": rowData.宸ヨ壓鍙傛暟浠g爜,
+                                            "HTechParamName": rowData.宸ヨ壓鍙傛暟鍚嶇О,
+                                            "HTechParamUnitID": 0,
+                                            "HTechParamUnitName": "",
+                                            "HStd": "0",
+                                            "HMax": "0",
+                                            "HMin": "0",
+                                            "HDataForm": "璁惧閲囬泦",
+                                            "HDataUnit": "绉�",
+                                            "HDataTimes": "0",
+                                            "HTechParamClassID": "0",
+                                            "HSNO": "0",
+                                            "HStdNextTimes": "0",
+                                            "HTechParamIDStd": "0",
+                                            "HSourceBillNo": "0",
+                                            "HSourceBillType": "0",
+                                            "HSourceEntryID": "0",
+                                            "HSourceInterID": "0"
+                                        };
+                                        table.cache["mainTable"].push(NewRow);
+                                    }
+                                    option.data = table.cache["mainTable"];
+                                    table.render(option);
+
+                                    //for (var i = 0; i < checkStatus.data.length; i++) {
+                                    //    option.data.push({
+                                    //        "HTechParamID": checkStatus.data[i].HItemID,
+                                    //        "HTechParamNumber": checkStatus.data[i].宸ヨ壓鍙傛暟浠g爜,
+                                    //        "HTechParamName": checkStatus.data[i].宸ヨ壓鍙傛暟鍚嶇О,
+                                    //    })
+                                    //}
+
+
+                                    //obj.update({
+                                    //    "HTechParamID": checkStatus.data[0].HItemID,
+                                    //    "HTechParamNumber": checkStatus.data[0].宸ヨ壓鍙傛暟浠g爜,
+                                    //    "HTechParamName": checkStatus.data[0].宸ヨ壓鍙傛暟鍚嶇О,
+
+                                    //});
+                                    //table.render(option);
                                     layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
                                 }
                                 , end: function () {
@@ -929,6 +1060,85 @@
                                         });
                                         OptionData = [];
                                     }
+                                }
+                            });
+                        }
+                        //宸ヨ壓鍙傛暟澶х被
+                        if (obj.event == "HTechParamClassName") {
+                            //鎵撳紑宸ヨ壓鍙傛暟澶х被灏忕獥浣�
+                            layer.open({
+                                type: 2,
+                                skin: 'layui-layer-rim', //鍔犱笂杈规
+                                title: '宸ヨ壓鍙傛暟澶х被',
+                                closeBtn: 1,
+                                shift: 2,
+                                area: ['80%', '80%'],
+                                maxmin: true,
+                                content: ['../../../views/鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_TechnologyParameterType.html', 'yes'],
+                                btn: ['纭畾', '鍙栨秷']
+                                , btn1: function (index, layero) {
+                                    //鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
+                                    var iframeWindow = window['layui-layer-iframe' + index]  //鑾峰彇寮规椤甸潰
+                                    var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//鑾峰彇table鐨別lem:"#test"
+                                    if (checkStatus.data.length === 0) {
+                                        return layer.msg('璇烽�夋嫨鏁版嵁');
+                                    }
+                                    obj.update({
+                                        "HTechParamClassID": checkStatus.data[0].HItemID,
+                                        "HTechParamClassName": checkStatus.data[0].宸ヨ壓鍙傛暟鍒嗙被鍚嶇О,
+
+                                    });
+                                    layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+                                }
+                                , end: function () {
+                                    //if (OptionData.length > 0) {
+                                    //    //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
+                                    //    obj.update({
+                                    //        "HTechParamClassID": OptionData[0].HItemID,
+                                    //        "HTechParamClassName": OptionData[0].宸ヨ壓鍙傛暟澶х被鍚嶇О,
+                                    //    });
+                                    //    OptionData = [];
+                                    //}
+                                }
+                            });
+                        }
+                        //瀵瑰簲璁惧畾鍊煎伐鑹哄弬鏁�
+                        if (obj.event == "HTechParamIDStdName") {
+                            //鎵撳紑瀵瑰簲璁惧畾鍊煎伐鑹哄弬鏁�(灏忕獥浣�
+                            layer.open({
+                                type: 2,
+                                skin: 'layui-layer-rim', //鍔犱笂杈规
+                                title: '瀵瑰簲璁惧畾鍊煎伐鑹哄弬鏁板垪琛�',
+                                closeBtn: 1,
+                                shift: 2,
+                                area: ['80%', '80%'],
+                                maxmin: true,
+                                content: ['../../../views/鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_TechnologyParameter.html', 'yes'],
+                                btn: ['纭畾', '鍙栨秷']
+                                , btn1: function (index, layero) {
+                                    //鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
+                                    var iframeWindow = window['layui-layer-iframe' + index]  //鑾峰彇寮规椤甸潰
+                                    var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//鑾峰彇table鐨別lem:"#test"
+                                    if (checkStatus.data.length === 0) {
+                                        return layer.msg('璇烽�夋嫨鏁版嵁');
+                                    }
+                                    obj.update({
+                                        "HTechParamIDStd": checkStatus.data[0].HItemID,
+                                        "HTechParamIDStdName": checkStatus.data[0].瀵瑰簲璁惧畾鍊煎伐鑹哄弬鏁板悕绉�,
+
+                                    });
+                                    layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+                                }
+                                , end: function () {
+                                    //if (OptionData.length > 0) {
+                                    //    //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
+                                    //    obj.update({
+                                    //        "HTechParamIDStd": OptionData[0].HItemID,
+                                    //        "HTechParamIDStdName": OptionData[0].瀵瑰簲璁惧畾鍊煎伐鑹哄弬鏁板悕绉�,
+
+                                    //    });
+                                    //    OptionData = [];
+                                    //}
                                 }
                             });
                         }
@@ -1103,8 +1313,8 @@
                             var tableSub = result.data[1];
                             //涓昏〃
                             form.val("formData", { //formTest 鍗� class="layui-form" 鎵�鍦ㄥ厓绱犲睘鎬� lay-filter="" 瀵瑰簲鐨勫��
-                                "HInterID": tableMain[0]["HInterID"]
-                                , "HBillNo": tableMain[0]["鍗曟嵁鍙�"]
+                                "HInterID": OperationType == 2 ? "" : tableMain[0]["HInterID"]
+                                , "HBillNo": OperationType == 2 ? "" : tableMain[0]["鍗曟嵁鍙�"]
                                 , "HDate": Format(new Date(tableMain[0]["鏃ユ湡"]), "yyyy-MM-dd")
                                 , "HMaterID": tableMain[0]["HMaterID"]
                                 , "HMaterNumber": tableMain[0]["鐗╂枡浠g爜"]
@@ -1114,6 +1324,10 @@
                                 , "HEquipNumber": tableMain[0]["璁惧浠g爜"]
                                 , "HEquipName": tableMain[0]["璁惧鍚嶇О"]
                                 , "HEquipModel": tableMain[0]["璁惧鍨嬪彿"]
+                                , "HMouldID": tableMain[0]["HMouldID"]
+                                , "HMouldNumber": tableMain[0]["妯″叿浠g爜"]
+                                , "HMouldName": tableMain[0]["妯″叿鍚嶇О"]
+                                , "HMouldModel": tableMain[0]["妯″叿鍨嬪彿"]
                                 , "HDeptID": tableMain[0]["HDeptID"]
                                 , "HDeptName": tableMain[0]["閮ㄩ棬"]
                                 , "HWorkCenterID": tableMain[0]["HWorkCenterID"]
@@ -1173,8 +1387,12 @@
                 for (var i = 0; i < table.cache["mainTable"].length; i++) {
                     if (table.cache["mainTable"][i] != "") {
                         table.cache["mainTable"][i].LAY_TABLE_INDEX = i;
+                        table.cache["mainTable"][i].HTechParamIDStd == null ? 0 : table.cache["mainTable"][i].HTechParamIDStd
                         num.push(table.cache["mainTable"][i])
                     }
+
+                   
+
                 }
                 var sMainStr = JSON.stringify(data.field);
                 var sSubStr = JSON.stringify(num);

--
Gitblit v1.9.1