Przeglądaj źródła

解决人工系数值和正常数值无法区分问题。

Chenshilong 7 lat temu
rodzic
commit
fa01ac5299

+ 2 - 2
public/calc_util.js

@@ -331,12 +331,12 @@ class Calculation {
         let private_compile_items = function() {
             for (let idx of template.compiledSeq) {
                 let item = template.calcItems[idx];
+                item.dispExprUser = item.dispExpr;    // 用于界面显示。disExpr是公式模板,不允许修改:人工系数占位符被修改后变成数值,第二次无法正确替换。
                 item.compiledExpr = item.expression.split('@(').join('$CE.at(');
                 item.compiledExpr = item.compiledExpr.split('base(').join('$CE.base(');
-
                 if (item.labourCoeID){
                     let lc = me.compiledLabourCoes["LabourCoe_" + item.labourCoeID].coe;
-                    item.dispExpr = item.dispExpr.replace(/L/gi, lc.toString());
+                    item.dispExprUser = item.dispExpr.replace(/L/gi, lc.toString());
                     item.compiledExpr = item.compiledExpr.replace(/L/gi, lc.toString());
                 };
 

+ 1 - 1
web/building_saas/main/js/views/calc_program_manage.js

@@ -23,7 +23,7 @@ let rationPM = {
             // {headerName:"ID",headerWidth:80,dataCode:"ID", hAlign: "center"},
             {headerName:"费用代号",headerWidth:80,dataCode:"code", dataType: "String"},
             {headerName:"费用名称",headerWidth:200,dataCode:"name", dataType: "String"},
-            {headerName:"计算基数",headerWidth:180,dataCode:"dispExpr", dataType: "String"},
+            {headerName:"计算基数",headerWidth:180,dataCode:"dispExprUser", dataType: "String"},
             {headerName:"基数说明",headerWidth:300,dataCode:"statement", dataType: "String"},
             {headerName:"费率",headerWidth:80,dataCode:"feeRate", dataType: "Number",hAlign: "left",tofix:feeRate_consts.decimal},
             {headerName:"字段名称",headerWidth:140,dataCode:"displayFieldName", dataType: "String", hAlign: "center"},

+ 1 - 1
web/building_saas/main/js/views/calc_program_view.js

@@ -203,7 +203,7 @@ let calcProgramObj = {
         header: [
             {headerName: "费用代号", headerWidth: 75, dataCode: "code", dataType: "String", hAlign: "left"},
             {headerName: "费用名称", headerWidth: 200, dataCode: "name", dataType: "String"},
-            {headerName: "计算基数", headerWidth: 200, dataCode: "dispExpr", dataType: "String"},
+            {headerName: "计算基数", headerWidth: 200, dataCode: "dispExprUser", dataType: "String"},
             {headerName: "基数说明", headerWidth: 400, dataCode: "statement", dataType: "String"},
             {headerName: "费率", headerWidth: 80, dataCode: "feeRate", dataType: "Number"},   // precision: 3
             {headerName: "单价", headerWidth: 100, dataCode: "unitFee", dataType: "Number"},  // execRst