From b742f00aac8e1e1bb628232383c35e67f4a41e4e Mon Sep 17 00:00:00 2001
From: cwjbxqmz <1134865194@qq.com>
Date: 星期五, 26 一月 2024 15:21:28 +0800
Subject: [PATCH] 1

---
 WebTM/views/模治具管理/模治具管理/Sc_Add_MouldMaintainBillList.html |  496 ++++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 367 insertions(+), 129 deletions(-)

diff --git "a/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/Sc_Add_MouldMaintainBillList.html" "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/Sc_Add_MouldMaintainBillList.html"
index 81f218e..48f6329 100644
--- "a/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/Sc_Add_MouldMaintainBillList.html"
+++ "b/WebTM/views/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/\346\250\241\346\262\273\345\205\267\347\256\241\347\220\206/Sc_Add_MouldMaintainBillList.html"
@@ -2,7 +2,7 @@
 <html>
 <head>
     <meta charset="utf-8" />
-    <title>鏂板/缂栬緫妯″叿淇濆吇璁板綍琛�</title>
+    <title>鏂板/缂栬緫鍣ㄥ叿淇濆吇璁板綍琛�</title>
     <meta name="renderer" content="webkit">
     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
     <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
@@ -20,16 +20,19 @@
         <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>
                                 <button type="button" id="add-btn" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Saver">淇濆瓨</button>
+                                <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="view">棰勮</button>
+                                <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="print">鎵撳嵃</button>
                                 <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Exit">閫�鍑�</button>
                             </div>
                         </div>
                         <div class="layui-card-body">
                             <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
-                                <h1 style="text-align:center;"><b>妯″叿淇濆吇璁板綍琛�</b></h1>
+                                <h1 style="text-align:center;"><b>鍣ㄥ叿淇濆吇璁板綍琛�</b></h1>
                                 <div class="layui-tab-content">
                                     <div class="layui-tab-item layui-show">
                                         <div class="layui-form-item">
@@ -53,7 +56,7 @@
                                                 </div>
                                             </div>
                                             <div class="layui-inline">
-                                                <label class="layui-form-label">浜у搧妯″叿</label>
+                                                <label class="layui-form-label">浜у搧鍣ㄥ叿<label style="color:red"> * </label></label>
                                                 <div class="layui-input-inline">
                                                     <input type="text" name="HMouldName" id="HMouldName" class="layui-input" value="" style="float:left;width:150px;">
                                                     <input type="hidden" name="HMouldID" id="HMouldID" class="layui-input" value="" style="float:left;width:150px;">
@@ -67,15 +70,9 @@
                                             <div class="layui-inline">
                                                 <label class="layui-form-label">淇濆吇璁″垝缂栧彿</label>
                                                 <div class="layui-input-inline">
-                                                    <input type="text" name="HPlanNo" id="HPlanNo" class="layui-input">
-                                                </div>
-                                            </div>
-                                            <div class="layui-inline">
-                                                <label class="layui-form-label">淇濆吇璁″垝鍐呯爜</label>
-                                                <div class="layui-input-inline">
-                                                    <input type="text" name="HPlanInterName" id="HPlanInterName" class="layui-input" value="" style="float:left;width:150px;">
-                                                    <input type="hidden" name="HPlanInterID" id="HPlanInterID" class="layui-input" value="" style="float:left;width:150px;">
-                                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="HPlanInterpList" style="width:40px;">
+                                                    <input type="hidden" name="HPlanNo" id="HPlanNo" class="layui-input" value="0" style="float:left;width:150px;">
+                                                    <input type="text" name="HPlanName" id="HPlanName" class="layui-input" value="" style="float:left;width:150px;">
+                                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="HPlanList" style="width:40px;">
                                                         <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                     </button>
                                                 </div>
@@ -106,12 +103,22 @@
                                                     <textarea placeholder="璇疯緭鍏ョ淮澶囨敞" class="layui-textarea" name="HRemark" id="HRemark"></textarea>
                                                 </div>
                                             </div>
+                                            <div class="layui-inline">
+                                                <label class="layui-form-label">鍣ㄥ叿淇濆吇瑙勭▼<label style="color:red"> * </label></label>
+                                                <div class="layui-input-inline">
+                                                    <input type="hidden" name="HMouldMaintainRuleInterID" id="HMouldMaintainRuleInterID" class="layui-input" value="" style="float:left;width:150px;">
+                                                    <input type="text" name="HMouldMaintainRuleInterNo" id="HMouldMaintainRuleInterNo" class="layui-input" value="" style="float:left;width:150px;" readonly="readonly">
+                                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="HMouldMaintainRuleInterList" style="width:40px;">
+                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
+                                                    </button>
+                                                </div>
+                                            </div>
                                         </div>
                                     </div>
                                 </div>
                             </div>
                         </div>
-                        <div class="layui-tab layui-tab-card">
+                        <div class="layui-tab layui-tab-card" lay-filter="TabTest">
                             <ul class="layui-tab-title">
                                 <li class="layui-this">淇濆吇椤逛俊鎭�</li>
                                 <li>閰嶄欢淇℃伅</li>
@@ -192,10 +199,9 @@
                 , element = layui.element;
             var option;
             var option2;
-            var option1;
             var sBillType = "3807";
-            var TabRow = { "HMaintainItemID": 0, "HMaintainItemNumber": "", "HMaintainItem": "", "HMaintainPart": "", "HClaim": "", "HManagerID": "0 ", "HManagerNumber": "", "HManagerName": "", "HRemark": "" };
-            var TabRow1 = { "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HMaterSpec": "", "HUnitID": "0", "HUnitNumber": "", "HUnitName": "", "HQty": "0", "HQtyMust": "0", "HManagerID": "0", "HManagerNumber": "", "HManagerName": "", "HRemark": "" };
+            var TabRow = { "HMaintainItemID": 0, "HMaintainItemNumber": " ", "HMaintainItem": " ", "HMaintainPart": " ", "HClaim": " ", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HRemark": " " };
+            var TabRow1 = { "HMaterID": 0, "HMaterNumber": " ", "HMaterName": " ", "HMaterSpec": " ", "HUnitID": "0", "HUnitNumber": " ", "HUnitName": " ", "HQty": "0", "HQtyMust": "0", "HRemark": " " };
             //#endregion
 
             //#region 杩涘叆椤甸潰鍗冲姞杞�
@@ -219,13 +225,18 @@
             //#endregion
 
             //#region 瑙﹀彂浜嬩欢锛氬寘鎷琭orm.on(){}鏍煎紡鐨勬墍鏈夌偣鍑讳簨浠躲�侀�夋嫨浜嬩欢绛�
+            //Tab鍒囨崲
+            //element.on('tab(TabTest)', function (data) {
+
+            //})
+
             // 澶村伐鍏锋爮浜嬩欢
             table.on('toolbar(mainTable)', function (obj) {
                 var rowid = 0;
                 var checkStatus = table.checkStatus('mainTable')
                     , data = checkStatus.data;;
                 var AddRow = table.cache['mainTable'];
-                var NewRow = TabRow;
+                var NewRow = { "HMaintainItemID": 0, "HMaintainItemNumber": " ", "HMaintainItem": " ", "HMaintainPart": " ", "HClaim": " ", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HRemark": " " };
                 switch (obj.event) {
                     //鏂板涓�琛�
                     case 'btn-AddLine': btnAddLine(NewRow);
@@ -242,7 +253,7 @@
                 var checkStatus = table.checkStatus('mainTable1')
                     , data = checkStatus.data;;
                 var AddRow = table.cache['mainTable1'];
-                var NewRow = TabRow1;
+                var NewRow = { "HMaterID": 0, "HMaterNumber": " ", "HMaterName": " ", "HMaterSpec": " ", "HUnitID": "0", "HUnitNumber": " ", "HUnitName": " ", "HQty": "0", "HQtyMust": "0", "HRemark": " " };
                 switch (obj.event) {
                     //鏂板涓�琛�
                     case 'btn-AddLine1': btnAddLine1(NewRow);
@@ -265,47 +276,18 @@
                 set_GridCellCheck1(obj); //琛屽唴蹇嵎閿瓫閫�
             });
 
-            //淇濆吇璁″垝鍐呯爜
-            form.on('submit(HPlanInterpList)', function () {//閫夋嫨鍗曚綅
+            //琛ㄥご淇℃伅淇濆吇璁″垝婧愬崟寮圭獥
+            form.on('submit(HPlanList)', function () {
                 //椤甸潰灞�-鑷畾涔�
                 layer.open({
                     type: 2,
                     skin: 'layui-layer-rim', //鍔犱笂杈规
-                    title: '淇濆吇璁″垝鍒楄〃',
+                    title: '鍣ㄥ叿淇濆吇璁″垝婧愬崟鍒楄〃',
                     closeBtn: 1,
                     shift: 2,
                     area: ['80%', '80%'],
                     maxmin: true,
-                    content: ['', 'yes'],
-                    btn: ['纭畾', '鍙栨秷']
-                    , btn1: function (index, layero) {
-
-                    }
-                    , btn2: function (index, layero) {
-                        //鎸夐挳銆愭寜閽簩銆戠殑鍥炶皟
-                        //return false 寮�鍚浠g爜鍙姝㈢偣鍑昏鎸夐挳鍏抽棴
-                    },
-                    end: function () {
-
-                    },
-                    success: function (layero, index) {
-
-                    }
-                });
-            });
-
-            //浜у搧妯″叿
-            form.on('submit(HMouldList)', function () {
-                //椤甸潰灞�-鑷畾涔�
-                layer.open({
-                    type: 2,
-                    skin: 'layui-layer-rim', //鍔犱笂杈规
-                    title: '浜у搧妯″叿鍒楄〃',
-                    closeBtn: 1,
-                    shift: 2,
-                    area: ['80%', '80%'],
-                    maxmin: true,
-                    content: ['../../PublicPage/MouldInformation.html', 'yes'],
+                    content: ['../妯℃不鍏风鐞�/Sc_MouldMaintainPlanBillList.html', 'yes'],
                     btn: ['纭畾', '鍙栨秷']
                     , btn1: function (index, layero) {
                         //鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
@@ -314,8 +296,45 @@
                         if (checkStatus.data.length === 0) {
                             return layer.msg('璇烽�夋嫨鏁版嵁');
                         }
-                        $("#HMouldName").val(checkStatus.data[0].HName);
-                        $("#HMouldID").val(checkStatus.data[0].HItemID);
+                        $("#HPlanName").val(checkStatus.data[0].鍗曟嵁鍙�);
+                        $("#HPlanNo").val(checkStatus.data[0].hmainid);
+                        layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+                        get_MaintainItem1();
+                    }
+                    , btn2: function (index, layero) {
+                        //鎸夐挳銆愭寜閽簩銆戠殑鍥炶皟
+                        //return false 寮�鍚浠g爜鍙姝㈢偣鍑昏鎸夐挳鍏抽棴
+                    },
+                    end: function () {
+                    },
+                    success: function (layero, index) {
+                    }
+                });
+            });
+
+            //浜у搧鍣ㄥ叿
+            form.on('submit(HMouldList)', function () {
+                //椤甸潰灞�-鑷畾涔�
+                layer.open({
+                    type: 2,
+                    skin: 'layui-layer-rim', //鍔犱笂杈规
+                    title: '浜у搧鍣ㄥ叿鍒楄〃',
+                    closeBtn: 1,
+                    shift: 2,
+                    area: ['80%', '80%'],
+                    maxmin: true,
+                    content: ['../妯℃不鍏风鐞�/Gy_MouldFileList.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('璇烽�夋嫨鏁版嵁');
+                        }
+                        $("#HMouldName").val(checkStatus.data[0].鍗曟嵁鍙�);
+                        $("#HMouldID").val(checkStatus.data[0].hmainid);
+                        get_MaintainItem();
                         layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
                     }
                     , btn2: function (index, layero) {
@@ -330,6 +349,46 @@
                     }
                 });
             });
+         
+
+
+            //琛ㄥご淇℃伅鍣ㄥ叿淇濆吇瑙勭▼
+            form.on('submit(HMouldMaintainRuleInterList)', function () {
+                //椤甸潰灞�-鑷畾涔�
+                layer.open({
+                    type: 2,
+                    skin: 'layui-layer-rim', //鍔犱笂杈规
+                    title: '鍣ㄥ叿淇濆吇瑙勭▼鍒楄〃',
+                    closeBtn: 1,
+                    shift: 2,
+                    area: ['80%', '80%'],
+                    maxmin: true,
+                    content: ['../../妯℃不鍏风鐞�/妯℃不鍏风鐞�/Sc_MouldMaintainRuleBillList.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('璇烽�夋嫨鏁版嵁');
+                        }
+                        $("#HMouldMaintainRuleInterNo").val(checkStatus.data[0].鍗曟嵁鍙�);
+                        $("#HMouldMaintainRuleInterID").val(checkStatus.data[0].hmainid);
+                        get_MaintainItem2();
+                        layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+                    }
+                    , btn2: function (index, layero) {
+                        //鎸夐挳銆愭寜閽簩銆戠殑鍥炶皟
+                        //return false 寮�鍚浠g爜鍙姝㈢偣鍑昏鎸夐挳鍏抽棴
+                    },
+                    end: function () {
+                    },
+                    success: function (layero, index) {
+                    }
+                });
+            });
+
+
 
             //閫夋嫨鍗曚綅
             form.on('submit(HUnitID-BT)', function () {//閫夋嫨鍗曚綅
@@ -347,6 +406,201 @@
                     }
                 })
             });
+
+            //浜у搧鍣ㄥ叿
+            function get_MaintainItem() {
+                $.ajax({
+                    url: GetWEBURL() + "/Web/GetMaintainItemtemByMouldProjectID",
+                    type: "GET",
+                    data: { "MouldProjectID": $("#HMouldID").val() },
+                    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": " " }];
+                                option2.data = [{ "HMaterID": 0, "HMaterNumber": " ", "HMaterName": " ", "HMaterSpec": " ", "HUnitID": "0", "HUnitNumber": " ", "HUnitName": " ", "HQty": "0", "HQtyMust": "0", "HRemark": " " }];
+                                table.render(option);
+                                table.render(option2);
+
+                                $("#HMouldMaintainRuleInterID").val(BYData[0].HInterID);
+                                $("#HMouldMaintainRuleInterNo").val(BYData[0].HBillNo);
+
+                                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, "HManagerID": BYData[i].HManagerID, "HManagerNumber": BYData[i].HManagerNumber,
+                                            "HManagerName": BYData[i].HManagerName, "HClaim": BYData[i].HClaim, "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,
+                                            "HMaterSpec": PJData[i].HMaterSpec, "HUnitID": PJData[i].HUnitID, "HUnitNumber": PJData[i].HUnitNumber,
+                                            "HUnitName": PJData[i].HUnitName, "HQty": PJData[i].HQty, "HQtyMust": PJData[i].HQtyMust,
+                                            "HRemark": PJData[0].HRemark
+                                        };
+                                        buttonArr.push(checkrow);  //灏嗕箣鍓嶇殑鏁版嵁瀛樺偍
+                                    }
+                                    table.reload("mainTable1", {
+                                        data: buttonArr    //灏嗘暟鎹噸鏂拌浇鍏ヨ〃鏍�
+                                    })
+                                }
+
+                            } else {
+                                layer.alert(result.code + result.Message, { icon: 5 });
+                            }
+                        }
+                    }
+                })
+            }
+
+            //淇濆吇璁″垝缂栧彿
+            function get_MaintainItem1() {
+                $.ajax({
+                    url: GetWEBURL() + "/Sc_MouldMaintainPlanBill/Sc_MouldMaintainPlanBillListProjectDetai",
+                    type: "GET",
+                    data: { "sqlWhere": "and hmainid=" + $("#HPlanNo").val() },
+                    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": " " }];
+                                option2.data = [{ "HMaterID": 0, "HMaterNumber": " ", "HMaterName": " ", "HMaterSpec": " ", "HUnitID": "0", "HUnitNumber": " ", "HUnitName": " ", "HQty": "0", "HQtyMust": "0", "HRemark": " " }];
+                                table.render(option);
+                                table.render(option2);
+
+                                if (BYData.length != 0) {
+                                    $("#HMouldMaintainRuleInterID").val(BYData[0].HMouldMaintainRuleID);
+                                    $("#HMouldMaintainRuleInterNo").val(BYData[0].HEquipDotCheckNo);
+                                }
+                                else {
+                                    layer.msg("鏃犱繚鍏昏绋�!")
+                                }
+                               
+
+                                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, "HManagerID": BYData[i].璐熻矗浜篒D, "HManagerNumber": BYData[i].HManagerNumber,
+                                            "HManagerName": BYData[i].HManagerName, "HClaim": BYData[i].HClaim, "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,
+                                            "HMaterSpec": PJData[i].HMaterSpec, "HUnitID": PJData[i].HUnitID, "HUnitNumber": PJData[i].HUnitNumber,
+                                            "HUnitName": PJData[i].HUnitName, "HQty": PJData[i].HQty, "HQtyMust": PJData[i].HQtyMust,
+                                            "HRemark": PJData[0].HRemark
+                                        };
+                                        buttonArr.push(checkrow);  //灏嗕箣鍓嶇殑鏁版嵁瀛樺偍
+                                    }
+                                    table.reload("mainTable1", {
+                                        data: buttonArr    //灏嗘暟鎹噸鏂拌浇鍏ヨ〃鏍�
+                                    })
+                                }
+
+                            } else {
+                                layer.alert(result.code + result.Message, { icon: 5 });
+                            }
+                        }
+                    }
+                })
+            }
+
+            //鍣ㄥ叿淇濆吇瑙勭▼
+            function get_MaintainItem2() {
+                $.ajax({
+                    url: GetWEBURL() + "/Web/GetMouldMaintainItemtemByMaintainRuleID",
+                    type: "GET",
+                    data: { "MouldMaintainRuleID": $("#HMouldMaintainRuleInterID").val() },
+                    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": " " }];
+                                option2.data = [{ "HMaterID": 0, "HMaterNumber": " ", "HMaterName": " ", "HMaterSpec": " ", "HUnitID": "0", "HUnitNumber": " ", "HUnitName": " ", "HQty": "0", "HQtyMust": "0", "HRemark": " " }];
+                                table.render(option);
+                                table.render(option2);
+
+                                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, "HManagerID": BYData[i].HManagerID, "HManagerNumber": BYData[i].HManagerNumber,
+                                            "HManagerName": BYData[i].HManagerName, "HClaim": BYData[i].HClaim, "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,
+                                            "HMaterSpec": PJData[i].HMaterSpec, "HUnitID": PJData[i].HUnitID, "HUnitNumber": PJData[i].HUnitNumber,
+                                            "HUnitName": PJData[i].HUnitName, "HQty": PJData[i].HQty, "HQtyMust": PJData[i].HQtyMust,
+                                            "HRemark": PJData[i].HRemark
+                                        };
+                                        buttonArr.push(checkrow);  //灏嗕箣鍓嶇殑鏁版嵁瀛樺偍
+                                    }
+                                    table.reload("mainTable1", {
+                                        data: buttonArr    //灏嗘暟鎹噸鏂拌浇鍏ヨ〃鏍�
+                                    })
+                                }
+
+                            } else {
+                                layer.alert(result.code + result.Message, { icon: 5 });
+                            }
+                        }
+                    }
+                })
+            }
 
             //琛ㄦ牸琛屽唴浜嬩欢蹇嵎閿瓫閫�
             function set_GridCellCheck(obj) {
@@ -460,6 +714,7 @@
                                     if (checkStatus.data.length === 0) {
                                         return layer.msg('璇烽�夋嫨鏁版嵁');
                                     }
+                                    console.log(checkStatus.data[0]);
                                     //鍚屾鏇存柊琛ㄦ牸鍜岀紦瀛樺搴旂殑鍊�
                                     obj.update({
                                         HMaterID: checkStatus.data[0].HItemID,
@@ -518,53 +773,18 @@
                                 }
                             });
                         }
-
-                        if (obj.event === 'HManagerNumber')  //璐d换浜轰俊鎭�
-                        {
-                            //椤甸潰灞�-鑷畾涔�
-                            layer.open({
-                                type: 2,
-                                skin: 'layui-layer-rim', //鍔犱笂杈规
-                                title: '璐d换浜哄垪琛�',
-                                closeBtn: 1,
-                                shift: 2,
-                                area: ['90%', '90%'],
-                                maxmin: true,
-                                content: ['../../PublicPage/UserInformation.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({
-                                        HManagerID: checkStatus.data[0].HItemID,
-                                        HManagerNumber: checkStatus.data[0].HNumber,
-                                        HManagerName: checkStatus.data[0].HName
-                                    });
-
-                                    layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
-                                }
-                                , btn2: function (index, layero) {
-                                    //鎸夐挳銆愭寜閽簩銆戠殑鍥炶皟
-                                    //return false 寮�鍚浠g爜鍙姝㈢偣鍑昏鎸夐挳鍏抽棴
-                                },
-                                end: function () {
-
-                                }
-                            });
-                        }
                         obj.event = "";
                         return false;
 
                     }
                 })
             }
+            //鏂板
+            form.on('submit(set_AddNew)', function (data) {
+                $("#component-form-group")[0].reset();
+                layui.form.render();
+                set_AddFNew();
+            });
 
             //淇濆瓨
             form.on('submit(Saver)', function (data) {//淇濆瓨
@@ -572,12 +792,13 @@
                 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;
                 }
-               
+
                 $.ajax(
                     {
                         type: "POST",
@@ -590,7 +811,7 @@
                                 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); //鍐嶆墽琛屽叧闂� 聽 聽 聽 聽 聽聽 聽聽聽 聽
+                                    parent.layer.close(index); //鍐嶆墽琛屽叧闂�
                                 });
                             }
                             else {
@@ -604,10 +825,28 @@
                     });
             });
 
+            //棰勮
+            form.on("submit(view)", function (data) {
+                window.open("../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/HBarPlanPrint.html?linterid=" + linterid + "&Type=HMouldMaintainBill&OpenTmp=鍣ㄥ叿淇濆吇璁板綍鏉$爜");
+
+            });
+
+            //鎵撳嵃Printing
+            form.on("submit(print)", function (data) {
+                window.open("../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/HBarPlanPrint.html?linterid=" + linterid + "&Type=HMouldMaintainBill&OpenTmp=鍣ㄥ叿淇濆吇璁板綍鏉$爜");
+
+            });
+
             //閫�鍑�
             form.on('submit(Exit)', function (data) {//
-                var index = parent.layer.getFrameIndex(window.name); //鍏堝緱鍒板綋鍓峣frame灞傜殑绱㈠紩
-                parent.layer.close(index); //鍐嶆墽琛屽叧闂�
+                if (linterid == undefined) {
+                    //鍏抽棴椤电
+                    Pub_Close(2);
+                }
+                else {
+                    //鍏抽棴椤电
+                    Pub_Close(1);
+                }
             });
 
 
@@ -640,15 +879,15 @@
                 //琛ㄥご
                 columns = [
                     { type: 'checkbox', fixed: 'left' }
-                    , { templet: '#xuhao', title: '搴忓彿', sort: true, fixed: 'left', event: "qwe" }
+                    , { templet: '#xuhao', title: '搴忓彿', sort: true, fixed: 'left' }
                     , { 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' }
                 ];
@@ -669,21 +908,18 @@
             //鍒濆鍖栭厤浠堕」鍒楄〃
             function Table2() {
                 //琛ㄥご
-                columns = [
+                columns1 = [
                     { type: 'checkbox', fixed: 'left' }
-                    , { templet: '#xuhao1', title: '搴忓彿', sort: true, fixed: 'left', event: "qwe" }
+                    , { templet: '#xuhao1', title: '搴忓彿', sort: true, fixed: 'left'}
                     , { field: 'HMaterID', title: '閰嶄欢ID', edit: 'text', hide: true }
                     , { field: 'HMaterNumber', title: '閰嶄欢浠g爜', edit: 'text', event: "HMaterNumber" }
-                    , { field: 'HMaterName', title: '閰嶄欢鍚嶇О', edit: 'text' }
-                    , { field: 'HMaterSpec', title: '瑙勬牸鍨嬪彿', edit: 'text' }
+                    , { field: 'HMaterName', title: '閰嶄欢鍚嶇О' }
+                    , { field: 'HMaterSpec', title: '瑙勬牸鍨嬪彿' }
                     , { field: 'HUnitID', title: '鍗曚綅ID', edit: 'text', hide: true }
                     , { field: 'HUnitNumber', title: '鍗曚綅浠g爜', edit: 'text', event: "HUnitNumber" }
-                    , { field: 'HUnitName', title: '鍗曚綅鍚嶇О', edit: 'text' }
+                    , { field: 'HUnitName', title: '鍗曚綅鍚嶇О' }
                     , { field: 'HQty', title: '瀹為檯鐢ㄩ噺', edit: 'text' }
                     , { field: 'HQtyMust', 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: '#barDemo1' }
                 ];
@@ -694,7 +930,7 @@
                     , page: false
                     , cellMinWidth: 120
                     , height: 500
-                    , cols: [columns]
+                    , cols: [columns1]
                     , done: function (res, curr, count) {
 
                     }
@@ -705,8 +941,8 @@
             function set_AddFNew() {
                 //鑾峰彇鏈�澶у崟鎹彿
                 get_MAXNum();
-                option.data = [];
-                option2.data = [];
+                option.data = [{ "HMaintainItemID": 0, "HMaintainItemNumber": " ", "HMaintainItem": " ", "HMaintainPart": " ", "HClaim": " ", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HRemark": " " }];
+                option2.data = [{ "HMaterID": 0, "HMaterNumber": " ", "HMaterName": " ", "HMaterSpec": " ", "HUnitID": "0", "HUnitNumber": " ", "HUnitName": " ", "HQty": "0", "HQtyMust": "0", "HRemark": " " }];
                 table.render(option);
                 table.render(option2);
             }
@@ -763,10 +999,12 @@
                                 , "HExplanation": data.鎽樿
                                 , "HRemark": data.澶囨敞
                                 , "HPlanNo": data.淇濆吇璁″垝缂栧彿
+                                , "HPlanName": data.淇濆吇璁″垝
                                 , "HPlanInterID": data.淇濆吇璁″垝鍐呯爜
                                 , "HMouldID": data.HMouldID
                                 , "HMouldName": data.浜у搧妯″叿
-
+                                , "HMouldMaintainRuleInterID": data.HMouldMaintainRuleInterID
+                                , "HMouldMaintainRuleInterNo": data.鍣ㄥ叿淇濆吇瑙勭▼
                             });
 
                         } else {
@@ -823,6 +1061,13 @@
                 table.render(option);
             }
 
+            //澧炲姞涓�琛�
+            function btnAddLine1(NewRow) {
+                table.cache["mainTable1"].push(NewRow);
+                option2.data = table.cache["mainTable1"];
+                table.render(option2);
+            }
+
             //澶嶅埗涓�琛�
             function btnCopyLine(data) {
                 var copydata = JSON.stringify(data);
@@ -839,13 +1084,6 @@
                     option.data = table.cache["mainTable"];//灏嗘暟鎹粦瀹氬埌data涓�
                     table.render(option);//灏嗘暟鎹覆鏌撳埌琛ㄦ牸涓�
                 }
-            }
-
-            //澧炲姞涓�琛�
-            function btnAddLine1(NewRow) {
-                table.cache["mainTable1"].push(NewRow);
-                option2.data = table.cache["mainTable1"];
-                table.render(option2);
             }
 
             //澶嶅埗涓�琛�
@@ -875,9 +1113,9 @@
                         option.data = table.cache["mainTable"];//灏嗘暟鎹粦瀹氬埌data涓�
                         obj.del();
                         option.data.splice(rowIndex, 1);//鍒犻櫎缂撳瓨鐨勮
-                        table.reload('mainTable',option);
+                        table.reload('mainTable', option);
                         layer.close(index);
-                        
+
                     });
                 }
             }
@@ -888,10 +1126,10 @@
                 if (obj.event === 'del1') {
                     layer.confirm('鐪熺殑鍒犻櫎琛屼箞', function (index) {
                         var rowIndex = $(obj.tr).attr("data-index");
-                        var oldData = table.cache["mainTable1"];//灏嗘暟鎹粦瀹氬埌data涓�
+                        option2.data = table.cache["mainTable1"];//灏嗘暟鎹粦瀹氬埌data涓�
                         obj.del();
-                        oldData.splice(rowIndex, 1);//鍒犻櫎缂撳瓨鐨勮
-                        table.reload('mainTable1',oldData);
+                        option2.data.splice(rowIndex, 1);//鍒犻櫎缂撳瓨鐨勮
+                        table.reload('mainTable1', option2);
                         layer.close(index);
                     });
                 }
@@ -901,10 +1139,10 @@
             function AllowLoadData(sSubStr) {  //闈炵┖楠岃瘉
                 var Result = true;
                 if ($("#HMouldID").val() == '' || $("#HMouldID").val() == null) {
-                    layer.msg("浜у搧妯″叿涓嶈兘涓虹┖!", { icon: 5, btn: ['纭'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                    layer.msg("浜у搧鍣ㄥ叿涓嶈兘涓虹┖!", { icon: 5, btn: ['纭'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
                     return Result = false;
                 }
-                if (typeof (sSubStr) == "undefined" || sSubStr == "" || sSubStr =="[]") {
+                if (typeof (sSubStr) == "undefined" || sSubStr == "" || sSubStr == "[]") {
                     layer.msg("淇濆吇椤规槑缁嗚褰曚笉鑳戒负绌�", { icon: 5, btn: ['纭'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
                     return Result = false;
                 }

--
Gitblit v1.9.1