|
|
@@ -7,8 +7,8 @@ let divideObj = {
|
|
|
{headerName: "单位", headerWidth: 100, dataCode: "unit", dataType: "String",cellType:'comboBox',editable:true,options:['m', 'm2', 'm3', 'km', 't', 'kg', '台班', '工日', '昼夜', '元', '项', '处', '个', '件',
|
|
|
'根', '组', '系统', '台', '套', '株', '丛', '缸', '支', '只', '块', '座', '对', '份', '樘', '攒', '榀']},
|
|
|
{headerName: "工程量", headerWidth: 80, dataCode: "quantity", dataType: "Number",validator:"number",getText:"notZero"},
|
|
|
- {headerName: "单价", headerWidth: 100, dataCode: "unitPrice", dataType: "Number",validator:"number",getText:"notZero"},
|
|
|
- {headerName: "金额", headerWidth: 100, dataCode: "totalPrice", dataType: "Number",validator:"number",getText:"notZero"},
|
|
|
+ {headerName: "单价", headerWidth: 100, dataCode: "marketUnitFee", dataType: "Number",validator:"number",getText:"notZero"},
|
|
|
+ {headerName: "金额", headerWidth: 100, dataCode: "marketTotalFee", dataType: "Number",validator:"number",getText:"notZero"},
|
|
|
{headerName: "预算价", headerWidth: 100, dataCode: "marketPrice", dataType: "Number",validator:"number",getText:"notZero"},
|
|
|
{headerName: "取费类别", headerWidth: 60, dataCode: "programID", hAlign:'center', dataType: "String",cellType:'comboBox',editorValueType:true}
|
|
|
],
|
|
|
@@ -100,13 +100,50 @@ let divideObj = {
|
|
|
showRationGLJDatas:function(){
|
|
|
if(!$('#divide_glj_nav').hasClass('active')) return;
|
|
|
this.divideSubSpread.setActiveSheetIndex(0);
|
|
|
- this.rationGLJDatas = this.getRationGLJDatas();
|
|
|
+ this.rationGLJDatas = getTreeRationGLJDatas();
|
|
|
+
|
|
|
+
|
|
|
let rationGLJSheet = this.divideSubSpread.getSheet(0)
|
|
|
rationGLJSheet.setRowCount(this.rationGLJDatas.length);
|
|
|
sheetCommonObj.showTreeData(rationGLJSheet, gljCol.ration_glj_setting,this.rationGLJDatas);
|
|
|
-
|
|
|
+ function getTreeRationGLJDatas(){
|
|
|
+ let datas = [];
|
|
|
+ let selected = divideObj.getSelectedItem();
|
|
|
+ let divideSetting = projectObj.project.divide_setting.datas;
|
|
|
+ let projectGLJ = projectObj.project.projectGLJ
|
|
|
+ let projectGLJData = projectGLJ.datas;
|
|
|
+ let projectGljs = projectGLJData.gljList;
|
|
|
+ let mixRatioMap = projectGLJData.mixRatioMap;
|
|
|
+ if(selected && selected.itemType=="定额"){
|
|
|
+ for(r of divideSetting.ration_gljs){
|
|
|
+ if(r.rationID == selected.ID){
|
|
|
+ let newr = Object.assign(r);
|
|
|
+ newr.ParentID = -1;
|
|
|
+ datas.push(newr);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(datas.length > 0){
|
|
|
+ datas = gljUtil.sortRationGLJ(datas);
|
|
|
+ let pgljMap = _.indexBy(projectGljs, 'id');
|
|
|
+ for(let d of datas){
|
|
|
+ let glj = pgljMap[d.projectGLJID];
|
|
|
+ if(!glj) continue;
|
|
|
+ if(projectGLJ.isEstimateType(d.type )) d.isEstimate = glj.is_evaluate;
|
|
|
+ d.shortName=projectGLJ.getShortNameByID(d.type);
|
|
|
+ d.isAdd = glj.unit_price.is_add;
|
|
|
+ d=this.setGLJPrice(d,glj,false);//设置工料机价格
|
|
|
+ let connect_index = this.getIndex(glj, gljKeyArray);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ return datas;
|
|
|
+ }
|
|
|
},
|
|
|
- getRationGLJDatas : function (){
|
|
|
+ getRationGLJDatas : function (){//这里是给计算程序统一调用的方法,树结构不用这个方法了
|
|
|
let datas = [];
|
|
|
let selected = divideObj.getSelectedItem();
|
|
|
let divideSetting = projectObj.project.divide_setting.datas;
|
|
|
@@ -139,13 +176,13 @@ let divideObj = {
|
|
|
if(data){
|
|
|
if(data.itemType == "分摊项"){
|
|
|
//金额,预算价,取费类别不可编辑
|
|
|
- if(dataCode =="totalPrice" || dataCode =="marketPrice" || dataCode =="programID" ) return false;
|
|
|
+ if(dataCode =="marketTotalFee" || dataCode =="marketPrice" || dataCode =="programID" ) return false;
|
|
|
//有子项时,单价不可编辑
|
|
|
- if(dataCode =="unitPrice"&& _.find(me.divideDatas,{ParentID:data.ID})) return false;
|
|
|
+ if(dataCode =="marketUnitFee"&& _.find(me.divideDatas,{ParentID:data.ID})) return false;
|
|
|
}
|
|
|
- if( data.itemType == "量价" && dataCode =="totalPrice") return false//量价:“金额”不可编辑。
|
|
|
+ if( data.itemType == "量价" && dataCode =="marketTotalFee") return false//量价:“金额”不可编辑。
|
|
|
if(data.itemType == "定额"){ //定额:“单位”、“单价”、“金额”、“预算价”
|
|
|
- return !(dataCode == "unit"||dataCode == "unitPrice"||dataCode == "totalPrice"||dataCode == "marketPrice")
|
|
|
+ return !(dataCode == "unit"||dataCode == "marketUnitFee"||dataCode == "marketTotalFee"||dataCode == "marketPrice")
|
|
|
}
|
|
|
return true
|
|
|
}
|
|
|
@@ -345,13 +382,13 @@ let divideObj = {
|
|
|
if(recode.itemType == "分摊项"){
|
|
|
if(dataCode == "quantity"){
|
|
|
value = scMathUtil.roundForObj(value,3);
|
|
|
- let tu = scMathUtil.roundForObj(recode.unitPrice&&recode.unitPrice!=""?recode.unitPrice:0,getDecimal("bills.unitPrice"))
|
|
|
- doc["totalPrice"] = scMathUtil.roundForObj(value * tu,getDecimal("bills.totalPrice"))
|
|
|
+ let tu = scMathUtil.roundForObj(recode.marketUnitFee&&recode.marketUnitFee!=""?recode.marketUnitFee:0,getDecimal("bills.unitPrice"))
|
|
|
+ doc["marketTotalFee"] = scMathUtil.roundForObj(value * tu,getDecimal("bills.totalPrice"))
|
|
|
}
|
|
|
- if(dataCode == "unitPrice"){
|
|
|
+ if(dataCode == "marketUnitFee"){
|
|
|
value = scMathUtil.roundForObj(value,getDecimal("bills.unitPrice"));
|
|
|
let tq = scMathUtil.roundForObj(recode.quantity && recode.quantity!=""?recode.quantity:0,3)
|
|
|
- doc["totalPrice"] = scMathUtil.roundForObj(value * tq,getDecimal("bills.totalPrice"))
|
|
|
+ doc["marketTotalFee"] = scMathUtil.roundForObj(value * tq,getDecimal("bills.totalPrice"))
|
|
|
}
|
|
|
}
|
|
|
doc[dataCode]=value;
|