From 222e62df3dfecb71d669b2509e4e8822638791a6 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期四, 26 六月 2025 08:22:15 +0800
Subject: [PATCH] 华远:直观图调整

---
 WebTM/views/生产管理/生产汇报单/Sc_Add_ICMOReportBillList.html |  450 ++++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 353 insertions(+), 97 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 310f872..59893bd 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"
@@ -14,6 +14,7 @@
     <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
     <script src="../../../layuiadmin/PubCustom.js"></script>
     <script src="../../../layuiadmin/PageTitle.js"></script>
+    <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
     <style type="text/css">
         /*begin 姝ゆ牱寮忕敤浜庢秷闄よ鍏冪礌涓竷灞�瀹藉害涓嶅鐨勯棶棰�*/
         .layui-form-item .layui-inline {
@@ -37,7 +38,7 @@
                             <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="set_CheckBill" id="set_CheckBill">瀹℃牳</button>
                             <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="set_AbandonCheck" id="set_AbandonCheck">鍙嶅鏍�</button>
                             <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="set_DeleteBill" id="set_DeleteBill">鍒犻櫎</button>
-                            <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="get_PrintReport" id="get_PrintReport">棰勮</button>
+                            <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="get_PrintReport" id="get_PrintReport">鎵撳嵃</button>
                             <button type="button" id="add-btn" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Saver">淇濆瓨</button>
                             <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Exit">閫�鍑�</button>
                         </div>
@@ -84,7 +85,7 @@
                                             <label class="layui-form-label">鐝粍</label>
                                             <div class="layui-input-inline">
                                                 <input type="text" name="HGroupName" id="HGroupName" class="layui-input" value="" style="float:left;width:150px;">
-                                                <input type="hidden" name="HGroupID" id="HGroupID" class="layui-input" value="" style="float:left;width:150px;">
+                                                <input type="hidden" name="HGroupID" id="HGroupID" class="layui-input" value="0" style="float:left;width:150px;">
                                                 <button type="button" lay-submit="" class="layui-btn" lay-filter="HGroupList" style="width:40px;">
                                                     <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                 </button>
@@ -94,7 +95,7 @@
                                             <label class="layui-form-label">缁熻鍛�</label>
                                             <div class="layui-input-inline">
                                                 <input type="text" name="HEmpName" id="HEmpName" class="layui-input" value="" style="float:left;width:150px;">
-                                                <input type="hidden" name="HEmpID" id="HEmpID" class="layui-input" value="" style="float:left;width:150px;">
+                                                <input type="hidden" name="HEmpID" id="HEmpID" class="layui-input" value="0" style="float:left;width:150px;">
                                                 <button type="button" lay-submit="" class="layui-btn" lay-filter="HEmpList" style="width:40px;">
                                                     <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                 </button>
@@ -124,8 +125,8 @@
                                         </div>
                                         <div class="layui-col-xs8 layui-inline">
                                             <label class="layui-form-label" style="width: 6.5%;">澶囨敞</label>
-                                            <div class="layui-input-block">
-                                                <input class="layui-input" name="HRemark" id="HRemark" autocomplete="off" style=" width: 75%;">
+                                            <div class="layui-input-inline">
+                                                <input class="layui-input" name="HRemark" id="HRemark" autocomplete="off" style=" width: 75%;">                                               
                                             </div>
                                         </div>
                                     </div>
@@ -263,6 +264,7 @@
         <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">鍒犻櫎</a>
     </script>
     <script>
+        var OptionData = [];
         //#region 鎶樺彔娉ㄩ噴
         //#endregion
         layui.config({
@@ -289,6 +291,7 @@
             //};
             var Sctag = "0";
             var columns = "";
+            var HIsCheck = false;
             //#endregion
 
 
@@ -345,6 +348,26 @@
                 set_EditFromGrid();
                 //get_file();
             }
+            else if (OperationType == 4) {//涓嬫帹
+                setInit_PushBill();
+            }
+            else if (OperationType == 5) {//澶嶅埗
+                set_EditFromGrid();
+                //鑾峰彇鏈�澶у崟鎹彿
+                get_MAXNum();
+                //鍒濆鍖栧埗鍗曚汉鍜屽埗鍗曟椂闂�
+                $("#HMaker").val(sessionStorage["HUserName"]);
+                $("#HMakeDate").val(Format(new Date(), "yyyy-MM-dd"));
+                $("#HUpDater").val();
+                $("#HUpDateDate").val();
+                $("#HChecker").val();
+                $("#HCheckDate").val();
+                $("#HCloseMan").val();
+                $("#HCloseDate").val();
+                $("#HDeleteMan").val();
+                $("#HDeleteDate").val();
+                //get_file();
+            }
             else {
                 layer.alert("鏈煡鎿嶄綔绫诲瀷锛�", { icon: 5 });
             }
@@ -365,9 +388,9 @@
                     "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
+                    "HSourceBillType": 0
                 };
-              
+
                 switch (obj.event) {
                     //鏂板涓�琛�
                     case 'btn-AddLine': btnAddLine(NewRow);
@@ -403,7 +426,7 @@
                     shift: 2,
                     area: ['80%', '80%'],
                     maxmin: true,
-                    content: ['../../PublicPage/GroupInformation.html', 'yes'],
+                    content: ['../../鍩虹璧勬枡/宸ヨ祫鍩虹璧勬枡/Gy_Group.html?type=HGroup&openType=2', 'yes'],
                     btn: ['纭畾', '鍙栨秷']
                     , btn1: function (index, layero) {
 
@@ -413,7 +436,7 @@
                         if (checkStatus.data.length === 0) {
                             return layer.msg('璇烽�夋嫨鏁版嵁');
                         }
-                        $("#HGroupName").val(checkStatus.data[0].HName);
+                        $("#HGroupName").val(checkStatus.data[0].鐝粍鍚嶇О);
                         $("#HGroupID").val(checkStatus.data[0].HItemID);
                         layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
                     }
@@ -449,13 +472,6 @@
                     content: ['../../PublicPage/ProductionOrder.html', 'yes'],
                     btn: ['纭畾', '鍙栨秷']
                     , btn1: function (index, layero) {
-                        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,"HICMOTempID":0
-                        }];
-                        table.render(option);
                         //鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
                         var iframeWindow = window['layui-layer-iframe' + index]  //鑾峰彇寮规椤甸潰
                         var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//鑾峰彇table鐨別lem:"#test"
@@ -477,30 +493,22 @@
                         if (isAllEqual(list))  //鐩稿悓鍗曞彿
                         {
                             //console.log(checkStatus.data);
-                            if (checkStatus.data.length > 1) {
-                                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({
-                                        "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, "HICMOTempID": 0
-                                    });
-                                    option.data = table.cache["mainTable"];
-                                    table.render(option);
-                                }
+                            var optionData = [];
+                            for (var i = 0; i < checkStatus.data.length; i++) //琛ヨ
+                            {
+                                var NewRow = {
+                                    "HMaterID": checkStatus.data[0].HMaterID, "HMaterCode": checkStatus.data[0].HMaterCode, "HMaterName": checkStatus.data[0].HMaterName, "HMaterSpec": checkStatus.data[0].HMaterSpec, "HUnitID": checkStatus.data[0].HUnitID, "HUnitCode": checkStatus.data[0].HUnitCode, "HUnitName": checkStatus.data[0].HUnitName,
+                                    "HSourceID": 0, "HSourceCode": "", "HSourceName": "", "HWorkerid": 0, "HWorkerCode": "", "HWorkerName": "", "HQty": 0, "HBadQty": 0,
+                                    "HICMOBillNo": checkStatus.data[0].鍗曟嵁鍙�, "HICMOInterID": checkStatus.data[0].hmainid, "HICMOEntryID": checkStatus.data[0].HEntryID, "HRemark": "", "HSourceInterID": checkStatus.data[0].hmainid, "HSourceEntryID": checkStatus.data[0].HEntryID, "HSourceBillNo": checkStatus.data[0].鍗曟嵁鍙�,
+                                    "HSourceBillType": 3710
+                                };
+                                optionData.push(NewRow);
                             }
-                            option.data = checkStatus.data;
-                            table.render(option);
-                            //for (var i = 0; i < checkStatus.data.length; i++) {
-                            //    $('.layui-table-view[lay-id="mainTable"]').children('.layui-table-box').children('.layui-table-body').find('table tbody tr[data-index="' + i + '"]').find('td[data-field="HMaterID"] .layui-table-cell').text(checkStatus.data[i].HMaterID);
-                            //    $('.layui-table-view[lay-id="mainTable"]').children('.layui-table-box').children('.layui-table-body').find('table tbody tr[data-index="' + i + '"]').find('td[data-field="HMaterCode"] .layui-table-cell').text(checkStatus.data[i].HMaterCode);
-                            //    $('.layui-table-view[lay-id="mainTable"]').children('.layui-table-box').children('.layui-table-body').find('table tbody tr[data-index="' + i + '"]').find('td[data-field="HMaterName"] .layui-table-cell').text(checkStatus.data[i].HMaterName);
-                            //    $('.layui-table-view[lay-id="mainTable"]').children('.layui-table-box').children('.layui-table-body').find('table tbody tr[data-index="' + i + '"]').find('td[data-field="HMaterSpec"] .layui-table-cell').text(checkStatus.data[i].HMaterSpec);
-                            //    $('.layui-table-view[lay-id="mainTable"]').children('.layui-table-box').children('.layui-table-body').find('table tbody tr[data-index="' + i + '"]').find('td[data-field="HUnitID"] .layui-table-cell').text(checkStatus.data[i].HUnitID);
-                            //    $('.layui-table-view[lay-id="mainTable"]').children('.layui-table-box').children('.layui-table-body').find('table tbody tr[data-index="' + i + '"]').find('td[data-field="HUnitCode"] .layui-table-cell').text(checkStatus.data[i].HUnitCode);
-                            //    $('.layui-table-view[lay-id="mainTable"]').children('.layui-table-box').children('.layui-table-body').find('table tbody tr[data-index="' + i + '"]').find('td[data-field="HUnitName"] .layui-table-cell').text(checkStatus.data[i].HUnitName);
-                            //}
+                            
+                            table.reload("mainTable", {
+                                data: optionData    //灏嗘暟鎹噸鏂拌浇鍏ヨ〃鏍�
+                            })
+                            
                             layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
                         }
                         else {
@@ -532,7 +540,7 @@
             //#region 鎻愪氦淇濆瓨
             form.on('submit(Saver)', function (data) {//淇濆瓨
                 var refSav = "";
-                if (OperationType == 1 || OperationType == 2) {
+                if (OperationType == 1 || OperationType == 2 || OperationType == 4 || OperationType == 5) {
                     refSav = "Add";
                 }
                 if (OperationType == 3) {
@@ -543,6 +551,13 @@
                 var row = [];
                 for (var i = 0; i < table.cache['mainTable'].length; i++) {
                     if (table.cache['mainTable'][i] != "") {
+                        if (table.cache["mainTable"][i].HMaterName.indexOf("\"") != -1 || table.cache["mainTable"][i].HMaterName.indexOf(";") != -1) {
+                            table.cache["mainTable"][i].HMaterName = table.cache["mainTable"][i].HMaterName.replaceAll("\"", "鈥�").replaceAll(";", "锛�")
+                        }
+                        if (table.cache["mainTable"][i].HMaterSpec.indexOf("\"") != -1 || table.cache["mainTable"][i].HMaterSpec.indexOf(";") != -1) {
+                            table.cache["mainTable"][i].HMaterSpec = table.cache["mainTable"][i].HMaterSpec.replaceAll("\"", "鈥�").replaceAll(";", "锛�")
+                        }
+                        
                         row.push(table.cache['mainTable'][i])
                     }
                 }
@@ -606,6 +621,26 @@
             //#region 鍒犻櫎
             form.on('submit(set_DeleteBill)', function (data) {
 
+            });
+            //#endregion
+
+            //#region 鎵撳嵃
+            form.on('submit(get_PrintReport)', function (data) {
+                if (HIsCheck == true) {
+                    layer.open({
+                        type: 2
+                        , area: ['50%', '50%']
+                        , title: '鎵撳嵃妯$増閫夋嫨'
+                        , shade: 0.6 //閬僵閫忔槑搴�
+                        , maxmin: false //鍏佽鍏ㄥ睆鏈�灏忓寲
+                        , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
+                        , content: ['../../BaseSet/SRM_OpenTmpList.html?linterid=' + $("#HInterID").val().toString() + '&MyMsg=' + $("#HInterID").val().toString() + '&Type=HICMOReport2', 'yes']
+                        , resize: false
+                    })
+                }
+                else {
+                    layer.msg('璇峰鏍稿崟鎹垚鍔熷悗鎵撳嵃锛�');
+                }
             });
             //#endregion
 
@@ -684,6 +719,7 @@
                     data: { "HInterID": InterID, "IsAudit": 0, "CurUserName": sessionStorage["HUserName"] },
                     success: function (result) {
                         if (result.count == 1) {
+                            HIsCheck = true;
                             layer.msg(result.Message, { time: 1 * 10000, icon: 1 }, function () {
                                 // 寰楀埌frame绱㈠紩
                                 var index = layer.getFrameIndex(window.name);
@@ -718,7 +754,7 @@
                                 shift: 2,
                                 area: ['90%', '90%'],
                                 maxmin: true,
-                                content: ['../../PublicPage/PartInformation.html', 'yes'],
+                                content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_Material.html?openType=2', 'yes'],
                                 btn: ['纭畾', '鍙栨秷']
                                 , btn1: function (index, layero) {
                                     //鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
@@ -727,20 +763,68 @@
                                     if (checkStatus.data.length === 0) {
                                         return layer.msg('璇烽�夋嫨鏁版嵁');
                                     }
-                                    //鍚屾鏇存柊琛ㄦ牸鍜岀紦瀛樺搴旂殑鍊�
-                                    obj.update({
-                                        HMaterID: checkStatus.data[0].HItemID,
-                                        HMaterCode: checkStatus.data[0].HNumber,
-                                        HMaterName: checkStatus.data[0].HName,
-                                        HMaterSpec: checkStatus.data[0].HModel,
-                                    });
+                                    
+                                    //閫変腑澶氳鏃�
+                                    if (checkStatus.data.length > 1) {
+                                        var rowIndex = $(obj.tr).attr("data-index") * 1;  //attr("data-index")鐢ㄤ簬鑾峰彇璇r鍏冪礌涓奷ata-index灞炴�х殑鍊�*1杞崲绫诲瀷鐒跺悗璧嬪�肩粰rowIndex
+                                        for (var i = 0; i < checkStatus.data.length; i++) {  //鍒ゆ柇閫変腑鐨勬暟鎹殑闀垮害  鐢ㄤ簬閬嶅巻checkStatus.data鏁扮粍涓殑姣忎釜鍏冪礌
+                                            if (rowIndex + i >= option.data.length) {           //鍒ゆ柇rowIndex + i鐨勭储寮曡秴鍑轰簡option.data鏁扮粍鐨勯暱搴︼紝璇存槑option.data鏁扮粍闇�瑕佹墿灞曚互鍖呭惈鏇村琛�
+                                                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
+                                                };
+
+                                                table.cache["mainTable"].push(NewRow);    //鍒涘缓鏂扮殑鍖呭惈鏁扮粍  浼犲叆table.cache["mainTable"]鏁扮粍
+                                                option.data = table.cache["mainTable"];  //鎶婁紶鍏� table.cache["mainTable"]鏁扮粍鐨勫�艰祴鍊肩粰option.data 鐨勫睘鎬�
+
+                                                table.render(option);//娓叉煋鐣岄潰
+                                            }
+                                            option.data[rowIndex + i].HMaterID = checkStatus.data[i].HItemID;  //灏唎ption.data鏁扮粍涓搴旇鐨凥MaterID灞炴�ф洿鏂颁负浠巖esultData瀵硅薄涓幏鍙栫殑鐗╂枡ID
+                                            option.data[rowIndex + i].HMaterCode = checkStatus.data[i].鐗╂枡浠g爜; //灏唎ption.data鏁扮粍涓搴旇鐨� 鐗╂枡浠g爜 灞炴�ф洿鏂颁负浠巖esultData瀵硅薄涓幏鍙栫殑鐗╂枡ID
+                                            option.data[rowIndex + i].HMaterName = checkStatus.data[i].鐗╂枡鍚嶇О; //灏唎ption.data鏁扮粍涓搴旇鐨�  鐗╂枡鍚嶇О  灞炴�ф洿鏂颁负浠巖esultData瀵硅薄涓幏鍙栫殑鐗╂枡ID
+                                            option.data[rowIndex + i].HMaterSpec = checkStatus.data[i].瑙勬牸鍨嬪彿; //灏唎ption.data鏁扮粍涓搴旇鐨�  瑙勬牸鍨嬪彿  灞炴�ф洿鏂颁负浠巖esultData瀵硅薄涓幏鍙栫殑鐗╂枡ID
+                                            option.data[rowIndex + i].HUnitID = checkStatus.data[i].HUnitID; //灏唎ption.data鏁扮粍涓搴旇鐨� HUnitID 灞炴�ф洿鏂颁负浠巖esultData瀵硅薄涓幏鍙栫殑鐗╂枡ID
+                                            option.data[rowIndex + i].HUnitCode = checkStatus.data[i].璁¢噺鍗曚綅浠g爜;
+                                            option.data[rowIndex + i].HUnitName = checkStatus.data[i].璁¢噺鍗曚綅鍚嶇О; //灏唎ption.data鏁扮粍涓搴旇鐨� 璁¢噺鍗曚綅 灞炴�ф洿鏂颁负浠巖esultData瀵硅薄涓幏鍙栫殑鐗╂枡ID   鏇存柊璁¢噺鍗曚綅灞炴��
+                                        }
+                                        table.render(option); //閲嶆柊娓叉煋琛ㄦ牸浠ユ樉绀烘洿鏂板悗鐨勬暟鎹�
+                                    } else {
+                                        //鍚屾鏇存柊琛ㄦ牸鍜岀紦瀛樺搴旂殑鍊�
+                                        obj.update({
+                                            HMaterID: checkStatus.data[0].HItemID,
+                                            HMaterCode: checkStatus.data[0].鐗╂枡浠g爜,
+                                            HMaterName: checkStatus.data[0].鐗╂枡鍚嶇О,
+                                            HMaterSpec: checkStatus.data[0].瑙勬牸鍨嬪彿,
+                                            HUnitID: checkStatus.data[0].HUnitID,
+                                            HUnitCode: checkStatus.data[0].璁¢噺鍗曚綅浠g爜,
+                                            HUnitName: checkStatus.data[0].璁¢噺鍗曚綅鍚嶇О,
+                                        });
+                                    }
+
+
+
+
                                     layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
                                 }
                                 , btn2: function (index, layero) {
                                     //鎸夐挳銆愭寜閽簩銆戠殑鍥炶皟
                                     //return false 寮�鍚浠g爜鍙姝㈢偣鍑昏鎸夐挳鍏抽棴
-                                },
-                                end: function () {
+                                }, end: function () {
+                                    if (OptionData != "" && OptionData != []) {
+                                        //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
+                                        obj.update({
+                                            HMaterID: OptionData.HItemID,
+                                            HMaterCode: OptionData.鐗╂枡浠g爜,
+                                            HMaterName: OptionData.鐗╂枡鍚嶇О,
+                                            HMaterSpec: OptionData.瑙勬牸鍨嬪彿,
+                                            HUnitID: OptionData.HUnitID,
+                                            HUnitCode: OptionData.璁¢噺鍗曚綅浠g爜,
+                                            HUnitName: OptionData.璁¢噺鍗曚綅鍚嶇О,
+                                        });
+                                        OptionData = [];
+                                    }
                                 }
                             });
                         }
@@ -756,7 +840,7 @@
                                 shift: 2,
                                 area: ['90%', '90%'],
                                 maxmin: true,
-                                content: ['../../PublicPage/UnitInformation.html', 'yes'],
+                                content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_Unit.html?Type=HUnitList', 'yes'],
                                 btn: ['纭畾', '鍙栨秷']
                                 , btn1: function (index, layero) {
 
@@ -770,8 +854,8 @@
                                     //鍚屾鏇存柊琛ㄦ牸鍜岀紦瀛樺搴旂殑鍊�
                                     obj.update({
                                         HUnitID: checkStatus.data[0].HItemID,
-                                        HUnitCode: checkStatus.data[0].HNumber,
-                                        HUnitName: checkStatus.data[0].HName
+                                        HUnitCode: checkStatus.data[0].璁¢噺鍗曚綅浠g爜,
+                                        HUnitName: checkStatus.data[0].璁¢噺鍗曚綅鍚嶇О
                                     });
 
                                     layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
@@ -779,9 +863,16 @@
                                 , btn2: function (index, layero) {
                                     //鎸夐挳銆愭寜閽簩銆戠殑鍥炶皟
                                     //return false 寮�鍚浠g爜鍙姝㈢偣鍑昏鎸夐挳鍏抽棴
-                                },
-                                end: function () {
-
+                                }, end: function () {
+                                    if (OptionData != "" && OptionData != []) {
+                                        //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
+                                        obj.update({
+                                            HUnitID: OptionData.HItemID,
+                                            HUnitCode: OptionData.璁¢噺鍗曚綅浠g爜,
+                                            HUnitName: OptionData.璁¢噺鍗曚綅鍚嶇О
+                                        });
+                                        OptionData = [];
+                                    }
                                 }
                             });
                         }
@@ -797,7 +888,7 @@
                                 shift: 2,
                                 area: ['90%', '90%'],
                                 maxmin: true,
-                                content: ['../../PublicPage/SourceInformation.html', 'yes'],
+                                content: ['../../鍩虹璧勬枡/鐢熶骇鍩虹璧勬枡/Gy_Source.html?Htype=&openType=2', 'yes'],
                                 btn: ['纭畾', '鍙栨秷']
                                 , btn1: function (index, layero) {
 
@@ -811,8 +902,8 @@
                                     //鍚屾鏇存柊琛ㄦ牸鍜岀紦瀛樺搴旂殑鍊�
                                     obj.update({
                                         HSourceID: checkStatus.data[0].HItemID,
-                                        HSourceCode: checkStatus.data[0].HNumber,
-                                        HSourceName: checkStatus.data[0].HName
+                                        HSourceCode: checkStatus.data[0].鐢熶骇璧勬簮浠g爜,
+                                        HSourceName: checkStatus.data[0].鐢熶骇璧勬簮鍚嶇О
                                     });
 
                                     layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
@@ -820,9 +911,16 @@
                                 , btn2: function (index, layero) {
                                     //鎸夐挳銆愭寜閽簩銆戠殑鍥炶皟
                                     //return false 寮�鍚浠g爜鍙姝㈢偣鍑昏鎸夐挳鍏抽棴
-                                },
-                                end: function () {
-
+                                }, end: function () {
+                                    if (OptionData.length > 0) {
+                                        //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
+                                        obj.update({
+                                            HSourceID: OptionData[0][0].HItemID,
+                                            HSourceCode: OptionData[0][0].鐢熶骇璧勬簮浠g爜,
+                                            HSourceName: OptionData[0][0].鐢熶骇璧勬簮鍚嶇О
+                                        });
+                                        OptionData = [];
+                                    }
                                 }
                             });
                         }
@@ -838,7 +936,7 @@
                                 shift: 2,
                                 area: ['90%', '90%'],
                                 maxmin: true,
-                                content: ['../../PublicPage/UserInformation.html', 'yes'],
+                                content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_EmployeeList.html?type=HManager', 'yes'],
                                 btn: ['纭畾', '鍙栨秷']
                                 , btn1: function (index, layero) {
 
@@ -852,8 +950,8 @@
                                     //鍚屾鏇存柊琛ㄦ牸鍜岀紦瀛樺搴旂殑鍊�
                                     obj.update({
                                         HWorkerid: checkStatus.data[0].HItemID,
-                                        HWorkerCode: checkStatus.data[0].HNumber,
-                                        HWorkerName: checkStatus.data[0].HName
+                                        HWorkerCode: checkStatus.data[0].鑱屽憳浠g爜,
+                                        HWorkerName: checkStatus.data[0].鑱屽憳鍚嶇О
                                     });
 
                                     layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
@@ -861,9 +959,16 @@
                                 , btn2: function (index, layero) {
                                     //鎸夐挳銆愭寜閽簩銆戠殑鍥炶皟
                                     //return false 寮�鍚浠g爜鍙姝㈢偣鍑昏鎸夐挳鍏抽棴
-                                },
-                                end: function () {
-
+                                }, end: function () {
+                                    if (OptionData.length > 0) {
+                                        //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
+                                        obj.update({
+                                            HWorkerid: OptionData[0].HItemID,
+                                            HWorkerCode: OptionData[0].鑱屽憳浠g爜,
+                                            HWorkerName: OptionData[0].鑱屽憳鍚嶇О
+                                        });
+                                        OptionData = [];
+                                    }
                                 }
                             });
                         }
@@ -882,24 +987,24 @@
                     , { 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: 'HMaterName', title: '鐗╂枡鍚嶇О', style: 'background-color:#efefef4d;', width: 100 }
+                    , { field: 'HMaterSpec', title: '瑙勬牸鍨嬪彿', style: 'background-color:#efefef4d;', 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: 'HUnitName', title: '鍗曚綅鍚嶇О', style: 'background-color:#efefef4d;', 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: 'HSourceName', title: '璧勬簮鍚嶇О', style: 'background-color:#efefef4d;', 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: 'HWorkerName', title: '鎿嶄綔鍛樺悕绉�', style: 'background-color:#efefef4d;', width: 100 }
                     , { field: 'HQty', title: '鐢熶骇鏁伴噺', edit: 'text', width: 100, totalRow: true }
                     , { field: 'HBadQty', title: '涓嶈壇鏁伴噺', edit: 'text', width: 100, totalRow: true }
-                    , { 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: 'HICMOBillNo', title: '鐢熶骇璁㈠崟', style: 'background-color:#efefef4d;', width: 100 }
+                    , { field: 'HICMOInterID', title: '鐢熶骇璁㈠崟鍐呯爜', style: 'background-color:#efefef4d;', width: 100, hide: true }
+                    , { field: 'HICMOEntryID', title: '鐢熶骇璁㈠崟瀛愬唴鐮�', style: 'background-color:#efefef4d;', width: 100, hide: true }
 
-                    , { field: 'HSourceInterID', 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 }
@@ -935,8 +1040,8 @@
                     , { 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, totalRow: true}
-                    , { field: 'HBadQty', title: '涓嶈壇鏁伴噺', edit: 'text', width: 100, totalRow: true}
+                    , { field: 'HQty', title: '鐢熶骇鏁伴噺', edit: 'text', width: 100, totalRow: true }
+                    , { field: 'HBadQty', title: '涓嶈壇鏁伴噺', edit: 'text', width: 100, totalRow: true }
                     , { field: 'HICMOBillNo', title: '鐢熶骇璁㈠崟', edit: 'text', width: 100 }
                     , { field: 'HRemark', title: '琛ㄤ綋澶囨敞', edit: 'text', width: 100 }
                     , { fixed: 'right', title: '鎿嶄綔', toolbar: '#barDemo', width: 150 }
@@ -998,7 +1103,7 @@
                     "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,"HICMOTempID":0
+                    "HSourceBillType": 0, "HICMOTempID": 0
                 }];
                 table.render(option);
             }
@@ -1075,12 +1180,12 @@
             function set_EditFromGrid() {
                 set_EditForm(linterid);  //缂栬緫鑾峰彇琛ㄥご
                 set_EditGrid(linterid);  //缂栬緫鑾峰彇琛ㄤ綋
-                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, "HICMOTempID": 0
-                }];
+                //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, "HICMOTempID": 0
+                //}];
                 table.render(option);
             }
             //#endregion
@@ -1091,6 +1196,7 @@
                 $.ajax({
                     url: GetWEBURL() + "Sc_ICMOReportBill/Sc_GetICMOReportBillListCheckDetai",
                     type: "GET",
+                    async: false,
                     data: {
                         "HID": linterid
                     },
@@ -1109,8 +1215,8 @@
                             $("#HEmpID").val(data.HEmpID);
                             $("#HEmpName").val(data.缁熻鍛�);
                             $("#HMainSourceBillNo").val(data.HMainSourceBillNo);
-                            $("#HMainSourceInterID").val(data.HMainSourceInterID);
-                            $("#HMainSourceEntryID").val(data.HMainSourceEntryID);
+                            $("#HMainSourceInterID").val(data.HMainSourceInterID == null ? 0 : data.HMainSourceInterID);
+                            $("#HMainSourceEntryID").val(data.HMainSourceEntryID == null ? 0 : data.HMainSourceEntryID);
                             $("#HExplanation").val("");
                             $("#HRemark").val(data.琛ㄥご澶囨敞);
                             PicUpload();
@@ -1132,6 +1238,7 @@
                 $.ajax({
                     url: GetWEBURL() + 'Sc_ICMOReportBill/Sc_ICMOReportBillListProjectDetai',
                     type: "GET",
+                    async: false,
                     data: { "sqlWhere": "and hmainid=" + linterid },
                     success: function (result) {
                         if (result.count == 1) {
@@ -1205,15 +1312,15 @@
             //#region 闈炵┖楠岃瘉
             function AllowLoadData(sSubStr) {  //闈炵┖楠岃瘉
                 var Result = true;
-                if ($("#HDeptID").val() == '' || $("#HDeptID").val() == null) {
+                if ($("#HDeptID").val() == '' || $("#HDeptID").val() == null || $("#HDeptID").val() == "undefined" || $("#HDeptID").val() == 0) {
                     layer.msg("杞﹂棿涓嶈兘涓虹┖!", { icon: 5, btn: ['纭'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
                     return Result = false;
                 }
-                if ($("#HGroupID").val() == '' || $("#HGroupID").val() == null) {
+                if ($("#HGroupID").val() == '' || $("#HGroupID").val() == null || $("#HGroupID").val() == "undefined" | $("#HGroupID").val() == 0) {
                     layer.msg("鐝粍涓嶈兘涓虹┖锛�", { icon: 5, btn: ['纭'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
                     return Result = false;
                 }
-                if ($("#HEmpID").val() == '' || $("#HEmpID").val() == null) {
+                if ($("#HEmpID").val() == '' || $("#HEmpID").val() == null || $("#HGroupID").val() == "undefined" || $("#HEmpID").val() == 0) {
                     layer.msg("缁熻鍛樹笉鑳戒负绌猴紒", { icon: 5, btn: ['纭'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
                     return Result = false;
                 }
@@ -1272,7 +1379,7 @@
                     , area: ['90%', '90%']//澶у皬
                     , title: '鑱屽憳鍒楄〃'//鏍囬
                     , shift: 2//寮瑰嚭鍔ㄧ敾
-                    , content: ['../../PublicPage/UserInformation.html', 'yes']
+                    , content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_EmployeeList.html?type=HEmp', 'yes']
                     , btn: ['纭畾', '鍙栨秷']
                     , btn1: function (index, layero) {//鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
                         var iframeWindow = window['layui-layer-iframe' + index]  //鑾峰彇寮规椤甸潰
@@ -1280,7 +1387,7 @@
                         if (checkStatus.data.length === 0) {
                             return layer.msg('璇烽�夋嫨鏁版嵁');
                         }
-                        $("#HEmpName").val(checkStatus.data[0].HName);
+                        $("#HEmpName").val(checkStatus.data[0].鑱屽憳鍚嶇О);
                         $("#HEmpID").val(checkStatus.data[0].HItemID);
                         layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
                     }
@@ -1297,7 +1404,7 @@
                     , area: ['90%', '90%']//澶у皬
                     , title: '閮ㄩ棬鍒楄〃'//鏍囬
                     , shift: 2//寮瑰嚭鍔ㄧ敾
-                    , content: ['../../PublicPage/DeptInformation.html', 'yes']
+                    , content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_DepartmentList.html?openType=2&HOrgName=' + sessionStorage["Organization"], 'yes']
                     , btn: ['纭畾', '鍙栨秷']
                     , btn1: function (index, layero) {//鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
                         var iframeWindow = window['layui-layer-iframe' + index]  //鑾峰彇寮规椤甸潰
@@ -1305,9 +1412,9 @@
                         if (checkStatus.data.length === 0) {
                             return layer.msg('璇烽�夋嫨鏁版嵁');
                         }
-                        $("#HDeptName").val(checkStatus.data[0].HName);
+                        $("#HDeptName").val(checkStatus.data[0].閮ㄩ棬鍚嶇О);
                         $("#HDeptID").val(checkStatus.data[0].HItemID);
-                        $("#HDeptNumber").val(checkStatus.data[0].HNumber);
+                        $("#HDeptNumber").val(checkStatus.data[0].閮ㄩ棬浠g爜);
                         layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
                     }
                     , btn2: function (index, layero) { }
@@ -1417,7 +1524,125 @@
                 }
             }
 
+            //#region 涓嬫帹椤甸潰鍒濆鍖�
+            function setInit_PushBill() {
+                //鐢熸垚鍗曟嵁鍙峰拰鍐呯爜
+                get_MAXNum();
 
+                //鍒濆鍖栨棩鏈熴�佸埗鍗曚汉銆佸埗鍗曟棩鏈�
+                $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
+                $("#HMaker").val(sessionStorage["HUserName"]);
+                $("#HMakeDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss"));
+                $("#HGroupID").val(sessionStorage["HGroupID"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭鐝粍ID
+                $("#HGroupName").val(sessionStorage["HGroup"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭鐝粍
+                $("#HEmpID").val(sessionStorage["HEmpID"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭鎿嶄綔鍛業D
+                $("#HEmpName").val(sessionStorage["HEmpName"]); //鏍规嵁鐧诲綍鐢ㄦ埛甯﹀嚭鎿嶄綔鍛�
+
+                var temp = HSouceBillType;
+
+                if (temp == "3710") {
+                    //鑾峰彇
+                    var data = getUrlVars_JSON().data;
+                    var dataArray = [];
+                    for (var i = 0; i < data.length; i++) {
+                        var temp = getPushSource_ICMOBillInit(data[i].hmainid, data[i].hsubid);
+                        if (temp != "none") {
+                            dataArray.push(temp);
+                        } else {
+                            return;
+                        }
+                    }
+
+                    form.val("component-form-group", { //formTest 鍗� class="layui-form" 鎵�鍦ㄥ厓绱犲睘鎬� lay-filter="" 瀵瑰簲鐨勫��
+                        "HMainSourceInterID": "0"
+                        , "HMainSourceEntryID": "0"
+                        , "HMainSourceBillNo": ""
+                        , "HMainSourceBillType": temp
+                        , "HDeptID": dataArray[0].HDeptID
+                        , "HDeptName": dataArray[0].鐢熶骇杞﹂棿
+                        , "HMainSourceBillType": 2
+                    });
+                    $('#XDHList').addClass("layui-btn-disabled").attr("disabled", true);
+                    $('#HMainSourceBillNo').addClass("layui-btn-disabled").attr("disabled", true);
+                    document.getElementById('HMainSourceBillNo').style.backgroundColor = '#efefef4d'
+
+                    //瀛愯〃  璧嬪��
+                    var rowdata = [];
+                    for (var i = 0; i < dataArray.length; i++) {
+                        rowdata.push(
+                            {
+                                "HMaterID": dataArray[i].HMaterID
+                                , "HMaterCode": dataArray[i].浜у搧浠g爜
+                                , "HMaterName": dataArray[i].浜у搧鍚嶇О
+                                , "HMaterSpec": dataArray[i].瑙勬牸鍨嬪彿
+                                , "HUnitID": dataArray[i].HUnitID
+                                , "HUnitCode": dataArray[i].璁¢噺鍗曚綅浠g爜
+                                , "HUnitName": dataArray[i].璁¢噺鍗曚綅
+                                , "HSourceID": sessionStorage["HSourceID"] == "" ? 0 : sessionStorage["HSourceID"]
+                                , "HSourceCode": ""
+                                , "HSourceName": sessionStorage["HSource"]
+                                , "HWorkerid": sessionStorage["HEmpID"] == "" ? 0 : sessionStorage["HEmpID"]
+                                , "HWorkerCode": sessionStorage["HEmpNumber"]
+                                , "HWorkerName": sessionStorage["HEmpName"]
+                                , "HQty": dataArray[i].鏈叧鑱旀暟閲�
+                                , "HBadQty": 0                                             
+                                , "HICMOBillNo": dataArray[i].鍗曟嵁鍙�
+                                , "HICMOInterID": dataArray[i].hmainid
+                                , "HICMOEntryID": dataArray[i].HEntryID
+                                , "HSourceInterID": dataArray[i].hmainid
+                                , "HSourceEntryID": dataArray[i].HEntryID
+                                , "HSourceBillNo": dataArray[i].鍗曟嵁鍙�
+                                , "HSourceBillType": dataArray[i].鍗曟嵁绫诲瀷
+                                , 'HICMOTempID': "0"
+                                , 'HRemark': ""
+                            }
+                        );
+                    }
+                    option.data = rowdata;
+                    table.render(option);
+                }
+                else {
+                    return layer.msg('褰撳墠涓嶆敮鎸佽婧愬崟涓嬫帹锛侊紒');
+                }
+            }
+            //#endregion
+
+            //#region 鏍规嵁涓诲唴鐮佷笌瀛愬唴鐮佽幏鍙栨簮鍗曠敓浜ц鍗曟暟鎹�
+            function getPushSource_ICMOBillInit(HSourceInterID, HSourceEntryID) {
+                var res = "none";
+                $.ajax({
+                    url: GetWEBURL() + "/Sc_ICMOBill/loadSc_ICMOBill_Push",
+                    async: false,
+                    type: "GET",
+                    data: {
+                        "HInterID": HSourceInterID
+                        , "HSubID": HSourceEntryID
+                    },
+                    success: function (result) {
+                        if (result.code == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                            res = result.data[0];
+                        } else {
+                            res = result.data;
+                            //layer.alert(result.msg, { icon: 5, btn: ['閫�鍑�'], time: 100000, offset: 't' });
+                        }
+                    }, error: function () {
+                        res = "none";
+                        layer.alert("鍙戠敓閿欒!", { icon: 5 });
+                    }
+                });
+                return res;
+            }
+            //#endregion
+
+            //#region 鑾峰彇鍙傛暟_浼犻�掔殑JSON鏍煎紡鍙傛暟
+            function getUrlVars_JSON() {
+                var datajson;
+                var str = window.location.search; //鑾峰彇閾炬帴涓紶閫掔殑鍙傛暟
+                var arr = str.substring(str.lastIndexOf("=") + 1);
+                datajson = $.parseJSON(decodeURI(arr));
+                return datajson;
+            }
+            //#endregion
 
             //#endregion
 
@@ -1467,7 +1692,38 @@
             /*window.location.href = url;*/
             window.open(url)
         }
-
+        //鐢熶骇杞﹂棿
+        function GetHDeptNameValue(obj) {
+            $("#HDeptName").val(obj[0].閮ㄩ棬鍚嶇О);
+            $("#HDeptID").val(obj[0].HItemID);
+            $("#HDeptNumber").val(obj[0].閮ㄩ棬浠g爜);
+        }
+        //鐢熶骇鐝粍
+        function GetHGroupValue(obj) {
+            $("#HGroupName").val(obj[0].鐝粍鍚嶇О);
+            $("#HGroupID").val(obj[0].HItemID);
+        }
+        //缁熻鍛�
+        function GetHEmpValue(obj) {
+            $("#HEmpName").val(obj[0].鑱屽憳鍚嶇О);
+            $("#HEmpID").val(obj[0].HItemID);
+        }
+        //鐗╂枡
+        function GetGyMaterial(obj) {
+            OptionData = obj;
+        }
+        //鍗曚綅
+        function GetHUnitListValue(obj) {
+            OptionData = obj;
+        }
+        //鐢熶骇璧勬簮
+        function GetGySource(obj) {
+            OptionData[0] = obj;
+        }
+        //鎿嶄綔鍛�
+        function GetHManagerValue(obj) {
+            OptionData = obj;
+        }
     </script>
 </body>
 </html>
\ No newline at end of file

--
Gitblit v1.9.1