Przeglądaj źródła

新增工料机汇总“类型”列

olym 7 lat temu
rodzic
commit
fcd7b3ca1e

+ 2 - 1
modules/glj/models/glj_list_model.js

@@ -482,7 +482,8 @@ class GLJListModel extends BaseModel {
                 code: tmp.code,
                 name: tmp.name,
                 unit_price_file_id: unitPriceFileId,
-                type: tmp.gljType
+                type: tmp.gljType,
+                short_name: tmp.shortName === undefined ? '' : tmp.shortName,
             };
             unitPriceInsertData.push(unitPriceData);
         }

+ 2 - 0
modules/glj/models/schemas/unit_price.js

@@ -28,6 +28,8 @@ let modelSchema = {
     },
     // 类型
     type: Number,
+    // 类型简称
+    short_name: String,
     // 单价文件表id
     unit_price_file_id: Number,
 };

+ 1 - 0
modules/glj/models/unit_price_model.js

@@ -115,6 +115,7 @@ class UnitPriceModel extends BaseModel {
             unit_price_file_id: unitPriceFileId,
             name: data.name,
             type: data.type,
+            short_name: data.shortName !== undefined ? data.shortName : ''
         };
 
         let addPriceResult = await this.add(insertData);

+ 3 - 0
web/building_saas/glj/js/project_glj_spread.js

@@ -44,6 +44,7 @@ ProjectGLJSpread.prototype.init = function () {
         {name: '名称', field: 'name', visible: true},
         {name: '规格型号', field: 'specs', visible: true},
         {name: '单位', field: 'unit', visible: true},
+        {name: '类型', field: 'unit_price.short_name', visible: true},
         {name: 'ID', field: 'id', visible: false},
         {name: '类型', field: 'unit_price.type', visible: false},
         {name: '总消耗量', field: 'quantity', visible: true},
@@ -88,12 +89,14 @@ ProjectGLJSpread.prototype.init = function () {
     let adjustPriceColumn = this.sheetObj.getFieldColumn('adjust_price');
     let marketPriceColumn = this.sheetObj.getFieldColumn('unit_price.market_price');
     let supplyColumn = this.sheetObj.getFieldColumn('supply');
+    let shortNameColumn = this.sheetObj.getFieldColumn('unit_price.short_name');
 
     // 居中样式
     let centerStyleSetting = {hAlign: 1};
     this.sheetObj.setStyle(-1, isEvaluateColumn, centerStyleSetting);
     this.sheetObj.setStyle(-1, isAdjustPriceColumn, centerStyleSetting);
     this.sheetObj.setStyle(-1, unitColumn, centerStyleSetting);
+    this.sheetObj.setStyle(-1, shortNameColumn, centerStyleSetting);
 
     // 向右对齐样式
     let rightStyleSetting = {hAlign: GC.Spread.Sheets.HorizontalAlign.right};