From 81c93ee7a4bc6735ad8f69ea0ee7244eaa58d73f Mon Sep 17 00:00:00 2001
From: YL <YL@LAPTOP-SE03PLUR>
Date: 星期二, 15 二月 2022 08:32:07 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MESWMS-LayUI

---
 WebTM/views/设备管理/Sb_Add_EqpMaintenanceBillList.html |   84 ++++++++++++++++++++++++++++++++++++------
 1 files changed, 72 insertions(+), 12 deletions(-)

diff --git "a/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_Add_EqpMaintenanceBillList.html" "b/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_Add_EqpMaintenanceBillList.html"
index 61de300..c46dcb6 100644
--- "a/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_Add_EqpMaintenanceBillList.html"
+++ "b/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_Add_EqpMaintenanceBillList.html"
@@ -17,7 +17,7 @@
 <body>
 
     <div id="layout1" class="layui-fluid">
-        <div class="layui-row layui-col-space15">
+        <div class="layui-row layui-col-space15">                                                                
             <div class="layui-col-md12">
                 <div class="layui-card">
                     <form id="form0" class="layui-form" lay-filter="component-form-group" action="">
@@ -295,7 +295,7 @@
             table.on('toolbar(mainTable)', function (obj) {
                 var checkStatus = table.checkStatus('mainTable')
                     , data = checkStatus.data;;
-                var NewRow = { "HRepairID1": 0, "HRepairCode": "", "HRepairName": "", "HManagerID1": 0, "HManagerCode": "", "HManagerName": "", "HRepairExplanation": "", "HRemark": "" };
+                var NewRow = { "HRepairID": 0, "HRepairCode": "", "HRepairName": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRepairExplanation": "", "HRemark": ""/*, "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": " ", "HSourceBillType": " " */};
                 switch (obj.event) {
                     //澧炲姞涓�琛�
                     case 'btn-AddLine': set_AddLine(NewRow);
@@ -503,7 +503,8 @@
                     }
                 });
             });
-            //#region 琛ㄥご淇℃伅閫夋嫨鍗曟嵁寮圭獥
+
+            //琛ㄥご淇℃伅閫夋嫨鍗曟嵁寮圭獥
             form.on('submit(XDHList)', function () {
                 //椤甸潰灞�-鑷畾涔�
                 layer.open({
@@ -515,7 +516,8 @@
                     content: ['../璁惧绠$悊/Sb_EqpConkBookBillList.html', 'yes'],
                     btn: ['纭畾', '鍙栨秷']
                     , btn1: function (index, layero) {
-                        //鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
+                        //var NewRow = { "HRepairID": 0, "HRepairCode": "", "HRepairName": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRepairExplanation": "", "HRemark": "", "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": " ", "HSourceBillType": " " };
+                        ////鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
                         var iframeWindow = window['layui-layer-iframe' + index]  //鑾峰彇寮规椤甸潰
                         var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//鑾峰彇table鐨別lem:"#test"
                         if (checkStatus.data.length === 0) {
@@ -524,6 +526,49 @@
                         $("#HMainSourceBillNo").val(checkStatus.data[0].鍗曟嵁鍙�);
                         $("#HMainSourceInterID").val(checkStatus.data[0].hmainid);
                         $("#HMainSourceEntryID").val(checkStatus.data[0].hsubid);
+                        ////鎸夐�夊崟鍙峰姞杞借〃浣撴暟鎹�
+                        //$.ajax({
+                        //    url: GetWEBURL() + 'Sb_EqpRepairWorkBill/Sb_EqpRepairWorkBillSubByHMainSourceBillNo',
+                        //    type: "GET",
+                        //    data: { "HMainSourceBillNo": checkStatus.data[0].鍗曟嵁鍙� },
+                        //    success: function (result) {
+                        //        if (result.count == 1) {
+                        //            var EndData = result.data;
+                        //            var rowdate = layui.table.cache["mainTable"];
+                        //            if (rowdate.length == 0)  //琛ㄤ綋鏁版嵁涓虹┖鏃�
+                        //            {
+                        //                buttonArr = [];//娓呯┖鏁扮粍
+                        //                for (var i = 0; i < checkStatus.data.length; i++) {
+                        //                    var checkrow = { "HRepairID": 0, "HRepairCode": "", "HRepairName": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRepairExplanation": "", "HRemark": "", "HSourceInterID": EndData[i].hmainid, "HSourceEntryID": EndData[i].hsubid, "HSourceBillNo": EndData[i].鍗曟嵁鍙�, "HSourceBillType": EndData[i].HBillType };
+                        //                    buttonArr.push(checkrow);  //灏嗕箣鍓嶇殑鏁版嵁瀛樺偍
+                        //                }
+                        //                table.reload("mainTable", {
+                        //                    data: buttonArr    //灏嗘暟鎹噸鏂拌浇鍏ヨ〃鏍�
+                        //                })
+                        //            }
+                        //            else {
+                        //                buttonArr = [];//娓呯┖鏁扮粍
+                        //                for (var i = 0; i < EndData.length; i++) {
+                        //                    var checkrow = {
+                        //                        "HRepairID": rowdate[i].HRepairID, "HRepairCode": rowdate[i].HRepairCode, "HRepairName": rowdate[i].HRepairName,
+                        //                        "HRepairExplanation": rowdate[i].HRepairExplanation, "HManagerID": rowdate[i].HManagerID, "HManagerCode": rowdate[i].HManagerCode,
+                        //                        "HManagerName": rowdate[i].HManagerName, "HMoney": rowdate[i].HMoney, "HRemark": rowdate[i].HRemark,
+                        //                        "HSourceInterID": EndData[i].hmainid, "HSourceEntryID": EndData[i].hsubid,
+                        //                        "HSourceBillNo": EndData[i].鍗曟嵁鍙�, "HSourceBillType": EndData[i].HBillType
+                        //                    };
+                        //                    buttonArr.push(checkrow);  //灏嗕箣鍓嶇殑鏁版嵁瀛樺偍
+                        //                }
+                        //                table.reload("mainTable", {
+                        //                    data: buttonArr    //灏嗘暟鎹噸鏂拌浇鍏ヨ〃鏍�
+                        //                })
+                        //            }
+                        //        } else {
+                        //            layer.alert(result.code + result.Message, { icon: 5 });
+                        //        }
+                        //    }, error: function () {
+                        //        layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                        //    }
+                        //});
                         layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
                     }
                     , btn2: function (index, layero) {
@@ -545,7 +590,7 @@
                 data.field.HMaker = sessionStorage["HUserName"];//鍒跺崟浜�
                 var sMainStr = JSON.stringify(data.field);
                 var sSubStr = JSON.stringify(table.cache['mainTable']);
-                var sMainSub = sMainStr + ';' + sSubStr;
+                var sMainSub = sMainStr + ';' + sSubStr + ";" + sessionStorage["HUserName"];
                 //瀵规暟鎹繘琛岄獙璇�
                 if (AllowLoadData(sSubStr)) {
                     $.ajax(
@@ -564,7 +609,7 @@
                                     });
                                 }
                                 else {
-                                    f_alert(data.Message);
+                                    layui.alert("淇濆瓨澶辫触")
                                     console.log("Reason" + sMainStr + "sub:" + JSON.stringify(layui.table.cache.mainTable));
                                 }
                                 layer.closeAll("loading");
@@ -615,14 +660,18 @@
                 columns = [
                     { type: 'checkbox', fixed: 'left' }
                     , { templet: '#xuhao', title: '搴忓彿', sort: true, fixed: 'left', event: "qwe" }
-                    , { field: 'HRepairID1', title: 'HRepairID1', edit: 'text', event: "", hide: true }
+                    , { field: 'HRepairID', title: 'HRepairID', edit: 'text', event: "", hide: true }
                     , { field: 'HRepairCode', title: '缁翠慨椤圭洰浠g爜', edit: 'text', event: "", event: "HRepairCode" }
                     , { field: 'HRepairName', title: '缁翠慨椤圭洰', edit: 'text', event: "" }
-                    , { field: 'HManagerID1', title: 'HManagerID1', edit: 'text', hide: true }
+                    , { field: 'HManagerID', title: 'HManagerID', edit: 'text', hide: true }
                     , { field: 'HManagerCode', title: '璐熻矗浜轰唬鐮�', edit: 'text', event: "HManagerCode" }
                     , { field: 'HManagerName', title: '璐熻矗浜�', edit: 'text' }
                     , { field: 'HRepairExplanation', title: '缁翠慨瑕佹眰', edit: 'text' }
                     , { field: 'HRemark', title: '澶囨敞', event: "", edit: 'text' }
+                    //, { field: 'HSourceInterID', title: '婧愬崟涓诲唴鐮�' }
+                    //, { field: 'HSourceEntryID', title: '婧愬崟瀛愬唴鐮�' }
+                    //, { field: 'HSourceBillNo', title: '婧愬崟鍗曞彿' }
+                    //, { field: 'HSourceBillType', title: '婧愬崟绫诲瀷' }
                     , { fixed: 'right', title: '鎿嶄綔', toolbar: '#barDemo', width: 150 }
                 ];
                 option = {
@@ -643,7 +692,7 @@
             function set_AddFNew() {
                 //鑾峰彇鏈�澶у崟鎹彿
                 get_MAXNum();
-                option.data = [{ "HRepairID1": 0, "HRepairCode": "", "HRepairName": "", "HManagerID1": 0, "HManagerCode": "", "HManagerName": "", "HRepairExplanation": "", "HRemark": "" }];
+                option.data = [{ "HRepairID": 0, "HRepairCode": "", "HRepairName": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRepairExplanation": "", "HRemark": ""/*, "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": " ", "HSourceBillType": " "*/ }];
                 table.render(option);
             }
 
@@ -671,7 +720,7 @@
             function set_EditFromGrid() {
                 set_EditForm(linterid);  //缂栬緫鑾峰彇琛ㄥご
                 set_EditGrid(linterid);  //缂栬緫鑾峰彇琛ㄤ綋
-                option.data = [{ "HRepairID1": 0, "HRepairCode": "", "HRepairName": "", "HManagerID1": 0, "HManagerCode": "", "HManagerName": "", "HRepairExplanation": "", "HRemark": "" }];
+                option.data = [{ "HRepairID": 0, "HRepairCode": "", "HRepairName": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRepairExplanation": "", "HRemark": ""/*, "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": " ", "HSourceBillType": " " */}];
                 table.render(option);
             }
 
@@ -806,7 +855,7 @@
                                     }
                                     //鍚屾鏇存柊琛ㄦ牸鍜岀紦瀛樺搴旂殑鍊�
                                     obj.update({
-                                        HRepairID1: checkStatus.data[0].HItemID,
+                                        HRepairID: checkStatus.data[0].HItemID,
                                         HRepairCode: checkStatus.data[0].HNumber,
                                         HRepairName: checkStatus.data[0].HName,
                                     });
@@ -847,7 +896,7 @@
 
                                     //鍚屾鏇存柊琛ㄦ牸鍜岀紦瀛樺搴旂殑鍊�
                                     obj.update({
-                                        HManagerID1: checkStatus.data[0].HItemID,
+                                        HManagerID: checkStatus.data[0].HItemID,
                                         HManagerCode: checkStatus.data[0].HNumber,
                                         HManagerName: checkStatus.data[0].HName
                                     });
@@ -902,6 +951,17 @@
                 }
             }
 
+            //鍒ゆ柇婧愬崟甯﹀洖鏁版嵁鏁扮粍涓殑鍊兼槸鍚︾浉鍚�
+            function isAllEqual(array) {
+                if (array.length > 0) {
+                    return !array.some(function (value, index) {
+                        return value !== array[0];
+                    });
+                } else {
+                    return true;
+                }
+            }
+
             //鏁版嵁楠岃瘉
             function AllowLoadData(sSubStr) {  //sSubStr
 

--
Gitblit v1.9.1