From b28c9a27dfefb67600192dcd587efdf0cf64cc98 Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期二, 24 九月 2024 10:00:38 +0800
Subject: [PATCH] 不同订单类型不能合并下推送货单;设置默认打印模板;一键打印

---
 WebSRM/layuiAdmin.std-v1.2.1/src/views/SRM/SRM_POInStockBill_Edit.html |   69 +++++++++++++++++++++++++++++++---
 1 files changed, 62 insertions(+), 7 deletions(-)

diff --git a/WebSRM/layuiAdmin.std-v1.2.1/src/views/SRM/SRM_POInStockBill_Edit.html b/WebSRM/layuiAdmin.std-v1.2.1/src/views/SRM/SRM_POInStockBill_Edit.html
index 98ab8e4..d894293 100644
--- a/WebSRM/layuiAdmin.std-v1.2.1/src/views/SRM/SRM_POInStockBill_Edit.html
+++ b/WebSRM/layuiAdmin.std-v1.2.1/src/views/SRM/SRM_POInStockBill_Edit.html
@@ -27,6 +27,7 @@
                                 <button type="button" id="add-btn" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Saver">淇濆瓨</button>
                                 <button type="button" id="aduit-btn" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Aduit">瀹℃牳</button>
                                 <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Print">鎵撳嵃</button>
+                                <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Print_Convenient">涓�閿墦鍗�</button>
                                 <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="ChooseSource">閫夋簮鍗�</button>
                                 <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Exit">閫�鍑�</button>
                             </div>
@@ -349,13 +350,15 @@
                     , { field: 'HRQty', title: '鍓╀綑鍙彂璐ф暟閲�', width: 100 }
                     , { field: 'HSQty', title: '婧愬崟鏁伴噺', width: 100 }
                     , { field: 'HBatchNo', title: '鎵瑰彿', width: 120, edit: 'text' }
+                    , { field: 'HBatchManager', title: '鍚敤鎵规绠$悊', width: 120, hide: true }
+                    , { field: 'HOrderType', title: '璁㈠崟绫诲瀷', width: 120, hide: true }
                     , { field: 'HKFDate', title: '鐢熶骇鏃ユ湡', align: 'center', width: 150, data_field: 'HKFDate', event: "chooseHKFDate" }
                     , { field: 'HKFPeriod', title: '淇濊川鏈�', width: 100, hide: true }
                     , { field: 'HDate', title: '棰勮鍒拌揣鏃ユ湡', align: 'center', width: 150, data_field: 'HDate', event: "chooseHDate", hide: true }
                     , { field: 'HPrice', title: '鍗曚环', width: 100, hide: true }
                     , { field: 'HMoney', title: '閲戦', width: 100, hide: true }
                     , { field: 'HRemark', title: '澶囨敞', width: 200, edit: true }
-                    , { field: 'HTAXPRICE_T', title: '鍚◣閲嶉噺鍗曚环/鍚�', width: 200, edit: true, hide: true}                    
+                    , { field: 'HTAXPRICE_T', title: '鍚◣閲嶉噺鍗曚环/鍚�', width: 200, edit: true, hide: true }
                     //, { field: 'HRemark', title: '澶囨敞', width: 100 }
                     , { field: 'HPOOrderInterID', title: '閲囪喘璁㈠崟涓诲唴鐮�', width: 150, hide: true }
                     , { field: 'HPOOrderEntryID', title: '閲囪喘璁㈠崟瀛愬唴鐮�', width: 150, hide: true }
@@ -741,6 +744,50 @@
                     });
             });
 
+            //涓�閿墦鍗�
+            form.on('submit(Print_Convenient)', function (data) {
+                if (HIsAduit == false) {
+                    layer.msg("璇峰鏍搁�佽揣鍗曞悗鍦ㄨ繘琛屾墦鍗�( 麓鈼旓笌 鈥糕棓锔巂)", { icon: 5 });
+                    return;
+                }
+                $.ajax({
+                    type: "GET",
+                    url: GetWEBURL() + "/GetHinterID", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+                    async: true,
+                    data: { "HBillNo": $("#HBillNo").val() },
+                    dataType: "json",
+                    success: function (data) {
+                        if (data.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                            $.ajax({
+                                type: "get",
+                                url: GetWEBURL() + "/Open_PrintTem/GetDefaultOpenTmp_Json",
+                                async: true,
+                                data: { "HNumber": 'SRM_POInStockBillList' },
+                                //data: { "Value": Value },
+                                success: function (result) {
+                                    if (result.count == 1) {
+                                        var OpenTmp = result.data[0].妯℃澘鍚嶇О
+                                        window.open("../../views/SRM/HBarPlanPrint.html?linterid=" + data.data.toString() + "&Type=SRM_POInStockBillList" + "&OpenTmp=" + OpenTmp.toString());
+                                    } else {
+                                        layer.msg(result.Message);
+                                    }
+                                },
+                                error: function (result) {
+                                    console.log(result);
+                                }
+                            });
+                        }
+                        else {
+                            f_alert(data.Message);
+                        }
+                        layer.closeAll("loading");
+                    },
+                    error: function (err) {
+                        f_alert("閿欒:" + err);
+                    }
+                });
+            });           
+
             form.on('submit(ChooseSource)', function (data) {
                 layer.open({
                     type: 2
@@ -825,10 +872,10 @@
                         //    layer.msg("鏄庣粏璁板綍绗�" + (i + 1) + "琛�,閫佽揣鍗曟暟閲忎笉鑳借秴杩囧凡鐢熸垚鏉$爜鏁伴噺!", { icon: 5, btn: ['纭'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
                         //    return Result = false;
                         //}
-                        //if (sSubStr[i].HBatchNo == "") {
-                        //    layer.msg("鏄庣粏璁板綍绗�" + (i + 1) + "琛�,鎵规涓虹┖!", { icon: 5, btn: ['纭'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-                        //    return Result = false;
-                        //}
+                        if (sSubStr[i].HBatchNo == "" && sSubStr[i].HBatchManager == "鏄�") {
+                            layer.msg("鏄庣粏璁板綍绗�" + (i + 1) + "琛�,鐗╂枡鍚敤鎵规绠$悊锛屾壒娆′负绌猴紝璇峰~鍐欐壒娆′俊鎭�!", { icon: 5, btn: ['纭'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                            return Result = false;
+                        }
                         if (sSubStr[i].HKFDate == "") {
                             //鍑礉
                             layer.msg("鏄庣粏璁板綍绗�" + (i + 1) + "琛�,鐢熶骇鏃ユ湡涓虹┖!", { icon: 5, btn: ['纭'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
@@ -970,11 +1017,16 @@
         });
 
         function GetPoorderValue(obj) {
-            var Batchno = Format(new Date(), "yyyy-MM-dd").replaceAll('-', '').substr(2,6);//6浣嶆暟褰撳墠鏃ユ湡
-            
+            var Batchno = Format(new Date(), "yyyy-MM-dd").replaceAll('-', '').substr(2, 6);//6浣嶆暟褰撳墠鏃ユ湡
+
             var HSubLen = HSubData.length + 1;
             var a = [];
+            var HOrderType = HSubData[0].HOrderType
+            var HError = "";
             for (let i = 0; i < obj.length; i++) {
+                if (obj[i].璁㈠崟绫诲瀷 != HOrderType) {
+                    HError += obj[i].璁㈠崟绫诲瀷;
+                }
                 var row_options = {
                     //"sorderid": HSubLen, "HPOOrderInterID": obj[i].hmainid, "HPOOrderEntryID": obj[i].hentryid, "HPOOrderBillNo": obj[i].鍗曟嵁鍙�, "HWWOrderInterID": 0,
                     //"HWWOrderEntryID": 0, "HWWOrderDetaiLID": 0., "HWWOrderBillNo": '', "HBillType": "1102", "HBatchNo": obj[i].HBatchNo, "HMaterID": obj[i].hmaterid,
@@ -1001,6 +1053,9 @@
                 //    "HUnitID": "0", "FPrintCount": "0", "HRQty": "0", "HSQty": "", "HBatchNo": "", "HKFDate": "", "HKFPeriod": "", "HDate": "", "HPrice": "", "HMoney": "", "HRemark": "", "HPOOrderInterID": "", "HPOOrderEntryID": "", "HPOOrderBillNo": "", "HWWOrderInterID": "", "HWWOrderEntryID": "", "HWWOrderBillNo": "", "HBillType": "", "HSourceBillType": "", "HSourceBillNo": "", "HSupMaterNumber": "", "HSupBatchNo": "", "HExpressNumberSub": "", "HExpressSupplierSub": "", "HPlanArrivalDate": "", "HBoxNumber": "", "HSourceInterID": "", "HSourceEntryID": ""
                 //};
             };
+            if (HError != "") {
+                return layer.msg('閲囪喘璁㈠崟璁㈠崟绫诲瀷涓嶅悓锛屼笉鍏佽鍚堝苟涓嬫帹鐢熸垚閫佽揣鍗曪紒')
+            }
             table.reload('mainTable', {
                 data: HSubData
                 , height: 'full-10'

--
Gitblit v1.9.1