Commit 4330e29a authored by dragondean@qq.com's avatar dragondean@qq.com

修复拆单异常bug

parent 2b7273f5
...@@ -203,8 +203,7 @@ ...@@ -203,8 +203,7 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('操作')" align="center"> <el-table-column :label="$t('操作')" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="index==0" disabled size="mini" type="text" icon="el-icon-delete" @click="removeShop(scope.row.id)">{{$t('移出')}}</el-button> <el-button size="mini" type="text" icon="el-icon-delete" @click="removeShop(scope.row.id)">{{$t('移出')}}</el-button>
<el-button v-else size="mini" type="text" icon="el-icon-delete" @click="removeShop(scope.row.id)">{{$t('移出')}}</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -261,7 +260,7 @@ ...@@ -261,7 +260,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('剩余数据')"> <el-form-item :label="$t('剩余数据')">
<div>{{$t('剩余箱数')}}{{ shopForm.sum || 0 }}</div> <div>{{$t('剩余箱数')}}:{{ mainOrderItem.num || 0 }}</div>
<div> <div>
{{ $t('入仓方数') }}:{{ mainOrderItem.volume || 0 }}m³ {{ $t('入仓方数') }}:{{ mainOrderItem.volume || 0 }}m³
{{ $t('收费方数') }}:{{ mainOrderItem.chargeVolume || 0 }}m³ {{ $t('收费方数') }}:{{ mainOrderItem.chargeVolume || 0 }}m³
...@@ -370,7 +369,7 @@ ...@@ -370,7 +369,7 @@
<el-form-item label-width="0" <el-form-item label-width="0"
:prop="`specsRecordVOList.${$index}.weight`" :prop="`specsRecordVOList.${$index}.weight`"
:rules="{required: true, message: $t('不能为空'), trigger: 'blur'}"> :rules="{required: true, message: $t('不能为空'), trigger: 'blur'}">
<el-input-number controls-position="right" :min="0" class="w-100 tight" v-model="row.weight"/> <el-input-number controls-position="right" :min="0" class="w-75 tight" v-model="row.weight"/>
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
...@@ -382,7 +381,7 @@ ...@@ -382,7 +381,7 @@
<el-form-item label-width="0" <el-form-item label-width="0"
:prop="`specsRecordVOList.${$index}.chargeWeight`" :prop="`specsRecordVOList.${$index}.chargeWeight`"
:rules="{required: true, message: $t('不能为空'), trigger: 'blur'}"> :rules="{required: true, message: $t('不能为空'), trigger: 'blur'}">
<el-input-number controls-position="right" :min="0" class="w-100 tight" v-model="row.chargeWeight" type="number"/> <el-input-number controls-position="right" :min="0" class="w-75 tight" v-model="row.chargeWeight" type="number"/>
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
...@@ -428,7 +427,7 @@ ...@@ -428,7 +427,7 @@
<!--</el-form>--> <!--</el-form>-->
</el-card> </el-card>
<el-form-item :label="$t('放入数据')"> <el-form-item :label="$t('放入数据')">
<div>{{$t('箱数')}}{{ putin.num || 0 }}</div> <div>{{$t('箱数')}}{{ putin.num || 0 }}</div>
<div> <div>
{{ $t('入仓方数') }}:{{ putin.volume || 0 }}m³ {{ $t('入仓方数') }}:{{ putin.volume || 0 }}m³
{{ $t('收费方数') }}:{{ putin.chargeVolume || 0 }}m³ {{ $t('收费方数') }}:{{ putin.chargeVolume || 0 }}m³
...@@ -647,6 +646,19 @@ export default { ...@@ -647,6 +646,19 @@ export default {
if(!this.orderItem.orderItemId || !this.splitData.length || !this.splitData[0].orderSplitItemBackVOList) return {} if(!this.orderItem.orderItemId || !this.splitData.length || !this.splitData[0].orderSplitItemBackVOList) return {}
return this.splitData[0].orderSplitItemBackVOList.find(item => item.orderItemId == this.orderItem.orderItemId) || {} return this.splitData[0].orderSplitItemBackVOList.find(item => item.orderItemId == this.orderItem.orderItemId) || {}
}, },
// 剩余数据
leftData(){
let data = {
num: new Decimal(this.currentWarehouseItem?.num || 0),
volume: new Decimal(this.currentWarehouseItem?.volume || 0),
// chargeVolume: new Decimal(this.currentWarehouseItem?.num || 0),
weight: new Decimal(this.currentWarehouseItem?.weight || 0),
// chargeWeight: new Decimal(this.currentWarehouseItem?.num || 0),
quantity: new Decimal(this.currentWarehouseItem?.quantity || 0)
}
// TODO 对已拆记录进行累减
return data
},
// 放入数据 // 放入数据
putin(){ putin(){
let data = { let data = {
...@@ -678,6 +690,10 @@ export default { ...@@ -678,6 +690,10 @@ export default {
currentWarehouseId(){ currentWarehouseId(){
return this.orderData.adjustToDestWarehouseId || this.orderData.logisticsInfoDto.startWarehouseId return this.orderData.adjustToDestWarehouseId || this.orderData.logisticsInfoDto.startWarehouseId
}, },
// 当前选择的入仓记录
currentWarehouseItem(){
return this.getOrderItemWarehouseIn(this.shopForm.orderItemId).find(item => item.id === this.selectedWarehouseInId)
},
// 根据orderItemId获取入仓记录 // 根据orderItemId获取入仓记录
getOrderItemWarehouseIn() { getOrderItemWarehouseIn() {
return orderItemId => { return orderItemId => {
...@@ -685,7 +701,7 @@ export default { ...@@ -685,7 +701,7 @@ export default {
return list.map(item => { return list.map(item => {
let [boxGauge1, boxGauge2, boxGauge3] = item.boxGauge.split('*') let [boxGauge1, boxGauge2, boxGauge3] = item.boxGauge.split('*')
let labelArr = [ let labelArr = [
this.$t('{num}箱', {num: item.num}), this.$t('{num}箱', {num: item.cartonsNum}),
this.$l(this.getDictDatas(this.DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE).find(dict => dict.value == item.specificationType), 'label'), this.$l(this.getDictDatas(this.DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE).find(dict => dict.value == item.specificationType), 'label'),
this.$t('长{boxGauge1}cm', {boxGauge1}), this.$t('长{boxGauge1}cm', {boxGauge1}),
this.$t('宽{boxGauge2}cm', {boxGauge2}), this.$t('宽{boxGauge2}cm', {boxGauge2}),
...@@ -867,6 +883,8 @@ export default { ...@@ -867,6 +883,8 @@ export default {
addShop(index){ addShop(index){
this.splitItemIndex = index this.splitItemIndex = index
this.shopOpen = true this.shopOpen = true
// 重置表单数据
this.shopForm = {specsRecordVOList:[]}
}, },
addSplit(){ addSplit(){
this.form.transportId = this.orderData.transportId this.form.transportId = this.orderData.transportId
...@@ -1018,7 +1036,7 @@ export default { ...@@ -1018,7 +1036,7 @@ export default {
if(!this.shopForm.specsRecordVOList){ if(!this.shopForm.specsRecordVOList){
this.$set(this.shopForm,'specsRecordVOList',[]) this.$set(this.shopForm,'specsRecordVOList',[])
} }
const warehouseInItem = this.getOrderItemWarehouseIn(this.shopForm.orderItemId).find(item => item.id === this.selectedWarehouseInId) const warehouseInItem = this.currentWarehouseItem
if(!warehouseInItem){ if(!warehouseInItem){
return this.$message.info(this.$t("未找到对应入仓记录")) return this.$message.info(this.$t("未找到对应入仓记录"))
} }
......
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