|
@@ -390,6 +390,10 @@ var gljOprObj = {
|
|
|
}
|
|
|
},
|
|
|
onCheckBoxClick: function (sender, args) {
|
|
|
+ let selected = projectObj.project.mainTree.selected;
|
|
|
+ if(selected.sourceType == ModuleNames.ration_glj||(selected.sourceType == ModuleNames.ration&&selected.data.type==rationType.gljRation)){//选中的是工料机时不可编辑
|
|
|
+ return ;
|
|
|
+ }
|
|
|
var checkboxValue = args.sheet.getCell(args.row, args.col).value();
|
|
|
var newval = 0;
|
|
|
if (checkboxValue) {
|
|
@@ -599,9 +603,11 @@ var gljOprObj = {
|
|
|
me.sheet.getCell(args.row, args.col, GC.Spread.Sheets.SheetArea.viewport).locked(disable);
|
|
|
}
|
|
|
},
|
|
|
- hasComposition:function (ration_glj) {//判断是否有组成物,有则返回true
|
|
|
- if(notEditType.indexOf(ration_glj.type)!=-1){
|
|
|
- let con_key = this.getIndex(ration_glj,gljKeyArray);
|
|
|
+ hasComposition:function (ration_glj,isRationType) {//判断是否有组成物,有则返回true 现在主材类型的工料机也有可能有组成物。
|
|
|
+ let type = isRationType==true? ration_glj.subType:ration_glj.type;
|
|
|
+ if(notEditType.indexOf(type)!=-1||type==gljType.MAIN_MATERIAL){
|
|
|
+ let keyArray = isRationType==true? rationKeyArray:gljKeyArray;
|
|
|
+ let con_key = this.getIndex(ration_glj,keyArray);
|
|
|
var mixRatioMap = projectObj.project.projectGLJ.datas.mixRatioMap;
|
|
|
if(mixRatioMap[con_key]&&mixRatioMap[con_key].length>0){
|
|
|
return true;
|
|
@@ -681,13 +687,17 @@ var gljOprObj = {
|
|
|
this.selectedNodeId = node.getID();
|
|
|
}
|
|
|
if (node.sourceType == "ration") {
|
|
|
- this.showRationGLJData(node);
|
|
|
- this.showRationCoeData(node);
|
|
|
- this.showRationAssData(node);
|
|
|
+ if(node.data.type==rationType.gljRation){
|
|
|
+ this.showMixRatio(node);
|
|
|
+ }else {
|
|
|
+ this.showRationGLJData(node);
|
|
|
+ this.showRationCoeData(node);
|
|
|
+ this.showRationAssData(node);
|
|
|
+ }
|
|
|
isShow = true;
|
|
|
}
|
|
|
if(node.sourceType == ModuleNames.ration_glj){
|
|
|
-
|
|
|
+ this.showMixRatio(node);
|
|
|
isShow = true;
|
|
|
}
|
|
|
|
|
@@ -708,14 +718,14 @@ var gljOprObj = {
|
|
|
showMixRatio:function (node) {//显示组成物到定额工料机
|
|
|
let mixRatioMap = projectObj.project.projectGLJ.datas.mixRatioMap;
|
|
|
let projectGljs = projectObj.project.projectGLJ.datas.gljList;
|
|
|
- let indexArray =node.getSourceType()==ModuleNames.ration?rationKeyArray:gljKeyArray;
|
|
|
+ let indexArray =node.sourceType==ModuleNames.ration?rationKeyArray:gljKeyArray;
|
|
|
let connect_index = this.getIndex(node.data,indexArray);
|
|
|
let gljList=[];
|
|
|
if(mixRatioMap[connect_index]){ //说明是有组成物的类型
|
|
|
gljList = this.getMixRationShowDatas(mixRatioMap[connect_index], projectGljs);
|
|
|
}
|
|
|
if(gljList.length>0){//计算总消耗量
|
|
|
- if(node.getSourceType()==ModuleNames.ration){
|
|
|
+ if(node.sourceType==ModuleNames.ration){
|
|
|
this.calcMixRationTotalQuantity(gljList,node.data.quantity);
|
|
|
}else {
|
|
|
let totalQuantity = this.getTotalQuantity(node.data);
|
|
@@ -726,6 +736,15 @@ var gljOprObj = {
|
|
|
this.sheet.setRowCount(0);
|
|
|
this.sheetData = sortRationGLJ(this.sheetData);
|
|
|
sheetCommonObj.showData(this.sheet, this.setting, this.sheetData);
|
|
|
+
|
|
|
+ this.sheet.getRange(-1, 0, -1, this.setting.header.length).locked(true);//锁住定额工料机的所有列
|
|
|
+ this.detailSheet.getRange(-1, 0, -1, this.detailSetting.header.length).locked(true);//锁住工程量明细的所有列
|
|
|
+
|
|
|
+ sheetCommonObj.showData(this.coeSheet, this.coeSetting, []);
|
|
|
+ sheetCommonObj.showData(this.assSheet, this.assSetting, []);
|
|
|
+
|
|
|
+ this.coeSheetData = [];
|
|
|
+ this.assSheetData = [];
|
|
|
},
|
|
|
|
|
|
showRationGLJData: function (node) {
|
|
@@ -835,7 +854,7 @@ var gljOprObj = {
|
|
|
var glj = _.find(projectGljs, {'id': ration_gljs[i].projectGLJID});
|
|
|
if (glj) {
|
|
|
let typeString = ration_gljs[i].type + "";
|
|
|
- if (typeString.indexOf("2") != -1||typeString=='4'||typeString=='5') {//只有材料类型才显示是否暂估
|
|
|
+ if (typeString.startsWith("2") != -1||typeString=='4'||typeString=='5') {//只有材料类型才显示是否暂估
|
|
|
ration_gljs[i].isEstimate = glj.is_evaluate;
|
|
|
}
|
|
|
ration_gljs[i].isAdd = glj.unit_price.is_add;
|
|
@@ -915,16 +934,22 @@ var gljOprObj = {
|
|
|
specs: pg.specs,
|
|
|
unit: pg.unit,
|
|
|
shortName: pg.unit_price.short_name,
|
|
|
+ consumption:mixRatioList[i].consumption,
|
|
|
rationItemQuantity: mixRatioList[i].consumption,
|
|
|
// quantity:mixRatioList[i].consumption,
|
|
|
- basePrice: pg.unit_price.base_price,
|
|
|
+ /* basePrice: pg.unit_price.base_price,
|
|
|
marketPrice: pg.unit_price.market_price,
|
|
|
- adjustPrice: pg.adjust_price,
|
|
|
- isEstimate: pg.is_evaluate,
|
|
|
+ adjustPrice: pg.adjust_price,*/
|
|
|
+ //isEstimate: pg.is_evaluate,
|
|
|
isMixRatio: true,
|
|
|
isAdd: pg.unit_price.is_add,
|
|
|
GLJID: pg.glj_id
|
|
|
+ };
|
|
|
+ let typeString = pg.type + "";
|
|
|
+ if (typeString.startsWith("2")||typeString=='4'||typeString=='5') {//只有材料类型才显示是否暂估
|
|
|
+ tem.isEstimate = pg.is_evaluate;
|
|
|
}
|
|
|
+ this.setGLJPrice(tem,pg);
|
|
|
temRationGLJs.push(tem);
|
|
|
}
|
|
|
temRationGLJs = _.sortBy(temRationGLJs, 'code');
|
|
@@ -1235,15 +1260,22 @@ var gljOprObj = {
|
|
|
return distTypeTree;
|
|
|
},
|
|
|
doInsertGLJ: function () {
|
|
|
+ var me = this;
|
|
|
var selected = projectObj.project.mainTree.selected;
|
|
|
var project = projectObj.project;
|
|
|
- if (gljOprObj.GLJSelection.length <= 0) {
|
|
|
+ if (me.GLJSelection.length <= 0) {
|
|
|
return;
|
|
|
}
|
|
|
$("#glj_tree_div").modal('hide');
|
|
|
- project.ration_glj.insertGLJAsRation(gljOprObj.GLJSelection, selected, function (result) {
|
|
|
- project.projectGLJ.loadData();
|
|
|
- gljOprObj.showRationGLJSheetData();
|
|
|
+ project.ration_glj.insertGLJAsRation(me.GLJSelection, selected, function (node) {
|
|
|
+ project.projectGLJ.loadData(function () {
|
|
|
+ if(me.hasComposition(node.data,true)){
|
|
|
+ me.showMixRatio(node);
|
|
|
+ }else {
|
|
|
+ me.showRationGLJSheetData();
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
})
|
|
|
},
|
|
|
doAddGLJ: function () {
|