完善检查项目模块

This commit is contained in:
lxd 2024-07-24 19:18:34 +08:00
parent c35c310221
commit 45e66025dc

View File

@ -46,13 +46,26 @@
<el-input v-model="formData.orgId" placeholder="请输入机构编号" /> <el-input v-model="formData.orgId" placeholder="请输入机构编号" />
</el-form-item> </el-form-item>
<el-form-item label="第三方系统的检查项目的CODE" prop="thirdPartyExamItemCode" v-if="false"> <el-form-item label="第三方系统的检查项目的CODE" prop="thirdPartyExamItemCode" v-if="false">
<el-input v-model="formData.thirdPartyExamItemCode" placeholder="请输入第三方系统的检查项目的CODE" /> <el-input
v-model="formData.thirdPartyExamItemCode"
placeholder="请输入第三方系统的检查项目的CODE"
/>
</el-form-item> </el-form-item>
<el-form-item label="第三方系统的检查项目名称" prop="thirdPartyExamItemName" v-if="false"> <el-form-item label="第三方系统的检查项目名称" prop="thirdPartyExamItemName" v-if="false">
<el-input v-model="formData.thirdPartyExamItemName" placeholder="请输入第三方系统的检查项目名称" /> <el-input
v-model="formData.thirdPartyExamItemName"
placeholder="请输入第三方系统的检查项目名称"
/>
</el-form-item> </el-form-item>
<el-form-item label="第三方系统的检查项目的收费价格" prop="thirdPartyExamItemPrice" v-if="false"> <el-form-item
<el-input v-model="formData.thirdPartyExamItemPrice" placeholder="请输入第三方系统的检查项目的收费价格" /> label="第三方系统的检查项目的收费价格"
prop="thirdPartyExamItemPrice"
v-if="false"
>
<el-input
v-model="formData.thirdPartyExamItemPrice"
placeholder="请输入第三方系统的检查项目的收费价格"
/>
</el-form-item> </el-form-item>
</el-form> </el-form>
<template #footer> <template #footer>
@ -87,21 +100,13 @@ const formData = ref({
examPartCode: undefined, examPartCode: undefined,
thirdPartyExamItemCode: undefined, thirdPartyExamItemCode: undefined,
thirdPartyExamItemName: undefined, thirdPartyExamItemName: undefined,
thirdPartyExamItemPrice: undefined, thirdPartyExamItemPrice: undefined
}) })
const formRules = reactive({ const formRules = reactive({
examItemCode: [ examItemCode: [{ required: true, message: '请输入检查项目编号', trigger: 'blur' }],
{ required: true, message: '请输入检查项目编号', trigger: 'blur' } examItemName: [{ required: true, message: '请输入检查项目名称', trigger: 'blur' }],
], examPartCode: [{ required: true, message: '请选择检查部位编号', trigger: 'blur' }],
examItemName: [ orgId: [{ required: true, message: '请选择机构编号', trigger: 'blur' }]
{ required: true, message: '请输入检查项目名称', trigger: 'blur' }
],
examPartCode: [
{ required: true, message: '请选择检查部位编号', trigger: 'blur' }
],
orgId: [
{ required: true, message: '请选择机构编号', trigger: 'blur' }
]
}) })
const formRef = ref() // Ref const formRef = ref() // Ref
@ -132,14 +137,22 @@ const submitForm = async () => {
formLoading.value = true formLoading.value = true
try { try {
const data = formData.value as unknown as examitemsVO const data = formData.value as unknown as examitemsVO
const re = ref()
if (formType.value === 'create') { if (formType.value === 'create') {
await examitemsApi.createexamitems(data) re.value = await examitemsApi.createexamitems(data)
if (re.value ==='项目ID已经存在') {
message.error(re.value)
return
} else {
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
}
} else { } else {
await examitemsApi.updateexamitems(data) await examitemsApi.updateexamitems(data)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
dialogVisible.value = false dialogVisible.value = false
// //
emit('success') emit('success')
} finally { } finally {
@ -162,7 +175,7 @@ const resetForm = () => {
examPartCode: undefined, examPartCode: undefined,
thirdPartyExamItemCode: undefined, thirdPartyExamItemCode: undefined,
thirdPartyExamItemName: undefined, thirdPartyExamItemName: undefined,
thirdPartyExamItemPrice: undefined, thirdPartyExamItemPrice: undefined
} }
formRef.value?.resetFields() formRef.value?.resetFields()
} }