From 2d9c354691a6d363b0a47909e37039be870f9d41 Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期一, 19 十二月 2022 10:53:28 +0800
Subject: [PATCH] 盘点分析维护 器具档案单据 列表维护 器具保养计划单 单据双子列表 器具保养计划单列表加子列表显示

---
 WebTM/views/模治具管理/模治具管理/Sc_MouldMaintainRuleBillList.html     |    8 
 WebTM/views/车间管理/工序出站汇报单/Cj_StationOutBill.html               |    8 
 WebTM/views/计划管理/工艺路线/Gy_RoutingBill.html                     |    6 
 WebTM/views/设备管理/Sb_EquipMaintainPlanBillEdit.html            |   15 
 WebTM/views/模治具管理/模治具管理/Sc_Add_MouldMaintainPlanBillList.html |  939 +++++++++++++++++++++++++++++++---------------
 WebTM/views/模治具管理/模治具管理/Gy_MouldFile.html                     |    2 
 WebTM/views/生产管理/要料计划/JIT_NeedMaterPlanBillEdit.html          |   54 +-
 WebTM/views/模治具管理/模治具管理/Sc_MouldMaintainPlanBillList.html     |  140 ++++++
 WebTM/views/模治具管理/模治具管理/Gy_MouldFileList.html                 |   12 
 WebTM/views/基础资料/基础资料/InventoryAnalysis.html                  |    4 
 10 files changed, 827 insertions(+), 361 deletions(-)

diff --git "a/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/InventoryAnalysis.html" "b/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/InventoryAnalysis.html"
index e36c9cd..790d773 100644
--- "a/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/InventoryAnalysis.html"
+++ "b/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/InventoryAnalysis.html"
@@ -532,7 +532,7 @@
                 //鍒濆鍖栬〃鏍�(閫�搴�)
                 set_InitGrid7();
                 //鍒濆鏌ユ甯搁〉绛�
-                zc_Display();
+                //zc_Display();
             }
 
             //鍒濆鍖栬〃鏍�(姝e父)
@@ -750,7 +750,7 @@
             }
             //鐩樼泩鏌ヨ
             function py_Display() {
-                var sWhere = "isnull(HBookPot,'''')='''' and isnull(HRealPot,'''')!=''''";
+                var sWhere = "py";
                 var HItemID = $("#HItemID").val();//鍗曟嵁绫诲瀷
                
                 //杩涘叆椤甸潰鏄剧ず鐨勭紦瀛樺垪琛�
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/Gy_MouldFile.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/Gy_MouldFile.html"
index c7cb71b..c1b8087 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/Gy_MouldFile.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/Gy_MouldFile.html"
@@ -136,7 +136,7 @@
                                             <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">瀵瑰簲ERP鐗╂枡</label>
                                             <div class="layui-input-block" style="margin-left: 77px;">
                                                 <input type="text" class="layui-input" name="HMaterNumber" id="HMaterNumber" style="width: 60%;display: inline-block;" readonly>
-                                                <input type="hidden" class="layui-input" name="HMaterID" id="HMaterID" style="background-color:#efefef4d;width: 60%;display: inline-block;">
+                                                <input type="hidden" class="layui-input" name="HMaterID" id="HMaterID" style="background-color:#efefef4d;width: 60%;display: inline-block;" value="0">
                                                 <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHMaterList" id="btnHMaterList" style="padding: 0 10px;float: right;margin-right: 3px;">
                                                     <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                 </button>
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/Gy_MouldFileList.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/Gy_MouldFileList.html"
index de5842b..801549e 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/Gy_MouldFileList.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/Gy_MouldFileList.html"
@@ -139,6 +139,10 @@
                 get_FastQuery();
             });
 
+            //閲嶇疆鎸夐挳
+            form.on('submit(btnReSearch)', function (data) {
+                set_ClearQuery();
+            });
 
 
             //#endregion
@@ -264,6 +268,14 @@
                 sWhere = "";//璋冪敤鎺ュ彛鍚庢竻绌簊Where缂撳瓨
             }
 
+            //閲嶇疆杩囨护鏉′欢
+            function set_ClearQuery() {
+                $("#HNumber").val("")
+                $("#HName").val("");
+                sWhere = "";
+                get_Display(sWhere);
+            }
+
             //鏂板
             function set_AddNew() {
                 //椤甸潰灞�-鑷畾涔�
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_MouldMaintainPlanBillList.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_MouldMaintainPlanBillList.html"
index 608f7cb..4e90f2f 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_MouldMaintainPlanBillList.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_MouldMaintainPlanBillList.html"
@@ -55,6 +55,16 @@
                                                     <input type="text" name="HInnerBillNo" id="HInnerBillNo" class="layui-input">
                                                 </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="HEquipDotCheckRuleInterID" id="HEquipDotCheckRuleInterID" class="layui-input" value="0" style="float:left;width:150px;">
+                                                    <input type="text" name="HEquipDotCheckRuleInterNo" id="HEquipDotCheckRuleInterNo" 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>
                                         <div class="layui-form-item">
                                             <div class="layui-inline">
@@ -105,16 +115,36 @@
                             </div>
                         </div>
 
-                        <table class="layui-hide" id="mainTable" lay-filter="mainTable"></table>
+                        <div class="layui-tab layui-tab-card" lay-filter="TabTest">
+                            <ul class="layui-tab-title">
+                                <li class="layui-this">淇濆吇椤逛俊鎭�</li>
+                                <li>閰嶄欢淇℃伅</li>
+                            </ul>
+                            <div class="layui-tab-content">
+                                <div class="layui-tab-item layui-show">
+                                    <table class="layui-hide" id="mainTable" lay-filter="mainTable"></table>
+                                </div>
+                                <div class="layui-tab-item">
+                                    <table class="layui-hide" id="mainTable1" lay-filter="mainTable1"></table>
+                                </div>
+                            </div>
+                        </div>
                         <script type="text/html" id="toolbarDemo">
                             <div class="layui-btn-container">
-
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-AddLine"><i class="layui-icon layui-icon-form"></i>澧炲姞涓�琛�</button>
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-CopyLine"><i class="layui-icon layui-icon-form"></i>澶嶅埗涓�琛�</button>
-
+                            </div>
+                        </script>
+                        <script type="text/html" id="toolbarDemo1">
+                            <div class="layui-btn-container">
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-AddLine1"><i class="layui-icon layui-icon-form"></i>澧炲姞涓�琛�</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-CopyLine1"><i class="layui-icon layui-icon-form"></i>澶嶅埗涓�琛�</button>
                             </div>
                         </script>
                         <script type="text/html" id="xuhao">
+                            {{d.LAY_TABLE_INDEX+1}}
+                        </script>
+                        <script type="text/html" id="xuhao1">
                             {{d.LAY_TABLE_INDEX+1}}
                         </script>
                     </form>
@@ -125,6 +155,10 @@
     <script type="text/html" id="barDemo">
         <!--<a class="layui-btn layui-btn-xs" lay-event="edit">缂栬緫</a>-->
         <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-xs" lay-event="edit">缂栬緫</a>-->
+        <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>
@@ -158,7 +192,8 @@
                 , form = layui.form
                 , laydate = layui.laydate
                 , element = layui.element;
-            var option;
+            var option = [];//淇濆吇
+            var option1 = [];//閰嶄欢
             var sBillType = "3818";
             //var TabRow = { "HMaterID": 0, "HUnitID": "0 ", "HQty": "0   ", "HQtyMust": "0", "HRemark": "  " };
             //#endregion
@@ -170,6 +205,7 @@
 
             //鍒濆鍖栬〃鏍�
             set_InitGrid();
+            set_InitGrid1();
 
             //鍒ゆ柇鎿嶄綔绫诲瀷
             if (OperationType == 1) {//鏃犳簮鍗�
@@ -197,7 +233,7 @@
                 var checkStatus = table.checkStatus('mainTable')
                     , data = checkStatus.data;;
                 var AddRow = table.cache['mainTable'];
-                var NewRow = { "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": "0 ", "HUnitNumber": "","HUnitName":"", "HQty": "0   ", "HQtyMust": "0", "HRemark": " " };
+                var NewRow = { "HMaintainItemID": 0, "HMaintainItemNumber": " ", "HMaintainItem": " ", "HMaintainPart": " ", "HClaim": " ", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HRemark": " " };
                 switch (obj.event) {
                     //鏂板涓�琛�
                     case 'btn-AddLine': btnAddLine(NewRow);
@@ -208,14 +244,582 @@
                 }
             });
 
-            // 琛屽唴浜嬩欢
+            // 澶村伐鍏锋爮浜嬩欢
+            table.on('toolbar(mainTable1)', function (obj) {
+                var rowid = 0;
+                var checkStatus = table.checkStatus('mainTable1')
+                    , data = checkStatus.data;;
+                var AddRow = table.cache['mainTable1'];
+                var NewRow = { "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": "0 ", "HUnitNumber": "", "HUnitName": "", "HQty": "0   ", "HQtyMust": "0", "HRemark": " " };
+                switch (obj.event) {
+                    //鏂板涓�琛�
+                    case 'btn-AddLine1': btnAddLine1(NewRow);
+                        break;
+                    //澶嶅埗涓�琛�
+                    case 'btn-CopyLine1': btnCopyLine1(data);
+                        break;
+                }
+            });
+
+            //琛屽唴浜嬩欢
             table.on('tool(mainTable)', function (obj) {
                 set_GridDelete(obj);   //琛屽唴鍒犻櫎
                 set_GridCellCheck(obj); //琛屽唴蹇嵎閿瓫閫�
             });
 
+            // 琛屽唴浜嬩欢
+            table.on('tool(mainTable1)', function (obj) {
+                set_GridDelete1(obj);   //琛屽唴鍒犻櫎
+                set_GridCellCheck1(obj); //琛屽唴蹇嵎閿瓫閫�
+            });
+
+            //琛ㄥご淇℃伅鍣ㄥ叿淇濆吇瑙勭▼
+            form.on('submit(HEquipDotCheckRuleInterList)', 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('璇烽�夋嫨鏁版嵁');
+                        }
+                        $("#HEquipDotCheckRuleInterNo").val(checkStatus.data[0].鍗曟嵁鍙�);
+                        $("#HEquipDotCheckRuleInterID").val(checkStatus.data[0].hmainid);
+                        get_DocCheckItem2(checkStatus.data[0].hmainid);
+                        layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+                    }
+                    , btn2: function (index, layero) {
+                        //鎸夐挳銆愭寜閽簩銆戠殑鍥炶皟
+                        //return false 寮�鍚浠g爜鍙姝㈢偣鍑昏鎸夐挳鍏抽棴
+                    },
+                    end: function () {
+                    },
+                    success: function (layero, index) {
+                    }
+                });
+            });
+
+            //鏂板
+            form.on('submit(set_AddNew)', function (data) {
+                $("#component-form-group")[0].reset();
+                layui.form.render();
+                set_AddFNew();
+            });
+
+            //淇濆瓨
+            form.on('submit(Saver)', function (data) {//淇濆瓨
+                var sMainStr = JSON.stringify(data.field);
+                var sSubStr = JSON.stringify(table.cache['mainTable']);
+                var sSubStr1 = JSON.stringify(table.cache['mainTable1']);
+                var sMainSub = sMainStr + ';' + sSubStr1 + ";" + sessionStorage["HUserName"] + ";" + sSubStr;
+                if (AllowLoadData(sSubStr1)) {
+                    $.ajax(
+                        {
+                            type: "POST",
+                            url: GetWEBURL() + "/Sc_MouldMaintainPlanBill/SaveGetMouldMaintainPlanBillList", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+                            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.alert(data.Message, { icon: 5 });
+                                    //console.log("Reason" + sMainStr + "sub:" + JSON.stringify(layui.table.cache.mainTable));
+                                }
+                                layer.closeAll("loading");
+                            },
+                            error: function (err) {
+                                layer.alert("閿欒:" + err, { icon: 5 });
+                                //console.log("Reason" + sMainStr);
+                            }
+                        });
+                }
+
+            });
+
+            //棰勮
+            form.on("submit(view)", function (data) {
+                window.open("../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/HBarPlanPrint.html?linterid=" + linterid + "&Type=HMouldMaintainPlanBill&OpenTmp=鍣ㄥ叿淇濆吇璁″垝鏉$爜");
+
+            });
+
+            //鎵撳嵃Printing
+            form.on("submit(print)", function (data) {
+                window.open("../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/HBarPlanPrint.html?linterid=" + linterid + "&Type=HMouldMaintainPlanBill&OpenTmp=鍣ㄥ叿淇濆吇璁″垝鏉$爜");
+
+            });
+
+            //閫�鍑�
+            form.on('submit(Exit)', function (data) {//
+                if (linterid == undefined) {
+                    //鍏抽棴椤电
+                    Pub_Close(2);
+                }
+                else {
+                    //鍏抽棴椤电
+                    Pub_Close(1);
+                }
+            });
+
+
+            //#endregion
+
+            //鍒濆鍖栬〃鍗曟彃浠�
+            function set_InitFrom() {
+                //甯歌鐢ㄦ硶
+                laydate.render({
+                    elem: '#HDate'
+                });
+                laydate.render({
+                    elem: '#HBeginDate'
+                });
+                laydate.render({
+                    elem: '#HEndDate'
+                });
+            }
+
+            //鍒濆鍖栦繚鍏婚」鍒楄〃
+            function set_InitGrid() {
+                //琛ㄥご
+                columns = [
+                    { type: 'checkbox', fixed: 'left' }
+                    , { 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: '淇濆吇椤圭洰' }
+                    , { 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: '璐熻矗浜�' }
+                    , { field: 'HRemark', title: '澶囨敞', edit: 'text' }
+                    , { fixed: 'right', title: '鎿嶄綔', toolbar: '#barDemo' }
+                ];
+                option = {
+                    id: 'mainTable'
+                    , elem: '#mainTable'
+                    , toolbar: '#toolbarDemo'
+                    , page: false
+                    , cellMinWidth: 120
+                    , height: 500
+                    , cols: [columns]
+                    , done: function (res, curr, count) {
+
+                    }
+                };
+            }
+
+            //鍒濆鍖栬〃鏍�
+            function set_InitGrid1() {
+                //琛ㄥご
+                columns = [
+                    { type: 'checkbox', fixed: 'left' }
+                    , { templet: '#xuhao1', title: '搴忓彿', sort: true, fixed: 'left', event: "qwe" }
+                    , { field: 'HMaterID', title: '閰嶄欢ID', edit: 'text', hide: true }
+                    , { field: 'HMaterNumber', title: '閰嶄欢浠g爜', edit: 'text', event: "HMaterNumber", }
+                    , { field: 'HUnitID', title: '鍗曚綅ID', edit: 'text', event: "", hide: true }
+                    , { field: 'HUnitNumber', title: '鍗曚綅浠g爜', edit: 'text', event: "HUnitNumber" }
+                    , { field: 'HQty', title: '瀹為檯鐢ㄩ噺', edit: 'text' }
+                    , { field: 'HQtyMust', title: '鍗曚綅鐢ㄩ噺', edit: 'text' }
+                    , { field: 'HRemark', title: '澶囨敞', edit: 'text' }
+                    , { fixed: 'right', title: '鎿嶄綔', toolbar: '#barDemo1', width: 150 }
+                ];
+                option1 = {
+                    id: 'mainTable1'
+                    , elem: '#mainTable1'
+                    , toolbar: '#toolbarDemo1'
+                    , page: false
+                    , cellMinWidth: 120
+                    , height: 500
+                    , cols: [columns]
+                    , done: function (res, curr, count) {
+
+                    }
+                };
+
+            }
+
+            //鏃犳簮鍗曟柊澧�
+            function set_AddFNew() {
+                //鑾峰彇鏈�澶у崟鎹彿
+                get_MAXNum();
+                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   ", "HQtyMust": "0", "HRemark": "" }];
+                table.render(option);
+                table.render(option1);
+            }
+
+            //缂栬緫
+            function set_EditFromGrid() {
+                set_EditForm(linterid);  //缂栬緫鑾峰彇琛ㄥご
+                set_EditGrid(linterid);  //缂栬緫鑾峰彇琛ㄤ綋
+                option.data = [{ "HMaintainItemID": 0, "HMaintainItemNumber": " ", "HMaintainItem": " ", "HMaintainPart": " ", "HClaim": " ", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HRemark": " " }];
+                table.render(option);
+                option.data = [{ "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": "0 ", "HUnitNumber": "", "HUnitName": "", "HQty": "0   ", "HQtyMust": "0", "HRemark": "" }];
+                table.render(option);
+            }
+
+            //鑾峰彇鏈�澶у崟鎹彿鍙婇粯璁ゅ�艰祴鍊�
+            function get_MAXNum() {
+                //鑾峰彇鏈�澶у崟鎹彿 new
+                $("#HInterID").val("0");
+                $("#HBillNo").val("");
+                $.ajax({
+                    url: GetWEBURL() + "/Web/GetMAXNum",
+                    type: "GET",
+                    data: { "HBillType": '3819' },
+                    success: function (d) {
+                        $("#HInterID").val(0);
+                        $("#HPlanInterID").val(0);
+                        $("#HBillNo").val(d.data[0].HBillNo);
+                        $("#HDate").val(Pub_Format(new Date(), "yyyy-MM-dd"));
+                        $("#HBeginDate").val(Pub_Format(new Date(), "yyyy-MM-dd"));
+                        $("#HEndDate").val(Pub_Format(new Date(), "yyyy-MM-dd"));
+
+                    }
+                });
+            }
+
+            //缂栬緫鑾峰彇琛ㄥご
+            function set_EditForm(linterid) {
+                //鏌ヨ妫�楠屾柟妗堝崟鏄惁瀛樺湪
+                $.ajax({
+                    url: GetWEBURL() + "Sc_MouldMaintainPlanBill/Sc_MouldMaintainPlanBillListCheckDetai",
+                    type: "GET",
+                    data: {
+                        "HID": linterid
+                    },
+                    success: function (result) {
+                        if (result.code == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                            var data = result.data.h_v_Sc_MouldMaintainPlanBillList[0];
+                            form.val("component-form-group", { //formTest 鍗� class="layui-form" 鎵�鍦ㄥ厓绱犲睘鎬� lay-filter="" 瀵瑰簲鐨勫��
+                                "HBillNo": data.鍗曟嵁鍙�
+                                , "HDate": data.鏃ユ湡
+                                , "HInnerBillNo": data.鍐呴儴鍗曟嵁鍙�
+                                , "HCycleUnit": data.鍛ㄦ湡鍗曚綅
+                                , "HCheckCycle": data.淇濆吇鍛ㄦ湡
+                                , "HBeginDate": data.璁″垝寮�濮嬫棩鏈�
+                                , "HEndDate": data.璁″垝缁撴潫鏃ユ湡
+                                , "HExplanation": data.鎽樿
+                                , "HRemark": data.澶囨敞
+                                , "HEquipDotCheckRuleInterID": data.HEquipDotCheckRuleInterID
+                                , "HEquipDotCheckRuleInterNo": data.鍣ㄥ叿淇濆吇瑙勭▼
+                            });
+
+                        } else {
+                            layer.alert(result.msg, { icon: 5, btn: ['閫�鍑�'], time: 100000, offset: 't' });
+                        }
+                    }, error: function () {
+                        layer.alert("鍙戠敓閿欒!", { icon: 5 });
+                    }
+                });
+            }
+
+            // 缂栬緫鑾峰彇琛ㄥご鏃舵椂闂存牸寮忕煫姝f柟寮�
+            function formatDate(date) {
+                var d = new Date(date),
+                    month = '' + (d.getMonth() + 1),
+                    day = '' + d.getDate(),
+                    year = d.getFullYear();
+
+                if (month.length < 2) month = '0' + month;
+                if (day.length < 2) day = '0' + day;
+
+                return [year, month, day].join('-');
+            }
+
+            // 缂栬緫鑾峰彇琛ㄤ綋
+            function set_EditGrid(linterid) {
+                $("#HInterID").val(linterid);//淇敼鏃朵富琛↖D
+                //缂栬緫鍔犺浇鏁版嵁
+                $.ajax({
+                    url: GetWEBURL() + 'Sc_MouldMaintainPlanBill/Sc_MouldMaintainPlanBillListProjectDetai',
+                    type: "GET",
+                    data: { "sqlWhere": "and hmainid=" + linterid },
+                    success: function (result) {
+                        //console.log('gouba' + result);
+                        if (result.count == 1) {
+                            option.data = result.list[0];
+                            table.render(option);
+                            option1.data = result.list[1];
+                            table.render(option1);
+                        } else {
+                            layer.alert(result.code + result.Message, { icon: 5 });
+                        }
+                    }, error: function () {
+                        layer.close(index0);
+                        layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                    }
+                });
+            }
+
+            //澧炲姞涓�琛�
+            function btnAddLine(NewRow) {
+                var tableBak = table.cache["mainTable"]; //鑾峰彇涔嬪墠缂栬緫杩囩殑琛ㄦ牸鏁版嵁
+                buttonArr = [];//娓呯┖鏁扮粍
+                for (var i = 0; i < tableBak.length; i++) {
+                    buttonArr.push(tableBak[i]);  //灏嗕箣鍓嶇殑鏁版嵁瀛樺偍
+                }
+                buttonArr.push(NewRow);  //鍦ㄥ熬閮ㄥ姞涓�琛�
+                table.reload("mainTable", {
+                    data: buttonArr    //灏嗘暟鎹噸鏂拌浇鍏ヨ〃鏍�
+                })
+            }
+
+            //澧炲姞涓�琛�
+            function btnAddLine1(NewRow) {
+                var tableBak = table.cache["mainTable1"]; //鑾峰彇涔嬪墠缂栬緫杩囩殑琛ㄦ牸鏁版嵁
+                buttonArr = [];//娓呯┖鏁扮粍
+                for (var i = 0; i < tableBak.length; i++) {
+                    buttonArr.push(tableBak[i]);  //灏嗕箣鍓嶇殑鏁版嵁瀛樺偍
+                }
+                buttonArr.push(NewRow);  //鍦ㄥ熬閮ㄥ姞涓�琛�
+                table.reload("mainTable1", {
+                    data: buttonArr    //灏嗘暟鎹噸鏂拌浇鍏ヨ〃鏍�
+                })
+            }
+
+            //澶嶅埗涓�琛�
+            function btnCopyLine(data) {
+                var copydata = JSON.stringify(data);
+                if (data.length <= 0) {
+                    layer.msg("璇烽�夋嫨闇�瑕佸鍒剁殑涓�琛岋紒");
+                }
+                else if (data.length > 1) {
+                    layer.msg("鍙兘閫夋嫨澶嶅埗涓�琛岋紒");
+                }
+                else {
+                    var copydata2 = copydata.substring(1, copydata.length);//鍘婚櫎棣栬瀛楃'['
+                    var copyrow = copydata2.substring(0, copydata2.length - 1);//鍘婚櫎鏈熬瀛楃']'
+                    table.cache["mainTable"].push(JSON.parse(copyrow));//灏嗗鍒剁殑琛屽己杞垚json杩藉姞鍒拌〃鏍间笂
+                    option.data = table.cache["mainTable"];//灏嗘暟鎹粦瀹氬埌data涓�
+                    table.render(option);//灏嗘暟鎹覆鏌撳埌琛ㄦ牸涓�
+                }
+            }
+
+            //澶嶅埗涓�琛�
+            function btnCopyLine1(data) {
+                var copydata = JSON.stringify(data);
+                if (data.length <= 0) {
+                    layer.msg("璇烽�夋嫨闇�瑕佸鍒剁殑涓�琛岋紒");
+                }
+                else if (data.length > 1) {
+                    layer.msg("鍙兘閫夋嫨澶嶅埗涓�琛岋紒");
+                }
+                else {
+                    var copydata2 = copydata.substring(1, copydata.length);//鍘婚櫎棣栬瀛楃'['
+                    var copyrow = copydata2.substring(0, copydata2.length - 1);//鍘婚櫎鏈熬瀛楃']'
+                    table.cache["mainTable1"].push(JSON.parse(copyrow));//灏嗗鍒剁殑琛屽己杞垚json杩藉姞鍒拌〃鏍间笂
+                    option1.data = table.cache["mainTable1"];//灏嗘暟鎹粦瀹氬埌data涓�
+                    table.render(option1);//灏嗘暟鎹覆鏌撳埌琛ㄦ牸涓�
+                }
+            }
+
+            // 琛ㄦ牸琛屽唴浜嬩欢鍒犻櫎
+            function set_GridDelete(obj) {
+                var data = obj.data;
+                var rowIndex = $(obj.tr).attr("data-index");
+                if (obj.event === 'del') {
+                    layer.confirm('鐪熺殑鍒犻櫎琛屼箞', function (index) {
+                        console.log("绱㈠紩涓�:" + rowIndex);
+                        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 });
+                            layer.close(index);
+                        }
+                    });
+                }
+            }
+
+            //琛ㄦ牸琛屽唴浜嬩欢鍒犻櫎
+            function set_GridDelete1(obj) {
+                var rowIndex = $(obj.tr).attr("data-index");
+                if (obj.event === 'del1') {
+                    layer.confirm('鐪熺殑鍒犻櫎琛屼箞', function (index) {
+                        console.log("绱㈠紩涓�:" + rowIndex);
+                        if (rowIndex === '0') {
+                            layer.msg('棣栬鏃犳硶鍒犻櫎锛侊紒锛�');
+                        } else {
+                            var oldData = table.cache["mainTable1"];
+                            oldData.splice(obj.tr.data('index'), 1);
+                            table.reload('mainTable1', { data: oldData });
+                            layer.close(index);
+                        }
+                    });
+                }
+            };
+
             //琛ㄦ牸琛屽唴浜嬩欢蹇嵎閿瓫閫�
             function set_GridCellCheck(obj) {
+                $(document).off('keydown', ".layui-table-edit").on('keydown', '.layui-table-edit', function (e) {
+                    if (event.key == "F7") {
+                        if (obj.event === 'HMaintainItemNumber')  //淇濆吇椤圭洰淇℃伅
+                        {
+                            //椤甸潰灞�-鑷畾涔�
+                            layer.open({
+                                type: 2,
+                                skin: 'layui-layer-rim', //鍔犱笂杈规
+                                title: '淇濆吇椤圭洰鍒楄〃',
+                                closeBtn: 1,
+                                shift: 2,
+                                area: ['90%', '90%'],
+                                maxmin: true,
+                                content: ['../../PublicPage/Gy_Maintain.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({
+                                        HMaintainItemID: checkStatus.data[0].HItemID,
+                                        HMaintainItemNumber: checkStatus.data[0].HNumber,
+                                        HMaintainItem: checkStatus.data[0].HName,
+                                    });
+                                    layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+                                }
+                                , btn2: function (index, layero) {
+                                    //鎸夐挳銆愭寜閽簩銆戠殑鍥炶皟
+                                    //return false 寮�鍚浠g爜鍙姝㈢偣鍑昏鎸夐挳鍏抽棴
+                                },
+                                end: function () {
+                                }
+                            });
+                        }
+                        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;
+
+                    }
+                })
+            }
+
+            // 淇濆吇淇℃伅 閰嶄欢淇℃伅
+            function get_DocCheckItem2(data) {
+                $.ajax({
+                    url: GetWEBURL() + "/Sc_MouldMaintainRuleBill/Sc_MouldMaintainRuleBillListProjectDetaiNew",
+                    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   ", "HQtyMust": "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].淇濆吇椤圭洰ID, "HMaintainItemNumber": BYData[i].淇濆吇椤圭洰浠g爜, "HMaintainItem": BYData[i].淇濆吇椤圭洰,
+                                            "HMaintainPart": BYData[i].淇濆吇閮ㄤ綅, "HClaim": BYData[i].鍏蜂綋瑕佹眰, "HManagerID": BYData[i].璐熻矗浜篒D, "HManagerNumber": BYData[i].璐熻矗浜轰唬鐮�,
+                                            "HManagerName": BYData[i].璐熻矗浜哄悕绉�, "HRemark": BYData[i].瀛愬娉�2
+                                        };
+                                        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].閰嶄欢ID, "HMaterNumber": PJData[i].閰嶄欢浠g爜, "HMaterName": PJData[i].閰嶄欢鍚嶇О,
+                                            "HUnitID": PJData[i].鍗曚綅ID, "HUnitNumber": PJData[i].璁¢噺鍗曚綅浠g爜,
+                                            "HUnitName": PJData[i].璁¢噺鍗曚綅鍚嶇О, "HQty": PJData[i].鐢ㄩ噺, "HQtyMust": PJData[i].鏍囧噯鐢ㄩ噺,
+                                            "HRemark": PJData[i].瀛愬娉�1
+                                        };
+                                        buttonArr.push(checkrow);  //灏嗕箣鍓嶇殑鏁版嵁瀛樺偍
+                                    }
+                                    table.reload("mainTable1", {
+                                        data: buttonArr    //灏嗘暟鎹噸鏂拌浇鍏ヨ〃鏍�
+                                    })
+                                }
+
+                            } else {
+                                layer.alert(result.code + result.Message, { icon: 5 });
+                            }
+                        }
+                    }
+                })
+            }
+
+            //琛ㄦ牸琛屽唴浜嬩欢蹇嵎閿瓫閫�
+            function set_GridCellCheck1(obj) {
                 $(document).off('keydown', ".layui-table-edit").on('keydown', '.layui-table-edit', function (e) {
                     if (event.key == "F7") {
                         if (obj.event === 'HMaterNumber')  //閰嶄欢浠g爜
@@ -298,306 +902,35 @@
                 })
             }
 
-            //鏂板
-            form.on('submit(set_AddNew)', function (data) {
-                $("#component-form-group")[0].reset();
-                layui.form.render();
-                set_AddFNew();
-            });
-
-            //淇濆瓨
-            form.on('submit(Saver)', function (data) {//淇濆瓨
-                var sMainStr = JSON.stringify(data.field);
-                var sSubStr = JSON.stringify(table.cache['mainTable']);
-                var sMainSub = sMainStr + ';' + sSubStr + ";" +sessionStorage["HUserName"];
-                if (AllowLoadData(sSubStr)) {
-                    $.ajax(
-                        {
-                            type: "POST",
-                            url: GetWEBURL() + "/Sc_MouldMaintainPlanBill/SaveGetMouldMaintainPlanBillList", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
-                            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.alert(data.Message, { icon: 5 });
-                                    //console.log("Reason" + sMainStr + "sub:" + JSON.stringify(layui.table.cache.mainTable));
-                                }
-                                layer.closeAll("loading");
-                            },
-                            error: function (err) {
-                                layer.alert("閿欒:" + err, { icon: 5 });
-                                //console.log("Reason" + sMainStr);
-                            }
-                        });
-                }
-
-            });
-
-            //棰勮
-            form.on("submit(view)", function (data) {
-                window.open("../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/HBarPlanPrint.html?linterid=" + linterid + "&Type=HMouldMaintainPlanBill&OpenTmp=鍣ㄥ叿淇濆吇璁″垝鏉$爜");
-
-            });
-
-            //鎵撳嵃Printing
-            form.on("submit(print)", function (data) {
-                window.open("../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/HBarPlanPrint.html?linterid=" + linterid + "&Type=HMouldMaintainPlanBill&OpenTmp=鍣ㄥ叿淇濆吇璁″垝鏉$爜");
-
-            });
-
-            //閫�鍑�
-            form.on('submit(Exit)', function (data) {//
-                if (linterid == undefined) {
-                    //鍏抽棴椤电
-                    Pub_Close(2);
-                }
-                else {
-                    //鍏抽棴椤电
-                    Pub_Close(1);
-                }
-            });
-
-
-            //#endregion
-
-            //鍒濆鍖栬〃鍗曟彃浠�
-            function set_InitFrom() {
-                //甯歌鐢ㄦ硶
-                laydate.render({
-                    elem: '#HDate'
-                });
-                laydate.render({
-                    elem: '#HBeginDate'
-                });
-                laydate.render({
-                    elem: '#HEndDate'
-                });
-            }
-
-            //鍒濆鍖栬〃鏍�
-            function set_InitGrid() {
-                //琛ㄥご
-                columns = [
-                    { type: 'checkbox', fixed: 'left' }
-                    , { templet: '#xuhao', title: '搴忓彿', sort: true, fixed: 'left', event: "qwe" }
-                    , { field: 'HMaterID', title: '閰嶄欢ID', edit: 'text', hide: true }
-                    , { field: 'HMaterNumber', title: '閰嶄欢浠g爜', edit: 'text', event: "HMaterNumber", }
-                    , { field: 'HUnitID', title: '鍗曚綅ID', edit: 'text', event: "", hide: true}
-                    , { field: 'HUnitNumber', title: '鍗曚綅浠g爜', edit: 'text', event: "HUnitNumber" }
-                    , { field: 'HQty', title: '瀹為檯鐢ㄩ噺', edit: 'text' }
-                    , { field: 'HQtyMust', title: '鍗曚綅鐢ㄩ噺', edit: 'text' }
-                    , { field: 'HRemark', title: '澶囨敞', edit: 'text' }
-                    , { fixed: 'right', title: '鎿嶄綔', toolbar: '#barDemo', width: 150 }
-                ];
-                option = {
-                    id: 'mainTable'
-                    , elem: '#mainTable'
-                    , toolbar: '#toolbarDemo'
-                    , page: false
-                    , cellMinWidth: 120
-                    , height: 500
-                    , cols: [columns]
-                    , done: function (res, curr, count) {
-
-                    }
-                };
-
-            }
-
-            //鏃犳簮鍗曟柊澧�
-            function set_AddFNew() {
-                //鑾峰彇鏈�澶у崟鎹彿
-                get_MAXNum();
-                option.data = [{ "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": "0 ", "HUnitNumber": "", "HUnitName": "", "HQty": "0   ", "HQtyMust": "0", "HRemark":"" }];
-                table.render(option);
-            }
-
-            //缂栬緫
-            function set_EditFromGrid() {
-                set_EditForm(linterid);  //缂栬緫鑾峰彇琛ㄥご
-                set_EditGrid(linterid);  //缂栬緫鑾峰彇琛ㄤ綋
-                option.data = [{ "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": "0 ", "HUnitNumber": "", "HUnitName": "", "HQty": "0   ", "HQtyMust": "0", "HRemark":""}];
-                table.render(option);
-            }
-
-            //鑾峰彇鏈�澶у崟鎹彿鍙婇粯璁ゅ�艰祴鍊�
-            function get_MAXNum() {
-                //鑾峰彇鏈�澶у崟鎹彿 new
-                $("#HInterID").val("0");
-                $("#HBillNo").val("");
-                $.ajax({
-                    url: GetWEBURL() + "/Web/GetMAXNum",
-                    type: "GET",
-                    data: { "HBillType": '3819' },
-                    success: function (d) {
-                        $("#HInterID").val(0);
-                        $("#HPlanInterID").val(0);
-                        $("#HBillNo").val(d.data[0].HBillNo);
-                        $("#HDate").val(Pub_Format(new Date(), "yyyy-MM-dd"));
-                        $("#HBeginDate").val(Pub_Format(new Date(), "yyyy-MM-dd"));
-                        $("#HEndDate").val(Pub_Format(new Date(), "yyyy-MM-dd"));
-
-                    }
-                });
-            }
-
-            //缂栬緫鑾峰彇琛ㄥご
-            function set_EditForm(linterid) {
-                //鏌ヨ妫�楠屾柟妗堝崟鏄惁瀛樺湪
-                $.ajax({
-                    url: GetWEBURL() + "Sc_MouldMaintainPlanBill/Sc_MouldMaintainPlanBillListCheckDetai",
-                    type: "GET",
-                    data: {
-                        "HID": linterid
-                    },
-                    success: function (result) {
-                        if (result.code == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
-                            var data = result.data.h_v_Sc_MouldMaintainPlanBillList[0];
-                            form.val("component-form-group", { //formTest 鍗� class="layui-form" 鎵�鍦ㄥ厓绱犲睘鎬� lay-filter="" 瀵瑰簲鐨勫��
-                                "HBillNo": data.鍗曟嵁鍙�
-                                , "HDate": data.鏃ユ湡
-                                , "HInnerBillNo": data.鍐呴儴鍗曟嵁鍙�
-                                , "HCycleUnit": data.鍛ㄦ湡鍗曚綅
-                                , "HCheckCycle": data.淇濆吇鍛ㄦ湡
-                                , "HBeginDate": data.璁″垝寮�濮嬫棩鏈�
-                                , "HEndDate": data.璁″垝缁撴潫鏃ユ湡
-                                , "HExplanation": data.鎽樿
-                                , "HRemark": data.澶囨敞
-                                
-
-                            });
-
-                        } else {
-                            layer.alert(result.msg, { icon: 5, btn: ['閫�鍑�'], time: 100000, offset: 't' });
-                        }
-                    }, error: function () {
-                        layer.alert("鍙戠敓閿欒!", { icon: 5 });
-                    }
-                });
-            }
-
-            // 缂栬緫鑾峰彇琛ㄥご鏃舵椂闂存牸寮忕煫姝f柟寮�
-            function formatDate(date) {
-                var d = new Date(date),
-                    month = '' + (d.getMonth() + 1),
-                    day = '' + d.getDate(),
-                    year = d.getFullYear();
-
-                if (month.length < 2) month = '0' + month;
-                if (day.length < 2) day = '0' + day;
-
-                return [year, month, day].join('-');
-            }
-
-            // 缂栬緫鑾峰彇琛ㄤ綋
-            function set_EditGrid(linterid) {
-                $("#HInterID").val(linterid);//淇敼鏃朵富琛↖D
-                //缂栬緫鍔犺浇鏁版嵁
-                $.ajax({
-                    url: GetWEBURL() + 'Sc_MouldMaintainPlanBill/Sc_MouldMaintainPlanBillListProjectDetai',
-                    type: "GET",
-                    data: { "sqlWhere": "and HInterID=" + linterid },
-                    success: function (result) {
-                        //console.log('gouba' + result);
-                        if (result.count == 1) {
-                            option.data = result.data;
-                            table.render(option);
-
-                        } else {
-                            layer.alert(result.code + result.Message, { icon: 5 });
-                        }
-                    }, error: function () {
-                        layer.close(index0);
-                        layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
-                    }
-                });
-            }
-
-            //澧炲姞涓�琛�
-            function btnAddLine(NewRow) {
-                var tableBak = table.cache["mainTable"]; //鑾峰彇涔嬪墠缂栬緫杩囩殑琛ㄦ牸鏁版嵁
-                buttonArr = [];//娓呯┖鏁扮粍
-                for (var i = 0; i < tableBak.length; i++) {
-                    buttonArr.push(tableBak[i]);  //灏嗕箣鍓嶇殑鏁版嵁瀛樺偍
-                }
-                buttonArr.push(NewRow);  //鍦ㄥ熬閮ㄥ姞涓�琛�
-                table.reload("mainTable", {
-                    data: buttonArr    //灏嗘暟鎹噸鏂拌浇鍏ヨ〃鏍�
-                })
-            }
-
-            //澶嶅埗涓�琛�
-            function btnCopyLine(data) {
-                var copydata = JSON.stringify(data);
-                if (data.length <= 0) {
-                    layer.msg("璇烽�夋嫨闇�瑕佸鍒剁殑涓�琛岋紒");
-                }
-                else if (data.length > 1) {
-                    layer.msg("鍙兘閫夋嫨澶嶅埗涓�琛岋紒");
-                }
-                else {
-                    var copydata2 = copydata.substring(1, copydata.length);//鍘婚櫎棣栬瀛楃'['
-                    var copyrow = copydata2.substring(0, copydata2.length - 1);//鍘婚櫎鏈熬瀛楃']'
-                    table.cache["mainTable"].push(JSON.parse(copyrow));//灏嗗鍒剁殑琛屽己杞垚json杩藉姞鍒拌〃鏍间笂
-                    option.data = table.cache["mainTable"];//灏嗘暟鎹粦瀹氬埌data涓�
-                    table.render(option);//灏嗘暟鎹覆鏌撳埌琛ㄦ牸涓�
-                }
-            }
-
-            //琛ㄦ牸琛屽唴浜嬩欢鍒犻櫎
-            function set_GridDelete(obj) {
-                var data = obj.data;
-                if (obj.event === 'del') {
-                    layer.confirm('鐪熺殑鍒犻櫎琛屼箞', function (index) {
-                        var rowIndex = $(obj.tr).attr("data-index");
-                        option.data = table.cache["mainTable"];//灏嗘暟鎹粦瀹氬埌data涓�
-                        obj.del();
-                        option.data.splice(rowIndex, 1);//鍒犻櫎缂撳瓨鐨勮
-                        table.reload('mainTable', option);
-                        layer.close(index);
-
-                    });
-                }
-            }
-
-        });
-
-        function AllowLoadData(sSubStr) {  //闈炵┖楠岃瘉
-            if ($("#HBillNo").val() == '') {
-                layer.msg("閿欒鐨勫崟鎹彿", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-                return false;
-            }
-            if ($("#HInterID").val() == '') {
-                layer.msg("閿欒鐨勫唴鐮�", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-                return false;
-            }
-            if (typeof (sSubStr) == "undefined") {
-                layer.msg("娌℃湁鐗╂枡鏄庣粏璁板綍", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-                return false;
-            }
-            if (!typeof (sSubStr) == "undefined") {
-                for (var i = 0; i <= sSubStr.length - 1; i++) {   //鍒ゆ柇鎵爜鏁伴噺涓嶈兘涓�0
-                    if (parseFloat(sSubStr[i].HQty) > 0) {
-                        s = 1;
-                    }
-                }
-                if (s == 0) {
-                    layer.msg("浜у搧鍏ュ簱璁板綍鏈壂鐮�", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+            function AllowLoadData(sSubStr) {  //闈炵┖楠岃瘉
+                if ($("#HBillNo").val() == '') {
+                    layer.msg("閿欒鐨勫崟鎹彿", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
                     return false;
                 }
+                if ($("#HInterID").val() == '') {
+                    layer.msg("閿欒鐨勫唴鐮�", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                    return false;
+                }
+                if (typeof (sSubStr) == "undefined") {
+                    layer.msg("娌℃湁鐗╂枡鏄庣粏璁板綍", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                    return false;
+                }
+                if (!typeof (sSubStr) == "undefined") {
+                    for (var i = 0; i <= sSubStr.length - 1; i++) {   //鍒ゆ柇鎵爜鏁伴噺涓嶈兘涓�0
+                        if (parseFloat(sSubStr[i].HQty) > 0) {
+                            s = 1;
+                        }
+                    }
+                    if (s == 0) {
+                        layer.msg("浜у搧鍏ュ簱璁板綍鏈壂鐮�", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                        return false;
+                    }
+                }
+                else {
+                    return true;
+                }
             }
-            else {
-                return true;
-            }
-        }
+        })
     </script>
 </body>
 </html>
\ No newline at end of file
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_MouldMaintainPlanBillList.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_MouldMaintainPlanBillList.html"
index becb8bb..3913c22 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_MouldMaintainPlanBillList.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_MouldMaintainPlanBillList.html"
@@ -29,15 +29,15 @@
                                     </div>
                                 </div>
                                 <!--<div class="layui-inline">
-                                    <label class="layui-form-label">鍗曟嵁绫诲瀷</label>
-                                    <div class="layui-input-block">
-                                        <select name="HBillType" id="HBillType">
-                                            <option value="">鎵�鏈�</option>
-                                            <option value="ZHXJ">涓嬫灦鎵捐揣鍗�</option>
-                                            <option value="ZHSJ">涓婃灦褰掕繕鍗�</option>
-                                        </select>
-                                    </div>
-                                </div>-->
+                <label class="layui-form-label">鍗曟嵁绫诲瀷</label>
+                <div class="layui-input-block">
+                    <select name="HBillType" id="HBillType">
+                        <option value="">鎵�鏈�</option>
+                        <option value="ZHXJ">涓嬫灦鎵捐揣鍗�</option>
+                        <option value="ZHSJ">涓婃灦褰掕繕鍗�</option>
+                    </select>
+                </div>
+            </div>-->
                                 <div class="layui-inline">
                                     <label class="layui-form-label">鍗曟嵁鍙�</label>
                                     <div class="layui-input-block">
@@ -71,6 +71,20 @@
                             </div>
                         </div>
                         <table class="" id="mainTable" lay-filter="mainTable"></table>
+                        <div class="layui-tab layui-tab-card">
+                            <ul class="layui-tab-title">
+                                <li class="layui-this">淇濆吇椤逛俊鎭�</li>
+                                <li>閰嶄欢淇℃伅</li>
+                            </ul>
+                            <div class="layui-tab-content">
+                                <div class="layui-tab-item layui-show">
+                                    <table class="layui-hide" id="mainTable1" lay-filter="mainTable1"></table>
+                                </div>
+                                <div class="layui-tab-item">
+                                    <table class="layui-hide" id="mainTable2" lay-filter="mainTable2"></table>
+                                </div>
+                            </div>
+                        </div>
                         <script type="text/html" id="toolbarDemo">
                             <div class="layui-btn-container">
                                 <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-getCheckData"><i class="layui-icon layui-icon-tips"></i>棰勮</button>-->
@@ -80,10 +94,14 @@
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-print"><i class="layui-icon layui-icon-print"></i>鎵撳嵃</button>
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Delete"><i class="layui-icon layui-icon-delete"></i>鍒犻櫎</button>
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Refresh"><i class="layui-icon layui-icon-refresh"></i>鍒锋柊</button>
-                                
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Exit"><i class="layui-icon layui-icon-return"></i>閫�鍑�</button>
-
                             </div>
+                        </script>
+                        <script type="text/html" id="xuhao">
+                            {{d.LAY_TABLE_INDEX+1}}
+                        </script>
+                        <script type="text/html" id="xuhao1">
+                            {{d.LAY_TABLE_INDEX+1}}
                         </script>
                     </form>
                 </div>
@@ -114,9 +132,17 @@
             var sWhere = "";
             //鍏敤鍙橀噺
             var option = [];
+            var option1 = [];
+            var option2 = [];
 
+            $("#BenginHCreateDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
+            $("#EndHCreateDate").val(Format(new Date(), "yyyy-MM-dd"));
             //鍒濆鍖栬〃鏍�
             set_InitGrid();
+            //鍒濆鍖栬〃鏍�(瀛愯〃1)
+            set_InitGrid1();
+            //鍒濆鍖栬〃鏍�(瀛愯〃2)
+            set_InitGrid2();
             //鍔犺浇鏁版嵁鍒扮綉鏍�
             get_Display(sWhere);
 
@@ -163,12 +189,37 @@
                 };
             });
 
+            //鐐瑰嚮涓昏〃甯﹀嚭浠庤〃鏁版嵁
+            table.on('row(mainTable)', function (obj) { //娉細tool 鏄伐鍏锋潯浜嬩欢鍚嶏紝test 鏄� table 鍘熷瀹瑰櫒鐨勫睘鎬� lay-filter="瀵瑰簲鐨勫��"
+                var datas = obj.data; //鑾峰緱褰撳墠琛屾暟鎹�
+                var linterid = datas.hmainid;
+                $.ajax({
+                    url: GetWEBURL() + 'Sc_MouldMaintainPlanBill/Sc_MouldMaintainPlanBillListProjectDetai',
+                    type: "GET",
+                    data: { "sqlWhere": "and hmainid=" + linterid },
+                    success: function (data1) {
+                        if (data1.count == 1) {
+                            option1.data = data1.list[0];
+                            table.render(option1);
+                            option2.data = data1.list[1];
+                            table.render(option2);
+                        } else {
+                            layer.alert(result.code + result.Message, { icon: 5 });
+                        }
+                    }, error: function () {
+                        layer.alert("鎺ュ彛澶辨晥!", { icon: 5 });
+                    }
+                });
+            });
+
             //閲嶇疆鎸夐挳
             form.on('submit(btnReSearch)', function (data) {
                 set_ClearQuery();
             });
             //閲嶇疆杩囨护鏉′欢
             function set_ClearQuery() {
+                $("#BenginHCreateDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
+                $("#EndHCreateDate").val(Format(new Date(), "yyyy-MM-dd"));
                 $("#HNumber").val("");
                 $("#HName").val("");
                 $("#HBillNo").val("");//鍗曟嵁鍙�
@@ -205,7 +256,7 @@
                 option = {
                     elem: '#mainTable'
                     , toolbar: '#toolbarDemo'
-                    , height: 'full-50'
+                    , height: 450
                     , page: true
                     , cellMinWidth: 90
                     , limit: 50
@@ -237,7 +288,7 @@
                         , { field: '鍏抽棴绫诲瀷', title: '鍏抽棴绫诲瀷', width: 200 }
                         , { field: '琛ㄤ綋澶囨敞', title: '琛ㄤ綋澶囨敞', width: 200, hide: true }
                         , { field: '鍒跺崟浜�', title: '鍒跺崟浜�', width: 115, hide: true }
-                        , { field: '鍒跺崟鏃ユ湡', title: '鍒跺崟鏃ユ湡', width: 200, templet: "<div>{{d.鍒跺崟鏃ユ湡 ==null ?'':layui.util.toDateString(d.鍒跺崟鏃ユ湡 'yyyy-MM-dd')}}</div>"}
+                        , { field: '鍒跺崟鏃ユ湡', title: '鍒跺崟鏃ユ湡', width: 200, templet: "<div>{{d.鍒跺崟鏃ユ湡 ==null ?'':layui.util.toDateString(d.鍒跺崟鏃ユ湡 ,'yyyy-MM-dd')}}</div>"}
                         , { field: '瀹℃牳浜�', title: '瀹℃牳浜�', width: 200 }
                         , { field: '瀹℃牳鏃ユ湡', title: '瀹℃牳鏃ユ湡', width: 200, hide: true, templet: "<div>{{d.瀹℃牳鏃ユ湡 ==null ?'':layui.util.toDateString(d.瀹℃牳鏃ユ湡, 'yyyy-MM-dd')}}</div>"}
                         , { field: '淇敼浜�', title: '淇敼浜�', width: 200, hide: true }
@@ -255,6 +306,69 @@
                 }
             }
 
+            //鍒濆鍖栬〃鏍�(瀛愯〃1)
+            function set_InitGrid1() {
+                var ajaxLoad = layer.load();
+                option1 = {
+                    elem: '#mainTable1'
+                    //, toolbar: '#toolbarDemo'
+                    , height: '250'
+                    , page: true
+                    , cellMinWidth: 90
+                    , limit: 50
+                    , limits: [50, 500, 5000, 20000]
+                    , cols: [[
+                        //{ type: 'checkbox', fixed: 'left' }
+                        , { templet: '#xuhao', title: '搴忓彿', sort: true, fixed: 'left' }
+                        , { field: 'HMaintainItemID', title: '淇濆吇椤圭洰ID', width: 200, hide: true }
+                        , { field: 'HMaintainItemNumber', title: '淇濆吇椤圭洰浠g爜', width: 200 }
+                        , { field: 'HMaintainItem', title: '淇濆吇椤圭洰', width: 200 }
+                        , { field: 'HMaintainPart', title: '淇濆吇閮ㄤ綅', width: 200 }
+                        , { field: 'HClaim', title: '鍏蜂綋瑕佹眰', width: 200 }
+                        , { field: 'HManagerID', title: '璐熻矗浜篒D', width: 200, hide: true }
+                        , { field: 'HManagerNumber', title: '璐熻矗浜轰唬鐮�', width: 200 }
+                        , { field: 'HManagerName', title: '璐熻矗浜�', width: 200 }
+                        , { field: 'HRemark', title: '澶囨敞', width: 200 }
+                    ]]
+                };
+                option1.data = [];
+                table.render(option1);
+                layer.close(ajaxLoad);
+            }
+
+            //鍒濆鍖栬〃鏍�(瀛愯〃2)
+            function set_InitGrid2() {
+                var ajaxLoad = layer.load();
+                option2 = {
+                    elem: '#mainTable2'
+                    //, toolbar: '#toolbarDemo'
+                    , height: '250'
+                    , page: true
+                    , cellMinWidth: 90
+                    , limit: 50
+                    , limits: [50, 500, 5000, 20000]
+                    , cols: [[
+                        //{ type: 'checkbox', fixed: 'left' }
+                        , { templet: '#xuhao1', title: '搴忓彿', sort: true, fixed: 'left'}
+                        , { field: 'HMaterID', title: '閰嶄欢ID', width: 200, hide: true }
+                        , { field: 'HMaterNumber', title: '閰嶄欢浠g爜', width: 200 }
+                        , { field: 'HMaterName', title: '閰嶄欢鍚嶇О', width: 200 }
+                        , { field: 'HMaterSpec', title: '瑙勬牸鍨嬪彿', width: 200, hide: true }
+                        , { field: 'HUnitID', title: '鍗曚綅ID', width: 200, hide: true }
+                        , { field: 'HUnitNumber', title: '鍗曚綅浠g爜', width: 200 }
+                        , { field: 'HUnitName', title: '鍗曚綅鍚嶇О', width: 200 }
+                        , { field: 'HManagerID', title: '璐熻矗浜篒D', width: 200, hide: true }
+                        , { field: 'HManagerNumber', title: '璐熻矗浜轰唬鐮�', width: 200 }
+                        , { field: 'HManagerName', title: '璐熻矗浜�', width: 200 }
+                        , { field: 'HQty', title: '瀹為檯鐢ㄩ噺', width: 200 }
+                        , { field: 'HQtyMust', title: '鏍囧噯鐢ㄩ噺', width: 200 }
+                        , { field: 'HRemark', title: '澶囨敞', width: 200 }
+                    ]]
+                };
+                option2.data = [];
+                table.render(option2);
+                layer.close(ajaxLoad);
+            }
 
             //鏂板
             function set_AddNew() {
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_MouldMaintainRuleBillList.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_MouldMaintainRuleBillList.html"
index 98d298e..9f81063 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_MouldMaintainRuleBillList.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_MouldMaintainRuleBillList.html"
@@ -252,6 +252,8 @@
 
             //#region 姝ら〉闈㈡墍鏈夋柟娉�
             function set_ClearBill() {
+                $("#BenginHCreateDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
+                $("#EndHCreateDate").val(Format(new Date(), "yyyy-MM-dd"));
                 //鍒濆鍖栬〃鏍�(涓昏〃)
                 set_InitGrid();
                 //鍒濆鍖栬〃鏍�(瀛愯〃1)
@@ -610,7 +612,7 @@
                     sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) >= '" + BenginHCreateDate + "'";
                 }
                 if (EndHCreateDate) {
-                    sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) >= '" + EndHCreateDate + "'";
+                    sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) <= '" + EndHCreateDate + "'";
                 }
                 get_Display(sWhere);
                 sWhere = "";//璋冪敤鎺ュ彛鍚庢竻绌簊Where缂撳瓨
@@ -621,8 +623,8 @@
                 $("#HBillNo").val("");//鍗曟嵁鍙�
                 $("#HSourceBillNo").val("");//婧愬崟鍙�
                 $("#HCreateBy").val("");//鍒跺崟浜�
-                $("#BenginHCreateDate").val("");//寮�濮嬪埗鍗曟椂闂�
-                $("#EndHCreateDate").val("");//缁撴潫鍒跺崟鏃堕棿
+                $("#BenginHCreateDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
+                $("#EndHCreateDate").val(Format(new Date(), "yyyy-MM-dd"));
                 $("#btnSearch").click();
                 $("#ColContent").val("");
                 $("#ColName").val("0");
diff --git "a/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\350\246\201\346\226\231\350\256\241\345\210\222/JIT_NeedMaterPlanBillEdit.html" "b/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\350\246\201\346\226\231\350\256\241\345\210\222/JIT_NeedMaterPlanBillEdit.html"
index 02880a4..0052abf 100644
--- "a/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\350\246\201\346\226\231\350\256\241\345\210\222/JIT_NeedMaterPlanBillEdit.html"
+++ "b/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\350\246\201\346\226\231\350\256\241\345\210\222/JIT_NeedMaterPlanBillEdit.html"
@@ -273,30 +273,7 @@
             //    }, function () { window.location.href = "../../user/login.html"; });
             //}
 
-            var params = getUrlVars();
-            var OperationType = params[params[0]]; //浠庡弬鏁颁腑鑾峰彇 鏁版嵁绫诲瀷  娣诲姞 淇濆瓨
-            var linterid = params[params[1]]; //浠庡弬鏁颁腑鑾峰彇 鍗曟嵁鍐呯爜
-            var lSourceBillType = params[params[2]];  //浠庡崟鎹幏鍙� 婧愬崟绫诲瀷
-
-            //鍒ゆ柇鏄惁鏂板
-            if (linterid == null || linterid == -1) {
-                OperationType = 1;
-                $.ajax({
-                    url: GetWEBURL() + "/Web/GetMAXNum",
-                    type: "GET",
-                    data: { "HBillType": '4609' },
-                    success: function (d) {
-                        //console.log(d.data);
-                        $("#HInterID").val(d.data[0].HInterID);
-                        $("#HBillNo").val(d.data[0].HBillNo);
-                        $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
-                    }
-                });
-            }
-            else {//濡傛灉淇敼鍒欒蛋涓嬮潰 new
-                RoadBillMain(linterid);
-                //RoadBillSub(linterid);
-            }
+        
             var HModName = "JIT_NeedMaterPlanBill";
             var option = {
                 elem: '#mainTable'
@@ -346,10 +323,35 @@
                     , { fixed: 'right', title: '鎿嶄綔', toolbar: '#barDemo' }
                 ]]
             }
-
             //鍒濆鍔犺浇琛ㄦ牸
             option.data = rowdata;
             DisPlay_HideColumn();
+
+            var params = getUrlVars();
+            var OperationType = params[params[0]]; //浠庡弬鏁颁腑鑾峰彇 鏁版嵁绫诲瀷  娣诲姞 淇濆瓨
+            var linterid = params[params[1]]; //浠庡弬鏁颁腑鑾峰彇 鍗曟嵁鍐呯爜
+            var lSourceBillType = params[params[2]];  //浠庡崟鎹幏鍙� 婧愬崟绫诲瀷
+
+            //鍒ゆ柇鏄惁鏂板
+            if (linterid == null || linterid == -1) {
+                OperationType = 1;
+                $.ajax({
+                    url: GetWEBURL() + "/Web/GetMAXNum",
+                    type: "GET",
+                    data: { "HBillType": '4609' },
+                    success: function (d) {
+                        //console.log(d.data);
+                        $("#HInterID").val(d.data[0].HInterID);
+                        $("#HBillNo").val(d.data[0].HBillNo);
+                        $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
+                    }
+                });
+            }
+            else {//濡傛灉淇敼鍒欒蛋涓嬮潰 new
+                RoadBillMain(linterid);
+                //RoadBillSub(linterid);
+            }
+         
             //#endregion
 
             //#region 瑙﹀彂浜嬩欢锛氬寘鎷琭orm.on(){}鏍煎紡鐨勬墍鏈夌偣鍑讳簨浠躲�侀�夋嫨浜嬩欢绛�
@@ -871,6 +873,7 @@
                 $.ajax({
                     url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList',
                     type: "GET",
+                    async: false,
                     data: { "HModName": HModName, "user": sessionStorage["HUserName"] },
                     success: function (data1) {
                         if (data1.data.length != 0) {
@@ -956,6 +959,7 @@
                 $.ajax({
                     url: GetWEBURL() + "/Sc_WorkDemandPlanBill/Sc_WorkDemandPlanBillList",
                     type: "GET",
+                    async: false,
                     data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                     success: function (d) {
 
diff --git "a/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_RoutingBill.html" "b/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_RoutingBill.html"
index 6f58e9f..d4eb45a 100644
--- "a/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_RoutingBill.html"
+++ "b/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_RoutingBill.html"
@@ -550,6 +550,8 @@
             //鍒濆鍔犺浇琛ㄦ牸
             option.data = rowdata;
             table.render(option);
+            //鍒濆鍖栬〃鏍�
+            DisPlay_HideColumn();
 
             //鍒跺崟浜�
             $("#HMaker").val(sessionStorage["HUserName"]);
@@ -608,8 +610,7 @@
                 //RoadBillSub(linterid);
             }
 
-            //鍒濆鍖栬〃鏍�
-            DisPlay_HideColumn();
+          
 
             //#endregion
 
@@ -1587,6 +1588,7 @@
                     url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList',
                     type: "GET",
                     data: { "HModName": HModName, "user": sessionStorage["HUserName"] },
+                    async: false,
                     success: function (data1) {
                         if (data1.data.length != 0) {
 
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 43a571f..db4c45f 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"
@@ -166,6 +166,9 @@
     <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>
     <script src="../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
@@ -414,12 +417,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' }
                 ];
@@ -453,7 +456,7 @@
                     , { 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'
@@ -646,8 +649,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 +661,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 });
diff --git "a/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\267\245\345\272\217\345\207\272\347\253\231\346\261\207\346\212\245\345\215\225/Cj_StationOutBill.html" "b/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\267\245\345\272\217\345\207\272\347\253\231\346\261\207\346\212\245\345\215\225/Cj_StationOutBill.html"
index 6b1c21c..b8f4166 100644
--- "a/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\267\245\345\272\217\345\207\272\347\253\231\346\261\207\346\212\245\345\215\225/Cj_StationOutBill.html"
+++ "b/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\267\245\345\272\217\345\207\272\347\253\231\346\261\207\346\212\245\345\215\225/Cj_StationOutBill.html"
@@ -1190,7 +1190,7 @@
                 $.ajax({
                     type: "POST",
                     url: GetWEBURL() + "/Cj_StationOutBill/AddBill",
-                    async: true,
+                    async: false,
                     data: { "oMain": oMain },
                     dataType: "json",
                     success: function (data) {
@@ -1642,7 +1642,7 @@
                 $.ajax({
                     type: "GET",
                     url: GetWEBURL() + "/Sc_ProcessMangement/SaveICMOReportBill", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
-                    async: true,
+                    async: false,
                     data: { "InterID": InterID, "user": sessionStorage["HUserName"], "BillNo": BillNo, "OrganizationID": sessionStorage["OrganizationID"] },
                     dataType: "json",
                     success: function (data) {
@@ -1669,7 +1669,7 @@
                 $.ajax({
                     type: "GET",
                     url: GetWEBURL() + "/Sc_ProcessMangement/SaveProcdutInBill", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
-                    async: true,
+                    async: false,
                     data: { "BillNo": BillNo },
                     dataType: "json",
                     success: function (data) {
@@ -1695,7 +1695,7 @@
                 $.ajax({
                     type: "GET",
                     url: GetWEBURL() + "/Sc_ProcessMangement/SaveBFBill", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
-                    async: true,
+                    async: false,
                     data: { "BillNo": BillNo },
                     dataType: "json",
                     success: function (data) {

--
Gitblit v1.9.1