From 9aee5998cdeb8568cd88ffb9583726b770b59ff8 Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期三, 03 七月 2024 23:39:39 +0800
Subject: [PATCH] 巡检记录单增加默认值,安灯呼叫增加子表复选框

---
 WebTM/views/质量管理/巡检记录单/QC_Add_Edit_PatrolProcCheckOtherill.html |   16 ++++----
 WebTM/views/质量管理/安灯逐级呼叫规则/OA_AndengFlowRuleBillMain.html        |   72 +++++++++++++++++++++++++++++++-----
 2 files changed, 70 insertions(+), 18 deletions(-)

diff --git "a/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\345\256\211\347\201\257\351\200\220\347\272\247\345\221\274\345\217\253\350\247\204\345\210\231/OA_AndengFlowRuleBillMain.html" "b/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\345\256\211\347\201\257\351\200\220\347\272\247\345\221\274\345\217\253\350\247\204\345\210\231/OA_AndengFlowRuleBillMain.html"
index 32bf96b..b9d1a74 100644
--- "a/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\345\256\211\347\201\257\351\200\220\347\272\247\345\221\274\345\217\253\350\247\204\345\210\231/OA_AndengFlowRuleBillMain.html"
+++ "b/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\345\256\211\347\201\257\351\200\220\347\272\247\345\221\274\345\217\253\350\247\204\345\210\231/OA_AndengFlowRuleBillMain.html"
@@ -225,7 +225,14 @@
             <option value="娑堟伅">娑堟伅</option>
             <option value="鍚屾椂鎺ユ敹">鍚屾椂鎺ユ敹</option>
         </select>
-    </script>   
+    </script>
+
+    <!--澶嶉�夋 瀹屾垚鏍囪-->
+    <script type="text/html" id="HIsRece">
+        <div class="layui-input-block" style="margin-left: 20px;">
+            <input type="checkbox" name="HIsRece" lay-filter="HIsRece" id="HIsRece{{d.LAY_TABLE_INDEX+1}}" lay-skin="primary">
+        </div>
+    </script>
 
     <script>
 
@@ -395,6 +402,8 @@
                     , "HDutyNumber": ""
                     , "HDutyName": ""
                     , "HTimes": ""
+                    ,"HReceiveType":""
+                    , "HIsRece": false
                     , "HRemark": ""
                     , "HReceiveType": ""
                     , "HSourceInterID": "0"
@@ -407,11 +416,19 @@
                         table.cache["mainTable"].push(NewRow);
                         option.data = table.cache["mainTable"];
                         table.render(option);
+                        CheckedSet_tableSub();
                         for (var i = 1; i <= option.data.length; i++) {
-                            $('#HReceiveType' + i + '').find("option[value='" + option.data[i - 1].HReceiveType + "']").attr("selected", true);
-
+                            $('#HReceiveType' + i + '').find("option[value='" + option.data[i - 1].HReceiveType + "']").attr("selected", true);                            
                         }
+                        for (var i = 1; i <= option.data.length; i++) {
+                            //瀹屾垚鏍囪
+                            if (option.data[i - 1].HIsRece) {
+                                $('#HIsRece' + i + '').attr("checked", true);
+                            }
+                        }
+                      
                         form.render('select');
+                        form.render('checkbox');
                         break;
                     case 'btn-CopyLine':
                         var copydata = JSON.stringify(data);
@@ -427,11 +444,19 @@
                             table.cache["mainTable"].push(JSON.parse(copyrow));//灏嗗鍒剁殑琛屽己杞垚json杩藉姞鍒拌〃鏍间笂
                             option.data = table.cache["mainTable"];//灏嗘暟鎹粦瀹氬埌data涓�
                             table.render(option);//灏嗘暟鎹覆鏌撳埌琛ㄦ牸涓�
+                            CheckedSet_tableSub();
                             for (var i = 1; i <= option.data.length; i++) {
                                 $('#HReceiveType' + i + '').find("option[value='" + option.data[i - 1].HReceiveType + "']").attr("selected", true);
-
                             }
+                            for (var i = 1; i <= option.data.length; i++) {
+                                //瀹屾垚鏍囪
+                                if (option.data[i - 1].HIsRece) {
+                                    $('#HIsRece' + i + '').attr("checked", true);
+                                }
+                            }
+
                             form.render('select');
+                            form.render('checkbox');
                         }
                         break;
                     //涓婁竴琛�
@@ -550,7 +575,7 @@
                         , { field: 'HDutyName', title: '鑱屽姟鍚嶇О', edit: 'text', event: "HDutyName", style: 'background-color: #f9f9f9;' } //f7
                         , { field: 'HTimes', title: '瑙﹀彂鏃堕棿', edit: 'text', style: 'background-color: #f9f9f9;', }
                         , { field: 'HReceiveType', title: '鎺ユ敹妯″紡', style: 'background-color: #f9f9f9;', templet: '#HReceiveType' }
-
+                        , { field: 'HIsRece', title: '瀹屾垚鏍囪', templet: "#HIsRece" }//checkbox
                         , { field: 'HRemark', title: '澶囨敞', edit: 'text' }
                         , { field: 'HSourceInterID', title: '婧愬崟鍐呯爜', hide: true, style: 'background-color: #f9f9f9;' }     //f7
                         , { field: 'HSourceEntryID', title: '婧愬崟瀛愬唴鐮�', hide: true, style: 'background-color: #f9f9f9;' }     //f7
@@ -568,7 +593,8 @@
                         , "HDutyName": ""
                         , "HTimes": ""
                         , "HRemark": ""
-                        , "HReceiveType": "鐭俊" 
+                        , "HReceiveType": "鐭俊"
+                        , "HIsRece": false
                         , "HSourceInterID": "0"
                         , "HSourceEntryID": "0"
                         , "HSourceBillNo": ""
@@ -590,6 +616,19 @@
                 $.each(option.data, function (index, value) {
                     if (value.LAY_TABLE_INDEX == dataindex) {
                         value.HReceiveType = data.value;//鎶婇�変腑涓嬫媺妗唅d鍊艰祴鍊肩粰琛ㄦ牸缂撳瓨
+                    }
+                });
+            });
+            //#endregion
+
+            //#region 瀹屾垚鏍囪
+            form.on('checkbox(HIsRece)', function (data) {
+                //鑾峰彇涓嬫媺妗嗛�変腑鐨勫��
+                var elem = data.othis.parents('tr');
+                var dataindex = elem.attr("data-index");
+                $.each(option.data, function (index, value) {
+                    if (value.LAY_TABLE_INDEX == dataindex) {
+                        value.HIsRece = data.elem.checked;//鎶婇�変腑涓嬫媺妗唅d鍊艰祴鍊肩粰琛ㄦ牸缂撳瓨
                     }
                 });
             });
@@ -789,7 +828,7 @@
                                 {
                                     "HSNO": tableSub[i].娴佺▼鍙�, "HDutyID": tableSub[i].HDutyID, "HDutyNumber": tableSub[i].鑱屽姟缂栫爜,
                                     "HDutyName": tableSub[i].鑱屽姟, "HTimes": tableSub[i].瑙﹀彂鏃堕棿, "HRemark": tableSub[i].澶囨敞,
-                                    "HReceiveType": tableSub[i].鎺ユ敹妯″紡
+                                    "HReceiveType": tableSub[i].鎺ユ敹妯″紡, "HIsRece": tableSub[i].鏄惁鍙戦��
                                 }
                             )
                         }
@@ -797,14 +836,14 @@
                         table.render(option);
                         for (var i = 0; i < rowdata.length; i++) {
                             $('#HReceiveType' + (i + 1)).find("option[value='" + tableSub[i].鎺ユ敹妯″紡 + "']").attr("selected", true);
+                            $('#HIsRece' + (i + 1)).attr("checked", true);
                         }
                         form.render('select');
                         form.render('checkbox');
                     }
                 })
             }
-            //#endregion
-
+            //#endregion          
 
 
             //#region 瀹℃牳
@@ -956,6 +995,19 @@
             }
             //#endregion
 
+            //#region 鍒锋柊璁剧疆澶嶉�夋鐘舵��
+            function CheckedSet_tableSub() {
+                var tableSub = option.data;
+                //瀵瑰瓙琛ㄤ腑鐨勫閫夋杩涜閫変腑
+                for (var i = 0; i < tableSub.length; i++) {
+                    if (tableSub[i].HIsRece) {
+                        $('#HIsRece' + (i + 1)).attr("checked", true);
+                    }
+                }
+                form.render('checkbox');
+            }
+            //#endregion
+
 
             //#region 闅愯棌鍒楄缃�
             function get_HideColumn() {
@@ -1102,7 +1154,7 @@
                 $("#HReceiveDeptName").val(obj[0].閮ㄩ棬鍚嶇О);
                 $("#HReceiveDeptID").val(obj[0].HItemID);
             }
-           
+
         }
         //寮傚父鍛煎彨绫诲瀷
         function GetErrMsgBackTypeValue(obj) {
diff --git "a/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\345\267\241\346\243\200\350\256\260\345\275\225\345\215\225/QC_Add_Edit_PatrolProcCheckOtherill.html" "b/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\345\267\241\346\243\200\350\256\260\345\275\225\345\215\225/QC_Add_Edit_PatrolProcCheckOtherill.html"
index e427313..1a651ac 100644
--- "a/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\345\267\241\346\243\200\350\256\260\345\275\225\345\215\225/QC_Add_Edit_PatrolProcCheckOtherill.html"
+++ "b/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\345\267\241\346\243\200\350\256\260\345\275\225\345\215\225/QC_Add_Edit_PatrolProcCheckOtherill.html"
@@ -411,7 +411,7 @@
                                     <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="HRejectQty" id="HRejectQty" style="background-color:#efefef4d;" readonly>
+                                            <input type="text" class="layui-input" name="HRejectQty" id="HRejectQty"  value="0" style="background-color:#efefef4d;" readonly>
                                         </div>
                                     </div>
                                     <!--<div class="layui-inline">
@@ -1008,8 +1008,8 @@
                     "HQCCheckItemID": "", "妫�楠岄」鐩�": "", "HInspectInstruMentID": "0", "妫�楠屼华鍣�": "", "HQCStd": "", "HUnit": "", "HQCNote": "", "HAnalysisMethod": "", "HResult": "",
                     "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": ""
+                    "HSampleSchemeName": "", "HSampleQty": "0", "HSampleDamageQty": "0", "HAcceptQty": "0", "HInspectionLevel": "", "HRejectQty": "0",
+                    "HStrictness": "", "HSampleUnRightQty": "0", "HAQL": "", "HSamplingType": ""
                 };
 
                 switch (obj.event) {
@@ -2235,7 +2235,7 @@
                     "HQCCheckItemID": "", "妫�楠岄」鐩�": "", "HInspectInstruMentID": "0", "妫�楠屼华鍣�": "", "HQCStd": "", "HUnit": "", "HQCNote": "", "HAnalysisMethod": "", "HResult": "",
                     "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": "",
+                    "HSampleSchemeName": "", "HSampleQty": "0", "HSampleDamageQty": "0", "HAcceptQty": "0", "HInspectionLevel": "", "HRejectQty": "0",
                     "HStrictness": "", "HSampleUnRightQty": "0", "HAQL": "", "HSamplingType": ""
                 }];
                 option = {
@@ -2681,16 +2681,16 @@
                     $("#HSampleQty2").val("")
                     $("#HAcceptQty").val("0")
                     $("#HInspectionLevel").val("")
-                    $("#HRejectQty").val("")
+                    $("#HRejectQty").val("0")
                     $("#HStrictness").val("")
-                    $("#HSampleUnRightQty").val("")
-                    $("#HSampleUnRightQty2").val("")
+                    $("#HSampleUnRightQty").val("0")
+                    $("#HSampleUnRightQty2").val("0")
                     $("#HAQL").val("")
                     $("#HSamplingType").val("")
                     $("#HSampleQty").val("0")
                     $("#HInspectResultToSee").val("")
                     $("#HInspectResultToSee2").val("")
-                    $("#HSampleUnRightQty").val("")
+                    $("#HSampleUnRightQty").val("0")
                     $("#HUnitID").val("0")
                     $("#HUnitName").val("")
                     $("#HInspectValB").val("0")

--
Gitblit v1.9.1