From fc69a1e9655df3e8a01dc36ea2742c99f4a651ed Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期三, 17 一月 2024 13:22:08 +0800
Subject: [PATCH] 特批申请单:数据校验 销售订单:维护页面增加字段 销售出库关联数量、销售出库未关联数量、生产关联数量、生产未关联数量

---
 WebTM/views/生产管理/生产任务单/Sc_ICMOBillEdit_NoTable.html |  222 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 214 insertions(+), 8 deletions(-)

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_ICMOBillEdit_NoTable.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_ICMOBillEdit_NoTable.html"
index 8076540..bde7ce5 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_ICMOBillEdit_NoTable.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_ICMOBillEdit_NoTable.html"
@@ -119,14 +119,12 @@
                                                 </button>
                                             </div>
                                         </div>
-
-
                                         <div class="layui-inline" style="width: 51%;">
                                             <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">瀹㈡埛</label>
                                             <div class="layui-input-block" style="margin-left: 77px;">
                                                 <input type="text" class="layui-input" lay-verify="HCusName" name="HCusName" id="HCusName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                 <input type="hidden" name="HCusID" id="HCusID" lay-verify="HCusID" value="0">
-                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHCus" id="btnHCus" style="padding: 0 10px; float: right; margin-right: 210px;">
+                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHCus" id="btnHCus" style="padding: 0 10px; float: right; margin-right: 85px;">
                                                     <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                 </button>
                                             </div>
@@ -250,9 +248,23 @@
                                             </div>
                                         </div>
                                         <div class="layui-inline">
-                                            <label class="layui-form-label" style="width: 85px;">璁″垝寮�瀹屽伐鏈�</label>
+                                            <label class="layui-form-label" style="width: 85px;">璁″垝瀹屽伐鏈�</label>
                                             <div class="layui-input-block" style="margin-left: 120px;">
                                                 <input type="date" class="layui-input" lay-verify="HPlanEndDate" name="HPlanEndDate" id="HPlanEndDate" style="padding-left: 80px;">
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="layui-row">
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label" style="width: 85px;">瀹㈡埛鐗╂枡鍚嶇О</label>
+                                            <div class="layui-input-block" style="margin-left: 120px;">
+                                                <input type="text" class="layui-input" name="HCusMaterName" lay-verify="HCusMaterName" id="HCusMaterName" style="display: inline-block;" >
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label" style="width: 85px;">瀹㈡埛瑙勬牸鍨嬪彿</label>
+                                            <div class="layui-input-block" style="margin-left: 120px;">
+                                                <input type="text" class="layui-input" name="HCusModel" lay-verify="HCusModel" id="HCusModel" style="display: inline-block;">
                                             </div>
                                         </div>
                                     </div>
@@ -261,6 +273,12 @@
                                             <label class="layui-form-label" style="width: 85px;">鐧藉澂瑕佹眰</label>
                                             <div class="layui-input-block" style="margin-left: 120px;">
                                                 <input type="text" class="layui-input" name="HRemark" id="HRemark" lay-verify="HRemark" placeholder="璇疯緭鍏ュ唴瀹�" onmouseover="this.title=this.value">
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label" style="width: 85px;">璁㈠崟鍖呰澶囨敞</label>
+                                            <div class="layui-input-block" style="margin-left: 120px;">
+                                                <input type="text" class="layui-input" name="HOrderPickRemark" lay-verify="HOrderPickRemark" id="HOrderPickRemark" style="display: inline-block;">
                                             </div>
                                         </div>
                                     </div>
@@ -273,7 +291,7 @@
                                         </div>
                                     </div>
                                 </div>
-                            </div>
+                                </div>
 
                             <!--鍏朵粬淇℃伅-->
                             <div class="layui-tab-item">
@@ -404,6 +422,18 @@
                                             </div>
                                         </div>
                                     </div>
+
+                                    <!--闅愯棌瀛楁-->
+                                    <div class="layui-row" style="display:none;">
+                                        <div class="layui-inline">
+                                            <div class="layui-input-block" style="margin-left: 77px;">
+                                                <input type="hidden" name="HSourceInterID" id="HSourceInterID" lay-verify="HSourceInterID" value="0">
+                                                <input type="hidden" name="HSourceEntryID" id="HSourceEntryID" lay-verify="HSourceEntryID" value="0">
+                                                <input type="hidden" name="HSourceBillNo" id="HSourceBillNo" lay-verify="HSourceBillNo" value="">
+                                                <input type="hidden" name="HSourceBillType" id="HSourceBillType" lay-verify="HSourceBillType" value="">
+                                            </div>
+                                        </div>
+                                    </div>
                                 </div>
                             </div>
                         </div>
@@ -475,6 +505,9 @@
                 $("#HDate").attr("disabled", true);
                 RoadBillMain(linterid);
             }
+            else if (OperationType == 4) {  //閿�鍞鍗曚笅鎺ㄧ敓浜ц鍗�-椤甸潰鍒濆鍖�
+                setInit_PushBill();
+            }
             HfBtn();
 
             //#endregion
@@ -542,6 +575,26 @@
 
             //淇濆瓨鎻愪氦
             form.on('submit(btnSave)', function (data) {//鎻愪氦
+                //#region 鍒ゆ柇婧愬崟鐘舵��
+                var HSourceBillData = "";
+                var HSourceBillData = getSourceBillStatus_SeOrderBill();            //鑾峰彇婧愬崟鏁版嵁
+                if (HSourceBillData != "none") {
+                    if (HSourceBillData.length == 0) {
+                        if ($("#HSourceInterID").val() != 0) {
+                            layer.alert("淇濆瓨澶辫触!鏈煡璇㈠埌婧愬崟鍗曟嵁!", { icon: 5 });
+                            return;
+                        }
+                    } else if (HSourceBillData[0]["鐘舵��"] != "宸插鏍�") {
+                        layer.alert("淇濆瓨澶辫触!婧愬崟鍗曟嵁鐘舵�佹湭涓�'宸插鏍�'鐘舵��!", { icon: 5 });
+                        return;
+                    }
+                } else {
+                    return;
+                }
+                //#endregion
+
+
+
                 if (AllowLoadData(data)) {
                     set_AddNew(data);
                 }
@@ -646,6 +699,11 @@
                         $("#HSeOrderBillNo").val(checkStatus.data[0].鍗曟嵁鍙�);
                         $("#HSeOrderEntryID").val(checkStatus.data[0].hsubid);
 
+                        $("#HSourceInterID").val(checkStatus.data[0].hmainid);
+                        $("#HSourceEntryID").val(checkStatus.data[0].hsubid);
+                        $("#HSourceBillNo").val(checkStatus.data[0].鍗曟嵁鍙�);
+                        $("#HSourceBillType").val("1401");
+
                         layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
                     }
                     , btn2: function (index, layero) { }
@@ -686,7 +744,7 @@
                     , area: ['90%', '90%']//澶у皬
                     , title: '瀹㈡埛'//鏍囬
                     , shift: 2//寮瑰嚭鍔ㄧ敾
-                    , content: ['../../鍩虹璧勬枡/閿�鍞熀纭�璧勬枡/Gy_Customer.html', 'yes']
+                    , content: ['../../BaseSet/鍩虹璧勬枡/Gy_CustomerList.html', 'yes']
                     , btn: ['纭畾', '鍙栨秷']
                     , btn1: function (index, layero) {//鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
                         var iframeWindow = window['layui-layer-iframe' + index]  //鑾峰彇寮规椤甸潰
@@ -695,8 +753,10 @@
                             return layer.msg('璇烽�夋嫨鏁版嵁');
                         }
                         //鑾峰彇鏁版嵁
-                        $("#HCusID").val(checkStatus.data[0].HItemID);
-                        $("#HCusName").val(checkStatus.data[0].瀹㈡埛鍚嶇О);
+                        //$("#HCusID").val(checkStatus.data[0].HItemID);
+                        //$("#HCusName").val(checkStatus.data[0].瀹㈡埛鍚嶇О);
+
+                        getCustomerByCusID(checkStatus.data[0].HItemID);
 
                         layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
                     }
@@ -893,6 +953,72 @@
                 })
             }
 
+            //#region 涓嬫帹椤甸潰鍒濆鍖�
+            function setInit_PushBill() {
+                //鐢熸垚骞惰缃富琛ㄧ殑鍐呯爜鍜屽崟鎹彿
+                $.ajax({
+                    url: GetWEBURL() + "/Web/GetMAXNum",
+                    type: "GET",
+                    data: { "HBillType": '3710' },
+                    success: function (d) {
+                        $("#HInterID").val(d.data[0].HInterID);
+                        $("#HBillNo").val(d.data[0].HBillNo);
+                    }
+                });
+
+                //鏌ヨ 閿�鍞鍗� 鏄惁瀛樺湪
+                var ajaxLoad = layer.load();
+                $.ajax({
+                    url: GetWEBURL() + "/Xs_SeOrderBill/loadXs_SeOrderBill_InitICMO",
+                    async: false,
+                    type: "GET",
+                    data: {
+                        "HInterID": linterid
+                        , "HEntryID": HEntryID
+                    },
+                    success: function (result) {
+                        if (result.code == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                            var data = result.data[0];
+
+                            form.val("formData", { //formTest 鍗� class="layui-form" 鎵�鍦ㄥ厓绱犲睘鎬� lay-filter="" 瀵瑰簲鐨勫��
+                                "HSeOrderBillNo": data.鍗曟嵁鍙�
+                                , "HSeOrderInterID": data.hmainid
+                                , "HSeOrderEntryID": data.hsubid
+                               
+                                , "HSourceInterID": data.hmainid
+                                , "HSourceEntryID": data.hsubid
+                                , "HSourceBillNo": data.鍗曟嵁鍙�
+                                , "HSourceBillType": "1401"
+
+                                , "HEmpID": data.HEmpID
+                                , "HEmpName": data.涓氬姟鍛�
+                                , "HCusID": data.HCusID
+                                , "HCusName": data.瀹㈡埛
+                                , "HQty": data.鏁伴噺
+                                , "HMaterID": data.HMaterID
+                                , "HMaterNumber": data.鐗╂枡浠g爜
+                                , "HMaterName": data.鐗╂枡鍚嶇О
+                                , "HModel": data.瑙勬牸鍨嬪彿
+                                , "HUnitID": data.HUnitID
+                                , "HUnitName": data.璁¢噺鍗曚綅
+                                , "HWidth": data.骞呭
+                                , "HWeight": data.鍏嬮噸
+                                , "HRemark": data.琛ㄥご澶囨敞
+                            });
+
+                            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
+
             //淇濆瓨HMaker
             function set_AddNew(data) {
 
@@ -980,6 +1106,12 @@
                             , "HSeOrderBillNo": d.data[0].婧愬崟鍗曞彿
                             , "HSeOrderInterID": d.data[0].婧愬崟涓诲唴鐮�
                             , "HSeOrderEntryID": d.data[0].婧愬崟瀛愬唴鐮�
+
+                            , "HSourceInterID": d.data[0].HSourceInterID
+                            , "HSourceEntryID": d.data[0].HSourceEntryID
+                            , "HSourceBillNo": d.data[0].HSourceBillNo
+                            , "HSourceBillType": d.data[0].HSourceBillType
+
                             , "HEmpID": d.data[0].HEmpID
                             , "HEmpName": d.data[0].涓氬姟鍛�
                             , "HCusID": d.data[0].HEntryCusID
@@ -1013,6 +1145,9 @@
                             , "HWidth": d.data[0].HWidth
                             , "HWeight": d.data[0].HWeight
                             , "HColorRemark": d.data[0].鏌撹壊瑕佹眰
+                            , "HCusMaterName": d.data[0].瀹㈡埛鐗╂枡鍚嶇О
+                            , "HCusModel": d.data[0].瀹㈡埛瑙勬牸鍨嬪彿
+                            , "HOrderPickRemark": d.data[0].璁㈠崟鍖呰澶囨敞
                             //鍏朵粬淇℃伅
                             , "hmakers": OperationType == 2 ? "" : d.data[0].鍒跺崟浜�
                             , "hmakedate": OperationType == 2 ? "" : d.data[0].鍒跺崟鏃ユ湡 == null ? "" : Format(new Date(d.data[0].鍒跺崟鏃ユ湡), "yyyy-MM-dd")
@@ -1254,6 +1389,11 @@
                     return false;
                 }
 
+                if ($("#HCusID").val() == "0" || $("#HCusName").val() == "") {
+                    layer.msg("瀹㈡埛涓嶈兘涓虹┖!");
+                    return false;
+                }
+
                 if ($("#HMaterNumber").val() == "") {
                     layer.msg("鐗╂枡缂栫爜娌℃湁閫夋嫨");
                     return false;
@@ -1334,10 +1474,76 @@
                 return vars;
             }
 
+
+            //#region 鑾峰彇婧愬崟-閿�鍞鍗曞崟鎹姸鎬�
+            function getSourceBillStatus_SeOrderBill() {
+                var HSourceBillData = "none";
+                var sWhere = " and hmainid = " + $("#HSourceInterID").val();
+                $.ajax({
+                    url: GetWEBURL() + '/Xs_SeOrderBill/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
 
         });
 
+        function GetHSupValue(obj)  //杩斿洖瀹㈡埛
+        {
+            //$("#HCusName").val(obj[0].HName);
+            //$("#HCusID").val(obj[0].HItemID);
+            //鏍规嵁瀹㈡埛鑾峰彇鐩稿叧淇℃伅
+            getCustomerByCusID(obj[0].HItemID);
+        }
+
+        //#region 鏍规嵁瀹㈡埛鑾峰彇甯佸埆銆佹眹鐜囥�佺粨绠楁柟寮忋�佸鎴蜂俊鐢ㄩ搴︺�佽仈绯讳汉銆佽仈绯荤數璇�
+        function getCustomerByCusID(HCusID) {
+            $.ajax({
+                url: GetWEBURL() + "/Xs_SeOrderBill/getCustomerByCusID",
+                async: false,
+                type: "GET",
+                data: {
+                    "HCusID": HCusID
+                },
+                success: function (result) {
+                    if (result.code == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                        var data = result.data[0];
+
+                        $("#HCusID").val(data.HCusID);
+                        $("#HCusName").val(data.HCusName);
+                        //$("#HCurID").val(data.HCurID);
+                        //$("#HCurName").val(data.HCurName);
+                        //$("#HExRate").val(data.HExRate);
+                        //$("#HSSID").val(data.HSSID);
+                        //$("#HSSName").val(data.HSSName);
+                        //$("#HCreditRating_Now").val(data.HCreditRating_Now);
+                        //$("#HLinkMan").val(data.HLinkMan);
+                        //$("#HLinkPhone").val(data.HLinkPhone);
+
+                        //subHTaxRate = data.HTaxRate;
+
+                    } else {
+                        layer.alert(result.msg, { icon: 5, btn: ['閫�鍑�'], time: 100000, offset: 't' });
+                    }
+                }, error: function () {
+                    layer.alert("鍙戠敓閿欒!", { icon: 5 });
+                }
+            });
+        }
+        //#endregion
 
     </script>
 </body>

--
Gitblit v1.9.1