Просмотр исходного кода

Merge branch '1.0.0_online' of http://192.168.1.41:3000/SmartCost/ConstructionCost into 1.0.0_online

zhongzewei 6 лет назад
Родитель
Сommit
c1ca90d012

+ 4 - 4
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,setting.header[col].editable);
+                this.setComboBox(-1,col,sheet,setting.header[col].options,setting.header[col].editorValueType,setting.header[col].editable,setting.header[col].maxDropDownItems);
             }
 
             for (let row = 0; row < data.length; row++) {
@@ -137,7 +137,6 @@ var sheetCommonObj = {
                     let options = data[row].options ? data[row].options.split("@") : [];
                     this.setComboBox(row,col,sheet,options);
                 }
-
                 let val = data[row][setting.header[col].dataCode];
                 if(val&&setting.header[col].dataType === "Number"){
                     if(setting.header[col].hasOwnProperty('decimalField')){
@@ -259,7 +258,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,setting.header[col].editable);
+                this.setComboBox(row,col,sheet,setting.header[col].options,setting.header[col].editorValueType,setting.header[col].editable,setting.header[col].maxDropDownItems);
             }
             if(setting.header[col].cellType === "selectButton"){
                 this.setSelectButton(row,col,sheet,setting.header[col]);
@@ -394,11 +393,12 @@ var sheetCommonObj = {
         c.isThreeState(threeState);
         return c
     },
-    setComboBox(row,col,sheet,options,editorValueType,editable){
+    setComboBox(row,col,sheet,options,editorValueType,editable,maxDropDownItems){
         //let combo = new GC.Spread.Sheets.CellTypes.ComboBox();
         let dynamicCombo = sheetCommonObj.getDynamicCombo(true);
         if(options){
             dynamicCombo.items(options);
+            if(maxDropDownItems) dynamicCombo.maxDropDownItems(maxDropDownItems);
             if(editable == true)  dynamicCombo.editable(true);//可编辑
             if(editorValueType==true){
                 dynamicCombo.editorValueType(GC.Spread.Sheets.CellTypes.EditorValueType.value);

+ 2 - 1
public/web/tree_sheet/tree_sheet_helper.js

@@ -181,7 +181,8 @@ var TREE_SHEET_HELPER = {
                 var cell = sheet.getCell(iRow, iCol, GC.Spread.Sheets.SheetArea.viewport);
                 if (colSetting.data.getText && Object.prototype.toString.apply(colSetting.data.getText) === "[object Function]") {
                     cell.value(colSetting.data.getText(node));
-                }else if((colSetting.data.field=="mainBills"||colSetting.data.field=="outPutMaxPrice")&&MainTreeCol.mainBillsEnable(node)){//主要清单有三种状态,所以直接显示就好,不走最后的逻辑
+                }else if((colSetting.data.field=="mainBills"||(colSetting.data.field=="outPutMaxPrice" && $("#fileKind").val() != '1'))&&MainTreeCol.mainBillsEnable(node)){//主要清单有三种状态,所以直接显示就好,不走最后的逻辑
+                   //outPutMaxPrice 对于投标项目 即 fileKind = 1 时只读,不进这个逻辑
                     cell.value(node.data[colSetting.data.field]===undefined?false:node.data[colSetting.data.field]);
                 } else {
                     cell.value(getFieldText2());

+ 2 - 1
web/building_saas/main/html/main.html

@@ -53,6 +53,7 @@
         <span id="tool-toast-content">右键不支持粘贴外部内容,请使用Ctrl+V粘贴。<span id="toolToastBtn">我知道了</span></span>
     </div>
 </div>-->
+<input type="hidden" id="fileKind" value="<%= fileKind %>">
 <img src="/web/dest/css/img/question.png" id="question_pic" style="display: none">
     <div class="header">
          <div class="top-msg clearfix">
@@ -100,7 +101,7 @@
                     <a class="dropdown-toggle" href="#" data-toggle="dropdown"><i class="fa  fa-code-fork"></i></a>
                     <div class="dropdown-menu" id="exportMenu">
                         <a class="dropdown-item" href="#export" data-toggle="modal" data-target="#export">重庆市电子招投标数据接口</a>
-                        <a class="dropdown-item" href="javascript:void(0)" id="SEIMenu"  >重庆其他电子招投标数据接口</a>
+                        <a class="dropdown-item" href="javascript:void(0)" id="SEIMenu"  >导出重庆市指标成果文件</a>
                     </div>
                 </span>
                     <a href="javascript:void(0)" class="btn btn-light btn-sm" id="insertRation" data-toggle="tooltip" data-placement="bottom" data-original-title="插入定额"><i class="fa fa-sign-in" aria-hidden="true"></i></a>

+ 11 - 7
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:[],editable:true},
+            {headerName: "工料指标", headerWidth: 120, dataCode: "materialIndexType", hAlign: "center", dataType: "String",cellType:'comboBox',options:[],editable:true,maxDropDownItems:10},
             {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:[],editable:true},
-            {headerName: "工程量指标类别", headerWidth: 150, dataCode: "quantityIndexType", hAlign: "center", dataType: "String",cellType:'comboBox',options:[],editable:true},
+            {headerName: "工程经济指标类别", headerWidth: 120, dataCode: "economicType", hAlign: "center", dataType: "String",cellType:'comboBox',options:[],editable:true,maxDropDownItems:10},
+            {headerName: "工程量指标类别", headerWidth: 150, dataCode: "quantityIndexType", hAlign: "center", dataType: "String",cellType:'comboBox',options:[],editable:true,maxDropDownItems:10},
             {headerName: "工程量指标单位", headerWidth: 150, dataCode: "quantityIndexUnit", hAlign: "center", dataType: "String"},
             {headerName: "单位转换系数", headerWidth: 150, dataCode: "quantityIndexCoe", hAlign: "center", dataType: "String",validator:"number"}
         ],
@@ -235,6 +235,7 @@ let indexObj= {
         this.spread.setActiveSheetIndex(1);
         let sheet = this.spread.getActiveSheet();
         refreshValue();
+        this.setRowCountAndLock(sheet,this.engineerFeatureDatas);
         sheetCommonObj.showTreeData(sheet, this.engineerFeatureSetting,this.engineerFeatureDatas);
         function refreshValue() {
             let map = projectObj.project.property.engineerFeatures?_.indexBy(projectObj.project.property.engineerFeatures,'ID'):{};
@@ -386,7 +387,7 @@ let indexObj= {
         let oldData = sel.row<this.ecoQuantityDatas.length?this.ecoQuantityDatas[sel.row]:null;
         this.ecoQuantityDatas = this.getIndexBillsData(parentMap);
         sheet.setRowCount(0);
-        sheet.setRowCount(this.ecoQuantityDatas.length);
+        this.setRowCountAndLock(sheet,this.ecoQuantityDatas);
         sheetCommonObj.showTreeData(sheet, this.ecoQuantitySetting,this.ecoQuantityDatas);
         sel.row = oldData?_.findIndex(this.ecoQuantityDatas,{'ID':oldData.ID}):0;
         sheet.setSelection(sel.row==-1?0:sel.row,sel.col,sel.rowCount,sel.colCount);
@@ -448,10 +449,9 @@ let indexObj= {
         let oldData = sel.row<this.materialDatas.length?this.materialDatas[sel.row]:null;
         this.materialDatas = getMaterialData();
         sheetCommonObj.showData(sheet, this.materialSetting,this.materialDatas );
-        sheet.setRowCount(this.materialDatas .length);
-
         sel.row = oldData?_.findIndex(this.materialDatas,{'id':oldData.id}):0;
         sheet.setSelection(sel.row==-1?0:sel.row,sel.col,sel.rowCount,sel.colCount);
+        this.setRowCountAndLock(sheet,this.materialDatas);
         function getMaterialData() {
             let datas = [];
             let gljList = projectObj.project.projectGLJ.datas.gljList;
@@ -478,7 +478,11 @@ let indexObj= {
             }
             return datas;
         }
-
+    },
+    setRowCountAndLock:function (sheet,datas) {
+        let rowCount = datas.length > 0 ?datas.length+11:0;
+        sheet.setRowCount(rowCount);
+        sheet.getRange(datas.length, -1, 11, -1, GC.Spread.Sheets.SheetArea.viewport).locked(true);//锁定空行
     },
     setComboOptions:function (property,setting,field) {
         if(!property) return;

+ 3 - 2
web/building_saas/main/js/views/main_tree_col.js

@@ -272,7 +272,8 @@ let MainTreeCol = {
             return true;
         },
         maxPrice:function (node) {
-            return node.data.outPutMaxPrice!==true;
+            if($("#fileKind").val() == '1') return true;//对于投标项目只读
+            return   node.data.outPutMaxPrice!==true;
         }
     },
     cellType: {
@@ -368,7 +369,7 @@ let MainTreeCol = {
             if(MainTreeCol.mainBillsEnable(node)) return sheetCommonObj.getCheckBox(true);
         },
         outPutMaxPrice:function (node) {
-            if(MainTreeCol.mainBillsEnable(node)) return sheetCommonObj.getCheckBox(true);
+            if(MainTreeCol.mainBillsEnable(node) && $("#fileKind").val() != '1') return sheetCommonObj.getCheckBox(true);
         }
     },
     mainBillsEnable:function (node) {