Commit 1ce94b43 authored by dragondean@qq.com's avatar dragondean@qq.com

拆单计算默认收费数据,入仓记录显示拆出后剩余数据

parent 0f20e604
......@@ -239,7 +239,7 @@
style="width: 100%">
<el-table-column :label="$t('箱数')">
<template v-slot="{row,$index}">
{{row.cartonsNum}}
{{getWarehouseLeftData(row, 'num')}}
<dict-tag :type="DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE" v-model="row.specificationType"></dict-tag>
</template>
</el-table-column>
......@@ -265,11 +265,19 @@
</el-table-column>
<el-table-column label="入仓体积(m³)">
<template v-slot="{row,$index}">
{{row.volume}}
{{getWarehouseLeftData(row, 'volume')}}
</template>
</el-table-column>
<el-table-column label="入仓重量(Kg)" prop="weight">
<template v-slot="{row,$index}">
{{getWarehouseLeftData(row, 'weight')}}
</template>
</el-table-column>
<el-table-column :label="$t('数量')" prop="quantity">
<template v-slot="{row,$index}">
{{getWarehouseLeftData(row, 'quantity')}}
</template>
</el-table-column>
<el-table-column label="入仓重量(Kg)" prop="weight"></el-table-column>
<el-table-column :label="$t('数量')" prop="quantity"></el-table-column>
<el-table-column :label="$t('快递单号')" prop="expressNo"></el-table-column>
<el-table-column :label="$t('储位')" prop="orderLocationBackVOList">
<template v-slot="{ row, column, $index }">
......@@ -614,6 +622,16 @@ export default {
})
return total.toNumber()
}
},
// 获取入仓记录的剩余数据
getWarehouseLeftData(){
return (warehouseRecord, field) => {
let total = new Decimal(warehouseRecord[ field == 'num' ? 'cartonsNum' : field ] || 0)
this.getWarehouseInspecsRecordVOList(warehouseRecord.id).forEach(item => {
total = total.minus(new Decimal(item[field] || 0))
})
return total.toNumber()
}
}
},
methods: {
......@@ -898,6 +916,12 @@ export default {
this.shopForm.specsRecordVOList.push({...item})
})
this.currentPutIn = null
// 根据比例计算默认的收费方数和收费重量
const orderItem = this.orderData.orderItemVOList.find(item => item.orderItemId == this.shopForm.orderItemId)
const rate = this.putin.num / orderItem.warehouseInInfoVO.cartonsNum
this.$set(this.shopForm, 'chargeVolume', (orderItem.chargeVolume*rate).toFixed(2))
this.$set(this.shopForm, 'chargeWeight', (orderItem.chargeWeight*rate).toFixed(2))
},
// 清空放入记录
clearAll(){
......
......@@ -270,8 +270,9 @@
style="width: 100%">
<el-table-column :label="$t('箱数')">
<template v-slot="{row,$index}">
{{row.cartonsNum}}
<dict-tag :type="DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE" v-model="row.specificationType"></dict-tag>
<!--{{row.cartonsNum}}-->
{{getWarehouseLeftData(row, 'num')}}
<dict-tag :type="DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE" v-model="row.specificationType"></dict-tag>
</template>
</el-table-column>
<el-table-column :label="$t('包装类型')">
......@@ -296,11 +297,19 @@
</el-table-column>
<el-table-column label="入仓体积(m³)">
<template v-slot="{row,$index}">
{{row.volume}}
{{getWarehouseLeftData(row, 'volume')}}
</template>
</el-table-column>
<el-table-column label="入仓重量(Kg)" prop="weight">
<template v-slot="{row,$index}">
{{getWarehouseLeftData(row, 'weight')}}
</template>
</el-table-column>
<el-table-column :label="$t('数量')" prop="quantity">
<template v-slot="{row,$index}">
{{getWarehouseLeftData(row, 'quantity')}}
</template>
</el-table-column>
<el-table-column label="入仓重量(Kg)" prop="weight"></el-table-column>
<el-table-column :label="$t('数量')" prop="quantity"></el-table-column>
<el-table-column :label="$t('快递单号')" prop="expressNo"></el-table-column>
<el-table-column :label="$t('储位')" prop="orderLocationBackVOList">
<template v-slot="{ row, column, $index }">
......@@ -728,6 +737,16 @@ export default {
})
return total.toNumber()
}
},
// 获取入仓记录的剩余数据
getWarehouseLeftData(){
return (warehouseRecord, field) => {
let total = new Decimal(warehouseRecord[ field == 'num' ? 'cartonsNum' : field ] || 0)
this.getWarehouseInspecsRecordVOList(warehouseRecord.id).forEach(item => {
total = total.minus(new Decimal(item[field] || 0))
})
return total.toNumber()
}
}
},
methods: {
......@@ -1108,6 +1127,12 @@ export default {
this.shopForm.specsRecordVOList.push({...item})
})
this.currentPutIn = null
// 根据比例计算默认的收费方数和收费重量
const orderItem = this.orderData.orderItemVOList.find(item => item.orderItemId == this.shopForm.orderItemId)
const rate = this.putin.num / orderItem.warehouseInInfoVO.cartonsNum
this.$set(this.shopForm, 'chargeVolume', (orderItem.chargeVolume*rate).toFixed(2))
this.$set(this.shopForm, 'chargeWeight', (orderItem.chargeWeight*rate).toFixed(2))
},
// 清空放入记录
clearAll(){
......
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