From 96785ebcfe1bc9210f3d9d4056f4ec29fb60d810 Mon Sep 17 00:00:00 2001
From: wangyi <2946747746@qq.com>
Date: 星期四, 02 四月 2026 10:58:22 +0800
Subject: [PATCH] 1

---
 WebTM/views/领料发货/其他出库/Add_Edit_Kf_OtherOutBill.html |  205 +++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 181 insertions(+), 24 deletions(-)

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) {

--
Gitblit v1.9.1