zhangweicheng 6 lat temu
rodzic
commit
78a38a28fc

+ 4 - 3
public/web/sheet/sheet_common.js

@@ -129,7 +129,7 @@ var sheetCommonObj = {
                 sheet.setFormatter(-1, col, setting.header[col].formatter, GC.Spread.Sheets.SheetArea.viewport);
             }
             if(setting.header[col].cellType === "comboBox"){
-                this.setComboBox(-1,col,sheet,setting.header[col].options,setting.header[col].editorValueType);
+                this.setComboBox(-1,col,sheet,setting.header[col].options,setting.header[col].editorValueType,setting.header[col].editable);
             }
 
             for (let row = 0; row < data.length; row++) {
@@ -259,7 +259,7 @@ var sheetCommonObj = {
                 this.setCheckBoxCell(row,col,sheet,val)
             }
             if(setting.header[col].cellType === "comboBox"){
-                this.setComboBox(row,col,sheet,setting.header[col].options,setting.header[col].editorValueType);
+                this.setComboBox(row,col,sheet,setting.header[col].options,setting.header[col].editorValueType,setting.header[col].editable);
             }
             if(setting.header[col].cellType === "selectButton"){
                 this.setSelectButton(row,col,sheet,setting.header[col]);
@@ -385,11 +385,12 @@ var sheetCommonObj = {
         c.isThreeState(threeState);
         return c
     },
-    setComboBox(row,col,sheet,options,editorValueType){
+    setComboBox(row,col,sheet,options,editorValueType,editable){
         //let combo = new GC.Spread.Sheets.CellTypes.ComboBox();
         let dynamicCombo = sheetCommonObj.getDynamicCombo(true);
         if(options){
             dynamicCombo.items(options);
+            if(editable == true)  dynamicCombo.editable(true);//可编辑
             if(editorValueType==true){
                 dynamicCombo.editorValueType(GC.Spread.Sheets.CellTypes.EditorValueType.value);
             }

+ 1 - 0
web/building_saas/main/js/models/exportSEIInterface.js

@@ -427,6 +427,7 @@ async function exportSEI(projectID) {
         }
         function setFeatures(tender,arr) {
             let features = tender.property.engineerFeatures?tender.property.engineerFeatures:[];
+            if(features.length == 0) return;
             let parentMap = _.groupBy(features,"ParentID");
             let rootNodes = parentMap["-1"]?parentMap["-1"]:parentMap[null];
             for(let r of rootNodes){

+ 39 - 23
web/building_saas/main/js/views/index_view.js

@@ -64,7 +64,7 @@ let indexObj= {
             {headerName: "数量", headerWidth: 90, dataCode: "quantity", hAlign: "right", dataType: "Number",decimalField:'glj.quantity'},
             {headerName: "市场价", headerWidth: 70, dataCode: "marketPrice", hAlign: "right", dataType: "Number",validator:"number"},//,decimalField:"glj.unitPrice"
             {headerName: "市场价合价", headerWidth: 120, dataCode: "totalPrice", hAlign: "right", dataType: "Number",validator:"number"},//,decimalField:"glj.unitPrice"
-            {headerName: "工料指标", headerWidth: 120, dataCode: "materialIndexType", hAlign: "center", dataType: "String",cellType:'comboBox',options:[]},
+            {headerName: "工料指标", headerWidth: 120, dataCode: "materialIndexType", hAlign: "center", dataType: "String",cellType:'comboBox',options:[],editable:true},
             {headerName: "工料指标单位", headerWidth: 150, dataCode: "materialIndexUnit", hAlign: "center", dataType: "String"},
             {headerName: "单位转换系数", headerWidth: 150, dataCode: "materialIndexCoe", hAlign: "center", dataType: "String",validator:"number"}
         ],
@@ -80,8 +80,8 @@ let indexObj= {
             {headerName: "工程量", headerWidth: 90, dataCode: "quantity", hAlign: "right", dataType: "Number"},
             {headerName: "综合单价", headerWidth: 70, dataCode: "unitFee", hAlign: "right", dataType: "Number",validator:"number"},//,decimalField:"glj.unitPrice"
             {headerName: "综合合价", headerWidth: 120, dataCode: "totalFee", hAlign: "right", dataType: "Number",validator:"number"},//,decimalField:"glj.unitPrice"
-            {headerName: "工程经济指标类别", headerWidth: 120, dataCode: "economicType", hAlign: "center", dataType: "String",cellType:'comboBox',options:[]},
-            {headerName: "工程量指标类别", headerWidth: 150, dataCode: "quantityIndexType", hAlign: "center", dataType: "String",cellType:'comboBox',options:[]},
+            {headerName: "工程经济指标类别", headerWidth: 120, dataCode: "economicType", hAlign: "center", dataType: "String",cellType:'comboBox',options:[],editable:true},
+            {headerName: "工程量指标类别", headerWidth: 150, dataCode: "quantityIndexType", hAlign: "center", dataType: "String",cellType:'comboBox',options:[],editable:true},
             {headerName: "工程量指标单位", headerWidth: 150, dataCode: "quantityIndexUnit", hAlign: "center", dataType: "String"},
             {headerName: "单位转换系数", headerWidth: 150, dataCode: "quantityIndexCoe", hAlign: "center", dataType: "String",validator:"number"}
         ],
@@ -399,6 +399,7 @@ let indexObj= {
         let datas = [],allNodes=[];
         let controller = projectObj.mainController, project = projectObj.project;
         let  FBFX = project.Bills.getFBFXNode(controller);
+        let IDMap = _.indexBy(this.ecoQuantityDatas,"ID");
         if(FBFX){
             allNodes.push(FBFX);
             controller.tree.getAllSubNode(FBFX.source,allNodes);
@@ -424,7 +425,7 @@ let indexObj= {
                 quantityIndexType:d.quantityIndexType,
                 quantityIndexUnit:d.quantityIndexUnit,
                 quantityIndexCoe:d.quantityIndexCoe,
-                collapsed:false
+                collapsed:IDMap[d.ID]?IDMap[d.ID].collapsed:false
             };
             parentMap[d.ParentID] = tem;
             datas.push(tem);
@@ -481,7 +482,7 @@ let indexObj= {
     },
     setComboOptions:function (property,setting,field) {
         if(!property) return;
-        let options = [];
+        let options = [""];
         for(let p of property){
             options.push(p.name);
         }
@@ -503,6 +504,7 @@ let indexObj= {
         }
         let recode = indexObj.ecoQuantityDatas[info.row];
         let data = indexObj.getEcoQuantityUpdateData(recode,dataCode,value);
+        if(data == null)  return indexObj.showDatas();
         projectObj.project.updateNodesAndRefresh([data],indexObj.showDatas)
     },
     onEngineerInfoValueChange:function (sender,info) {
@@ -634,18 +636,26 @@ let indexObj= {
         tem.data[dataCode] = newValue;
         if(!recode) return null;
         if(dataCode == "quantityIndexType"){
-            let mainQuantities = projectObj.project.property.mainQuantities;
-            if (!mainQuantities) return null;
-            let m =  _.find(mainQuantities,{name:newValue});
-            if(!m) return null;
-            tem.data["quantityIndexUnit"] = m.unit;
-            tem.data["quantityIndexCoe"] = recode.unit == m.unit? 1:null;
+            if(newValue == ""){
+                tem.data["quantityIndexUnit"] = "";
+                tem.data["quantityIndexCoe"] = null;
+            }else {
+                let mainQuantities = projectObj.project.property.mainQuantities;
+                if (!mainQuantities) return null;
+                let m =  _.find(mainQuantities,{name:newValue});
+                if(!m) return null;
+                tem.data["quantityIndexUnit"] = m.unit;
+                tem.data["quantityIndexCoe"] = recode.unit == m.unit? 1:null;
+            }
+
         }
         if(dataCode == "economicType"){//这里就主要查找输入是否是下列选项中的一个,值已经在上面设置了
-            let economics = projectObj.project.property.economics;
-            if (!economics) return null;
-            let m =  _.find(economics,{name:newValue});
-            if(!m) return null;
+            if(newValue != ""){
+                let economics = projectObj.project.property.economics;
+                if (!economics) return null;
+                let m =  _.find(economics,{name:newValue});
+                if(!m) return null;
+            }
         }
         return tem;
 
@@ -654,14 +664,20 @@ let indexObj= {
         let data = {};
         data[dataCode] = newValue;
         if(dataCode == "materialIndexType"){
-            let materials = projectObj.project.property.materials;
-            if (!materials) return null;
-            if(!recode) return null;
-            let m =  _.find(materials,{name:newValue});
-            if(!m) return null;
-            data["materialIndexUnit"] = m.unit;
-            data["materialIndexCoe"] =  recode.unit == m.unit ?1: null;
-            if(recode.name == "水泥" && m.name == "水泥")  data["materialIndexCoe"] = 0.001;
+            if(newValue == ""){
+                data["materialIndexUnit"] = "";
+                data["materialIndexCoe"] =  null;
+            }else {
+                let materials = projectObj.project.property.materials;
+                if (!materials) return null;
+                if(!recode) return null;
+                let m =  _.find(materials,{name:newValue});
+                if(!m) return null;
+                data["materialIndexUnit"] = m.unit;
+                data["materialIndexCoe"] =  recode.unit == m.unit ?1: null;
+                if(recode.name == "水泥" && m.name == "水泥")  data["materialIndexCoe"] = 0.001;
+            }
+
         }
         return data
     },