浏览代码

多辅助定额

zhangweicheng 6 年之前
父节点
当前提交
eba114b7b5

+ 4 - 1
modules/all_models/stdRation_ration.js

@@ -19,7 +19,10 @@ const rationAssItemSchema = new Schema({
     decimal: Number,
     carryBit: String,
     minValue: String,
-    maxValue: String
+    maxValue: String,
+    paramName:String,//参数名称
+    param:String,//参数
+    thirdRationCode:String//第三定额
 }, { _id: false });
 
 //定额安装增加费用

+ 1 - 0
public/web/sheet/sheet_common.js

@@ -33,6 +33,7 @@ var sheetCommonObj = {
             allowResizeColumns: true
         };
         sheet.showRowOutline(false);
+        sheet.options.allowCellOverflow = false;
         me.buildHeader(sheet, setting);
         if (rowCount > 0) sheet.setRowCount(rowCount);
         sheet.resumeEvent();

+ 14 - 11
web/maintain/ration_repository/js/ration_assist.js

@@ -8,16 +8,19 @@ var rationAssistOprObj = {
     setting: {
         header:[
             {headerName:"调整名称",headerWidth:110,dataCode:"name", dataType: "String", hAlign: "left"},
+            {headerName:"参数",headerWidth:60,dataCode:"param", dataType: "String", hAlign: "right"},
             {headerName:"辅助定额号",headerWidth:90,dataCode:"assistCode", dataType: "String", hAlign: "center", formatter: "@"},
+            {headerName:"参数名称",headerWidth:90,dataCode:"paramName", dataType: "String", hAlign: "left"},
             {headerName:"标准值",headerWidth:60,dataCode:"stdValue", dataType: "String", hAlign: "right"},
             {headerName:"步距",headerWidth:60,dataCode:"stepValue", dataType: "String", hAlign: "right"},
             {headerName:"精度",headerWidth:60,dataCode:"decimal",  dataType: "String", hAlign: "right"},
             {headerName:"进位方式",headerWidth:80,dataCode:"carryBit", dataType: "String", hAlign: "center"},
             {headerName:"最小值",headerWidth:70,dataCode:"minValue", dataType: "String", hAlign: "right"},
-            {headerName:"最大值",headerWidth:70,dataCode:"maxValue", dataType: "String", hAlign: "right"}
+            {headerName:"最大值",headerWidth:70,dataCode:"maxValue", dataType: "String", hAlign: "right"},
+            {headerName:"第三定额",headerWidth:90,dataCode:"thirdRationCode", dataType: "String", hAlign: "center", formatter: "@"}
         ],
         view:{},
-        comboItems: ["四舍五入", "进一"]
+        comboItems: ["四舍五入", "进一",'舍一']
     },
 
     buildSheet: function(sheet) {
@@ -41,7 +44,7 @@ var rationAssistOprObj = {
         let cellType = args.sheet.getCellType(args.row, 5);
         if(cellType.typeName !== 'undefined' && cellType.typeName === '1'){
           //  sheetCommonObj.setStaticCombo(args.sheet, 0, 5, 0, me.setting.comboItems, false);
-            sheetCommonObj.setDynamicCombo(args.sheet, 0, 5, me.sheet.getRowCount(), me.setting.comboItems, false, false);
+            sheetCommonObj.setDynamicCombo(args.sheet, 0, 7, me.sheet.getRowCount(), me.setting.comboItems, false, false);
         }
     },
 
@@ -72,7 +75,7 @@ var rationAssistOprObj = {
         });
         sheetCommonObj.cleanData(me.sheet, me.setting, -1);
         //sheetCommonObj.setStaticCombo(me.sheet, 0, 5, me.ration.rationAssList.length, me.setting.comboItems, false, false);
-        sheetCommonObj.setDynamicCombo(me.sheet, 0, 5, me.sheet.getRowCount(), me.setting.comboItems, false, false);
+        sheetCommonObj.setDynamicCombo(me.sheet, 0, 7, me.sheet.getRowCount(), me.setting.comboItems, false, false);
         sheetCommonObj.showData(me.sheet, me.setting, me.ration.rationAssList);
     },
 
@@ -95,13 +98,13 @@ var rationAssistOprObj = {
         var assList = me.ration.rationAssList;
         var assObj = sheetsOprObj.combineRationRowData(me.sheet, me.setting, args.row);
         let dataCode = me.setting.header[args.col].dataCode;
-        if((args.col === 2 || args.col === 3 || args.col === 6 || args.col === 7)
+        if((dataCode === 'stdValue' || dataCode === 'stepValue' || dataCode === 'minValue' || dataCode === 'maxValue')
             && args.editingText && args.editingText.toString().trim().length > 0 && isNaN(args.editingText)){
             args.sheet.setValue(args.row, args.col, args.row < assList.length ? assList[args.row][dataCode] : '');
             alert(me.setting.header[args.col].headerName + '只能为数值!');
             return;
         }
-        else if(args.col === 4 && args.editingText && (args.editingText.toString().trim().length === 0 ||
+        else if(dataCode === 'decimal' && args.editingText && (args.editingText.toString().trim().length === 0 ||
                 isNaN(args.editingText) || args.editingText % 1 !== 0)){
             args.sheet.setValue(args.row, args.col, args.row < assList.length ? assList[args.row][dataCode] : 0);
             alert(me.setting.header[args.col].headerName + '只能为整数!');
@@ -110,7 +113,7 @@ var rationAssistOprObj = {
         // 新增
         if (args.row >= assList.length) {
             if (assObj.decimal == undefined || assObj.decimal == null){assObj.decimal = '0';};
-            if (assObj.carryBit == undefined || assObj.carryBit == null){assObj.carryBit = '进一';};
+            if (assObj.carryBit == undefined || assObj.carryBit == null){assObj.carryBit = '四舍五入';};
             assList.push(assObj);
         }
         // 修改
@@ -120,7 +123,7 @@ var rationAssistOprObj = {
         });
         sheetCommonObj.cleanData(me.sheet, me.setting, -1);
         //sheetCommonObj.setStaticCombo(me.sheet, 0, 5, assList.length, me.setting.comboItems, false, false);
-        sheetCommonObj.setDynamicCombo(me.sheet, 0, 5, me.sheet.getRowCount(), me.setting.comboItems, false, false);
+        sheetCommonObj.setDynamicCombo(me.sheet, 0, 7, me.sheet.getRowCount(), me.setting.comboItems, false, false);
         sheetCommonObj.showData(me.sheet, me.setting, assList);
     },
 
@@ -163,7 +166,7 @@ var rationAssistOprObj = {
                     });
                     sheetCommonObj.cleanData(me.sheet, me.setting, -1);
                     //sheetCommonObj.setStaticCombo(me.sheet, 0, 5, curCahe.length, me.setting.comboItems, false);
-                    sheetCommonObj.setDynamicCombo(me.sheet, 0, 5, me.sheet.getRowCount(), me.setting.comboItems, false);
+                    sheetCommonObj.setDynamicCombo(me.sheet, 0, 7, me.sheet.getRowCount(), me.setting.comboItems, false);
                     sheetCommonObj.showData(me.sheet, me.setting, curCahe);
                 }
             }
@@ -182,12 +185,12 @@ var rationAssistOprObj = {
         if (ration == undefined || ration.rationAssList == undefined ||
             ration.rationAssList.length == 0){
             //sheetCommonObj.setStaticCombo(me.sheet, 0, 5, 0, me.setting.comboItems, false);
-            sheetCommonObj.setDynamicCombo(me.sheet, 0, 5, me.sheet.getRowCount(), me.setting.comboItems, false, false);
+            sheetCommonObj.setDynamicCombo(me.sheet, 0, 7, me.sheet.getRowCount(), me.setting.comboItems, false, false);
             return;
         }
         else {
             //sheetCommonObj.setStaticCombo(me.sheet, 0, 5, ration.rationAssList.length, me.setting.comboItems, false);
-            sheetCommonObj.setDynamicCombo(me.sheet, 0, 5, me.sheet.getRowCount(), me.setting.comboItems, false, false);
+            sheetCommonObj.setDynamicCombo(me.sheet, 0, 7, me.sheet.getRowCount(), me.setting.comboItems, false, false);
         }
         sheetCommonObj.showData(me.sheet, me.setting, ration.rationAssList);
     }