✨ feat(mes): 添加外协发料单数量校验功能
新增校验接口,确保外协发料单每行明细数量之和与行发料数量一致。此功能提升了数据准确性,避免了潜在的发料错误。pull/871/MERGE
parent
ce14a5ae6d
commit
2e87bf55b5
|
|
@ -64,6 +64,11 @@ export const WmOutsourceIssueApi = {
|
||||||
return await request.put({ url: '/mes/wm/outsource-issue/cancel?id=' + id })
|
return await request.put({ url: '/mes/wm/outsource-issue/cancel?id=' + id })
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 校验外协发料单数量
|
||||||
|
checkOutsourceIssueQuantity: async (id: number) => {
|
||||||
|
return await request.get({ url: '/mes/wm/outsource-issue/check-quantity?id=' + id })
|
||||||
|
},
|
||||||
|
|
||||||
// 导出外协发料单 Excel
|
// 导出外协发料单 Excel
|
||||||
exportOutsourceIssue: async (params: any) => {
|
exportOutsourceIssue: async (params: any) => {
|
||||||
return await request.download({ url: '/mes/wm/outsource-issue/export-excel', params })
|
return await request.download({ url: '/mes/wm/outsource-issue/export-excel', params })
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,13 @@
|
||||||
<el-table-column label="库区名称" align="center" prop="locationName" min-width="100" />
|
<el-table-column label="库区名称" align="center" prop="locationName" min-width="100" />
|
||||||
<el-table-column label="库位名称" align="center" prop="areaName" min-width="100" />
|
<el-table-column label="库位名称" align="center" prop="areaName" min-width="100" />
|
||||||
<el-table-column label="数量" align="center" prop="quantity" width="100" />
|
<el-table-column label="数量" align="center" prop="quantity" width="100" />
|
||||||
<el-table-column v-if="isUpdate" label="操作" align="center" width="120" fixed="right">
|
<el-table-column
|
||||||
|
v-if="props.formType === 'stock'"
|
||||||
|
label="操作"
|
||||||
|
align="center"
|
||||||
|
width="120"
|
||||||
|
fixed="right"
|
||||||
|
>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button link type="primary" @click="emit('edit-detail', scope.row.id)">
|
<el-button link type="primary" @click="emit('edit-detail', scope.row.id)">
|
||||||
编辑
|
编辑
|
||||||
|
|
@ -39,8 +45,6 @@ const emit = defineEmits(['edit-detail'])
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
const isUpdate = computed(() => ['create', 'update'].includes(props.formType)) // 是否为编辑模式
|
|
||||||
|
|
||||||
const loading = ref(false) // 列表的加载中
|
const loading = ref(false) // 列表的加载中
|
||||||
const list = ref<WmOutsourceIssueDetailVO[]>([]) // 明细列表
|
const list = ref<WmOutsourceIssueDetailVO[]>([]) // 明细列表
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -166,8 +166,12 @@ const submitForm = async () => {
|
||||||
/** 执行拣货 */
|
/** 执行拣货 */
|
||||||
const handleStock = async () => {
|
const handleStock = async () => {
|
||||||
try {
|
try {
|
||||||
await message.confirm('确认执行拣货吗?执行后将进入待执行出库状态。')
|
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
|
// 校验发料数量与拣货数量是否一致
|
||||||
|
const quantityMatch = await WmOutsourceIssueApi.checkOutsourceIssueQuantity(formData.value.id!)
|
||||||
|
if (!quantityMatch) {
|
||||||
|
await message.confirm('发料数量与拣货数量不一致,确认执行拣货?')
|
||||||
|
}
|
||||||
await WmOutsourceIssueApi.stockOutsourceIssue(formData.value.id!)
|
await WmOutsourceIssueApi.stockOutsourceIssue(formData.value.id!)
|
||||||
message.success('拣货成功')
|
message.success('拣货成功')
|
||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,13 @@
|
||||||
<el-table-column label="单位" align="center" prop="unitMeasureName" width="80" />
|
<el-table-column label="单位" align="center" prop="unitMeasureName" width="80" />
|
||||||
<el-table-column label="领料数量" align="center" prop="quantity" width="100" />
|
<el-table-column label="领料数量" align="center" prop="quantity" width="100" />
|
||||||
<el-table-column label="批次号" align="center" prop="batchCode" min-width="120" />
|
<el-table-column label="批次号" align="center" prop="batchCode" min-width="120" />
|
||||||
<el-table-column v-if="isUpdate" label="操作" align="center" width="200" fixed="right">
|
<el-table-column
|
||||||
|
v-if="isUpdate || isStock"
|
||||||
|
label="操作"
|
||||||
|
align="center"
|
||||||
|
width="160"
|
||||||
|
fixed="right"
|
||||||
|
>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button v-if="isUpdate" link type="primary" @click="openForm('update', scope.row.id)">
|
<el-button v-if="isUpdate" link type="primary" @click="openForm('update', scope.row.id)">
|
||||||
编辑
|
编辑
|
||||||
|
|
@ -42,14 +48,8 @@
|
||||||
<el-button v-if="isUpdate" link type="danger" @click="handleDelete(scope.row.id)">
|
<el-button v-if="isUpdate" link type="danger" @click="handleDelete(scope.row.id)">
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
<!-- DONE @芋艿:这里是不是上架?(AI 未修复原因:需产品经理确认业务逻辑,建议人工确认) -->
|
<el-button v-if="isStock" link type="success" @click="handlePicking(scope.row.id)">
|
||||||
<el-button
|
拣货
|
||||||
v-if="isUpdate"
|
|
||||||
link
|
|
||||||
type="success"
|
|
||||||
@click="handleAddDetail(scope.row.id, scope.row.itemId)"
|
|
||||||
>
|
|
||||||
添加明细
|
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
@ -133,6 +133,7 @@ const { t } = useI18n() // 国际化
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
const isUpdate = computed(() => ['create', 'update'].includes(props.formType)) // 是否为编辑模式
|
const isUpdate = computed(() => ['create', 'update'].includes(props.formType)) // 是否为编辑模式
|
||||||
|
const isStock = computed(() => props.formType === 'stock') // 是否为拣货模式
|
||||||
|
|
||||||
// ==================== 列表 ====================
|
// ==================== 列表 ====================
|
||||||
const loading = ref(false) // 列表的加载中
|
const loading = ref(false) // 列表的加载中
|
||||||
|
|
@ -250,9 +251,10 @@ const setDetailListRef = (lineId: number, el: any) => {
|
||||||
// ==================== 发料明细表单(LineList 层级持有) ====================
|
// ==================== 发料明细表单(LineList 层级持有) ====================
|
||||||
const detailFormRef = ref()
|
const detailFormRef = ref()
|
||||||
|
|
||||||
/** 添加明细:直接打开明细创建表单 */
|
/** 拣货:直接打开明细创建表单 */
|
||||||
const handleAddDetail = (lineId: number, itemId?: number) => {
|
const handlePicking = (lineId: number) => {
|
||||||
openDetailForm('create', lineId, itemId)
|
const row = list.value.find((r) => r.id === lineId)
|
||||||
|
openDetailForm('create', lineId, row?.itemId)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 打开发料明细表单 */
|
/** 打开发料明细表单 */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue