From 6b8a9aef84d4d4ba8dd08b911ade7cfa6cc4fa4a Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期五, 26 一月 2024 16:51:07 +0800
Subject: [PATCH] 周总结
---
WebTM/views/销售管理/销售订单/Add_Edit_Xs_SeOrderBillList.html | 665 ++++++++++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 577 insertions(+), 88 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..c3ff143 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">
@@ -96,6 +98,16 @@
</div>
<div class="layui-row">
<div class="layui-inline">
+ <label class="layui-form-label">瀹㈡埛<label style="color:red"> * </label></label>
+ <div class="layui-input-inline">
+ <input type="text" name="HCusName" id="HCusName" class="layui-input" value="" style="float: left; width: 150px; background-color: #efefef4d;">
+ <input type="hidden" name="HCusID" id="HCusID" class="layui-input" value="0" style="float:left;width:150px;">
+ <button type="button" lay-submit="" class="layui-btn" lay-filter="HCusList" style="width:40px;">
+ <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
+ </button>
+ </div>
+ </div>
+ <div class="layui-inline">
<label class="layui-form-label">閿�鍞竵鍒�<label style="color:red"> * </label></label>
<div class="layui-input-inline">
<input type="text" name="HCurName" id="HCurName" class="layui-input" value="" style="float: left; width: 150px; background-color: #efefef4d;">
@@ -109,16 +121,6 @@
<label class="layui-form-label">姹囩巼<label style="color:red"> * </label></label>
<div class="layui-input-inline">
<input class="layui-input" name="HExRate" id="HExRate" autocomplete="off" value="0" style="background-color: #efefef4d;" readonly>
- </div>
- </div>
- <div class="layui-inline" style="width:900px;">
- <label class="layui-form-label">瀹㈡埛<label style="color:red"> * </label></label>
- <div class="layui-input-inline" style="width:700px;">
- <input type="text" name="HCusName" id="HCusName" class="layui-input" value="" style="float: left; width: 465px; background-color: #efefef4d;" readonly>
- <input type="hidden" name="HCusID" id="HCusID" class="layui-input" value="0" style="float:left;width:150px;">
- <button type="button" lay-submit="" class="layui-btn" lay-filter="HCusList" style="width:40px;">
- <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
- </button>
</div>
</div>
</div>
@@ -144,27 +146,9 @@
</div>
</div>
<div class="layui-inline">
- <label class="layui-form-label">鎽樿</label>
- <div class="layui-input-inline">
- <input class="layui-input" name="HExplanation" id="HExplanation" autocomplete="off" style="width: 501px;">
- </div>
- </div>
- </div>
- <div class="layui-row">
- <div class="layui-inline">
- <label class="layui-form-label">閿�鍞富绠�</label>
- <div class="layui-input-inline">
- <input type="text" name="HManagerName" id="HManagerName" class="layui-input" value="" style="float: left; width: 150px; background-color: #efefef4d;" readonly>
- <input type="hidden" name="HManagerID" id="HManagerID" class="layui-input" value="0" style="float:left;width:150px;">
- <button type="button" lay-submit="" class="layui-btn" lay-filter="HManagerList" style="width:40px;">
- <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
- </button>
- </div>
- </div>
- <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">
@@ -173,18 +157,39 @@
<input class="layui-input" name="HLinkPhone" id="HLinkPhone" autocomplete="off" value="">
</div>
</div>
- <div class="layui-inline">
- <label class="layui-form-label">鍐呴儴璁㈠崟鍙�</label>
- <div class="layui-input-inline">
- <input class="layui-input" name="HInnerBillNo" id="HInnerBillNo" style="background-color: #efefef4d;" autocomplete="off" readonly>
- </div>
- </div>
</div>
+
<div class="layui-row">
<div class="layui-inline">
<label class="layui-form-label">澶囨敞</label>
<div class="layui-input-block">
<input class="layui-input" name="HRemark" id="HRemark" autocomplete="off" style="width: 1135px;">
+ </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>
@@ -197,21 +202,33 @@
</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>
<!--闅愯棌瀛楁锛氭殏鏃舵病鏈夌敤澶�-->
+ <div class="layui-row" style="display:none;">
+ <div class="layui-inline">
+ <label class="layui-form-label">閿�鍞富绠�</label>
+ <div class="layui-input-inline">
+ <input type="text" name="HManagerName" id="HManagerName" class="layui-input" value="" style="float: left; width: 150px; background-color: #efefef4d;" readonly>
+ <input type="hidden" name="HManagerID" id="HManagerID" class="layui-input" value="0" style="float:left;width:150px;">
+ <button type="button" lay-submit="" class="layui-btn" lay-filter="HManagerList" style="width:40px;">
+ <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
+ </button>
+ </div>
+ </div>
+ <div class="layui-inline">
+ <label class="layui-form-label">鍐呴儴璁㈠崟鍙�</label>
+ <div class="layui-input-inline">
+ <input class="layui-input" name="HInnerBillNo" id="HInnerBillNo" style="background-color: #efefef4d;" 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="HExplanation" id="HExplanation" autocomplete="off" style="width: 501px;">
+ </div>
+ </div>
+ </div>
<div class="layui-row" style="display:none;">
<div class="layui-inline">
<label class="layui-form-label">缁撶畻鏃ユ湡</label>
@@ -392,11 +409,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 +440,10 @@
//#region 鍒濆鍖栫粍缁�
Organ();
+ //#endregion
+
+ //#region 椤甸潰鍒濆鍖栧悗锛屾牴鎹鎴疯幏鍙栧鎴蜂綑棰�
+ getCustomerBalance( $("#HCusID").val() );
//#endregion
//#region 鍒楄缃細瀛愯〃1
@@ -474,6 +511,18 @@
});
//#endregion
+ //#region 瀹℃牳鎸夐挳
+ form.on('submit(set_CheckBill)', function (data) {
+ set_CheckBill(0);
+ });
+ //#endregion
+
+ //#region 鎵撳嵃鎸夐挳
+ form.on('submit(btn-print)', function (data) {
+ get_PrintReport();
+ });
+ //#endregion
+
//#region 閫�鍑烘寜閽�
form.on('submit(Exit)', function () {
if (params[1] != null) {
@@ -496,6 +545,9 @@
"HMaterID": "0",
"鐗╂枡浠g爜": "",
"鐗╂枡鍚嶇О": "",
+ "HItemID": "0",
+ "璁㈠崟绛夌骇浠g爜": "",
+ "璁㈠崟绛夌骇鍚嶇О": "",
"瑙勬牸鍨嬪彿": "",
"HUnitID": "0",
"璁¢噺鍗曚綅": "",
@@ -512,7 +564,10 @@
"HDate": Format(new Date(), 'yyyy-MM-dd'),
"HOutStockQty": "0",
"HInvoiceQty": "0",
- "HRemark": ""
+ "HRemark": "",
+ "HCusMaterNumber": "",
+ "HCusModel": "",
+ "HCusMaterName": ""
};
switch (obj.event) {
//鏂板涓�琛�
@@ -601,7 +656,13 @@
var HTaxMoney = HMoney * HTaxRate; //绋庨=閲戦*绋庣巼
var HlineTotal = HMoney + HTaxMoney; //浠风◣鍚堣=閲戦+绋庨
-
+ //璁剧疆鏁版嵁灏忔暟浣嶆暟
+ HQty = dealDoubleToFixed(HQty, 1);
+ HPrice = dealDoubleToFixed(HPrice, 3);
+ HTaxRate = HTaxRate;
+ HTaxPrice = dealDoubleToFixed(HTaxPrice, 3);
+ HMoney = dealDoubleToFixed(HMoney, 2);
+ HlineTotal = dealDoubleToFixed(HlineTotal, 2);
//鍚屾鏇存柊琛ㄦ牸鍜岀紦瀛樺搴旂殑鍊�
obj.update({
@@ -613,6 +674,8 @@
, HlineTotal: HlineTotal
});
table.render(option);
+ //璁剧疆琛ㄥご鎵�闇�閲戦
+ set_HBillMoney();
break;
case "HPrice": //鍗曚环
//鏁版嵁鏍煎紡鏍¢獙
@@ -641,7 +704,13 @@
var HTaxMoney = HMoney * HTaxRate; //绋庨=閲戦*绋庣巼
var HlineTotal = HMoney + HTaxMoney; //浠风◣鍚堣=閲戦+绋庨
-
+ //璁剧疆鏁版嵁灏忔暟浣嶆暟
+ HQty = dealDoubleToFixed(HQty, 1);
+ HPrice = dealDoubleToFixed(HPrice, 3);
+ HTaxRate = HTaxRate;
+ HTaxPrice = dealDoubleToFixed(HTaxPrice, 3);
+ HMoney = dealDoubleToFixed(HMoney, 2);
+ HlineTotal = dealDoubleToFixed(HlineTotal, 2);
//鍚屾鏇存柊琛ㄦ牸鍜岀紦瀛樺搴旂殑鍊�
obj.update({
@@ -653,18 +722,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;
}
@@ -681,7 +752,13 @@
var HTaxMoney = HMoney * HTaxRate; //绋庨=閲戦*绋庣巼
var HlineTotal = HMoney + HTaxMoney; //浠风◣鍚堣=閲戦+绋庨
-
+ //璁剧疆鏁版嵁灏忔暟浣嶆暟
+ HQty = dealDoubleToFixed(HQty, 1);
+ HPrice = dealDoubleToFixed(HPrice, 3);
+ HTaxRate = HTaxRate;
+ HTaxPrice = dealDoubleToFixed(HTaxPrice, 3);
+ HMoney = dealDoubleToFixed(HMoney, 2);
+ HlineTotal = dealDoubleToFixed(HlineTotal, 2);
//鍚屾鏇存柊琛ㄦ牸鍜岀紦瀛樺搴旂殑鍊�
obj.update({
@@ -693,11 +770,86 @@
, 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; //浠风◣鍚堣=閲戦+绋庨
+
+ //璁剧疆鏁版嵁灏忔暟浣嶆暟
+ HQty = dealDoubleToFixed(HQty, 1);
+ HPrice = dealDoubleToFixed(HPrice, 3);
+ HTaxRate = HTaxRate;
+ HTaxPrice = dealDoubleToFixed(HTaxPrice, 3);
+ HMoney = dealDoubleToFixed(HMoney, 2);
+ HlineTotal = dealDoubleToFixed(HlineTotal, 2);
+
+ //鍚屾鏇存柊琛ㄦ牸鍜岀紦瀛樺搴旂殑鍊�
+ 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
@@ -807,28 +959,33 @@
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: 'HOrderLevID', title: 'HOrderLevID', width: 100, hide: true, style: 'background-color:#efefef4d;' }
+ , { field: '璁㈠崟绛夌骇浠g爜', title: '璁㈠崟绛夌骇浠g爜', width: 150, edit: 'text', event: "HOrderLevID" }//f7
+ , { field: '璁㈠崟绛夌骇鍚嶇О', title: '璁㈠崟绛夌骇鍚嶇О', width: 150, style: 'background-color:#efefef4d;' }
+ , { field: 'HCusMaterNumber', title: '瀹㈡埛鐗╂枡缂栫爜', width: 100, edit: 'text' }
+ , { field: 'HCusModel', title: '瀹㈡埛瑙勬牸鍨嬪彿', width: 100, edit: 'text' }
+ , { field: 'HCusMaterName', title: '瀹㈡埛鐗╂枡鍚嶇О', width: 100, edit: 'text' }
, { 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, style: 'background-color:#efefef4d;' }
- , { field: 'HMoney', title: '閲戦', width: 100, style: 'background-color:#efefef4d;' }
- , { field: 'HlineTotal', title: '浠风◣鍚堣', width: 100, style: 'background-color:#efefef4d;' }
+ , { field: 'HTaxPrice', title: '鍚◣鍗曚环', width: 100, edit: 'text' }
+ , { 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' }
-
-
, { field: 'HDiscountRate', title: '鎶樻墸鐜�', width: 100, edit: 'text', hide: true }
, { field: 'HRelTaxPrice', title: '瀹為檯鍚◣鍗曚环', width: 110, hide: true }
, { field: 'HTaxMoney', title: '绋庨', width: 100, hide: true }
@@ -843,6 +1000,9 @@
"HMaterID": "0",
"鐗╂枡浠g爜": "",
"鐗╂枡鍚嶇О": "",
+ "HOrderLevID": "0",
+ "璁㈠崟绛夌骇浠g爜": "",
+ "璁㈠崟绛夌骇鍚嶇О": "",
"瑙勬牸鍨嬪彿": "",
"HUnitID": "0",
"璁¢噺鍗曚綅": "",
@@ -859,11 +1019,17 @@
"HDate": Format(new Date(),'yyyy-MM-dd'),
"HOutStockQty": "0",
"HInvoiceQty": "0",
- "HRemark": ""
+ "HRemark": "",
+ "HCusMaterNumber": "",
+ "HCusModel": "",
+ "HCusMaterName": ""
}];
option.data = rowdata;
table.render(option);
+
+ //璁剧疆琛ㄥご鎵�闇�閲戦
+ set_HBillMoney();
}
//#endregion
@@ -931,6 +1097,7 @@
, "HLinkMan": data.鑱旂郴浜�
, "HExplanation": data.鎽樿
, "HLinkPhone": data.鑱旂郴鐢佃瘽
+ , "HCreditRating_Now": data.HCreditRating_Now
, "HRemark": data.琛ㄥご澶囨敞
, "HMaker": data.鍒跺崟浜�
, "HMakeDate": data.鍒跺崟浜� == "" ? "" :formatDate(data.鍒跺崟鏃ユ湡)
@@ -948,6 +1115,8 @@
//缁勭粐鐨勫�糎OrgID鍙樺寲锛岄噸鏂版覆鏌�
HOrgIDBar = data.HOrgID;
+ //鑾峰彇绋庣巼(鐢ㄤ簬瀛愯〃绋庣巼鐨勯粯璁ゅ��)
+ getHTaxRateByCusID(data.HCusID);
//瀛愯〃 璧嬪��
var rowdata = [];
@@ -957,33 +1126,42 @@
"HMaterID": result.data[i]["HMaterID"],
"鐗╂枡浠g爜": result.data[i]["鐗╂枡浠g爜"],
"鐗╂枡鍚嶇О": result.data[i]["鐗╂枡鍚嶇О"],
+ "HOrderLevID": result.data[i]["HOrderLevID"],
+ "璁㈠崟绛夌骇浠g爜": result.data[i]["璁㈠崟绛夌骇浠g爜"],
+ "璁㈠崟绛夌骇鍚嶇О": result.data[i]["璁㈠崟绛夌骇鍚嶇О"],
"瑙勬牸鍨嬪彿": result.data[i]["瑙勬牸鍨嬪彿"],
"HUnitID": result.data[i]["HUnitID"],
"璁¢噺鍗曚綅": result.data[i]["璁¢噺鍗曚綅"],
- "HQty": result.data[i]["鏁伴噺"],
- "HPrice": result.data[i]["鍗曚环"],
- "HTaxPrice": result.data[i]["鍚◣鍗曚环"],
- "HMoney": result.data[i]["閲戦"],
+ "HQty": dealDoubleToFixed(result.data[i]["鏁伴噺"], 1),
+ "HPrice": dealDoubleToFixed(result.data[i]["鍗曚环"], 3),
+ "HTaxPrice": dealDoubleToFixed(result.data[i]["鍚◣鍗曚环"], 3),
+ "HMoney": dealDoubleToFixed(result.data[i]["閲戦"],2),
"HDiscountRate": result.data[i]["鎶樻墸鐜�"],
"HRelTaxPrice": result.data[i]["瀹為檯鍚◣鍗曚环"],
"HTaxRate": result.data[i]["绋庣巼"],
"HTaxMoney": result.data[i]["绋庨"],
- "HlineTotal": result.data[i]["浠风◣鍚堣"],
+ "HlineTotal": dealDoubleToFixed(result.data[i]["浠风◣鍚堣"], 2),
"HlineTotalBB": result.data[i]["鏈綅甯佷环绋庡悎璁�"],
"HDate": formatDate(result.data[i]["浜よ揣鏃ユ湡"]),
"HOutStockQty": result.data[i]["鍑哄簱鏁伴噺"],
"HInvoiceQty": result.data[i]["寮�绁ㄦ暟閲�"],
- "HRemark": result.data[i]["琛ㄤ綋澶囨敞"]
+ "HRemark": result.data[i]["琛ㄤ綋澶囨敞"],
+ "HCusMaterNumber": result.data[i]["瀹㈡埛鐗╂枡缂栫爜"],
+ "HCusModel": result.data[i]["瀹㈡埛瑙勬牸鍨嬪彿"],
+ "HCusMaterName": result.data[i]["瀹㈡埛鐗╂枡鍚嶇О"]
}
);
}
option.data = rowdata;
//鍑哄簱鏁伴噺銆佸紑绁ㄦ暟閲忎笉鍙紪杈�
- option.cols[0][19].edit = null;
- option.cols[0][20].edit = null;
+ option.cols[0][22].edit = null;
+ option.cols[0][23].edit = null;
table.render(option);
+
+ //璁剧疆琛ㄥご鎵�闇�閲戦
+ set_HBillMoney();
layer.close(ajaxLoad);
} else {
layer.close(ajaxLoad);
@@ -1039,6 +1217,9 @@
return layer.msg('璇烽�夋嫨鏁版嵁');
}
getCustomerByCusID(checkStatus.data[0].HItemID);
+ //鏍规嵁瀹㈡埛鑾峰彇瀹㈡埛浣欓
+ getCustomerBalance(checkStatus.data[0].HItemID);
+
layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
}
, btn2: function (index, layero) { }
@@ -1485,6 +1666,8 @@
table.cache["mainTable"].push(NewRow);
option.data = table.cache["mainTable"];
table.render(option);
+ //璁剧疆琛ㄥご鎵�闇�閲戦
+ set_HBillMoney();
//rows++;
layer.msg('澧炲姞涓�琛屾寜閽紒')
}
@@ -1506,6 +1689,8 @@
}
option.data = tables;
table.render(option);
+ //璁剧疆琛ㄥご鎵�闇�閲戦
+ set_HBillMoney();
} else {
layer.msg('璇烽�夋嫨涓�琛屾暟鎹紪杈戯紒');
}
@@ -1530,6 +1715,8 @@
option.data[option.data.length - 1].HWeight = "0";
table.render(option);//灏嗘暟鎹覆鏌撳埌琛ㄦ牸涓�
+ //璁剧疆琛ㄥご鎵�闇�閲戦
+ set_HBillMoney();
}
}
//#endregion
@@ -1554,6 +1741,8 @@
option.data[i - 1] = data[0];
option.data[i] = tables[0];
table.render(option);
+ //璁剧疆琛ㄥご鎵�闇�閲戦
+ set_HBillMoney();
break;
}
}
@@ -1585,6 +1774,8 @@
option.data[i + 1] = data[0];
option.data[i] = tables[0];
table.render(option);
+ //璁剧疆琛ㄥご鎵�闇�閲戦
+ set_HBillMoney();
break;
}
}
@@ -1610,6 +1801,8 @@
oldData.splice(obj.tr.data('index'), 1);
option.data = oldData;
table.render(option);
+ //璁剧疆琛ㄥご鎵�闇�閲戦
+ set_HBillMoney();
layer.close(index);
}
});
@@ -1623,6 +1816,8 @@
if (event.key == "F7") {
//鐗╂枡
if (obj.event == "HMaterID") {
+ var HOrgID = $("#HOrgID").val();
+
layer.open({
type: 2
, skin: "layui-layer-rim" //鍔犱笂杈规
@@ -1631,26 +1826,79 @@
, shift: 2 //寮瑰嚭鍔ㄧ敾
, area: ["90%", "90%"] //绐椾綋澶у皬
, maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀�
- , content: ['../../Baseset/鍩虹璧勬枡/Gy_MaterialList.html', 'yes']
+ , content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_Material.html?openType=2&HOrgID=' + HOrgID, '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": "", "HCusMaterNumber": "",
+ "HCusModel": "","HCusMaterName": ""
+ }
+ 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);//鍏抽棴寮圭獥
}
})
@@ -1684,6 +1932,37 @@
}
})
}
+ //璁㈠崟绛夌骇
+ if (obj.event == "HOrderLevID") {
+ layer.open({
+ type: 2
+ , skin: "layui-layer-rim" //鍔犱笂杈规
+ , title: "璁㈠崟绛夌骇鍒楄〃" //鏍囬
+ , closeBtn: 1 //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡
+ , shift: 2 //寮瑰嚭鍔ㄧ敾
+ , area: ["90%", "90%"] //绐椾綋澶у皬
+ , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀�
+ , content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_OrderLev.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("璇烽�夋嫨涓�鏉℃暟鎹�");
+ }
+ //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
+ obj.update({
+ "璁㈠崟绛夌骇鍚嶇О": checkStatus.data[0].璁㈠崟绛夌骇
+ , "璁㈠崟绛夌骇浠g爜": checkStatus.data[0].璁㈠崟绛夌骇浠g爜
+ , "HOrderLevID": checkStatus.data[0].HItemID
+ })
+ layer.close(index);//鍏抽棴寮圭獥
+ }
+ })
+ }
+
obj.event = "";
return false;
}
@@ -1819,15 +2098,120 @@
}
//#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() {
+ //#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",
+ 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
+
+ //#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
//浠ヤ笂鏄痩ayui妯″潡
});
+ //瀛愯〃绋庣巼锛屾牴鎹鎴峰甫鍑�
+ var subHTaxRate = 0;
+
// 鍩虹璧勬枡杩斿洖鏁版嵁
function GetHEmpValue(obj) //杩斿洖涓氬姟鍛�
{
@@ -1839,7 +2223,10 @@
{
//$("#HCusName").val(obj[0].HName);
//$("#HCusID").val(obj[0].HItemID);
+ //鏍规嵁瀹㈡埛鑾峰彇鐩稿叧淇℃伅
getCustomerByCusID(obj[0].HItemID);
+ //鏍规嵁瀹㈡埛鑾峰彇瀹㈡埛浣欓
+ getCustomerBalance(obj[0].HItemID);
}
function GetHManagerValue(obj) //杩斿洖涓荤
@@ -1854,7 +2241,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 +2273,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 +2288,92 @@
});
}
//#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
+
+ //#region 澶勭悊灏忔暟鏄剧ず浣嶆暟锛坉ata锛氶渶瑕佸鐞嗙殑鏁版嵁锛沶um锛氭暟鎹殑绫诲瀷(濡�1:鏁伴噺锛�2:閲戦锛�3:鍗曚环)锛�
+ function dealDoubleToFixed(data, num) {
+ //鐢ㄤ簬璁剧疆灏忔暟浣嶆暟
+ var dotLength = 0;
+
+ if (num == 1) { //褰撴暟鎹负鏁伴噺鏃讹紝鏈�澶氫繚鐣�6浣嶅皬鏁�
+ //璁剧疆鏈�澶氫繚鐣�6浣嶅皬鏁�
+ dotLength = 6;
+ } else if (num == 2) { //褰撴暟鎹负閲戦鏃讹紝鏈�澶氫繚鐣�2浣嶅皬鏁�
+ //璁剧疆鏈�澶氫繚鐣�2浣嶅皬鏁�
+ dotLength = 2;
+ } else if (num == 3) { //褰撴暟鎹负鍗曚环鏃讹紝鏈�澶氫繚鐣�4浣嶅皬鏁�
+ //璁剧疆鏈�澶氫繚鐣�4浣嶅皬鏁�
+ dotLength = 4;
+ }
+
+ //鍒ゆ柇鏄惁瀛樺湪灏忔暟鐐瑰強鍏剁储寮曚綅缃�
+ data = data + "";
+ var index = data.indexOf(".");
+
+ //澶勭悊鏁版嵁骞惰繑鍥�
+ if (index < 0) {
+ return data * 1;
+ } else {
+ //鑾峰彇灏忔暟浣嶆暟
+ var length = data.length - index - 1;
+ if (length <= dotLength) {
+ return data * 1;
+ } else {
+ data = data * 1;
+ return data.toFixed(dotLength);
+ }
+ }
+ }
+ //#endregion
</script>
</body>
</html>
\ No newline at end of file
--
Gitblit v1.9.1