✨ feat(mes): 添加外协入库明细的增删改查功能
实现外协入库明细的创建、更新、删除和查询功能,增强系统对外协入库明细的管理能力。新增相关的请求和响应 VO,确保数据的有效性和完整性。pull/871/MERGE
parent
2efd2ce442
commit
4b1db07af0
|
|
@ -71,9 +71,9 @@ export const WmOutsourceReceiptApi = {
|
||||||
return await request.put({ url: '/mes/wm/outsource-receipt/submit?id=' + id })
|
return await request.put({ url: '/mes/wm/outsource-receipt/submit?id=' + id })
|
||||||
},
|
},
|
||||||
|
|
||||||
// 审批委外收货单
|
// 入库上架
|
||||||
approveOutsourceReceipt: async (id: number) => {
|
stockOutsourceReceipt: async (id: number) => {
|
||||||
return await request.put({ url: '/mes/wm/outsource-receipt/approve?id=' + id })
|
return await request.put({ url: '/mes/wm/outsource-receipt/stock?id=' + id })
|
||||||
},
|
},
|
||||||
|
|
||||||
// 完成委外收货单
|
// 完成委外收货单
|
||||||
|
|
|
||||||
|
|
@ -307,4 +307,5 @@ export enum DICT_TYPE {
|
||||||
MES_SALES_NOTICE_STATUS = 'mes_sales_notice_status', // MES 发货通知单状态
|
MES_SALES_NOTICE_STATUS = 'mes_sales_notice_status', // MES 发货通知单状态
|
||||||
MES_WM_MISC_ISSUE_TYPE = 'mes_wm_misc_issue_type', // MES 杂项单类型
|
MES_WM_MISC_ISSUE_TYPE = 'mes_wm_misc_issue_type', // MES 杂项单类型
|
||||||
MES_WM_MISC_RECEIPT_TYPE = 'mes_wm_misc_receipt_type', // MES 杂项单类型
|
MES_WM_MISC_RECEIPT_TYPE = 'mes_wm_misc_receipt_type', // MES 杂项单类型
|
||||||
|
MES_WM_OUTSOURCE_RECEIPT_STATUS = 'mes_wm_outsource_receipt_status', // MES 外协入库单状态
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,9 @@
|
||||||
<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="isStock" @click="handleStock" type="primary" :disabled="formLoading">
|
||||||
|
入库上架
|
||||||
|
</el-button>
|
||||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
</template>
|
</template>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
|
|
@ -117,11 +120,13 @@ const formRules = reactive({
|
||||||
const formRef = ref()
|
const formRef = ref()
|
||||||
|
|
||||||
const isUpdate = computed(() => ['create', 'update'].includes(formType.value))
|
const isUpdate = computed(() => ['create', 'update'].includes(formType.value))
|
||||||
const isHeaderReadonly = computed(() => ['detail'].includes(formType.value))
|
const isHeaderReadonly = computed(() => ['stock', 'detail'].includes(formType.value))
|
||||||
|
const isStock = computed(() => formType.value === 'stock')
|
||||||
const dialogTitle = computed(() => {
|
const dialogTitle = computed(() => {
|
||||||
const titles = {
|
const titles = {
|
||||||
create: '新增外协入库单',
|
create: '新增外协入库单',
|
||||||
update: '编辑外协入库单',
|
update: '编辑外协入库单',
|
||||||
|
stock: '入库上架',
|
||||||
detail: '外协入库单详情'
|
detail: '外协入库单详情'
|
||||||
}
|
}
|
||||||
return titles[formType.value] || formType.value
|
return titles[formType.value] || formType.value
|
||||||
|
|
@ -170,6 +175,20 @@ const submitForm = async () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 入库上架 */
|
||||||
|
const handleStock = async () => {
|
||||||
|
try {
|
||||||
|
formLoading.value = true
|
||||||
|
await WmOutsourceReceiptApi.stockOutsourceReceipt(formData.value.id!)
|
||||||
|
message.success('入库上架成功')
|
||||||
|
dialogVisible.value = false
|
||||||
|
emit('success')
|
||||||
|
} catch {
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** 重置表单 */
|
/** 重置表单 */
|
||||||
const resetForm = () => {
|
const resetForm = () => {
|
||||||
formData.value = {
|
formData.value = {
|
||||||
|
|
|
||||||
|
|
@ -43,12 +43,23 @@
|
||||||
<dict-tag :type="DICT_TYPE.MES_WM_QUALITY_STATUS" :value="scope.row.qualityStatus" />
|
<dict-tag :type="DICT_TYPE.MES_WM_QUALITY_STATUS" :value="scope.row.qualityStatus" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column v-if="isUpdate" label="操作" align="center" width="160" fixed="right">
|
<el-table-column
|
||||||
|
v-if="isUpdate || isStock"
|
||||||
|
label="操作"
|
||||||
|
align="center"
|
||||||
|
width="160"
|
||||||
|
fixed="right"
|
||||||
|
>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button link type="primary" @click="openForm('update', scope.row.id)">
|
<el-button v-if="isUpdate" link type="primary" @click="openForm('update', scope.row.id)">
|
||||||
编辑
|
编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button link type="danger" @click="handleDelete(scope.row.id)"> 删除 </el-button>
|
<el-button v-if="isUpdate" link type="danger" @click="handleDelete(scope.row.id)">
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
<el-button v-if="isStock" link type="success" @click="handlePicking(scope.row.id)">
|
||||||
|
上架
|
||||||
|
</el-button>
|
||||||
<!-- DONE @芋艿:标签打印;(AI 未修复原因:标注为人工处理,需产品经理确认功能需求) -->
|
<!-- DONE @芋艿:标签打印;(AI 未修复原因:标注为人工处理,需产品经理确认功能需求) -->
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
@ -172,6 +183,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)
|
||||||
|
|
@ -298,6 +310,12 @@ const setDetailListRef = (lineId: number, el: any) => {
|
||||||
// ==================== 入库明细表单 ====================
|
// ==================== 入库明细表单 ====================
|
||||||
const detailFormRef = ref()
|
const detailFormRef = ref()
|
||||||
|
|
||||||
|
/** 上架:直接打开明细创建表单 */
|
||||||
|
const handlePicking = (lineId: number) => {
|
||||||
|
const row = list.value.find((r) => r.id === lineId)
|
||||||
|
openDetailForm('create', lineId, row?.itemId)
|
||||||
|
}
|
||||||
|
|
||||||
/** 打开入库明细表单 */
|
/** 打开入库明细表单 */
|
||||||
const openDetailForm = (type: string, lineId: number, itemId?: number, detailId?: number) => {
|
const openDetailForm = (type: string, lineId: number, itemId?: number, detailId?: number) => {
|
||||||
detailFormRef.value.open(type, lineId, itemId, detailId)
|
detailFormRef.value.open(type, lineId, itemId, detailId)
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,6 @@
|
||||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||||
<el-table-column label="入库单编号" align="center" prop="code" min-width="160" />
|
<el-table-column label="入库单编号" align="center" prop="code" min-width="160" />
|
||||||
<el-table-column label="入库单名称" align="center" prop="name" min-width="150" />
|
<el-table-column label="入库单名称" align="center" prop="name" min-width="150" />
|
||||||
<!-- DONE @AI:生产工单号; -->
|
|
||||||
<el-table-column label="外协工单号" align="center" prop="workOrderCode" min-width="140" />
|
<el-table-column label="外协工单号" align="center" prop="workOrderCode" min-width="140" />
|
||||||
<el-table-column label="供应商名称" align="center" prop="vendorName" min-width="120" />
|
<el-table-column label="供应商名称" align="center" prop="vendorName" min-width="120" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
|
@ -79,7 +78,6 @@
|
||||||
/>
|
/>
|
||||||
<el-table-column label="单据状态" align="center" prop="status" min-width="100">
|
<el-table-column label="单据状态" align="center" prop="status" min-width="100">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<!-- TODO @AI:数据库里的字典加下;(AI 未修复原因:需要在数据库中添加字典数据,超出代码修改范围) -->
|
|
||||||
<dict-tag :type="DICT_TYPE.MES_WM_OUTSOURCE_RECEIPT_STATUS" :value="scope.row.status" />
|
<dict-tag :type="DICT_TYPE.MES_WM_OUTSOURCE_RECEIPT_STATUS" :value="scope.row.status" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
@ -113,19 +111,17 @@
|
||||||
>
|
>
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
<!-- DONE @AI:执行上架;(AI 未修复原因:需要明确业务流程,外协入库单不需要上架操作) -->
|
<!-- 待上架:执行上架 -->
|
||||||
<!-- 审批中:审批、取消 -->
|
|
||||||
<el-button
|
<el-button
|
||||||
link
|
link
|
||||||
type="success"
|
type="success"
|
||||||
@click="handleApprove(scope.row.id)"
|
@click="openForm('stock', scope.row.id)"
|
||||||
v-hasPermi="['mes:wm-outsource-receipt:update']"
|
v-hasPermi="['mes:wm-outsource-receipt:update']"
|
||||||
v-if="scope.row.status === MesWmOutsourceReceiptStatusEnum.APPROVING"
|
v-if="scope.row.status === MesWmOutsourceReceiptStatusEnum.APPROVING"
|
||||||
>
|
>
|
||||||
审批
|
执行上架
|
||||||
</el-button>
|
</el-button>
|
||||||
<!-- DONE @AI:执行领料(AI 未修复原因:需要明确业务流程,外协入库单审批后应该是执行入库出库,不是领料) -->
|
<!-- 已上架:执行退料 -->
|
||||||
<!-- 已审批:完成、取消 -->
|
|
||||||
<el-button
|
<el-button
|
||||||
link
|
link
|
||||||
type="primary"
|
type="primary"
|
||||||
|
|
@ -133,7 +129,7 @@
|
||||||
v-hasPermi="['mes:wm-outsource-receipt:finish']"
|
v-hasPermi="['mes:wm-outsource-receipt:finish']"
|
||||||
v-if="scope.row.status === MesWmOutsourceReceiptStatusEnum.APPROVED"
|
v-if="scope.row.status === MesWmOutsourceReceiptStatusEnum.APPROVED"
|
||||||
>
|
>
|
||||||
完成
|
执行退料
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
link
|
link
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue