|
@@ -91,6 +91,10 @@ $(document).ready(() => {
|
|
|
const cInfo = _.find(changeList, {gcl_id: data.id, mx_id: ''});
|
|
|
return cInfo ? cInfo.is_valuation : 0;
|
|
|
},
|
|
|
+ camount: function (data) {
|
|
|
+ const cInfo = _.find(changeList, {gcl_id: data.id, mx_id: ''});
|
|
|
+ return cInfo ? ZhCalc.round(cInfo.camount, findDecimal(data.unit)) : ZhCalc.round(data.camount, findDecimal(data.unit));
|
|
|
+ }
|
|
|
},
|
|
|
readOnly: {
|
|
|
isChangeAdd: function (data) {
|
|
@@ -794,7 +798,6 @@ $(document).ready(() => {
|
|
|
return;
|
|
|
}
|
|
|
const is_valuation = info.sheet.getValue(info.row, info.col) ? 1 : 0;
|
|
|
- console.log(select, info.sheet.getValue(info.row, info.col), is_valuation);
|
|
|
// select.is_valuation = is_valuation;
|
|
|
cInfo.is_valuation = is_valuation;
|
|
|
delete cInfo.waitingLoading;
|
|
@@ -869,7 +872,7 @@ $(document).ready(() => {
|
|
|
SpreadJsObj.reLoadRowData(info.sheet, info.row);
|
|
|
return;
|
|
|
}
|
|
|
- cInfo[col.field] = ZhCalc.round(validText, findDecimal(node.unit)) || 0;
|
|
|
+ cInfo[col.field] = validText;
|
|
|
cInfo.spamount = ZhCalc.round(validText, findDecimal(node.unit)) || 0;
|
|
|
cInfo.camount_expr = exprQuantity.expr;
|
|
|
node[col.field] = cInfo[col.field];
|
|
@@ -982,26 +985,6 @@ $(document).ready(() => {
|
|
|
changeList = result.changeList;
|
|
|
const refreshNode = billsTree.loadPostData(result);
|
|
|
for (const u of refreshNode.update) {
|
|
|
- if (col.field === 'unit') {
|
|
|
- const cInfo = _.find(changeList, { gcl_id: u.id, mx_id: '' });
|
|
|
- if (cInfo && cInfo.camount_expr) {
|
|
|
- const exprQuantity = {
|
|
|
- expr: '',
|
|
|
- quantity: 0,
|
|
|
- };
|
|
|
- const [valid, msg] = billsTreeSpreadObj._checkExpr(cInfo.camount_expr, exprQuantity);
|
|
|
- if (!valid) {
|
|
|
- break;
|
|
|
- }
|
|
|
- if (isNaN(exprQuantity.quantity)) {
|
|
|
- break;
|
|
|
- }
|
|
|
- u.camount = ZhCalc.round(parseFloat(exprQuantity.quantity), findDecimal(newValue)) || 0;
|
|
|
- cInfo.unit = newValue;
|
|
|
- } else {
|
|
|
- u.camount = ZhCalc.round(u.camount, findDecimal(newValue)) || 0;
|
|
|
- }
|
|
|
- }
|
|
|
billsTreeSpreadObj.reCalcCamount(u);
|
|
|
}
|
|
|
billsTreeSpreadObj.refreshTree(info.sheet, refreshNode);
|
|
@@ -1136,7 +1119,7 @@ $(document).ready(() => {
|
|
|
continue;
|
|
|
}
|
|
|
if (bPaste) {
|
|
|
- node.camount = ZhCalc.round(validText, findDecimal(node.unit)) || 0;
|
|
|
+ node.camount = validText;
|
|
|
filterNodes.push(node);
|
|
|
camountData.push({id: cInfo.id, camount: node.camount, camount_expr: exprQuantity.expr, spamount: ZhCalc.round(validText, findDecimal(node.unit)) || 0 });
|
|
|
} else {
|
|
@@ -1297,7 +1280,7 @@ $(document).ready(() => {
|
|
|
continue;
|
|
|
}
|
|
|
if (bPaste) {
|
|
|
- node.camount = ZhCalc.round(validText, findDecimal(node.unit)) || 0;
|
|
|
+ node.camount = validText;
|
|
|
filterNodes.push(node);
|
|
|
camountData.push({id: cInfo.id, camount: node.camount, camount_expr: exprQuantity.expr, spamount: ZhCalc.round(validText, findDecimal(node.unit)) || 0 });
|
|
|
} else {
|
|
@@ -1799,8 +1782,8 @@ $(document).ready(() => {
|
|
|
toastr.error('清单变更数值必须小于等于已调用值 ' + usedInfo.qty);
|
|
|
return;
|
|
|
}
|
|
|
- cInfo.camount = ZhCalc.round(camount, findDecimal(select.unit)) || 0;
|
|
|
- select.camount = ZhCalc.round(camount, findDecimal(select.unit)) || 0;
|
|
|
+ cInfo.camount = camount;
|
|
|
+ select.camount = camount;
|
|
|
cInfo.spamount = ZhCalc.round(camount, findDecimal(select.unit)) || 0;
|
|
|
cInfo.camount_expr = exprQuantity.expr;
|
|
|
delete cInfo.waitingLoading;
|
|
@@ -3105,7 +3088,7 @@ $(document).ready(() => {
|
|
|
toastr.error('清单变更数值必须小于等于已调用值 ' + usedInfo.qty);
|
|
|
return;
|
|
|
}
|
|
|
- cInfo.camount = ZhCalc.round(camount, findDecimal(billsNode.unit)) || 0;
|
|
|
+ cInfo.camount = camount;
|
|
|
cInfo.spamount = ZhCalc.round(camount, findDecimal(billsNode.unit)) || 0;
|
|
|
cInfo.camount_expr = exprQuantity.expr;
|
|
|
delete cInfo.waitingLoading;
|