Pārlūkot izejas kodu

总额计量下,允许直接编辑本期数量变更

MaiXinRong 1 mēnesi atpakaļ
vecāks
revīzija
52ba1e1a8a
2 mainītis faili ar 7 papildinājumiem un 3 dzēšanām
  1. 2 2
      app/const/spread.js
  2. 5 1
      app/public/js/stage.js

+ 2 - 2
app/const/spread.js

@@ -621,7 +621,7 @@ const BaseSpreadColSetting = {
                 {title: '本期合同计量|数量', colSpan: '2|1', rowSpan: '1|1', field: 'contract_qty', hAlign: 2, width: 60, type: 'Number'},
                 {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'contract_tp', hAlign: 2, width: 60, type: 'Number'},
                 {title: '本期数量变更|数量', colSpan: '3|1', rowSpan: '1|1', field: 'qc_qty', hAlign: 2, width: 60, type: 'Number'},
-                {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'qc_tp', hAlign: 2, width: 60, type: 'Number', readOnly: true},
+                {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'qc_tp', hAlign: 2, width: 60, type: 'Number'},
                 {title: '|不计价', colSpan: '|1', rowSpan: '|1', field: 'qc_minus_qty', hAlign: 2, width: 60, type: 'Number'},
                 {title: '本期补差|原单价', colSpan: '2|1', rowSpan: '1|1', field: 'org_price', hAlign: 2, width: 60, type: 'Number', readOnly: true },
                 {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'pc_tp', hAlign: 2, width: 60, type: 'Number', readOnly: true },
@@ -785,7 +785,7 @@ const BaseSpreadColSetting = {
                 {title: '本期合同计量|数量', colSpan: '2|1', rowSpan: '1|1', field: 'contract_qty', hAlign: 2, width: 60, type: 'Number'},
                 {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'contract_tp', hAlign: 2, width: 60, type: 'Number'},
                 {title: '本期数量变更|数量', colSpan: '3|1', rowSpan: '1|1', field: 'qc_qty', hAlign: 2, width: 60, type: 'Number'},
-                {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'qc_tp', hAlign: 2, width: 60, type: 'Number', readOnly: true},
+                {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'qc_tp', hAlign: 2, width: 60, type: 'Number'},
                 {title: '|不计价', colSpan: '|1', rowSpan: '|1', field: 'qc_minus_qty', hAlign: 2, width: 60, type: 'Number'},
                 {title: '本期补差|原单价', colSpan: '2|1', rowSpan: '1|1', field: 'org_price', hAlign: 2, width: 60, type: 'Number', readOnly: true },
                 {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'pc_tp', hAlign: 2, width: 60, type: 'Number', readOnly: true },

+ 5 - 1
app/public/js/stage.js

@@ -1381,6 +1381,7 @@ $(document).ready(() => {
                     info.cancel = node.is_tp;
                     break;
                 case 'contract_tp':
+                case 'qc_tp':
                     info.cancel = !node.is_tp || node.settle_status === settleStatus.finish;
                     break;
                 case 'is_tp':
@@ -1710,7 +1711,10 @@ $(document).ready(() => {
                 const gatherTp = ZhCalc.sum(result.map(x => { return x.info.total_price; }));
                 const node = SpreadJsObj.getSelectObject(slSheet);
                 const contract_tp = ZhCalc.mul(ZhCalc.div(gatherContractTp, gatherTp), node.total_price);
-                stageTreeSpreadObj.updateNodeData({ stage: { lid: node.id, contract_tp, postil } });
+                const contract_expr = result.length > 1
+                    ? '(' + result.map(x => { return x.info.contract_tp; }).join('+') + ')/(' + result.map(x => { return x.info.total_price; }).join('+') + ')'
+                    : result[0].info.contract_tp + '/' + result[0].info.total_price;
+                stageTreeSpreadObj.updateNodeData({ stage: { lid: node.id, contract_tp, contract_expr, postil } });
             });
         },
     });