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 |  144 ++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 109 insertions(+), 35 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 eebef97..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"
@@ -2,7 +2,7 @@
 <html>
 <head>
     <meta charset="utf-8" />
-    <title>鏂板/缂栬緫妯″叿棰嗙敤鍗�</title>
+    <title>鏂板/缂栬緫鍣ㄥ叿棰嗙敤鍗�</title>
     <meta name="renderer" content="webkit">
     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
     <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
@@ -26,18 +26,18 @@
 
                                 <button type="button" id="add-btn" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Saver">淇濆瓨</button>
                                 <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Exit">閫�鍑�</button>
-
+                                <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="view">棰勮</button>
+                                <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="print">鎵撳嵃</button>
 
                             </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>
+                                <h1 style="text-align:center;"><b>鍣ㄥ叿棰嗙敤鍗�</b></h1>
                                 <div class="layui-tab-content">
                                     <div class="layui-tab-item layui-show">
                                         <div class="layui-form-item">
@@ -62,7 +62,7 @@
                                                 </div>
                                             </div>
                                             <div class="layui-inline">
-                                                <label class="layui-form-label">妯″叿浠撳簱</label>
+                                                <label class="layui-form-label">鍣ㄥ叿浠撳簱</label>
                                                 <div class="layui-input-inline">
                                                     <input type="text" name="HWHName" id="HWHName" class="layui-input" value="" style="float:left;width:150px;">
                                                     <input type="hidden" name="HWHID" id="HWHID" class="layui-input" value="" style="float:left;width:150px;">
@@ -139,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">
 
@@ -161,11 +174,14 @@
         <!--<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 src="../../../layuiadmin/layui/layui.js"></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>
     <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
     <script src="../../../layuiadmin/PubCustom.js"></script>
+    <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
     <script>
         layui.config({
             base: '../../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰�
@@ -179,7 +195,7 @@
                 , form = layui.form
                 , laydate = layui.laydate
                 , element = layui.element;
-    
+
             var params = get_UrlVars();
             if (typeof (params[params[0]]) == "undefined") {
                 var OperationType = 1;//鎿嶄綔绫诲瀷
@@ -214,10 +230,13 @@
                     { type: 'checkbox', fixed: 'left' }
                     , { templet: '#xuhao', title: '搴忓彿', sort: true, fixed: 'left', event: "qwe", width: 100 }
                     , { field: 'HMaterID', title: 'HMaterID', edit: 'text', width: 100, hide: true }
-                    , { field: 'HMaterCode', title: '妯″叿浠g爜', edit: 'text', event: 'HMaterCode', width: 100 }
-                    , { field: 'HMaterName', title: '妯″叿鍚嶇О', edit: 'text', width: 100 }
+                    , { field: 'HMaterCode', title: '鍣ㄥ叿浠g爜', edit: 'text', event: 'HMaterCode', width: 100 }
+                    , { 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 }
@@ -232,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 });
@@ -275,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]);
@@ -330,7 +372,7 @@
                             layer.open({
                                 type: 2,
                                 skin: 'layui-layer-rim', //鍔犱笂杈规
-                                title: '妯″叿鍒楄〃',
+                                title: '鍣ㄥ叿鍒楄〃',
                                 closeBtn: 1,
                                 shift: 2,
                                 area: ['80%', '80%'],
@@ -388,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('璇烽�夋嫨鏁版嵁');
                                     }
@@ -526,13 +568,13 @@
 
             function RoadBillMain(hID)//鍔犺浇琛ㄥご
             {
-                //alert(hID);
+                //alert(linterid);
                 //鏌ヨ妫�楠屾柟妗堝崟鏄惁瀛樺湪
                 $.ajax({
                     url: GetWEBURL() + "Sc_MouldProdOutBill/Sc_MouldProdOutBillListCheckDetai",
                     type: "GET",
                     data: {
-                        "HID": hID
+                        "HID": linterid
                     },
                     success: function (result) {
 
@@ -574,7 +616,7 @@
             var shijian = year + "-" + month + "-" + day;
 
             //鍒ゆ柇鏄惁鏂板
-            if (hID == null || hID == 0) {
+            if (linterid == null || linterid == 0) {
                 //鑾峰彇鏈�澶у崟鎹彿 new
                 $("#HInterID").val("0");
                 $("#HBillNo").val("");
@@ -591,7 +633,7 @@
                 });
             }
             else {//濡傛灉淇敼鍒欒蛋涓嬮潰 new
-                RoadBillMain(hID);
+                RoadBillMain(linterid);
                 /* RoadBillSub(linterid);*/
             }
 
@@ -612,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('璇烽�夋嫨鏁版嵁');
                         }
@@ -747,7 +789,43 @@
                     }
                 });
             });
+            //鎵撳嵃Printing
+            form.on("submit(view)", function (data) {
+                if (linterid != "" || linterid != null) {
+                    layer.open({
+                        type: 2
+                        , area: ['50%', '50%']
+                        , title: '鎵撳嵃妯$増閫夋嫨'
+                        , shade: 0.6 //閬僵閫忔槑搴�
+                        , maxmin: false //鍏佽鍏ㄥ睆鏈�灏忓寲
+                        , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
+                        , content: ['../../BaseSet/SRM_OpenTmpList.html?linterid=' + linterid.toString() + '&MyMsg=' + linterid.toString() + '&Type=HMouldProdOutBill', 'yes']
+                        , resize: false
+                    })
+                }
+                else {
+                    layer.msg('褰撳墠鍗曟嵁ID涓虹┖锛�');
+                }
 
+            });
+            //鎵撳嵃Printing
+            form.on("submit(print)", function (data) {
+                if (linterid != "" || linterid != null) {
+                    layer.open({
+                        type: 2
+                        , area: ['50%', '50%']
+                        , title: '鎵撳嵃妯$増閫夋嫨'
+                        , shade: 0.6 //閬僵閫忔槑搴�
+                        , maxmin: false //鍏佽鍏ㄥ睆鏈�灏忓寲
+                        , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
+                        , content: ['../../BaseSet/SRM_OpenTmpList.html?linterid=' + linterid.toString() + '&MyMsg=' + linterid.toString() + '&Type=HMouldProdOutBill', 'yes']
+                        , resize: false
+                    })
+                }
+                else {
+                    layer.msg('褰撳墠鍗曟嵁ID涓虹┖锛�');
+                }
+            });
 
             //閫�鍑�
             form.on('submit(Exit)', function (data) {
@@ -784,12 +862,13 @@
                 return [year, month, day].join('-');
             }
 
-            form.on('submit(Saver)', function (data) {//淇濆瓨
+            //淇濆瓨
+            form.on('submit(Saver)', function (data) {
                 //debugger;
                 data.field.HMaker = sessionStorage["HUserName"];//鍒跺崟浜�
                 var sMainStr = JSON.stringify(data.field);
                 var sSubStr = JSON.stringify(table.cache['mainTable']);
-                var sMainSub = sMainStr + ';' + sSubStr;
+                var sMainSub = sMainStr + ';' + sSubStr + ';' + sessionStorage["HUserName"];
 
 
                 $.ajax(
@@ -928,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