1
cwjbxqmz
2023-11-14 66a7d3c6b9aefe3c5142ada65670f172cffeee0a
WebTM/views/ÏúÊÛ¹ÜÀí/ÊÕ¿îµ¥/YS_ReceiveBill.html
@@ -271,7 +271,7 @@
                                        <div class="layui-inline">
                                            <label class="layui-form-label">客户余额</label>
                                            <div class="layui-input-inline">
                                                <input class="layui-input" name="" id="" autocomplete="off" style="background-color: #efefef4d;" readonly>
                                                <input class="layui-input" name="HCusBalance" id="HCusBalance" autocomplete="off" style="background-color: #efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
@@ -420,6 +420,10 @@
            //#region ç»„织初始化
            Organ();
            //#endregion
            //#region é¡µé¢åˆå§‹åŒ–后,根据客户获取客户余额
            getCustomerBalance($("#HCusID").val());
            //#endregion
            //#endregion
@@ -608,6 +612,24 @@
            }
            //#endregion
            //#region  æ—¶é—´è½¬æ¢
            function formatDate(date) {
                var d = new Date(date),
                    month = '' + (d.getMonth() + 1),
                    day = '' + d.getDate(),
                    year = d.getFullYear();
                if (month.length < 2) {
                    month = '0' + month;
                }
                if (day.length < 2) {
                    day = '0' + day;
                }
                return [year, month, day].join('-');
            }
            //#endregion
            //#region èŽ·å–ç»„ç»‡
            function Organ() {
                //获取登录页组织列
@@ -768,6 +790,8 @@
                        }
                        getCustomerByCusID(checkStatus.data[0].HItemID);
                        //根据客户获取客户余额
                        getCustomerBalance(checkStatus.data[0].HItemID);
                        layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
@@ -1074,7 +1098,10 @@
        {
            //$("#HCusName").val(obj[0].HName);
            //$("#HCusID").val(obj[0].HItemID);
            //根据客户获取相关信息
            getCustomerByCusID(obj[0].HItemID);
            //根据客户获取客户余额
            getCustomerBalance(obj[0].HItemID);
        }
        function GetHManagerValue(obj)  //返回销售主管
@@ -1127,6 +1154,31 @@
            });
        }
        //#endregion
        //#region æ ¹æ®å®¢æˆ·èŽ·å–å®¢æˆ·ä½™é¢
        function getCustomerBalance(HCusID) {
            $.ajax({
                url: GetWEBURL() + "/Xs_CusRatingChangeBill/getCustomerBalance",
                async: false,
                type: "GET",
                data: {
                    "HCusID": HCusID
                },
                success: function (result) {
                    if (result.code == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                        var data = result.data[0];
                        $("#HCusBalance").val(data.HCusBalance == null ? 0 : data.HCusBalance);
                        $("#HCreditRating_Now").val(data.HCreditRating_Now == null ? 0 : data.HCreditRating_Now);
                    } else {
                        layer.alert(result.msg, { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
                    }
                }, error: function () {
                    layer.alert("发生错误!", { icon: 5 });
                }
            });
        }
        //#endregion
    </script>
</body>
</html>