diff --git a/src/views/mes/md/workstation/workshop/WorkshopForm.vue b/src/views/mes/md/workstation/workshop/WorkshopForm.vue index eace899ea..8d2a6d3f8 100644 --- a/src/views/mes/md/workstation/workshop/WorkshopForm.vue +++ b/src/views/mes/md/workstation/workshop/WorkshopForm.vue @@ -11,7 +11,11 @@ - + + + @@ -85,6 +89,8 @@ import { getIntDictOptions, DICT_TYPE } from '@/utils/dict' import { MdWorkshopApi, MdWorkshopVO } from '@/api/mes/md/workstation/workshop' import { CommonStatusEnum } from '@/utils/constants' +import { MesAutoCodeRuleCode } from '@/views/mes/utils/constants' +import { AutoCodeRecordApi } from '@/api/mes/md/autocode/record' import * as UserApi from '@/api/system/user' defineOptions({ name: 'WorkshopForm' }) @@ -121,6 +127,13 @@ const formRules = reactive({ }) const formRef = ref() // 表单 Ref +/** 生成车间编码 */ +const generateCode = async () => { + formData.value.code = await AutoCodeRecordApi.generateAutoCode( + MesAutoCodeRuleCode.MD_WORKSHOP_CODE + ) +} + /** 打开弹窗 */ const open = async (type: string, id?: number) => { dialogVisible.value = true diff --git a/src/views/mes/utils/constants.ts b/src/views/mes/utils/constants.ts index d804dfce6..6e0fdf8d9 100644 --- a/src/views/mes/utils/constants.ts +++ b/src/views/mes/utils/constants.ts @@ -446,6 +446,7 @@ export const MesAutoCodeRuleCode = { MD_VENDOR_CODE: 'MD_VENDOR_CODE', // 供应商编码 MD_CLIENT_CODE: 'MD_CLIENT_CODE', // 客户编码 MD_WORKSTATION_CODE: 'MD_WORKSTATION_CODE', // 工作站编码 + MD_WORKSHOP_CODE: 'MD_WORKSHOP_CODE', // 车间编码 TM_TOOL_CODE: 'TM_TOOL_CODE', // 工具编码 TM_TOOL_TYPE_CODE: 'TM_TOOL_TYPE_CODE', // 工具类型编码 WM_ARRIVAL_NOTICE_CODE: 'WM_ARRIVAL_NOTICE_CODE', // 到货通知单编码