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_MouldProdOutBillList.html |   95 ++++++++++++++++++++++++++++++++---------------
 1 files changed, 64 insertions(+), 31 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\344\273\223\345\272\223\347\256\241\347\220\206/Sc_Add_MouldProdOutBillList.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\344\273\223\345\272\223\347\256\241\347\220\206/Sc_Add_MouldProdOutBillList.html"
index 182919e..0010e44 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\344\273\223\345\272\223\347\256\241\347\220\206/Sc_Add_MouldProdOutBillList.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\344\273\223\345\272\223\347\256\241\347\220\206/Sc_Add_MouldProdOutBillList.html"
@@ -30,12 +30,11 @@
                                 <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="print">鎵撳嵃</button>
 
                             </div>
-
                         </div>
                         <div class="layui-card-body">
                             <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
                                 <!--<ul class="layui-tab-title">
-                                <li class="layui-this">鍩烘湰淇℃伅</li>-->
+            <li class="layui-this">鍩烘湰淇℃伅</li>-->
                                 <!--<li>鍏朵粬淇℃伅</li>-->
                                 <!--</ul>-->
                                 <h1 style="text-align:center;"><b>鍣ㄥ叿棰嗙敤鍗�</b></h1>
@@ -140,8 +139,21 @@
                                 </div>
                             </div>
                         </div>
+                        <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>
 
-                        <table class="layui-hide" id="mainTable" lay-filter="mainTable"></table>
                         <script type="text/html" id="toolbarDemo">
                             <div class="layui-btn-container">
 
@@ -222,6 +234,9 @@
                     , { field: 'HMaterName', title: '鍣ㄥ叿鍚嶇О', edit: 'text', width: 100 }
                     , { field: 'HMaterSpec', title: '瑙勬牸鍨嬪彿', edit: 'text', width: 100 }
                     , { field: 'HBatchNo', title: '鎵规', edit: 'text', width: 100 }
+                    , { field: 'HUnitID', title: 'HUnitID', edit: 'text', width: 100, hide: true }
+                    , { field: 'HUnitCode', title: '璁¢噺鍗曚綅浠g爜', edit: 'text', event: 'HUnitCode', width: 100 }
+                    , { field: 'HUnitName', title: '璁¢噺鍗曚綅', edit: 'text', width: 100 }
                     , { field: 'HDesignLife', title: '璁捐瀵垮懡', edit: 'text', width: 100 }
                     , { field: 'HLeaveLife', title: '鍓╀綑瀵垮懡', edit: 'text', width: 100 }
                     , { field: 'HUseLife', title: '绱Н浣跨敤瀵垮懡', edit: 'text', width: 100 }
@@ -236,29 +251,52 @@
                     , { field: 'HSPCode', title: '浠撲綅浠g爜', edit: 'text', event: 'HSPCode', width: 100 }
                     , { field: 'HSPName', title: '浠撲綅', edit: 'text', width: 100 }
                     , { field: 'HRemark', title: '琛ㄤ綋澶囨敞', edit: 'text', width: 100 }
+                    , { field: 'HStockOrgID', title: 'HStockOrgID', width: 100, hide: true }
                     , { fixed: 'right', title: '鎿嶄綔', toolbar: '#barDemo' }
                 ]]
                 , limit: 500 //姣忛〉榛樿鏄剧ず鐨勬暟閲�
             };
+            var option1 = {
+                id:'#mainTable1'
+                ,elem: '#mainTable1'
+                , height: 500
+                , page: true //寮�鍚垎椤�
+                , cols: [[ //琛ㄥご
+                    { type: 'checkbox', fixed: 'left' }
+                    , { templet: '#xuhao', title: '搴忓彿', sort: true, fixed: 'left', event: "qwe", width: 100 }
+                    , { field: '鐗╂枡浠g爜', title: '鐗╂枡浠g爜', edit: 'text', event: 'HMaterCode', width: 100 }
+                    , { field: '鐗╂枡鍚嶇О', title: '鐗╂枡鍚嶇О', edit: 'text', width: 100 }
+                    , { field: '瑙勬牸鍨嬪彿', title: '瑙勬牸鍨嬪彿', edit: 'text', width: 100 }
+                    , { field: '鍗曟嵁鍙�', title: '鍗曟嵁鍙�', edit: 'text', width: 100 }
+                    , { field: '鎵规', title: '鎵规', edit: 'text', width: 100 }
+                    , { field: '瀹炲彂鏁伴噺', title: '瀹炲彂鏁伴噺', edit: 'text', width: 100 }
+                    , { field: 'HWHSonID', title: 'HWHSonID', edit: 'text', width: 100, hide: true }
+                    , { field: '鍙戞枡浠撳簱浠g爜', title: '鍙戞枡浠撳簱浠g爜', edit: 'text', event: 'HWHCode', width: 120 }
+                    , { field: '鍙戞枡浠撳簱', title: '鍙戞枡浠撳簱', edit: 'text', width: 120 }
+                    , { field: '琛ㄤ綋澶囨敞', title: '澶囨敞', edit: 'text', width: 100 }
+                ]]
+                , limit: 500 //姣忛〉榛樿鏄剧ず鐨勬暟閲�
+            };
+
             //鍒ゆ柇鏄惁鏂板
             if (OperationType == 1) {
                 //鍒濆鍔犺浇琛ㄦ牸{ "ID": 0, "HWasterReasonName": " ","HBadReasonID":0,"HEmpName": "  ", "HSQProcName": "   ","HProcID":0, "HZRProcName": "  ", "HMRBChecker": "  ", "HRemark": "  ", "HPSProcName": "  ", "HCloseMan": "   " }
-                option.data = [{ "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HBatchNo": "", "HDesignLife": 0, "HLeaveLife": 0, "HUseLife": 0, "HQtyMust": 0, "HQty": 0, "HPrice": 0, "HMoney": 0, "HWHID": 0, "HWHCode": "", "HWHName": "", "HSPID": 0, "HSPCode": "", "HSPName": "", "HRemark": "" }];
+                option.data = [{ "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HBatchNo": "", "HDesignLife": 0, "HLeaveLife": 0, "HUseLife": 0, "HQtyMust": 0, "HQty": 0, "HPrice": 0, "HMoney": 0, "HWHID": 0, "HWHCode": "", "HWHName": "", "HSPID": 0, "HSPCode": "", "HSPName": "", "HStockOrgID": sessionStorage["OrganizationID"], "HRemark": "" }];
                 table.render(option);
             }
             else {
-                $("#HInterID").val(hID);//淇敼鏃朵富琛↖D
+                $("#HInterID").val(linterid);//淇敼鏃朵富琛↖D
                 //缂栬緫鍔犺浇鏁版嵁
                 $.ajax({
                     url: GetWEBURL() + 'Sc_MouldProdOutBill/Sc_MouldProdOutBillListProjectDetai',
                     type: "GET",
-                    data: { "sqlWhere": "and hmainid=" + hID },
+                    data: { "sqlWhere": "and hmainid=" + linterid },
                     success: function (result) {
-                        //console.log(result);
-                        //console.log('gouba' + result);
                         if (result.count == 1) {
-                            option.data = result.data;
+                            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 });
@@ -279,7 +317,7 @@
                 var checkStatus = table.checkStatus('mainTable')
                     , data = checkStatus.data;;
                 var AddRow = table.cache['mainTable'];
-                var NewRow = { "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HBatchNo": "", "HDesignLife": 0, "HLeaveLife": 0, "HUseLife": 0, "HQtyMust": 0, "HQty": 0, "HPrice": 0, "HMoney": 0, "HWHID": 0, "HWHCode": "", "HWHName": "", "HSPID": 0, "HSPCode": "", "HSPName": "", "HRemark": "" };
+                var NewRow = { "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HBatchNo": "", "HUnitID": 0, "HUnitCode": "", "HUnitName": "", "HDesignLife": 0, "HLeaveLife": 0, "HUseLife": 0, "HQtyMust": 0, "HQty": 0, "HPrice": 0, "HMoney": 0, "HWHID": 0, "HWHCode": "", "HWHName": "", "HSPID": 0, "HSPCode": "", "HSPName": "", "HRemark": "" };
                 switch (obj.event) {
                     case 'btn-AddLine':
                         //table.cache["mainTable"].push(AddRow[rows]);
@@ -392,7 +430,7 @@
 
                                     //鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
                                     var iframeWindow = window['layui-layer-iframe' + index]  //鑾峰彇寮规椤甸潰
-                                    var checkStatus = iframeWindow.layui.table.checkStatus('ck-table');//鑾峰彇table鐨別lem:"#test"
+                                    var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//鑾峰彇table鐨別lem:"#test"
                                     if (checkStatus.data.length === 0) {
                                         return layer.msg('璇烽�夋嫨鏁版嵁');
                                     }
@@ -527,16 +565,16 @@
                 }
             });
 
-            //鍔犺浇琛ㄥご
-            function RoadBillMain(hID)
+
+            function RoadBillMain(hID)//鍔犺浇琛ㄥご
             {
-                //alert(hID);
+                //alert(linterid);
                 //鏌ヨ妫�楠屾柟妗堝崟鏄惁瀛樺湪
                 $.ajax({
                     url: GetWEBURL() + "Sc_MouldProdOutBill/Sc_MouldProdOutBillListCheckDetai",
                     type: "GET",
                     data: {
-                        "HID": hID
+                        "HID": linterid
                     },
                     success: function (result) {
 
@@ -578,7 +616,7 @@
             var shijian = year + "-" + month + "-" + day;
 
             //鍒ゆ柇鏄惁鏂板
-            if (hID == null || hID == 0) {
+            if (linterid == null || linterid == 0) {
                 //鑾峰彇鏈�澶у崟鎹彿 new
                 $("#HInterID").val("0");
                 $("#HBillNo").val("");
@@ -595,7 +633,7 @@
                 });
             }
             else {//濡傛灉淇敼鍒欒蛋涓嬮潰 new
-                RoadBillMain(hID);
+                RoadBillMain(linterid);
                 /* RoadBillSub(linterid);*/
             }
 
@@ -616,7 +654,7 @@
 
                         //鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
                         var iframeWindow = window['layui-layer-iframe' + index]  //鑾峰彇寮规椤甸潰
-                        var checkStatus = iframeWindow.layui.table.checkStatus('ck-table');//鑾峰彇table鐨別lem:"#test"
+                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//鑾峰彇table鐨別lem:"#test"
                         if (checkStatus.data.length === 0) {
                             return layer.msg('璇烽�夋嫨鏁版嵁');
                         }
@@ -753,7 +791,7 @@
             });
             //鎵撳嵃Printing
             form.on("submit(view)", function (data) {
-                if (hID != "" || hID != null) {
+                if (linterid != "" || linterid != null) {
                     layer.open({
                         type: 2
                         , area: ['50%', '50%']
@@ -761,7 +799,7 @@
                         , shade: 0.6 //閬僵閫忔槑搴�
                         , maxmin: false //鍏佽鍏ㄥ睆鏈�灏忓寲
                         , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
-                        , content: ['../../BaseSet/SRM_OpenTmpList.html?linterid=' + hID.toString() + '&MyMsg=' + hID.toString() + '&Type=HMouldProdOutBill', 'yes']
+                        , content: ['../../BaseSet/SRM_OpenTmpList.html?linterid=' + linterid.toString() + '&MyMsg=' + linterid.toString() + '&Type=HMouldProdOutBill', 'yes']
                         , resize: false
                     })
                 }
@@ -772,7 +810,7 @@
             });
             //鎵撳嵃Printing
             form.on("submit(print)", function (data) {
-                if (hID != "" || hID != null) {
+                if (linterid != "" || linterid != null) {
                     layer.open({
                         type: 2
                         , area: ['50%', '50%']
@@ -780,7 +818,7 @@
                         , shade: 0.6 //閬僵閫忔槑搴�
                         , maxmin: false //鍏佽鍏ㄥ睆鏈�灏忓寲
                         , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
-                        , content: ['../../BaseSet/SRM_OpenTmpList.html?linterid=' + hID.toString() + '&MyMsg=' + hID.toString() + '&Type=HMouldProdOutBill', 'yes']
+                        , content: ['../../BaseSet/SRM_OpenTmpList.html?linterid=' + linterid.toString() + '&MyMsg=' + linterid.toString() + '&Type=HMouldProdOutBill', 'yes']
                         , resize: false
                     })
                 }
@@ -969,19 +1007,14 @@
                 return false;
             }
             if (!typeof (sSubStr) == "undefined") {
-                //for (var i = 0; i <= sSubStr.length - 1; i++) {  //鍒ゆ柇鎵爜鏁伴噺涓嶈兘澶т簬搴旀敹鏁伴噺
-                //    if (parseFloat(sSubStr[i].HQtyMust) > 0) {
-                //        if (parseFloat(sSubStr[i].HQty) > parseFloat(sSubStr[i].HQtyMust))
-                //        {
-                //            layer.msg("鏁伴噺涓嶈兘澶т簬搴旀敹鏁伴噺", { icon: 5, btn: ['纭畾'], time: 100000, offset: 't' });
-                //            return false;
-                //        }
-                //    }
-                //}
                 for (var i = 0; i <= sSubStr.length - 1; i++) {   //鍒ゆ柇鎵爜鏁伴噺涓嶈兘涓�0
                     if (parseFloat(sSubStr[i].HQty) > 0) {
                         s = 1;
                     }
+                    if (sSubStr[i].HUnitID == "") {
+                        layer.msg("鏄庣粏璁板綍绗�" + (i + 1) + "琛�,璁¢噺鍗曚綅涓虹┖!", { icon: 5, btn: ['纭'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                        return Result = false;
+                    }
                 }
                 if (s == 0) {
                     layer.msg("浜у搧鍏ュ簱璁板綍鏈壂鐮�", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });

--
Gitblit v1.9.1