From 3f90ca8ee15fc859e260965ee6df555907dfa3bc Mon Sep 17 00:00:00 2001
From: dytyqx <1342948614@qq.com>
Date: 星期一, 09 三月 2026 11:15:18 +0800
Subject: [PATCH] 1

---
 WebTM/WebTM.csproj.user                                      |    2 
 WebTM/views/领料发货/领料出库/Kf_MateOutBillLEdit.html               |  125 ++++++++
 WebTM/views/领料发货/领料出库/Kf_MateOutBillList.html                |    1 
 WebTM/views/车间管理/工序流转卡/Sc_ProcessExchangeBillList.html       |  186 +++++++++++++
 WebTM/layuiadmin/Scripts/webConfig.js                        |    3 
 WebTM/views/领料发货/其他出库/Add_Edit_Kf_OtherOutBill.html          |  205 ++++++++++++-
 WebTM/views/领料发货/领料出库/Kf_MateOutBackBillEdit.html            |  146 ++++++++++
 WebTM/views/生产管理/生产任务单/Sc_ICMOBillList.html                  |    3 
 WebTM/views/领料发货/生产领料/Kf_ProductReceiveMaterialBillEdit.html |  122 ++++++++
 9 files changed, 758 insertions(+), 35 deletions(-)

diff --git a/WebTM/WebTM.csproj.user b/WebTM/WebTM.csproj.user
index 2c596da..25c279f 100644
--- a/WebTM/WebTM.csproj.user
+++ b/WebTM/WebTM.csproj.user
@@ -8,7 +8,7 @@
     <NameOfLastUsedPublishProfile>D:\鏅轰簯LMes\MESWMS-LayUI\WebTM\Properties\PublishProfiles\SWETM.pubxml</NameOfLastUsedPublishProfile>
     <NameOfLastUsedPublishProfile>D:\GitHub\MES-WEB-LayUI\WebTM\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
     <ProjectView>ProjectFiles</ProjectView>
-    <LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
+    <LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
     <UseIISExpress>true</UseIISExpress>
     <Use64BitIISExpress />
     <IISExpressSSLPort />
diff --git a/WebTM/layuiadmin/Scripts/webConfig.js b/WebTM/layuiadmin/Scripts/webConfig.js
index 445168a..cf74c06 100644
--- a/WebTM/layuiadmin/Scripts/webConfig.js
+++ b/WebTM/layuiadmin/Scripts/webConfig.js
@@ -6,12 +6,13 @@
     //var WEBURL = "http://localhost:8082/LuBaoAPI/";    //鏉ㄤ箰鏈湴閰嶇疆
    /*  var WEBURL = "http://localhost:8082/API/";    //鏉滆春鏈湴閰嶇疆*/
      //var WEBURL = "http://localhost:8082/API/";    //寮犵憺骞挎湰鍦伴厤缃�
+       var WEBURL = "http://localhost:8082/API/";    //鏉ㄦ潈閼湰鍦伴厤缃�
     //var WEBURL = "http://localhost:81/API/"    //缈佹稕娑涙湰鍦伴厤缃�
     //var WEBURL = "http://localhost:8082/LuBaoAPI/";    //鏉ㄤ箰鏈湴閰嶇疆
     //var WEBURL = "http://47.96.97.237/API/";          //鏅轰簯鏈嶅姟鍣�
    /* var WEBURL = "http://localhost:8082/LuBaoAPI/";  //浣欐�濇澃鏈湴閰嶇疆*/
     //var WEBURL = "http://localhost:81/API/";            // 闄堥晲鍝叉湰鍦伴厤缃�*/
-     var WEBURL = "http://localhost:8082/LuBaoAPI/";  //鏉庢灄淇婃湰鍦伴厤缃�
+/*     var WEBURL = "http://localhost:8082/LuBaoAPI/";  //鏉庢灄淇婃湰鍦伴厤缃�*/
     //var WEBURL = "http://localhost:8088/ARAPI/";      //浣欐�濇澃鏈湴閰嶇疆(瀹夌憺)
     //var WEBURL = "http://61.164.86.218:8099/ABAPI/";  //濂ラ偊
     //var WEBURL = "http://10.1.4.155/API/";            //姹熶赴瀹㈡埛NEW
diff --git "a/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\344\273\273\345\212\241\345\215\225/Sc_ICMOBillList.html" "b/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\344\273\273\345\212\241\345\215\225/Sc_ICMOBillList.html"
index d8f97ef..ecb4a51 100644
--- "a/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\344\273\273\345\212\241\345\215\225/Sc_ICMOBillList.html"
+++ "b/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\344\273\273\345\212\241\345\215\225/Sc_ICMOBillList.html"
@@ -1685,6 +1685,7 @@
             function set_PushICMOChangeBill() {
                 var checkStatus = table.checkStatus('mainTable')
                     , data = checkStatus.data;
+                console.log(checkStatus)
                 if (checkStatus.data.length === 1) {
                     var hID = data[0].hmainid.toString();
                     var HEntryID = data[0].hsubid.toString();
@@ -3130,7 +3131,7 @@
                 var HSourceBillData = "none";
                 var sWhere = " and hmainid = " + ParamsInterID;
                 $.ajax({
-                    url: GetWEBURL() + '/LEMS/MES_IF_ICMOBillList_Json',
+                    url: GetWEBURL() + 'LEMS/MES_IF_ICMOBillList_Json',
                     async: false,
                     type: "GET",
                     data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
diff --git "a/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\267\245\345\272\217\346\265\201\350\275\254\345\215\241/Sc_ProcessExchangeBillList.html" "b/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\267\245\345\272\217\346\265\201\350\275\254\345\215\241/Sc_ProcessExchangeBillList.html"
index 999e852..957619f 100644
--- "a/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\267\245\345\272\217\346\265\201\350\275\254\345\215\241/Sc_ProcessExchangeBillList.html"
+++ "b/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\267\245\345\272\217\346\265\201\350\275\254\345\215\241/Sc_ProcessExchangeBillList.html"
@@ -291,11 +291,14 @@
                                 <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_PatrolCheck" id="set_PatrolCheck"><i class="layui-icon layui-icon-form"></i>宸℃</button>
                                 <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_WorkCheck" id="set_WorkCheck"><i class="layui-icon layui-icon-form"></i>鑷</button>
                                 <button type="button" class="layui-btn layui-btn-sm" style="display:none;" id="btn_print_small" lay-event="btn_print_small"><i class="layui-icon layui-icon-print"></i>宸ヨ壓灏忔爣绛炬墦鍗�</button>
+                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_pushKf_OtherOut" id="set_pushKf_OtherOut"><i class="layui-icon layui-icon-form"></i>涓嬫帹(鍏朵粬鍑哄簱鍗�)</button>
+                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_pushKf_MateOutBack" id="set_pushKf_MateOutBack"><i class="layui-icon layui-icon-form"></i>涓嬫帹(鐢熶骇閫�鏂欏崟)</button>
+                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_pushKf_MateOut" id="set_pushKf_MateOut"><i class="layui-icon layui-icon-form"></i>涓嬫帹(鐢熶骇棰嗘枡鍗�)</button>
                             </div>
                         </script>
                         <script type="text/html" id="toolbarDemo2">
                             <div class="layui-btn-container">
-                                <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="set_AddNew"><i class="layui-icon layui-icon-file-b"></i>鏂板</button>
+                                <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="set_AddNew"><i class="layui-icon layui-icon-file-b"></i>鏂板</button> 
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="set_ShowBill"><i class="layui-icon layui-icon-form"></i>缂栬緫</button>
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="set_DeleteBill"><i class="layui-icon layui-icon-delete"></i>鍒犻櫎</button>
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="btn_view"><i class="layui-icon layui-icon-tips"></i>棰勮</button>
@@ -529,8 +532,15 @@
                         break;
                     //case 'fy':  initFunction(1, HModName, sessionStorage["HTranSlate"]);
                     //    break;
-
-
+                    //涓嬫帹(鍏朵粬鍑哄簱鍗�)
+                    case 'set_pushKf_OtherOut': set_pushKf_OtherOut();
+                        break;
+                    //涓嬫帹(鐢熶骇閫�鏂欏崟)
+                    case 'set_pushKf_MateOutBack': set_pushKf_MateOutBack();
+                        break;
+                    //涓嬫帹(鐢熶骇棰嗘枡鍗�)
+                    case 'set_pushKf_MateOut': set_pushKf_MateOut();
+                        break;
                 };
             });
 
@@ -3641,6 +3651,176 @@
             }
             //#endregion
 
+            //#region 涓嬫帹(鍏朵粬鍑哄簱鍗�)
+            function set_pushKf_OtherOut() {
+                var checkStatus = table.checkStatus('mainTable')
+                    , data = checkStatus.data;
+                if (checkStatus.data.length === 1) {
+                    var hID = data[0].hmainid.toString();
+                    var HEntryID = data[0].HEntryID.toString();
+
+                    //#region 鍒ゆ柇婧愬崟鐘舵��
+                    var HSourceBillData = "";
+                    var HSourceBillData = getSourceBillStatus_ProcessExchangeBill(hID);            //鑾峰彇婧愬崟鏁版嵁
+                    if (HSourceBillData != "none") {
+                        if (HSourceBillData.length == 0) {
+                            layer.alert("淇濆瓨澶辫触!鏈煡璇㈠埌鐢熶骇璁㈠崟鍗曟嵁!", { icon: 5 });
+                            return;
+                        } else if (HSourceBillData[0]["瀹℃牳浜�"] == "") {
+                            var err = "淇濆瓨澶辫触!鍘熷洜锛氳鍗曞崟鎹姸鎬佷负鈥�" + HSourceBillData[0]["鍗曟嵁鐘舵��"] + "鈥濓紝涓嶅厑璁镐笅鎺ㄥ叾浠栧嚭搴撳崟锛�";
+                            layer.alert(err, { icon: 5 });
+                            return;
+                        }
+                    } else {
+                        return;
+                    }
+
+
+                    layer.open({
+                        type: 2
+                        , area: ['100%', '100%']
+                        , title: '涓嬫帹-鍏朵粬鍑哄簱鍗�'
+                        , closeBtn: 1
+                        , shade: 0.6 //閬僵閫忔槑搴�
+                        , maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲
+                        , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
+                        , content: '../../棰嗘枡鍙戣揣/鍏朵粬鍑哄簱/Add_Edit_Kf_OtherOutBill.html?OperationType=4&linterid=' + hID + '&HSouceBillType=3772&closeType=1&HEntryID=' + HEntryID
+                        , resize: false,
+                        end: function () {
+                            //鍒锋柊椤甸潰,
+                            $("#btnSearch").trigger('click');
+                        }
+                        , cancel: function () {
+
+                        }
+                    })
+                } else {
+                    layer.msg('璇烽�夋嫨涓�琛屾暟鎹紪杈戯紒');
+                }
+            }
+            //#endregion
+
+            //#region 涓嬫帹(鐢熶骇閫�鏂欏崟)
+            function set_pushKf_MateOutBack() {
+                var checkStatus = table.checkStatus('mainTable')
+                    , data = checkStatus.data;
+                if (checkStatus.data.length === 1) {
+                    var hID = data[0].hmainid.toString();
+                    var HEntryID = data[0].HEntryID.toString();
+
+                    //#region 鍒ゆ柇婧愬崟鐘舵��
+                    var HSourceBillData = "";
+                    var HSourceBillData = getSourceBillStatus_ProcessExchangeBill(hID);            //鑾峰彇婧愬崟鏁版嵁
+                    if (HSourceBillData != "none") {
+                        if (HSourceBillData.length == 0) {
+                            layer.alert("淇濆瓨澶辫触!鏈煡璇㈠埌鐢熶骇璁㈠崟鍗曟嵁!", { icon: 5 });
+                            return;
+                        } else if (HSourceBillData[0]["瀹℃牳浜�"] == "") {
+                            var err = "淇濆瓨澶辫触!鍘熷洜锛氳鍗曞崟鎹姸鎬佷负鈥�" + HSourceBillData[0]["鍗曟嵁鐘舵��"] + "鈥濓紝涓嶅厑璁镐笅鎺ㄥ叾浠栧嚭搴撳崟锛�";
+                            layer.alert(err, { icon: 5 });
+                            return;
+                        }
+                    } else {
+                        return;
+                    }
+
+
+                    layer.open({
+                        type: 2
+                        , area: ['100%', '100%']
+                        , title: '涓嬫帹-鐢熶骇閫�鏂欏崟'
+                        , closeBtn: 1
+                        , shade: 0.6 //閬僵閫忔槑搴�
+                        , maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲
+                        , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
+                        , content: '../../棰嗘枡鍙戣揣/棰嗘枡鍑哄簱/Kf_MateOutBackBillEdit.html?OperationType=4&linterid=' + hID + '&HSouceBillType=3772&closeType=1&HEntryID=' + HEntryID
+                        , resize: false,
+                        end: function () {
+                            //鍒锋柊椤甸潰,
+                            $("#btnSearch").trigger('click');
+                        }
+                        , cancel: function () {
+
+                        }
+                    })
+                } else {
+                    layer.msg('璇烽�夋嫨涓�琛屾暟鎹紪杈戯紒');
+                }
+            }
+            //#endregion
+
+            //#region 涓嬫帹(鐢熶骇棰嗘枡鍗�)
+            function set_pushKf_MateOut() {
+                var checkStatus = table.checkStatus('mainTable')
+                    , data = checkStatus.data;
+                if (checkStatus.data.length === 1) {
+                    var hID = data[0].hmainid.toString();
+                    var HEntryID = data[0].HEntryID.toString();
+
+                    //#region 鍒ゆ柇婧愬崟鐘舵��
+                    var HSourceBillData = "";
+                    var HSourceBillData = getSourceBillStatus_ProcessExchangeBill(hID);            //鑾峰彇婧愬崟鏁版嵁
+                    if (HSourceBillData != "none") {
+                        if (HSourceBillData.length == 0) {
+                            layer.alert("淇濆瓨澶辫触!鏈煡璇㈠埌鐢熶骇璁㈠崟鍗曟嵁!", { icon: 5 });
+                            return;
+                        } else if (HSourceBillData[0]["瀹℃牳浜�"] == "") {
+                            var err = "淇濆瓨澶辫触!鍘熷洜锛氳鍗曞崟鎹姸鎬佷负鈥�" + HSourceBillData[0]["鍗曟嵁鐘舵��"] + "鈥濓紝涓嶅厑璁镐笅鎺ㄥ叾浠栧嚭搴撳崟锛�";
+                            layer.alert(err, { icon: 5 });
+                            return;
+                        }
+                    } else {
+                        return;
+                    }
+
+
+                    layer.open({
+                        type: 2
+                        , area: ['100%', '100%']
+                        , title: '涓嬫帹-鐢熶骇棰嗘枡鍗�'
+                        , closeBtn: 1
+                        , shade: 0.6 //閬僵閫忔槑搴�
+                        , maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲
+                        , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
+                        , content: '../../棰嗘枡鍙戣揣/鐢熶骇棰嗘枡/Kf_ProductReceiveMaterialBillEdit.html?OperationType=4&linterid=' + hID + '&HSouceBillType=3772&closeType=1&HEntryID=' + HEntryID
+                        , resize: false,
+                        end: function () {
+                            //鍒锋柊椤甸潰,
+                            $("#btnSearch").trigger('click');
+                        }
+                        , cancel: function () {
+
+                        }
+                    })
+                } else {
+                    layer.msg('璇烽�夋嫨涓�琛屾暟鎹紪杈戯紒');
+                }
+            }
+            //#endregion
+
+            //#region 鑾峰彇婧愬崟-璁㈠崟鍗曟嵁鐘舵��
+            function getSourceBillStatus_ProcessExchangeBill(ParamsInterID) {
+                var HSourceBillData = "none";
+                var sWhere = " and hmainid = " +ParamsInterID;
+                $.ajax({
+                    url: GetWEBURL() + 'LEMS/MES_Sc_ProcessExchangeBillList_Json',
+                    async: false,
+                    type: "GET",
+                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
+                    success: function (data1) {
+                        if (data1.count == 1) {
+                            HSourceBillData = data1.data;
+                        } else {
+                            layer.alert(data1.code + "鍗曟嵁鐘舵�佸垽鏂け璐ワ紒", { icon: 5 });
+                        }
+                    }, error: function () {
+                        layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                    }
+                });
+                return HSourceBillData;
+            }
+            //#endregion
+
             //#region 鏍规嵁鐢ㄦ埛鑾峰彇鐢ㄦ埛鍏宠仈瀹㈡埛鐨勮繃婊ゆ潯浠�
             function getSWhereByHUser() {
                 var res = "";
diff --git "a/WebTM/views/\351\242\206\346\226\231\345\217\221\350\264\247/\345\205\266\344\273\226\345\207\272\345\272\223/Add_Edit_Kf_OtherOutBill.html" "b/WebTM/views/\351\242\206\346\226\231\345\217\221\350\264\247/\345\205\266\344\273\226\345\207\272\345\272\223/Add_Edit_Kf_OtherOutBill.html"
index 3dcb17d..7f1f999 100644
--- "a/WebTM/views/\351\242\206\346\226\231\345\217\221\350\264\247/\345\205\266\344\273\226\345\207\272\345\272\223/Add_Edit_Kf_OtherOutBill.html"
+++ "b/WebTM/views/\351\242\206\346\226\231\345\217\221\350\264\247/\345\205\266\344\273\226\345\207\272\345\272\223/Add_Edit_Kf_OtherOutBill.html"
@@ -79,6 +79,15 @@
                                             </div>
                                         </div>
                                         <div class="layui-col-xs4 layui-inline">
+                                            <label class="layui-form-label">瀛愬崟鎹被鍨�</label>
+                                            <div class="layui-input-inline">
+                                                <select name="HBillSubType" lay-filter="HBillSubType" id="HBillSubType">
+                                                    <option value="鐧藉澂棰嗘枡" selected="selected">鐧藉澂棰嗘枡</option>
+                                                    <option value="鐧藉澂棰嗘枡璋冩暣">鐧藉澂棰嗘枡璋冩暣</option>
+                                                </select>
+                                            </div>
+                                        </div>
+                                        <div class="layui-col-xs4 layui-inline">
                                             <label class="layui-form-label">涓氬姟鍛�</label>
                                             <div class="layui-input-inline">
                                                 <input type="hidden" name="HEmpID" id="HEmpID" class="layui-input" value=0 style="float:left;width:150px;">
@@ -361,6 +370,7 @@
             var params = get_UrlVars();
             var OperationType = params[params[0]]; //浠庡弬鏁颁腑鑾峰彇 鏁版嵁绫诲瀷  1娣诲姞 淇濆瓨  2澶嶅埗  3 缂栬緫
             var linterid = params[params[1]]; //浠庡弬鏁颁腑鑾峰彇 鍗曟嵁鍐呯爜
+            var HEntryID = params[params[4]]; //鑾峰彇鍗曟嵁瀛恑d
             if (typeof (params[params[0]]) == "undefined") {
                 OperationType = 1;//鎿嶄綔绫诲瀷
             } else {
@@ -407,10 +417,10 @@
             //#region 鏄庣粏琛屽垵濮嬪寲
             var rowdata = [{
                 "HMaterID": 0, "鐗╂枡浠g爜": "", "鐗╂枡鍚嶇О": "", "瑙勬牸鍨嬪彿": "", "HPropertyID": "0", "杈呭姪灞炴��": "", "HSecUnitRate": "0", "HUnitID": 0, "璁¢噺鍗曚綅": "", "HRemark": "",
-                "HQtyMust": "0", "HQty": "0","HPieceQty": "0", "HPrice": "0", "HMoney": "0", "HWHID": 0, "鏀舵枡浠撳簱": "",
+                "HQtyMust": "0", "HQty": "0","HPieceQty": "0", "HPrice": "0", "HMoney": "0", "HWHID": 0, "鍙戞枡浠撳簱": "",
                 "HSPID": 0, "HSPGroupID": 0, "浠撲綅鍚嶇О": "", "HBatchNo": "", "HPOOrderInterID": 0, "HPOOrderEntryID": 0,
                 "HPOOrderBillNo": "", "HSeOrderInterID": 0, "HSeOrderEntryID": 0, "HSeOrderBillNo": "",
-                "HSourceBillNo": 0, "HSourceBillType": 0, "HSourceInterID": 0, "HSourceEntryID": 0,
+                "婧愬崟鍙�": 0, "HSourceBillType": 0, "HSourceInterID": 0, "HSourceEntryID": 0,
             }];
             // 鍒濆鍖栫晫
             set_InitGrid();
@@ -425,7 +435,12 @@
             else if (OperationType == 3) {//缂栬緫
                 $("#HItemID").val(linterid);//淇敼鏃朵富琛↖D
                 //缂栬緫鐘舵�佹椂锛屾牴鎹唴鐮侊紝鑾峰彇淇℃伅骞跺啓鍏ョ晫闈�
+                console.log('鎵ц缂栬緫');
                 RoadBillMain(linterid);
+            }
+            else if (OperationType == 4) {      //涓嬫帹
+                console.log('鎵ц涓嬫帹');
+                setInit_PushBill(linterid);
             }
             else {
                 layer.alert("鏈煡鎿嶄綔绫诲瀷锛�", { icon: 5 });
@@ -449,10 +464,11 @@
                     }
                 });
             }
-            else {//濡傛灉淇敼鍒欒蛋涓嬮潰 new
-                $("#HInterID").val(linterid);
-                RoadBillMain(linterid);
-            }
+            //else {//濡傛灉淇敼鍒欒蛋涓嬮潰 new
+            //    $("#HInterID").val(linterid);
+            //    console.log(1)
+            //    RoadBillMain(linterid);
+            //}
             //#endregion
             //#endregion
 
@@ -487,10 +503,10 @@
                 //    return;
                 //}
 
-                //if ($("#HWHName").val() == 0) {
-                //    layer.msg("璇烽�夋嫨浠撳簱锛�", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-                //    return;
-                //}
+                if ($("#HWHName").val() == 0) {
+                    layer.msg("璇烽�夋嫨浠撳簱锛�", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                    return;
+                }
                 //if ($("#HKeeperID").val() == 0) {
                 //    layer.msg("璇烽�夋嫨淇濈鍛橈紒", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
                 //    return;
@@ -500,10 +516,10 @@
                 //    return;
                 //}
 
-                if ($("#HSupID").val() == 0) {
-                    layer.msg("璇烽�夋嫨寰�鏉ュ崟浣嶏紒", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-                    return;
-                }
+                //if ($("#HSupID").val() == 0) {
+                //    layer.msg("璇烽�夋嫨寰�鏉ュ崟浣嶏紒", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                //    return;
+                //}
 
                 for (var i = 0; i < option.data.length; i++) {
                     if (option.data[i]["HMaterID"] == "0") {
@@ -991,7 +1007,7 @@
                     "HQtyMust": "0", "HQty": "0","HPieceQty": "0", "HPrice": "0", "HMoney": "0", "HWHID": 0, "鏀舵枡浠撳簱": "",
                     "HSPID": 0, "HSPGroupID": 0, "浠撲綅鍚嶇О": "", "HBatchNo": "", "HPOOrderInterID": 0, "HPOOrderEntryID": 0,
                     "HPOOrderBillNo": "", "HSeOrderInterID": 0, "HSeOrderEntryID": 0, "HSeOrderBillNo": "",
-                    "HSourceBillNo": 0, "HSourceBillType": 0, "HSourceInterID": 0, "HSourceEntryID": 0,
+                    "婧愬崟鍙�": 0, "HSourceBillType": 0, "HSourceInterID": 0, "HSourceEntryID": 0,
                 };
                 switch (obj.event) {
                     //鏂板
@@ -1510,7 +1526,7 @@
                                     obj.update({
 
                                         "HWHID": checkStatus.data[0].HItemID,
-                                        "鏀舵枡浠撳簱": checkStatus.data[0].浠撳簱鍚嶇О
+                                        "鍙戞枡浠撳簱": checkStatus.data[0].浠撳簱鍚嶇О
                                     })
                                     layer.close(index);//鍏抽棴寮圭獥
                                 }
@@ -1557,6 +1573,7 @@
                                 }
                             })
                         }
+
 
                         //閲囪喘璁㈠崟鍙�
                         if (obj.event == "HPOOrderBillNo") {
@@ -1755,6 +1772,22 @@
             }
             //#endregion
 
+            //#region 鐢熸垚鍗曟嵁鍙�
+            function createBillNo() {
+                $.ajax({
+                    url: GetWEBURL() + "/Web/GetMAXNum",
+                    type: "GET",
+                    data: { "HBillType": '1206' },
+                    success: function (d) {
+
+                        $("#HBillNo").val(d.data[0].HBillNo);
+                        $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
+                        $("#HInterID").val(d.data[0].HInterID);
+                    }
+                });
+            }
+            //#endregion
+
             //#region 鏃ユ湡鏍煎紡鍖�
             function formatDate(date) {
                 var d = new Date(date),
@@ -1781,9 +1814,9 @@
                     , cols: [[ //瀛愯〃
                         { type: 'checkbox', totalRowText: '鍚堣琛�' }
                         , { type: 'numbers', title: '搴忓彿', width: 100 }
-                        , { type: 'HSourceBillNo', title: '婧愬崟鍙�', width: 100, hide: true }//婧愬崟鍙�
+                        , { field: 'HSourceBillNo', title: '婧愬崟鍙�', width: 100, hide: true }//婧愬崟鍙�
                         , { field: 'HSourceBillType', title: '婧愬崟绫诲瀷', width: 100, hide: true }//婧愬崟绫诲瀷
-                        , { type: 'HSourceInterID', title: '婧愬崟涓诲唴鐮�', width: 100, hide: true }//婧愬崟涓诲唴鐮�
+                        , { field: 'HSourceInterID', title: '婧愬崟涓诲唴鐮�', width: 100, hide: true }//婧愬崟涓诲唴鐮�
                         , { field: 'HSourceEntryID', title: '婧愬崟瀛愬唴鐮�', width: 100, hide: true }//婧愬崟瀛愬唴鐮�
                         , { field: 'HMaterID', title: 'HMaterID', width: 100, hide: true }
                         , { field: '鐗╂枡浠g爜', title: '鐗╂枡浠g爜', width: 150, edit: 'text', event: "HMaterID" }//f7
@@ -1804,10 +1837,10 @@
                         , { field: 'HMoney', title: '閲戦', width: 100, edit: 'text', totalRow: true }
                      
                         , { field: 'HWHID ', title: 'HWHID ', width: 100, hide: true }
-                        , { field: '鏀舵枡浠撳簱', title: '鍙戞枡浠撳簱', width: 100, edit: 'text', event: "HWHID" }//f7
+                        , { field: '鍙戞枡浠撳簱', title: '鍙戞枡浠撳簱', width: 100, edit: 'text', event: "HWHID" }//f7
                         , { field: 'HSPID', title: 'HSPID', width: 100, hide: true }
                         , { field: 'HSPGroupID', title: 'HSPGroupID', width: 100, hide: true }
-                        , { field: '浠撲綅鍚嶇О', title: '浠撲綅鍚嶇О', width: 100, edit: 'text', event: "HSPID" }//f7
+                        , { field: '浠撲綅鍚嶇О', title: '浠撲綅鍚嶇О', width: 100, edit: 'text', event: "HSPID"}//f7
                         , { field: 'HBatchNo', title: '鎵规', width: 150, edit: 'text', hide: true }
                         , { field: 'HPOOrderInterID', title: '閲囪喘璁㈠崟涓诲唴鐮�', width: 100, hide: true }//閲囪喘璁㈠崟涓诲唴鐮�
                         , { field: 'HPOOrderEntryID', title: '閲囪喘璁㈠崟瀛愬唴鐮�', width: 100, hide: true }//閲囪喘璁㈠崟瀛愬唴鐮�
@@ -1851,6 +1884,7 @@
                                 , "HSupName": data[0]["寰�鏉ュ崟浣�"]
                                 , "HWHID": data[0]["HWHID"]
                                 , "HWHName": data[0]["浠撳簱"]
+                                , "HBillSubType": data[0]["HBillSubType"]
                                 , "HSecManagerID": data[0]["HSecManagerID"]
                                 , "HSecManagerName": data[0]["楠屾敹鍛�"]
                                 , "HKeeperID": data[0]["HKeeperID"]
@@ -1862,7 +1896,6 @@
                                 , "HEmpID": data[0]["HEmpID"]
                                 , "HEmpName": data[0]["涓氬姟鍛�"]
                                 , "HExplanation": data[0]["HExplanation"]
-
                                 , "HRemark": data[0]["琛ㄥご澶囨敞"]
                                 , "HMaker": data[0]["鍒跺崟浜�"]
                                 , "HMakeDate": data[0]["鍒跺崟鏃ユ湡"] == null ? "" : Format(new Date(data[0]["鍒跺崟鏃ユ湡"]), "yyyy-MM-dd")
@@ -1881,7 +1914,6 @@
                             option.data = data1;
                             table.render(option);
                             form.render('select');
-
                             layer.close(ajaxLoad);
                         } else {
                             layer.close(ajaxLoad);
@@ -1918,7 +1950,127 @@
                 return duplicates;
             }
             //#endregion
-            
+
+            //#region 涓嬫帹椤甸潰鍒濆鍖�
+            function setInit_PushBill(linterid) {
+                //鐢熸垚骞惰缃富琛ㄧ殑鍐呯爜鍜屽崟鎹彿
+                console.log("setInit_PushBill 寮�濮嬫墽琛岋紒");
+                createBillNo();
+
+                //鐩稿叧鏂囨湰妗嗕俊鎭垵濮嬪寲
+                $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
+                $("#HMaker").val(sessionStorage["HUserName"]);
+                $("#HMakeDate").val(Format(new Date(), "yyyy-MM-dd"));
+                //鍒濆鍖栧苟鍒楄缃細瀛愯〃1
+                //set_InitGrid();
+                //DisPlay_HideColumn();
+
+
+                //鏌ヨ鐢熶骇璁㈠崟鏄惁瀛樺湪
+                var ajaxLoad = layer.load();
+                var sWhere = " and HPRDORGID=" + sessionStorage["OrganizationID"] + "  and hmainid='" + linterid + "' and HEntryID=" + HEntryID;
+                $.ajax({
+                    url: GetWEBURL() + "/LEMS/MES_Sc_ProcessExchangeBillList_Json",
+                    type: "GET",
+                    async: false,
+                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
+                    success: function (d) {
+                        var result = d;
+                        if (result.code == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                            var data = result.data[0];
+
+                            console.log('鏉冮檺鍒ゆ柇鎴愬姛')
+                            form.val("component-form-group", { //formTest 鍗� class="layui-form" 鎵�鍦ㄥ厓绱犲睘鎬� lay-filter="" 瀵瑰簲鐨勫��
+                                "HEmpID": data.HEmpID
+                                , "HEmpName": data.涓氬姟鍛�
+                                , "HDeptID": data.HDeptID
+                                , "HDeptName": data.鐢熶骇杞﹂棿
+                                , "HCusID": data.HEntryCusID
+                                , "HCusName": data.瀹㈡埛
+                                , "HBillSubType" :data.HBillSubType
+
+                                //, "HDeptID": data.HDeptID
+                                //, "HDeptName": data.鐢熶骇杞﹂棿
+                                //, "HCusID": data.HCusID
+                                //, "HCusName": data.瀹㈡埛
+
+                                //, "HMainSourceInterID": linterid
+                                //, "HMainSourceEntryID": HEntryID
+                                //, "HMainSourceBillNo": data.鍗曟嵁鍙�
+/*                                , "HMainSourceBillType": params[params[2]]*/
+
+
+                                //, "HMaterID": data.HMaterID
+                                //, "鐗╂枡浠g爜": data.浜у搧浠g爜
+                                //, "鐗╂枡鍚嶇О": data.浜у搧鍚嶇О
+                                //, "婧愬崟鍙�": data.鍗曟嵁鍙�
+                                //, "婧愬崟涓诲唴鐮�": data.hmainid
+                                //, "婧愬崟瀛愬唴鐮�": data.HEntryID
+                            });
+
+                            //缁勭粐鐨勫�糎OrgID鍙樺寲锛岄噸鏂版覆鏌�
+                            HOrgIDBar = data.HOrgID;
+
+                            //瀛愯〃  璧嬪��
+                            var rowdata = [];
+                            for (var i = 0; i < result.data.length; i++) {
+                                rowdata.push(
+                                    {
+                                        //"HMaterID": result.data[i]["HMaterID"],
+                                        //"鐗╂枡浠g爜": result.data[i]["浜у搧浠g爜"],
+                                        //"鐗╂枡鍚嶇О": result.data[i]["浜у搧鍚嶇О"],
+                                        //"瑙勬牸鍨嬪彿": result.data[i]["瑙勬牸鍨嬪彿"],
+                                        //"HUnitID": result.data[i]["HUnitID"],
+                                        //"璁¢噺鍗曚綅": result.data[i]["璁¢噺鍗曚綅"],
+                                        //"HQty_Old": result.data[i]["鐢熶骇浠诲姟鍗曟暟閲�"],
+                                        //"HQty_New": result.data[i]["鐢熶骇浠诲姟鍗曟暟閲�"],
+                                        ////"HDate_Old": formatDate(result.data[i]["鍘熶氦璐ф棩鏈�"]),
+                                        ////"HDate_New": formatDate(result.data[i]["鏂颁氦璐ф棩鏈�"]),
+                                        //"HRemark": "",
+                                        //"HSourceInterID": result.data[i]["hmainid"],
+                                        //"HSourceEntryID": result.data[i]["HEntryID"],
+                                        //"HSourceBillNo": result.data[i]["鍗曟嵁鍙�"],
+                                        //"HSourceBillType": result.data[i]["鍗曟嵁绫诲瀷"]
+                                        "HMaterID": data.HMaterID
+                                        , "鐗╂枡浠g爜": data.浜у搧浠g爜
+                                        , "鐗╂枡鍚嶇О": data.浜у搧鍚嶇О
+                                        , "HSourceBillNo": data.鍗曟嵁鍙�
+                                        , "HSourceInterID": data.hmainid
+                                        , "HSourceEntryID": data.HEntryID
+                                        , "HSourceBillType": params[params[2]]
+                                        , "HWHID": ""
+                                        , "鍙戞枡浠撳簱": ""
+                                        , "HSPID": ""
+                                        , "浠撲綅鍚嶇О": ""
+                                        , "HPropertyID": ""
+                                        , "杈呭姪灞炴��": ""
+                                        , "HSecUnitRate": ""
+                                        , "HUnitID": ""
+                                        , "璁¢噺鍗曚綅": ""
+                                        , "HQtyMust": ""
+                                        , "HQty": ""
+                                        , "HPieceQty": ""
+                                        , "HPrice": ""
+                                        , "HMoney": ""
+                                    }
+                                );
+                            }
+                            option.data = rowdata;
+
+                            table.render(option);
+                            layer.close(ajaxLoad);
+                        } else {
+                            layer.close(ajaxLoad);
+                            layer.alert(result.msg, { icon: 5, btn: ['閫�鍑�'], time: 100000, offset: 't' });
+                        }
+                    }, error: function () {
+                        layer.close(ajaxLoad);
+                        layer.alert("鍙戠敓閿欒!", { icon: 5 });
+                    }
+                })
+            }
+            //#endregion
+
             //#region 鑾峰彇婧愬崟绫诲瀷
             function HSourceBillType() {
                 var HName = '鍏朵粬鍏ュ簱鍗�';
@@ -1969,6 +2121,11 @@
             $("#HWHName").val(obj[0].浠撳簱鍚嶇О);
             $("#HWHID").val(obj[0].HItemID);
         }
+        function GetHSPValue(obj)  //杩斿洖浠撲綅
+        {
+            $("#HSPName").val(obj[0].浠撲綅鍚嶇О);
+            $("#HSPID").val(obj[0].HItemID);
+        }
 
         function GetHDeptNameValue(obj)  //杩斿洖閮ㄩ棬
         {
@@ -1984,7 +2141,7 @@
 
         //鍙屽嚮杩斿洖鐗╂枡
         function GetGyMaterial(data) {
-            OptionData = data
+            OptionData  = data
         }
         //鍙屽嚮杩斿洖璁¢噺鍗曚綅
         function GetGyUnit(data) {
diff --git "a/WebTM/views/\351\242\206\346\226\231\345\217\221\350\264\247/\347\224\237\344\272\247\351\242\206\346\226\231/Kf_ProductReceiveMaterialBillEdit.html" "b/WebTM/views/\351\242\206\346\226\231\345\217\221\350\264\247/\347\224\237\344\272\247\351\242\206\346\226\231/Kf_ProductReceiveMaterialBillEdit.html"
index c611b9c..e8b5ad6 100644
--- "a/WebTM/views/\351\242\206\346\226\231\345\217\221\350\264\247/\347\224\237\344\272\247\351\242\206\346\226\231/Kf_ProductReceiveMaterialBillEdit.html"
+++ "b/WebTM/views/\351\242\206\346\226\231\345\217\221\350\264\247/\347\224\237\344\272\247\351\242\206\346\226\231/Kf_ProductReceiveMaterialBillEdit.html"
@@ -324,6 +324,8 @@
                 var OperationType = params[params[0]];//鎿嶄綔绫诲瀷
                 var linterid = params[params[1]];//婧愬崟id
                 var HSouceBillType = params[params[2]];//婧愬崟绫诲瀷
+                var closeType = params[params[3]];  //鍏抽棴绫诲瀷
+                var HEntryID = params[params[4]]
             }
             //#endregion
 
@@ -352,7 +354,7 @@
                 RoadBillMain(linterid);
             }
             else if (OperationType == 4) {                     //涓嬫帹
-                setInit_PushBill();
+                setInit_PushBill(linterid);
             }
             else {
                 layer.alert("鏈煡鎿嶄綔绫诲瀷锛�", { icon: 5 });
@@ -1824,6 +1826,124 @@
             }
             //#endregion
 
+
+            //#region 涓嬫帹椤甸潰鍒濆鍖�
+            function setInit_PushBill(linterid) {
+                //鐢熸垚骞惰缃富琛ㄧ殑鍐呯爜鍜屽崟鎹彿
+                console.log("setInit_PushBill 寮�濮嬫墽琛岋紒");
+                get_MAXNum();
+
+                //鐩稿叧鏂囨湰妗嗕俊鎭垵濮嬪寲
+                $("#HDate").val(Pub_Format(new Date(), "yyyy-MM-dd"));
+                $("#HMaker").val(sessionStorage["HUserName"]);
+                $("#HMakeDate").val(Pub_Format(new Date(), "yyyy-MM-dd"));
+                //鍒濆鍖栧苟鍒楄缃細瀛愯〃1
+                //set_InitGrid();
+                //DisPlay_HideColumn();
+
+
+                //鏌ヨ鐢熶骇璁㈠崟鏄惁瀛樺湪
+                var ajaxLoad = layer.load();
+                console.log(linterid,HEntryID)
+                var sWhere = " and HPRDORGID=" + sessionStorage["OrganizationID"] + "  and hmainid='" + linterid + "' and HEntryID=" + HEntryID;
+                $.ajax({
+                    url: GetWEBURL() + "/LEMS/MES_Sc_ProcessExchangeBillList_Json",
+                    type: "GET",
+                    async: false,
+                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
+                    success: function (d) {
+                        var result = d;
+                        console.log(result);
+                        if (result.code == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                            var data = result.data[0];
+
+                            console.log('鏉冮檺鍒ゆ柇鎴愬姛')
+                            form.val("component-form-group", { //formTest 鍗� class="layui-form" 鎵�鍦ㄥ厓绱犲睘鎬� lay-filter="" 瀵瑰簲鐨勫��
+                                "HEmpID": data.HEmpID
+                                , "HEmpName": data.涓氬姟鍛�
+                                , "HDeptID": data.HDeptID
+                                , "HDeptName": data.鐢熶骇杞﹂棿
+                                , "HCusID": data.HEntryCusID
+                                , "HCusName": data.瀹㈡埛
+                                , "HBillSubType": "鐧藉澂棰嗘枡"
+
+                                //, "HDeptID": data.HDeptID
+                                //, "HDeptName": data.鐢熶骇杞﹂棿
+                                //, "HCusID": data.HCusID
+                                //, "HCusName": data.瀹㈡埛
+
+                                //, "HMainSourceInterID": linterid
+                                //, "HMainSourceEntryID": HEntryID
+                                //, "HMainSourceBillNo": data.鍗曟嵁鍙�
+                                /*                                , "HMainSourceBillType": params[params[2]]*/
+
+
+                                //, "HMaterID": data.HMaterID
+                                //, "鐗╂枡浠g爜": data.浜у搧浠g爜
+                                //, "鐗╂枡鍚嶇О": data.浜у搧鍚嶇О
+                                //, "婧愬崟鍙�": data.鍗曟嵁鍙�
+                                //, "婧愬崟涓诲唴鐮�": data.hmainid
+                                //, "婧愬崟瀛愬唴鐮�": data.HEntryID
+                            });
+
+                            //缁勭粐鐨勫�糎OrgID鍙樺寲锛岄噸鏂版覆鏌�
+                            HOrgIDBar = data.HOrgID;
+
+                            //瀛愯〃  璧嬪��
+                            var rowdata = [];
+                            for (var i = 0; i < result.data.length; i++) {
+                                rowdata.push(
+                                    {
+                                        //"HMaterID": result.data[i]["HMaterID"],
+                                        //"鐗╂枡浠g爜": result.data[i]["浜у搧浠g爜"],
+                                        //"鐗╂枡鍚嶇О": result.data[i]["浜у搧鍚嶇О"],
+                                        //"瑙勬牸鍨嬪彿": result.data[i]["瑙勬牸鍨嬪彿"],
+                                        //"HUnitID": result.data[i]["HUnitID"],
+                                        //"璁¢噺鍗曚綅": result.data[i]["璁¢噺鍗曚綅"],
+                                        //"HQty_Old": result.data[i]["鐢熶骇浠诲姟鍗曟暟閲�"],
+                                        //"HQty_New": result.data[i]["鐢熶骇浠诲姟鍗曟暟閲�"],
+                                        ////"HDate_Old": formatDate(result.data[i]["鍘熶氦璐ф棩鏈�"]),
+                                        ////"HDate_New": formatDate(result.data[i]["鏂颁氦璐ф棩鏈�"]),
+                                        "HRemark": "",
+                                        //"HSourceInterID": result.data[i]["hmainid"],
+                                        //"HSourceEntryID": result.data[i]["HEntryID"],
+                                        //"HSourceBillNo": result.data[i]["鍗曟嵁鍙�"],
+                                        //"HSourceBillType": result.data[i]["鍗曟嵁绫诲瀷"]
+                                        "HMaterID": data.HMaterID
+                                        , "鐗╂枡浠g爜": data.浜у搧浠g爜
+                                        , "鐗╂枡鍚嶇О": data.浜у搧鍚嶇О
+                                        , "HSourceBillNo": data.鍗曟嵁鍙�
+                                        , "HSourceInterID": data.hmainid
+                                        , "HSourceEntryID": data.HEntryID
+                                        , "HSourceBillType": params[params[2]]
+                                        , "璁¢噺鍗曚綅": ""
+                                        , "HUnitCode": ""
+                                        , "HUnitName": ""
+                                        , "HQtyMust": "0"
+                                        , "HQty": "0"
+                                        , "HWHCode": ""
+                                        , "鍙戣揣浠撳簱": ""
+                                        , "HWHID": ""
+                                        , "HMaterSpec": data.浜у搧瑙勬牸
+                                    }
+                                );
+                            }
+                            option.data = rowdata;
+
+                            table.render(option);
+                            layer.close(ajaxLoad);
+                        } else {
+                            layer.close(ajaxLoad);
+                            layer.alert(result.msg, { icon: 5, btn: ['閫�鍑�'], time: 100000, offset: 't' });
+                        }
+                    }, error: function () {
+                        layer.close(ajaxLoad);
+                        layer.alert("鍙戠敓閿欒!", { icon: 5 });
+                    }
+                })
+            }
+            //#endregion
+
             //#region 鏍规嵁鐗╂枡ID鑾峰彇绮惧害
             function getDecByMaterID(HMaterID) {
                 var resultData = {};
diff --git "a/WebTM/views/\351\242\206\346\226\231\345\217\221\350\264\247/\351\242\206\346\226\231\345\207\272\345\272\223/Kf_MateOutBackBillEdit.html" "b/WebTM/views/\351\242\206\346\226\231\345\217\221\350\264\247/\351\242\206\346\226\231\345\207\272\345\272\223/Kf_MateOutBackBillEdit.html"
index c84cca1..1b2468e 100644
--- "a/WebTM/views/\351\242\206\346\226\231\345\217\221\350\264\247/\351\242\206\346\226\231\345\207\272\345\272\223/Kf_MateOutBackBillEdit.html"
+++ "b/WebTM/views/\351\242\206\346\226\231\345\217\221\350\264\247/\351\242\206\346\226\231\345\207\272\345\272\223/Kf_MateOutBackBillEdit.html"
@@ -62,6 +62,7 @@
                                                     <select name="HBillSubType" lay-filter="HBillSubType" id="HBillSubType">
                                                         <option value="鏍囧噯棰嗘枡" selected="selected">鏍囧噯棰嗘枡</option>
                                                         <option value="鐧藉澂棰嗘枡">鐧藉澂棰嗘枡</option>
+                                                        <option value="鐧藉澂閫�鏂�">鐧藉澂閫�鏂�</option>
                                                     </select>
                                                 </div>
                                             </div>
@@ -135,7 +136,7 @@
                                                 </div>
                                             </div>
                                             <div class="layui-inline">
-                                                <label class="layui-form-label">閫夊崟鍙�</label>
+                                                <label class="layui-form-label">閫夊崟鍙�<label style="color:red"> * </label></label>
                                                 <div class="layui-input-inline">
                                                     <input type="text" name="HSourceBillNo" id="HSourceBillNo" readonly class="layui-input" value="" style="float:left;width:150px;">
                                                     <input type="hidden" name="HSourceInterID" id="HSourceInterID" class="layui-input" value="" style="float:left;width:150px;">
@@ -204,6 +205,7 @@
             var linterid = params[params[1]];//婧愬崟id
             var HSouceBillType = params[params[2]];//婧愬崟绫诲瀷
             var closeType = params[params[3]];  //鍏抽棴绫诲瀷
+            var HEntryID = params[params[4]]
         }
 
         layui.config({
@@ -246,6 +248,9 @@
             }
             else if (OperationType == 3) {//缂栬緫
                 set_EditFromGrid(linterid);
+            }
+            else if (OperationType == 4) {//涓嬫帹
+                setInit_PushBill(linterid);
             }
             else {
                 layer.alert("鏈煡鎿嶄綔绫诲瀷锛�", { icon: 5 });
@@ -734,10 +739,10 @@
             //淇濆瓨
             form.on('submit(Saver)', function (data) {
                 var refSav = "";
-                if (linterid == "" || linterid == null) {
+                if (OperationType == 1 || OperationType == 2 || OperationType == 4) {
                     refSav = "Add";
                 }
-                if (linterid != "" && linterid != null) {
+                if (OperationType == 3) {
                     refSav = "Update";
                 }
                 data.field.HMaker = sessionStorage["HUserName"];//鍒跺崟浜�
@@ -907,6 +912,22 @@
                 });
             }
 
+            //#region 鐢熸垚鍗曟嵁鍙�
+            function createBillNo() {
+                $.ajax({
+                    url: GetWEBURL() + "/Web/GetMAXNum",
+                    type: "GET",
+                    data: { "HBillType": '1244' },
+                    success: function (d) {
+
+                        $("#HBillNo").val(d.data[0].HBillNo);
+                        $("#HDate").val(Pub_Format(new Date(), "yyyy-MM-dd"));
+                        $("#HInterID").val(0);
+                    }
+                });
+            }
+            //#endregion
+
             //鍒濆鍖栨槑缁嗚〃鏍�
             function set_InitGrid() {
                 columns = [
@@ -972,6 +993,125 @@
                 });
             }
 
+            //#region 涓嬫帹椤甸潰鍒濆鍖�
+            function setInit_PushBill(linterid) {
+                //鐢熸垚骞惰缃富琛ㄧ殑鍐呯爜鍜屽崟鎹彿
+                console.log("setInit_PushBill 寮�濮嬫墽琛岋紒");
+                createBillNo();
+
+                //鐩稿叧鏂囨湰妗嗕俊鎭垵濮嬪寲
+                $("#HDate").val(Pub_Format(new Date(), "yyyy-MM-dd"));
+                $("#HMaker").val(sessionStorage["HUserName"]);
+                $("#HMakeDate").val(Pub_Format(new Date(), "yyyy-MM-dd"));
+                //鍒濆鍖栧苟鍒楄缃細瀛愯〃1
+                //set_InitGrid();
+                //DisPlay_HideColumn();
+
+
+                //鏌ヨ鐢熶骇璁㈠崟鏄惁瀛樺湪
+                var ajaxLoad = layer.load();
+                var sWhere = " and HPRDORGID=" + sessionStorage["OrganizationID"] + "  and hmainid='" + linterid + "' and HEntryID=" + HEntryID;
+                $.ajax({
+                    url: GetWEBURL() + "/LEMS/MES_Sc_ProcessExchangeBillList_Json",
+                    type: "GET",
+                    async: false,
+                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
+                    success: function (d) {
+                        var result = d;
+                        console.log(result);
+                        if (result.code == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                            var data = result.data[0];
+
+                            console.log('鏉冮檺鍒ゆ柇鎴愬姛')
+                            form.val("component-form-group", { //formTest 鍗� class="layui-form" 鎵�鍦ㄥ厓绱犲睘鎬� lay-filter="" 瀵瑰簲鐨勫��
+                                "HEmpID": data.HEmpID
+                                , "HEmpName": data.涓氬姟鍛�
+                                , "HDeptID": data.HDeptID
+                                , "HDeptName": data.鐢熶骇杞﹂棿
+                                , "HCusID": data.HEntryCusID
+                                , "HCusName": data.瀹㈡埛
+                                , "HBillSubType": "鐧藉澂閫�鏂�"
+
+                                //, "HDeptID": data.HDeptID
+                                //, "HDeptName": data.鐢熶骇杞﹂棿
+                                //, "HCusID": data.HCusID
+                                //, "HCusName": data.瀹㈡埛
+
+                                //, "HMainSourceInterID": linterid
+                                //, "HMainSourceEntryID": HEntryID
+                                //, "HMainSourceBillNo": data.鍗曟嵁鍙�
+                                /*                                , "HMainSourceBillType": params[params[2]]*/
+
+
+                                //, "HMaterID": data.HMaterID
+                                //, "鐗╂枡浠g爜": data.浜у搧浠g爜
+                                //, "鐗╂枡鍚嶇О": data.浜у搧鍚嶇О
+                                //, "婧愬崟鍙�": data.鍗曟嵁鍙�
+                                //, "婧愬崟涓诲唴鐮�": data.hmainid
+                                //, "婧愬崟瀛愬唴鐮�": data.HEntryID
+                            });
+
+                            //缁勭粐鐨勫�糎OrgID鍙樺寲锛岄噸鏂版覆鏌�
+                            HOrgIDBar = data.HOrgID;
+
+                            //瀛愯〃  璧嬪��
+                            var rowdata = [];
+                            for (var i = 0; i < result.data.length; i++) {
+                                rowdata.push(
+                                    {
+                                        //"HMaterID": result.data[i]["HMaterID"],
+                                        //"鐗╂枡浠g爜": result.data[i]["浜у搧浠g爜"],
+                                        //"鐗╂枡鍚嶇О": result.data[i]["浜у搧鍚嶇О"],
+                                        //"瑙勬牸鍨嬪彿": result.data[i]["瑙勬牸鍨嬪彿"],
+                                        //"HUnitID": result.data[i]["HUnitID"],
+                                        //"璁¢噺鍗曚綅": result.data[i]["璁¢噺鍗曚綅"],
+                                        //"HQty_Old": result.data[i]["鐢熶骇浠诲姟鍗曟暟閲�"],
+                                        //"HQty_New": result.data[i]["鐢熶骇浠诲姟鍗曟暟閲�"],
+                                        ////"HDate_Old": formatDate(result.data[i]["鍘熶氦璐ф棩鏈�"]),
+                                        ////"HDate_New": formatDate(result.data[i]["鏂颁氦璐ф棩鏈�"]),
+                                        "HRemark": "",
+                                        //"HSourceInterID": result.data[i]["hmainid"],
+                                        //"HSourceEntryID": result.data[i]["HEntryID"],
+                                        //"HSourceBillNo": result.data[i]["鍗曟嵁鍙�"],
+                                        //"HSourceBillType": result.data[i]["鍗曟嵁绫诲瀷"]
+                                        "HMaterID": data.HMaterID
+                                        , "HMaterCode": data.浜у搧浠g爜
+                                        , "HMaterName": data.浜у搧鍚嶇О
+                                        , "HSourceBillNo": data.鍗曟嵁鍙�
+                                        , "HSourceInterID": data.hmainid
+                                        , "HSourceEntryID": data.HEntryID
+                                        , "HSourceBillType": params[params[2]]
+                                        , "HUnitID": ""
+                                        , "HUnitCode": ""
+                                        , "HUnitName": ""
+                                        , "HQtyMust": ""
+                                        , "HQty": ""
+                                        , "HPrice": ""
+                                        , "HMoney": ""
+                                        , "HWHCode": ""
+                                        , "HWHName": ""
+                                        , "HWHID": ""
+                                        , "HMaterSpec": data.浜у搧瑙勬牸
+                                    }
+                                );
+                            }
+                            option.data = rowdata;
+
+                            table.render(option);
+                            layer.close(ajaxLoad);
+                        } else {
+                            layer.close(ajaxLoad);
+                            layer.alert(result.msg, { icon: 5, btn: ['閫�鍑�'], time: 100000, offset: 't' });
+                        }
+                    }, error: function () {
+                        layer.close(ajaxLoad);
+                        layer.alert("鍙戠敓閿欒!", { icon: 5 });
+                    }
+                })
+            }
+            //#endregion
+
+
             //缂栬緫
             function set_EditFromGrid(linterid) {
                 set_EditForm(linterid);  //缂栬緫鑾峰彇琛ㄥご
diff --git "a/WebTM/views/\351\242\206\346\226\231\345\217\221\350\264\247/\351\242\206\346\226\231\345\207\272\345\272\223/Kf_MateOutBillLEdit.html" "b/WebTM/views/\351\242\206\346\226\231\345\217\221\350\264\247/\351\242\206\346\226\231\345\207\272\345\272\223/Kf_MateOutBillLEdit.html"
index 9580f77..ff6663c 100644
--- "a/WebTM/views/\351\242\206\346\226\231\345\217\221\350\264\247/\351\242\206\346\226\231\345\207\272\345\272\223/Kf_MateOutBillLEdit.html"
+++ "b/WebTM/views/\351\242\206\346\226\231\345\217\221\350\264\247/\351\242\206\346\226\231\345\207\272\345\272\223/Kf_MateOutBillLEdit.html"
@@ -418,6 +418,7 @@
                 var linterid = params[params[1]];//婧愬崟id
                 var HSouceBillType = params[params[2]];//婧愬崟绫诲瀷
                 var closeType = params[params[3]];  //鍏抽棴绫诲瀷
+                            var HEntryID = params[params[4]]
             }
             //#endregion
 
@@ -454,6 +455,9 @@
             }
             else if (OperationType == 3) {//缂栬緫
                 set_EditFromGrid(linterid);
+            }
+            else if (OperationType == 4) {
+                setInit_PushBill(linterid)
             }
             else {
                 layer.alert("鏈煡鎿嶄綔绫诲瀷锛�", { icon: 5 });
@@ -2155,6 +2159,127 @@
             }
             //#endregion
 
+
+            //#region 涓嬫帹椤甸潰鍒濆鍖�
+            function setInit_PushBill(linterid) {
+                //鐢熸垚骞惰缃富琛ㄧ殑鍐呯爜鍜屽崟鎹彿
+                console.log("setInit_PushBill 寮�濮嬫墽琛岋紒");
+                get_MAXNum();
+
+                //鐩稿叧鏂囨湰妗嗕俊鎭垵濮嬪寲
+                $("#HDate").val(Pub_Format(new Date(), "yyyy-MM-dd"));
+                $("#HMaker").val(sessionStorage["HUserName"]);
+                $("#HMakeDate").val(Pub_Format(new Date(), "yyyy-MM-dd"));
+                //鍒濆鍖栧苟鍒楄缃細瀛愯〃1
+                //set_InitGrid();
+                //DisPlay_HideColumn();
+
+
+                //鏌ヨ鐢熶骇璁㈠崟鏄惁瀛樺湪
+                var ajaxLoad = layer.load();
+                var sWhere = " and HPRDORGID=" + sessionStorage["OrganizationID"] + "  and hmainid='" + linterid + "' and HEntryID=" + HEntryID;
+                $.ajax({
+                    url: GetWEBURL() + "/LEMS/MES_Sc_ProcessExchangeBillList_Json",
+                    type: "GET",
+                    async: false,
+                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
+                    success: function (d) {
+                        var result = d;
+                        console.log(result);
+                        if (result.code == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                            var data = result.data[0];
+
+                            console.log('鏉冮檺鍒ゆ柇鎴愬姛')
+                            form.val("component-form-group", { //formTest 鍗� class="layui-form" 鎵�鍦ㄥ厓绱犲睘鎬� lay-filter="" 瀵瑰簲鐨勫��
+                                "HEmpID": data.HEmpID
+                                , "HEmpName": data.涓氬姟鍛�
+                                , "HDeptID": data.HDeptID
+                                , "HDeptName": data.鐢熶骇杞﹂棿
+                                , "HCusID": data.HEntryCusID
+                                , "HCusName": data.瀹㈡埛
+                                , "HBillSubType": "鐧藉澂閫�鏂�"
+
+
+
+                                //, "HDeptID": data.HDeptID
+                                //, "HDeptName": data.鐢熶骇杞﹂棿
+                                //, "HCusID": data.HCusID
+                                //, "HCusName": data.瀹㈡埛
+
+                                //, "HMainSourceInterID": linterid
+                                //, "HMainSourceEntryID": HEntryID
+                                //, "HMainSourceBillNo": data.鍗曟嵁鍙�
+                                /*                                , "HMainSourceBillType": params[params[2]]*/
+
+
+                                //, "HMaterID": data.HMaterID
+                                //, "鐗╂枡浠g爜": data.浜у搧浠g爜
+                                //, "鐗╂枡鍚嶇О": data.浜у搧鍚嶇О
+                                //, "婧愬崟鍙�": data.鍗曟嵁鍙�
+                                //, "婧愬崟涓诲唴鐮�": data.hmainid
+                                //, "婧愬崟瀛愬唴鐮�": data.HEntryID
+                            });
+
+                            //缁勭粐鐨勫�糎OrgID鍙樺寲锛岄噸鏂版覆鏌�
+                            HOrgIDBar = data.HOrgID;
+
+                            //瀛愯〃  璧嬪��
+                            var rowdata = [];
+                            for (var i = 0; i < result.data.length; i++) {
+                                rowdata.push(
+                                    {
+                                        //"HMaterID": result.data[i]["HMaterID"],
+                                        //"鐗╂枡浠g爜": result.data[i]["浜у搧浠g爜"],
+                                        //"鐗╂枡鍚嶇О": result.data[i]["浜у搧鍚嶇О"],
+                                        //"瑙勬牸鍨嬪彿": result.data[i]["瑙勬牸鍨嬪彿"],
+                                        //"HUnitID": result.data[i]["HUnitID"],
+                                        //"璁¢噺鍗曚綅": result.data[i]["璁¢噺鍗曚綅"],
+                                        //"HQty_Old": result.data[i]["鐢熶骇浠诲姟鍗曟暟閲�"],
+                                        //"HQty_New": result.data[i]["鐢熶骇浠诲姟鍗曟暟閲�"],
+                                        ////"HDate_Old": formatDate(result.data[i]["鍘熶氦璐ф棩鏈�"]),
+                                        ////"HDate_New": formatDate(result.data[i]["鏂颁氦璐ф棩鏈�"]),
+                                        "HRemark": "",
+                                        //"HSourceInterID": result.data[i]["hmainid"],
+                                        //"HSourceEntryID": result.data[i]["HEntryID"],
+                                        //"HSourceBillNo": result.data[i]["鍗曟嵁鍙�"],
+                                        //"HSourceBillType": result.data[i]["鍗曟嵁绫诲瀷"]
+                                        "HMaterID": data.HMaterID
+                                        , "HMaterCode": data.浜у搧浠g爜
+                                        , "HMaterName": data.浜у搧鍚嶇О
+                                        , "HSourceBillNo": data.鍗曟嵁鍙�
+                                        , "HSourceInterID": data.hmainid
+                                        , "HSourceEntryID": data.HEntryID
+                                        , "HSourceBillType": params[params[2]]
+                                        , "HUnitID": ""
+                                        , "HUnitCode": ""
+                                        , "HUnitName": ""
+                                        , "HQtyMust": ""
+                                        , "HQty": ""
+                                        , "HPrice": ""
+                                        , "HMoney": ""
+                                        , "HWHCode": ""
+                                        , "HWHName": ""
+                                        , "HWHID": ""
+                                        , "HMaterSpec": data.浜у搧瑙勬牸
+                                    }
+                                );
+                            }
+                            option.data = rowdata;
+
+                            table.render(option);
+                            layer.close(ajaxLoad);
+                        } else {
+                            layer.close(ajaxLoad);
+                            layer.alert(result.msg, { icon: 5, btn: ['閫�鍑�'], time: 100000, offset: 't' });
+                        }
+                    }, error: function () {
+                        layer.close(ajaxLoad);
+                        layer.alert("鍙戠敓閿欒!", { icon: 5 });
+                    }
+                })
+            }
+            //#endregion
+
             //#region 鏍规嵁宸ヨ壓鍗曞彿鑾峰彇琛ㄥご淇℃伅
             function getMainInfoByHProcExchBillNo() {
                 var HProcExchBillNo = $("#HProcExchBillNo").val();
diff --git "a/WebTM/views/\351\242\206\346\226\231\345\217\221\350\264\247/\351\242\206\346\226\231\345\207\272\345\272\223/Kf_MateOutBillList.html" "b/WebTM/views/\351\242\206\346\226\231\345\217\221\350\264\247/\351\242\206\346\226\231\345\207\272\345\272\223/Kf_MateOutBillList.html"
index 5e7a846..1960469 100644
--- "a/WebTM/views/\351\242\206\346\226\231\345\217\221\350\264\247/\351\242\206\346\226\231\345\207\272\345\272\223/Kf_MateOutBillList.html"
+++ "b/WebTM/views/\351\242\206\346\226\231\345\217\221\350\264\247/\351\242\206\346\226\231\345\207\272\345\272\223/Kf_MateOutBillList.html"
@@ -936,7 +936,6 @@
 
             //#region 鏂板
             function set_AddNew() {
-                debugger
                 var content = '../棰嗘枡鍑哄簱/Kf_MateOutBillLEdit.html?OperationType=1&linterid=&HSouceBillType=0&closeType=1'
                 if (subType) {
                     if (subType == '缇婃瘺鏌撹壊') {

--
Gitblit v1.9.1