|
|
@@ -19,11 +19,13 @@ let zmhs_obj = {
|
|
|
},
|
|
|
getText:{
|
|
|
forContent:function (item) {//所选人材机,内容和条件互换位置
|
|
|
- if(gljUtil.isDef(item.option_codes)&&item.option_codes!=""){
|
|
|
- return item.name;
|
|
|
- }else {
|
|
|
- return item.content;
|
|
|
- }
|
|
|
+ if(gljUtil.isDef(item.option_codes)&&item.option_codes!=""){
|
|
|
+ return item.name;
|
|
|
+ }else if(item.assistCode &&item.assistCode!="" ){//是辅助定额行,显示实际值
|
|
|
+ return item.actualValue;
|
|
|
+ } else {
|
|
|
+ return item.content;
|
|
|
+ }
|
|
|
},
|
|
|
forName:function (item) {
|
|
|
if(gljUtil.isDef(item.select_code)&&item.select_code!=""){
|
|
|
@@ -55,6 +57,7 @@ let zmhs_obj = {
|
|
|
assSpread:null,
|
|
|
assSheet:null,
|
|
|
assSheetData: [],
|
|
|
+ assFirstIndex:0,
|
|
|
assSetting: {
|
|
|
header: [
|
|
|
{headerName: "调整名称", headerWidth: 100, dataCode: "name", dataType: "String"},
|
|
|
@@ -78,7 +81,7 @@ let zmhs_obj = {
|
|
|
this.coeSheet = this.coeSpread.getSheet(0);
|
|
|
sheetCommonObj.initSheet(this.coeSheet, this.coeSetting, 30);
|
|
|
this.coeSheet.name('ration_coe');
|
|
|
- this.coeSheet.bind(GC.Spread.Sheets.Events.CellClick, this.onCoeCellClick);
|
|
|
+ //this.coeSheet.bind(GC.Spread.Sheets.Events.CellClick, this.onCoeCellClick); 配合自定义系数使用,现在自定义系数不在这显示了
|
|
|
this.coeSpread.bind(GC.Spread.Sheets.Events.ButtonClicked, this.onButtonClick);
|
|
|
this.coeSheet.bind(GC.Spread.Sheets.Events.ValueChanged,this.onCoeValueChange);
|
|
|
this.coeSheet.bind(GC.Spread.Sheets.Events.SelectionChanged, function (e,args) {
|
|
|
@@ -120,6 +123,8 @@ let zmhs_obj = {
|
|
|
let ration = selected.data;
|
|
|
coeList = ration_coe.getCoeByRationID(ration.ID);
|
|
|
_.remove(coeList,{"coeID":-1})//2018-12-24 新需求,把自定义乘系数分离出来,这里排除自定义乘系数行
|
|
|
+ this.assFirstIndex = coeList.length;//辅助定额的起始下标
|
|
|
+ coeList = coeList.concat(this.getAssList(node)) //2019-01-23 新需求,将辅助定额合并到一个表显示
|
|
|
}
|
|
|
this.coeSheet.setRowCount(0);
|
|
|
sheetCommonObj.showData(this.coeSheet, this.coeSetting,coeList);
|
|
|
@@ -130,6 +135,8 @@ let zmhs_obj = {
|
|
|
if(gljUtil.isDef(coeList[i].option_codes)&&coeList[i].option_codes!=""){
|
|
|
this.getComboBoxForCodes(coeList[i],i);//设置可选类型的下拉框
|
|
|
// sheet.setValue(row, col, val, ch);
|
|
|
+ } else if(coeList[i].assistCode && coeList[i].assistCode !=''){//是辅助定额列
|
|
|
+ this.coeSheet.getCell(i, 2, GC.Spread.Sheets.SheetArea.viewport).locked(false);
|
|
|
} else if(coeList[i].coeID == -1){ //自定义系数列
|
|
|
this.coeSheet.getCell(i, 1, GC.Spread.Sheets.SheetArea.viewport).locked(false);
|
|
|
this.coeSheet.setCellType(i, 1, sheetCommonObj.getCustomerCoeCellType(this.generateHtmlString,this.bindCusEditorValue,this.updateCusCoeAfterEditor), GC.Spread.Sheets.SheetArea.viewport);
|
|
|
@@ -189,6 +196,12 @@ let zmhs_obj = {
|
|
|
disableSpread(this.assSpread);
|
|
|
}
|
|
|
},
|
|
|
+ getAssList:function (node) {
|
|
|
+ let selected = node?node:projectObj.project.mainTree.selected;
|
|
|
+ let assList = selected&&selected.data.rationAssList ? selected.data.rationAssList : [];
|
|
|
+ this.assSheetData = assList;
|
|
|
+ return assList;
|
|
|
+ },
|
|
|
refreshAfterUpdate:function(result,reload){
|
|
|
let ration_glj = projectObj.project.ration_glj;
|
|
|
let calcInstall = false;//是否记录安装增加费
|
|
|
@@ -374,7 +387,7 @@ let zmhs_obj = {
|
|
|
args.sheet.getCell(args.row, args.col).value(newval);
|
|
|
}
|
|
|
let recode = me.coeSheetData[args.row];
|
|
|
- projectObj.project.ration_coe.adjustCoeClick(recode, newval);
|
|
|
+ recode.assistCode && recode.assistCode != "" ? me.adjustAssClick(args,newval) : projectObj.project.ration_coe.adjustCoeClick(recode, newval);
|
|
|
},
|
|
|
generateHtmlString: function (context,cellRect,$editor) {//这里要改成动态的了,根据自定义系数内容生成对应的输入框
|
|
|
let me = zmhs_obj;
|
|
|
@@ -412,6 +425,8 @@ let zmhs_obj = {
|
|
|
let recode = zmhs_obj.coeSheetData[args.row];
|
|
|
if(gljUtil.isDef(recode.option_codes)&&recode.option_codes!=""&& fieldID == 'name'){//说明是选择了下拉框
|
|
|
projectObj.project.ration_coe.adjustCoeClick(recode, 1,{'select_code':args.newValue});
|
|
|
+ }else if(recode.assistCode &&recode.assistCode!=""){//编辑的是辅助定额
|
|
|
+ zmhs_obj.updateRationAss({editingText:args.newValue,row:args.row - zmhs_obj.assFirstIndex})//转换一下
|
|
|
}
|
|
|
},
|
|
|
onCusValueChange:function (e,args) {
|
|
|
@@ -484,6 +499,10 @@ let zmhs_obj = {
|
|
|
me.updateRationAss(args);
|
|
|
}
|
|
|
},
|
|
|
+ adjustAssClick:function (args,newval) {
|
|
|
+ let me = zmhs_obj, row = args.row - me.assFirstIndex;
|
|
|
+ projectObj.project.ration_ass.updateActualValue(me.assSheetData, row,null,newval);
|
|
|
+ },
|
|
|
updateRationAss: function (args) {
|
|
|
var me = zmhs_obj;
|
|
|
var newval;
|
|
|
@@ -500,8 +519,7 @@ let zmhs_obj = {
|
|
|
newval = scMathUtil.roundTo(newval, -2);
|
|
|
projectObj.project.ration_ass.updateActualValue(me.assSheetData, args.row, newval);
|
|
|
} else {
|
|
|
- newval = recode.actualValue;
|
|
|
- me.assSheet.getCell(args.row, args.col).value(newval);
|
|
|
+ me.showDatas();
|
|
|
}
|
|
|
},
|
|
|
checkingActualValue(record, newval){
|