Commit f9be6a38 authored by dragondean@qq.com's avatar dragondean@qq.com

装柜拆单兼容按入仓记录放入

parent 36900e21
......@@ -211,212 +211,152 @@
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="$t('放入品名')" :visible.sync="shopOpen" width="1500px" append-to-body>
<el-form ref="shopForm" :model="shopForm" :rules="shopRules" label-width="150px" size="mini">
<el-form-item :label="$t('中文品名')+':'" prop="orderItemId">
<el-select v-model="shopForm.orderItemId" :placeholder="$t('请选择中文品名')">
<el-option v-for="item in orderItems" :label="item.prodTitleZh" :value="item.orderItemId" :key="item.id" :disabled="itemDisabled(item)"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('英文品名')+':'" prop="orderItemId">
<el-select v-model="shopForm.orderItemId" :placeholder="$t('请选择英文品名')">
<el-option v-for="item in orderItems" :label="item.prodTitleEn" :value="item.orderItemId" :key="item.id" :disabled="itemDisabled(item)"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('选择入仓记录')">
<el-select :placeholder="$t('选择入仓记录')" v-model="selectedWarehouseInId" clearable>
<el-option v-for="item in getOrderItemWarehouseIn(shopForm.orderItemId)" :label="item.text" :value="item.id" :key="item.id" ></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('剩余数据')">
<div>{{$t('剩余箱数')}}:{{ mainOrderItem.num || 0 }}</div>
<div>
{{ $t('入仓方数') }}:{{ mainOrderItem.volume || 0 }}m³
{{ $t('收费方数') }}:{{ mainOrderItem.chargeVolume || 0 }}m³
</div>
<div>
{{ $t('入仓重量') }}:{{ mainOrderItem.weight || 0 }}kg
{{ $t('收费重量') }}:{{ mainOrderItem.chargeWeight || 0 }}kg
</div>
<div>
{{ $t('数量(个)') }}:{{ mainOrderItem.quantity || 0 }}
{{ $t('剩余货值') }}:{{ mainOrderItem.worth || 0 }}{{ $t('元') }}
</div>
</el-form-item>
<el-card class="box-card" v-if="shopForm.specsRecordVOList">
<div slot="header" class="clearfix">
<span>{{ $t('入仓记录') }}</span>
<el-button style="float: right;margin-left: 15px" size="mini" type="primary" icon="el-icon-minus" circle @click="deleteRow" :disabled="shopForm.specsRecordVOList.length <= 1"></el-button>
<el-button style="float: right" size="mini" type="primary" icon="el-icon-plus" circle @click="addRow" :disabled="!shopForm.orderItemId || !selectedWarehouseInId"></el-button>
</div>
<el-table
:data="shopForm.specsRecordVOList"
style="width: 100%">
<el-table-column :label="$t('箱数')" width="200px">
<template v-slot:header>
<span style="color: red">*</span>{{ $t('箱数') }}
</template>
<template v-slot="{row,$index}">
<el-form-item class="flex" label-width="0"
:prop="`specsRecordVOList.${$index}.num`"
:rules="{required: true, message: $t('不能为空'), trigger: 'blur'}">
<el-input-number controls-position="right" :min="0" class="w-75 tight" v-model="row.num" type="number"></el-input-number>
<dict-selector class="w-75" :type="DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE" v-model="row.specificationType" defaultable></dict-selector>
</el-form-item>
</template>
</el-table-column>
<el-table-column :label="$t('包装类型')" width="100px">
<template v-slot:header>
<span style="color: red">*</span>{{ $t('包装类型') }}
</template>
<template v-slot="{row,$index}">
<el-form-item label-width="0">
<dict-selector :type="DICT_TYPE.ECW_PACKAGING_TYPE" v-model="row.unit" defaultable></dict-selector>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="长(cm)">
<template v-slot:header>
<span>{{ $t('') }}</span>(cm)
</template>
<template v-slot="{row,$index}">
<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)"/>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="宽(cm)">
<template v-slot:header>
<span>{{ $t('') }}</span>(cm)
</template>
<template v-slot="{row,$index}">
<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)" />
</el-form-item>
</template>
</el-table-column>
<el-table-column label="高(cm)">
<template v-slot:header>
<span>{{ $t('') }}</span>(cm)
</template>
<template v-slot="{row,$index}">
<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)"/>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="入仓体积(m³)">
<template v-slot:header>
<span style="color: red">*</span> <span>{{ $t('体积') }}</span>(m³)
</template>
<template v-slot="{row,$index}">
<el-form-item label-width="0"
:prop="`specsRecordVOList.${$index}.volume`"
:rules="{required: true, message: $t('不能为空'), trigger: 'blur'}">
<el-input-number controls-position="right" :min="0" class="w-100 tight" v-model="row.volume"/>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="收费体积(m³)">
<template v-slot:header>
<span style="color: red">*</span> <span>{{ $t('收费体积') }}</span>(m³)
</template>
<template v-slot="{row,$index}">
<el-form-item label-width="0"
:prop="`specsRecordVOList.${$index}.chargeVolume`"
:rules="{required: true, message: $t('不能为空'), trigger: 'blur'}">
<el-input-number controls-position="right" :min="0" class="w-100 tight" v-model="row.chargeVolume"/>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="入仓重量(Kg)">
<template v-slot:header>
<span style="color: red">*</span> <span>{{ $t('入仓重量') }}</span>(Kg)
</template>
<template v-slot="{row,$index}">
<el-form-item label-width="0"
:prop="`specsRecordVOList.${$index}.weight`"
:rules="{required: true, message: $t('不能为空'), trigger: 'blur'}">
<el-input-number controls-position="right" :min="0" class="w-100 tight" v-model="row.weight"/>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="收费重量(Kg)">
<template v-slot:header>
<span style="color: red">*</span> <span>{{ $t('收费重量') }}</span>(Kg)
</template>
<template v-slot="{row,$index}">
<el-form-item label-width="0"
:prop="`specsRecordVOList.${$index}.chargeWeight`"
: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-form-item>
</template>
</el-table-column>
<el-table-column :label="$t('数量')" width="130px">
<template v-slot="{row,$index}">
<el-form-item label-width="0"
:prop="`specsRecordVOList.${$index}.quantity`"
:rules="{required: isQuantity, message: $t('不能为空'), trigger: 'blur'}">
<el-input-number controls-position="right" :min="0" class="w-75 tight" v-model.number="row.quantity" />{{ $t('') }}
</el-form-item>
</template>
</el-table-column>
<el-table-column :label="$t('快递单号')">
<template v-slot="{row,$index}">
<el-form-item label-width="0">
<el-input v-model="row.expressNo"></el-input>
</el-form-item>
</template>
</el-table-column>
<el-table-column :label="$t('储位')" prop="orderLocationBackVOList">
<template v-slot="{ row, column, $index }">
<!--<el-button type="primary" size="mini" @click="showLocation(row, $index)">{{ $t('选择储位') }}</el-button>-->
<warehouse-area-select
v-model="row.orderLocationList"
:warehouse-id="splitData.dstWarehouseId"
></warehouse-area-select>
</template>
</el-table-column>
<el-table-column :label="$t('操作')">
<template v-slot="{ row, column, $index}">
<el-popconfirm
v-if="$index > 0"
:title="$t('确定要删除该行入仓记录吗?')"
@confirm="deleteRow($index)"
>
<template v-slot:reference>
<el-button size="mini" type="danger">删除</el-button>
</template>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
</el-card>
<el-form-item :label="$t('放入数据')">
<div>{{$t('箱数')}}{{ putin.num || 0 }}</div>
<div>
{{ $t('入仓方数') }}:{{ putin.volume || 0 }}m³
{{ $t('收费方数') }}:{{ putin.chargeVolume || 0 }}m³
</div>
<div>
{{ $t('入仓重量') }}:{{ putin.weight || 0 }}kg
{{ $t('收费重量') }}:{{ putin.chargeWeight || 0 }}kg
</div>
<div>
{{ $t('数量(个)') }}:{{ putin.quantity || 0 }}
</div>
</el-form-item>
<el-form ref="shopForm" :model="shopForm" :rules="shopRules" label-width="150px" inline>
<el-form-item :label="$t('中文品名')+':'" prop="orderItemId">
<el-select v-model="shopForm.orderItemId" :placeholder="$t('请选择中文品名')">
<el-option v-for="item in orderItems" :label="item.prodTitleZh" :value="item.orderItemId" :key="item.id" :disabled="itemDisabled(item)"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('英文品名')+':'" prop="orderItemId">
<el-select v-model="shopForm.orderItemId" :placeholder="$t('请选择英文品名')">
<el-option v-for="item in orderItems" :label="item.prodTitleEn" :value="item.orderItemId" :key="item.id" :disabled="itemDisabled(item)"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('放入货值')">
<el-input-number v-model="shopForm.worth" controls-position="right" :min="0" :max="mainOrderItem.worth"></el-input-number>
</el-form-item>
<!--按照原型这里需要显示剩余数量,但是事实无法计算剩余数量,因为已装数量是未知的-->
<!--<el-form-item :label="$t('放入数量(个)')+':'" prop="quantity" v-if="isQuantity">
<el-input-number v-model="shopForm.quantity" controls-position="right" :min="0" :max="mainOrderItem.quantity || undefined"></el-input-number>
</el-form-item>-->
<el-form-item :label="$t('备注信息')+':'">
<el-input v-model="shopForm.remarks"></el-input>
</el-form-item>
<div class="page-title">{{$t('品名可拆数据')}}</div>
<div class="pl-20">
<span class="mr-10">{{$t('箱数')}}:{{ mainOrderItem.num || 0 }}</span>
<span class="mr-10">{{ $t('入仓方数') }}:{{ mainOrderItem.volume || 0 }}m³</span>
<span class="mr-10">{{ $t('收费方数') }}:{{ mainOrderItem.chargeVolume || 0 }}m³</span>
<span class="mr-10">{{ $t('入仓重量') }}:{{ mainOrderItem.weight || 0 }}kg</span>
<span class="mr-10">{{ $t('收费重量') }}:{{ mainOrderItem.chargeWeight || 0 }}kg</span>
<span class="mr-10">{{ $t('数量(个)') }}:{{ mainOrderItem.quantity || 0 }}</span>
<span class="mr-10">{{ $t('剩余货值') }}:{{ mainOrderItem.worth || 0 }}{{ $t('元') }}</span>
</div>
<div class="page-title">{{$t('可拆入仓记录')}}</div>
<el-table
:data="getOrderItemWarehouseIn(shopForm.orderItemId)"
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>
</template>
</el-table-column>
<el-table-column :label="$t('包装类型')">
<template v-slot="{row,$index}">
<dict-tag :type="DICT_TYPE.ECW_PACKAGING_TYPE" v-model="row.unit"></dict-tag>
</template>
</el-table-column>
<el-table-column label="长(cm)">
<template v-slot="{row,$index}">
{{row.boxGauge1}}
</template>
</el-table-column>
<el-table-column label="宽(cm)">
<template v-slot="{row,$index}">
{{ row.boxGauge2 }}
</template>
</el-table-column>
<el-table-column label="高(cm)">
<template v-slot="{row,$index}">
{{ row.boxGauge3 }}
</template>
</el-table-column>
<el-table-column label="入仓体积(m³)">
<template v-slot="{row,$index}">
{{row.volume}}
</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 }">
{{row.orderLocationList}}
</template>
</el-table-column>
<el-table-column :label="$t('操作')">
<template v-slot="{ row, column, $index}">
<el-tag v-if="getWarehouseInSplitData(row.id,'num') >= row.cartonsNum" disabled size="mini" type="primary" >{{$t('已拆完')}}</el-tag>
<el-button v-else size="mini" type="primary" @click="putInRecord(row)">放入</el-button>
</template>
</el-table-column>
</el-table>
<div class="page-title">{{$t('已放入入仓记录')}}</div>
<el-table
:data="shopForm.specsRecordVOList"
style="width: 100%">
<el-table-column :label="$t('箱数')" width="200px">
<template v-slot="{row,$index}">
{{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('包装类型')" width="100px">
<template v-slot="{row,$index}">
<dict-tag :type="DICT_TYPE.ECW_PACKAGING_TYPE" v-model="row.unit"></dict-tag>
</template>
</el-table-column>
<el-table-column label="长(cm)">
<template v-slot="{row,$index}">
{{row.boxGauge1}}
</template>
</el-table-column>
<el-table-column label="宽(cm)">
<template v-slot="{row,$index}">
{{ row.boxGauge2 }}
</template>
</el-table-column>
<el-table-column label="高(cm)">
<template v-slot="{row,$index}">
{{ row.boxGauge3 }}
</template>
</el-table-column>
<el-table-column label="入仓体积(m³)">
<template v-slot="{row,$index}">
{{row.volume}}
</template>
</el-table-column>
<!--<el-table-column label="收费体积(m³)" prop="chargeVolume"></el-table-column>-->
<el-table-column label="入仓重量(Kg)" prop="weight"></el-table-column>
<!--<el-table-column label="收费重量(Kg)" prop="chargeWeight"></el-table-column>-->
<el-table-column :label="$t('数量')" width="130px" 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 }">
{{getLocationName(row.orderLocationList)}}
</template>
</el-table-column>
<el-table-column :label="$t('操作')">
<template v-slot="{ row, column, $index}">
<el-button size="mini" type="primary" @click="deleteRow($index)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="page-title">放入数据</div>
<div class="pl-20 mb-10">
<span class="mr-10">{{$t('箱数')}}:{{ putin.num || 0 }},</span>
<span class="mr-10">{{ $t('数量(个)') }}:{{ putin.quantity || 0 }},</span>
<span class="mr-10">{{ $t('入仓方数') }}:{{ putin.volume || 0 }}m³, </span>
<span class="mr-10">{{ $t('入仓重量') }}:{{ putin.weight || 0 }}kg</span>
</div>
<el-form-item :label="$t('收费方数')" prop="chargeVolume">
<el-input-number v-model="shopForm.chargeVolume" controls-position="right"></el-input-number>
</el-form-item>
<el-form-item :label="$t('收费重量')" prop="chargeWeight">
<el-input-number v-model="shopForm.chargeWeight" controls-position="right"></el-input-number>kg
</el-form-item>
<el-form-item :label="$t('放入货值')">
<el-input-number v-model="shopForm.worth" controls-position="right" :min="0" :max="mainOrderItem.worth">
<template slot="append">{{ $t('') }}</template>
</el-input-number>
</el-form-item>
<el-form-item :label="$t('备注信息')">
<el-input v-model="shopForm.remark"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="shopAdd">{{$t('确定')}}</el-button>
......@@ -425,6 +365,14 @@
</el-dialog>
<warehouse-record v-if="currentWarehouseRecord" :list="currentWarehouseRecord" append-to-body></warehouse-record>
<put-in
v-if="currentPutIn"
:warehouse-record="currentPutIn"
@close="currentPutIn=null"
@submit="handlePutin"
:warehouse-id="currentWarehouseId"
append-to-body
></put-in>
</div>
</template>
......@@ -445,11 +393,13 @@ import Decimal from "decimal.js";
import Warehouse from "@/views/ecw/order/warehousing/components/Warehouse";
import WarehouseRecord from "@/views/ecw/order/splitApply/components/WarehouseRecord";
import WarehouseAreaSelect from "@/components/WarehouseAreaSelect";
import PutIn from "@/views/ecw/order/splitApply/components/PutIn.vue";
export default {
name: "splitOrder",
inheritAttrs: false,
components: {
PutIn,
WarehouseAreaSelect,
WarehouseRecord,
Warehouse,
......@@ -501,7 +451,9 @@ export default {
// 订单入仓记录
warehouseInList: [],
// 当前选择的入仓记录ID
selectedWarehouseInId: null
selectedWarehouseInId: null,
// 当前正在放入的入仓记录
currentPutIn: null
};
},
created() {
......@@ -591,9 +543,9 @@ export default {
return this.orderData.adjustToDestWarehouseId || this.orderData.logisticsInfoDto.startWarehouseId
},
// 当前选择的入仓记录
currentWarehouseItem(){
/*currentWarehouseItem(){
return this.getOrderItemWarehouseIn(this.shopForm.orderItemId).find(item => item.id === this.selectedWarehouseInId)
},
},*/
// 根据orderItemId获取入仓记录
getOrderItemWarehouseIn() {
return orderItemId => {
......@@ -627,6 +579,35 @@ export default {
return item
})
}
},
// 根据入仓记录ID筛选出他的全部拆出记录(不含主单的)
getWarehouseInspecsRecordVOList(){
return warehouseInId => {
let specsRecordVOList = []
// 这里是拆单已放入的
this.splitData.orderSplitItemBackVOList.forEach(splitItem => {
splitItem.specsRecordVOList.forEach(specs => {
if(specs.warehouseInId === warehouseInId){
specsRecordVOList.push(specs)
}
})
})
// 这里是正在操作放入,但是还没确定提交的
this.shopForm.specsRecordVOList.forEach(item => {
if(item.warehouseInId == warehouseInId)specsRecordVOList.push(item)
})
return specsRecordVOList
}
},
// 根据入仓ID获取拆出数据???
getWarehouseInSplitData(){
return (warehouseInId, field) => {
let total = new Decimal(0)
this.getWarehouseInspecsRecordVOList(warehouseInId).forEach(item => {
total = total.plus(new Decimal(item[field] || 0))
})
return total.toNumber()
}
}
},
methods: {
......@@ -886,6 +867,31 @@ export default {
return this.$message.info(this.$t('暂无入仓记录'))
}
this.currentWarehouseRecord = row.specsRecordVOList
},
// 获取储位名称
getLocationName(locationArr){
if(!locationArr || !locationArr.length) return ''
let arr = []
locationArr.forEach(item => {
arr.push(`${item.areaName}${item.locationName || ''}`)
})
return Array.from(new Set(arr)).join(",")
},
// 根据入仓记录打开放入弹层
putInRecord(row){
this.currentPutIn = row
// 此条入仓记录已拆出的入仓记录,这样在放入的时候可以确保不超过此入仓记录的数量
this.currentPutIn.specsRecordVOList = this.getWarehouseInspecsRecordVOList(row.id)
},
// 放入回调
handlePutin(list){
if(!list.length){
return this.$message.error(this.$t("请至少放入一条数据"))
}
list.forEach(item => {
this.shopForm.specsRecordVOList.push({...item})
})
this.currentPutIn = null
}
},
};
......
......@@ -218,6 +218,8 @@ export default {
appendToBody: Boolean,
// 仓库ID,选择储位要用到
warehouseId: Number,
// 数量是否必须
quantityshow: Boolean
},
data(){
return {
......
......@@ -309,7 +309,7 @@
</el-table-column>
<el-table-column :label="$t('操作')">
<template v-slot="{ row, column, $index}">
<el-tag v-if="getWarehouseInLeftData(row.id,'num') >= row.cartonsNum" disabled size="mini" type="primary" >{{$t('已拆完')}}</el-tag>
<el-tag v-if="getWarehouseInSplitData(row.id,'num') >= row.cartonsNum" disabled size="mini" type="primary" >{{$t('已拆完')}}</el-tag>
<el-button v-else size="mini" type="primary" @click="putInRecord(row)">放入</el-button>
</template>
</el-table-column>
......@@ -349,9 +349,9 @@
{{row.volume}}
</template>
</el-table-column>
<el-table-column label="收费体积(m³)" prop="chargeVolume"></el-table-column>
<!--<el-table-column label="收费体积(m³)" prop="chargeVolume"></el-table-column>-->
<el-table-column label="入仓重量(Kg)" prop="weight"></el-table-column>
<el-table-column label="收费重量(Kg)" prop="chargeWeight"></el-table-column>
<!--<el-table-column label="收费重量(Kg)" prop="chargeWeight"></el-table-column>-->
<el-table-column :label="$t('数量')" width="130px" prop="quantity"></el-table-column>
<el-table-column :label="$t('快递单号')" prop="expressNo"></el-table-column>
<el-table-column :label="$t('储位')" prop="orderLocationBackVOList">
......@@ -714,8 +714,8 @@ export default {
return specsRecordVOList
}
},
// 根据入仓ID获取剩余数据
getWarehouseInLeftData(){
// 根据入仓ID获取拆出数据
getWarehouseInSplitData(){
return (warehouseInId, field) => {
let total = new Decimal(0)
this.getWarehouseInspecsRecordVOList(warehouseInId).forEach(item => {
......@@ -1091,16 +1091,7 @@ export default {
putInRecord(row){
this.currentPutIn = row
// 此条入仓记录已拆出的入仓记录,这样在放入的时候可以确保不超过此入仓记录的数量
let specsRecordVOList = []
this.splitData.forEach(split => {
split.orderSplitItemBackVOList.forEach(splitItem => {
splitItem.specsRecordVOList.forEach(specs => {
if(specs.warehouseInId === row.id){
specsRecordVOList.push(specs)
}
})
})
})
let specsRecordVOList = this.getWarehouseInspecsRecordVOList(getWarehouseInspecsRecordVOList)
this.currentPutIn.specsRecordVOList = 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