|
@@ -516,7 +516,18 @@ $(document).ready(() => {
|
|
|
});
|
|
|
|
|
|
// 加载计量单元数据 - 暂时统一加载,如有需要,切换成动态加载并缓存
|
|
|
- postData(window.location.pathname + '/load', { filter: 'ledger;pos;detail;change;tag' }, function (result) {
|
|
|
+ postData(window.location.pathname + '/load', { filter: 'ledger;pos;detail;change;tag;sumDeal' }, function (result) {
|
|
|
+ for (const l of result.ledgerData) {
|
|
|
+ const sd = result.sumDeal.find(x => { return x.code === l.b_code && x.name === l.name && x.unit === l.unit; });
|
|
|
+ if (sd) {
|
|
|
+ l.unit_price = sd.unit_price;
|
|
|
+ l.deal_tp = ZhCalc.mul(l.unit_price, l.deal_qty);
|
|
|
+ l.sgfh_tp = ZhCalc.mul(l.unit_price, l.sgfh_qty);
|
|
|
+ l.sjcl_tp = ZhCalc.mul(l.unit_price, l.sjcl_qty);
|
|
|
+ l.qtcl_tp = ZhCalc.mul(l.unit_price, l.qtcl_qty);
|
|
|
+ l.total_price = ZhCalc.mul(l.unit_price, l.quantity);
|
|
|
+ }
|
|
|
+ }
|
|
|
// 加载树结构
|
|
|
stageTree.loadDatas(result.ledgerData);
|
|
|
treeCalc.calculateAll(stageTree);
|