Ver código fonte

Merge branch 'master' of http://smartcost.f3322.net:3000/SmartCost/ConstructionCost

olym 7 anos atrás
pai
commit
16da519025

+ 1 - 1
modules/pm/models/project_property_template.js

@@ -13,7 +13,7 @@ const defaultDecimal = {
 };
 const displaySetting = {
     autoHeight:true,
-    disPlayMainMateria:true
+    disPlayMainMaterial:true
 }
 
 /*

+ 1 - 1
modules/ration_glj/facade/ration_glj_facade.js

@@ -138,7 +138,7 @@ function get_lib_glj_info(ration_glj) {
                     }
                 });
             }else {
-                cb(null,null);
+                cb(null,result);
             }
         })
     }

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

@@ -448,13 +448,13 @@
                                         <fieldset class="form-group">
                                             <div class="form-check">
                                                 <label class="form-check-label">
-                                                    <input class="form-check-input" id="autoHeight" value="1" type="checkbox">
+                                                    <input class="form-check-input" id="autoHeight" type="checkbox">
                                                     造价书表格自动调整行高
                                                 </label>
                                             </div>
                                             <div class="form-check">
                                                 <label class="form-check-label">
-                                                    <input class="form-check-input" id="disPlayMainMaterial" value="1" type="checkbox">
+                                                    <input class="form-check-input" id="disPlayMainMaterial" type="checkbox">
                                                     定额下显示主材、设备
                                                 </label>
                                             </div>

+ 6 - 3
web/building_saas/main/js/models/calc_base.js

@@ -277,7 +277,7 @@ let baseFigureTemplate = {
         return 0;
     },
     'FBFXGCLQDJJZJGCF': function () {
-        return this['FBFXDEJJRGF']() + this['FBFXDEJJCLF']() + this['FBFXDEJJJXF']();
+        return (this['FBFXDEJJRGF']() + this['FBFXDEJJCLF']() + this['FBFXDEJJJXF']()).toDecimal(decimalObj.bills.totalPrice);
     },
     'CSXMF': function () {
         let bill = calcBase.fixedBills[calcBase.fixedFlag.MEASURE]['bill'];
@@ -292,7 +292,7 @@ let baseFigureTemplate = {
         return bill.feesIndex.common.totalFee || 0;
     },
     'ZZCSXMDEJJZJGCF': function () {
-        return this['ZZCSXMDEJJRGF']() + this['ZZCSXMDEJJCLF']() + this['ZZCSXMDEJJJXF']()
+        return (this['ZZCSXMDEJJRGF']() + this['ZZCSXMDEJJCLF']() + this['ZZCSXMDEJJJXF']()).toDecimal(decimalObj.bills.totalPrice);
     },
     'ZZCSXMDEJJRGF': function () {
         let bill = calcBase.fixedBills[calcBase.fixedFlag.CONSTRUCTION_ORGANIZATION]['bill'];
@@ -364,7 +364,7 @@ let baseFigureTemplate = {
         return 0;
     },
     'JSCSXMQDDEJJZJGCF': function () {
-        return this['JSCSXMDEJJRGF']() + this['JSCSXMDEJJCLF']() + this['JSCSXMDEJJJXF']();
+        return (this['JSCSXMDEJJRGF']() + this['JSCSXMDEJJCLF']() + this['JSCSXMDEJJJXF']()).toDecimal(decimalObj.bills.totalPrice);
     },
     'QTXMF': function () {
         let bill = calcBase.fixedBills[calcBase.fixedFlag.OTHER]['bill'];
@@ -579,6 +579,9 @@ let calcBase = {
     getBaseByClass: function (node) {
         return cbTools.getFigure(node);
     },
+    getBaseBill: function (node) {
+        return cbTools.getBaseBill(node);
+    },
     calculate: function (node) {
         let me = calcBase,
             $CBA = cbAnalyzer,

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

@@ -954,7 +954,8 @@ class CalcProgram {
         };
 
         calcNodes(me.project.mainTree.roots);
-        me.saveNodes(needSaveNodes);
+        // me.saveNodes(needSaveNodes);   保存要与计算分离,否则实际应用场景中,会产生多次通讯。
+        return needSaveNodes;
     };
 
     // 重新计算叶子清单下的所有子结点:如定额、工料机定额等(calculate算法基于定额、工料机定额的计算结果是正确的,实际上有时它们的计算结果并不是最新的)

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

@@ -143,7 +143,7 @@ var PROJECT = {
                     newNode.sourceType = that.Ration.getSourceType();
                     newNode.data = br[i];
                     if(projectInfoObj.projectInfo.property.displaySetting !== undefined &&
-                        projectInfoObj.projectInfo.property.displaySetting.disPlayMainMateria==true){
+                        projectInfoObj.projectInfo.property.displaySetting.disPlayMainMaterial==true){
                         loadRationGLJNode(newNode);
                     }
                 }

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

@@ -184,7 +184,7 @@ ProjectGLJ.prototype.updateBasePriceFromRG=function(recode,updateField,newval){
     }
 }
 ProjectGLJ.prototype.refreshTreeNodePriceIfNeed = function (data) {
-    if((data.unit_price.type = gljType.MAIN_MATERIAL||data.type==gljType.EQUIPMENT)&&projectInfoObj.projectInfo.property.displaySetting.disPlayMainMateria==true){
+    if((data.unit_price.type = gljType.MAIN_MATERIAL||data.unit_price.type==gljType.EQUIPMENT)&&projectInfoObj.projectInfo.property.displaySetting.disPlayMainMaterial==true){
         var nodes = _.filter(projectObj.project.mainTree.items,function (tem) {
             if(tem.sourceType==ModuleNames.ration_glj&&tem.data.projectGLJID ==data.id){
                 tem.data.marketUnitFee = data.unit_price.market_price;

+ 24 - 11
web/building_saas/main/js/models/ration_glj.js

@@ -175,7 +175,8 @@ var ration_glj = {
             return glj_list[glj_index].rationID;
         };
         ration_glj.prototype.refreshAfterDelete=function(data){
-            var glj_list = projectObj.project.ration_glj.datas;
+            var me = projectObj.project.ration_glj;
+            var glj_list = me.datas;
             var oldData = _.remove(glj_list,data.query);
             _.remove(gljOprObj.sheetData,data.query);
             gljOprObj.showRationGLJSheetData();
@@ -193,9 +194,7 @@ var ration_glj = {
             projectObj.mainController.refreshTreeNode([rationNode]);
             for(let o of oldData){
                 if(this.needShowToTree(o)){
-                    let node = _.find(projectObj.project.mainTree.items,function (n) {//找到对应的树节点
-                        return n.sourceType==ModuleNames.ration_glj &&n.data.ID==o.ID;
-                    });
+                    let node = me.findTreeNodeByID(o.ID);  //找到对应的树节点
                     projectObj.mainController.deleteNode(node,next);
                 }
             }
@@ -410,7 +409,10 @@ var ration_glj = {
           var allGLJ=gljOprObj.AllRecode;
             GLJSelection.sort();
           _.forEach(GLJSelection,function (g) {
-              var glj=_.find(allGLJ,{'code':g});
+              var glj=_.find(allGLJ,function (item) {
+                var i_key = gljOprObj.getIndex(item,['code','name','specs','unit','gljType']);
+                return i_key ==g;
+              });
               var ration_glj ={
                   projectID:ration.projectID,
                   GLJID:glj.ID,
@@ -446,8 +448,11 @@ var ration_glj = {
         };
         ration_glj.prototype.replaceGLJ=function (selectCode,oldData,callback) {
             var allGLJ=gljOprObj.AllRecode;
-            var glj=_.find(allGLJ,{'code':selectCode});
-            if(selectCode==oldData.code){
+            var glj=_.find(allGLJ,function (item) {
+                var i_key = gljOprObj.getIndex(item,['code','name','specs','unit','gljType']);
+                return i_key ==selectCode;
+            });
+            if(selectCode==gljOprObj.getIndex(oldData,['code','name','specs','unit','type'])){
                 return callback(null);
             }
             if(oldData.createType!='replace'){
@@ -479,8 +484,11 @@ var ration_glj = {
 
         ration_glj.prototype.mReplaceGLJ=function (selectCode,oldData,callback) {
             var allGLJ=gljOprObj.AllRecode;
-            var glj=_.find(allGLJ,{'code':selectCode});
-            if(selectCode==oldData.code){
+            var glj=_.find(allGLJ,function (item) {
+                var i_key = gljOprObj.getIndex(item,['code','name','specs','unit','gljType']);
+                return i_key ==selectCode;
+            });
+            if(selectCode== gljOprObj.getIndex(oldData,['code','name','specs','unit','type'])){
                 return callback(null);
             }
             var query={
@@ -570,12 +578,17 @@ var ration_glj = {
                 gljOprObj.refreshTreeNode({"type":ModuleNames.ration_glj,"ID":data.ID});
             }
         };
-
         ration_glj.prototype.needShowToTree=function(data){
-            if((data.type == gljType.MAIN_MATERIAL||data.type==gljType.EQUIPMENT)&&projectInfoObj.projectInfo.property.displaySetting.disPlayMainMateria==true){
+            if((data.type == gljType.MAIN_MATERIAL||data.type==gljType.EQUIPMENT)&&projectInfoObj.projectInfo.property.displaySetting.disPlayMainMaterial==true){
                 return true
             }
             return false
+        };
+        ration_glj.prototype.findTreeNodeByID = function (ID) {
+            let node = _.find(projectObj.project.mainTree.items,function (n) {//找到对应的树节点
+                return n.sourceType==ModuleNames.ration_glj &&n.data.ID==ID;
+            });
+            return node;
         }
         return new ration_glj(project);
     }

+ 60 - 18
web/building_saas/main/js/views/glj_view.js

@@ -856,7 +856,7 @@ var gljOprObj = {
         }else {
             me.gljLibSheetData=me[val];
         }
-        if($('#actionType').val()!='add'){
+        if($('#actionType').val()=='replace'||$('#actionType').val()=='m_replace'){
             me.filterLibGLJByType();
         }
         if(me.gljCurTypeId==undefined){
@@ -871,36 +871,44 @@ var gljOprObj = {
         }
     },
     setGLJSelection:function (args,newVal) {
-        if($('#actionType').val()=='add'){
+        if($('#actionType').val()=='add'||$('#actionType').val()=='insert'){
             this.addGLJsSelection(args,newVal);
         }else {
             this.replaceGLJSelection(args,newVal);
         }
     },
     addGLJsSelection:function (args,newVal) {
+         var con_key = this.getIndex(this.gljLibSheetData[args.row],['code','name','specs','unit','gljType'])
         if(newVal==1){
-            this.GLJSelection.push(this.gljLibSheetData[args.row].code);
+            this.GLJSelection.push(con_key);
             this.gljLibSheetData[args.row].select=1;
         }else if(newVal==0){
-            _.pull(this.GLJSelection,this.gljLibSheetData[args.row].code);
+            _.pull(this.GLJSelection,con_key);
             this.gljLibSheetData[args.row].select=0;
         }
     },
     replaceGLJSelection:function (args,newVal) {
+        var me =this;
         var oldSelection=this.GLJSelection[0];
         if(newVal==0){
             args.sheet.getCell(args.row, args.col).value(1);
             return;
         }
-        this.GLJSelection=[this.gljLibSheetData[args.row].code];
+        this.GLJSelection=[me.getIndex(this.gljLibSheetData[args.row],['code','name','specs','unit','gljType'])];
         this.gljLibSheetData[args.row].select=1;
-        var oindex = _.findIndex(this.gljLibSheetData,{'code':oldSelection});
+        var oindex = _.findIndex(this.gljLibSheetData,function (item) {
+            var i_key = me.getIndex(item,['code','name','specs','unit','gljType']);
+            return oldSelection==i_key;
+        });
         if(oindex!=-1){
             args.sheet.getCell(oindex, args.col).value(0);
             this.gljLibSheetData[oindex].select=0;
         }else {
-            var oldData = _.find(gljOprObj.AllRecode,{'code':oldSelection})
-            oldData.select=0;
+            var oldData = _.find(gljOprObj.AllRecode,function (item) {
+                var i_key = me.getIndex(item,['code','name','specs','unit','gljType']);
+                return oldSelection==i_key;
+            });
+            oldData?oldData.select=0:"";
         }
     },
     filterLibGLJByType:function () {
@@ -941,11 +949,20 @@ var gljOprObj = {
         });
         return distTypeTree;
     },
+    doInsertGLJ:function () {
+        var selected = projectObj.project.mainTree.selected;
+        var project= projectObj.project;
+        console.log(gljOprObj.GLJSelection);
+    },
     doAddGLJ:function () {
         var selected = projectObj.project.mainTree.selected;
         var project= projectObj.project;
         gljOprObj.GLJSelection= _.filter(gljOprObj.GLJSelection,function (n) {
-            return _.find(gljOprObj.sheetData,{'code':n})?false:true;
+            var rg = _.find(gljOprObj.sheetData,function (item) {
+                var i_key = gljOprObj.getIndex(item,['code','name','specs','unit','type']);
+                 return n==i_key
+            })
+            return rg?false:true;
         })
         if(gljOprObj.GLJSelection.length>0&&selected&&selected.sourceType==ModuleNames.ration){
             $("#glj_tree_div").modal('hide');
@@ -979,11 +996,22 @@ var gljOprObj = {
                 //result.adjustState;
                 var data =result.data;
                 var index = _.findIndex(gljOprObj.sheetData,{'ID':data.ID});
+                var nodes = [selected];
                 gljOprObj.sheetData[index]=data;
                 gljOprObj.showRationGLJSheetData();
+                if(project.ration_glj.needShowToTree(data)){//当替换的是主材或设备时,刷新对应的树节点
+                    var  node =  project.ration_glj.findTreeNodeByID(data.ID);
+                    if(node){
+                        project.ration_glj.transferToNodeData(data);
+                        node.source = data;
+                        node.data = data;
+                    }
+                    node?nodes.push(node):"";
+                }
+                //project.ration_glj.addToMainTree(data);
                 project.projectGLJ.loadData();
                 selected.data.adjustState=result.adjustState;
-                projectObj.mainController.refreshTreeNode([selected]);
+                projectObj.mainController.refreshTreeNode(nodes);
             }
             $.bootstrapLoading.end();
         })
@@ -998,15 +1026,21 @@ var gljOprObj = {
             var data=result.data;
             var stateList= result.stateList;
             var n_index = me.getIndex(data.query,['code','name','specs','unit','type']);
+            var nodes=[];
             _.forEach(project.ration_glj.datas,function (t) {
                 var t_index =me.getIndex(t,['code','name','specs','unit','type']);
                 if(n_index==t_index){
                     me.updateProperty(t,data.doc);
+                    if(project.ration_glj.needShowToTree(t)){//如果是造价书中的树节点,则也须刷新
+                        project.ration_glj.transferToNodeData(t);
+                        var node = project.ration_glj.findTreeNodeByID(t.ID);
+                        nodes.push(node);
+                    }
                 }
             })
             me.showRationGLJSheetData();
             project.projectGLJ.loadData();
-            me.refreshStateAfterMreplace(stateList);
+            me.refreshStateAfterMreplace(stateList,nodes);
             $.bootstrapLoading.end();
         })
     },
@@ -1015,7 +1049,7 @@ var gljOprObj = {
             obj[key] = n;
         });
     },
-    refreshStateAfterMreplace:function (stateList) {
+    refreshStateAfterMreplace:function (stateList,gljNodes) {
         var nodes=[];
         _.forEach(stateList,function (s) {
           var node = _.find(projectObj.project.mainTree.items,function (n) {
@@ -1026,6 +1060,7 @@ var gljOprObj = {
               nodes.push(node);
           }
         });
+        gljNodes.length>0?nodes = nodes.concat(gljNodes):"";
         projectObj.mainController.refreshTreeNode(nodes);
     },
     refreshView:function () {
@@ -1180,16 +1215,21 @@ $(function(){
         }
         gljOprObj.gljLibSheetData =gljOprObj.AllRecode;
         var selected=null;
-        if($('#actionType').val()=='add'){
+        if($('#actionType').val()=='add'||$('#actionType').val()=='insert'){
             gljOprObj.GLJSelection=[];
         }else {
              selected=gljOprObj.sheetData[gljContextMenu.selectedRow];
-            gljOprObj.GLJSelection=[selected.code];
+             var connect_key = gljOprObj.getIndex(selected,['code','name','specs','unit','type'])
+            gljOprObj.GLJSelection=[connect_key];
             gljOprObj.filterLibGLJByType();
         }
 
         if(selected!=null){
-            var r = _.find(gljOprObj.gljLibSheetData,{'code':selected.code});
+            var s_key = gljOprObj.getIndex(selected,['code','name','specs','unit','gljType']);
+            var r = _.find(gljOprObj.gljLibSheetData,function (item) {
+                var item_key = gljOprObj.getIndex(item,['code','name','specs','unit','type']);
+                return s_key == item_key;
+            });
             r?r.select=1:"";
         }
         gljOprObj.showLibGLJSheetData();
@@ -1211,11 +1251,13 @@ $(function(){
         if(gljOprObj.GLJSelection.length<1){
             return;
         }
-        if($('#actionType').val()=='add'){
+        if($('#actionType').val()=='insert'){  //造价书页面中插入定额类型的工料机
+            gljOprObj.doInsertGLJ();
+        }else if($('#actionType').val()=='add'){ //添加工料机
             gljOprObj.doAddGLJ();
-        }else if($('#actionType').val()=='replace'){
+        }else if($('#actionType').val()=='replace'){//替换工料机
             gljOprObj.doReplaceGLJ();
-        }else if($('#actionType').val()=='m_replace'){
+        }else if($('#actionType').val()=='m_replace'){//批量替换工料机
             gljOprObj.doMReplaceGLJ();
         }
     })

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

@@ -157,12 +157,12 @@ let MainTreeCol = {
         // CSL, 2017-11-28
         subType: function (node) {
             if (node.data.type == rationType.volumePrice || node.data.type == rationType.gljRation||node.sourceType === projectObj.project.ration_glj.getSourceType()){
-                let VPType = new GC.Spread.Sheets.CellTypes.ComboBox();
+                let VPType = sheetCommonObj.getDynamicCombo();;
 
                 if (node.data.type == rationType.volumePrice)
-                    VPType.items(["人工","材料","机械","主材","设备"])
+                    VPType.itemHeight(5).items(["人工","材料","机械","主材","设备"])
                 else if (node.data.type == rationType.gljRation||node.sourceType === projectObj.project.ration_glj.getSourceType())
-                    VPType.items(["材料","主材","设备"]);
+                    VPType.itemHeight(3).items(["材料","主材","设备"]);
 
                 return VPType;
             };

+ 16 - 8
web/building_saas/main/js/views/project_property_decimal_view.js

@@ -178,20 +178,28 @@ function v_initPanel(data){
 function e_validIn(inputs){
     for(let i = 0, len = inputs.length; i < len; i++){
         let orgV = $(inputs[i]).val();
-        $(inputs[i]).keydown(function () {
-            let v = $(this).val();
-            if(v.trim().length > 0 && isValidDigit(v)){
-                orgV = v;
-            }
-        });
-        $(inputs[i]).keyup(function () {
+        $(inputs[i]).bind('input', function () {
             let v = $(this).val();
+            let inputName = $(this).attr('name');
             if(v.trim().length === 0 || !isValidDigit(v)){
                 alert('小数位数范围在0-6!');
                 $(this).val(orgV);
             }
             else{
-                //let newV = parseInt(v);
+                orgV = v;
+                //清单单价、合价 与定额单价、合价同步
+                if(inputName === 'bills-unitPrice'){
+                    $("input[name='ration-unitPrice']").val(v);
+                }
+                else if(inputName === 'bills-totalPrice'){
+                    $("input[name='ration-totalPrice']").val(v);
+                }
+                else if(inputName === 'ration-unitPrice'){
+                    $("input[name='bills-unitPrice']").val(v);
+                }
+                else if(inputName === 'ration-totalPrice'){
+                    $("input[name='bills-totalPrice']").val(v);
+                }
             }
         });
     }

+ 8 - 5
web/building_saas/main/js/views/project_property_display_view.js

@@ -12,6 +12,9 @@ let projDisplayView = {
  },
 
     needUpdate: function(autoHeight, disPlayMainMaterial) {
+        if(this.datas==null){
+            return;
+        }
         return autoHeight !== this.datas.autoHeight || disPlayMainMaterial !== this.datas.disPlayMainMaterial;
     },
 
@@ -20,13 +23,13 @@ let projDisplayView = {
             return;
         }
         var autoHeight = $('#autoHeight').prop('checked');
-        var disPlayMainMateria = $('#disPlayMainMateria').prop('checked');
-        if(this.datas.autoHeight!==autoHeight||this.datas.disPlayMainMateria!==disPlayMainMateria){
+        var disPlayMainMaterial = $('#disPlayMainMaterial').prop('checked');
+        if(this.datas.autoHeight!==autoHeight||this.datas.disPlayMainMaterial!==disPlayMainMaterial){
             this.datas.autoHeight=autoHeight;
-            this.datas.disPlayMainMateria=disPlayMainMateria;
+            this.datas.disPlayMainMaterial=disPlayMainMaterial;
+            let updateData = {sourceType: 'properties', updateType: 'update', updateData: {ID: projectID, 'property.displaySetting':this.datas}};
+            properties.push(updateData);
         }
-        let updateData = {updateType: 'update', updateData: {ID: projectID, 'property.displaySetting':this.datas}};
-        properties.push(updateData);
     }
 };
 

+ 34 - 17
web/building_saas/main/js/views/project_view.js

@@ -341,7 +341,7 @@ var projectObj = {
     },
     mainSpreadEnterCell: function (sender, info) {
         let colSetting = projectObj.mainController.setting.cols[info.col];
-        if(colSetting.data.field === 'unit' || projectObj.lastCol.data.field === 'unit'){
+        if(colSetting.data.field === 'unit' || projectObj.lastCol.data.field === 'unit'||colSetting.data.field ==='subType'|| projectObj.lastCol.data.field === 'subType'){
             info.sheet.repaint();
         }
     },
@@ -357,7 +357,7 @@ var projectObj = {
         // 自动行高
         const autoHeight = project.property.displaySetting.autoHeight;
         if (autoHeight) {
-            this.mainSpread.getActiveSheet().autoFitRow(info.row);
+            projectObj.mainSpread.getActiveSheet().autoFitRow(info.row);
         }
     },
     mainSpreadRangeChanged: function (sender, info) {
@@ -520,6 +520,18 @@ var projectObj = {
                         ProjectController.addRation(project, controller, rationType.volumePrice);
                     }
                 },
+                "insertGLJ": {
+                    name: "插入工料机",
+                    icon: 'fa-sign-in',
+                    disabled: function () {
+                        var selected = project.mainTree.selected;
+                        var readOnly = MainTreeCol.readOnly;
+                        return readOnly.billsParent(selected)||(readOnly.bills(selected)&&!readOnly.calcBaseType(selected));
+                    },
+                    callback: function (key, opt) {
+                        getGLJData('insert');// ProjectController.addRation(project, controller, rationType.volumePrice);
+                    }
+                },
                 "spr1": '--------',
                 "delete": {
                     name: '删除',
@@ -696,7 +708,7 @@ $('#property_ok').click(function () {
     let b = parseInt($("input[name='calcFlag']:checked").val());
 
     if (b !== project.property.billsCalcMode) {
-        let bData = {updateType: 'update', updateData: {ID: projectID, 'property.billsCalcMode': b}};
+        let bData = {sourceType: 'properties', updateType: 'update', updateData: {ID: projectID, 'property.billsCalcMode': b}};
         properties.push(bData);
         project.property.billsCalcMode = b;
         reCalcBills = true;
@@ -704,7 +716,7 @@ $('#property_ok').click(function () {
 
     let zg = parseInt($("input[name='zangu']:checked").val());
     if (zg !== project.property.zanguCalcMode) {
-        let zgData = {updateType: 'update', updateData: {ID: projectID, 'property.zanguCalcMode': zg}};
+        let zgData = {sourceType: 'properties', updateType: 'update', updateData: {ID: projectID, 'property.zanguCalcMode': zg}};
         properties.push(zgData);
         project.property.zanguCalcMode = zg;
         reCalcBills = true;
@@ -712,19 +724,19 @@ $('#property_ok').click(function () {
 
     //基本信息
     if(basicInfoView.toUpdate(basicInfoView.orgDatas, basicInfoView.datas)){
-        let updateData = {updateType: 'update', updateData: {ID: projectID, 'property.basicInformation': basicInfoView.toSaveDatas(basicInfoView.datas)}};
+        let updateData = {sourceType: 'properties', updateType: 'update', updateData: {ID: projectID, 'property.basicInformation': basicInfoView.toSaveDatas(basicInfoView.datas)}};
         properties.push(updateData);
     }
     //工程特征
     if(projFeatureView.toUpdate(projFeatureView.orgDatas, projFeatureView.datas)){
-        let updateData = {updateType: 'update', updateData: {ID: projectID, 'property.projectFeature': projFeatureView.toSaveDatas(projFeatureView.datas)}};
+        let updateData = {sourceType: 'properties', updateType: 'update', updateData: {ID: projectID, 'property.projectFeature': projFeatureView.toSaveDatas(projFeatureView.datas)}};
         properties.push(updateData);
     }
     //清单工程量精度
     let newBillsDecimalDatas = billsDecimalView.toBillsDecimalDatas(billsDecimalView.cache);
     if(billsDecimalView.toUpdate(billsQuanDecimal.datas, newBillsDecimalDatas)){
         reCalcBills = true;
-        let updateData = {updateType: 'update', updateData: {ID: projectID, 'property.billsQuantityDecimal': newBillsDecimalDatas}};
+        let updateData = {sourceType: 'properties', updateType: 'update', updateData: {ID: projectID, 'property.billsQuantityDecimal': newBillsDecimalDatas}};
         properties.push(updateData);
     }
     //小数位数
@@ -733,9 +745,10 @@ $('#property_ok').click(function () {
     if(toUpdateDecimal(decimalObj, updateDecimal)){
         reCalcRations = true;
         reCalcBills = true;
-        let updateData = {updateType: 'update', updateData: {ID: projectID, 'property.decimal': updateDecimal}};
+        let updateData = {sourceType: 'properties', updateType: 'update', updateData: {ID: projectID, 'property.decimal': updateDecimal}};
         properties.push(updateData);
-    }
+    };
+
     // 人工系数
     let lcData;
     if (labourCoeView.needSave()){
@@ -746,18 +759,19 @@ $('#property_ok').click(function () {
         let projectID = projectInfoObj.projectInfo.ID;
         let libID = $("#std_labour_coe_files").children("option:selected").val();
         let libName = $("#std_labour_coe_files").children("option:selected").text();
-        lcData = {projectID: projectID, libID: libID, libName: libName, newItemArr: labourCoeView.needUpdateDatas};
+        lcData = {sourceType: 'labourCoe', projectID: projectID, libID: libID, libName: libName, newItemArr: labourCoeView.needUpdateDatas};
         properties.push(lcData);
     };
 
     // 呈现选项
-    const autoHeight = $("#autoHeight:checked").length > 0;
-    const disPlayMainMaterial = $("#disPlayMainMaterial:checked").length > 0;
-    if (projDisplayView.needUpdate(autoHeight, disPlayMainMaterial)) {
+    projDisplayView.updateChecking(projectID,properties);
+ /*   const autoHeight = $("#autoHeight:checked").length > 0;
+    const disPlayMainMaterial = $("#disPlayMainMaterial:checked").length > 0;*/
+/*    if (projDisplayView.needUpdate(autoHeight, disPlayMainMaterial)) {
         const displaySetting = { autoHeight, disPlayMainMaterial };
-        let updateData = {updateType: 'update', updateData: {ID: projectID, 'property.displaySetting': displaySetting}};
+        let updateData = {sourceType: 'properties', updateType: 'update', updateData: {ID: projectID, 'property.displaySetting': displaySetting}};
         properties.push(updateData);
-    }
+    }*/
 
     // 重新计算树节点
     let changedNodes = [];
@@ -779,14 +793,17 @@ $('#property_ok').click(function () {
                 feeRate: node.data.feeRate,
                 feeRateID: node.data.feeRateID
             };
-            let dataObj = {updateType: 'ut_update', updateData: data};
-            properties.push(changedNodes);
+            let dataObj = {sourceType: node.sourceType, updateType: 'ut_update', updateData: data};
+            properties.push(dataObj);
         };
     };
 
     console.log(properties);
     if(properties.length > 0){
         CommonAjax.post('/pm/api/updateMixDatas', {user_id: userID, updateData: properties}, function (rstData) {
+            if (changedNodes.length > 0) {
+                for (let node of changedNodes){delete node.changed};
+            };
             if (lcData) labourCoeView.refresh(lcData);
             window.location.href = '/main?project=' + projectID;
         });