From 97c0e58f43f33d051dba994054b31bf858b8fd87 Mon Sep 17 00:00:00 2001
From: chenhaozhe <cgz@hz-kingdee.com>
Date: 星期一, 03 十一月 2025 14:08:13 +0800
Subject: [PATCH] 来料检验单 优化

---
 WebTM/views/质量管理/来料检验单/QC_Add_Edit_POStockInCheckBillList.html |  191 +++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 173 insertions(+), 18 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_Add_Edit_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_Add_Edit_POStockInCheckBillList.html"
index 56a544b..72a1ebb 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_Add_Edit_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_Add_Edit_POStockInCheckBillList.html"
@@ -1683,13 +1683,151 @@
                                 }
                             });
                         }
-                        if(obj.event == 'HQualityStdID'){
+                        if (obj.event === 'HQualityStdID')  //
+                        {
+                            //椤甸潰灞�-鑷畾涔�
+                            layer.open({
+                                type: 2,
+                                skin: 'layui-layer-rim', //鍔犱笂杈规
+                                title: '璐ㄩ噺鏍囧噯鍒楄〃',
+                                closeBtn: 1,
+                                shift: 2,
+                                area: ['80%', '80%'],
+                                maxmin: true,
+                                content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_QualityStd.html?openType=2', 'yes'],
+                                btn: ['纭畾', '鍙栨秷']
+                                , btn1: function (index, layero) {
 
-                        }
-                        if(obj.event == 'HInspectMethodID') {
+                                    //鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
+                                    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({
+                                        HQualityStdID: checkStatus.data[0].HItemID,
+                                        HQualityStdName: checkStatus.data[0].璐ㄩ噺鏍囧噯鍚嶇О,
+                                    });
+                                    layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+                                }
+                                , btn2: function (index, layero) {
+                                    //鎸夐挳銆愭寜閽簩銆戠殑鍥炶皟
+                                    //return false 寮�鍚浠g爜鍙姝㈢偣鍑昏鎸夐挳鍏抽棴
+                                },
+                                end: function () {
+                                    if (OptionData.length == 0) { return }
+                                    if (OptionData[0].绂佺敤鏍囪 != '鏄�' || OptionData[0].瀹℃牳浜� != "") {
+                                        debugger
+                                        //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
+                                        obj.update({
+                                            "HQualityStdID": OptionData[0].HItemID
+                                            , "HQualityStdName": OptionData[0].璐ㄩ噺鏍囧噯鍚嶇О
+                                        })
+                                    } else {
+                                        layer.msg("璇ヨ川閲忔爣鍑嗗凡绂佺敤鏈鏍革紝璇烽噸鏂伴�夋嫨!");
+                                    }
+                                },
+                                success: function (layero, index) {
 
+                                }
+                            });
                         }
-                        if(obj.event == 'HInspectBasisID')
+                        if (obj.event === 'HInspectMethodID')  //
+                        {
+                            //椤甸潰灞�-鑷畾涔�
+                            layer.open({
+                                type: 2,
+                                skin: 'layui-layer-rim', //鍔犱笂杈规
+                                title: '妫�楠屾柟娉曞垪琛�',
+                                closeBtn: 1,
+                                shift: 2,
+                                area: ['80%', '80%'],
+                                maxmin: true,
+                                content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_InspectMethod.html?openType=2', '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({
+                                        HInspectMethodID: checkStatus.data[0].HItemID,
+                                        HInspectMethodName: checkStatus.data[0].妫�楠屾柟娉曞悕绉�,
+                                    });
+                                    layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+                                }
+                                , btn2: function (index, layero) {
+                                    //鎸夐挳銆愭寜閽簩銆戠殑鍥炶皟
+                                    //return false 寮�鍚浠g爜鍙姝㈢偣鍑昏鎸夐挳鍏抽棴
+                                },
+                                end: function () {
+                                    if (OptionData.length == 0) { return }
+                                    if (OptionData[0].绂佺敤鏍囪 != '鏄�' || OptionData[0].瀹℃牳浜� != "") {
+                                        //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
+                                        obj.update({
+                                            "HInspectMethodID": OptionData[0].HItemID
+                                            , "HInspectMethodName": OptionData[0].妫�楠屾柟娉曞悕绉�
+                                        })
+                                    } else {
+                                        layer.msg("璇ユ楠屾柟娉曞凡绂佺敤鏈鏍革紝璇烽噸鏂伴�夋嫨!");
+                                    }
+                                },
+                                success: function (layero, index) {
+
+                                }
+                            });
+                        }
+                        if (obj.event === 'HInspectBasisID')  //
+                        {
+                            //椤甸潰灞�-鑷畾涔�
+                            layer.open({
+                                type: 2,
+                                skin: 'layui-layer-rim', //鍔犱笂杈规
+                                title: '妫�楠屼緷鎹垪琛�',
+                                closeBtn: 1,
+                                shift: 2,
+                                area: ['80%', '80%'],
+                                maxmin: true,
+                                content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_InspectBasis.html?openType=2', '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({
+                                        HInspectBasisID: checkStatus.data[0].HItemID,
+                                        HInspectBasisName: checkStatus.data[0].妫�楠屼緷鎹悕绉�,
+                                    });
+                                    layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+                                }
+                                , btn2: function (index, layero) {
+                                    //鎸夐挳銆愭寜閽簩銆戠殑鍥炶皟
+                                    //return false 寮�鍚浠g爜鍙姝㈢偣鍑昏鎸夐挳鍏抽棴
+                                },
+                                end: function () {
+                                    if (OptionData.length == 0) { return }
+                                    if (OptionData[0].绂佺敤鏍囪 != '鏄�' || OptionData[0].瀹℃牳浜� != "") {
+                                        //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
+                                        obj.update({
+                                            "HInspectBasisID": OptionData[0].HItemID
+                                            , "HInspectBasisName": OptionData[0].妫�楠屼緷鎹悕绉�
+                                        })
+                                    } else {
+                                        layer.msg("璇ユ楠屼华鍣ㄥ凡绂佺敤鏈鏍革紝璇烽噸鏂伴�夋嫨!");
+                                    }
+                                },
+                                success: function (layero, index) {
+
+                                }
+                            });
+                        }
 
                         obj.event = "";
                         return false;
@@ -1866,6 +2004,7 @@
                 var sSubStr = JSON.stringify(table.cache['mainTable']);
                 var sSubValue = JSON.stringify(table.cache['ValueTable']);
                 var sMainSub = sMainStr + ';' + sSubStr + ';' + OperationType + ";" + sessionStorage["HUserName"] + ';' + sSubValue;
+
                 var index = layer.load();
                 $.ajax({
                     type: "POST",
@@ -2009,8 +2148,6 @@
                                 , HMainSourceInterID: data.HMainSourceInterID
                                 , HMainSourceEntryID: data.HMainSourceEntryID
                                 , HMainSourceBillType: data.HMainSourceBillType
-                                , HCompareSymbol: data["姣旇緝绗�"]
-
                             });
                             data = result.data;
                             //data = result.data.h_v_QC_Edit_POStockInCheckBillList;
@@ -2026,8 +2163,14 @@
                                         "HSampleSchemeID": data[i].HSampleSchemeID, "HUnitID": data[i].HUnitID,
                                         "HInspectVal": data[i].妫�娴嬪��, "HTargetVal": data[i].鐩爣鍊�, "HUpLimit": data[i].涓婇檺鍊�, "HDownLimit": data[i].涓嬮檺鍊�, "HUpOffSet": data[i].涓婂亸宸�, "HDownOffSet": data[i].涓嬪亸宸�, "HSampleDamageQty": data[i].鏍锋湰鐮村潖鏁�,
                                         "HSampleSchemeName": data[i].鎶芥牱鏂规鍚嶇О, "HSampleQty": data[i].鏍锋湰閲�, "HSampleDamageQty": data[i].鏍锋湰鐮村潖鏁�, "HAcceptQty": data[i].鍏佽鏁�, "HInspectionLevel": 0, "HRejectQty": data[i].鎷掔粷鏁�,
-                                        "HStrictness": 0, "HSampleUnRightQty": data[i].鏍锋湰涓嶅悎鏍兼暟, "HAQL": data[i].AQL, "HSamplingType": 0, "HSamplingType": data[i].鎶芥牱绫诲瀷, "HStrictness": data[i].涓ユ牸搴�, "HCompareSymbol": data[i]["姣旇緝绗�"]
-
+                                        "HCompareSymbol": data[i]["姣旇緝绗�"],
+                                        "HQualityStdID": data[i].HQualityStdID, "HQualityStdName": data[i]["璐ㄩ噺鏍囧噯"],
+                                        "HInspectMethodID": data[i]["HInspectMethodID"], "HInspectMethodName": data[i]["妫�楠屾柟娉�"], "HInspectBasisID": data[i]["HInspectBasisID"], "HInspectBasisName": data[i]["妫�楠屼緷鎹�"],
+                                        "HStatus": data[i].妫�楠岀粨鏋�,
+                                        "HStrictness": data[i].涓ユ牸搴�,
+                                        "HSampleUnRightQty": data[i].鏍锋湰涓嶅悎鏍兼暟,
+                                        "HAQL": data[i].AQL,
+                                        "HSamplingType": data[i].鎶芥牱绫诲瀷
                                     }
                                 )
                                 SummaryIndex.push(i.toString());
@@ -2425,7 +2568,9 @@
                                         "HMax": "", "HMin": "", "HAvg": "", "HRemark": "", "HKeyInspect": data[i]["閲嶇偣妫�鏌�"] == 1 ? true : false, "HStatus": 0, "HSampleSchemeID": data[i]["HSampleSchemeID"], "HUnitID": data[i]["HUnitID"],
                                         "HInspectVal": '', "HTargetVal": '', "HUpLimit": + data[i].涓婇檺鍊�, "HDownLimit": + data[i].涓嬮檺鍊�, "HUpOffSet": '', "HDownOffSet": '', "HSampleDamageQty": "0",
                                         "HSampleSchemeName": data[i].鎶芥牱鏂规鍚嶇О, "HSampleQty": data[i].鏍锋湰閲�, "HAcceptQty": data[i].鍏佽鏁�, "HInspectionLevel": data[i].妫�楠屾按骞�, "HRejectQty": data[i].鎷掔粷鏁�,
-                                        "HStrictness": data[i].涓ユ牸搴�, "HSampleUnRightQty": "", "HAQL": data[i].AQL, "HSamplingType": data[i].鎶芥牱绫诲瀷, "HCompareSymbol": data[i]["姣旇緝绗�"], "HTargetVal": data[i]['鐩爣鍊�']
+                                        "HStrictness": data[i].涓ユ牸搴�, "HSampleUnRightQty": "", "HAQL": data[i].AQL, "HSamplingType": data[i].鎶芥牱绫诲瀷, "HCompareSymbol": data[i]["姣旇緝绗�"], "HTargetVal": data[i]['鐩爣鍊�'],
+                                        "HQualityStdID": data[i].HQualityStdID, "HQualityStdName": data[i]["璐ㄩ噺鏍囧噯"],
+                                        "HInspectMethodID": data[i]["HInspectMethodID"], "HInspectMethodName": data[i]["妫�楠屾柟娉�"], "HInspectBasisID": data[i]["HInspectBasisID"], "HInspectBasisName": data[i]["妫�楠屼緷鎹�"],
                                     }
                                 );
                                 SampleNum.push(data[0].鏍锋湰閲�);
@@ -2964,9 +3109,8 @@
                     "HMax": "", "HMin": "", "HAvg": "", "HRemark": "", "HKeyInspect": false, "HStatus": 0, "HSampleSchemeID": 0, "HUnitID": 0,
                     "HInspectVal": '', "HTargetVal": '', "HUpLimit": '', "HDownLimit": '', "HUpOffSet": '', "HDownOffSet": '', "HSampleDamageQty": '0',
                     "HSampleSchemeName": "", "HSampleQty": "0", "HSampleDamageQty": "0", "HAcceptQty": "0", "HInspectionLevel": "", "HRejectQty": "",
-                    "HStrictness": "", "HSampleUnRightQty": "", "HAQL": "", "HSamplingType": "", "HQualityStdID": "0", "璐ㄩ噺鏍囧噯浠g爜": "", "璐ㄩ噺鏍囧噯": "",
-                    "HInspectMethodID": "0", "妫�楠屾柟娉曚唬鐮�": "", "妫�楠屾柟娉�": "", "HInspectBasisID": "0", "妫�楠屼緷鎹唬鐮�": "",
-                    "妫�楠屼緷鎹�": ""
+                    "HStrictness": "", "HSampleUnRightQty": "", "HAQL": "", "HSamplingType": "", "HQualityStdID": "0", "HQualityStdName": "",
+                    "HInspectMethodID": "0", "HInspectMethodName": "", "HInspectBasisID": "0", "HInspectBasisName": "",
                 }];
                 option = {
                     elem: '#mainTable'
@@ -2993,16 +3137,13 @@
                         , { field: 'HAnalysisMethod', title: '鍒嗘瀽鏂规硶', templet: '#HAnalysisMethod', event: 'HAnalysisMethod' }
                         , { field: 'HKeyInspect', title: '閲嶇偣妫�鏌�', templet: '#HKeyInspect', unresize: false }
                         , { field: 'HQualityStdID', title: 'HQualityStdID', edit: 'text', hide: true },
-                        , { field: '璐ㄩ噺鏍囧噯浠g爜', title: '璐ㄩ噺鏍囧噯浠g爜', edit: 'text', edit: true, event: "HQualityStdID" },
-                        , { field: '璐ㄩ噺鏍囧噯', title: '璐ㄩ噺鏍囧噯', edit: 'text' },
+                        , { field: 'HQualityStdName', title: '璐ㄩ噺鏍囧噯', edit: 'text', event: "HQualityStdID" },
 
                         , { field: 'HInspectMethodID', title: 'HInspectMethodID', edit: 'text', hide: true },
-                        , { field: '妫�楠屾柟娉曚唬鐮�', title: '妫�楠屾柟娉曚唬鐮�', edit: 'text', edit: true, event: "HInspectMethodID" },
-                        , { field: '妫�楠屾柟娉�', title: '妫�楠屾柟娉�', edit: 'text' },
+                        , { field: 'HInspectMethodName', title: '妫�楠屾柟娉�', edit: 'text', event: "HInspectMethodID" },
 
                         , { field: 'HInspectBasisID', title: 'HInspectBasisID', edit: 'text', hide: true },
-                        , { field: '妫�楠屼緷鎹唬鐮�', title: '妫�楠屼緷鎹唬鐮�', edit: 'text', edit: true, event: "HInspectBasisID" },
-                        , { field: '妫�楠屼緷鎹�', title: '妫�楠屼緷鎹�', edit: 'text' },
+                        , { field: 'HInspectBasisName', title: '妫�楠屼緷鎹�', edit: 'text', event: "HInspectBasisID" },
 
 
                         , { field: 'HQCStd', title: '妫�楠屾爣鍑�', edit: 'text' }
@@ -5075,6 +5216,20 @@
             OptionData = obj;
         }
 
+        //璐ㄩ噺鏍囧噯
+        function GetQualityStdValue(obj) {
+            OptionData = obj;
+        }
+        //妫�楠屾柟娉�
+        function GetInspectMethodValue(obj) {
+            OptionData = obj;
+        }
+
+        //妫�楠屼緷鎹�
+        function GetInspectBasisValue(obj) {
+            OptionData = obj;
+        }
+
     </script>
 </body>
 

--
Gitblit v1.9.1