Commit 9f88666e authored by dragondean@qq.com's avatar dragondean@qq.com

默认按照箱数比例计算,修改规格后按照规则计算体积

parent 09b51c92
...@@ -94,7 +94,8 @@ ...@@ -94,7 +94,8 @@
</template> </template>
<template v-slot="{row,$index}"> <template v-slot="{row,$index}">
<el-form-item label-width="0"> <el-form-item label-width="0">
<el-input-number controls-position="right" :min="0" class="w-100 tight" v-model="row.boxGauge1" @blur="calcVolume(row)"/> <input class="input" v-model="row.boxGauge1" type="number" @keyup="calcVolume(row)" @change="calcVolume(row)" :min="0"></input>
<!--<el-input-number controls-position="right" :min="0" class="w-100 tight" v-model="row.boxGauge1" @blur="calcVolume(row)"/>-->
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
...@@ -104,7 +105,8 @@ ...@@ -104,7 +105,8 @@
</template> </template>
<template v-slot="{row,$index}"> <template v-slot="{row,$index}">
<el-form-item label-width="0"> <el-form-item label-width="0">
<el-input-number controls-position="right" :min="0" class="w-100 tight" v-model="row.boxGauge2" @blur="calcVolume(row)" /> <input class="input" v-model="row.boxGauge2" type="number" @keyup="calcVolume(row)" @change="calcVolume(row)" :min="0"></input>
<!--<el-input-number controls-position="right" :min="0" class="w-100 tight" v-model="row.boxGauge2" @blur="calcVolume(row)" />-->
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
...@@ -114,7 +116,8 @@ ...@@ -114,7 +116,8 @@
</template> </template>
<template v-slot="{row,$index}"> <template v-slot="{row,$index}">
<el-form-item label-width="0"> <el-form-item label-width="0">
<el-input-number controls-position="right" :min="0" class="w-100 tight" v-model="row.boxGauge3" @blur="calcVolume(row)"/> <input class="input" v-model="row.boxGauge3" type="number" @keyup="calcVolume(row)" @change="calcVolume(row)" :min="0"></input>
<!--<el-input-number controls-position="right" :min="0" class="w-100 tight" v-model="row.boxGauge3" @blur="calcVolume(row)"/>-->
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
...@@ -338,12 +341,15 @@ export default { ...@@ -338,12 +341,15 @@ export default {
}, },
// 计算体积 // 计算体积
calcVolume(row){ calcVolume(row){
// 改了规格后按照规格计算体积
this.$set(row, 'calcVolumeByBoxGauge', 1)
let volume = Decimal(row.boxGauge1 || 0) let volume = Decimal(row.boxGauge1 || 0)
.times(Decimal(row.boxGauge2 || 0)) .times(Decimal(row.boxGauge2 || 0))
.times(Decimal(row.boxGauge3 || 0)).div(1000000) .times(Decimal(row.boxGauge3 || 0)).div(1000000)
// 如果是箱的单位要乘以箱数 // 如果是箱的单位要乘以箱数
if(row.specificationType === 1) { if(+row.specificationType === 1) {
row.volume = volume.times(Decimal(row.num || 0)) volume = volume.times(Decimal(row.num || 0))
} }
// 最低0.01 // 最低0.01
...@@ -355,16 +361,22 @@ export default { ...@@ -355,16 +361,22 @@ export default {
if(!locationArr || !locationArr.length) return '' if(!locationArr || !locationArr.length) return ''
let arr = [] let arr = []
locationArr.forEach(item => { locationArr.forEach(item => {
arr.push(`${item.areaName}${item.locationName || ''}`) arr.push(`${item.areaName || ''}${item.locationName || ''}`)
}) })
return Array.from(new Set(arr)).join(",") return Array.from(new Set(arr)).join(",")
}, },
// 根据箱数计算体积,重量,数量 // 根据箱数计算体积,重量,数量
calc(row){ calc(row){
const rate = row.num / this.warehouseRecord.cartonsNum const rate = row.num / this.warehouseRecord.cartonsNum
row.volume = (this.warehouseRecord.volume * rate).toFixed(2) row.volume = (this.warehouseRecord.volume * rate).toFixed(2)
row.weight = (this.warehouseRecord.weight * rate).toFixed(2) row.weight = (this.warehouseRecord.weight * rate).toFixed(2)
row.quantity = (this.warehouseRecord.quantityAll * rate).toFixed(0) row.quantity = (this.warehouseRecord.quantityAll * rate).toFixed(0)
// 如果是按照规格计算体积,则重新计算
if(row.calcVolumeByBoxGauge){
this.calcVolume(row)
}
}, },
closeDialog(){ closeDialog(){
this.show = false this.show = false
......
...@@ -920,21 +920,6 @@ export default { ...@@ -920,21 +920,6 @@ export default {
} }
this.open = true this.open = true
}, },
/*changeProdTitleZh(val){
var list = []
list = this.splitData[0].orderSplitItemBackVOList.filter(item=>item.id == val)
this.shopForm.sum = list[0].num
this.quantitySum = list[0].quantity
this.shopForm.orderItemId = list[0].orderItemId
this.shopForm.prodTitleEn = list[0].prodTitleEn
this.shopForm.prodTitleZh = list[0].prodTitleZh
// 默认给一个
if(!this.shopForm.specsRecordVOList || !this.shopForm.specsRecordVOList.length){
this.addRow()
}
this.numcheck()
},*/
// 查询数量是否必填 // 查询数量是否必填
numcheck(){ numcheck(){
quantityRequired(this.orderData.lineId).then(res=>{ quantityRequired(this.orderData.lineId).then(res=>{
...@@ -1012,6 +997,7 @@ export default { ...@@ -1012,6 +997,7 @@ export default {
volume: this.putin.volume, volume: this.putin.volume,
chargeVolume: this.shopForm.chargeVolume, chargeVolume: this.shopForm.chargeVolume,
weight: this.putin.weight, weight: this.putin.weight,
quantity: this.putin.quantity,
chargeWeight: this.shopForm.chargeWeight, chargeWeight: this.shopForm.chargeWeight,
worth: this.shopForm.worth || 0, worth: this.shopForm.worth || 0,
specsRecordVOList:this.shopForm.specsRecordVOList specsRecordVOList:this.shopForm.specsRecordVOList
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment