zhangweicheng 6 years ago
parent
commit
d0e5b8b970

+ 4 - 1
web/building_saas/css/custom.css

@@ -261,8 +261,11 @@ legend.legend{
 .item_spread{
     width: 29.8%;
     float: left;
-    background: #F1F1F1
+    white-space:nowrap;
+    margin-top: -5px;
+    background: #F1F1F1;
 }
+
 input.text-right{
     text-align: right;
 }

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

@@ -322,7 +322,7 @@
                                           <div class="input-group input-group-sm col-12">
                                               <input type="text" class="form-control form-control-sm" placeholder="查找内容" value="">
                                               <div class="input-group-append">
-                                                  <button class="btn btn-secondary btn-sm" type="button"><i class="fa fa-search" aria-hidden="true"></i></button>
+                                                  <button class="btn btn-secondary btn-sm" type="button" id="locate_btn"><i class="fa fa-search" aria-hidden="true"></i></button>
                                               </div>
                                           </div>
                                           <div class="form-group col-12 mb-1">

+ 1 - 0
web/building_saas/main/js/controllers/material_controller.js

@@ -219,6 +219,7 @@ let MaterialController = {
             $('#subSpread').css('width','');
             return;
         }
+        $("#replaceM").removeClass("ovf-hidden");
         $('#subSpread').css('width',MaterialController.subSpreadDivWidth);
         $("#replaceM").html(text);
     },

+ 1 - 1
web/building_saas/main/js/models/calc_program.js

@@ -761,7 +761,7 @@ let calcTools = {
         // 定额大类
         if (me.isRationCategory(treeNode)) {
             data.isSubcontract = treeNode.data.isSubcontract;
-
+            data.evaluationProject = treeNode.data.evaluationProject;
             //定额类型的工料机做特殊处理
             if(me.isGljRation(treeNode)){
                 data.code = treeNode.data.code;

+ 1 - 1
web/building_saas/main/js/models/quantity_detail.js

@@ -384,7 +384,7 @@ var quantity_detail = {
                     query.billID = recode.billID;
                     doc.billID=recode.billID;
                 }
-                if(this.checkAndCalcResult(args.editingText,args.row,doc) === false){
+                if(gljUtil.isDef(args.editingText)&&this.checkAndCalcResult(args.editingText,args.row,doc) === false){
                     gljOprObj.showQuantityDetailData();
                     return;
                 }

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

@@ -155,7 +155,7 @@ var gljOprObj = {
         function enterKeyAction(spd,sheeName) {
             let editRow = sheet.getActiveRowIndex(),orgCol = sheet.getActiveColumnIndex();
             let fieldID = me.setting.header[orgCol].dataCode;
-            if(me.setting.navigationRightCol.indexOf(fieldID) != -1){
+            if(sheeName=="ration_glj" && me.setting.navigationRightCol.indexOf(fieldID) != -1){
                 if(sheet.isEditing()) sheet.endEdit();
                 GC.Spread.Sheets.Commands.navigationRight.execute(spd,sheeName);
             }else {
@@ -608,8 +608,6 @@ var gljOprObj = {
         let ration_glj = this.sheetData[selected.row];
         return ration_glj;
     },
-
-
     getUnitPriceCodeMap : function () {//取单价文件中,编码前缀一样的映射表
         let codeMap = {};
         let priceMap = projectObj.project.projectGLJ.datas.unitPriceMap;
@@ -758,6 +756,7 @@ var gljOprObj = {
         return data;
 
     },
+
     getBasePrice:function (treeNode) {//造价书中的工料机修改的节点要用到
         let proGLJ =  projectObj.project.projectGLJ;
         let glj =_.find(proGLJ.datas.gljList, {'id': treeNode.data.projectGLJID});

+ 118 - 19
web/building_saas/main/js/views/locate_view.js

@@ -2,37 +2,136 @@
  * Created by zhang on 2018/11/16.
  */
 let locateObject={
+    bills_setting:{
+        header:[
+            {headerName: "编码", headerWidth: 120, dataCode: "code", dataType: "String"},
+            {headerName: "项目名称", headerWidth: 100, dataCode: "name", dataType: "String"},
+            {headerName: "单位", headerWidth: 50, dataCode: "unit", dataType: "String",hAlign: "center"},
+            {headerName: "工程量", headerWidth: 65, dataCode: "quantity", dataType: "Number", hAlign: "right"},
+            {headerName: "综合单价", headerWidth: 65, dataCode: "unitPrice", dataType: "Number", hAlign: "right"},
+            {headerName: "综合合价", headerWidth: 65, dataCode: "totalPrice", dataType: "Number", hAlign: "right"}
+        ],
+        view: {
+            lockColumns: [0,1,2,3,4],
+            rowHeaderWidth:25
+        }
+    },
+    ration_setting:{
+        header:[
+            {headerName: "定额编码", headerWidth: 100, dataCode: "code", dataType: "String"},
+            {headerName: "定额名称", headerWidth: 180, dataCode: "name", dataType: "String"},
+            {headerName: "单位", headerWidth: 50, dataCode: "unit", dataType: "String",hAlign: "center"},
+            {headerName: "工程量", headerWidth: 65, dataCode: "quantity", dataType: "Number", hAlign: "right",decimalField: "ration.quantity"}
+        ],
+        view: {
+            lockColumns: [0,1,2,3],
+            rowHeaderWidth:25
+        }
+    },
+    ration_glj_setting:{
+        header:[
+            {headerName: "编码", headerWidth: 120, dataCode: "code", dataType: "String"},
+            {headerName: "名称", headerWidth: 80, dataCode: "name", dataType: "String"},
+            {headerName: "规格型号", headerWidth: 80, dataCode: "code", dataType: "String"},
+            {headerName: "单位", headerWidth: 50, dataCode: "unit", dataType: "String",hAlign: "center"},
+            {headerName: "市场价", headerWidth: 65, dataCode: "marketPrice", dataType: "Number", hAlign: "right"}
+        ],
+        view: {
+            lockColumns: [0,1,2,3],
+            rowHeaderWidth:25
+        }
+    },
+    initMainSpread:function(){
+        if(!this.mainSpread){
+            this.mainSpread = SheetDataHelper.createNewSpread($("#locate_result")[0],3);
+            sheetCommonObj.spreadDefaultStyle(this.mainSpread);
+            this.initMainSheet();
+        }else {
+            this.mainSpread.refresh();
+        }
+    },
+    initMainSheet:function () {
+       // this.mainSheet = this.mainSpread .getSheet(0);
+        //this.spread.bind(GC.Spread.Sheets.Events.ButtonClicked, this.onReplaceButtonClick);
+       //初始化清单表格
+        sheetCommonObj.initSheet(this.mainSpread .getSheet(0),this.bills_setting);
+        this.mainSpread .getSheet(0).setRowCount(0);
+        //初始化定额表格
+        sheetCommonObj.initSheet(this.mainSpread .getSheet(1),this.ration_setting);
+        this.mainSpread .getSheet(1).setRowCount(0);
 
-
+        //初始化人材机表格
+        sheetCommonObj.initSheet(this.mainSpread.getSheet(2),this.ration_glj_setting);
+        this.mainSpread .getSheet(2).setRowCount(0);
+    },
+    initSubSpread:function () {
+        if(!this.subSpread){
+            this.subSpread = SheetDataHelper.createNewSpread($("#locate_sub")[0]);
+            sheetCommonObj.spreadDefaultStyle(this.subSpread);
+            this.initSubSheet();
+        }else {
+            this.subSpread.refresh();
+        }
+    },
+    initSubSheet:function () {
+        this.subSheet = this.subSpread .getSheet(0);
+        sheetCommonObj.initSheet( this.subSheet, this.ration_setting);
+        this.subSheet.setRowCount(0);
+        //this.spread.bind(GC.Spread.Sheets.Events.ButtonClicked, this.onReplaceButtonClick);
+        this.subSheet.name('locate_sub');
+    },
+    showMainData:function () {
+        let datas = [];
+        //sheetCommonObj.showData(this.mainSheet,this.mainSettiong,datas);
+        this.mainSpread.getActiveSheet().setRowCount(datas.length);
+    },
     init:function () {
-        let tab_content = $('#locate').parent();
-        $('#locate_result').height(tab_content.height()*0.6);
-        $('#locate_sub').height(tab_content.height()*0.4);
-
+        let me = this;
+        let options = $("input[name='content_type']:checked").val();
+        let callback = function () {
+            let mainHeight = $(window).height()-$(".header").height()-$(".toolsbar").height()-$("#searchPanel").height();
+            let subHeight = 0;
+            if(options == "ration_glj"){
+                subHeight = mainHeight*0.4;
+                mainHeight = mainHeight*0.6;
+            }
+            console.log(mainHeight);
+            $('#locate_result').height(mainHeight);
+            $('#locate_sub').height(subHeight - 7);
+            me.initMainSpread();
+            me.initSubSpread();
+            me.showMainData();
+        };
+        options == "bills"?$("#outstandingOptions").show(0,callback):$("#outstandingOptions").hide(0,callback);
 
     },
+    findRecodes:function () {
 
+    },
     onshow:function () {
-
         locateObject.init();
-        console.log('#locate is now visible');
-        console.log($("#locate").is(':visible'))
     }
-
 }
 
 
+$("#locate_btn").click(function () {
+    locateObject.findRecodes();
+});
 
-
-/*
-$("input[name='install_setting_radios']").each(function(){
+$("input[name='content_type']").each(function(){
     $(this).click(function(){
-        var settingVal = $(this).val();
-        let installSetting = projectInfoObj.projectInfo.property.installSetting;
-        if(installSetting==settingVal){
-            return;
+        let optins = $(this).val();
+        switch (optins){
+            case "bills":
+                locateObject.mainSpread.setActiveSheetIndex(0);
+                break;
+            case "ration":
+                locateObject.mainSpread.setActiveSheetIndex(1);
+                break;
+            case "ration_glj":
+                locateObject.mainSpread.setActiveSheetIndex(2);
+                break;
         }
-        projectObj.project.installation_fee.updateInstallSetting(settingVal);
-        installationFeeObj.cleanPositionIfNeed(settingVal);
+        locateObject.init();
     });
-});*/
+});

+ 1 - 0
web/building_saas/main/js/views/project_view.js

@@ -183,6 +183,7 @@ var projectObj = {
     },
     checkFormulaValidField: function (editingText, colSetting) {
         let value = Number(editingText);
+        if(isNaN(value)) return value;
         if (!value) {
             try {
                 let exp = new Expression('');