feat(mes): 添加 MES 转移单类型及状态枚举,更新相关表单字段禁用逻辑

pull/350/head
YunaiV 2026-05-30 13:20:41 +08:00
parent 83482781d6
commit 37b9db148f
11 changed files with 74 additions and 8 deletions

View File

@ -168,6 +168,7 @@ export const MesAutoCodeRuleCode = {
WM_STOCK_TAKING_CODE: 'WM_STOCK_TAKING_CODE', WM_STOCK_TAKING_CODE: 'WM_STOCK_TAKING_CODE',
WM_STOCK_TAKING_PLAN_CODE: 'WM_STOCK_TAKING_PLAN_CODE', WM_STOCK_TAKING_PLAN_CODE: 'WM_STOCK_TAKING_PLAN_CODE',
WM_WAREHOUSE_CODE: 'WM_WAREHOUSE_CODE', WM_WAREHOUSE_CODE: 'WM_WAREHOUSE_CODE',
TRANSFER_CODE: 'TRANSFER_CODE',
} as const; } as const;
/** MES 装箱单状态枚举 */ /** MES 装箱单状态枚举 */
@ -309,6 +310,22 @@ export const MesWmOutsourceReceiptStatusEnum = {
CANCELED: MesOrderStatusConstants.CANCELLED, CANCELED: MesOrderStatusConstants.CANCELLED,
} as const; } as const;
/** MES 转移单类型枚举 */
export const MesWmTransferTypeEnum = {
INNER: 1, // 内部调拨
OUTER: 2, // 外部调拨
} as const;
/** MES 转移单状态枚举 */
export const MesWmTransferStatusEnum = {
PREPARE: MesOrderStatusConstants.DRAFT, // 草稿
UNCONFIRMED: MesOrderStatusConstants.CONFIRMED, // 待确认
APPROVING: MesOrderStatusConstants.APPROVING, // 待上架
APPROVED: MesOrderStatusConstants.APPROVED, // 待执行
FINISHED: MesOrderStatusConstants.FINISHED, // 已完成
CANCELED: MesOrderStatusConstants.CANCELLED, // 已取消
} as const;
/** MES 到货通知单状态枚举 */ /** MES 到货通知单状态枚举 */
export const MesWmArrivalNoticeStatusEnum = { export const MesWmArrivalNoticeStatusEnum = {
PREPARE: MesOrderStatusConstants.DRAFT, PREPARE: MesOrderStatusConstants.DRAFT,

View File

@ -118,8 +118,8 @@ const [Grid, gridApi] = useVbenVxeGrid({
<Page auto-content-height> <Page auto-content-height>
<template #doc> <template #doc>
<DocAlert <DocAlert
title="【仓库】生产入库、生产退料" title="【仓库】产品产出、产品入库"
url="https://doc.iocoder.cn/mes/wm/produce-in/" url="https://doc.iocoder.cn/mes/wm/product-in/"
/> />
</template> </template>

View File

@ -91,11 +91,16 @@ async function handleSubmit() {
} }
} }
/** 执行上架:明细数量与行收货数量不一致时二次确认 */ /** 执行上架:先确认,再在明细数量与行收货数量不一致时二次确认 */
async function handleStock() { async function handleStock() {
if (!formData.value?.id) { if (!formData.value?.id) {
return; return;
} }
try {
await confirm('确认执行上架?');
} catch {
return;
}
const quantityMatch = await checkProductReceiptQuantity(formData.value.id); const quantityMatch = await checkProductReceiptQuantity(formData.value.id);
if (!quantityMatch) { if (!quantityMatch) {
try { try {

View File

@ -87,6 +87,7 @@ export function useFormSchema(
label: '出库单编号', label: '出库单编号',
component: 'Input', component: 'Input',
componentProps: { componentProps: {
disabled: isHeaderReadonly(formType),
placeholder: '请输入出库单编号', placeholder: '请输入出库单编号',
}, },
rules: 'required', rules: 'required',
@ -112,6 +113,7 @@ export function useFormSchema(
label: '出库单名称', label: '出库单名称',
component: 'Input', component: 'Input',
componentProps: { componentProps: {
disabled: isHeaderReadonly(formType),
placeholder: '请输入出库单名称', placeholder: '请输入出库单名称',
}, },
rules: 'required', rules: 'required',
@ -121,6 +123,7 @@ export function useFormSchema(
label: '发货通知单', label: '发货通知单',
component: markRaw(WmSalesNoticeSelect), component: markRaw(WmSalesNoticeSelect),
componentProps: { componentProps: {
disabled: isHeaderReadonly(formType),
// 选择发货通知单后,自动回填销售订单号、客户、收货人信息 // 选择发货通知单后,自动回填销售订单号、客户、收货人信息
onChange: async (notice?: MesWmSalesNoticeApi.SalesNotice) => { onChange: async (notice?: MesWmSalesNoticeApi.SalesNotice) => {
await formApi?.setValues({ await formApi?.setValues({
@ -139,6 +142,7 @@ export function useFormSchema(
label: '销售订单编号', label: '销售订单编号',
component: 'Input', component: 'Input',
componentProps: { componentProps: {
disabled: isHeaderReadonly(formType),
placeholder: '请输入销售订单编号', placeholder: '请输入销售订单编号',
}, },
}, },
@ -148,6 +152,7 @@ export function useFormSchema(
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
class: '!w-full', class: '!w-full',
disabled: isHeaderReadonly(formType),
format: 'YYYY-MM-DD', format: 'YYYY-MM-DD',
placeholder: '请选择出库日期', placeholder: '请选择出库日期',
valueFormat: 'x', valueFormat: 'x',
@ -159,6 +164,7 @@ export function useFormSchema(
label: '客户', label: '客户',
component: markRaw(MdClientSelect), component: markRaw(MdClientSelect),
componentProps: { componentProps: {
disabled: isHeaderReadonly(formType),
placeholder: '请选择客户', placeholder: '请选择客户',
}, },
rules: 'selectRequired', rules: 'selectRequired',
@ -168,6 +174,7 @@ export function useFormSchema(
label: '收货人', label: '收货人',
component: 'Input', component: 'Input',
componentProps: { componentProps: {
disabled: isHeaderReadonly(formType),
placeholder: '请输入收货人', placeholder: '请输入收货人',
}, },
}, },
@ -176,6 +183,7 @@ export function useFormSchema(
label: '联系方式', label: '联系方式',
component: 'Input', component: 'Input',
componentProps: { componentProps: {
disabled: isHeaderReadonly(formType),
placeholder: '请输入联系方式', placeholder: '请输入联系方式',
}, },
}, },
@ -184,6 +192,7 @@ export function useFormSchema(
label: '收货地址', label: '收货地址',
component: 'Input', component: 'Input',
componentProps: { componentProps: {
disabled: isHeaderReadonly(formType),
placeholder: '请输入收货地址', placeholder: '请输入收货地址',
}, },
}, },
@ -193,6 +202,7 @@ export function useFormSchema(
component: 'Textarea', component: 'Textarea',
formItemClass: 'col-span-3', formItemClass: 'col-span-3',
componentProps: { componentProps: {
disabled: isHeaderReadonly(formType),
placeholder: '请输入备注', placeholder: '请输入备注',
rows: 3, rows: 3,
}, },

View File

@ -203,7 +203,7 @@ const [Modal, modalApi] = useVbenModal({
const data = modalApi.getData<{ formType: FormType; id?: number }>(); const data = modalApi.getData<{ formType: FormType; id?: number }>();
formType.value = data.formType; formType.value = data.formType;
formApi.setState({ schema: useFormSchema(formType.value, formApi) }); formApi.setState({ schema: useFormSchema(formType.value, formApi) });
formApi.setDisabled(!isEditable.value && !isShipping.value); formApi.setDisabled(false);
modalApi.setState({ showConfirmButton: isEditable.value }); modalApi.setState({ showConfirmButton: isEditable.value });
if (data?.id) { if (data?.id) {
modalApi.lock(); modalApi.lock();

View File

@ -168,6 +168,7 @@ export const MesAutoCodeRuleCode = {
WM_STOCK_TAKING_CODE: 'WM_STOCK_TAKING_CODE', WM_STOCK_TAKING_CODE: 'WM_STOCK_TAKING_CODE',
WM_STOCK_TAKING_PLAN_CODE: 'WM_STOCK_TAKING_PLAN_CODE', WM_STOCK_TAKING_PLAN_CODE: 'WM_STOCK_TAKING_PLAN_CODE',
WM_WAREHOUSE_CODE: 'WM_WAREHOUSE_CODE', WM_WAREHOUSE_CODE: 'WM_WAREHOUSE_CODE',
TRANSFER_CODE: 'TRANSFER_CODE',
} as const; } as const;
/** MES 装箱单状态枚举 */ /** MES 装箱单状态枚举 */
@ -309,6 +310,22 @@ export const MesWmOutsourceReceiptStatusEnum = {
CANCELED: MesOrderStatusConstants.CANCELLED, CANCELED: MesOrderStatusConstants.CANCELLED,
} as const; } as const;
/** MES 转移单类型枚举 */
export const MesWmTransferTypeEnum = {
INNER: 1, // 内部调拨
OUTER: 2, // 外部调拨
} as const;
/** MES 转移单状态枚举 */
export const MesWmTransferStatusEnum = {
PREPARE: MesOrderStatusConstants.DRAFT, // 草稿
UNCONFIRMED: MesOrderStatusConstants.CONFIRMED, // 待确认
APPROVING: MesOrderStatusConstants.APPROVING, // 待上架
APPROVED: MesOrderStatusConstants.APPROVED, // 待执行
FINISHED: MesOrderStatusConstants.FINISHED, // 已完成
CANCELED: MesOrderStatusConstants.CANCELLED, // 已取消
} as const;
/** MES 到货通知单状态枚举 */ /** MES 到货通知单状态枚举 */
export const MesWmArrivalNoticeStatusEnum = { export const MesWmArrivalNoticeStatusEnum = {
PREPARE: MesOrderStatusConstants.DRAFT, PREPARE: MesOrderStatusConstants.DRAFT,

View File

@ -117,8 +117,8 @@ const [Grid, gridApi] = useVbenVxeGrid({
<Page auto-content-height> <Page auto-content-height>
<template #doc> <template #doc>
<DocAlert <DocAlert
title="【仓库】生产入库、生产退料" title="【仓库】产品产出、产品入库"
url="https://doc.iocoder.cn/mes/wm/produce-in/" url="https://doc.iocoder.cn/mes/wm/product-in/"
/> />
</template> </template>

View File

@ -91,11 +91,16 @@ async function handleSubmit() {
} }
} }
/** 执行上架:明细数量与行收货数量不一致时二次确认 */ /** 执行上架:先确认,再在明细数量与行收货数量不一致时二次确认 */
async function handleStock() { async function handleStock() {
if (!formData.value?.id) { if (!formData.value?.id) {
return; return;
} }
try {
await confirm('确认执行上架?');
} catch {
return;
}
const quantityMatch = await checkProductReceiptQuantity(formData.value.id); const quantityMatch = await checkProductReceiptQuantity(formData.value.id);
if (!quantityMatch) { if (!quantityMatch) {
try { try {

View File

@ -87,6 +87,7 @@ export function useFormSchema(
label: '出库单编号', label: '出库单编号',
component: 'Input', component: 'Input',
componentProps: { componentProps: {
disabled: isHeaderReadonly(formType),
placeholder: '请输入出库单编号', placeholder: '请输入出库单编号',
}, },
rules: 'required', rules: 'required',
@ -111,6 +112,7 @@ export function useFormSchema(
label: '出库单名称', label: '出库单名称',
component: 'Input', component: 'Input',
componentProps: { componentProps: {
disabled: isHeaderReadonly(formType),
placeholder: '请输入出库单名称', placeholder: '请输入出库单名称',
}, },
rules: 'required', rules: 'required',
@ -120,6 +122,7 @@ export function useFormSchema(
label: '发货通知单', label: '发货通知单',
component: markRaw(WmSalesNoticeSelect), component: markRaw(WmSalesNoticeSelect),
componentProps: { componentProps: {
disabled: isHeaderReadonly(formType),
// 选择发货通知单后,自动回填销售订单号、客户、收货人信息 // 选择发货通知单后,自动回填销售订单号、客户、收货人信息
onChange: async (notice?: MesWmSalesNoticeApi.SalesNotice) => { onChange: async (notice?: MesWmSalesNoticeApi.SalesNotice) => {
await formApi?.setValues({ await formApi?.setValues({
@ -138,6 +141,7 @@ export function useFormSchema(
label: '销售订单编号', label: '销售订单编号',
component: 'Input', component: 'Input',
componentProps: { componentProps: {
disabled: isHeaderReadonly(formType),
placeholder: '请输入销售订单编号', placeholder: '请输入销售订单编号',
}, },
}, },
@ -147,6 +151,7 @@ export function useFormSchema(
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
class: '!w-full', class: '!w-full',
disabled: isHeaderReadonly(formType),
format: 'YYYY-MM-DD', format: 'YYYY-MM-DD',
placeholder: '请选择出库日期', placeholder: '请选择出库日期',
type: 'date', type: 'date',
@ -159,6 +164,7 @@ export function useFormSchema(
label: '客户', label: '客户',
component: markRaw(MdClientSelect), component: markRaw(MdClientSelect),
componentProps: { componentProps: {
disabled: isHeaderReadonly(formType),
placeholder: '请选择客户', placeholder: '请选择客户',
}, },
rules: 'selectRequired', rules: 'selectRequired',
@ -168,6 +174,7 @@ export function useFormSchema(
label: '收货人', label: '收货人',
component: 'Input', component: 'Input',
componentProps: { componentProps: {
disabled: isHeaderReadonly(formType),
placeholder: '请输入收货人', placeholder: '请输入收货人',
}, },
}, },
@ -176,6 +183,7 @@ export function useFormSchema(
label: '联系方式', label: '联系方式',
component: 'Input', component: 'Input',
componentProps: { componentProps: {
disabled: isHeaderReadonly(formType),
placeholder: '请输入联系方式', placeholder: '请输入联系方式',
}, },
}, },
@ -184,6 +192,7 @@ export function useFormSchema(
label: '收货地址', label: '收货地址',
component: 'Input', component: 'Input',
componentProps: { componentProps: {
disabled: isHeaderReadonly(formType),
placeholder: '请输入收货地址', placeholder: '请输入收货地址',
}, },
}, },
@ -193,6 +202,7 @@ export function useFormSchema(
component: 'Textarea', component: 'Textarea',
formItemClass: 'col-span-3', formItemClass: 'col-span-3',
componentProps: { componentProps: {
disabled: isHeaderReadonly(formType),
placeholder: '请输入备注', placeholder: '请输入备注',
rows: 3, rows: 3,
}, },

View File

@ -203,7 +203,7 @@ const [Modal, modalApi] = useVbenModal({
const data = modalApi.getData<{ formType: FormType; id?: number }>(); const data = modalApi.getData<{ formType: FormType; id?: number }>();
formType.value = data.formType; formType.value = data.formType;
formApi.setState({ schema: useFormSchema(formType.value, formApi) }); formApi.setState({ schema: useFormSchema(formType.value, formApi) });
formApi.setDisabled(!isEditable.value && !isShipping.value); formApi.setDisabled(false);
modalApi.setState({ showConfirmButton: isEditable.value }); modalApi.setState({ showConfirmButton: isEditable.value });
if (data?.id) { if (data?.id) {
modalApi.lock(); modalApi.lock();

View File

@ -245,6 +245,8 @@ const MES_DICT = {
MES_WM_STOCK_TAKING_TASK_STATUS: 'mes_wm_stock_taking_task_status', // MES 盘点任务状态 MES_WM_STOCK_TAKING_TASK_STATUS: 'mes_wm_stock_taking_task_status', // MES 盘点任务状态
MES_WM_STOCK_TAKING_LINE_STATUS: 'mes_wm_stock_taking_task_line_status', // MES 盘点任务行状态 MES_WM_STOCK_TAKING_LINE_STATUS: 'mes_wm_stock_taking_task_line_status', // MES 盘点任务行状态
MES_WM_STOCK_TAKING_PLAN_PARAM_TYPE: 'mes_wm_stock_taking_plan_param_type', // MES 盘点方案参数类型 MES_WM_STOCK_TAKING_PLAN_PARAM_TYPE: 'mes_wm_stock_taking_plan_param_type', // MES 盘点方案参数类型
MES_WM_TRANSFER_STATUS: 'mes_wm_transfer_status', // MES 转移单状态
MES_WM_TRANSFER_TYPE: 'mes_wm_transfer_type', // MES 转移单类型
} as const; } as const;
/** ========== WMS - 仓储管理模块 ========== */ /** ========== WMS - 仓储管理模块 ========== */