From c3631dd1c8e908b478625c209dc59618146cebcd Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期五, 24 十一月 2023 15:52:26 +0800
Subject: [PATCH] 销售订单:编辑页面打印功能限制单据状态为”已审核“时使用

---
 WebTM/views/销售管理/销售订单/Add_Edit_Xs_SeOrderBillList.html |  123 +++++++++++++++++++++++++++++++++++++++--
 1 files changed, 117 insertions(+), 6 deletions(-)

diff --git "a/WebTM/views/\351\224\200\345\224\256\347\256\241\347\220\206/\351\224\200\345\224\256\350\256\242\345\215\225/Add_Edit_Xs_SeOrderBillList.html" "b/WebTM/views/\351\224\200\345\224\256\347\256\241\347\220\206/\351\224\200\345\224\256\350\256\242\345\215\225/Add_Edit_Xs_SeOrderBillList.html"
index c1b36ff..441a912 100644
--- "a/WebTM/views/\351\224\200\345\224\256\347\256\241\347\220\206/\351\224\200\345\224\256\350\256\242\345\215\225/Add_Edit_Xs_SeOrderBillList.html"
+++ "b/WebTM/views/\351\224\200\345\224\256\347\256\241\347\220\206/\351\224\200\345\224\256\350\256\242\345\215\225/Add_Edit_Xs_SeOrderBillList.html"
@@ -192,7 +192,7 @@
                                     </div>
                                     <div class="layui-row">
                                         <div class="layui-inline">
-                                            <label class="layui-form-label">瀹㈡埛浣欓</label>
+                                            <label class="layui-form-label">瀹㈡埛浣欓<i class="layui-icon layui-icon-tips" id="tips-HCusBalance"></i></label>
                                             <div class="layui-input-inline">
                                                 <input class="layui-input" name="HCusBalance" id="HCusBalance" autocomplete="off" readonly>
                                             </div>
@@ -204,9 +204,15 @@
                                             </div>
                                         </div>
                                         <div class="layui-inline">
-                                            <label class="layui-form-label">鍙敤棰濆害</label>
+                                            <label class="layui-form-label">鍙敤棰濆害<i class="layui-icon layui-icon-tips" id="tips-HAvailableBalance"></i></label>
                                             <div class="layui-input-inline">
                                                 <input class="layui-input" name="HAvailableBalance" id="HAvailableBalance" autocomplete="off" readonly>
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label">闇�姹傞噾棰�<i class="layui-icon layui-icon-tips" id="tips-HBillMoney"></i></label>
+                                            <div class="layui-input-inline">
+                                                <input class="layui-input" name="HBillMoney" id="HBillMoney" autocomplete="off" readonly>
                                             </div>
                                         </div>
                                     </div>
@@ -655,6 +661,8 @@
                             , HlineTotal: HlineTotal
                         });
                         table.render(option);
+                        //璁剧疆琛ㄥご鎵�闇�閲戦
+                        set_HBillMoney();
                         break;
                     case "HPrice":                                                       //鍗曚环
                         //鏁版嵁鏍煎紡鏍¢獙
@@ -695,6 +703,8 @@
                             , HlineTotal: HlineTotal
                         });
                         table.render(option);
+                        //璁剧疆琛ㄥご鎵�闇�閲戦
+                        set_HBillMoney();
                         break;
                     case "HTaxRate":                                                       //鏁伴噺
                         //鏁版嵁鏍煎紡鏍¢獙
@@ -735,6 +745,8 @@
                             , HlineTotal: HlineTotal
                         });
                         table.render(option);
+                        //璁剧疆琛ㄥご鎵�闇�閲戦
+                        set_HBillMoney();
                         break;
                     case "HTaxPrice":                                                       //鏁伴噺
                         //鏁版嵁鏍煎紡鏍¢獙
@@ -775,11 +787,38 @@
                             , HlineTotal: HlineTotal
                         });
                         table.render(option);
+                        //璁剧疆琛ㄥご鎵�闇�閲戦
+                        set_HBillMoney();
                         break;
                     default:
                 }
             });
             //#endregion
+            //#endregion
+
+            //#region 鏂囨湰妗嗙洃鍚�
+            $(document).ready(function () {
+                //#region 瀹㈡埛浣欓鎻愮ず淇℃伅
+                $("#tips-HCusBalance").on('click', function (data) {
+                    var tips_Message = "瀹㈡埛浣欓 = 鏈熷垵+鏈湡鏀舵锛堝凡瀹℃牳锛�-鏈湡閫�娆撅紙宸插鏍革級-鏈湡鍑哄簱锛堝凡瀹℃牳锛�+鏈湡閫�璐э紙宸插鏍革級";
+                    layer.alert(tips_Message, { icon: 0, btn: ['閫�鍑�'], time: 100000, offset: 't' });
+                });
+                //#endregion
+
+                //#region 鍙敤浣欓鎻愮ず淇℃伅
+                $("#tips-HAvailableBalance").on('click', function (data) {
+                    var tips_Message = "鍙敤棰濆害 = 瀹㈡埛浣欓 + 淇$敤棰濆害 - 锛堟湰鏈熼攢鍞鍗曟�婚噾棰� * 0.5锛�";
+                    layer.alert(tips_Message, { icon: 0, btn: ['閫�鍑�'], time: 100000, offset: 't' });
+                });
+                //#endregion
+
+                //#region 闇�姹傞噾棰�
+                $("#tips-HBillMoney").on('click', function (data) {
+                    var tips_Message = "闇�姹傞噾棰� = 浠风◣鍚堣 * 0.5";
+                    layer.alert(tips_Message, { icon: 0, btn: ['閫�鍑�'], time: 100000, offset: 't' });
+                });
+                //#endregion
+            });
             //#endregion
             //#endregion
 
@@ -889,24 +928,25 @@
                 option = {
                     elem: '#mainTable'
                     , toolbar: '#toolbarDemo'
+                    , totalRow: true
                     , limit: 500
                     , height: 500
                     , loading: false
                     , cols: [[ //瀛愯〃
                         { type: 'checkbox', totalRowText: '鍚堣琛�', style: 'background-color:#efefef4d;' }
-                        , { type: 'numbers', title: '搴忓彿', width: 100, totalRow: true, style: 'background-color:#efefef4d;' }
+                        , { type: 'numbers', title: '搴忓彿', width: 100, style: 'background-color:#efefef4d;' }
                         , { field: 'HMaterID', title: 'HMaterID', width: 100, hide: true, style: 'background-color:#efefef4d;' }
                         , { field: '鐗╂枡浠g爜', title: '鐗╂枡浠g爜', width: 150, edit: 'text', event: "HMaterID" }//f7
                         , { field: '鐗╂枡鍚嶇О', title: '鐗╂枡鍚嶇О', width: 150, style: 'background-color:#efefef4d;' }
                         , { field: '瑙勬牸鍨嬪彿', title: '瑙勬牸鍨嬪彿', width: 100, style: 'background-color:#efefef4d;' }
                         , { field: 'HUnitID', title: 'HUnitID', width: 100, hide: true, style: 'background-color:#efefef4d;' }
                         , { field: '璁¢噺鍗曚綅', title: '璁¢噺鍗曚綅', width: 100, style: 'background-color:#efefef4d;' }//f7
-                        , { field: 'HQty', title: '鏁伴噺', width: 100, edit: 'text' }
+                        , { field: 'HQty', title: '鏁伴噺', width: 100, totalRow: true, edit: 'text' }
                         , { field: 'HPrice', title: '鍗曚环', width: 100, edit: 'text' }
                         , { field: 'HTaxRate', title: '绋庣巼', width: 100, edit: 'text' }
                         , { field: 'HTaxPrice', title: '鍚◣鍗曚环', width: 100, edit: 'text' }
-                        , { field: 'HMoney', title: '閲戦', width: 100, style: 'background-color:#efefef4d;' }
-                        , { field: 'HlineTotal', title: '浠风◣鍚堣', width: 100, style: 'background-color:#efefef4d;' }
+                        , { field: 'HMoney', title: '閲戦', width: 100, totalRow: true, style: 'background-color:#efefef4d;' }
+                        , { field: 'HlineTotal', title: '浠风◣鍚堣', width: 100, totalRow: true, style: 'background-color:#efefef4d;' }
                         , { field: 'HDate', title: '浜よ揣鏃ユ湡', event: "HDate", width: 120 }
                         , { field: 'HRemark', title: '澶囨敞', width: 100, edit: 'text' }
 
@@ -946,6 +986,9 @@
 
                 option.data = rowdata;
                 table.render(option);
+
+                //璁剧疆琛ㄥご鎵�闇�閲戦
+                set_HBillMoney();
             }
             //#endregion
 
@@ -1069,6 +1112,9 @@
                             option.cols[0][20].edit = null;
 
                             table.render(option);
+
+                            //璁剧疆琛ㄥご鎵�闇�閲戦
+                            set_HBillMoney();
                             layer.close(ajaxLoad);
                         } else {
                             layer.close(ajaxLoad);
@@ -1573,6 +1619,8 @@
                 table.cache["mainTable"].push(NewRow);
                 option.data = table.cache["mainTable"];
                 table.render(option);
+                //璁剧疆琛ㄥご鎵�闇�閲戦
+                set_HBillMoney();
                 //rows++;
                 layer.msg('澧炲姞涓�琛屾寜閽紒')
             }
@@ -1594,6 +1642,8 @@
                     }
                     option.data = tables;
                     table.render(option);
+                    //璁剧疆琛ㄥご鎵�闇�閲戦
+                    set_HBillMoney();
                 } else {
                     layer.msg('璇烽�夋嫨涓�琛屾暟鎹紪杈戯紒');
                 }
@@ -1618,6 +1668,8 @@
                     option.data[option.data.length - 1].HWeight = "0";
 
                     table.render(option);//灏嗘暟鎹覆鏌撳埌琛ㄦ牸涓�
+                    //璁剧疆琛ㄥご鎵�闇�閲戦
+                    set_HBillMoney();
                 }
             }
             //#endregion
@@ -1642,6 +1694,8 @@
                             option.data[i - 1] = data[0];
                             option.data[i] = tables[0];
                             table.render(option);
+                            //璁剧疆琛ㄥご鎵�闇�閲戦
+                            set_HBillMoney();
                             break;
                         }
                     }
@@ -1673,6 +1727,8 @@
                             option.data[i + 1] = data[0];
                             option.data[i] = tables[0];
                             table.render(option);
+                            //璁剧疆琛ㄥご鎵�闇�閲戦
+                            set_HBillMoney();
                             break;
                         }
                     }
@@ -1698,6 +1754,8 @@
                             oldData.splice(obj.tr.data('index'), 1);
                             option.data = oldData;
                             table.render(option);
+                            //璁剧疆琛ㄥご鎵�闇�閲戦
+                            set_HBillMoney();
                             layer.close(index);
                         }
                     });
@@ -1788,6 +1846,8 @@
 
                                     }
                                     table.render(option);
+                                    //璁剧疆琛ㄥご鎵�闇�閲戦
+                                    set_HBillMoney();
 
                                     layer.close(index);//鍏抽棴寮圭獥
                                 }
@@ -1986,6 +2046,24 @@
 
             //#region 鎵撳嵃
             function get_PrintReport() {
+                //#region 鍒ゆ柇婧愬崟鐘舵��
+                var HSourceBillData = "";
+                var HSourceBillData = getSourceBillStatus_SeOrderBill();            //鑾峰彇婧愬崟鏁版嵁
+                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",
@@ -2012,6 +2090,39 @@
                 });
             }
             //#endregion
+
+            //#region 璁剧疆琛ㄥご鎵�闇�閲戦
+            function set_HBillMoney() {
+                var HBillMoney = 0;
+                for (var i = 0; i < option.data.length; i++) {
+                    HBillMoney += option.data[i]["HlineTotal"] * 1;
+                }
+                $("#HBillMoney").val(HBillMoney * 0.5);
+            }
+            //#endregion
+
+            //#region 鑾峰彇婧愬崟-閿�鍞鍗曞崟鎹姸鎬�
+            function getSourceBillStatus_SeOrderBill() {
+                var HSourceBillData = "none";
+                var sWhere = " and hmainid = " + $("#HInterID").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
 
 

--
Gitblit v1.9.1