From ccaea4025c1459f2eeeb43dd6618f8492be33f5a Mon Sep 17 00:00:00 2001
From: zzr99 <1940172413@qq.com>
Date: 星期四, 25 十一月 2021 19:08:38 +0800
Subject: [PATCH] 设备Bug修复

---
 WebTM/views/设备管理/设备规程单/Sb_EquipDotCheckRuleList.html |    8 +
 WebTM/views/设备管理/Sb_EquipDotCheckBillEdit.html       |    4 
 WebTM/views/设备管理/设备规程单/Sb_EquipMaintainRuleList.html |    2 
 WebTM/views/设备管理/Sb_Add_EqpRepairCheckBillList.html  |    2 
 WebTM/views/设备管理/设备规程单/Sb_EquipDotCheckRuleEdit.html |  203 ++++++++++++++++++++++++++------------------------
 5 files changed, 118 insertions(+), 101 deletions(-)

diff --git "a/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_Add_EqpRepairCheckBillList.html" "b/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_Add_EqpRepairCheckBillList.html"
index e3a79b4..9a51e11 100644
--- "a/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_Add_EqpRepairCheckBillList.html"
+++ "b/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_Add_EqpRepairCheckBillList.html"
@@ -405,7 +405,7 @@
                 var sMainStr = JSON.stringify(data.field);
                 var sSubStr = JSON.stringify(table.cache['mainTable']);
                 var sMainSub = sMainStr + ';' + sSubStr;
-                if (AllowLoadData()) {
+                if (AllowLoadData(sSubStr)) {
                     $.ajax(
                         {
                             type: "POST",
diff --git "a/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_EquipDotCheckBillEdit.html" "b/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_EquipDotCheckBillEdit.html"
index e15f7f1..ff6ae47 100644
--- "a/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_EquipDotCheckBillEdit.html"
+++ "b/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_EquipDotCheckBillEdit.html"
@@ -357,6 +357,7 @@
                     }
                 };
             }
+
             //澧炲姞涓�琛屼簨浠�
             function btnAddLine(NewRow) {
                 var tableBak = table.cache["mainTable"]; //鑾峰彇涔嬪墠缂栬緫杩囩殑琛ㄦ牸鏁版嵁
@@ -369,7 +370,6 @@
                     data: buttonArr    //灏嗘暟鎹噸鏂拌浇鍏ヨ〃鏍�
                 })
             }
-
             //琛ㄦ牸澶嶅埗涓�琛屼簨浠�
             function btnCopyLine(data) {
                 var copydata = JSON.stringify(data);
@@ -489,6 +489,7 @@
                     }
                 })
             }
+
             //鑾峰彇鏈�澶у崟鎹彿鍙婇粯璁ゅ�艰祴鍊�
             function get_MAXNum() {
                 //鑾峰彇鏈�澶у崟鎹彿 new
@@ -515,6 +516,7 @@
                 option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRemark": "" }];
                 table.render(option);
             }
+
             //缂栬緫鑾峰彇琛ㄥご銆佽幏鍙栬〃浣�
             function set_EditFromGrid(linterid) {
                 set_EditForm(linterid);  //缂栬緫鑾峰彇琛ㄥご
diff --git "a/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/\350\256\276\345\244\207\350\247\204\347\250\213\345\215\225/Sb_EquipDotCheckRuleEdit.html" "b/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/\350\256\276\345\244\207\350\247\204\347\250\213\345\215\225/Sb_EquipDotCheckRuleEdit.html"
index ce77809..8018a99 100644
--- "a/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/\350\256\276\345\244\207\350\247\204\347\250\213\345\215\225/Sb_EquipDotCheckRuleEdit.html"
+++ "b/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/\350\256\276\345\244\207\350\247\204\347\250\213\345\215\225/Sb_EquipDotCheckRuleEdit.html"
@@ -19,7 +19,12 @@
         }
         /*end*/
         .layui-form-label {
-            width: 95px;
+            width: 199px;
+        }
+
+        .layui-input-block {
+            margin-left: 229px;
+            min-height: 36px;
         }
     </style>
 </head>
@@ -188,7 +193,7 @@
                 var checkStatus = table.checkStatus('mainTable')
                     , data = checkStatus.data;;
                 var AddRow = table.cache['mainTable'];
-                var NewRow = { "HDotCheckItemID": "0","HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": "0", "HManagerNumber": "", "HManagerName": "", "HRemark": "" };
+                var NewRow = { "HDotCheckItemID": "0", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": "0", "HManagerNumber": "", "HManagerName": "", "HRemark": "" };
                 switch (obj.event) {
                     //鏂板涓�琛�
                     case 'btn-AddLine': btnAddLine(NewRow);
@@ -228,13 +233,49 @@
             function set_GridCellCheck(obj) {
                 $(document).off('keydown', ".layui-table-edit").on('keydown', '.layui-table-edit', function (e) {
                     if (event.key == "F7") {
-                        if (obj.event === 'HManagerNumber')  //璐d换浜轰俊鎭�
+
+                        if (obj.event === 'HDotCheckItem')  //鐐规椤圭洰浠g爜
                         {
                             //椤甸潰灞�-鑷畾涔�
                             layer.open({
                                 type: 2,
                                 skin: 'layui-layer-rim', //鍔犱笂杈规
-                                title: '璐d换浜哄垪琛�',
+                                title: '鐗╂枡鍒楄〃',
+                                closeBtn: 1,
+                                shift: 2,
+                                area: ['90%', '90%'],
+                                maxmin: true,
+                                content: ['../../PublicPage/CheckItemInformation.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({
+                                        HDotCheckItemID: checkStatus.data[0].HItemID,
+                                        HDotCheckItem: checkStatus.data[0].HName
+                                    });
+                                    layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+                                }
+                                , btn2: function (index, layero) {
+                                    //鎸夐挳銆愭寜閽簩銆戠殑鍥炶皟
+                                    //return false 寮�鍚浠g爜鍙姝㈢偣鍑昏鎸夐挳鍏抽棴
+                                },
+                                end: function () {
+                                }
+                            });
+                        }
+                        if (obj.event === 'HManagerNumber')  //璐熻矗浜轰唬鐮�
+                        {
+                            //椤甸潰灞�-鑷畾涔�
+                            layer.open({
+                                type: 2,
+                                skin: 'layui-layer-rim', //鍔犱笂杈规
+                                title: '鐗╂枡鍒楄〃',
                                 closeBtn: 1,
                                 shift: 2,
                                 area: ['90%', '90%'],
@@ -248,12 +289,11 @@
                                     if (checkStatus.data.length === 0) {
                                         return layer.msg('璇烽�夋嫨鏁版嵁');
                                     }
-
                                     //鍚屾鏇存柊琛ㄦ牸鍜岀紦瀛樺搴旂殑鍊�
                                     obj.update({
                                         HManagerID: checkStatus.data[0].HItemID,
                                         HManagerNumber: checkStatus.data[0].HNumber,
-                                        HManagerName: checkStatus.data[0].HName,
+                                        HManagerName: checkStatus.data[0].HName
                                     });
                                     layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
                                 }
@@ -286,14 +326,14 @@
                 columns = [
                     { type: 'checkbox', fixed: 'left' }
                     , { templet: '#xuhao', title: '搴忓彿', sort: true, fixed: 'left', event: "qwe" }
-                    , { field: '鐐规椤圭洰ID', title: '鐐规椤圭洰ID', edit: 'text' }
-                    , { field: '鐐规椤圭洰', title: '鐐规椤圭洰', edit: 'text' }
-                    , { field: '鐐规閮ㄤ綅', title: '鐐规閮ㄤ綅', edit: 'text' }
-                    , { field: '鍏蜂綋瑕佹眰', title: '鍏蜂綋瑕佹眰', edit: 'text' }
-                    , { field: '璐熻矗浜篒D', title: '璐熻矗浜篒D', edit: 'text', hide: true }
-                    , { field: '璐熻矗浜轰唬鐮�', title: '璐熻矗浜轰唬鐮�', edit: 'text', event: 'HManagerNumber' }
-                    , { field: '璐熻矗浜�', title: '璐熻矗浜�', edit: 'text' }
-                    , { field: '瀛愬娉�', title: '澶囨敞', edit: 'text' }
+                    , { field: 'HDotCheckItemID', title: '鐐规椤圭洰ID', edit: 'text', hide: true }
+                    , { field: 'HDotCheckItem', title: '鐐规椤圭洰', edit: 'text', event: 'HDotCheckItem' }
+                    , { field: 'HDotCheckPart', title: '鐐规閮ㄤ綅', edit: 'text' }
+                    , { field: 'HClaim', title: '鍏蜂綋瑕佹眰', edit: 'text' }
+                    , { field: 'HManagerID', title: '璐熻矗浜篒D', edit: 'text', hide: true }
+                    , { field: 'HManagerNumber', title: '璐熻矗浜轰唬鐮�', edit: 'text', event: 'HManagerNumber' }
+                    , { field: 'HManagerName', title: '璐熻矗浜�', edit: 'text' }
+                    , { field: 'HRemark', title: '澶囨敞', edit: 'text' }
                     , { fixed: 'right', title: '鎿嶄綔', toolbar: '#barDemo', width: 150 }
                 ];
                 option = {
@@ -314,6 +354,8 @@
             function set_AddFNew() {
                 //鑾峰彇鏈�澶у崟鎹彿
                 get_MAXNum();
+                option.data = [{ "HDotCheckItemID": "0", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": "0", "HManagerNumber": "", "HManagerName": "", "HRemark": "" }];
+                table.render(option);
             }
             //鑾峰彇鏈�澶у崟鎹彿
             function get_MAXNum() {
@@ -340,7 +382,6 @@
                 option.data = [{ "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": "0", "HManagerNumber": "", "HManagerName": "", "HRemark": "" }];
                 table.render(option);
 
-                
             }
             //缂栬緫鑾峰彇琛ㄥご
             function set_EditForm(linterid) {
@@ -349,19 +390,27 @@
                     url: GetWEBURL() + "/Sb_EquipDotCheckRuleBill/Sb_EquipDotCheckRuleBillListCheckDetai",
                     type: "GET",
                     data: {
-                        "HInterID": linterid
+                        "HID": linterid
                     },
                     success: function (d) {
-                        ajaxReturnData = JSON.parse(JSON.stringify(d)).data;
-                        $("#HInterID").val(d.data[0].hmainid);
-                        $("#HBillNo").val(d.data[0].鍗曟嵁鍙�);
-                        $("#HDate").val(formatDate(d.data[0].鏃ユ湡));
-                        $("#HOutComNo").val(formatDate(d.data[0].璁″垝寮�濮嬫棩鏈�));
-                        $("#HBarCode").val(formatDate(d.data[0].璁″垝缁撴潫鏃ユ湡));
-                        $("#HCheckCycle").val(d.data[0].鐐规鍛ㄦ湡);
-                        $("#HCycleUnit").val(d.data[0].鍛ㄦ湡鍗曚綅);
-                        $("#HExplanation").val(d.data[0].鎽樿);
-                        $("#HRemark").val(d.data[0].澶囨敞);
+                        if (d.code == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                            //console.log(result)
+                            var data = d.data.h_v_Sb_EquipDotCheckRuleList[0];
+                            form.val("component-form-group", { //formTest 鍗� class="layui-form" 鎵�鍦ㄥ厓绱犲睘鎬� lay-filter="" 瀵瑰簲鐨勫��
+                                "HBillNo": data.鍗曟嵁鍙�
+                                , "HInterID": data.hmainid
+                                , "HDate": formatDate(data.鏃ユ湡)
+                                ,"HBeginDate":formatDate(data.璁″垝寮�濮嬫棩鏈�)
+                                ,"HEndDate":formatDate(data.璁″垝缁撴潫鏃ユ湡)
+                                ,"HCheckCycle":data.鐐规鍛ㄦ湡
+                                ,"HCycleUnit":data.鍛ㄦ湡鍗曚綅
+                                ,"HExplanation":data.鎽樿
+                                ,"HRemark":data.澶囨敞
+                            });
+
+                        } else {
+                            layer.alert(result.msg, { icon: 5, btn: ['閫�鍑�'], time: 100000, offset: 't' });
+                        }
                     }
                 });
             }
@@ -403,79 +452,38 @@
 
             //淇濆瓨
             function set_btnSave(data) {
-
-                $("#HMaker").val(sessionStorage["HUserName"]);
-                var user = sessionStorage["HUserName"];
-                var ModRightNameAdd = 'Gy_MouldFile_Edit';
-
-                if (!AllowLoadData())//鏁版嵁楠岃瘉
-                {
-                    return false;
-                }
-                if (Stverf == "Add") {
-                    data.field.HMaker = sessionStorage["HUserName"];//鍒跺崟浜�
-                    var sMainStr = JSON.stringify(data.field);
-                    var oMain = sMainStr + ";" + ModRightNameAdd + ";" + user;
-                    //鏂板
-                    $.ajax({
-                        type: "POST",
-                        url: GetWEBURL() + "/Gy_EquipFileMain/AddBill",
-                        async: true,
-                        data: { "oMain": oMain },
-                        dataType: "json",
-                        success: function (data) {
-                            if (data.count == 1) {
-                                layer.msg(data.Message, { time: 1 * 1000, icon: 1 }, function () {
-                                    if (linterid == undefined) {
-                                        $('#btnSave').addClass("layui-btn-disabled").attr("disabled", true);
-                                    }
-                                    else {
+                data.field.HMaker = sessionStorage["HUserName"];//鍒跺崟浜�
+                var sMainStr = JSON.stringify(data.field);
+                var sSubStr = JSON.stringify(table.cache['mainTable']);
+                var sMainSub = sMainStr + ';' + sSubStr;
+                if (AllowLoadData(sSubStr)) {
+                    $.ajax(
+                        {
+                            type: "POST",
+                            url: GetWEBURL() + "/Sb_EquipDotCheckRuleBill/SaveEquipDotCheckRuleBill", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+                            async: true,
+                            data: { "msg": sMainSub },
+                            dataType: "json",
+                            success: function (data) {
+                                if (data.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                                    layer.msg(data.Message, { time: 1 * 1000, icon: 1 }, function () {
+                                        $('#add-btn').addClass("layui-btn-disabled").attr("disabled", true);
                                         var index = parent.layer.getFrameIndex(window.name); //鍏堝緱鍒板綋鍓峣frame灞傜殑绱㈠紩
                                         parent.layer.close(index); //鍐嶆墽琛屽叧闂�
-                                    }
-                                });
-                            }
-                            else {
-                                layer.msg(data.Message, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-                            }
-                        },
-                        error: function (err) {
-                            layer.msg("閿欒:" + err, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-                        }
-                    });
-                }
-                else {
-                    //淇敼
-                    data.field.HUpDater = sessionStorage["HUserName"];//淇敼浜�
-                    var sMainStr = JSON.stringify(data.field);
-                    var oMain = sMainStr + ";" + ModRightNameAdd + ";" + user;
-                    $.ajax({
-                        type: "POST",
-                        url: GetWEBURL() + "/Gy_EquipFileMain/EditBill",
-                        async: true,
-                        data: { "oMain": oMain },
-                        dataType: "json",
-                        success: function (data) {
-                            if (data.count == 1) {
-                                layer.msg(data.Message, { time: 1 * 1000, icon: 1 }, function () {
-                                    if (linterid == undefined) {
-                                        $('#btnSave').addClass("layui-btn-disabled").attr("disabled", true);
-                                    }
-                                    else {
-                                        var index = parent.layer.getFrameIndex(window.name); //鍏堝緱鍒板綋鍓峣frame灞傜殑绱㈠紩
-                                        parent.layer.close(index); //鍐嶆墽琛屽叧闂�
-                                    }
+                                    });
+                                }
+                                else {
+                                    f_alert(data.Message);
+                                    console.log("Reason" + sMainStr + "sub:" + JSON.stringify(layui.table.cache.mainTable));
+                                }
+                                layer.closeAll("loading");
+                            },
+                            error: function (err) {
 
-                                });
+                                f_alert("閿欒:" + err);
+                                console.log("Reason" + sMainStr);
                             }
-                            else {
-                                layer.msg(data.Message, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-                            }
-                        },
-                        error: function (err) {
-                            layer.msg("閿欒:" + err, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-                        }
-                    });
+                        });
                 }
             }
 
@@ -489,10 +497,13 @@
                 }
             })
         });
+        function f_alert(sMsg) {
+            layer.alert(sMsg, { icon: 5 });
 
+        }
         function AllowLoadData() {  //闈炵┖楠岃瘉
             var Result = true;
-            
+
             return Result;
         }
     </script>
diff --git "a/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/\350\256\276\345\244\207\350\247\204\347\250\213\345\215\225/Sb_EquipDotCheckRuleList.html" "b/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/\350\256\276\345\244\207\350\247\204\347\250\213\345\215\225/Sb_EquipDotCheckRuleList.html"
index c1f579a..e5d8b11 100644
--- "a/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/\350\256\276\345\244\207\350\247\204\347\250\213\345\215\225/Sb_EquipDotCheckRuleList.html"
+++ "b/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/\350\256\276\345\244\207\350\247\204\347\250\213\345\215\225/Sb_EquipDotCheckRuleList.html"
@@ -199,7 +199,7 @@
 
             //鏌ヨ
             function get_Display(sWhere) {
-                var index = layer.load(0, { shade: false });
+                var index = layer.load();
                 //杩涘叆椤甸潰鏄剧ず鐨勭紦瀛樺垪琛�
                 $.ajax({
                     url: GetWEBURL() + '/Sb_EquipDotCheckRuleBill/GetEquipDotCheckRuleList',
@@ -211,8 +211,10 @@
                             table.render(option);
                             layer.close(index);
                         } else {
+                            option.data = data1.data;
+                            table.render(option);
                             layer.close(index);
-                            layer.alert(data1.code + data1.Message, { icon: 5 });
+                            layer.alert("鏆傛棤璁板綍", { icon: 5 });
                         }
                     }, error: function () {
                         layer.close(index);
@@ -280,7 +282,7 @@
                         , shade: 0.6 //閬僵閫忔槑搴�
                         , maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲
                         , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
-                        , content: '../璁惧妗f/Sb_EquipDotCheckRuleEdit.html?OperationType=3&linterid=' + linterid + '&HSouceBillType='
+                        , content: '../璁惧瑙勭▼鍗�/Sb_EquipDotCheckRuleEdit.html?OperationType=3&linterid=' + linterid + '&HSouceBillType='
                         , resize: false,
                         end: function () {
                             //鍒锋柊椤甸潰,
diff --git "a/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/\350\256\276\345\244\207\350\247\204\347\250\213\345\215\225/Sb_EquipMaintainRuleList.html" "b/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/\350\256\276\345\244\207\350\247\204\347\250\213\345\215\225/Sb_EquipMaintainRuleList.html"
index 9971c72..965ff3f 100644
--- "a/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/\350\256\276\345\244\207\350\247\204\347\250\213\345\215\225/Sb_EquipMaintainRuleList.html"
+++ "b/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/\350\256\276\345\244\207\350\247\204\347\250\213\345\215\225/Sb_EquipMaintainRuleList.html"
@@ -343,6 +343,8 @@
                             table.render(option);
                             layer.close(index);
                         } else {
+                            option.data = data1.data;
+                            table.render(option);
                             layer.close(index);
                             layer.alert("娌℃湁鏁版嵁璁板綍!", { icon: 5 });
                         }

--
Gitblit v1.9.1