|
@@ -128,7 +128,7 @@ let indexObj= {
|
|
|
sheet.bind(GC.Spread.Sheets.Events.ValueChanged, this.oEngineerFeatureValueChange);
|
|
sheet.bind(GC.Spread.Sheets.Events.ValueChanged, this.oEngineerFeatureValueChange);
|
|
|
sheet.bind(GC.Spread.Sheets.Events.RangeChanged, this.onEngineerFeatureRangeChange); //
|
|
sheet.bind(GC.Spread.Sheets.Events.RangeChanged, this.onEngineerFeatureRangeChange); //
|
|
|
sheet.bind(GC.Spread.Sheets.Events.SelectionChanged,this.onSelectionChange);
|
|
sheet.bind(GC.Spread.Sheets.Events.SelectionChanged,this.onSelectionChange);
|
|
|
-
|
|
|
|
|
|
|
+ sheet.setRowCount(this.engineerFeatureDatas.length);
|
|
|
function getDatas() {
|
|
function getDatas() {
|
|
|
let datas = [];
|
|
let datas = [];
|
|
|
if(projectObj.project.property.engineerFeatures){
|
|
if(projectObj.project.property.engineerFeatures){
|
|
@@ -138,6 +138,8 @@ let indexObj= {
|
|
|
name:f.name,
|
|
name:f.name,
|
|
|
value:f.value,
|
|
value:f.value,
|
|
|
ParentID:f.ParentID,
|
|
ParentID:f.ParentID,
|
|
|
|
|
+ cellType:f.cellType,
|
|
|
|
|
+ options:f.options,
|
|
|
required:f.required,
|
|
required:f.required,
|
|
|
collapsed:false
|
|
collapsed:false
|
|
|
};
|
|
};
|
|
@@ -232,8 +234,6 @@ let indexObj= {
|
|
|
showEngineerFeature:function () {
|
|
showEngineerFeature:function () {
|
|
|
this.spread.setActiveSheetIndex(1);
|
|
this.spread.setActiveSheetIndex(1);
|
|
|
let sheet = this.spread.getActiveSheet();
|
|
let sheet = this.spread.getActiveSheet();
|
|
|
- sheet.setRowCount(0);
|
|
|
|
|
- sheet.setRowCount(this.engineerFeatureDatas.length);
|
|
|
|
|
refreshValue();
|
|
refreshValue();
|
|
|
sheetCommonObj.showTreeData(sheet, this.engineerFeatureSetting,this.engineerFeatureDatas);
|
|
sheetCommonObj.showTreeData(sheet, this.engineerFeatureSetting,this.engineerFeatureDatas);
|
|
|
function refreshValue() {
|
|
function refreshValue() {
|
|
@@ -266,8 +266,9 @@ let indexObj= {
|
|
|
},
|
|
},
|
|
|
showMainMaterial:function(){
|
|
showMainMaterial:function(){
|
|
|
this.spread.setActiveSheetIndex(3);
|
|
this.spread.setActiveSheetIndex(3);
|
|
|
|
|
+ let property = projectObj.project.property;
|
|
|
let sheet = this.spread.getActiveSheet();
|
|
let sheet = this.spread.getActiveSheet();
|
|
|
- let mainDatas = this.getMainMaterialDatas();
|
|
|
|
|
|
|
+ let mainDatas = this.getMainMaterialDatas(property.materials,projectObj.project.projectGLJ.datas,property.calcOptions,property.decimal,false,_,scMathUtil);
|
|
|
sheetCommonObj.showData(sheet, this.mainMaterialSetting,mainDatas);
|
|
sheetCommonObj.showData(sheet, this.mainMaterialSetting,mainDatas);
|
|
|
sheet.setRowCount(mainDatas.length);
|
|
sheet.setRowCount(mainDatas.length);
|
|
|
},
|
|
},
|
|
@@ -336,18 +337,16 @@ let indexObj= {
|
|
|
cost = scMathUtil.roundForObj(cost + i.totalFee,getDecimal("process"));
|
|
cost = scMathUtil.roundForObj(cost + i.totalFee,getDecimal("process"));
|
|
|
}
|
|
}
|
|
|
data.cost = scMathUtil.roundForObj(cost,priceDe);
|
|
data.cost = scMathUtil.roundForObj(cost,priceDe);
|
|
|
- data.unitCost = exportUtil.calUnitWidthCoe(data.cost);
|
|
|
|
|
|
|
+ data.unitCost = exportUtil.calUnitWidthCoe(data.cost,true);//noNeedCoe = true 这里不需要乘以系数
|
|
|
data.per = engineerCost?scMathUtil.roundForObj(data.cost/engineerCost * 100,2):0;
|
|
data.per = engineerCost?scMathUtil.roundForObj(data.cost/engineerCost * 100,2):0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return datas;
|
|
return datas;
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- getMainMaterialDatas:function () {
|
|
|
|
|
|
|
+ getMainMaterialDatas:function (materials,projectGLJData,calcOptions,decimalObj,isRadio,_,scMathUtil) {
|
|
|
let datas = [];
|
|
let datas = [];
|
|
|
- let materials = projectObj.project.property.materials;
|
|
|
|
|
- let gljList = projectObj.project.projectGLJ.datas.gljList;
|
|
|
|
|
- let materialGroup = _.groupBy(gljList,'materialIndexType');
|
|
|
|
|
|
|
+ let materialGroup = _.groupBy(projectGLJData.gljList,'materialIndexType');
|
|
|
if(!materials) return datas;
|
|
if(!materials) return datas;
|
|
|
for(let m of materials){
|
|
for(let m of materials){
|
|
|
let tem = {
|
|
let tem = {
|
|
@@ -361,17 +360,15 @@ let indexObj= {
|
|
|
datas.push(tem);
|
|
datas.push(tem);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
function setMainMaterial(gljs,data) {
|
|
function setMainMaterial(gljs,data) {
|
|
|
let quantity = 0 ,unitPrice=0;
|
|
let quantity = 0 ,unitPrice=0;
|
|
|
for(let g of gljs){
|
|
for(let g of gljs){
|
|
|
if(!g.quantity || g.quantity=="") continue;
|
|
if(!g.quantity || g.quantity=="") continue;
|
|
|
- let tem = {};
|
|
|
|
|
- gljOprObj.setGLJPrice(tem,g);
|
|
|
|
|
|
|
+ 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")):1;
|
|
|
let t_quantity = scMathUtil.roundForObj(g.quantity * materialIndexCoe,getDecimal("process"));
|
|
let t_quantity = scMathUtil.roundForObj(g.quantity * materialIndexCoe,getDecimal("process"));
|
|
|
quantity = scMathUtil.roundForObj(t_quantity + quantity,getDecimal("process"));
|
|
quantity = scMathUtil.roundForObj(t_quantity + quantity,getDecimal("process"));
|
|
|
- let temPrice = scMathUtil.roundForObj(g.quantity * tem.marketPrice,getDecimal("process"));
|
|
|
|
|
|
|
+ let temPrice = scMathUtil.roundForObj(g.quantity * marketPrice,getDecimal("process"));
|
|
|
unitPrice = scMathUtil.roundForObj(temPrice + unitPrice,getDecimal("process"));
|
|
unitPrice = scMathUtil.roundForObj(temPrice + unitPrice,getDecimal("process"));
|
|
|
}
|
|
}
|
|
|
data.quantity = scMathUtil.roundForObj(quantity,2);
|
|
data.quantity = scMathUtil.roundForObj(quantity,2);
|
|
@@ -510,15 +507,23 @@ let indexObj= {
|
|
|
},
|
|
},
|
|
|
onEngineerInfoValueChange:function (sender,info) {
|
|
onEngineerInfoValueChange:function (sender,info) {
|
|
|
let value = info.newValue;
|
|
let value = info.newValue;
|
|
|
- info.sheet.tag(value);
|
|
|
|
|
- var date = info.sheet.tag();
|
|
|
|
|
- // formatDate(new Date(v), 'yyyy-MM-dd');
|
|
|
|
|
- //v = formatDate(new Date(v), 'yyyy-MM-dd');
|
|
|
|
|
|
|
+ value = indexObj.valueChecking(indexObj.engineerInfoDatas[info.row],value,info.sheet);
|
|
|
let infos = projectObj.project.property.engineerInfos;
|
|
let infos = projectObj.project.property.engineerInfos;
|
|
|
let data = indexObj.getNewPropertyData([{row:info.row,value:value}],infos);
|
|
let data = indexObj.getNewPropertyData([{row:info.row,value:value}],infos);
|
|
|
if(!data) return indexObj.showDatas();
|
|
if(!data) return indexObj.showDatas();
|
|
|
indexObj.updateProjectProperty(data,"engineerInfos");
|
|
indexObj.updateProjectProperty(data,"engineerInfos");
|
|
|
},
|
|
},
|
|
|
|
|
+ valueChecking:function (recode,value,sheet) {
|
|
|
|
|
+ if(recode && recode.cellType == "date"){//日期类型要做个转换
|
|
|
|
|
+ sheet.tag(value);
|
|
|
|
|
+ let data = sheet.tag();
|
|
|
|
|
+ value = formatDate(new Date(data), 'yyyy-MM-dd');
|
|
|
|
|
+ }
|
|
|
|
|
+ //to do other checking
|
|
|
|
|
+ return value
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
oEngineerFeatureValueChange:function(sender,info){
|
|
oEngineerFeatureValueChange:function(sender,info){
|
|
|
let value = info.newValue;
|
|
let value = info.newValue;
|
|
|
let features = projectObj.project.property.engineerFeatures;
|
|
let features = projectObj.project.property.engineerFeatures;
|