From f2e0683e10b99bffee3ef0a2eb2bc47d28cea486 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期四, 26 十月 2023 10:11:00 +0800
Subject: [PATCH] 销售出库单:界面调整

---
 WebTM/views/设备管理/Sb_EquipMaintainPlanBillEdit.html |  125 +++++++++++++++++++++++++++++++++++++----
 1 files changed, 112 insertions(+), 13 deletions(-)

diff --git "a/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_EquipMaintainPlanBillEdit.html" "b/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_EquipMaintainPlanBillEdit.html"
index c989167..9321e4a 100644
--- "a/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_EquipMaintainPlanBillEdit.html"
+++ "b/WebTM/views/\350\256\276\345\244\207\347\256\241\347\220\206/Sb_EquipMaintainPlanBillEdit.html"
@@ -20,7 +20,7 @@
         <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="">
+                    <form id="component-form-group" class="layui-form" lay-filter="component-form-group" action="">
                         <div class="layui-card-header">
                             <div class="layui-btn-group">
                                 <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="set_AddNew" id="set_AddNew">鏂板</button>
@@ -106,6 +106,16 @@
                                         </div>
                                         <div class="layui-form-item">
                                             <div class="layui-inline">
+                                                <label class="layui-form-label">璁惧淇濆吇瑙勭▼<label style="color:red"></label></label>
+                                                <div class="layui-input-inline">
+                                                    <input type="hidden" name="HMouldMaintainRuleID" id="HMouldMaintainRuleID" class="layui-input" value="0" style="float:left;width:150px;">
+                                                    <input type="text" name="HMouldMaintainRuleNo" id="HMouldMaintainRuleNo" class="layui-input" value="" style="float:left;width:150px;background-color:#efefef4d;" readonly>
+                                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="HEquipDotCheckRuleInterList" style="width:40px;">
+                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
+                                                    </button>
+                                                </div>
+                                            </div>
+                                            <div class="layui-inline">
                                                 <label class="layui-form-label">鎽樿</label>
                                                 <div class="layui-input-inline">
                                                     <textarea placeholder="璇疯緭鍏ユ憳瑕�" class="layui-textarea" name="HExplanation" id="HExplanation"></textarea>
@@ -165,6 +175,9 @@
     </div>
     <script type="text/html" id="barDemo">
         <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">鍒犻櫎</a>
+    </script>
+    <script type="text/html" id="barDemo1">
+        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del1">鍒犻櫎</a>
     </script>
     <script src="../../layuiadmin/layui/layui.js"></script>
     <script src="../../layuiadmin/Scripts/json2.js"></script>
@@ -318,7 +331,7 @@
                 var sMainStr = JSON.stringify(data.field);
                 var sSubStr = JSON.stringify(table.cache['mainTable']);
                 var sSubStr1 = JSON.stringify(table.cache['mainTable1']);
-                var sMainSub = sMainStr + ';' + sSubStr + ';' + sSubStr1;
+                var sMainSub = sMainStr + ';' + sSubStr + ';' + sSubStr1 + ";" + sessionStorage["HUserName"];
                 if (!AllowLoadData(sSubStr))//鏁版嵁楠岃瘉
                 {
                     return false;
@@ -353,6 +366,34 @@
                     });
 
             });
+            //琛ㄥご淇℃伅璁惧淇濆吇瑙勭▼
+            form.on('submit(HEquipDotCheckRuleInterList)', function () {
+                //椤甸潰灞�-鑷畾涔�
+                layer.open({
+                    type: 2,
+                    skin: 'layui-layer-rim', //鍔犱笂杈规
+                    title: '璁惧淇濆吇瑙勭▼鍒楄〃',
+                    closeBtn: 1,
+                    shift: 2,
+                    area: ['80%', '80%'],
+                    maxmin: true,
+                    content: ['../璁惧绠$悊/璁惧瑙勭▼鍗�/Sb_EquipMaintainRuleList.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('璇烽�夋嫨鏁版嵁');
+                        }
+                        $("#HMouldMaintainRuleNo").val(checkStatus.data[0].鍗曟嵁鍙�);
+                        $("#HMouldMaintainRuleID").val(checkStatus.data[0].hmainid);
+                        get_DocCheckItem2(checkStatus.data[0].hmainid);
+                        layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+                    }
+                });
+            });
+
             //棰勮Printing
             form.on("submit(view)", function (data) {
                 window.open("../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/HBarPlanPrint.html?linterid=" + linterid + "&Type=HEquipMaintainPlanBill&OpenTmp=璁惧淇濆吇璁″垝鏉$爜");
@@ -414,12 +455,12 @@
                     , { templet: '#xuhao', title: '搴忓彿', sort: true, fixed: 'left', event: "qwe" }
                     , { field: 'HMaintainItemID', title: '淇濆吇椤圭洰ID', edit: 'text', hide: true }
                     , { field: 'HMaintainItemNumber', title: '淇濆吇椤圭洰浠g爜', edit: 'text', event: 'HMaintainItemNumber' }
-                    , { field: 'HMaintainItem', title: '淇濆吇椤圭洰', edit: 'text' }
+                    , { field: 'HMaintainItem', title: '淇濆吇椤圭洰' }
                     , { field: 'HMaintainPart', 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: 'HManagerName', title: '璐熻矗浜�' }
                     , { field: 'HRemark', title: '澶囨敞', edit: 'text' }
                     , { fixed: 'right', title: '鎿嶄綔', toolbar: '#barDemo' }
                 ];
@@ -448,12 +489,12 @@
                     , { field: 'HUnitID', title: '鍗曚綅ID', edit: 'text', hide: true }
                     , { field: 'HUnitNumber', title: '鍗曚綅浠g爜', edit: 'text', event: "HUnitCode" }
                     , { field: 'HUnitName', title: '鍗曚綅鍚嶇О', edit: 'text', event: "" }
-                    , { field: 'HManagerID', title: '璐熻矗浜篒D', edit: 'text', hide: true }
-                    , { field: 'HManagerNumber', title: '璐熻矗浜轰唬鐮�', edit: 'text', event: 'HManagerNumber' }
-                    , { field: 'HManagerName', title: '璐熻矗浜�', edit: 'text' }
+                    //, { field: 'HManagerID', title: '璐熻矗浜篒D', edit: 'text', hide: true }
+                    //, { field: 'HManagerNumber', title: '璐熻矗浜轰唬鐮�', edit: 'text', event: 'HManagerNumber' }
+                    //, { field: 'HManagerName', title: '璐熻矗浜�', edit: 'text' }
                     , { field: 'HQty', title: '鐢ㄩ噺', edit: 'text' }
                     , { field: 'HRemark', title: '澶囨敞', edit: 'text' }
-                    , { fixed: 'right', title: '鎿嶄綔', toolbar: '#barDemo', width: 150 }
+                    , { fixed: 'right', title: '鎿嶄綔', toolbar: '#barDemo1', width: 150 }
                 ];
                 option1 = {
                     id: 'mainTable1'
@@ -532,6 +573,8 @@
                                 , "HRemark": data.琛ㄥご澶囨敞
                                 , "HCycleUnit": data.鍛ㄦ湡鍗曚綅
                                 , "HCheckCycle": data.淇濆吇鍛ㄦ湡
+                                , "HMouldMaintainRuleID": data.HMouldMaintainRuleID
+                                , "HMouldMaintainRuleNo": data.璁惧淇濆吇瑙勭▼
                             });
 
                         } else {
@@ -566,6 +609,66 @@
                     }
                 });
             }
+
+            // 淇濆吇淇℃伅 閰嶄欢淇℃伅
+            function get_DocCheckItem2(data) {
+                $.ajax({
+                    url: GetWEBURL() + "/Sb_EquipMaintainRuleBill/Sb_EquipMaintainRuleBillSubAndSubItem",
+                    type: "GET",
+                    async: false,
+                    data: { "HInterID": data },
+                    success: function (result) {
+                        if (result != null) {
+                            if (result.count == 1) {
+                                var BYData = result.list[0];//淇濆吇
+                                var PJData = result.list[1];//閰嶄欢
+                                var rowdate1 = layui.table.cache["mainTable"];
+                                var rowdate2 = layui.table.cache["mainTable1"];
+                                option.data = [{ "HMaintainItemID": 0, "HMaintainItemNumber": " ", "HMaintainItem": " ", "HMaintainPart": " ", "HClaim": " ", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HRemark": " " }];
+                                option1.data = [{ "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HQty": "0", "HRemark": "" }];
+                                table.render(option);
+                                table.render(option1);
+
+                                if (BYData.length != 0)  //琛ㄤ綋鏁版嵁涓嶄负绌烘椂
+                                {
+                                    buttonArr = [];//娓呯┖鏁扮粍
+                                    for (var i = 0; i < BYData.length; i++) {
+                                        var checkrow = {
+                                            "HMaintainItemID": BYData[i].HMaintainItemID, "HMaintainItemNumber": BYData[i].HMaintainItemNumber, "HMaintainItem": BYData[i].HMaintainItem,
+                                            "HMaintainPart": BYData[i].HMaintainPart, "HClaim": BYData[i].HClaim, "HManagerID": BYData[i].HManagerID, "HManagerNumber": BYData[i].HManagerNumber,
+                                            "HManagerName": BYData[i].HManagerName, "HRemark": BYData[i].HRemark
+                                        };
+                                        buttonArr.push(checkrow);  //灏嗕箣鍓嶇殑鏁版嵁瀛樺偍
+                                    }
+                                    table.reload("mainTable", {
+                                        data: buttonArr    //灏嗘暟鎹噸鏂拌浇鍏ヨ〃鏍�
+                                    })
+                                }
+
+                                if (PJData.length != 0)  //琛ㄤ綋鏁版嵁涓嶄负绌烘椂
+                                {
+                                    buttonArr = [];//娓呯┖鏁扮粍
+                                    for (var i = 0; i < PJData.length; i++) {
+                                        var checkrow = {
+                                            "HMaterID": PJData[i].HMaterID, "HMaterNumber": PJData[i].HMaterNumber, "HMaterName": PJData[i].HMaterName,
+                                            "HUnitID": PJData[i].HUnitID, "HUnitNumber": PJData[i].HUnitNumber,
+                                            "HUnitName": PJData[i].HUnitName, "HQty": PJData[i].HQty, "HRemark": PJData[i].HRemark
+                                        };
+                                        buttonArr.push(checkrow);  //灏嗕箣鍓嶇殑鏁版嵁瀛樺偍
+                                    }
+                                    table.reload("mainTable1", {
+                                        data: buttonArr    //灏嗘暟鎹噸鏂拌浇鍏ヨ〃鏍�
+                                    })
+                                }
+
+                            } else {
+                                layer.alert(result.code + result.Message, { icon: 5 });
+                            }
+                        }
+                    }
+                })
+            }
+
             //鏃ユ湡鏍煎紡鍖�
             function formatDate(date) {
                 var d = new Date(date),
@@ -646,8 +749,6 @@
                         if (rowIndex === '0') {
                             layer.msg('棣栬鏃犳硶鍒犻櫎锛侊紒锛�');
                         } else {
-                            //obj.del();
-                            //layer.close(index);
                             var oldData = table.cache["mainTable"];
                             oldData.splice(obj.tr.data('index'), 1);
                             table.reload('mainTable', { data: oldData });
@@ -660,14 +761,12 @@
             function set_GridDelete1(obj) {
                 var data = obj.data;
                 var rowIndex = $(obj.tr).attr("data-index");
-                if (obj.event === 'del') {
+                if (obj.event === 'del1') {
                     layer.confirm('鐪熺殑鍒犻櫎琛屼箞', function (index) {
                         console.log("绱㈠紩涓�:" + rowIndex);
                         if (rowIndex === '0') {
                             layer.msg('棣栬鏃犳硶鍒犻櫎锛侊紒锛�');
                         } else {
-                            //obj.del();
-                            //layer.close(index);
                             var oldData = table.cache["mainTable1"];
                             oldData.splice(obj.tr.data('index'), 1);
                             table.reload('mainTable1', { data: oldData });

--
Gitblit v1.9.1