From 40bf4e328668fd9673fd60a67b551c2f8d8d5445 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期五, 05 一月 2024 14:03:42 +0800
Subject: [PATCH] 生产订单:下查(工序流转卡、工序进站接收单、工序出站汇报单、指引卡开工单、指引卡完工单、生产领料单)

---
 WebTM/views/销售管理/收款单/YS_ReceiveBill.html |  131 ++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 128 insertions(+), 3 deletions(-)

diff --git "a/WebTM/views/\351\224\200\345\224\256\347\256\241\347\220\206/\346\224\266\346\254\276\345\215\225/YS_ReceiveBill.html" "b/WebTM/views/\351\224\200\345\224\256\347\256\241\347\220\206/\346\224\266\346\254\276\345\215\225/YS_ReceiveBill.html"
index 88c51ac..ef4c60b 100644
--- "a/WebTM/views/\351\224\200\345\224\256\347\256\241\347\220\206/\346\224\266\346\254\276\345\215\225/YS_ReceiveBill.html"
+++ "b/WebTM/views/\351\224\200\345\224\256\347\256\241\347\220\206/\346\224\266\346\254\276\345\215\225/YS_ReceiveBill.html"
@@ -128,7 +128,7 @@
                                         <div class="layui-inline">
                                             <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; background-color: #efefef4d;" readonly>
+                                                <input type="text" name="HEmpName" id="HEmpName"  class="layui-input" value="" style="float: left; width: 150px; background-color: #efefef4d;" readonly>
                                                 <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>
@@ -290,6 +290,18 @@
                                             </div>
                                         </div>
                                     </div>
+
+                                    <!--闅愯棌瀛楁-->
+                                    <div class="layui-row" style="display:none;">
+                                        <div class="layui-inline">
+                                            <div class="layui-input-block">
+                                                <input class="layui-input" name="HMainSourceInterID" id="HMainSourceInterID" value="0" autocomplete="off">
+                                                <input class="layui-input" name="HMainSourceEntryID" id="HMainSourceEntryID" value="0" autocomplete="off">
+                                                <input class="layui-input" name="HMainSourceBillNo" id="HMainSourceBillNo" value="" autocomplete="off">
+                                                <input class="layui-input" name="HMainSourceBillType" id="HMainSourceBillType" value="" autocomplete="off">
+                                            </div>
+                                        </div>
+                                    </div>
                                 </div>
                             </div>
                             <!--鍏朵粬淇℃伅-->
@@ -425,6 +437,9 @@
                 //鍔犺浇缂栬緫椤甸潰
                 RoadBillMain(linterid);
             }
+            else if (OperationType == 4) {                                                  //涓嬫帹
+                setInit_PushBill(linterid);
+            }
             //#endregion
 
             //#region 缁勭粐鍒濆鍖�
@@ -552,6 +567,26 @@
             //#region 鎿嶄綔鎸夐挳瑙﹀彂浜嬩欢
             //#region 淇濆瓨鎻愪氦
             form.on('submit(btnSave)', function (data) {//鎻愪氦
+                if (OperationType == 4) {
+                    //#region 鍒ゆ柇婧愬崟鐘舵��
+                    var HSourceBillData = "";
+                    var HSourceBillData = getSourceBillStatus_ExceptiveCheckRequestBill();            //鑾峰彇婧愬崟鏁版嵁
+                    if (HSourceBillData != "none") {
+                        if (HSourceBillData.length == 0) {
+                            layer.alert("淇濆瓨澶辫触!鏈煡璇㈠埌婧愬崟鍗曟嵁!", { icon: 5 });
+                            return;
+                        } else if (HSourceBillData[0]["鐘舵��"] != "宸插鏍�") {
+                            layer.alert("淇濆瓨澶辫触!婧愬崟鍗曟嵁鐘舵�佹湭涓�'宸插鏍�'鐘舵��!", { icon: 5 });
+                            return;
+                        }
+                    } else {
+                        return;
+                    }
+                    //#endregion
+                }
+
+
+
                 //if (AllowLoadData(data)) {
                     set_AddNew(data);
                 //}
@@ -920,7 +955,7 @@
             function set_AddNew(data) {
                 //鑾峰彇鎿嶄綔鏂瑰紡
                 var refSav = "";
-                if (OperationType == 1 || OperationType == 2) {
+                if (OperationType == 1 || OperationType == 2 || OperationType == 4) {
                     refSav = "Add";
                 }
                 if (OperationType == 3) {
@@ -1016,6 +1051,11 @@
                                 , "HCreditRating_Now": data.HCreditRating_Now
                                 , "HRemark": data.琛ㄥご澶囨敞
 
+                                , "HMainSourceInterID": data.HMainSourceInterID == null ? 0 : data.HMainSourceInterID
+                                , "HMainSourceEntryID": data.HMainSourceEntryID == null ? 0 : data.HMainSourceEntryID
+                                , "HMainSourceBillNo": data.HMainSourceBillNo
+                                , "HMainSourceBillType": data.HMainSourceBillType
+
                                 , "HMaker": data.鍒跺崟浜�
                                 , "HMakeDate": data.鍒跺崟鏃ユ湡 == null ? "" : Format(new Date(data.鍒跺崟鏃ユ湡), "yyyy-MM-dd")
                                 , "HUpDater": data.淇敼浜�
@@ -1030,6 +1070,62 @@
 
                             HOrgIDBar = data.HOrgID == null ? 0 : data.HOrgID;
 
+                            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 setInit_PushBill(linterid) {
+                //鐢熸垚骞惰缃富琛ㄧ殑鍐呯爜鍜屽崟鎹彿
+                createBillNo();
+
+                //鐩稿叧鏂囨湰妗嗕俊鎭垵濮嬪寲
+                $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
+                $("#HMaker").val(sessionStorage["HUserName"]);
+                $("#HMakeDate").val(Format(new Date(), "yyyy-MM-dd"));
+
+                //鏌ヨ 鐗规壒鐢宠鍗� 鏄惁瀛樺湪
+                var ajaxLoad = layer.load();
+                $.ajax({
+                    url: GetWEBURL() + "/Xs_ExceptiveCheckRequestBill/cx",
+                    async: false,
+                    type: "GET",
+                    data: {
+                        "HInterID": linterid
+                    },
+                    success: function (result) {
+                        if (result.code == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                            var data = result.data[0];
+
+                            getCustomerByCusID(data.HCusID);
+
+                            form.val("formData", { //formTest 鍗� class="layui-form" 鎵�鍦ㄥ厓绱犲睘鎬� lay-filter="" 瀵瑰簲鐨勫��
+                                "HDeptID": data.HDeptID
+                                , "HDeptName": data.閿�鍞儴闂�
+                                , "HEmpID": data.HEmpID
+                                , "HEmpName": data.閿�鍞憳
+                                , "HManagerID": data.HManagerID
+                                , "HManagerName": data.閿�鍞富绠�
+                                , "HCurID": data.HCurID
+                                , "HCurName": data.甯佸埆
+                                , "HExRate": data.姹囩巼
+                                , "HCusID": data.HCusID
+                                , "HCusName": data.涓氬姟瀹㈡埛
+                                , "HAccCusID": data.HCusID
+                                , "HAccCusName": data.涓氬姟瀹㈡埛
+                                , "HMainSourceInterID": linterid
+                                , "HMainSourceBillNo": data.鍗曟嵁鍙�
+                                , "HMainSourceBillType": params[params[2]]
+                            });
                             layer.close(ajaxLoad);
                         } else {
                             layer.close(ajaxLoad);
@@ -1109,7 +1205,7 @@
                                 //鍏抽棴褰撳墠frame
                                 layer.close(index);
                             });
-
+                            layer.msg(result.Message);
                         } else {
                             layer.alert(result.code + result.Message, { icon: 5 });
                         }
@@ -1117,6 +1213,29 @@
                         layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
                     }
                 });
+            }
+            //#endregion
+
+            //#region 鑾峰彇婧愬崟-鐗规壒鐢宠鍗曞崟鎹姸鎬�
+            function getSourceBillStatus_ExceptiveCheckRequestBill() {
+                var HSourceBillData = "none";
+                var sWhere = " and hmainid = " + $("#HMainSourceInterID").val();
+                $.ajax({
+                    url: GetWEBURL() + '/Xs_ExceptiveCheckRequestBill/list',
+                    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
             //#endregion
@@ -1158,6 +1277,12 @@
             $("#HBankID").val(obj[0].HItemID);
         }
 
+        function GetSettleStyleValue(obj)           //杩斿洖缁撶畻鏂瑰紡
+        {
+            $("#HSSName").val(obj[0].HName);
+            $("#HSSID").val(obj[0].HItemID);
+        }
+
         //#region 鏍规嵁瀹㈡埛鑾峰彇甯佸埆銆佹眹鐜囥�佺粨绠楁柟寮�
         function getCustomerByCusID(HCusID) {
             $.ajax({

--
Gitblit v1.9.1