|
@@ -18,6 +18,7 @@ function ProjectGLJSpread() {
|
|
|
this.firstMixRatioRow = -1;
|
|
|
this.successCallback = null;
|
|
|
this.supplyType = ['自行采购', '部分甲供', '完全甲供', '甲定乙供'];
|
|
|
+ this.supplyComboMap = [{text:"自行采购",value:0},{text:"完全甲供",value:2},{text:"部分甲供",value:1},{text:"甲定乙供",value:3}];//后来调整了下拉选项的顺序,为了不改之前的业务逻辑,这里的值对换了一下
|
|
|
// 工料机类型是混凝土、砂浆、配合比、机械(不包括机械组成物)时,供货方式列只读。
|
|
|
this.supplyReadonlyType = notEditType;
|
|
|
}
|
|
@@ -30,10 +31,10 @@ function ProjectGLJSpread() {
|
|
|
ProjectGLJSpread.prototype.init = function () {
|
|
|
// 供货方式类型
|
|
|
let supplySelect = [];
|
|
|
- for(let index in this.supplyType) {
|
|
|
+ for(let comM of this.supplyComboMap) {
|
|
|
supplySelect.push({
|
|
|
- text: this.supplyType[index],
|
|
|
- value: index
|
|
|
+ text: comM.text,
|
|
|
+ value: comM.value
|
|
|
});
|
|
|
}
|
|
|
let selectBox = new GC.Spread.Sheets.CellTypes.ComboBox();
|
|
@@ -45,11 +46,8 @@ ProjectGLJSpread.prototype.init = function () {
|
|
|
{name: '规格型号', field: 'specs', visible: true,width:120},
|
|
|
{name: '单位', field: 'unit', visible: true,width:45},
|
|
|
{name: '类型', field: 'short_name', visible: true,width:45},
|
|
|
- {name: 'ID', field: 'id', visible: false},
|
|
|
{name: '类型', field: 'unit_price.type', visible: false},
|
|
|
{name: '总消耗量', field: 'quantity', visible: true,width:100,decimalField:'glj.quantity'},
|
|
|
- {name: '分部分项总消耗量', field: 'subdivisionQuantity', visible: true,width:100,decimalField:'glj.quantity'},
|
|
|
- {name: '技术措施项目总消耗量', field: 'techQuantity', visible: true,width:100,decimalField:'glj.quantity'},
|
|
|
{name: '定额价', field: "base_price", visible: true,width:70,decimalField:"glj.unitPrice",validator: 'number'},//这里feiedID设置是为了在计不计取价差的时候做显示用
|
|
|
{name: '调整价', field: 'adjust_price', visible: true,width:70,decimalField:"glj.unitPrice"},
|
|
|
{name: '市场价', field: "unit_price.market_price", visible: true, validator: 'number',width:70,decimalField:"glj.unitPrice"},
|
|
@@ -78,6 +76,9 @@ ProjectGLJSpread.prototype.init = function () {
|
|
|
{name: '组成物消耗量', field: 'consumption', visible: false},
|
|
|
{name: '父级关联编码', field: 'connect_code', visible: false},
|
|
|
{name: '组成物信息', field: 'ratio_data', visible: false},
|
|
|
+ {name: '分部分项总消耗量', field: 'subdivisionQuantity', visible: false,width:100,decimalField:'glj.quantity'},
|
|
|
+ {name: '技术措施项目总消耗量', field: 'techQuantity', visible: false,width:100,decimalField:'glj.quantity'},
|
|
|
+ {name: 'ID', field: 'id', visible: false}
|
|
|
];
|
|
|
let sourceData = jsonData;
|
|
|
|
|
@@ -95,7 +96,13 @@ ProjectGLJSpread.prototype.init = function () {
|
|
|
let supplyColumn = this.sheetObj.getFieldColumn('supply');
|
|
|
let shortNameColumn = this.sheetObj.getFieldColumn('unit_price.short_name');
|
|
|
let supplyQuantity = this.sheetObj.getFieldColumn('supply_quantity');
|
|
|
+ let nameColumn = this.sheetObj.getFieldColumn('name');
|
|
|
+ let specsColumn = this.sheetObj.getFieldColumn('specs');
|
|
|
|
|
|
+ //左对齐样式
|
|
|
+ let leftStyleSetting = {hAlign: GC.Spread.Sheets.HorizontalAlign.left};
|
|
|
+ this.sheetObj.setStyle(-1, nameColumn, leftStyleSetting);
|
|
|
+ this.sheetObj.setStyle(-1, specsColumn, leftStyleSetting);
|
|
|
|
|
|
// 居中样式
|
|
|
let centerStyleSetting = {hAlign: 1};
|
|
@@ -305,11 +312,11 @@ ProjectGLJSpread.prototype.specialColumn = function (sourceData) {
|
|
|
activeSheet.getCell(rowCounter, isEvaluateColumn, GC.Spread.Sheets.SheetArea.viewport).locked(false);
|
|
|
activeSheet.setValue(rowCounter, isEvaluateColumn, data.is_evaluate);
|
|
|
}
|
|
|
- // 设置供货方式列是否可选
|
|
|
+ /* // 设置供货方式列是否可选
|
|
|
if (this.supplyReadonlyType.indexOf(data.unit_price.type) >= 0) {
|
|
|
// 锁定该单元格
|
|
|
activeSheet.getCell(rowCounter, supplyColumn, GC.Spread.Sheets.SheetArea.viewport).locked(true);
|
|
|
- }
|
|
|
+ }*/
|
|
|
// 如果为部分甲供则甲供数量需要可编辑
|
|
|
if (data.supply == 1) {
|
|
|
activeSheet.getCell(rowCounter, supplyQuantity, GC.Spread.Sheets.SheetArea.viewport).locked(false);
|
|
@@ -332,11 +339,11 @@ ProjectGLJSpread.prototype.specialColumn = function (sourceData) {
|
|
|
this.firstMachineRow = this.firstMachineRow === -1 && data.unit_price.type === GLJTypeConst.GENERAL_MACHINE ?
|
|
|
rowCounter : this.firstMachineRow;
|
|
|
// 锁定该单元格
|
|
|
- if (data.ratio_data && data.ratio_data.length > 0){//有组成物时,市场单价、定额价不可修改
|
|
|
+ if (data.ratio_data && data.ratio_data.length > 0){//有组成物时,市场单价、定额价、供货方式不能修改
|
|
|
activeSheet.getCell(rowCounter, marketPriceColumn, GC.Spread.Sheets.SheetArea.viewport).locked(true);
|
|
|
activeSheet.getCell(rowCounter, basePriceColumn, GC.Spread.Sheets.SheetArea.viewport).locked(true);
|
|
|
+ activeSheet.getCell(rowCounter, supplyColumn, GC.Spread.Sheets.SheetArea.viewport).locked(true);
|
|
|
}
|
|
|
- activeSheet.getCell(rowCounter, supplyColumn, GC.Spread.Sheets.SheetArea.viewport).locked(true);
|
|
|
}
|
|
|
if(data.unit_price.is_add!=1){//如果不是新增,定额价不可修改。
|
|
|
activeSheet.getCell(rowCounter, basePriceColumn, GC.Spread.Sheets.SheetArea.viewport).locked(true);
|