✨ feat(mes): 添加运单填写功能及相关状态管理
parent
5375487d57
commit
4d66a7072c
|
|
@ -48,9 +48,19 @@ export const WmProductSalesApi = {
|
||||||
return await request.put({ url: '/mes/wm/product-sales/submit?id=' + id })
|
return await request.put({ url: '/mes/wm/product-sales/submit?id=' + id })
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 校验销售出库单数量
|
||||||
|
checkProductSalesQuantity: async (id: number) => {
|
||||||
|
return await request.get({ url: '/mes/wm/product-sales/check-quantity?id=' + id })
|
||||||
|
},
|
||||||
|
|
||||||
// 执行拣货
|
// 执行拣货
|
||||||
pickProductSales: async (id: number) => {
|
stockProductSales: async (id: number) => {
|
||||||
return await request.put({ url: '/mes/wm/product-sales/pick?id=' + id })
|
return await request.put({ url: '/mes/wm/product-sales/stock?id=' + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 填写运单
|
||||||
|
shippingProductSales: async (data: WmProductSalesVO) => {
|
||||||
|
return await request.put({ url: '/mes/wm/product-sales/shipping', data })
|
||||||
},
|
},
|
||||||
|
|
||||||
// 执行出库
|
// 执行出库
|
||||||
|
|
|
||||||
|
|
@ -266,6 +266,7 @@ export const MesWmProductReceiptStatusEnum = {
|
||||||
export const MesWmProductSalesStatusEnum = {
|
export const MesWmProductSalesStatusEnum = {
|
||||||
PREPARE: MesOrderStatusConstants.DRAFT,
|
PREPARE: MesOrderStatusConstants.DRAFT,
|
||||||
APPROVING: MesOrderStatusConstants.APPROVING,
|
APPROVING: MesOrderStatusConstants.APPROVING,
|
||||||
|
SHIPPING: 10, // 待填写运单
|
||||||
APPROVED: MesOrderStatusConstants.APPROVED,
|
APPROVED: MesOrderStatusConstants.APPROVED,
|
||||||
FINISHED: MesOrderStatusConstants.FINISHED,
|
FINISHED: MesOrderStatusConstants.FINISHED,
|
||||||
CANCELED: MesOrderStatusConstants.CANCELLED
|
CANCELED: MesOrderStatusConstants.CANCELLED
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,7 @@
|
||||||
<el-button v-if="isUpdate" @click="submitForm" type="primary" :disabled="formLoading">
|
<el-button v-if="isUpdate" @click="submitForm" type="primary" :disabled="formLoading">
|
||||||
确 定
|
确 定
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-if="isPick" @click="handlePick" type="primary" :disabled="formLoading">
|
<el-button v-if="isPick" @click="handleStock" type="primary" :disabled="formLoading">
|
||||||
执行拣货
|
执行拣货
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-if="isShipping" @click="handleShipping" type="primary" :disabled="formLoading">
|
<el-button v-if="isShipping" @click="handleShipping" type="primary" :disabled="formLoading">
|
||||||
|
|
@ -241,11 +241,15 @@ const submitForm = async () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 执行拣货 */
|
/** 执行拣货 */
|
||||||
const handlePick = async () => {
|
const handleStock = async () => {
|
||||||
try {
|
try {
|
||||||
await message.confirm('确认执行拣货?')
|
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
await WmProductSalesApi.pickProductSales(formData.value.id!)
|
// 校验出库数量与拣货数量是否一致
|
||||||
|
const quantityMatch = await WmProductSalesApi.checkProductSalesQuantity(formData.value.id!)
|
||||||
|
if (!quantityMatch) {
|
||||||
|
await message.confirm('出库数量与拣货数量不一致,确认执行拣货?')
|
||||||
|
}
|
||||||
|
await WmProductSalesApi.stockProductSales(formData.value.id!)
|
||||||
message.success('拣货成功')
|
message.success('拣货成功')
|
||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
emit('success')
|
emit('success')
|
||||||
|
|
@ -256,19 +260,16 @@ const handlePick = async () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 填写运单 */
|
/** 填写运单 */
|
||||||
// TODO @AI:方法改成 handleShipping
|
|
||||||
const handleShipping = async () => {
|
const handleShipping = async () => {
|
||||||
try {
|
try {
|
||||||
await message.confirm('确认提交运单信息?')
|
await message.confirm('确认提交运单信息?')
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
// 只提交运输信息字段
|
|
||||||
const data = {
|
const data = {
|
||||||
id: formData.value.id,
|
id: formData.value.id,
|
||||||
carrier: formData.value.carrier,
|
carrier: formData.value.carrier,
|
||||||
shippingNumber: formData.value.shippingNumber
|
shippingNumber: formData.value.shippingNumber
|
||||||
} as unknown as WmProductSalesVO
|
} as unknown as WmProductSalesVO
|
||||||
// TODO @AI:不是更新方法,需要增加一个 controller 接口;
|
await WmProductSalesApi.shippingProductSales(data)
|
||||||
await WmProductSalesApi.updateProductSales(data)
|
|
||||||
message.success('运单信息填写成功')
|
message.success('运单信息填写成功')
|
||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
emit('success')
|
emit('success')
|
||||||
|
|
|
||||||
|
|
@ -136,18 +136,26 @@
|
||||||
>
|
>
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
<!-- DONE @AI:执行拣货;之后状态是 status = 10(填写运单)(AI 未修复原因:需要后端增加新状态和状态流转逻辑,需人工实现) -->
|
|
||||||
<!-- 待拣货:拣货、取消 -->
|
<!-- 待拣货:拣货、取消 -->
|
||||||
<el-button
|
<el-button
|
||||||
link
|
link
|
||||||
type="success"
|
type="success"
|
||||||
@click="openForm('pick', scope.row.id)"
|
@click="openForm('stock', scope.row.id)"
|
||||||
v-hasPermi="['mes:wm-product-sales:pick']"
|
v-hasPermi="['mes:wm-product-sales:stock']"
|
||||||
v-if="scope.row.status === MesWmProductSalesStatusEnum.APPROVING"
|
v-if="scope.row.status === MesWmProductSalesStatusEnum.APPROVING"
|
||||||
>
|
>
|
||||||
拣货
|
拣货
|
||||||
</el-button>
|
</el-button>
|
||||||
<!-- DONE @AI:增加【填写运单】操作:(需要增加一个 status = 10);注意,填写运单,继续搞在 /Users/yunai/Java/yudao-all-in-one/yudao-ui-admin-vue3/src/views/mes/wm/productsales/ProductSalesForm.vue 里;只允许填写(承运商、运货单号)两个字段;(单独搞个 --- --- 分栏)(AI 未修复原因:需要后端增加新状态和填写运单接口,需人工实现) -->
|
<!-- 待填写运单:填写运单、取消 -->
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="warning"
|
||||||
|
@click="openForm('shipping', scope.row.id)"
|
||||||
|
v-hasPermi="['mes:wm-product-sales:shipping']"
|
||||||
|
v-if="scope.row.status === MesWmProductSalesStatusEnum.SHIPPING"
|
||||||
|
>
|
||||||
|
填写运单
|
||||||
|
</el-button>
|
||||||
<!-- 待出库:执行出库、取消 -->
|
<!-- 待出库:执行出库、取消 -->
|
||||||
<el-button
|
<el-button
|
||||||
link
|
link
|
||||||
|
|
@ -166,6 +174,7 @@
|
||||||
v-if="
|
v-if="
|
||||||
[
|
[
|
||||||
MesWmProductSalesStatusEnum.APPROVING,
|
MesWmProductSalesStatusEnum.APPROVING,
|
||||||
|
MesWmProductSalesStatusEnum.SHIPPING,
|
||||||
MesWmProductSalesStatusEnum.APPROVED
|
MesWmProductSalesStatusEnum.APPROVED
|
||||||
].includes(scope.row.status)
|
].includes(scope.row.status)
|
||||||
"
|
"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue