From 7de00c5824ecfd39fec748386298ba0cedd4504e Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期二, 16 一月 2024 16:06:10 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-LayUI

---
 WebTM/views/生产管理/生产汇报单/Sc_Add_ICMOReportBillList.html |  270 ++++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 234 insertions(+), 36 deletions(-)

diff --git "a/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\346\261\207\346\212\245\345\215\225/Sc_Add_ICMOReportBillList.html" "b/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\346\261\207\346\212\245\345\215\225/Sc_Add_ICMOReportBillList.html"
index a04504e..f5422e8 100644
--- "a/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\346\261\207\346\212\245\345\215\225/Sc_Add_ICMOReportBillList.html"
+++ "b/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\346\261\207\346\212\245\345\215\225/Sc_Add_ICMOReportBillList.html"
@@ -114,8 +114,8 @@
                                             <label class="layui-form-label">閫夊崟鍙�</label>
                                             <div class="layui-input-inline">
                                                 <input type="text" name="HMainSourceBillNo" id="HMainSourceBillNo" class="layui-input" value="" style="float:left;width:150px;">
-                                                <input type="hidden" name="HMainSourceInterID" id="HMainSourceInterID" class="layui-input" value="" style="float:left;width:150px;">
-                                                <input type="hidden" name="HMainSourceEntryID" id="HMainSourceEntryID" class="layui-input" value="" style="float:left;width:150px;">
+                                                <input type="hidden" name="HMainSourceInterID" id="HMainSourceInterID" class="layui-input" value="0" style="float:left;width:150px;">
+                                                <input type="hidden" name="HMainSourceEntryID" id="HMainSourceEntryID" class="layui-input" value="0" style="float:left;width:150px;">
                                                 <button type="button" lay-submit="" class="layui-btn" lay-filter="XDHList" id="XDHList" style="width:40px;">
                                                     <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                 </button>
@@ -227,7 +227,22 @@
                             </div>
                         </div>
                     </div>
-                    <table class="layui-hide" 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="mainTable" lay-filter="mainTable"></table>
+                            </div>
+                            <div class="layui-tab-item">
+                                <!--浜ч噺姹囨姤鍗�-->
+                                <table class="layui-hide" id="mainTable_prodReport" lay-filter="mainTable_prodReport"></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" id="btn-AddLine"><i class="layui-icon layui-icon-form"></i>澧炲姞涓�琛�</button>
@@ -254,8 +269,8 @@
         }).extend({
             index: 'lib/index' //涓诲叆鍙fā鍧�
         }).use(['index', 'form', 'laydate', 'table', 'element', 'upload'], function () {
-            
-        //#region 鍏敤鍙橀噺
+
+            //#region 鍏敤鍙橀噺
             var $ = layui.$
                 , admin = layui.admin
                 , layer = layui.layer
@@ -265,17 +280,18 @@
                 , laydate = layui.laydate
                 , element = layui.element;
             var option;
+            var option_prodReport;
             var sBillType = "3711";
-            var TabRow = {
-                "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HUnitID": 0, "HUnitCode": "", "HUnitName": "",
-                "HSourceID": 0, "HSourceCode": "", "HSourceName": "", "HWorkerid": 0, "HWorkerCode": "", "HWorkerName": "", "HQty": 0, "HRemark": ""
-            };
+            //var TabRow = {
+            //    "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HUnitID": 0, "HUnitCode": "", "HUnitName": "",
+            //    "HSourceID": 0, "HSourceCode": "", "HSourceName": "", "HWorkerid": 0, "HWorkerCode": "", "HWorkerName": "", "HQty": 0,"HBadQty":0, "HRemark": ""
+            //};
             var Sctag = "0";
             var columns = "";
-        //#endregion
+            //#endregion
 
 
-        //#region 杩涘叆椤甸潰鍗冲姞杞�
+            //#region 杩涘叆椤甸潰鍗冲姞杞�
 
             //鍒ゆ柇鏄惁鐧诲綍 鏈櫥褰曞垯璺冲埌鐧诲綍椤�
             get_LoginIs();
@@ -300,9 +316,21 @@
             }
             //鍒ゆ柇鎿嶄綔绫诲瀷
             if (OperationType == 1) {//鏃犳簮鍗曟柊澧�
+                $("#HDeptID").val(sessionStorage["HDeptID"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭閮ㄩ棬ID
+                $("#HDeptName").val(sessionStorage["HDept"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭閮ㄩ棬
+                $("#HGroupID").val(sessionStorage["HGroupID"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭鐝粍ID
+                $("#HGroupName").val(sessionStorage["HGroup"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭鐝粍
+                $("#HEmpID").val(sessionStorage["HEmpID"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭鎿嶄綔鍛業D
+                $("#HEmpName").val(sessionStorage["HEmpName"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭鎿嶄綔鍛�
                 set_AddFNew();
             }
             else if (OperationType == 2) {//鏈夋簮鍗曟柊澧�
+                $("#HDeptID").val(sessionStorage["HDeptID"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭閮ㄩ棬ID
+                $("#HDeptName").val(sessionStorage["HDept"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭閮ㄩ棬
+                $("#HGroupID").val(sessionStorage["HGroupID"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭鐝粍ID
+                $("#HGroupName").val(sessionStorage["HGroup"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭鐝粍
+                $("#HEmpID").val(sessionStorage["HEmpID"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭鎿嶄綔鍛業D
+                $("#HEmpName").val(sessionStorage["HEmpName"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭鎿嶄綔鍛�
                 set_AddNew();
             }
             else if (OperationType == 3) {//缂栬緫
@@ -314,10 +342,10 @@
             }
 
 
-        //#endregion
+            //#endregion
 
 
-        //#region 瑙﹀彂浜嬩欢锛氬寘鎷琭orm.on(){}鏍煎紡鐨勬墍鏈夌偣鍑讳簨浠躲�侀�夋嫨浜嬩欢绛�
+            //#region 瑙﹀彂浜嬩欢锛氬寘鎷琭orm.on(){}鏍煎紡鐨勬墍鏈夌偣鍑讳簨浠躲�侀�夋嫨浜嬩欢绛�
 
             //#region 澶村伐鍏锋爮浜嬩欢
             table.on('toolbar(mainTable)', function (obj) {
@@ -325,7 +353,13 @@
                 var checkStatus = table.checkStatus('mainTable')
                     , data = checkStatus.data;;
                 var AddRow = table.cache['mainTable'];
-                var NewRow = TabRow;
+                var NewRow = {
+                    "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HUnitID": 0, "HUnitCode": "", "HUnitName": "",
+                    "HSourceID": 0, "HSourceCode": "", "HSourceName": "", "HWorkerid": 0, "HWorkerCode": "", "HWorkerName": "", "HQty": 0, "HBadQty": 0,
+                    "HICMOBillNo": "", "HICMOInterID": "0", "HICMOEntryID": "0", "HRemark": "", "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": "",
+                    "HSourceBillType":0
+                };
+              
                 switch (obj.event) {
                     //鏂板涓�琛�
                     case 'btn-AddLine': btnAddLine(NewRow);
@@ -407,7 +441,12 @@
                     content: ['../../PublicPage/ProductionOrder.html', 'yes'],
                     btn: ['纭畾', '鍙栨秷']
                     , btn1: function (index, layero) {
-                        option.data = [TabRow];
+                        option.data = [{
+                            "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HUnitID": 0, "HUnitCode": "", "HUnitName": "",
+                            "HSourceID": 0, "HSourceCode": "", "HSourceName": "", "HWorkerid": 0, "HWorkerCode": "", "HWorkerName": "", "HQty": 0, "HBadQty": 0,
+                            "HICMOBillNo": "", "HICMOInterID": "0", "HICMOEntryID": "0", "HRemark": "", "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": "",
+                            "HSourceBillType": 0
+                        }];
                         table.render(option);
                         //鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
                         var iframeWindow = window['layui-layer-iframe' + index]  //鑾峰彇寮规椤甸潰
@@ -434,7 +473,11 @@
                                 for (var i = 0; i < checkStatus.data.length - 1; i++) //琛ヨ
                                 {
                                     //var NewRow = { "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HUnitID": 0, "HUnitCode": "", "HUnitName": "", "HSourceID": 0, "HSourceCode": "", "HSourceName": "", "HWorkerid": 0, "HWorkerCode": "", "HWorkerName": "", "HQty": 0, "HRemark": "" };
-                                    table.cache["mainTable"].push(TabRow);
+                                    table.cache["mainTable"].push({
+                                        "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HUnitID": 0, "HUnitCode": "", "HUnitName": "",
+                                        "HSourceID": 0, "HSourceCode": "", "HSourceName": "", "HWorkerid": 0, "HWorkerCode": "", "HWorkerName": "", "HQty": 0, "HBadQty": 0, "HICMOBillNo": "", "HICMOInterID": "0", "HICMOEntryID": "0", "HRemark": "", "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": "",
+                                        "HSourceBillType": 0
+                                    });
                                     option.data = table.cache["mainTable"];
                                     table.render(option);
                                 }
@@ -481,16 +524,23 @@
             //#region 鎻愪氦淇濆瓨
             form.on('submit(Saver)', function (data) {//淇濆瓨
                 var refSav = "";
-                if (linterid == "" || linterid == null) {
+                if (OperationType == 1 || OperationType == 2) {
                     refSav = "Add";
                 }
-                if (linterid != "" && linterid != null) {
+                if (OperationType == 3) {
                     refSav = "Update";
                 }
                 data.field.HMaker = sessionStorage["HUserName"];//鍒跺崟浜�
+                //绛涢�夊垹闄や箣鍚庝笉涓虹┖鐨勬暟鎹粍
+                var row = [];
+                for (var i = 0; i < table.cache['mainTable'].length; i++) {
+                    if (table.cache['mainTable'][i] != "") {
+                        row.push(table.cache['mainTable'][i])
+                    }
+                }
                 var sMainStr = JSON.stringify(data.field);
-                var sSubStr = JSON.stringify(table.cache['mainTable']);
-                var sMainSub = sMainStr + ';' + sSubStr + ';' + refSav;
+                var sSubStr = JSON.stringify(row);
+                var sMainSub = sMainStr + ';' + sSubStr + ';' + refSav + ";" + sessionStorage["HUserName"];
                 if (!AllowLoadData(sSubStr))//鏁版嵁楠岃瘉
                 {
                     return false;
@@ -504,9 +554,10 @@
                     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); //鍐嶆墽琛屽叧闂� 聽 聽 聽 聽 聽聽 聽聽聽 聽
+                                $('#add-btn').addClass("layui-btn-disabled").attr("disabled", true);//淇濆瓨鎸夐挳绂佺敤
+                                $('#set_CheckBill').removeClass("layui-btn-disabled").attr("disabled", false);//瀹℃牳鎸夐挳鍚敤
+                                //var index = parent.layer.getFrameIndex(window.name); //鍏堝緱鍒板綋鍓峣frame灞傜殑绱㈠紩
+                                //parent.layer.close(index); //鍐嶆墽琛屽叧闂� 聽 聽 聽 聽 聽聽 聽聽聽 聽
                             });
                         }
                         else {
@@ -534,7 +585,7 @@
 
             //#region 瀹℃牳
             form.on('submit(set_CheckBill)', function (data) {
-
+                set_CheckBill()
             });
             //#endregion
 
@@ -550,10 +601,10 @@
             });
             //#endregion
 
-        //#endregion
+            //#endregion
 
 
-        //#region 鏈〉闈㈡墍鏈夎璋冪敤鐨勬柟娉�
+            //#region 鏈〉闈㈡墍鏈夎璋冪敤鐨勬柟娉�
 
             //#region 鍒濆鍖栬〃鍗�
             function set_InitFrom() {
@@ -565,9 +616,15 @@
 
             //#region 琛ㄦ牸澧炲姞琛屼簨浠�
             function btnAddLine(NewRow) {
-                table.cache["mainTable"].push(NewRow);
-                option.data = table.cache["mainTable"];
-                table.render(option);
+                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    //灏嗘暟鎹噸鏂拌浇鍏ヨ〃鏍�
+                })
             }
             //#endregion
 
@@ -606,6 +663,35 @@
                         }
                     });
                 }
+            }
+            //#endregion
+
+            //#region 瀹℃牳
+            function set_CheckBill() {
+                var InterID = $("#HInterID").val();
+                //閫昏緫瀹℃牳鏂规硶
+                $.ajax({
+                    type: "GET",
+                    url: GetWEBURL() + "/Sc_ICMOReportBill/AuditProcessReportList", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+                    data: { "HInterID": InterID, "IsAudit": 0, "CurUserName": sessionStorage["HUserName"] },
+                    success: function (result) {
+                        if (result.count == 1) {
+                            layer.msg(result.Message, { time: 1 * 10000, icon: 1 }, function () {
+                                // 寰楀埌frame绱㈠紩
+                                var index = layer.getFrameIndex(window.name);
+                                //鍏抽棴褰撳墠frame
+                                layer.close(index);
+                                //淇敼涓哄姛鍚庡埛鏂扮晫闈�
+                                $("#btnSearch").trigger('click');
+                            });
+
+                        } else {
+                            layer.alert(result.code + result.Message, { icon: 5 });
+                        }
+                    }, error: function () {
+                        layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                    }
+                });
             }
             //#endregion
 
@@ -800,6 +886,16 @@
                     , { field: 'HWorkerCode', title: '鎿嶄綔鍛樹唬鐮�', edit: 'text', event: 'HWorkerCode', width: 100 }
                     , { field: 'HWorkerName', title: '鎿嶄綔鍛樺悕绉�', edit: 'text', width: 100 }
                     , { field: 'HQty', title: '鐢熶骇鏁伴噺', edit: 'text', width: 100 }
+                    , { field: 'HBadQty', title: '涓嶈壇鏁伴噺', edit: 'text', width: 100 }
+                    , { field: 'HICMOBillNo', title: '鐢熶骇璁㈠崟', edit: 'text', width: 100 }
+                    , { field: 'HICMOInterID', title: '鐢熶骇璁㈠崟鍐呯爜', edit: 'text', width: 100, hide: true }
+                    , { field: 'HICMOEntryID', title: '鐢熶骇璁㈠崟瀛愬唴鐮�', edit: 'text', width: 100, hide: true }
+
+                    , { field: 'HSourceInterID', title: '婧愬崟鍐呯爜', edit: 'text', width: 100, hide: true  }
+                    , { field: 'HSourceEntryID', title: '婧愬崟瀛愬唴鐮�', edit: 'text', width: 100, hide: true }
+                    , { field: 'HSourceBillNo', title: '婧愬崟鍗曞彿', edit: 'text', width: 100, hide: true }
+                    , { field: 'HSourceBillType', title: '婧愬崟绫诲瀷', edit: 'text', width: 100, hide: true }
+
                     , { field: 'HRemark', title: '琛ㄤ綋澶囨敞', edit: 'text', width: 100 }
                     , { fixed: 'right', title: '鎿嶄綔', toolbar: '#barDemo', width: 150 }
                 ];
@@ -811,6 +907,39 @@
                     , cellMinWidth: 120
                     , height: 500
                     , cols: [columns]
+                    , done: function (res, curr, count) {
+
+                    }
+                };
+
+                columns_prodReport = [
+                    { 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: 'HMaterSpec', title: '瑙勬牸鍨嬪彿', edit: 'text', width: 100 }
+                    , { field: 'HSourceID', title: 'HSourceID', edit: 'text', width: 100, hide: true }
+                    , { field: 'HSourceCode', title: '璧勬簮浠g爜', edit: 'text', event: 'HSourceCode', width: 100 }
+                    , { field: 'HSourceName', title: '璧勬簮鍚嶇О', edit: 'text', width: 100 }
+                    , { field: 'HWorkerid', title: 'HWorkerid', edit: 'text', width: 100, hide: true }
+                    , { field: 'HWorkerCode', title: '鎿嶄綔鍛樹唬鐮�', edit: 'text', event: 'HWorkerCode', width: 100 }
+                    , { field: 'HWorkerName', title: '鎿嶄綔鍛樺悕绉�', edit: 'text', width: 100 }
+                    , { field: 'HQty', title: '鐢熶骇鏁伴噺', edit: 'text', width: 100 }
+                    , { field: 'HBadQty', title: '涓嶈壇鏁伴噺', edit: 'text', width: 100 }
+                    , { field: 'HICMOBillNo', title: '鐢熶骇璁㈠崟', edit: 'text', width: 100 }
+                    , { field: 'HRemark', title: '琛ㄤ綋澶囨敞', edit: 'text', width: 100 }
+                    , { fixed: 'right', title: '鎿嶄綔', toolbar: '#barDemo', width: 150 }
+                ];
+                option_prodReport = {
+                    id: 'mainTable_prodReport'
+                    , elem: '#mainTable_prodReport'
+                    , page: true
+                    , limit: 1000
+                    , limits: [500, 1000, 1500, 2000, 3000]
+                    , cellMinWidth: 120
+                    , height: 500
+                    , cols: [columns_prodReport]
                     , done: function (res, curr, count) {
 
                     }
@@ -834,7 +963,7 @@
                     success: function (d) {
                         //console.log(d.data);
                         $("#HBillNo").val(d.data[0].HBillNo);
-                        $("#HInterID").val(0);
+                        $("#HInterID").val(d.data[0].HInterID);
                         $("#HDate").val(Pub_Format(new Date(), "yyyy-MM-dd"));
                         $("#HMakeDate").val(Pub_Format(new Date(), "yyyy-MM-dd"));
                         $("#HMaker").val(sessionStorage["HUserName"]);
@@ -854,7 +983,12 @@
                 $('#set_AbandonCheck').addClass("layui-btn-disabled").attr("disabled", true);
                 $('#set_DeleteBill').addClass("layui-btn-disabled").attr("disabled", true);
                 $('#get_PrintReport').addClass("layui-btn-disabled").attr("disabled", true);
-                option.data = [TabRow];
+                option.data = [{
+                    "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HUnitID": 0, "HUnitCode": "", "HUnitName": "",
+                    "HSourceID": 0, "HSourceCode": "", "HSourceName": "", "HWorkerid": 0, "HWorkerCode": "", "HWorkerName": "", "HQty": 0, "HBadQty": 0,
+                    "HICMOBillNo": "", "HICMOInterID": "0", "HICMOEntryID": "0", "HRemark": "", "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": "",
+                    "HSourceBillType": 0
+                }];
                 table.render(option);
             }
             //#endregion
@@ -863,8 +997,66 @@
             function set_AddNew() {
                 //鑾峰彇鏈�澶у崟鎹彿
                 get_MAXNum();
-                option.data = [TabRow];
-                table.render(option);
+                if (linterid.length > 0 && HSouceBillType == 3724) {
+                    var arr = [];
+                    var arr_detail = [];
+                    $.ajax({
+                        url: GetWEBURL() + "Sc_ICMOReportBill/GetProdReportBillList",
+                        type: "GET",
+                        data: {
+                            "HInterID": linterid,
+                            "user": sessionStorage["HUserName"]
+                        },
+                        async: false,
+                        success: function (result) {
+                            if (result.code == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                                var data = result.data.h_p_Sc_ICMOBillWorkQtyStatus_TmpList1; //姹囨�讳俊鎭�
+                                var data_detail = result.data.h_p_Sc_ICMOBillWorkQtyStatus_TmpList; //鏄庣粏淇℃伅
+
+                                for (let i = 0; i < data.length; i++) {
+                                    arr.push({
+                                        "HMaterID": data[i].鐗╂枡ID, "HMaterCode": data[i].鐗╂枡浠g爜, "HMaterName": data[i].鐗╂枡鍚嶇О, "HMaterSpec": data[i].瑙勬牸鍨嬪彿,
+                                        "HUnitID": data[i].鍗曚綅ID, "HUnitCode": data[i].璁¢噺鍗曚綅浠g爜, "HUnitName": data[i].璁¢噺鍗曚綅, "HSourceID": data[i].鐢熶骇璧勬簮ID, "HSourceCode": data[i].鐢熶骇璧勬簮浠g爜,
+                                        "HSourceName": data[i].鐢熶骇璧勬簮鍚嶇О, "HWorkerid": data[i].鎿嶄綔鍛業D, "HWorkerCode": data[i].鎿嶄綔鍛樹唬鐮�,
+                                        "HWorkerName": data[i].鎿嶄綔鍛樺悕绉�, "HQty": data[i].浜ч噺, "HBadQty": data[i].涓嶈壇鏁伴噺 == '' ? 0 : data[i].涓嶈壇鏁伴噺, "HICMOBillNo": data[i].鐢熶骇璁㈠崟鍙�,
+                                        "HICMOInterID": data[i].HICMOInterID, "HICMOEntryID": data[i].HICMOEntryID, "HRemark": "", "HSourceInterID": data[i].HICMOInterID, "HSourceEntryID": data[i].HICMOEntryID, "HSourceBillNo": data[i].鐢熶骇璁㈠崟鍙�,
+                                        "HSourceBillType": 3710
+                                    });
+                                }
+
+                                for (let j = 0; j < data_detail.length; j++) {
+                                    arr_detail.push({
+                                        "HMaterID": data_detail[j].鐗╂枡ID, "HMaterCode": data_detail[j].鐗╂枡浠g爜, "HMaterName": data_detail[j].鐗╂枡鍚嶇О,
+                                        "HMaterSpec": data_detail[j].瑙勬牸鍨嬪彿, "HUnitID": 0, "HUnitCode": "", "HUnitName": "", "HSourceID": data_detail[j].鐢熶骇璧勬簮ID,
+                                        "HSourceCode": data_detail[j].鐢熶骇璧勬簮浠g爜, "HSourceName": data_detail[j].鐢熶骇璧勬簮鍚嶇О, "HWorkerid": data_detail[j].鎿嶄綔鍛業D,
+                                        "HWorkerCode": data_detail[j].鎿嶄綔鍛樹唬鐮�, "HWorkerName": data_detail[j].鎿嶄綔鍛樺悕绉�, "HQty": data_detail[j].浜ч噺,
+                                        "HBadQty": data_detail[j].涓嶈壇鏁伴噺, "HICMOBillNo": data_detail[j].鐢熶骇璁㈠崟鍙�, "HRemark": ""
+                                    })
+                                }
+                            } else {
+                                layer.alert(result.msg, { icon: 5, btn: ['閫�鍑�'], time: 100000, offset: 't' });
+                            }
+                        }, error: function () {
+                            layer.alert("鍙戠敓閿欒!", { icon: 5 });
+                        }
+                    });
+
+                    option.data = arr;
+                    console.log(option.data);
+                    table.render(option);
+
+                    option_prodReport.data = arr_detail;
+                    table.render(option_prodReport);
+                } else {
+                    option.data = [{
+                        "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HUnitID": 0, "HUnitCode": "", "HUnitName": "",
+                        "HSourceID": 0, "HSourceCode": "", "HSourceName": "", "HWorkerid": 0, "HWorkerCode": "", "HWorkerName": "", "HQty": 0, "HBadQty": 0,
+                        "HICMOBillNo": "", "HICMOInterID": "0", "HICMOEntryID": "0", "HRemark": "", "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": "",
+                        "HSourceBillType": 0
+                    }];
+                    table.render(option);
+                }
+
             }
             //#endregion
 
@@ -872,7 +1064,12 @@
             function set_EditFromGrid() {
                 set_EditForm(linterid);  //缂栬緫鑾峰彇琛ㄥご
                 set_EditGrid(linterid);  //缂栬緫鑾峰彇琛ㄤ綋
-                option.data = [TabRow];
+                option.data = [{
+                    "HMaterID": 0, "HMaterCode": "", "HMaterName": "", "HMaterSpec": "", "HUnitID": 0, "HUnitCode": "", "HUnitName": "",
+                    "HSourceID": 0, "HSourceCode": "", "HSourceName": "", "HWorkerid": 0, "HWorkerCode": "", "HWorkerName": "", "HQty": 0, "HBadQty": 0,
+                    "HICMOBillNo": "", "HICMOInterID": "0", "HICMOEntryID": "0", "HRemark": "", "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": "",
+                    "HSourceBillType": 0
+                }];
                 table.render(option);
             }
             //#endregion
@@ -895,6 +1092,7 @@
                             $("#HInnerBillNo").val(data.鍐呴儴鍗曟嵁鍙�);
                             $("#HDeptID").val(data.HDeptID);
                             $("#HDeptName").val(data.閮ㄩ棬);
+                            $("#HDeptNumber").val(data.閮ㄩ棬浠g爜);
                             $("#HGroupID").val(data.HGroupID);
                             $("#HGroupName").val(data.鐝粍);
                             $("#HEmpID").val(data.HEmpID);
@@ -1063,7 +1261,7 @@
                     , area: ['90%', '90%']//澶у皬
                     , title: '鑱屽憳鍒楄〃'//鏍囬
                     , shift: 2//寮瑰嚭鍔ㄧ敾
-                    ,content: ['../../PublicPage/UserInformation.html', 'yes']
+                    , content: ['../../PublicPage/UserInformation.html', 'yes']
                     , btn: ['纭畾', '鍙栨秷']
                     , btn1: function (index, layero) {//鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
                         var iframeWindow = window['layui-layer-iframe' + index]  //鑾峰彇寮规椤甸潰
@@ -1210,7 +1408,7 @@
 
 
 
-        //#endregion
+            //#endregion
 
 
 

--
Gitblit v1.9.1