Browse Source

变更清单四舍五入问题

ellisran 1 week ago
parent
commit
d4d502bed7
2 changed files with 14 additions and 10 deletions
  1. 6 4
      app/public/js/change_information.js
  2. 8 6
      app/public/js/change_revise.js

+ 6 - 4
app/public/js/change_information.js

@@ -1053,7 +1053,7 @@ $(document).ready(() => {
             {title: '变更详情', colSpan: '1', rowSpan: '2', field: 'detail', hAlign: 0, width: 120, formatter: '@', readOnly: 'readOnly.isEdit'},
             {title: '计量上限(%)', colSpan: '1', rowSpan: '2', field: 'delimit', hAlign: 2, width: 60, type: 'Number', readOnly: 'readOnly.isSettle2', visible: openChangeState},
             {title: '原设计|数量', colSpan: '1|1', rowSpan: '|1', field: 'oamount2', hAlign: 2, width: 120, type: 'Number', readOnly: 'readOnly.isSettle', getValue: 'getValue.oamount2'},
-            {title: '申请变更增(+)减(-)|数量', colSpan: '1|1', rowSpan: '|1', field: 'camount', hAlign: 2, width: 120, readOnly: 'readOnly.isSettle2', getValue: 'getValue.camount'},
+            {title: '申请变更增(+)减(-)|数量', colSpan: '1|1', rowSpan: '|1', field: 'camount', type: 'Number', hAlign: 2, width: 120, readOnly: 'readOnly.isSettle2', getValue: 'getValue.camount'},
             // {title: '数量', colSpan: '1', rowSpan: '2', field: 'oamount', hAlign: 2, width: 80},
         ],
         emptyRows: 0,
@@ -1904,7 +1904,7 @@ $(document).ready(() => {
             }
             select.spamount = ZhCalc.round(validText, findDecimal(select.unit)) || 0;
             select.camount_expr = exprQuantity.expr;
-            select.camount = validText;
+            select.camount = ZhCalc.round(validText, findDecimal(select.unit)) || 0;
             cInfo.spamount = select.spamount;
             cInfo.camount_expr = select.camount_expr;
             cInfo.camount = validText;
@@ -1922,6 +1922,7 @@ $(document).ready(() => {
                         changeSpreadObj.refreshXmjData();
                     }
                 }
+                changeSpreadObj.loadExprToInput(changeSpreadSheet);
             }, function () {
                 select.camount = orgValue;
                 select.camount_expr = orgExprValue;
@@ -2479,10 +2480,10 @@ $(document).ready(() => {
             }
             select.spamount = ZhCalc.round(validText, findDecimal(select.unit)) || 0;
             select.camount_expr = exprQuantity.expr;
-            select.camount = validText;
+            select.camount = ZhCalc.round(validText, findDecimal(select.unit)) || 0;
             cInfo.spamount = select.spamount;
             cInfo.camount_expr = select.camount_expr;
-            cInfo.camount = validText;
+            cInfo.camount = ZhCalc.round(validText, findDecimal(select.unit)) || 0;
             // console.log(select);
             delete cInfo.waitingLoading;
 
@@ -2495,6 +2496,7 @@ $(document).ready(() => {
                 changeSpreadObj.calcOneSum(node);
                 changeSpreadObj.reloadRow(changeSpreadSheet, billIndex);
                 changeSpreadObj.countSum();
+                xmjSpreadObj.loadExprToInput(xmjSheet);
             }, function () {
                 select.camount = orgValue;
                 select.camount_expr = orgExprValue;

+ 8 - 6
app/public/js/change_revise.js

@@ -880,7 +880,7 @@ $(document).ready(() => {
                         SpreadJsObj.reLoadRowData(info.sheet, info.row);
                         return;
                     }
-                    cInfo[col.field] = validText;
+                    cInfo[col.field] = ZhCalc.round(validText, findDecimal(node.unit)) || 0;
                     cInfo.spamount = ZhCalc.round(validText, findDecimal(node.unit)) || 0;
                     cInfo.camount_expr = exprQuantity.expr;
                     node[col.field] = cInfo[col.field];
@@ -1129,7 +1129,7 @@ $(document).ready(() => {
                             continue;
                         }
                         if (bPaste) {
-                            node.camount = validText;
+                            node.camount = ZhCalc.round(validText, findDecimal(node.unit)) || 0;
                             filterNodes.push(node);
                             camountData.push({id: cInfo.id, camount: node.camount, camount_expr: exprQuantity.expr, spamount: ZhCalc.round(validText, findDecimal(node.unit)) || 0 });
                         } else {
@@ -1291,7 +1291,7 @@ $(document).ready(() => {
                                 continue;
                             }
                             if (bPaste) {
-                                node.camount = validText;
+                                node.camount = ZhCalc.round(validText, findDecimal(node.unit)) || 0;
                                 filterNodes.push(node);
                                 camountData.push({id: cInfo.id, camount: node.camount, camount_expr: exprQuantity.expr, spamount: ZhCalc.round(validText, findDecimal(node.unit)) || 0 });
                             } else {
@@ -1801,8 +1801,8 @@ $(document).ready(() => {
                     toastr.error('清单变更数值必须小于等于已调用值 ' + usedInfo.qty);
                     return;
                 }
-                cInfo.camount = camount;
-                select.camount = camount;
+                cInfo.camount = ZhCalc.round(camount, findDecimal(select.unit)) || 0;
+                select.camount = ZhCalc.round(camount, findDecimal(select.unit)) || 0;
                 cInfo.spamount = ZhCalc.round(camount, findDecimal(select.unit)) || 0;
                 cInfo.camount_expr = exprQuantity.expr;
                 delete cInfo.waitingLoading;
@@ -1812,6 +1812,7 @@ $(document).ready(() => {
                     const loadResult = { update: [select] };
                     const refreshNode = billsTree.loadPostData(loadResult);
                     billsTreeSpreadObj.refreshTree(billsSheet, refreshNode);
+                    billsTreeSpreadObj.loadExprToInput(billsSheet);
                 }, function () {
                     cInfo.camount = orgValue;
                     cInfo.spamount = orgValue;
@@ -3109,7 +3110,7 @@ $(document).ready(() => {
                     toastr.error('清单变更数值必须小于等于已调用值 ' + usedInfo.qty);
                     return;
                 }
-                cInfo.camount = camount;
+                cInfo.camount = ZhCalc.round(camount, findDecimal(billsNode.unit)) || 0;
                 cInfo.spamount = ZhCalc.round(camount, findDecimal(billsNode.unit)) || 0;
                 cInfo.camount_expr = exprQuantity.expr;
                 delete cInfo.waitingLoading;
@@ -3119,6 +3120,7 @@ $(document).ready(() => {
                     const loadResult = { update: [billsNode] };
                     const refreshNode = billsTree.loadPostData(loadResult);
                     billsTreeSpreadObj.refreshTree(billsSheet, refreshNode);
+                    posSpreadObj.loadExprToInput(posSheet);
                 }, function () {
                     cInfo.camount = orgValue;
                     cInfo.spamount = orgValue;