From 8299116e84cd704e28dac09d284d3fc33adca511 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期日, 25 十月 2026 12:42:29 +0800
Subject: [PATCH] feat(constants): 添加MES业务枚举常量并更新自动生成码规则
---
src/views/mes/qc/ncr/data.ts | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/views/mes/qc/ncr/data.ts b/src/views/mes/qc/ncr/data.ts
index f6bdbfb..876b0dd 100644
--- a/src/views/mes/qc/ncr/data.ts
+++ b/src/views/mes/qc/ncr/data.ts
@@ -4,11 +4,12 @@
import { h, markRaw } from 'vue';
-import { DICT_TYPE } from '@vben/constants';
+import { DICT_TYPE, MesAutoCodeRuleCode } from '@vben/constants';
import { getDictOptions } from '@vben/hooks';
import { Button } from 'ant-design-vue';
+import { generateAutoCode } from '#/api/mes/md/autocode/record';
import { getSimpleUserList } from '#/api/system/user';
import { DeptTreeSelect } from '#/views/system/dept/components';
import { MdItemSelect } from '#/views/mes/md/item/components';
@@ -79,9 +80,9 @@
{
type: 'default',
onClick: async () => {
- const now = new Date();
- const pad = (n: number) => String(n).padStart(2, '0');
- const code = `NCR${now.getFullYear()}${pad(now.getMonth() + 1)}${pad(now.getDate())}${pad(now.getHours())}${pad(now.getMinutes())}${pad(now.getSeconds())}`;
+ const code = await generateAutoCode(
+ MesAutoCodeRuleCode.QC_NCR_CODE,
+ );
await formApi?.setFieldValue('code', code);
},
},
--
Gitblit v1.9.3