| | |
| | | unit: res.product.unit, |
| | | model:res.product.model, |
| | | specs:res.product.specs, |
| | | moreUnit:res.product.moreUnit, |
| | | moreUnitList:res.product.moreUnitList, |
| | | auxiliaryUnit:res.auxiliaryUnit, |
| | | auxiliaryAmount:res.auxiliaryAmount, |
| | | auxiliaryAmount:res.amount&&adjunctAmount?Number(adjunctAmount)*Number(res.amount):0, |
| | | auxiliaryAmountInfo:adjunctAmount?Number(adjunctAmount):0, |
| | | inputFloatAuxiliaryAmount:isValue, |
| | | grossWeight:res.product.grossWeight, |
| | | totalGrossWeight:res.totalGrossWeight, |
| | |
| | | productName: res.name, |
| | | productId: res.id, |
| | | auxiliaryUnit:adjunctUnit, |
| | | auxiliaryAmount:Number(adjunctAmount), |
| | | auxiliaryAmount:adjunctAmount?Number(adjunctAmount)*1:0, |
| | | auxiliaryAmountInfo:adjunctAmount?Number(adjunctAmount):0, |
| | | inputFloatAuxiliaryAmount:isValue, |
| | | grossWeight:res.grossWeight, |
| | | totalGrossWeight:res.grossWeight?Number(res.grossWeight)*1:'', |
| | |
| | | }); |
| | | return list||[]; |
| | | }, |
| | | getAuxiligyAmount(unit,unitList){ |
| | | let adjunctUnit='' |
| | | let adjunctAmount='' |
| | | let isValue=false |
| | | let moreUnit=unit?unit:'' |
| | | let moreUnitList=unitList?unitList:[] |
| | | if(moreUnit&&moreUnitList){ |
| | | if(moreUnitList.length>0){ |
| | | for(let j in moreUnitList){ |
| | | if(moreUnitList[j].floating){ |
| | | isValue=true; |
| | | adjunctUnit=moreUnitList[j].unit |
| | | adjunctAmount=moreUnitList[j].amount |
| | | break; |
| | | } |
| | | } |
| | | if(!isValue){ |
| | | for(let j in moreUnitList){ |
| | | if(moreUnitList[j].unit){ |
| | | adjunctUnit=moreUnitList[j].unit |
| | | adjunctAmount=moreUnitList[j].amount |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return { |
| | | auxiliaryAmount:adjunctAmount, |
| | | auxiliaryUnit:adjunctUnit, |
| | | } |
| | | }, |
| | | // 操作输入 |
| | | inputContent(val, prop, row) { |
| | | this.countId = row.countId; |
| | | this.tableData.map((item) => { |
| | | if (item.id == row.id) { |
| | | debugger |
| | | item[prop] = val; |
| | | let auxiliaryAmountObject=this.getAuxiligyAmount(item.moreUnit,item.moreUnitList) |
| | | if(prop=='amount'){ |
| | | item.totalGrossWeight=item[prop]&&item.grossWeight?Number(item.grossWeight)*Number(item[prop]):'' |
| | | item.totalNetWeight=item[prop]&&item.netWeight?Number(item.netWeight)*Number(item[prop]):'' |
| | | item.auxiliaryAmount=item[prop]&&auxiliaryAmountObject.auxiliaryAmount?Number(auxiliaryAmountObject.auxiliaryAmount)*Number(item[prop]):'' |
| | | } |
| | | } |
| | | }); |