|
|
@@ -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"}
|
|
|
],
|
|
|
@@ -305,7 +305,7 @@ let indexObj= {
|
|
|
function setQuantities(items,data) {
|
|
|
let quantity = 0;
|
|
|
for (let i of items){
|
|
|
- let coe = i.quantityIndexCoe && i.quantityIndexCoe!=""?parseFloat(i.quantityIndexCoe):1;
|
|
|
+ let coe = i.quantityIndexCoe && i.quantityIndexCoe!=""?parseFloat(i.quantityIndexCoe):0;
|
|
|
i.quantity = scMathUtil.roundForObj(parseFloat(i.quantity)*coe,getDecimal("process"));
|
|
|
quantity = scMathUtil.roundForObj(quantity + i.quantity,getDecimal("process"));
|
|
|
}
|
|
|
@@ -365,7 +365,7 @@ let indexObj= {
|
|
|
for(let g of gljs){
|
|
|
if(!g.quantity || g.quantity=="") continue;
|
|
|
let marketPrice = gljUtil.getMarketPrice(g,projectGLJData,calcOptions,decimalObj,false,_,scMathUtil); // gljOprObj.setGLJPrice(tem,g);
|
|
|
- let materialIndexCoe = g.materialIndexCoe?scMathUtil.roundForObj(g.materialIndexCoe,getDecimal("process")):1;
|
|
|
+ let materialIndexCoe = g.materialIndexCoe?scMathUtil.roundForObj(g.materialIndexCoe,getDecimal("process")):0;
|
|
|
let t_quantity = scMathUtil.roundForObj(g.quantity * materialIndexCoe,getDecimal("process"));
|
|
|
quantity = scMathUtil.roundForObj(t_quantity + quantity,getDecimal("process"));
|
|
|
let temPrice = scMathUtil.roundForObj(g.quantity * marketPrice,getDecimal("process"));
|
|
|
@@ -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);
|
|
|
}
|
|
|
@@ -494,7 +495,7 @@ let indexObj= {
|
|
|
onEcoQuantityValueChange:function (sender,info) {
|
|
|
let value = info.newValue;
|
|
|
let dataCode = indexObj.ecoQuantitySetting.header[info.col].dataCode;
|
|
|
- if(!info.newValue){
|
|
|
+ if(!gljUtil.isDef(info.newValue)){
|
|
|
return;
|
|
|
}
|
|
|
if (value&&!sheetCommonObj.checkData(info.col,indexObj.ecoQuantitySetting, value)) {
|
|
|
@@ -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) {
|
|
|
@@ -580,7 +582,7 @@ let indexObj= {
|
|
|
onMaterialChange:function (sender,info) {
|
|
|
let value = info.newValue,updateMap = {};
|
|
|
let dataCode = indexObj.materialSetting.header[info.col].dataCode;
|
|
|
- if(!info.newValue){
|
|
|
+ if(!gljUtil.isDef(info.newValue)){
|
|
|
return;
|
|
|
}
|
|
|
if (value&&!sheetCommonObj.checkData(info.col,indexObj.materialSetting, value)) {
|
|
|
@@ -614,8 +616,13 @@ let indexObj= {
|
|
|
let updateMap = {};
|
|
|
for(let c of info.changedCells){
|
|
|
let value= info.sheet.getCell(c.row, c.col).text();
|
|
|
+ let dataCode = indexObj.materialSetting.header[c.col].dataCode;
|
|
|
let recode = indexObj.materialDatas[c.row];
|
|
|
- let tem = indexObj.getMaterialUpdateData(recode,value);
|
|
|
+ if (value&&!sheetCommonObj.checkData(c.col,indexObj.materialSetting, value)) {
|
|
|
+ alert('输入的数据类型不对,请重新输入!');
|
|
|
+ return indexObj.showDatas();
|
|
|
+ }
|
|
|
+ let tem = indexObj.getMaterialUpdateData(recode,dataCode,value);
|
|
|
if(tem) updateMap[recode.id] = tem;
|
|
|
}
|
|
|
if(_.isEmpty(updateMap)) return indexObj.showDatas();
|
|
|
@@ -629,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;
|
|
|
|
|
|
@@ -649,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
|
|
|
},
|