|
|
@@ -1706,8 +1706,9 @@ var projectObj = {
|
|
|
projectObj.onIsEstimateClick(node,info);
|
|
|
}else if(fieldName == "evaluationProject"){
|
|
|
projectObj.onEvaluationProjectClic(node,info);
|
|
|
+ }else if(fieldName == "unitPriceAnalysis"){
|
|
|
+ projectObj.onUnitPriceAnalysisClick(node,info);
|
|
|
}
|
|
|
-
|
|
|
},
|
|
|
onEvaluationProjectClic:function (node,info) {
|
|
|
let checkboxValue = info.sheet.getCell(info.row, info.col).value();
|
|
|
@@ -1719,8 +1720,7 @@ var projectObj = {
|
|
|
projectObj.project.calcProgram.calcAndSave(node);
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
- onIsEstimateClick: function(node,info){
|
|
|
+ setAndGetCheckBoxVal:function (info) {
|
|
|
let checkboxValue = info.sheet.getCell(info.row, info.col).value();
|
|
|
let cell = info.sheet.getCell(info.row, info.col), newval = 0;
|
|
|
if (checkboxValue) {
|
|
|
@@ -1730,6 +1730,10 @@ var projectObj = {
|
|
|
newval = 1;
|
|
|
cell.value(newval);
|
|
|
}
|
|
|
+ return newval;
|
|
|
+ },
|
|
|
+ onIsEstimateClick: function(node,info){
|
|
|
+ let newval = projectObj.setAndGetCheckBoxVal(info);
|
|
|
if(MainTreeCol.readOnly.bills(node)){
|
|
|
projectObj.updateNodeField(node,newval,'isEstimate');
|
|
|
}else if(node.data.projectGLJID){//更新的是定额类型的工料机或者是显示在造价书页面的主材、设备
|
|
|
@@ -1738,6 +1742,44 @@ var projectObj = {
|
|
|
projectObj.project.projectGLJ.pGljUpdate(updateData);
|
|
|
}
|
|
|
},
|
|
|
+ onUnitPriceAnalysisClick:function (unode,info) {
|
|
|
+ let updateDatas=[],nodes=[];
|
|
|
+ let newval = projectObj.setAndGetCheckBoxVal(info);
|
|
|
+ //仅对大项费用、清单有效,修改父项清单,子项清单跟随修改。
|
|
|
+ if(unode.sourceType == ModuleNames.bills) unitPriceAnalysisUpdate(unode,newval);
|
|
|
+ if(updateDatas.length > 0){
|
|
|
+ $.bootstrapLoading.start();
|
|
|
+ projectObj.project.updateNodes(updateDatas,function () {
|
|
|
+ for(let n of nodes){
|
|
|
+ n.data.unitPriceAnalysis = newval;
|
|
|
+ }
|
|
|
+ projectObj.mainController.refreshTreeNode(nodes);
|
|
|
+ $.bootstrapLoading.end();
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ function unitPriceAnalysisUpdate(node,val){
|
|
|
+ updateDatas.push(getUnitPriceUpdataData(node,val));
|
|
|
+ nodes.push(node);
|
|
|
+ if(node.children.length > 0 && node.children[0].sourceType == ModuleNames.bills) {//仅对大项费用、清单有效
|
|
|
+ for(let i = 0;i<node.children.length;i++ ){
|
|
|
+ unitPriceAnalysisUpdate(node.children[i],val)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function getUnitPriceUpdataData(node,val) {
|
|
|
+ let data = {
|
|
|
+ type:node.sourceType,
|
|
|
+ data:{
|
|
|
+ ID:node.data.ID,
|
|
|
+ unitPriceAnalysis:val
|
|
|
+ }
|
|
|
+ };
|
|
|
+ return data;
|
|
|
+ }
|
|
|
+ },
|
|
|
onSubcontractClick:function (node) {//点击分包费checkbox
|
|
|
if (node.updateData.isSubcontract) node.updateData.isSubcontract = false;
|
|
|
else node.updateData.isSubcontract = true;
|