Commit 74cd1ba9 authored by dragondean@qq.com's avatar dragondean@qq.com

拆单的bug

parent 884e4d34
...@@ -142,7 +142,8 @@ export default { ...@@ -142,7 +142,8 @@ export default {
if (f.selected) result.push({ if (f.selected) result.push({
orderId: this.orderId, orderId: this.orderId,
wareId: f.pid, wareId: f.pid,
areaId: f.id areaId: f.id,
locationName: f.code
}) })
else { else {
f.positionList?.forEach(g => { f.positionList?.forEach(g => {
...@@ -151,7 +152,8 @@ export default { ...@@ -151,7 +152,8 @@ export default {
orderId: this.orderId, orderId: this.orderId,
wareId: g.domainId, wareId: g.domainId,
areaId: g.areaId, areaId: g.areaId,
locationId: g.id locationId: g.id,
locationName: f.code + g.code
}) })
else g.children?.forEach(k => { else g.children?.forEach(k => {
// 子位置 // 子位置
...@@ -159,7 +161,8 @@ export default { ...@@ -159,7 +161,8 @@ export default {
orderId: this.orderId, orderId: this.orderId,
wareId: k.domainId, wareId: k.domainId,
areaId: k.areaId, areaId: k.areaId,
locationId: k.id locationId: k.id,
locationName: f.code + k.code
}) })
}) })
}) })
......
...@@ -613,7 +613,7 @@ export default { ...@@ -613,7 +613,7 @@ export default {
return specsRecordVOList return specsRecordVOList
} }
}, },
// 根据入仓ID获取拆出数据??? // 根据入仓ID获取拆出数据
getWarehouseInSplitData(){ getWarehouseInSplitData(){
return (warehouseInId, field) => { return (warehouseInId, field) => {
let total = new Decimal(0) let total = new Decimal(0)
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<el-table-column :label="$t('体积') + '(m³)'" prop="volume" /> <el-table-column :label="$t('体积') + '(m³)'" prop="volume" />
<el-table-column :label="$t('重量') + '(kg)'" prop="weight" /> <el-table-column :label="$t('重量') + '(kg)'" prop="weight" />
<el-table-column :label="$t('数量(个)')" prop="quantityAll" /> <el-table-column :label="$t('数量(个)')" prop="quantityAll" />
<el-table-column :label="$t('入仓快递单号')" prop="expressNo" />--> <el-table-column :label="$t('入仓快递单号')" prop="expressNo" />
<el-table-column :label="$t('首次入仓时间')" prop="inTime" > <el-table-column :label="$t('首次入仓时间')" prop="inTime" >
<template slot-scope="{row}">{{row.inTime|parseTime}}</template> <template slot-scope="{row}">{{row.inTime|parseTime}}</template>
</el-table-column> </el-table-column>
...@@ -49,7 +49,8 @@ ...@@ -49,7 +49,8 @@
{{$t('剩余')}}: {{$t('剩余')}}:
{{leftData('num')}}{{$t('箱')}}, {{leftData('num')}}{{$t('箱')}},
{{$t('体积')}}:{{leftData('volume')}}{{$t('m³')}}, {{$t('体积')}}:{{leftData('volume')}}{{$t('m³')}},
{{$t('重量')}}:{{leftData('weight')}}{{$t('kg')}} {{$t('重量')}}:{{leftData('weight')}}{{$t('kg')}},
{{$t('数量')}}:{{leftData('quantity')}}{{$t('个')}}
</div> </div>
</el-card> </el-card>
<el-card class="box-card mt-10"> <el-card class="box-card mt-10">
...@@ -70,7 +71,7 @@ ...@@ -70,7 +71,7 @@
<el-form-item class="flex" label-width="0" <el-form-item class="flex" label-width="0"
:prop="`list.${$index}.num`" :prop="`list.${$index}.num`"
:rules="{required: true, message: $t('不能为空'), trigger: 'blur'}"> :rules="{required: true, message: $t('不能为空'), trigger: 'blur'}">
<el-input-number controls-position="right" :min="0" class="w-75 tight" v-model="row.num" :max="warehouseRecord.cartonsNum"></el-input-number> <el-input-number controls-position="right" :min="0" class="w-75 tight" v-model="row.num" :max="warehouseRecord.cartonsNum" @change="calc(row)"></el-input-number>
<dict-selector class="w-75" :type="DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE" v-model="row.specificationType" defaultable></dict-selector> <dict-selector class="w-75" :type="DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE" v-model="row.specificationType" defaultable></dict-selector>
</el-form-item> </el-form-item>
</template> </template>
...@@ -167,18 +168,18 @@ ...@@ -167,18 +168,18 @@
<template v-slot="{row,$index}"> <template v-slot="{row,$index}">
<el-form-item label-width="0" <el-form-item label-width="0"
:prop="`list.${$index}.quantity`" :prop="`list.${$index}.quantity`"
:rules="{required: quantityshow, message: $t('不能为空'), trigger: 'blur'}"> :rules="{required: false, message: $t('不能为空'), trigger: 'blur'}">
<el-input-number controls-position="right" :min="0" :max="warehouseRecord.quantityAll" class="w-75 tight" v-model.number="row.quantity" />{{ $t('') }} <el-input-number controls-position="right" :min="0" :max="warehouseRecord.quantityAll > 0 ? warehouseRecord.quantityAll : null" class="w-75 tight" v-model.number="row.quantity" />{{ $t('') }}
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<!--<el-table-column :label="$t('快递单号')"> <el-table-column :label="$t('快递单号')">
<template v-slot="{row,$index}"> <template v-slot="{row,$index}">
<el-form-item label-width="0"> <el-form-item label-width="0">
<el-input v-model="row.expressNo"></el-input> <el-input v-model="row.expressNo"></el-input>
</el-form-item> </el-form-item>
</template> </template>
</el-table-column>--> </el-table-column>
<el-table-column :label="$t('储位')" prop="orderLocationBackVOList"> <el-table-column :label="$t('储位')" prop="orderLocationBackVOList">
<template v-slot="{ row, column, $index }"> <template v-slot="{ row, column, $index }">
<!--<el-button type="primary" size="mini" @click="showLocation(row, $index)">{{ $t('选择储位') }}</el-button>--> <!--<el-button type="primary" size="mini" @click="showLocation(row, $index)">{{ $t('选择储位') }}</el-button>-->
...@@ -251,8 +252,10 @@ export default { ...@@ -251,8 +252,10 @@ export default {
leftData(){ leftData(){
return (field, containNew = false) => { return (field, containNew = false) => {
// 入仓记录跟拆单记录的箱数字段不同,要做特殊处理 // 入仓记录跟拆单记录的箱数字段不同,要做特殊处理
let left = new Decimal(this.warehouseRecord[field == 'num' ? 'cartonsNum' : field] || 0) let warehouseField = field
console.log('leftData', left.toNumber()) if(field == 'num') warehouseField = 'cartonsNum'
if(field == 'quantity') warehouseField = 'quantityAll'
let left = new Decimal(this.warehouseRecord[warehouseField] || 0)
// 累减已拆记录 // 累减已拆记录
if(this.warehouseRecord.specsRecordVOList && this.warehouseRecord.specsRecordVOList.length){ if(this.warehouseRecord.specsRecordVOList && this.warehouseRecord.specsRecordVOList.length){
this.warehouseRecord.specsRecordVOList.forEach(item => { this.warehouseRecord.specsRecordVOList.forEach(item => {
...@@ -278,15 +281,16 @@ export default { ...@@ -278,15 +281,16 @@ export default {
methods:{ methods:{
// 添加一行 // 添加一行
addRow(){ addRow(){
let { specificationType, boxGauge1, boxGauge2, boxGauge3, volume, weight } = this.warehouseRecord let { specificationType, boxGauge1, boxGauge2, boxGauge3, volume, weight, expressNo } = this.warehouseRecord
let num = this.warehouseRecord.cartonsNum let num = this.warehouseRecord.cartonsNum
// 根据入仓记录添加一行 // 根据入仓记录添加一行
this.form.list.push({ this.form.list.push({
warehouseInId: this.warehouseRecord.id, warehouseInId: this.warehouseRecord.id,
specificationType, boxGauge1, boxGauge2, boxGauge3, specificationType, boxGauge1, boxGauge2, boxGauge3, expressNo,
volume: this.leftData('volume', true), volume: this.leftData('volume', true),
weight: this.leftData('weight', true), weight: this.leftData('weight', true),
num: this.leftData('num', true), num: this.leftData('num', true),
quantity: this.leftData('quantity', true),
orderLocationList: this.warehouseRecord.orderLocationBackVOList orderLocationList: this.warehouseRecord.orderLocationBackVOList
}) })
}, },
...@@ -318,6 +322,13 @@ export default { ...@@ -318,6 +322,13 @@ export default {
}) })
return Array.from(new Set(arr)).join(",") return Array.from(new Set(arr)).join(",")
}, },
// 根据箱数计算体积,重量,数量
calc(row){
const rate = row.num / this.warehouseRecord.cartonsNum
row.volume = (this.warehouseRecord.volume * rate).toFixed(2)
row.weight = (this.warehouseRecord.weight * rate).toFixed(2)
row.quantity = (this.warehouseRecord.quantityAll * rate).toFixed(2)
},
closeDialog(){ closeDialog(){
this.show = false this.show = false
this.$emit('close'); this.$emit('close');
......
...@@ -313,7 +313,7 @@ ...@@ -313,7 +313,7 @@
<el-table-column :label="$t('快递单号')" prop="expressNo"></el-table-column> <el-table-column :label="$t('快递单号')" prop="expressNo"></el-table-column>
<el-table-column :label="$t('储位')" prop="orderLocationBackVOList"> <el-table-column :label="$t('储位')" prop="orderLocationBackVOList">
<template v-slot="{ row, column, $index }"> <template v-slot="{ row, column, $index }">
{{row.orderLocationList}} {{getLocationName(row.orderLocationBackVOList)}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('操作')"> <el-table-column :label="$t('操作')">
...@@ -404,7 +404,7 @@ ...@@ -404,7 +404,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="shopAdd" :disabled="!shopForm.specsRecordVOList.length">{{$t('确定')}}</el-button> <el-button type="primary" @click="shopAdd" :disabled="!shopForm.specsRecordVOList || !shopForm.specsRecordVOList.length">{{$t('确定')}}</el-button>
<el-button @click="shopCancel">{{$t('取消')}}</el-button> <el-button @click="shopCancel">{{$t('取消')}}</el-button>
</div> </div>
</el-dialog> </el-dialog>
...@@ -622,9 +622,10 @@ export default { ...@@ -622,9 +622,10 @@ export default {
num: new Decimal(this.orderItem.warehouseInInfoVO?.cartonsNum || 0), num: new Decimal(this.orderItem.warehouseInInfoVO?.cartonsNum || 0),
volume: new Decimal(this.orderItem.warehouseInInfoVO?.volume || 0), volume: new Decimal(this.orderItem.warehouseInInfoVO?.volume || 0),
weight: new Decimal(this.orderItem.warehouseInInfoVO?.weight || 0), weight: new Decimal(this.orderItem.warehouseInInfoVO?.weight || 0),
quantity: new Decimal(this.orderItem.warehouseInInfoVO?.quantity || 0), quantity: new Decimal(this.orderItem.warehouseInInfoVO?.quantityAll || 0),
chargeVolume: new Decimal(this.orderItem.chargeVolume || 0), chargeVolume: new Decimal(this.orderItem.chargeVolume || 0),
chargeWeight: new Decimal(this.orderItem.chargeWeight || 0) chargeWeight: new Decimal(this.orderItem.chargeWeight || 0),
worth: new Decimal(this.orderItem.worth || 0),
} }
// 全部拆单的放入数据累减 // 全部拆单的放入数据累减
this.splitData.forEach(split => { this.splitData.forEach(split => {
...@@ -632,6 +633,7 @@ export default { ...@@ -632,6 +633,7 @@ export default {
// 每个品名都要累减收费数据 // 每个品名都要累减收费数据
data.chargeVolume = data.chargeVolume.minus(new Decimal(splitItem.chargeVolume || 0)) data.chargeVolume = data.chargeVolume.minus(new Decimal(splitItem.chargeVolume || 0))
data.chargeWeight = data.chargeWeight.minus(new Decimal(splitItem.chargeWeight || 0)) data.chargeWeight = data.chargeWeight.minus(new Decimal(splitItem.chargeWeight || 0))
data.worth = data.worth.minus(new Decimal(splitItem.worth || 0))
// 每个品名的入仓记录挨个累减其他数据 // 每个品名的入仓记录挨个累减其他数据
if(splitItem.orderItemId == this.shopForm.orderItemId){ if(splitItem.orderItemId == this.shopForm.orderItemId){
...@@ -741,7 +743,10 @@ export default { ...@@ -741,7 +743,10 @@ export default {
// 获取入仓记录的剩余数据 // 获取入仓记录的剩余数据
getWarehouseLeftData(){ getWarehouseLeftData(){
return (warehouseRecord, field) => { return (warehouseRecord, field) => {
let total = new Decimal(warehouseRecord[ field == 'num' ? 'cartonsNum' : field ] || 0) let warehouseField = field
if(field == 'num') warehouseField = 'cartonsNum'
if(field == 'quantity') warehouseField = 'quantityAll'
let total = new Decimal(warehouseRecord[ warehouseField ] || 0)
this.getWarehouseInspecsRecordVOList(warehouseRecord.id).forEach(item => { this.getWarehouseInspecsRecordVOList(warehouseRecord.id).forEach(item => {
total = total.minus(new Decimal(item[field] || 0)) total = total.minus(new Decimal(item[field] || 0))
}) })
...@@ -1107,7 +1112,7 @@ export default { ...@@ -1107,7 +1112,7 @@ 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(",")
}, },
......
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