✨ feat(mes): 添加样品编号生成方法,优化质检表单
parent
4e05ad4691
commit
0befdd32ad
|
|
@ -10,9 +10,14 @@
|
||||||
>
|
>
|
||||||
<el-row :gutter="16">
|
<el-row :gutter="16">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<!-- TODO @AI:这里需要有生成的方法,参考别的 -->
|
|
||||||
<el-form-item label="样品编号" prop="code">
|
<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-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
|
|
@ -93,6 +98,7 @@
|
||||||
import { QcIndicatorResultApi } from '@/api/mes/qc/indicatorresult'
|
import { QcIndicatorResultApi } from '@/api/mes/qc/indicatorresult'
|
||||||
import { getStrDictOptions } from '@/utils/dict'
|
import { getStrDictOptions } from '@/utils/dict'
|
||||||
import { MesQcResultValueType } from '@/views/mes/utils/constants'
|
import { MesQcResultValueType } from '@/views/mes/utils/constants'
|
||||||
|
import { generateRandomStr } from '@/utils'
|
||||||
|
|
||||||
defineOptions({ name: 'QcIndicatorResultForm' })
|
defineOptions({ name: 'QcIndicatorResultForm' })
|
||||||
|
|
||||||
|
|
@ -122,6 +128,11 @@ const formRules = reactive({
|
||||||
}) // 表单校验规则
|
}) // 表单校验规则
|
||||||
const formRef = ref() // 表单 Ref
|
const formRef = ref() // 表单 Ref
|
||||||
|
|
||||||
|
/** 生成样品编号 */
|
||||||
|
const generateCode = () => {
|
||||||
|
formData.value.code = 'QR' + generateRandomStr(12)
|
||||||
|
}
|
||||||
|
|
||||||
/** 打开弹窗 */
|
/** 打开弹窗 */
|
||||||
const open = async (type: string, id?: number) => {
|
const open = async (type: string, id?: number) => {
|
||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
|
|
|
||||||
|
|
@ -39,8 +39,6 @@
|
||||||
import { QcIndicatorResultApi, QcIndicatorResultVO } from '@/api/mes/qc/indicatorresult'
|
import { QcIndicatorResultApi, QcIndicatorResultVO } from '@/api/mes/qc/indicatorresult'
|
||||||
import QcIndicatorResultForm from './QcIndicatorResultForm.vue'
|
import QcIndicatorResultForm from './QcIndicatorResultForm.vue'
|
||||||
|
|
||||||
// TODO DONE @AI:补全注释,参考 system user index.vue => 已补全
|
|
||||||
|
|
||||||
defineOptions({ name: 'QcIndicatorResultList' })
|
defineOptions({ name: 'QcIndicatorResultList' })
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,6 @@
|
||||||
<el-row :gutter="16">
|
<el-row :gutter="16">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="检测人员" prop="inspectorUserId">
|
<el-form-item label="检测人员" prop="inspectorUserId">
|
||||||
<!-- TODO @AI:需要 import 下 -->
|
|
||||||
<UserSelect
|
<UserSelect
|
||||||
v-model="formData.inspectorUserId"
|
v-model="formData.inspectorUserId"
|
||||||
placeholder="请选择检测人员"
|
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 MdItemSelect from '@/views/mes/md/item/components/MdItemSelect.vue'
|
||||||
import IqcLineList from './IqcLineList.vue'
|
import IqcLineList from './IqcLineList.vue'
|
||||||
import QcIndicatorResultList from '@/views/mes/qc/indicatorresult/components/QcIndicatorResultList.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'
|
import { MesQcTypeEnum, MesAutoCodeRuleCode } from '@/views/mes/utils/constants'
|
||||||
|
|
||||||
defineOptions({ name: 'IqcForm' })
|
defineOptions({ name: 'IqcForm' })
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue