|
@@ -289,6 +289,12 @@ var gljOprObj = {
|
|
|
// me.detailSheet.selectionUnit(0);//0 cell,1 row,2 col;
|
|
|
sheet.name('quantity_detail');
|
|
|
me.bindSheetEvent(sheet);
|
|
|
+ sheet.bind(GC.Spread.Sheets.Events.EditStarting, function (sender, args) {
|
|
|
+ if(args.sheet.getValue(args.row,args.col)==null){//这里是为了解决当单元格里的值是null的时候,在单元格里输入数据,按键盘箭头移动光标的时候,会直接结束编辑,跳到另外的单元格。
|
|
|
+ args.sheet.setValue(args.row,args.col,"");
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
|
|
|
},
|
|
|
showCoeData: function (sheet, setting, datas) {
|
|
@@ -579,7 +585,7 @@ var gljOprObj = {
|
|
|
disable = true;
|
|
|
}else {
|
|
|
if (header[args.col] && header[args.col].dataCode == 'marketPrice') {
|
|
|
- if(me.hasComposition(me.sheetData[args.row])){
|
|
|
+ if(me.marketPriceReadOnly({data:me.sheetData[args.row]})){
|
|
|
disable = true;
|
|
|
}else {
|
|
|
disable = false;
|
|
@@ -588,7 +594,7 @@ var gljOprObj = {
|
|
|
if (header[args.col] && header[args.col].dataCode == 'basePrice') {
|
|
|
var isAdd = me.sheetData[args.row].isAdd;
|
|
|
if(isAdd==1){//是新增但没有组成物时允许修改定额价
|
|
|
- if(me.hasComposition(me.sheetData[args.row])){//如果有组成物,不可修改
|
|
|
+ if(me.marketPriceReadOnly({data:me.sheetData[args.row]})){//如果有组成物,不可修改
|
|
|
disable = true;
|
|
|
}else {
|
|
|
disable = false;
|
|
@@ -758,6 +764,7 @@ var gljOprObj = {
|
|
|
}
|
|
|
},
|
|
|
showRationGLJSheetData: function (init) {
|
|
|
+ let selected = this.sheet.getSelections();
|
|
|
this.combineWithProjectGlj(this.sheetData);
|
|
|
this.sheet.setRowCount(0);
|
|
|
//console.log(+new Date())
|
|
@@ -767,7 +774,9 @@ var gljOprObj = {
|
|
|
this.addMixRatioToShow();//显示组成物信息
|
|
|
this.initRationTree(init);
|
|
|
sheetCommonObj.showData(this.sheet, this.setting, this.sheetData);
|
|
|
-
|
|
|
+ if(selected){//定位光标到之前的位置
|
|
|
+ this.sheet.setSelection(selected[0].row,selected[0].col,selected[0].rowCount,selected[0].colCount);
|
|
|
+ }
|
|
|
},
|
|
|
initRationTree: function (init) {
|
|
|
this.sheet.getRange(-1, 0, -1, 1).cellType(this.getTreeNodeCellType(this.sheetData));
|
|
@@ -854,9 +863,10 @@ var gljOprObj = {
|
|
|
var glj = _.find(projectGljs, {'id': ration_gljs[i].projectGLJID});
|
|
|
if (glj) {
|
|
|
let typeString = ration_gljs[i].type + "";
|
|
|
- if (typeString.startsWith("2") != -1||typeString=='4'||typeString=='5') {//只有材料类型才显示是否暂估
|
|
|
+ if (typeString.startsWith("2")||typeString=='4'||typeString=='5') {//只有材料类型才显示是否暂估
|
|
|
ration_gljs[i].isEstimate = glj.is_evaluate;
|
|
|
}
|
|
|
+ ration_gljs[i].shortName =projectObj.project.projectGLJ.getShortNameByID(ration_gljs[i].type);
|
|
|
ration_gljs[i].isAdd = glj.unit_price.is_add;
|
|
|
ration_gljs[i]=this.setGLJPrice(ration_gljs[i],glj);//设置工料机价格
|
|
|
var connect_index = this.getIndex(glj, gljKeyArray);
|
|
@@ -934,7 +944,7 @@ var gljOprObj = {
|
|
|
specs: pg.specs,
|
|
|
unit: pg.unit,
|
|
|
type:mixRatioList[i].type,
|
|
|
- shortName: pg.unit_price.short_name,
|
|
|
+ shortName: projectObj.project.projectGLJ.getShortNameByID(mixRatioList[i].type),
|
|
|
consumption:mixRatioList[i].consumption,
|
|
|
rationItemQuantity: mixRatioList[i].consumption,
|
|
|
// quantity:mixRatioList[i].consumption,
|
|
@@ -1297,9 +1307,9 @@ var gljOprObj = {
|
|
|
//project.ration_glj.datas = project.ration_glj.datas.concat(result.newRecodes);//显示和缓存统一,这样的话就不用更新两个位置了
|
|
|
project.ration_glj.datas = project.ration_glj.datas.concat(result.showData);
|
|
|
gljOprObj.sheetData = gljOprObj.sheetData.concat(result.showData);
|
|
|
- gljOprObj.showRationGLJSheetData();
|
|
|
project.ration_glj.addToMainTree(result.showData);
|
|
|
project.projectGLJ.loadData(function () {
|
|
|
+ gljOprObj.showRationGLJSheetData();
|
|
|
project.calcProgram.calcAndSave(selected);
|
|
|
projectObj.mainController.refreshTreeNode([selected]);
|
|
|
$.bootstrapLoading.end();
|
|
@@ -1328,24 +1338,24 @@ var gljOprObj = {
|
|
|
var nodes = [selected];
|
|
|
gljOprObj.sheetData[index] = data;
|
|
|
glj_list[list_index] = data;
|
|
|
- gljOprObj.showRationGLJSheetData();
|
|
|
- if (project.ration_glj.needShowToTree(data)) {//当替换的是主材或设备时,刷新对应的树节点
|
|
|
- var node = project.ration_glj.findGLJNodeByID(data.ID);
|
|
|
- if (node) {
|
|
|
- project.ration_glj.transferToNodeData(data);
|
|
|
- node.source = data;
|
|
|
- node.data = data;
|
|
|
- }
|
|
|
- node ? nodes.push(node) : "";
|
|
|
- }
|
|
|
- //project.ration_glj.addToMainTree(data);
|
|
|
- selected.data.adjustState = result.adjustState;
|
|
|
project.projectGLJ.loadData(function () {//加载完项目工料机再计算
|
|
|
+ gljOprObj.showRationGLJSheetData();
|
|
|
+ if (project.ration_glj.needShowToTree(data)) {//当替换的是主材或设备时,刷新对应的树节点
|
|
|
+ var node = project.ration_glj.findGLJNodeByID(data.ID);
|
|
|
+ if (node) {
|
|
|
+ project.ration_glj.transferToNodeData(data);
|
|
|
+ node.source = data;
|
|
|
+ node.data = data;
|
|
|
+ }
|
|
|
+ node ? nodes.push(node) : "";
|
|
|
+ }
|
|
|
+ //project.ration_glj.addToMainTree(data);
|
|
|
+ selected.data.adjustState = result.adjustState;
|
|
|
projectObj.mainController.refreshTreeNode(nodes);
|
|
|
project.calcProgram.calcAndSave(selected);
|
|
|
+ $.bootstrapLoading.end();
|
|
|
});
|
|
|
}
|
|
|
- $.bootstrapLoading.end();
|
|
|
})
|
|
|
},
|
|
|
doMReplaceGLJ: function () {
|
|
@@ -1370,9 +1380,9 @@ var gljOprObj = {
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
- me.showRationGLJSheetData();
|
|
|
- var rationNodes = me.refreshStateAfterMreplace(stateList, nodes);
|
|
|
project.projectGLJ.loadData(function () {
|
|
|
+ me.showRationGLJSheetData();
|
|
|
+ var rationNodes = me.refreshStateAfterMreplace(stateList, nodes);
|
|
|
project.calcProgram.calcRationsAndSave(rationNodes);
|
|
|
$.bootstrapLoading.end();
|
|
|
});
|
|
@@ -1538,7 +1548,13 @@ var gljOprObj = {
|
|
|
return new TreeNodeCellType()
|
|
|
},
|
|
|
marketPriceReadOnly: function (node) {
|
|
|
- return node.data.type == gljType.CONCRETE || node.data.type == gljType.MORTAR || node.data.type == gljType.MIX_RATIO || node.data.type == gljType.GENERAL_MACHINE || node.data.isEstimate == 1
|
|
|
+ let hasCom = false;
|
|
|
+ if(node.sourceType==ModuleNames.ration&&node.data.type==rationType.gljRation){
|
|
|
+ hasCom = this.hasComposition(node.data,true);
|
|
|
+ }else {
|
|
|
+ hasCom = this.hasComposition(node.data);
|
|
|
+ }
|
|
|
+ return hasCom|| node.data.isEstimate == 1;
|
|
|
}
|
|
|
|
|
|
}
|