From d74fbf091b642604a2ad74668ffd8a5cfafaefa2 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期四, 12 九月 2024 10:04:52 +0800
Subject: [PATCH] 子表基础资料文本框输入后自动检索:弹窗选择选中的数据时,滚动条滚动
---
WebTM/views/销售管理/销售订单/Add_Edit_Xs_SeOrderBillList.html | 520 ++++++++++++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 452 insertions(+), 68 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 f857192..f8dbfd1 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"
@@ -224,7 +224,7 @@
</div>
</div>
</div>
- <div class="layui-row">
+ <div class="layui-row" style="display:none;">
<div class="layui-inline">
<label class="layui-form-label">椤圭洰浠g爜</label>
<div class="layui-input-inline">
@@ -413,6 +413,8 @@
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Up"><i class="layui-icon layui-icon-form"></i>涓婄Щ</button>
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Under"><i class="layui-icon layui-icon-form"></i>涓嬬Щ</button>
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-batchDelete"><i class="layui-icon layui-icon-form"></i>鎵归噺鍒犻櫎</button>
+ <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Inventory" id="get_Inventory"><i class="layui-icon layui-icon-form"></i>搴撳瓨鏌ヨ</button>
+ <button type="button" class="layui-btn layui-btn-sm" lay-event="get_InOutSum" id="get_InOutSum"><i class="layui-icon layui-icon-form"></i>鍑哄叆搴撹褰曟煡璇�</button>
<button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn"><i class="layui-icon layui-icon-form"></i>鍒楄缃�</button>
</div>
</script>
@@ -456,6 +458,8 @@
//瀛愯〃娓叉煋鍙傛暟
window.option = {};
+ var titleData = ["HMaterID", "HUnitID", "鎶樻墸鐜�", "瀹為檯鍚◣鍗曚环", "绋庨", "鏈綅甯佷环绋庡悎璁�", "鍑哄簱鏁伴噺", "寮�绁ㄦ暟閲�", "HOrderLevID", "璁㈠崟绛夌骇浠g爜", "閿�鍞嚭搴撴暟閲�", "閿�鍞嚭搴撳鏍告暟閲�", "閿�鍞嚭搴撳鏍搁噾棰�", "鐢熶骇鏁伴噺", "閿�鍞��搴撴暟閲�", "閿�鍞��搴撳鏍告暟閲�"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
+
//璁板綍缁勭粐鐨勫��
var HOrgIDBar = 0;
@@ -476,7 +480,8 @@
//#region 杩涘叆椤甸潰鍗冲姞杞�
-
+ //妫�娴嬫槸鍚﹀叿澶囨煡鐪嬮噾棰濇潈闄愶紝璁剧疆闅愯棌鍒�
+ checkRight_Money();
//#region 鍒ゆ柇鏄惁鐧诲綍 鏈櫥褰曞垯璺冲埌鐧诲綍椤�
get_LoginIs();
@@ -498,14 +503,7 @@
set_InitGrid();
//鍔犺浇琛ㄤ綋鍜岃〃浣撴暟鎹�
RoadBillMain(linterid);
- //鏍规嵁閿�鍞鍗曠被鍨嬭缃瓙琛ㄦ槸鍚﹀彇搴撳瓨閫夐」
- setHisStockGoodsByHBillSubType_For_RoadBillMain();
-
- //鏍规嵁鏄惁鍙栧簱瀛樿幏鍙栧畾閲戞瘮渚�
- setHEarnestRateByHisStockGoods();
-
- //璁剧疆琛ㄥご鎵�闇�閲戦
- set_HBillMoney($("#HEarnestRate").val() * 1);
+
//鐢熸垚骞惰缃富琛ㄧ殑鍐呯爜鍜屽崟鎹彿
createBillNo();
@@ -523,14 +521,6 @@
set_InitGrid();
//鍔犺浇琛ㄤ綋鍜岃〃浣撴暟鎹�
RoadBillMain(linterid);
- //鏍规嵁閿�鍞鍗曠被鍨嬭缃瓙琛ㄦ槸鍚﹀彇搴撳瓨閫夐」
- setHisStockGoodsByHBillSubType_For_RoadBillMain();
-
- //鏍规嵁鏄惁鍙栧簱瀛樿幏鍙栧畾閲戞瘮渚�
- setHEarnestRateByHisStockGoods();
-
- //璁剧疆琛ㄥご鎵�闇�閲戦
- set_HBillMoney($("#HEarnestRate").val() * 1);
}
//#endregion
@@ -543,7 +533,7 @@
//#endregion
//#region 鍒楄缃細瀛愯〃1
- //DisPlay_HideColumn();
+ DisPlay_HideColumn();
//#endregion
//#endregion
@@ -719,6 +709,12 @@
case 'set_HideColumn':
get_HideColumn();
break;
+ //搴撳瓨鏌ヨ
+ case 'get_Inventory': get_Inventory();
+ break;
+ //鍑哄叆搴撹褰曟煡璇�
+ case 'get_InOutSum': get_InOutSum();
+ break;
}
});
//#endregion
@@ -751,7 +747,10 @@
//鏁板�兼牸寮忔牎楠屽伐鍏�
var ref = /^\d+(\.\d+)?$/; //闈炶礋鏁版鍒欒〃杈惧紡
var temp = "";
-
+ var Dec = getDecByMaterID(obj.data.HMaterID) //鑾峰彇绮惧害
+ var HQtyDec = (Dec["HQtyDec"] == null || Dec["HQtyDec"] == 0) ? 4 : Dec["HQtyDec"]; //鏁伴噺绮惧害
+ var HPriceDec = (Dec["HPriceDec"] == null || Dec["HPriceDec"] == 0) ? 4 : Dec["HPriceDec"]; //鍗曚环绮惧害
+ var HMoneyDec = (Dec["HMoneyDec"] == null || Dec["HMoneyDec"] == 0) ? 2 : Dec["HMoneyDec"]; //閲戦绮惧害
// 鍗曞厓鏍肩紪杈戜箣鍓嶇殑鍊�
var oldText = $(this).prev().text();
var value = obj.value //寰楀埌淇敼鍚庣殑鍊�
@@ -790,13 +789,12 @@
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);
+ //鏁板瓧绮惧害
+ HQty = Number(HQty.toFixed(HQtyDec));
+ HPrice = Number(HPrice.toFixed(HPriceDec));
+ HMoney = Number(HMoney.toFixed(HMoneyDec));
+ HlineTotal = Number(HlineTotal.toFixed(HMoneyDec));
+ HTaxPrice = Number(HPrice.toFixed(HPriceDec));
//鍚屾鏇存柊琛ㄦ牸鍜岀紦瀛樺搴旂殑鍊�
obj.update({
@@ -807,7 +805,7 @@
, HMoney: HMoney
, HlineTotal: HlineTotal
});
- //table.render(option);
+ table.render(option);
//鍒锋柊琛ㄦ牸鍚屾椂鏍规嵁option涓璈isStockGoods鍊艰缃笅鎷夊垪琛�
setSelectHisStockGoodsByTableRender();
@@ -874,13 +872,12 @@
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);
+ //鏁板瓧绮惧害
+ HQty = Number(HQty.toFixed(HQtyDec));
+ HPrice = Number(HPrice.toFixed(HPriceDec));
+ HMoney = Number(HMoney.toFixed(HMoneyDec));
+ HlineTotal = Number(HlineTotal.toFixed(HMoneyDec));
+ HTaxPrice = Number(HTaxPrice.toFixed(HPriceDec));
//鍚屾鏇存柊琛ㄦ牸鍜岀紦瀛樺搴旂殑鍊�
obj.update({
@@ -891,7 +888,7 @@
, HMoney: HMoney
, HlineTotal: HlineTotal
});
- //table.render(option);
+ table.render(option);
//鍒锋柊琛ㄦ牸鍚屾椂鏍规嵁option涓璈isStockGoods鍊艰缃笅鎷夊垪琛�
setSelectHisStockGoodsByTableRender();
@@ -929,13 +926,12 @@
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);
+ //鏁板瓧绮惧害
+ HQty = Number(HQty.toFixed(HQtyDec));
+ HPrice = Number(HPrice.toFixed(HPriceDec));
+ HMoney = Number(HMoney.toFixed(HMoneyDec));
+ HlineTotal = Number(HlineTotal.toFixed(HMoneyDec));
+ HTaxPrice = Number(HTaxPrice.toFixed(HPriceDec));
//鍚屾鏇存柊琛ㄦ牸鍜岀紦瀛樺搴旂殑鍊�
obj.update({
@@ -946,7 +942,7 @@
, HMoney: HMoney
, HlineTotal: HlineTotal
});
- //table.render(option);
+ table.render(option);
//鍒锋柊琛ㄦ牸鍚屾椂鏍规嵁option涓璈isStockGoods鍊艰缃笅鎷夊垪琛�
setSelectHisStockGoodsByTableRender();
@@ -1014,13 +1010,12 @@
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);
+ //鏁板瓧绮惧害
+ HQty = Number(HQty.toFixed(HQtyDec));
+ HPrice = Number(HPrice.toFixed(HPriceDec));
+ HMoney = Number(HMoney.toFixed(HMoneyDec));
+ HlineTotal = Number(HlineTotal.toFixed(HMoneyDec));
+ HTaxPrice = Number(HTaxPrice.toFixed(HPriceDec));
//鍚屾鏇存柊琛ㄦ牸鍜岀紦瀛樺搴旂殑鍊�
obj.update({
@@ -1031,7 +1026,7 @@
, HMoney: HMoney
, HlineTotal: HlineTotal
});
- //table.render(option);
+ table.render(option);
//鍒锋柊琛ㄦ牸鍚屾椂鏍规嵁option涓璈isStockGoods鍊艰缃笅鎷夊垪琛�
setSelectHisStockGoodsByTableRender();
@@ -1244,8 +1239,8 @@
, { 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;', edit: 'text', event:"HUnitID" }//f7
- , { field: 'HRemark_TL', title: '鎶曟枡', width: 100, edit: 'text' }
- , { field: 'HRemark_SJG', title: '娣卞姞宸�', width: 100, edit: 'text' }
+ , { field: 'HRemark_TL', title: '鎶曟枡', width: 100, edit: 'text', event: "HRemark_TL" }
+ , { field: 'HRemark_SJG', title: '娣卞姞宸�', width: 100, edit: 'text', event: "HRemark_SJG" }
, { field: 'HWHID ', title: 'HWHID ', width: 100, hide: true }
, { field: '浠撳簱', title: '浠撳簱', width: 100, style: 'background-color:#efefef4d;' ,edit: 'text' ,event: "HWHID" }//f7
, { field: 'HisStockGoods', title: '鏄惁鍙栧簱瀛�', width: 120, templet: '#HisStockGoods' }
@@ -1484,20 +1479,18 @@
}
option.data = rowdata;
- //鍑哄簱鏁伴噺銆佸紑绁ㄦ暟閲忎笉鍙紪杈�
- //option.cols[0][22].edit = null;
- //option.cols[0][23].edit = null;
-
table.render(option);
//鑾峰彇涓存椂瀹氶噾姣斾緥
- HEarnestRateTemp = data.瀹氶噾姣斾緥 + "" == "0" ? "50" : data.瀹氶噾姣斾緥 + "";
+ HEarnestRateTemp = data.瀹氶噾姣斾緥;
- //鍒锋柊琛ㄦ牸鍚屾椂鏍规嵁option涓璈isStockGoods鍊艰缃笅鎷夊垪琛�
- setSelectHisStockGoodsByTableRender();
+ //鏍规嵁閿�鍞鍗曠被鍨嬭缃瓙琛ㄦ槸鍚﹀彇搴撳瓨閫夐」
+ setHisStockGoodsByHBillSubType_For_RoadBillMain();
//鏍规嵁鏄惁鍙栧簱瀛樿幏鍙栧畾閲戞瘮渚�
setHEarnestRateByHisStockGoods();
+
+ $("#HEarnestRate").val(data.瀹氶噾姣斾緥);
//璁剧疆琛ㄥご鎵�闇�閲戦
set_HBillMoney($("#HEarnestRate").val() * 1);
@@ -1549,6 +1542,7 @@
//#endregion
//#region 瀹㈡埛閫夋嫨椤甸潰
+ //#region 瀹㈡埛閫夋嫨椤甸潰
function get_checkCus() {
var HEmpID = $("#HEmpID").val();
layer.open({
@@ -1557,7 +1551,7 @@
, area: ['90%', '90%']//澶у皬
, title: '瀹㈡埛鍒楄〃'//鏍囬
, shift: 2//寮瑰嚭鍔ㄧ敾
- , content: ['../../鍩虹璧勬枡/閿�鍞熀纭�璧勬枡/Gy_Customer.html', 'yes']
+ , content: ['../../Baseset/鍩虹璧勬枡/Gy_CustomerList.html', 'yes']
, btn: ['纭畾', '鍙栨秷']
, btn1: function (index, layero) {//鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
var iframeWindow = window['layui-layer-iframe' + index] //鑾峰彇寮规椤甸潰
@@ -1574,6 +1568,35 @@
, btn2: function (index, layero) { }
})
}
+ //#endregion
+
+ //#region 瀹㈡埛閫夋嫨椤甸潰-鍩虹璧勬枡
+ //function get_checkCus() {
+ // var HEmpID = $("#HEmpID").val();
+ // layer.open({
+ // type: 2//寮圭獥绫诲瀷
+ // , skin: 'layui-layer-rim' //鍔犱笂杈规
+ // , area: ['90%', '90%']//澶у皬
+ // , title: '瀹㈡埛鍒楄〃'//鏍囬
+ // , shift: 2//寮瑰嚭鍔ㄧ敾
+ // , content: ['../../鍩虹璧勬枡/閿�鍞熀纭�璧勬枡/Gy_Customer.html', 'yes']
+ // , btn: ['纭畾', '鍙栨秷']
+ // , btn1: function (index, layero) {//鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
+ // var iframeWindow = window['layui-layer-iframe' + index] //鑾峰彇寮规椤甸潰
+ // var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//鑾峰彇table鐨別lem:"#test"
+ // if (checkStatus.data.length === 0) {
+ // return layer.msg('璇烽�夋嫨鏁版嵁');
+ // }
+ // getCustomerByCusID(checkStatus.data[0].HItemID);
+ // //鏍规嵁瀹㈡埛鑾峰彇瀹㈡埛浣欓
+ // getCustomerBalance(checkStatus.data[0].HItemID);
+
+ // layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+ // }
+ // , btn2: function (index, layero) { }
+ // })
+ //}
+ //#endregion
//#endregion
//#region 缁撶畻鏂归�夋嫨椤甸潰
@@ -1843,6 +1866,11 @@
success: function (data) {
if (data.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
layer.msg(data.Message, { icon: 1 });
+ if (data.Verify == "Y") //鑷姩瀹℃牳
+ {
+ $("#HInterID").val(data.HInterID);//鑾峰彇鎻愪氦鎴愬姛杩斿洖鐨勫崟鎹富ID
+ set_CheckBill(0); //瀹℃牳
+ }
$('#add-btn').addClass("layui-btn-disabled").attr("disabled", true);
layer.close(index);
}
@@ -2554,13 +2582,17 @@
var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//鑾峰彇閫変腑鐨勬暟鎹�
var rowIndex = $(obj.tr).attr("data-index") * 1;
+ var Dec = getDecByMaterID(obj.data.HMaterID) //鑾峰彇绮惧害
+ var HQtyDec = (Dec["HQtyDec"] == null || Dec["HQtyDec"] == 0) ? 4 : Dec["HQtyDec"]; //鏁伴噺绮惧害
+ var HPriceDec = (Dec["HPriceDec"] == null || Dec["HPriceDec"] == 0) ? 4 : Dec["HPriceDec"]; //鍗曚环绮惧害
+ var HMoneyDec = (Dec["HMoneyDec"] == null || Dec["HMoneyDec"] == 0) ? 2 : Dec["HMoneyDec"]; //閲戦绮惧害
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": ""
+ "HCusModel": "", "HCusMaterName": ""
}
btnAddLine(NewRow);
}
@@ -2583,8 +2615,8 @@
}
//鏁版嵁鏍¢獙鍚堟牸锛岄噸绠楄褰�
- var HQty = option.data[rowIndex + i].HQty; //鏁伴噺
- var HPrice = option.data[rowIndex + i].HPrice; //鍗曚环
+ var HQty = option.data[rowIndex + i].HQty * 1; //鏁伴噺
+ var HPrice = option.data[rowIndex + i].HPrice * 1; //鍗曚环
var HTaxRate = value * 0.01; //绋庣巼
/*var HDiscountRate = obj.data.HDiscountRate * 1; //鎶樻墸鐜�*/
var HTaxPrice = HPrice * (1 + HTaxRate); //鍚◣鍗曚环=鍗曚环*(1+绋庣巼)
@@ -2593,7 +2625,13 @@
var HMoney = HQty * HPrice; //閲戦=鏁伴噺*鍗曚环
var HTaxMoney = HMoney * HTaxRate; //绋庨=閲戦*绋庣巼
var HlineTotal = HMoney + HTaxMoney; //浠风◣鍚堣=閲戦+绋庨
-
+ //鏁板瓧绮惧害
+ HQty = Number(HQty.toFixed(HQtyDec));
+ HPrice = Number(HPrice.toFixed(HPriceDec));
+ HMoney = Number(HMoney.toFixed(HMoneyDec));
+ HTaxMoney = Number(HTaxMoney.toFixed(HMoneyDec));
+ HlineTotal = Number(HlineTotal.toFixed(HMoneyDec));
+ HTaxPrice = Number(HTaxPrice.toFixed(HPriceDec));
option.data[rowIndex + i].HMaterID = resultData.HItemID;
option.data[rowIndex + i].鐗╂枡浠g爜 = resultData.鐗╂枡浠g爜;
@@ -2623,6 +2661,42 @@
}
, end: function () {
if (typeof (HDataEmp.HItemID) != "undefined") {
+ var value = subHTaxRate;
+ //鏁板�兼牸寮忔牎楠屽伐鍏�
+ var ref = /^\d+(\.\d+)?$/;
+ //绋庣巼鏁版嵁鏍煎紡鏍¢獙锛岃嫢鏍规嵁瀹㈡埛鑾峰彇鐨勭◣鐜囦笉鍚堟硶锛屽垯浣跨敤璁板綍涓師鏈夌殑绋庣巼锛屽苟鎻愮ず
+ temp = value + "";
+ if (ref.test(temp)) {
+ var Dec = getDecByMaterID(obj.data.HMaterID) //鑾峰彇绮惧害
+ var HQtyDec = (Dec["HQtyDec"] == null || Dec["HQtyDec"] == 0) ? 4 : Dec["HQtyDec"]; //鏁伴噺绮惧害
+ var HPriceDec = (Dec["HPriceDec"] == null || Dec["HPriceDec"] == 0) ? 4 : Dec["HPriceDec"]; //鍗曚环绮惧害
+ var HMoneyDec = (Dec["HMoneyDec"] == null || Dec["HMoneyDec"] == 0) ? 2 : Dec["HMoneyDec"]; //閲戦绮惧害
+ //鏁版嵁鏍¢獙鍚堟牸锛岄噸绠楄褰�
+ var HQty = obj.data.HQty * 1; //鏁伴噺
+ var HPrice = obj.data.HPrice * 1; //鍗曚环
+ var HTaxRate = value * 0.01; //绋庣巼
+ var HTaxPrice = HPrice * (1 + HTaxRate); //鍚◣鍗曚环=鍗曚环*(1+绋庣巼)
+ var HMoney = HQty * HPrice; //閲戦=鏁伴噺*鍗曚环
+ var HTaxMoney = HMoney * HTaxRate; //绋庨=閲戦*绋庣巼
+ var HlineTotal = HMoney + HTaxMoney; //浠风◣鍚堣=閲戦+绋庨
+
+ //鏁板瓧绮惧害
+ HQty = Number(HQty.toFixed(HQtyDec));
+ HPrice = Number(HPrice.toFixed(HPriceDec));
+ HMoney = Number(HMoney.toFixed(HMoneyDec));
+ HlineTotal = Number(HlineTotal.toFixed(HMoneyDec));
+ HTaxPrice = Number(HPrice.toFixed(HPriceDec));
+
+ //鍚屾鏇存柊琛ㄦ牸鍜岀紦瀛樺搴旂殑鍊�
+ obj.update({
+ HQty: HQty
+ , HPrice: HPrice
+ , HTaxRate: HTaxRate * 100
+ , HTaxPrice: HTaxPrice
+ , HMoney: HMoney
+ , HlineTotal: HlineTotal
+ });
+ }
//鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
obj.update({
"HMaterID": HDataEmp.HItemID
@@ -3079,14 +3153,254 @@
set_HBillMoney($("#HEarnestRate").val() * 1);
}
+ //鎶曟枡
+ if (obj.event == "HRemark_TL") {
+ var oldText = table.cache["mainTable"][rowIndex].HRemark_TL;
+ var value = e.target.value; //寰楀埌淇敼鍚庣殑鍊�
+
+ //鏁版嵁鏍¢獙鍚堟牸锛岄噸绠楄褰�
+ for (var i = rowIndex * 1; i < option.data.length; i++) {
+ option.data[i].HRemark_TL = value;
+ }
+
+ table.render(option);
+
+ //鍒锋柊琛ㄦ牸鍚屾椂鏍规嵁option涓璈isStockGoods鍊艰缃笅鎷夊垪琛�
+ setSelectHisStockGoodsByTableRender();
+
+ //璁剧疆琛ㄥご鎵�闇�閲戦
+ set_HBillMoney($("#HEarnestRate").val() * 1);
+ }
+
+ //娣卞姞宸�
+ if (obj.event == "HRemark_SJG") {
+ var oldText = table.cache["mainTable"][rowIndex].HRemark_SJG;
+ var value = e.target.value; //寰楀埌淇敼鍚庣殑鍊�
+
+ //鏁版嵁鏍¢獙鍚堟牸锛岄噸绠楄褰�
+ for (var i = rowIndex * 1; i < option.data.length; i++) {
+ option.data[i].HRemark_SJG = value;
+ }
+
+ table.render(option);
+
+ //鍒锋柊琛ㄦ牸鍚屾椂鏍规嵁option涓璈isStockGoods鍊艰缃笅鎷夊垪琛�
+ setSelectHisStockGoodsByTableRender();
+
+ //璁剧疆琛ㄥご鎵�闇�閲戦
+ set_HBillMoney($("#HEarnestRate").val() * 1);
+ }
+
+
obj.event = "";
return false;
}
//#endregion
})
+
+ //鍙屽嚮
+ $('.layui-table-box tbody td[data-field="鐗╂枡浠g爜"]').off('dblclick').on('dblclick', function () {
+ var HOrgID = $("#HOrgID").val();
+
+ layer.open({
+ type: 2
+ , skin: "layui-layer-rim" //鍔犱笂杈规
+ , title: "鐗╂枡鍒楄〃" //鏍囬
+ , closeBtn: 1 //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡
+ , shift: 2 //寮瑰嚭鍔ㄧ敾
+ , area: ["90%", "90%"] //绐椾綋澶у皬
+ , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀�
+ , 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");//鑾峰彇閫変腑鐨勬暟鎹�
+
+ var rowIndex = $(obj.tr).attr("data-index") * 1;
+ var Dec = getDecByMaterID(obj.data.HMaterID) //鑾峰彇绮惧害
+ var HQtyDec = (Dec["HQtyDec"] == null || Dec["HQtyDec"] == 0) ? 4 : Dec["HQtyDec"]; //鏁伴噺绮惧害
+ var HPriceDec = (Dec["HPriceDec"] == null || Dec["HPriceDec"] == 0) ? 4 : Dec["HPriceDec"]; //鍗曚环绮惧害
+ var HMoneyDec = (Dec["HMoneyDec"] == null || Dec["HMoneyDec"] == 0) ? 2 : Dec["HMoneyDec"]; //閲戦绮惧害
+ 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 * 1; //鏁伴噺
+ var HPrice = option.data[rowIndex + i].HPrice * 1; //鍗曚环
+ 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; //浠风◣鍚堣=閲戦+绋庨
+ //鏁板瓧绮惧害
+ HQty = Number(HQty.toFixed(HQtyDec));
+ HPrice = Number(HPrice.toFixed(HPriceDec));
+ HMoney = Number(HMoney.toFixed(HMoneyDec));
+ HTaxMoney = Number(HTaxMoney.toFixed(HMoneyDec));
+ HlineTotal = Number(HlineTotal.toFixed(HMoneyDec));
+ HTaxPrice = Number(HTaxPrice.toFixed(HPriceDec));
+
+ 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);
+
+ //鍒锋柊琛ㄦ牸鍚屾椂鏍规嵁option涓璈isStockGoods鍊艰缃笅鎷夊垪琛�
+ setSelectHisStockGoodsByTableRender();
+
+ //璁剧疆琛ㄥご鎵�闇�閲戦
+ set_HBillMoney($("#HEarnestRate").val() * 1);
+
+ layer.close(index);//鍏抽棴寮圭獥
+ }
+ , end: function () {
+ if (typeof (HDataEmp.HItemID) != "undefined") {
+ var value = subHTaxRate;
+ //鏁板�兼牸寮忔牎楠屽伐鍏�
+ var ref = /^\d+(\.\d+)?$/;
+ //绋庣巼鏁版嵁鏍煎紡鏍¢獙锛岃嫢鏍规嵁瀹㈡埛鑾峰彇鐨勭◣鐜囦笉鍚堟硶锛屽垯浣跨敤璁板綍涓師鏈夌殑绋庣巼锛屽苟鎻愮ず
+ temp = value + "";
+ if (ref.test(temp)) {
+ var Dec = getDecByMaterID(obj.data.HMaterID) //鑾峰彇绮惧害
+ var HQtyDec = (Dec["HQtyDec"] == null || Dec["HQtyDec"] == 0) ? 4 : Dec["HQtyDec"]; //鏁伴噺绮惧害
+ var HPriceDec = (Dec["HPriceDec"] == null || Dec["HPriceDec"] == 0) ? 4 : Dec["HPriceDec"]; //鍗曚环绮惧害
+ var HMoneyDec = (Dec["HMoneyDec"] == null || Dec["HMoneyDec"] == 0) ? 2 : Dec["HMoneyDec"]; //閲戦绮惧害
+ //鏁版嵁鏍¢獙鍚堟牸锛岄噸绠楄褰�
+ var HQty = obj.data.HQty * 1; //鏁伴噺
+ var HPrice = obj.data.HPrice * 1; //鍗曚环
+ var HTaxRate = value * 0.01; //绋庣巼
+ var HTaxPrice = HPrice * (1 + HTaxRate); //鍚◣鍗曚环=鍗曚环*(1+绋庣巼)
+ var HMoney = HQty * HPrice; //閲戦=鏁伴噺*鍗曚环
+ var HTaxMoney = HMoney * HTaxRate; //绋庨=閲戦*绋庣巼
+ var HlineTotal = HMoney + HTaxMoney; //浠风◣鍚堣=閲戦+绋庨
+
+ //鏁板瓧绮惧害
+ HQty = Number(HQty.toFixed(HQtyDec));
+ HPrice = Number(HPrice.toFixed(HPriceDec));
+ HMoney = Number(HMoney.toFixed(HMoneyDec));
+ HlineTotal = Number(HlineTotal.toFixed(HMoneyDec));
+ HTaxPrice = Number(HPrice.toFixed(HPriceDec));
+
+ //鍚屾鏇存柊琛ㄦ牸鍜岀紦瀛樺搴旂殑鍊�
+ obj.update({
+ HQty: HQty
+ , HPrice: HPrice
+ , HTaxRate: HTaxRate * 100
+ , HTaxPrice: HTaxPrice
+ , HMoney: HMoney
+ , HlineTotal: HlineTotal
+ });
+ }
+ //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
+ obj.update({
+ "HMaterID": HDataEmp.HItemID
+ , "鐗╂枡浠g爜": HDataEmp.鐗╂枡浠g爜
+ , "鐗╂枡鍚嶇О": HDataEmp.鐗╂枡鍚嶇О
+ , "瑙勬牸鍨嬪彿": HDataEmp.瑙勬牸鍨嬪彿
+ , "HUnitID": HDataEmp.HUnitID
+ , "璁¢噺鍗曚綅": HDataEmp.璁¢噺鍗曚綅鍚嶇О
+ })
+ HDataEmp = {};
+ }
+ }
+ })
+ });
}
//#endregion
+
+ //#region 搴撳瓨鏌ヨ
+ function get_Inventory() {
+ var checkStatus = table.checkStatus('mainTable')
+ , data = checkStatus.data;
+ if (checkStatus.data.length === 1 && data[0].HMaterID != 0) {
+ var HMaterID = data[0].HMaterID.toString();
+ //寮圭獥鏂规硶
+ layer.open({
+ type: 2//寮圭獥绫诲瀷
+ , skin: 'layui-layer-rim' //鍔犱笂杈规
+ , area: ['90%', '90%']//澶у皬
+ , title: '搴撳瓨鏌ヨ鍒楄〃'//鏍囬
+ , shift: 2//寮瑰嚭鍔ㄧ敾
+ , content: ['../../浠撳瓨绠$悊/鏉$爜鎶ヨ〃/Kf_ICinventoryQueryReport.html?Type=1&HMaterID=' + HMaterID, 'yes']
+ , btn: ['鍙栨秷']
+ , btn1: function (index, layero) {
+ layer.close(index);
+ }
+ })
+ }
+ else {
+ layer.msg('璇烽�夋嫨涓�琛屾湁鐗╂枡鏁版嵁鏌ヨ锛�');
+ }
+ }
+ //#endregion
+ //#region 鍑哄叆搴撹褰曟煡璇�
+ function get_InOutSum() {
+ var checkStatus = table.checkStatus('mainTable')
+ , data = checkStatus.data;
+ if (checkStatus.data.length === 1 && data[0].HMaterID != 0) {
+ var HMaterID = data[0].HMaterID.toString();
+ layer.open({
+ type: 2//寮圭獥绫诲瀷
+ , skin: 'layui-layer-rim' //鍔犱笂杈规
+ , area: ['90%', '90%']//澶у皬
+ , title: '鍑哄叆搴撹褰曞垪琛�'//鏍囬
+ , shift: 2//寮瑰嚭鍔ㄧ敾
+ , content: ['../../浠撳瓨绠$悊/鏉$爜鎶ヨ〃/Kf_StockInOutSumQueryReport.html?Type=1&HMaterID=' + HMaterID, 'yes']
+ , btn: ['鍙栨秷']
+ , btn1: function (index, layero) {
+ layer.close(index);
+ }
+ })
+ }
+ else {
+ layer.msg('璇烽�夋嫨涓�琛屾湁鐗╂枡鏁版嵁鏌ヨ锛�');
+ }
+ }
+ //#endregion
+
//#region 瀛愯〃1锛氶殣钘忓垪璁剧疆
function get_HideColumn() {
@@ -3127,13 +3441,14 @@
function DisPlay_HideColumn() {
$.ajax({
url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList',
+ async: false,
type: "GET",
data: { "HModName": HModName, "user": sessionStorage["HUserName"] },
async: false,
success: function (data1) {
if (data1.data.length != 0) {
var dataCol = [];//鏁版嵁搴撴煡璇㈠嚭鐨勫垪鏁版嵁
- var titleData = ["HMaterID", "HUnitID", "鎶樻墸鐜�", "瀹為檯鍚◣鍗曚环", "绋庨", "鏈綅甯佷环绋庡悎璁�", "鍑哄簱鏁伴噺", "寮�绁ㄦ暟閲�", "HOrderLevID","璁㈠崟绛夌骇浠g爜","閿�鍞嚭搴撴暟閲�","閿�鍞嚭搴撳鏍告暟閲�","閿�鍞嚭搴撳鏍搁噾棰�","鐢熶骇鏁伴噺","閿�鍞��搴撴暟閲�","閿�鍞��搴撳鏍告暟閲�"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
+ /*var titleData = ["HMaterID", "HUnitID", "鎶樻墸鐜�", "瀹為檯鍚◣鍗曚环", "绋庨", "鏈綅甯佷环绋庡悎璁�", "鍑哄簱鏁伴噺", "寮�绁ㄦ暟閲�", "HOrderLevID","璁㈠崟绛夌骇浠g爜","閿�鍞嚭搴撴暟閲�","閿�鍞嚭搴撳鏍告暟閲�","閿�鍞嚭搴撳鏍搁噾棰�","鐢熶骇鏁伴噺","閿�鍞��搴撴暟閲�","閿�鍞��搴撳鏍告暟閲�"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�*/
//titleData = [];
dataCol = data1.data[0].HGridString.split(',');
@@ -3164,6 +3479,10 @@
if (dataCols[1] == 0 && $.inArray(option.cols[0][i + 1]["title"], titleData) == -1) {
option.cols[0][i + 1]["hide"] = false;
}
+ if ($.inArray(option.cols[0][i + 1]["title"], titleData) > -1) {
+ option.cols[0][i + 1]["hide"] = true;
+ }
+
//瀛椾綋鎵�鍦ㄤ綅缃�(宸� 灞呬腑 鍙�)
switch (dataCols[2]) {
case "L":
@@ -3175,6 +3494,11 @@
case "R":
option.cols[0][i + 1]["align"] = "right";
break;
+ }
+
+ //璁剧疆琛ㄦ牸title灞炴�ф樉绀哄埆鍚�
+ if (dataCols[4] != null && dataCols[4] != "") {
+ option.cols[0][i + 1]["title"] = dataCols[4];
}
}
@@ -3435,6 +3759,32 @@
}
//#endregion
+ //#region 鏍规嵁鐗╂枡ID鑾峰彇绮惧害
+ function getDecByMaterID(HMaterID) {
+ var resultData = {};
+ $.ajax({ // 寮傛璇锋眰
+ url: GetWEBURL() + "Gy_Material/getDecByID", //璇锋眰鍦板潃
+ async: false, //鏄惁寮�鍚紓姝�
+ type: "GET", //璇锋眰绫诲瀷
+ data: { //瀹氫箟鍙戦�佸埌鏈嶅姟鍣ㄧ殑鏁版嵁
+ "HMaterID": HMaterID // 灏唄materid浣滀负璇锋眰鍙傛暟鍙戦��
+ },
+ success: function (result) { // 褰撹姹傛垚鍔熸椂锛屾墽琛岃繖涓嚱鏁�
+ if (result.code == 1) { // 濡傛灉鏈嶅姟鍣ㄨ繑鍥炵殑鏁版嵁涓殑`code瀛楁绛変簬1锛岃繖鍙兘琛ㄧず瀹℃牳鎿嶄綔鎴愬姛鎵ц
+ var data = result.data; //澹版槑data鍙橀噺锛屽苟灏嗗叾璧嬪�间负result瀵硅薄涓殑data灞炴��
+ resultData = data[0]; //灏哾ata鏁扮粍锛堟垨绫绘暟缁勫璞★級鐨勭涓�涓厓绱犺祴鍊肩粰鍙橀噺resultData
+ }
+ //else {
+ // layer.alert(result.Message, { icon: 5, btn: ['閫�鍑�'], time: 100000, offset: 't' }); //result.msg瀵硅薄锛屾彁绀哄脊绐� 绫诲瀷涓�5锛� 鎸夐挳锛屽拰鎸夐挳鐨勫悕绉颁负閫�鍑� 鏃堕棿 涓�100绉掞紝浠ュ強鍋忕Щ閲忥紙`offset: 't'
+ //}
+ }, error: function () {
+ layer.alert("鍙戠敓閿欒!", { icon: 5 }); //鎻愮ず寮圭獥 鍙戠敓閿欒 锛岃绀烘爣蹇椾负5鐨�
+ }
+ });
+ return resultData;
+ }
+ //#endregion
+
//#region 鍒锋柊琛ㄦ牸鍚屾椂鏍规嵁option涓璈isStockGoods鍊艰缃笅鎷夊垪琛�
function setSelectHisStockGoodsByTableRender() {
for (var i = 1; i <= option.data.length; i++) {
@@ -3443,6 +3793,30 @@
form.render('select');
}
//#endregion
+
+ //#region 鏌ョ湅鏄惁鍏峰鏌ョ湅閲戦鏉冮檺锛岃缃噾棰濈瓑瀛楁鏄惁闇�瑕侀殣钘�
+ function checkRight_Money() {
+ $.ajax({
+ type: "GET",
+ async: false,
+ url: GetWEBURL() + "/Xs_SeOrderBill/CheckRight_Money", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+ data: { "user": sessionStorage["HUserName"] },
+ success: function (result) {
+ if (result.count == 1) {
+
+ } else {
+ var HideColumnList = ["鍓╀綑璁㈤噾", "鍗曚环", "绋庣巼%", "鍚◣鍗曚环", "閲戦", "浠风◣鍚堣"];
+ for (var i = 0; i < HideColumnList.length; i++) {
+ titleData.push(HideColumnList[i]);
+ }
+ }
+ }, error: function (err) {
+ layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+ }
+ });
+ }
+ //#endregion
+
//#endregion
@@ -3461,6 +3835,16 @@
}
function GetHCusNameValue(obj) //杩斿洖瀹㈡埛
+ {
+ //$("#HCusName").val(obj[0].HName);
+ //$("#HCusID").val(obj[0].HItemID);
+ //鏍规嵁瀹㈡埛鑾峰彇鐩稿叧淇℃伅
+ getCustomerByCusID(obj[0].HItemID);
+ //鏍规嵁瀹㈡埛鑾峰彇瀹㈡埛浣欓
+ getCustomerBalance(obj[0].HItemID);
+ }
+
+ function GetHSupValue(obj) //杩斿洖瀹㈡埛
{
//$("#HCusName").val(obj[0].HName);
//$("#HCusID").val(obj[0].HItemID);
@@ -3593,7 +3977,7 @@
subHTaxRate = data.HTaxRate;
} else {
- layer.alert(result.msg, { icon: 5, btn: ['閫�鍑�'], time: 100000, offset: 't' });
+ layer.alert(result.Message, { icon: 5, btn: ['閫�鍑�'], time: 100000, offset: 't' });
}
}, error: function () {
layer.alert("鍙戠敓閿欒!", { icon: 5 });
--
Gitblit v1.9.1