|
|
@@ -305,7 +305,7 @@ let indexObj= {
|
|
|
function setQuantities(items,data) {
|
|
|
let quantity = 0;
|
|
|
for (let i of items){
|
|
|
- let coe = i.quantityIndexCoe && i.quantityIndexCoe!=""?parseFloat(i.quantityIndexCoe):1;
|
|
|
+ let coe = i.quantityIndexCoe && i.quantityIndexCoe!=""?parseFloat(i.quantityIndexCoe):0;
|
|
|
i.quantity = scMathUtil.roundForObj(parseFloat(i.quantity)*coe,getDecimal("process"));
|
|
|
quantity = scMathUtil.roundForObj(quantity + i.quantity,getDecimal("process"));
|
|
|
}
|
|
|
@@ -365,7 +365,7 @@ let indexObj= {
|
|
|
for(let g of gljs){
|
|
|
if(!g.quantity || g.quantity=="") continue;
|
|
|
let marketPrice = gljUtil.getMarketPrice(g,projectGLJData,calcOptions,decimalObj,false,_,scMathUtil); // gljOprObj.setGLJPrice(tem,g);
|
|
|
- let materialIndexCoe = g.materialIndexCoe?scMathUtil.roundForObj(g.materialIndexCoe,getDecimal("process")):1;
|
|
|
+ let materialIndexCoe = g.materialIndexCoe?scMathUtil.roundForObj(g.materialIndexCoe,getDecimal("process")):0;
|
|
|
let t_quantity = scMathUtil.roundForObj(g.quantity * materialIndexCoe,getDecimal("process"));
|
|
|
quantity = scMathUtil.roundForObj(t_quantity + quantity,getDecimal("process"));
|
|
|
let temPrice = scMathUtil.roundForObj(g.quantity * marketPrice,getDecimal("process"));
|
|
|
@@ -494,7 +494,7 @@ let indexObj= {
|
|
|
onEcoQuantityValueChange:function (sender,info) {
|
|
|
let value = info.newValue;
|
|
|
let dataCode = indexObj.ecoQuantitySetting.header[info.col].dataCode;
|
|
|
- if(!info.newValue){
|
|
|
+ if(!gljUtil.isDef(info.newValue)){
|
|
|
return;
|
|
|
}
|
|
|
if (value&&!sheetCommonObj.checkData(info.col,indexObj.ecoQuantitySetting, value)) {
|
|
|
@@ -580,7 +580,7 @@ let indexObj= {
|
|
|
onMaterialChange:function (sender,info) {
|
|
|
let value = info.newValue,updateMap = {};
|
|
|
let dataCode = indexObj.materialSetting.header[info.col].dataCode;
|
|
|
- if(!info.newValue){
|
|
|
+ if(!gljUtil.isDef(info.newValue)){
|
|
|
return;
|
|
|
}
|
|
|
if (value&&!sheetCommonObj.checkData(info.col,indexObj.materialSetting, value)) {
|
|
|
@@ -614,8 +614,13 @@ let indexObj= {
|
|
|
let updateMap = {};
|
|
|
for(let c of info.changedCells){
|
|
|
let value= info.sheet.getCell(c.row, c.col).text();
|
|
|
+ let dataCode = indexObj.materialSetting.header[c.col].dataCode;
|
|
|
let recode = indexObj.materialDatas[c.row];
|
|
|
- let tem = indexObj.getMaterialUpdateData(recode,value);
|
|
|
+ if (value&&!sheetCommonObj.checkData(c.col,indexObj.materialSetting, value)) {
|
|
|
+ alert('输入的数据类型不对,请重新输入!');
|
|
|
+ return indexObj.showDatas();
|
|
|
+ }
|
|
|
+ let tem = indexObj.getMaterialUpdateData(recode,dataCode,value);
|
|
|
if(tem) updateMap[recode.id] = tem;
|
|
|
}
|
|
|
if(_.isEmpty(updateMap)) return indexObj.showDatas();
|