From 9d3e2e62b7ac0ba1b892c47ef3a539c708e15949 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期二, 21 十一月 2023 12:07:54 +0800
Subject: [PATCH] 销售订单:客户余额、可用余额、欠缺金额 旁边 增加按钮,按下后弹窗显示 计算公式
---
WebTM/views/销售管理/销售订单/Add_Edit_Xs_SeOrderBillList.html | 400 ++++++++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 365 insertions(+), 35 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 0742388..f86d8d2 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"
@@ -45,6 +45,8 @@
<div class="layui-card-header">
<div class="layui-btn-group">
<button type="button" id="add-btn" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="set_SaveBill">淇濆瓨</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>
@@ -69,8 +71,8 @@
</div>
<div class="layui-inline">
<label class="layui-form-label">鏃ユ湡<label style="color:red"> * </label></label>
- <div class="layui-input-inline">
- <input type="date" class="layui-input" lay-verify="HDate" name="HDate" id="HDate" style="padding-left: 80px;">
+ <div class="layui-input-block">
+ <input type="date" class="layui-input" lay-verify="HDate" name="HDate" id="HDate" style="width:190px;">
</div>
</div>
<div class="layui-inline">
@@ -164,7 +166,7 @@
<div class="layui-inline">
<label class="layui-form-label">鑱旂郴浜�</label>
<div class="layui-input-inline">
- <input class="layui-input" name="HLinkMan" id="HLinkMan" autocomplete="off" value="" >
+ <input class="layui-input" name="HLinkMan" id="HLinkMan" autocomplete="off" value="">
</div>
</div>
<div class="layui-inline">
@@ -188,6 +190,32 @@
</div>
</div>
</div>
+ <div class="layui-row">
+ <div class="layui-inline">
+ <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>
+ </div>
+ <div class="layui-inline">
+ <label class="layui-form-label">淇$敤棰濆害</label>
+ <div class="layui-input-inline">
+ <input class="layui-input" name="HCreditRating_Now" id="HCreditRating_Now" autocomplete="off" readonly>
+ </div>
+ </div>
+ <div class="layui-inline">
+ <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>
<div class="layui-row" style="margin-top:10px;">
<div class="layui-inline">
<label class="layui-form-label" style="width: 85px;">缁勭粐<label style="color:red"> * </label></label>
@@ -195,18 +223,6 @@
<select name="HOrgID" id="HOrgID" lay-verify="HOrgID">
<!--鍔ㄦ�佹覆鏌撶粍缁�-->
</select>
- </div>
- </div>
- <div class="layui-inline">
- <label class="layui-form-label">瀹㈡埛浣欓</label>
- <div class="layui-input-inline">
- <input class="layui-input" name="" id="" autocomplete="off" readonly>
- </div>
- </div>
- <div class="layui-inline">
- <label class="layui-form-label">瀹㈡埛淇$敤棰濆害</label>
- <div class="layui-input-inline">
- <input class="layui-input" name="" id="" autocomplete="off" readonly>
</div>
</div>
</div>
@@ -392,11 +408,27 @@
//#endregion
//#region 鍒ゆ柇骞惰缃搷浣滅被鍨嬨�侀〉闈㈠垵濮嬪寲
- if (OperationType == null || OperationType == 1) { //鏂板
+ if (OperationType == null || OperationType == 1) { //鏂板
//鏂板椤甸潰鍒濆鍖�
Init_setAdd();
}
- else if (OperationType == 3) { //缂栬緫
+ else if (OperationType == 2) { //澶嶅埗
+ //瀛愯〃鍒濆鍖�
+ set_InitGrid();
+ //鍔犺浇琛ㄤ綋鍜岃〃浣撴暟鎹�
+ RoadBillMain(linterid);
+
+ //鐢熸垚骞惰缃富琛ㄧ殑鍐呯爜鍜屽崟鎹彿
+ createBillNo();
+
+ //鐩稿叧鏂囨湰妗嗕俊鎭垵濮嬪寲
+ $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
+ $("#HSSDate").val(Format(new Date(), "yyyy-MM-dd"));
+ $("#HMaker").val(sessionStorage["HUserName"]);
+ $("#HMakeDate").val(Format(new Date(), "yyyy-MM-dd"));
+
+ }
+ else if (OperationType == 3) { //缂栬緫
$("#HInterID").val(linterid);
//瀛愯〃鍒濆鍖�
set_InitGrid();
@@ -407,6 +439,10 @@
//#region 鍒濆鍖栫粍缁�
Organ();
+ //#endregion
+
+ //#region 椤甸潰鍒濆鍖栧悗锛屾牴鎹鎴疯幏鍙栧鎴蜂綑棰�
+ getCustomerBalance( $("#HCusID").val() );
//#endregion
//#region 鍒楄缃細瀛愯〃1
@@ -471,6 +507,18 @@
if (AllowLoadData(data)) {
set_SaveBill(data);
}
+ });
+ //#endregion
+
+ //#region 瀹℃牳鎸夐挳
+ form.on('submit(set_CheckBill)', function (data) {
+ set_CheckBill(0);
+ });
+ //#endregion
+
+ //#region 鎵撳嵃鎸夐挳
+ form.on('submit(btn-print)', function (data) {
+ get_PrintReport();
});
//#endregion
@@ -613,6 +661,8 @@
, HlineTotal: HlineTotal
});
table.render(option);
+ //璁剧疆琛ㄥご鎵�闇�閲戦
+ set_HBillMoney();
break;
case "HPrice": //鍗曚环
//鏁版嵁鏍煎紡鏍¢獙
@@ -653,18 +703,20 @@
, HlineTotal: HlineTotal
});
table.render(option);
+ //璁剧疆琛ㄥご鎵�闇�閲戦
+ set_HBillMoney();
break;
case "HTaxRate": //鏁伴噺
//鏁版嵁鏍煎紡鏍¢獙
temp = value + "";
- if (!ref.test(temp) || temp == 0) {
+ if (!ref.test(temp)) {
//鎭㈠鏁版嵁鍒扮紪杈戝墠
obj.update({
HTaxRate: oldText
});
table.render(option);
- layer.msg("绋庣巼璇疯緭鍏ュぇ浜�0鐨勬暟瀛�!");
+ layer.msg("绋庣巼璇疯緭鍏ヤ笉灏忎簬0鐨勬暟瀛�!");
return;
}
@@ -693,11 +745,80 @@
, HlineTotal: HlineTotal
});
table.render(option);
+ //璁剧疆琛ㄥご鎵�闇�閲戦
+ set_HBillMoney();
+ break;
+ case "HTaxPrice": //鏁伴噺
+ //鏁版嵁鏍煎紡鏍¢獙
+ temp = value + "";
+ if (!ref.test(temp)) {
+ //鎭㈠鏁版嵁鍒扮紪杈戝墠
+ obj.update({
+ HTaxPrice: oldText
+ });
+ table.render(option);
+
+ layer.msg("鍚◣鍗曟嵁璇疯緭鍏ヤ笉灏忎簬0鐨勬暟瀛�!");
+ return;
+ }
+ //鏁版嵁鏍¢獙鍚堟牸锛岄噸绠楄褰�
+ var HQty = obj.data.HQty * 1; //鏁伴噺
+ var HTaxRate = obj.data.HTaxRate * 0.01; //绋庣巼
+ var HTaxPrice = value * 1; //鍚◣鍗曚环=鍗曚环*(1+绋庣巼)
+ var HPrice = HTaxPrice / (1 + HTaxRate); //鍗曚环=鍚◣鍗曟嵁/(1+绋庣巼)
+
+ /*var HDiscountRate = obj.data.HDiscountRate * 1; //鎶樻墸鐜�*/
+
+ /*var HRelTaxPrice = HTaxPrice * HDiscountRate; //瀹為檯鍚◣鍗曚环=鍚◣鍗曚环*鎶樻墸鐜�*/
+ //鎶樻墸棰� = 鍚◣鍗曚环 * (1 - 鎶樻墸鐜�) * 鏁伴噺
+ var HMoney = HQty * HPrice; //閲戦=鏁伴噺*鍗曚环
+ var HTaxMoney = HMoney * HTaxRate; //绋庨=閲戦*绋庣巼
+ var HlineTotal = HMoney + HTaxMoney; //浠风◣鍚堣=閲戦+绋庨
+
+
+
+ //鍚屾鏇存柊琛ㄦ牸鍜岀紦瀛樺搴旂殑鍊�
+ obj.update({
+ HQty: HQty
+ , HPrice: HPrice
+ , HTaxRate: HTaxRate * 100
+ , HTaxPrice: HTaxPrice
+ , HMoney: HMoney
+ , 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
@@ -822,7 +943,7 @@
, { field: 'HQty', title: '鏁伴噺', width: 100, edit: 'text' }
, { field: 'HPrice', title: '鍗曚环', width: 100, edit: 'text' }
, { field: 'HTaxRate', title: '绋庣巼', width: 100, edit: 'text' }
- , { field: 'HTaxPrice', title: '鍚◣鍗曚环', width: 100, style: 'background-color:#efefef4d;' }
+ , { 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: 'HDate', title: '浜よ揣鏃ユ湡', event: "HDate", width: 120 }
@@ -864,6 +985,9 @@
option.data = rowdata;
table.render(option);
+
+ //璁剧疆琛ㄥご鎵�闇�閲戦
+ set_HBillMoney();
}
//#endregion
@@ -931,6 +1055,7 @@
, "HLinkMan": data.鑱旂郴浜�
, "HExplanation": data.鎽樿
, "HLinkPhone": data.鑱旂郴鐢佃瘽
+ , "HCreditRating_Now": data.HCreditRating_Now
, "HRemark": data.琛ㄥご澶囨敞
, "HMaker": data.鍒跺崟浜�
, "HMakeDate": data.鍒跺崟浜� == "" ? "" :formatDate(data.鍒跺崟鏃ユ湡)
@@ -948,6 +1073,8 @@
//缁勭粐鐨勫�糎OrgID鍙樺寲锛岄噸鏂版覆鏌�
HOrgIDBar = data.HOrgID;
+ //鑾峰彇绋庣巼(鐢ㄤ簬瀛愯〃绋庣巼鐨勯粯璁ゅ��)
+ getHTaxRateByCusID(data.HCusID);
//瀛愯〃 璧嬪��
var rowdata = [];
@@ -984,6 +1111,9 @@
option.cols[0][20].edit = null;
table.render(option);
+
+ //璁剧疆琛ㄥご鎵�闇�閲戦
+ set_HBillMoney();
layer.close(ajaxLoad);
} else {
layer.close(ajaxLoad);
@@ -1039,6 +1169,9 @@
return layer.msg('璇烽�夋嫨鏁版嵁');
}
getCustomerByCusID(checkStatus.data[0].HItemID);
+ //鏍规嵁瀹㈡埛鑾峰彇瀹㈡埛浣欓
+ getCustomerBalance(checkStatus.data[0].HItemID);
+
layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
}
, btn2: function (index, layero) { }
@@ -1485,6 +1618,8 @@
table.cache["mainTable"].push(NewRow);
option.data = table.cache["mainTable"];
table.render(option);
+ //璁剧疆琛ㄥご鎵�闇�閲戦
+ set_HBillMoney();
//rows++;
layer.msg('澧炲姞涓�琛屾寜閽紒')
}
@@ -1506,6 +1641,8 @@
}
option.data = tables;
table.render(option);
+ //璁剧疆琛ㄥご鎵�闇�閲戦
+ set_HBillMoney();
} else {
layer.msg('璇烽�夋嫨涓�琛屾暟鎹紪杈戯紒');
}
@@ -1530,6 +1667,8 @@
option.data[option.data.length - 1].HWeight = "0";
table.render(option);//灏嗘暟鎹覆鏌撳埌琛ㄦ牸涓�
+ //璁剧疆琛ㄥご鎵�闇�閲戦
+ set_HBillMoney();
}
}
//#endregion
@@ -1554,6 +1693,8 @@
option.data[i - 1] = data[0];
option.data[i] = tables[0];
table.render(option);
+ //璁剧疆琛ㄥご鎵�闇�閲戦
+ set_HBillMoney();
break;
}
}
@@ -1585,6 +1726,8 @@
option.data[i + 1] = data[0];
option.data[i] = tables[0];
table.render(option);
+ //璁剧疆琛ㄥご鎵�闇�閲戦
+ set_HBillMoney();
break;
}
}
@@ -1610,6 +1753,8 @@
oldData.splice(obj.tr.data('index'), 1);
option.data = oldData;
table.render(option);
+ //璁剧疆琛ㄥご鎵�闇�閲戦
+ set_HBillMoney();
layer.close(index);
}
});
@@ -1631,26 +1776,78 @@
, shift: 2 //寮瑰嚭鍔ㄧ敾
, area: ["90%", "90%"] //绐椾綋澶у皬
, maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀�
- , content: ['../../Baseset/鍩虹璧勬枡/Gy_MaterialList.html', 'yes']
+ , content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_Material.html', 'yes']
, btn: ["纭畾", "鍙栨秷"]
, btn1: function (index, laero) {
//鎸夐挳涓� 鐨勫洖璋�
var iframeWindow = window["layui-layer-iframe" + index];//鑾峰彇寮规椤甸潰
var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//鑾峰彇閫変腑鐨勬暟鎹�
- if (checkStatus.data.length != 1) {
- return layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�");
- }
+ //if (checkStatus.data.length != 1) {
+ // return layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�");
+ //}
- //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
- obj.update({
- "HMaterID": checkStatus.data[0].HItemID
- , "鐗╂枡浠g爜": checkStatus.data[0].HNumber
- , "鐗╂枡鍚嶇О": checkStatus.data[0].HName
- , "瑙勬牸鍨嬪彿": checkStatus.data[0].HModel
- , "HUnitID": checkStatus.data[0].HUnitID
- , "璁¢噺鍗曚綅": checkStatus.data[0].HUnitName
- })
+ var rowIndex = $(obj.tr).attr("data-index") * 1;
+ for (var i = 0; i < checkStatus.data.length; i++) {
+ if (rowIndex + i >= option.data.length) {
+ var NewRow = {
+ "HMaterID": "0", "鐗╂枡浠g爜": "", "鐗╂枡鍚嶇О": "", "瑙勬牸鍨嬪彿": "", "HUnitID": "0", "璁¢噺鍗曚綅": "", "HQty": "0", "HPrice": "0", "HTaxPrice": "0"
+ , "HMoney": "0", "HDiscountRate": "0", "HRelTaxPrice": "0", "HTaxRate": "0", "HTaxMoney": "0", "HlineTotal": "0", "HlineTotalBB": "0"
+ , "HDate": Format(new Date(), 'yyyy-MM-dd'), "HOutStockQty": "0", "HInvoiceQty": "0", "HRemark": ""
+ }
+ btnAddLine(NewRow);
+ }
+
+ //鑾峰彇閫変腑鐨勭墿鏂欎俊鎭�
+ var resultData = checkStatus.data[i];
+
+ //鏁板�兼牸寮忔牎楠屽伐鍏�
+ var ref = /^\d+(\.\d+)?$/; //闈炶礋鏁版鍒欒〃杈惧紡
+ var temp = "";
+ //鑾峰彇閫夋嫨鐗╂枡鍓嶅悗鐨勭◣鐜�
+ var value = subHTaxRate; //閫夋嫨鐗╂枡鍚庢牴鎹鎴峰緱鍒扮殑绋庣巼
+ var oldText = option.data[rowIndex + i].HTaxRate; //璇ヨ褰曚腑鍘熸湁鐨勭◣鐜�
+
+ //绋庣巼鏁版嵁鏍煎紡鏍¢獙锛岃嫢鏍规嵁瀹㈡埛鑾峰彇鐨勭◣鐜囦笉鍚堟硶锛屽垯浣跨敤璁板綍涓師鏈夌殑绋庣巼锛屽苟鎻愮ず
+ temp = value + "";
+ if (!ref.test(temp)) {
+ value = oldText;
+ layer.msg("鑾峰彇鍒扮殑绋庣巼涓嶅悎娉曪紝宸茶嚜鍔ㄥ彉鏇翠负鍘熸湁绋庣巼!");
+ }
+
+ //鏁版嵁鏍¢獙鍚堟牸锛岄噸绠楄褰�
+ var HQty = option.data[rowIndex + i].HQty; //鏁伴噺
+ var HPrice = option.data[rowIndex + i].HPrice; //鍗曚环
+ var HTaxRate = value * 0.01; //绋庣巼
+ /*var HDiscountRate = obj.data.HDiscountRate * 1; //鎶樻墸鐜�*/
+ var HTaxPrice = HPrice * (1 + HTaxRate); //鍚◣鍗曚环=鍗曚环*(1+绋庣巼)
+ /*var HRelTaxPrice = HTaxPrice * HDiscountRate; //瀹為檯鍚◣鍗曚环=鍚◣鍗曚环*鎶樻墸鐜�*/
+ //鎶樻墸棰� = 鍚◣鍗曚环 * (1 - 鎶樻墸鐜�) * 鏁伴噺
+ var HMoney = HQty * HPrice; //閲戦=鏁伴噺*鍗曚环
+ var HTaxMoney = HMoney * HTaxRate; //绋庨=閲戦*绋庣巼
+ var HlineTotal = HMoney + HTaxMoney; //浠风◣鍚堣=閲戦+绋庨
+
+
+ option.data[rowIndex + i].HMaterID = resultData.HItemID;
+ option.data[rowIndex + i].鐗╂枡浠g爜 = resultData.鐗╂枡浠g爜;
+ option.data[rowIndex + i].鐗╂枡鍚嶇О = resultData.鐗╂枡鍚嶇О;
+ option.data[rowIndex + i].瑙勬牸鍨嬪彿 = resultData.瑙勬牸鍨嬪彿;
+ option.data[rowIndex + i].HUnitID = resultData.HUnitID;
+ option.data[rowIndex + i].璁¢噺鍗曚綅 = resultData.璁¢噺鍗曚綅鍚嶇О;
+
+ option.data[rowIndex + i].HQty = HQty;
+ option.data[rowIndex + i].HPrice = HPrice;
+ option.data[rowIndex + i].HTaxRate = HTaxRate * 100;
+ option.data[rowIndex + i].HTaxPrice = HTaxPrice;
+ option.data[rowIndex + i].HMoney = HMoney;
+ option.data[rowIndex + i].HlineTotal = HlineTotal;
+
+
+ }
+ table.render(option);
+ //璁剧疆琛ㄥご鎵�闇�閲戦
+ set_HBillMoney();
+
layer.close(index);//鍏抽棴寮圭獥
}
})
@@ -1819,15 +2016,79 @@
}
//#endregion
+ //#region 鍙嶅鏍�/瀹℃牳鏁版嵁
+ function set_CheckBill(num) {
+ var InterID = $("#HInterID").val();
+ //閫昏緫瀹℃牳鏂规硶
+ $.ajax({
+ type: "GET",
+ url: GetWEBURL() + "/Xs_SeOrderBill/AuditXs_SeOrderBill", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+ data: { "HInterID": InterID, "IsAudit": num, "CurUserName": sessionStorage["HUserName"] },
+ success: function (result) {
+ if (result.count == 1) {
+ layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
+ // 寰楀埌frame绱㈠紩
+ var index = layer.getFrameIndex(window.name);
+ //鍏抽棴褰撳墠frame
+ layer.close(index);
+ });
+ } else {
+ layer.alert(result.code + result.Message, { icon: 5 });
+ }
+ }, error: function () {
+ layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+ }
+ });
+ }
+ //#endregion
-
+ //#region 鎵撳嵃
+ function get_PrintReport() {
+ var InterID = $("#HInterID").val();
+ $.ajax({
+ type: "GET",
+ url: GetWEBURL() + "/Xs_SeOrderBill/CheckSeOrderBill_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=Xs_SeOrderBill', 'yes']
+ , resize: false
+ })
+ } else {
+ layer.alert(result.code + result.Message, { icon: 5 });
+ }
+ }, error: function () {
+ layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+ }
+ });
+ }
+ //#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
//#endregion
//浠ヤ笂鏄痩ayui妯″潡
});
+ //瀛愯〃绋庣巼锛屾牴鎹鎴峰甫鍑�
+ var subHTaxRate = 0;
+
// 鍩虹璧勬枡杩斿洖鏁版嵁
function GetHEmpValue(obj) //杩斿洖涓氬姟鍛�
{
@@ -1839,7 +2100,10 @@
{
//$("#HCusName").val(obj[0].HName);
//$("#HCusID").val(obj[0].HItemID);
+ //鏍规嵁瀹㈡埛鑾峰彇鐩稿叧淇℃伅
getCustomerByCusID(obj[0].HItemID);
+ //鏍规嵁瀹㈡埛鑾峰彇瀹㈡埛浣欓
+ getCustomerBalance(obj[0].HItemID);
}
function GetHManagerValue(obj) //杩斿洖涓荤
@@ -1854,7 +2118,19 @@
$("#HDeptID").val(obj[0].HItemID);
}
- //#region 鏍规嵁瀹㈡埛鑾峰彇甯佸埆銆佹眹鐜囥�佺粨绠楁柟寮�
+ function GetSettleStyleValue(obj) //杩斿洖缁撶畻鏂瑰紡
+ {
+ $("#HSSName").val(obj[0].HName);
+ $("#HSSID").val(obj[0].HItemID);
+ }
+
+ function GetSellStyleValue(obj) //杩斿洖閿�鍞柟寮�
+ {
+ $("#HSellSName").val(obj[0].HName);
+ $("#HSellSID").val(obj[0].HItemID);
+ }
+
+ //#region 鏍规嵁瀹㈡埛鑾峰彇甯佸埆銆佹眹鐜囥�佺粨绠楁柟寮忋�佸鎴蜂俊鐢ㄩ搴︺�佽仈绯讳汉銆佽仈绯荤數璇�
function getCustomerByCusID(HCusID) {
$.ajax({
url: GetWEBURL() + "/Xs_SeOrderBill/getCustomerByCusID",
@@ -1874,7 +2150,11 @@
$("#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' });
@@ -1885,6 +2165,56 @@
});
}
//#endregion
+
+ //#region 鏍规嵁瀹㈡埛鑾峰彇瀹㈡埛瀵瑰簲绋庣巼
+ function getHTaxRateByCusID(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];
+ subHTaxRate = data.HTaxRate;
+
+ } else {
+ layer.alert(result.msg, { icon: 5, btn: ['閫�鍑�'], time: 100000, offset: 't' });
+ }
+ }, error: function () {
+ layer.alert("鍙戠敓閿欒!", { icon: 5 });
+ }
+ });
+ }
+ //#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);
+ $("#HAvailableBalance").val(data.HAvailableBalance == null ? 0 : data.HAvailableBalance);
+ } else {
+ layer.alert(result.Message, { icon: 5, btn: ['閫�鍑�'], time: 100000, offset: 't' });
+ }
+ }, error: function () {
+ layer.alert("鍙戠敓閿欒!", { icon: 5 });
+ }
+ });
+ }
+ //#endregion
</script>
</body>
</html>
\ No newline at end of file
--
Gitblit v1.9.1