From aab547b8fe51cd326da13b9ef5ff3d56d657c95f Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期四, 29 二月 2024 16:29:57 +0800
Subject: [PATCH] 销售出库单:编辑页面增加打印功能

---
 WebTM/views/领料发货/销售出库/Kf_SellOutBill.html |   89 +++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 83 insertions(+), 6 deletions(-)

diff --git "a/WebTM/views/\351\242\206\346\226\231\345\217\221\350\264\247/\351\224\200\345\224\256\345\207\272\345\272\223/Kf_SellOutBill.html" "b/WebTM/views/\351\242\206\346\226\231\345\217\221\350\264\247/\351\224\200\345\224\256\345\207\272\345\272\223/Kf_SellOutBill.html"
index dbd80cd..322a446 100644
--- "a/WebTM/views/\351\242\206\346\226\231\345\217\221\350\264\247/\351\224\200\345\224\256\345\207\272\345\272\223/Kf_SellOutBill.html"
+++ "b/WebTM/views/\351\242\206\346\226\231\345\217\221\350\264\247/\351\224\200\345\224\256\345\207\272\345\272\223/Kf_SellOutBill.html"
@@ -47,6 +47,7 @@
                         <div class="layui-btn-group">
                             <button type="button" id="set_SaveBill" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Saver">淇濆瓨</button>
                             <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="set_CheckBill">瀹℃牳</button>
+                            <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="btn-print">鎵撳嵃</button>
                             <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Exit">閫�鍑�</button>
                         </div>
                     </div>
@@ -451,14 +452,14 @@
 
             //#region 鍒ゆ柇鏄惁鐧诲綍 鏈櫥褰曞垯璺冲埌鐧诲綍椤�
             get_LoginIs();
+            //#endregion
 
             //#region 銆愬姩鎬佽幏鍙栨ā鍧楀悕绉般��
-            var HModuleType = "1205";
-            //閫氳繃鍗曟嵁绫诲瀷锛屼粠鏁版嵁搴撳姩鎬佽幏鍙栧崟鎹ā鍧楀懡鍚�,寮曠敤js鏂囦欢 PageTitle.js
-            var HPageTitle = get_PageTitle(HModuleType) == "" ? $("h1").html() : get_PageTitle(HModuleType);
-            $("h1").html('<b>' + HPageTitle + '</b>');
-				//#endregion
-            //#endregion
+            //var HModuleType = "1205";
+            ////閫氳繃鍗曟嵁绫诲瀷锛屼粠鏁版嵁搴撳姩鎬佽幏鍙栧崟鎹ā鍧楀懡鍚�,寮曠敤js鏂囦欢 PageTitle.js
+            //var HPageTitle = get_PageTitle(HModuleType) == "" ? $("h1").html() : get_PageTitle(HModuleType);
+            //$("h1").html('<b>' + HPageTitle + '</b>');
+			//#endregion
 
             //#region 鑾峰彇椤甸潰璺宠浆鍙傛暟
             var params = get_UrlVars();
@@ -529,6 +530,12 @@
             //#region 瀹℃牳鎸夐挳
             form.on('submit(set_CheckBill)', function (data) {
                 set_CheckBill(0);
+            });
+            //#endregion
+
+            //#region 鎵撳嵃鎸夐挳
+            form.on('submit(btn-print)', function (data) {
+                get_PrintReport();
             });
             //#endregion
 
@@ -2497,6 +2504,53 @@
             }
             //#endregion
 
+            //#region 鎵撳嵃
+            function get_PrintReport() {
+                //#region 鍒ゆ柇婧愬崟鐘舵��
+                var HSourceBillData = "";
+                var HSourceBillData = getSourceBillStatus_SellOutBill();            //鑾峰彇婧愬崟鏁版嵁
+                if (HSourceBillData != "none") {
+                    if (HSourceBillData.length == 0) {
+                        layer.alert("鎵撳嵃澶辫触!鏈煡璇㈠埌鍗曟嵁淇℃伅!", { icon: 5 });
+                        return;
+                    } else if (HSourceBillData[0]["鐘舵��"] != "宸插鏍�") {
+                        layer.alert("鎵撳嵃澶辫触!鍗曟嵁鐘舵�佹湭涓�'宸插鏍�'鐘舵��!", { icon: 5 });
+                        return;
+                    }
+                } else {
+                    return;
+                }
+                //#endregion
+
+
+
+                var InterID = $("#HInterID").val();
+                $.ajax({
+                    type: "GET",
+                    url: GetWEBURL() + "/Kf_SellOutBill/CheckSellOutBill_IsExist", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+                    data: { "HInterID": InterID },
+                    success: function (result) {
+                        if (result.count == 1) {
+                            layer.open({
+                                type: 2
+                                , area: ['50%', '50%']
+                                , title: '鎵撳嵃妯$増閫夋嫨'
+                                , shade: 0.6 //閬僵閫忔槑搴�
+                                , maxmin: false //鍏佽鍏ㄥ睆鏈�灏忓寲
+                                , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
+                                , content: ['../../BaseSet/SRM_OpenTmpList.html?linterid=' + InterID + '&MyMsg=' + InterID + '&Type=Kf_SellOutBillList', 'yes']
+                                , resize: false
+                            })
+                        } else {
+                            layer.alert(result.code + result.Message, { icon: 5 });
+                        }
+                    }, error: function () {
+                        layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                    }
+                });
+            }
+            //#endregion
+
             //#region 鏍规嵁涓诲唴鐮佷笌瀛愬唴鐮佽幏鍙栨簮鍗曢攢鍞鍗曟暟鎹�
             function getPushSourceBillInit(HSourceInterID, HSourceEntryID) {
                 var res = "none";
@@ -2523,6 +2577,29 @@
                 return res;
             }
             //#endregion
+
+            //#region 鑾峰彇閿�鍞嚭搴撳崟鍗曟嵁鐘舵��
+            function getSourceBillStatus_SellOutBill() {
+                var HSourceBillData = "none";
+                var sWhere = " and hmainid = " + $("#HInterID").val();
+                $.ajax({
+                    url: GetWEBURL() + '/Kf_SellOutBill/GetSellOutBillList',
+                    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
 
 

--
Gitblit v1.9.1