zhangweicheng 7 years ago
parent
commit
1a159f1e0b

+ 18 - 1
web/building_saas/glj/js/project_glj_spread.js

@@ -294,8 +294,8 @@ ProjectGLJSpread.prototype.specialColumn = function (sourceData) {
     let supplyQuantity = this.sheetObj.getFieldColumn('supply_quantity');
     let activeSheet = this.sheetObj.getSheet();
 
-
     for (let data of sourceData) {
+        let rowStyle = null;
         //设置类型名称:
         activeSheet.setValue(rowCounter, shortNameColumn,projectObj.project.projectGLJ.getShortNameByID(data.unit_price.type));
         // 只有材料才显示是否暂估
@@ -343,6 +343,8 @@ ProjectGLJSpread.prototype.specialColumn = function (sourceData) {
                 activeSheet.getCell(rowCounter, marketPriceColumn,  GC.Spread.Sheets.SheetArea.viewport).locked(true);
                 activeSheet.getCell(rowCounter, basePriceColumn, GC.Spread.Sheets.SheetArea.viewport).locked(true);
                 activeSheet.getCell(rowCounter, supplyColumn,  GC.Spread.Sheets.SheetArea.viewport).locked(true);
+                //设置底色
+                rowStyle = this.getRowStyle("#E0E0E0");
             }
         }
         if(data.unit_price.is_add!=1){//如果不是新增,定额价不可修改。
@@ -365,10 +367,25 @@ ProjectGLJSpread.prototype.specialColumn = function (sourceData) {
         data=this.sheetObj.setProjectGLJDiffPrice(data);
         activeSheet.setValue(rowCounter,basePriceColumn,data.base_price);
         activeSheet.setValue(rowCounter,adjustPriceColumn,data.adjust_price);
+        if(rowStyle==null&&data.base_price == data.unit_price.market_price){//如果定额价等于市场价时,改底色。 优先度低于有组成物时的底色
+            rowStyle = this.getRowStyle("#C4CAFB");
+        }
+        activeSheet.setStyle(rowCounter, -1, rowStyle);
+
         rowCounter++;
     }
 };
 
+ProjectGLJSpread.prototype.getRowStyle = function (bgColour) {
+    let style = new GC.Spread.Sheets.Style();
+    style.backColor = bgColour;
+    style.borderLeft = new GC.Spread.Sheets.LineBorder("#D4D4D4", GC.Spread.Sheets.LineStyle.thin);
+    style.borderTop = new GC.Spread.Sheets.LineBorder("#D4D4D4", GC.Spread.Sheets.LineStyle.thin);
+    style.borderRight = new GC.Spread.Sheets.LineBorder("#D4D4D4", GC.Spread.Sheets.LineStyle.thin);
+    style.borderBottom = new GC.Spread.Sheets.LineBorder("#D4D4D4", GC.Spread.Sheets.LineStyle.thin);
+    return style;
+};
+
 /**
  * 计算当前行对应组成物的市场以及基价单价价格
  *

+ 2 - 2
web/building_saas/main/js/models/installation_fee.js

@@ -621,7 +621,7 @@ var installation_fee = {
                     'JXFTZ':{
                         rationID:data.ID,
                         billsItemID:data.billsItemID,
-                        shortName:project.projectGLJ.getShortNameByID(gljType.GENERAL_MACHINE),
+                        shortName:project.projectGLJ.getShortNameByID(gljType.MACHINE_COMPOSITION),
                         GLJID:-1,
                         projectID:data.projectID,
                         code:'JXFTZ',
@@ -629,7 +629,7 @@ var installation_fee = {
                         name:'机械费调整',
                         specs:'',
                         unit:'元',
-                        type:gljType.GENERAL_MACHINE,
+                        type:gljType.MACHINE_COMPOSITION,
                         basePrice:1,
                         adjCoe:null,
                         from:'std',