|
@@ -18,7 +18,7 @@ projectGljObject={
|
|
|
{headerName: "市场价", headerWidth: 70, dataCode: "marketPrice", hAlign: "right", dataType: "Number",decimalField:"glj.unitPrice",validator:"number"},
|
|
|
{headerName: "是否暂估", headerWidth: 60, dataCode: "is_evaluate", hAlign: "center", dataType: "String",cellType:'checkBox'},
|
|
|
{headerName: "供货方式", headerWidth: 80, dataCode: "supply", hAlign: "center", dataType: "String",cellType:'comboBox',editorValueType:true,options:supplyComboMap},
|
|
|
- {headerName: "甲供数量", headerWidth: 100, dataCode: "supply_quantity", hAlign: "right", dataType: "String",validator:"number"},
|
|
|
+ {headerName: "甲供数量", headerWidth: 100, dataCode: "supply_quantity", hAlign: "right", dataType: "Number",validator:"number"},
|
|
|
{headerName: "交货方式", headerWidth: 90, dataCode: "delivery", hAlign: "left", dataType: "String"},
|
|
|
{headerName: "送达地点", headerWidth: 100, dataCode: "delivery_address", hAlign: "left", dataType: "String"},
|
|
|
{headerName: "不调价", headerWidth: 55, dataCode: "is_adjust_price", dataType: "String",cellType: "checkBox"}
|
|
@@ -56,6 +56,7 @@ projectGljObject={
|
|
|
this.initSheet(this.projectGljSheet,this.projectGljSetting);
|
|
|
this.projectGljSheet.bind(GC.Spread.Sheets.Events.SelectionChanged,this.onProjectGljSelectionChange);
|
|
|
this.projectGljSheet.bind(GC.Spread.Sheets.Events.EditStarting,this.onProjectGljEditStarting);
|
|
|
+ this.projectGljSpread.bind(GC.Spread.Sheets.Events.RangeChanged, this.onProjectGljRangeChange);
|
|
|
this.projectGljSheet.name('projectGljSheet');
|
|
|
},
|
|
|
initMixRatio:function () {
|
|
@@ -133,37 +134,71 @@ projectGljObject={
|
|
|
let me = projectGljObject;
|
|
|
let row = args.row;
|
|
|
let col = args.col;
|
|
|
- let dataCode = me.projectGljSetting.header[col].dataCode;
|
|
|
- if(dataCode=='is_adjust_price'||dataCode=='is_evaluate'){
|
|
|
+ if(me.projectGljEditChecking(row,col)==false){
|
|
|
args.cancel = true;
|
|
|
}
|
|
|
},
|
|
|
- onProjectGljSelectionChange:function (sender, args) {
|
|
|
+ projectGljEditChecking:function (row,col) {//return false表示不能编码
|
|
|
let me = projectGljObject;
|
|
|
- let row = args.newSelections[0].row;
|
|
|
- let col = args.newSelections[0].col;
|
|
|
let data = me.projectGljSheetData[row];
|
|
|
let dataCode = me.projectGljSetting.header[col].dataCode;
|
|
|
+ if(dataCode=='is_adjust_price'||dataCode=='is_evaluate'){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
if(dataCode=='basePrice'||dataCode=='marketPrice'||dataCode=='supply'){//有组成物时,市场单价、定额价、供货方式不能修改
|
|
|
- let priceCell = false;
|
|
|
if (data.ratio_data && data.ratio_data.length > 0){
|
|
|
- priceCell = true;
|
|
|
+ return false;
|
|
|
}
|
|
|
- if(priceCell==false&&dataCode=='basePrice'&&data.is_add!=1){//如果不是新增,定额价不可修改。
|
|
|
- priceCell = true;
|
|
|
+ if(dataCode=='basePrice'&&data.is_add!=1){//如果不是新增,定额价不可修改。
|
|
|
+ return false;
|
|
|
}
|
|
|
- me.projectGljSheet.getCell(row, col, GC.Spread.Sheets.SheetArea.viewport).locked(priceCell);
|
|
|
}
|
|
|
if(dataCode == 'supply_quantity'){
|
|
|
- if (data.supply == 1) {// 如果为部分甲供则甲供数量需要可编辑
|
|
|
- me.projectGljSheet.getCell(row, col, GC.Spread.Sheets.SheetArea.viewport).locked(false);
|
|
|
- }else {
|
|
|
- me.projectGljSheet.getCell(row, col, GC.Spread.Sheets.SheetArea.viewport).locked(true);
|
|
|
+ if (data.supply != 1) {// 如果为部分甲供则甲供数量需要可编辑,其它的都不能编辑
|
|
|
+ return false;
|
|
|
}
|
|
|
}
|
|
|
+ return true;
|
|
|
+ },
|
|
|
+
|
|
|
+ onProjectGljSelectionChange:function (sender, args) {
|
|
|
+ let me = projectGljObject;
|
|
|
me.showMixRatioData();
|
|
|
me.projectGljSheet.repaint();
|
|
|
},
|
|
|
+ onProjectGljRangeChange:function (sender,info) {
|
|
|
+ let me = projectGljObject;
|
|
|
+ let changeInfo=[];
|
|
|
+ let canChange = true;
|
|
|
+ for(let c of info.changedCells){
|
|
|
+ let value= info.sheet.getCell(c.row, c.col).text();
|
|
|
+ changeInfo.push({row:c.row,col:c.col,value:value});
|
|
|
+ if(me.projectGljEditChecking(c.row,c.col)==false){//如果不能编辑
|
|
|
+ canChange = false;
|
|
|
+ }
|
|
|
+ if (canChange==true&&!me.checkData(c.col,me.projectGljSetting,value)) {
|
|
|
+ alert('输入的数据类型不对,请重新输入!');
|
|
|
+ canChange = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(canChange == false){//恢复原来的值
|
|
|
+ console.log('1');
|
|
|
+ me.showProjectGljData();
|
|
|
+ }else {
|
|
|
+ me.batchUpdatePrice(changeInfo);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ batchUpdatePrice(changeInfo){
|
|
|
+ let projectGLJ = projectObj.project.projectGLJ;
|
|
|
+ let me = projectGljObject;
|
|
|
+ projectGLJ.batchUpdatePrice(changeInfo,function (impactList) {
|
|
|
+ let selected = me.projectGljSheet.getSelections()[0];
|
|
|
+ me.showProjectGljData();
|
|
|
+ me.projectGljSheet.setSelection(selected.row,selected.col,selected.rowCount,selected.colCount);
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
showProjectGljData:function () {
|
|
|
let projectGljSheetData = [];
|
|
|
let gljList = projectObj.project.projectGLJ.datas.gljList;
|