feat(mes): 添加样品编号生成方法,优化质检表单

pull/871/MERGE
YunaiV 2026-03-27 21:54:24 +08:00
parent 4e05ad4691
commit 0befdd32ad
3 changed files with 14 additions and 5 deletions

View File

@ -10,9 +10,14 @@
>
<el-row :gutter="16">
<el-col :span="12">
<!-- TODO @AI这里需要有生成的方法参考别的 -->
<el-form-item label="样品编号" prop="code">
<el-input v-model="formData.code" placeholder="请输入样品编号" />
<el-input v-model="formData.code" placeholder="请输入样品编号">
<template #append>
<el-button @click="generateCode" :disabled="formType === 'update'">
生成
</el-button>
</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
@ -93,6 +98,7 @@
import { QcIndicatorResultApi } from '@/api/mes/qc/indicatorresult'
import { getStrDictOptions } from '@/utils/dict'
import { MesQcResultValueType } from '@/views/mes/utils/constants'
import { generateRandomStr } from '@/utils'
defineOptions({ name: 'QcIndicatorResultForm' })
@ -122,6 +128,11 @@ const formRules = reactive({
}) //
const formRef = ref() // Ref
/** 生成样品编号 */
const generateCode = () => {
formData.value.code = 'QR' + generateRandomStr(12)
}
/** 打开弹窗 */
const open = async (type: string, id?: number) => {
dialogVisible.value = true

View File

@ -39,8 +39,6 @@
import { QcIndicatorResultApi, QcIndicatorResultVO } from '@/api/mes/qc/indicatorresult'
import QcIndicatorResultForm from './QcIndicatorResultForm.vue'
// TODO DONE @AI system user index.vue =>
defineOptions({ name: 'QcIndicatorResultList' })
const props = defineProps<{

View File

@ -127,7 +127,6 @@
<el-row :gutter="16">
<el-col :span="8">
<el-form-item label="检测人员" prop="inspectorUserId">
<!-- TODO @AI需要 import -->
<UserSelect
v-model="formData.inspectorUserId"
placeholder="请选择检测人员"
@ -240,6 +239,7 @@ import MdVendorSelect from '@/views/mes/md/vendor/components/MdVendorSelect.vue'
import MdItemSelect from '@/views/mes/md/item/components/MdItemSelect.vue'
import IqcLineList from './IqcLineList.vue'
import QcIndicatorResultList from '@/views/mes/qc/indicatorresult/components/QcIndicatorResultList.vue'
import UserSelect from '@/views/system/user/components/UserSelect.vue'
import { MesQcTypeEnum, MesAutoCodeRuleCode } from '@/views/mes/utils/constants'
defineOptions({ name: 'IqcForm' })