|
@@ -38,7 +38,7 @@ ProjectGLJSpread.prototype.init = function () {
|
|
|
}
|
|
|
let selectBox = new GC.Spread.Sheets.CellTypes.ComboBox();
|
|
|
selectBox.items(supplySelect);
|
|
|
- selectBox.editorValueType(GC.Spread.Sheets.CellTypes.EditorValueType.text);
|
|
|
+ selectBox.editorValueType(GC.Spread.Sheets.CellTypes.EditorValueType.value);
|
|
|
let header = [
|
|
|
{name: '编码', field: 'code', visible: true,width:80},
|
|
|
{name: '名称', field: 'name', visible: true,width:160},
|
|
@@ -214,7 +214,7 @@ ProjectGLJSpread.prototype.updateProjectGLJField = function(info, callback) {
|
|
|
|
|
|
// 如果是供货方式则需要处理数据
|
|
|
if (field === 'supply') {
|
|
|
- value = this.supplyType.indexOf(value);
|
|
|
+ // value = this.supplyType.indexOf(value);
|
|
|
extend.supply_quantity = this.getSupplyQuantity(value, activeSheet, info);
|
|
|
}
|
|
|
if(field === 'supply_quantity'){//修改数量需做4舍5入
|
|
@@ -311,11 +311,11 @@ ProjectGLJSpread.prototype.specialColumn = function (sourceData) {
|
|
|
activeSheet.getCell(rowCounter, supplyColumn, GC.Spread.Sheets.SheetArea.viewport).locked(true);
|
|
|
}
|
|
|
// 如果为部分甲供则甲供数量需要可编辑
|
|
|
- if (data.supply === 1) {
|
|
|
+ if (data.supply == 1) {
|
|
|
activeSheet.getCell(rowCounter, supplyQuantity, GC.Spread.Sheets.SheetArea.viewport).locked(false);
|
|
|
}
|
|
|
//供货方式为完全甲供时设置甲供数量为总消耗量
|
|
|
- if (data.supply === 2) {
|
|
|
+ if (data.supply == 2) {
|
|
|
activeSheet.setValue(rowCounter, supplyQuantity, data.quantity);
|
|
|
}
|
|
|
// 供货方式数据
|
|
@@ -323,6 +323,7 @@ ProjectGLJSpread.prototype.specialColumn = function (sourceData) {
|
|
|
supplyIndex = isNaN(supplyIndex) ? 0 : supplyIndex;
|
|
|
let supplyText = this.supplyType[supplyIndex] !== undefined ? this.supplyType[supplyIndex] : '自行采购';
|
|
|
activeSheet.setValue(rowCounter, supplyColumn, supplyText);
|
|
|
+ // activeSheet.setValue(rowCounter, supplyColumn, supplyIndex);
|
|
|
|
|
|
// 如果类型为混凝土、砂浆、配合比、机械,则市场单价和供货方式不能修改
|
|
|
if (canNotChangeTypeId.indexOf(data.unit_price.type) >= 0) {
|
|
@@ -474,13 +475,14 @@ ProjectGLJSpread.prototype.priceCalculate = function(info) {
|
|
|
* @return {void}
|
|
|
*/
|
|
|
ProjectGLJSpread.prototype.changeSupplyType = function(info) {
|
|
|
- let supply = info.newValue;
|
|
|
- let supplyNumber = this.supplyType.indexOf(supply) > -1 ? this.supplyType.indexOf(supply) : 0;
|
|
|
+ // let supply = info.newValue;
|
|
|
+ // let supplyNumber = this.supplyType.indexOf(supply) > -1 ? this.supplyType.indexOf(supply) : 0;
|
|
|
+ let supplyNumber = info.newValue;
|
|
|
let supplyQuantityColumn = this.sheetObj.getFieldColumn('supply_quantity');
|
|
|
let activeSheet = this.sheetObj.getSheet();
|
|
|
|
|
|
// 部分甲供时可更改甲供数量数据,其余则只读
|
|
|
- let locked = supplyNumber === 1 ? false : true;
|
|
|
+ let locked = supplyNumber == 1 ? false : true;
|
|
|
activeSheet.getCell(info.row, supplyQuantityColumn, GC.Spread.Sheets.SheetArea.viewport).locked(locked);
|
|
|
|
|
|
let supplyQuantity = this.getSupplyQuantity(supplyNumber, activeSheet, info);
|
|
@@ -500,7 +502,7 @@ ProjectGLJSpread.prototype.getSupplyQuantity = function(supplyType, activeSheet,
|
|
|
// 获取总消耗量
|
|
|
let quantity = activeSheet.getValue(info.row, quantityColumn);
|
|
|
// 自行采购和甲定乙供则把甲供数量设置为0,其余情况则设置为当前总消耗量
|
|
|
- let supplyQuantity = supplyType === 0 || supplyType === 3 ? 0 : quantity;
|
|
|
+ let supplyQuantity = supplyType == 0 || supplyType == 3 ? 0 : quantity;
|
|
|
supplyQuantity = parseFloat(supplyQuantity);
|
|
|
|
|
|
return supplyQuantity;
|