feat(mes): 添加 MES 转移单类型及状态枚举,更新相关表单字段禁用逻辑
parent
83482781d6
commit
37b9db148f
|
|
@ -168,6 +168,7 @@ export const MesAutoCodeRuleCode = {
|
|||
WM_STOCK_TAKING_CODE: 'WM_STOCK_TAKING_CODE',
|
||||
WM_STOCK_TAKING_PLAN_CODE: 'WM_STOCK_TAKING_PLAN_CODE',
|
||||
WM_WAREHOUSE_CODE: 'WM_WAREHOUSE_CODE',
|
||||
TRANSFER_CODE: 'TRANSFER_CODE',
|
||||
} as const;
|
||||
|
||||
/** MES 装箱单状态枚举 */
|
||||
|
|
@ -309,6 +310,22 @@ export const MesWmOutsourceReceiptStatusEnum = {
|
|||
CANCELED: MesOrderStatusConstants.CANCELLED,
|
||||
} 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 到货通知单状态枚举 */
|
||||
export const MesWmArrivalNoticeStatusEnum = {
|
||||
PREPARE: MesOrderStatusConstants.DRAFT,
|
||||
|
|
|
|||
|
|
@ -118,8 +118,8 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
|||
<Page auto-content-height>
|
||||
<template #doc>
|
||||
<DocAlert
|
||||
title="【仓库】生产入库、生产退料"
|
||||
url="https://doc.iocoder.cn/mes/wm/produce-in/"
|
||||
title="【仓库】产品产出、产品入库"
|
||||
url="https://doc.iocoder.cn/mes/wm/product-in/"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
|
|
|||
|
|
@ -91,11 +91,16 @@ async function handleSubmit() {
|
|||
}
|
||||
}
|
||||
|
||||
/** 执行上架:明细数量与行收货数量不一致时二次确认 */
|
||||
/** 执行上架:先确认,再在明细数量与行收货数量不一致时二次确认 */
|
||||
async function handleStock() {
|
||||
if (!formData.value?.id) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await confirm('确认执行上架?');
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
const quantityMatch = await checkProductReceiptQuantity(formData.value.id);
|
||||
if (!quantityMatch) {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -87,6 +87,7 @@ export function useFormSchema(
|
|||
label: '出库单编号',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
disabled: isHeaderReadonly(formType),
|
||||
placeholder: '请输入出库单编号',
|
||||
},
|
||||
rules: 'required',
|
||||
|
|
@ -112,6 +113,7 @@ export function useFormSchema(
|
|||
label: '出库单名称',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
disabled: isHeaderReadonly(formType),
|
||||
placeholder: '请输入出库单名称',
|
||||
},
|
||||
rules: 'required',
|
||||
|
|
@ -121,6 +123,7 @@ export function useFormSchema(
|
|||
label: '发货通知单',
|
||||
component: markRaw(WmSalesNoticeSelect),
|
||||
componentProps: {
|
||||
disabled: isHeaderReadonly(formType),
|
||||
// 选择发货通知单后,自动回填销售订单号、客户、收货人信息
|
||||
onChange: async (notice?: MesWmSalesNoticeApi.SalesNotice) => {
|
||||
await formApi?.setValues({
|
||||
|
|
@ -139,6 +142,7 @@ export function useFormSchema(
|
|||
label: '销售订单编号',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
disabled: isHeaderReadonly(formType),
|
||||
placeholder: '请输入销售订单编号',
|
||||
},
|
||||
},
|
||||
|
|
@ -148,6 +152,7 @@ export function useFormSchema(
|
|||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
class: '!w-full',
|
||||
disabled: isHeaderReadonly(formType),
|
||||
format: 'YYYY-MM-DD',
|
||||
placeholder: '请选择出库日期',
|
||||
valueFormat: 'x',
|
||||
|
|
@ -159,6 +164,7 @@ export function useFormSchema(
|
|||
label: '客户',
|
||||
component: markRaw(MdClientSelect),
|
||||
componentProps: {
|
||||
disabled: isHeaderReadonly(formType),
|
||||
placeholder: '请选择客户',
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
|
|
@ -168,6 +174,7 @@ export function useFormSchema(
|
|||
label: '收货人',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
disabled: isHeaderReadonly(formType),
|
||||
placeholder: '请输入收货人',
|
||||
},
|
||||
},
|
||||
|
|
@ -176,6 +183,7 @@ export function useFormSchema(
|
|||
label: '联系方式',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
disabled: isHeaderReadonly(formType),
|
||||
placeholder: '请输入联系方式',
|
||||
},
|
||||
},
|
||||
|
|
@ -184,6 +192,7 @@ export function useFormSchema(
|
|||
label: '收货地址',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
disabled: isHeaderReadonly(formType),
|
||||
placeholder: '请输入收货地址',
|
||||
},
|
||||
},
|
||||
|
|
@ -193,6 +202,7 @@ export function useFormSchema(
|
|||
component: 'Textarea',
|
||||
formItemClass: 'col-span-3',
|
||||
componentProps: {
|
||||
disabled: isHeaderReadonly(formType),
|
||||
placeholder: '请输入备注',
|
||||
rows: 3,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@ const [Modal, modalApi] = useVbenModal({
|
|||
const data = modalApi.getData<{ formType: FormType; id?: number }>();
|
||||
formType.value = data.formType;
|
||||
formApi.setState({ schema: useFormSchema(formType.value, formApi) });
|
||||
formApi.setDisabled(!isEditable.value && !isShipping.value);
|
||||
formApi.setDisabled(false);
|
||||
modalApi.setState({ showConfirmButton: isEditable.value });
|
||||
if (data?.id) {
|
||||
modalApi.lock();
|
||||
|
|
|
|||
|
|
@ -168,6 +168,7 @@ export const MesAutoCodeRuleCode = {
|
|||
WM_STOCK_TAKING_CODE: 'WM_STOCK_TAKING_CODE',
|
||||
WM_STOCK_TAKING_PLAN_CODE: 'WM_STOCK_TAKING_PLAN_CODE',
|
||||
WM_WAREHOUSE_CODE: 'WM_WAREHOUSE_CODE',
|
||||
TRANSFER_CODE: 'TRANSFER_CODE',
|
||||
} as const;
|
||||
|
||||
/** MES 装箱单状态枚举 */
|
||||
|
|
@ -309,6 +310,22 @@ export const MesWmOutsourceReceiptStatusEnum = {
|
|||
CANCELED: MesOrderStatusConstants.CANCELLED,
|
||||
} 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 到货通知单状态枚举 */
|
||||
export const MesWmArrivalNoticeStatusEnum = {
|
||||
PREPARE: MesOrderStatusConstants.DRAFT,
|
||||
|
|
|
|||
|
|
@ -117,8 +117,8 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
|||
<Page auto-content-height>
|
||||
<template #doc>
|
||||
<DocAlert
|
||||
title="【仓库】生产入库、生产退料"
|
||||
url="https://doc.iocoder.cn/mes/wm/produce-in/"
|
||||
title="【仓库】产品产出、产品入库"
|
||||
url="https://doc.iocoder.cn/mes/wm/product-in/"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
|
|
|||
|
|
@ -91,11 +91,16 @@ async function handleSubmit() {
|
|||
}
|
||||
}
|
||||
|
||||
/** 执行上架:明细数量与行收货数量不一致时二次确认 */
|
||||
/** 执行上架:先确认,再在明细数量与行收货数量不一致时二次确认 */
|
||||
async function handleStock() {
|
||||
if (!formData.value?.id) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await confirm('确认执行上架?');
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
const quantityMatch = await checkProductReceiptQuantity(formData.value.id);
|
||||
if (!quantityMatch) {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -87,6 +87,7 @@ export function useFormSchema(
|
|||
label: '出库单编号',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
disabled: isHeaderReadonly(formType),
|
||||
placeholder: '请输入出库单编号',
|
||||
},
|
||||
rules: 'required',
|
||||
|
|
@ -111,6 +112,7 @@ export function useFormSchema(
|
|||
label: '出库单名称',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
disabled: isHeaderReadonly(formType),
|
||||
placeholder: '请输入出库单名称',
|
||||
},
|
||||
rules: 'required',
|
||||
|
|
@ -120,6 +122,7 @@ export function useFormSchema(
|
|||
label: '发货通知单',
|
||||
component: markRaw(WmSalesNoticeSelect),
|
||||
componentProps: {
|
||||
disabled: isHeaderReadonly(formType),
|
||||
// 选择发货通知单后,自动回填销售订单号、客户、收货人信息
|
||||
onChange: async (notice?: MesWmSalesNoticeApi.SalesNotice) => {
|
||||
await formApi?.setValues({
|
||||
|
|
@ -138,6 +141,7 @@ export function useFormSchema(
|
|||
label: '销售订单编号',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
disabled: isHeaderReadonly(formType),
|
||||
placeholder: '请输入销售订单编号',
|
||||
},
|
||||
},
|
||||
|
|
@ -147,6 +151,7 @@ export function useFormSchema(
|
|||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
class: '!w-full',
|
||||
disabled: isHeaderReadonly(formType),
|
||||
format: 'YYYY-MM-DD',
|
||||
placeholder: '请选择出库日期',
|
||||
type: 'date',
|
||||
|
|
@ -159,6 +164,7 @@ export function useFormSchema(
|
|||
label: '客户',
|
||||
component: markRaw(MdClientSelect),
|
||||
componentProps: {
|
||||
disabled: isHeaderReadonly(formType),
|
||||
placeholder: '请选择客户',
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
|
|
@ -168,6 +174,7 @@ export function useFormSchema(
|
|||
label: '收货人',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
disabled: isHeaderReadonly(formType),
|
||||
placeholder: '请输入收货人',
|
||||
},
|
||||
},
|
||||
|
|
@ -176,6 +183,7 @@ export function useFormSchema(
|
|||
label: '联系方式',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
disabled: isHeaderReadonly(formType),
|
||||
placeholder: '请输入联系方式',
|
||||
},
|
||||
},
|
||||
|
|
@ -184,6 +192,7 @@ export function useFormSchema(
|
|||
label: '收货地址',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
disabled: isHeaderReadonly(formType),
|
||||
placeholder: '请输入收货地址',
|
||||
},
|
||||
},
|
||||
|
|
@ -193,6 +202,7 @@ export function useFormSchema(
|
|||
component: 'Textarea',
|
||||
formItemClass: 'col-span-3',
|
||||
componentProps: {
|
||||
disabled: isHeaderReadonly(formType),
|
||||
placeholder: '请输入备注',
|
||||
rows: 3,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@ const [Modal, modalApi] = useVbenModal({
|
|||
const data = modalApi.getData<{ formType: FormType; id?: number }>();
|
||||
formType.value = data.formType;
|
||||
formApi.setState({ schema: useFormSchema(formType.value, formApi) });
|
||||
formApi.setDisabled(!isEditable.value && !isShipping.value);
|
||||
formApi.setDisabled(false);
|
||||
modalApi.setState({ showConfirmButton: isEditable.value });
|
||||
if (data?.id) {
|
||||
modalApi.lock();
|
||||
|
|
|
|||
|
|
@ -245,6 +245,8 @@ const MES_DICT = {
|
|||
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_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;
|
||||
|
||||
/** ========== WMS - 仓储管理模块 ========== */
|
||||
|
|
|
|||
Loading…
Reference in New Issue