添加医生签名
This commit is contained in:
parent
5673decbee
commit
892fb745d8
48
src/api/inspect/inspectdoctor/index.ts
Normal file
48
src/api/inspect/inspectdoctor/index.ts
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
// 保存医生签名信息 VO
|
||||||
|
export interface DoctorVO {
|
||||||
|
id: number // 主键
|
||||||
|
doctorid: string // 医生编号
|
||||||
|
doctorname: string // 医生姓名
|
||||||
|
doctorsign: string // 医生签名图片
|
||||||
|
orgid: string // 机构ID
|
||||||
|
orgname: string // 机构名称
|
||||||
|
}
|
||||||
|
|
||||||
|
// 保存医生签名信息 API
|
||||||
|
export const DoctorApi = {
|
||||||
|
// 查询保存医生签名信息分页
|
||||||
|
getDoctorPage: async (params: any) => {
|
||||||
|
return await request.get({ url: `/Inspect/doctor/page`, params })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 查询保存医生签名信息详情
|
||||||
|
getDoctor: async (id: number) => {
|
||||||
|
return await request.get({ url: `/Inspect/doctor/get?id=` + id })
|
||||||
|
},
|
||||||
|
//根据医生id查询医生信息
|
||||||
|
getDoctorById: async (doctorid: string) => {
|
||||||
|
return await request.get({ url: `/Inspect/doctor/getdoctor?doctorid=` + doctorid })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 新增保存医生签名信息
|
||||||
|
createDoctor: async (data: DoctorVO) => {
|
||||||
|
return await request.post({ url: `/Inspect/doctor/create`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 修改保存医生签名信息
|
||||||
|
updateDoctor: async (data: DoctorVO) => {
|
||||||
|
return await request.put({ url: `/Inspect/doctor/update`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 删除保存医生签名信息
|
||||||
|
deleteDoctor: async (id: number) => {
|
||||||
|
return await request.delete({ url: `/Inspect/doctor/delete?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 导出保存医生签名信息 Excel
|
||||||
|
exportDoctor: async (params) => {
|
||||||
|
return await request.download({ url: `/Inspect/doctor/export-excel`, params })
|
||||||
|
},
|
||||||
|
}
|
@ -30,6 +30,7 @@ export interface PatientVO {
|
|||||||
ncgcode: string // 尿常规编号
|
ncgcode: string // 尿常规编号
|
||||||
shqx: string // 生化编号
|
shqx: string // 生化编号
|
||||||
isprint: number // 是否打印
|
isprint: number // 是否打印
|
||||||
|
chiefinspectorid: string // 总检医生ID
|
||||||
}
|
}
|
||||||
|
|
||||||
// 患者信息 API
|
// 患者信息 API
|
||||||
@ -109,6 +110,10 @@ export const PatientApi = {
|
|||||||
updatemedicalSn: async (data: PatientVO) => {
|
updatemedicalSn: async (data: PatientVO) => {
|
||||||
return await request.put({ url: `/inspect/patient/updatesummary`, data })
|
return await request.put({ url: `/inspect/patient/updatesummary`, data })
|
||||||
},
|
},
|
||||||
|
// 保存总检医生
|
||||||
|
updatedoctorid: async (data: PatientVO) => {
|
||||||
|
return await request.put({ url: `/inspect/patient/updatedoctorid`, data })
|
||||||
|
},
|
||||||
//获取中医体质辨识结果
|
//获取中医体质辨识结果
|
||||||
getZytzInfo: async (medicalSn: string, cardId: string) => {
|
getZytzInfo: async (medicalSn: string, cardId: string) => {
|
||||||
return await request.put({ url: `/inspect/patient/syncPatientZyInfo?medicalSn=` + medicalSn + `&cardId=` + cardId })
|
return await request.put({ url: `/inspect/patient/syncPatientZyInfo?medicalSn=` + medicalSn + `&cardId=` + cardId })
|
||||||
|
@ -369,9 +369,10 @@
|
|||||||
placeholder="请选择检查医生"
|
placeholder="请选择检查医生"
|
||||||
:disabled="isDisabled"
|
:disabled="isDisabled"
|
||||||
class="doctor-select"
|
class="doctor-select"
|
||||||
|
clearable
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in getStrDictOptions('doctor_unit')"
|
v-for="item in doctorList"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
:value="`${item.label}|${item.value}`"
|
:value="`${item.label}|${item.value}`"
|
||||||
@ -421,6 +422,7 @@ import { getStrDictOptions } from '@/utils/dict' //导入字典
|
|||||||
import Summary from './summary.vue' // 导入Summary组件用于汇总页面
|
import Summary from './summary.vue' // 导入Summary组件用于汇总页面
|
||||||
import TemplateDrawer from './Drawer-Template.vue'
|
import TemplateDrawer from './Drawer-Template.vue'
|
||||||
import { updateItemsAnalyse } from '@/api/summary'
|
import { updateItemsAnalyse } from '@/api/summary'
|
||||||
|
import { DoctorApi } from '@/api/inspect/inspectdoctor' // 添加导入语句
|
||||||
|
|
||||||
const dialogTitle = ref('体检报告')
|
const dialogTitle = ref('体检报告')
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
@ -1002,6 +1004,9 @@ onMounted(async () => {
|
|||||||
pageSize.value = 20 // 或其他合适的数值
|
pageSize.value = 20 // 或其他合适的数值
|
||||||
pageNo.value = 1
|
pageNo.value = 1
|
||||||
|
|
||||||
|
// 获取医生列表
|
||||||
|
await getDoctorList()
|
||||||
|
|
||||||
// 直接调用获取列表方法,不附加任何过滤条件
|
// 直接调用获取列表方法,不附加任何过滤条件
|
||||||
await getPatientList()
|
await getPatientList()
|
||||||
})
|
})
|
||||||
@ -1713,6 +1718,12 @@ const handleSaveAllResults = async () => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 验证总检医生是否已选择
|
||||||
|
if (!summaryRef.value?.validateSummaryDoctor()) {
|
||||||
|
ElMessage.warning('请选择总检医生')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const userProfile = await getUserProfile()
|
const userProfile = await getUserProfile()
|
||||||
user.value = userProfile
|
user.value = userProfile
|
||||||
@ -2351,6 +2362,28 @@ const handleAbandonExam = async () => {
|
|||||||
ElMessage.info('已取消弃检')
|
ElMessage.info('已取消弃检')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 添加医生列表的响应式引用
|
||||||
|
const doctorList = ref([])
|
||||||
|
|
||||||
|
// 修改获取医生列表的方法
|
||||||
|
const getDoctorList = async () => {
|
||||||
|
try {
|
||||||
|
const res = await DoctorApi.getDoctorPage({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 100 // 设置较大的数值以获取所有医生
|
||||||
|
})
|
||||||
|
if (res && res.list && res.list.length > 0) {
|
||||||
|
doctorList.value = res.list.map(doctor => ({
|
||||||
|
label: doctor.doctorname,
|
||||||
|
value: doctor.doctorid
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取医生列表失败:', error)
|
||||||
|
ElMessage.error('获取医生列表失败')
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
@ -4,6 +4,22 @@
|
|||||||
<div class="title-with-button">
|
<div class="title-with-button">
|
||||||
<h3>体检汇总</h3>
|
<h3>体检汇总</h3>
|
||||||
<el-button type="text" @click="openTemplateDrawer" style="margin-left: 15px;">诊断模板</el-button>
|
<el-button type="text" @click="openTemplateDrawer" style="margin-left: 15px;">诊断模板</el-button>
|
||||||
|
<span style="margin-left: 15px;">总检医生:</span>
|
||||||
|
<el-select
|
||||||
|
v-model="selectedDoctor"
|
||||||
|
placeholder="请选择总检医生"
|
||||||
|
style="margin-left: 15px; width: 200px;"
|
||||||
|
clearable
|
||||||
|
:disabled="isReadOnly"
|
||||||
|
value-key="doctorid"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="doctor in doctorList"
|
||||||
|
:key="doctor.doctorid"
|
||||||
|
:label="doctor.doctorname"
|
||||||
|
:value="doctor.doctorid+'|'+doctor.doctorname"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -34,6 +50,7 @@ import { PatientApi } from '@/api/inspect/inspectpatient'
|
|||||||
import { ElLoading, ElMessage } from 'element-plus'
|
import { ElLoading, ElMessage } from 'element-plus'
|
||||||
import { Refresh } from '@element-plus/icons-vue'
|
import { Refresh } from '@element-plus/icons-vue'
|
||||||
import TemplateDrawer from '@/views/Department-entry/Drawer-Template.vue'
|
import TemplateDrawer from '@/views/Department-entry/Drawer-Template.vue'
|
||||||
|
import { DoctorApi } from '@/api/inspect/inspectdoctor'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
patient: {
|
patient: {
|
||||||
@ -51,7 +68,7 @@ const props = defineProps({
|
|||||||
})
|
})
|
||||||
|
|
||||||
// 添加emit以便与父组件通信
|
// 添加emit以便与父组件通信
|
||||||
const emit = defineEmits(['save-summary'])
|
const emit = defineEmits(['save-summary', 'update:patient'])
|
||||||
|
|
||||||
// 汇总数据
|
// 汇总数据
|
||||||
const summaryData = ref({
|
const summaryData = ref({
|
||||||
@ -302,6 +319,10 @@ const saveSummary = async () => {
|
|||||||
ElMessage.warning('患者信息不完整,无法保存汇总数据')
|
ElMessage.warning('患者信息不完整,无法保存汇总数据')
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
if (!selectedDoctor.value) {
|
||||||
|
ElMessage.warning('请选择总检医生')
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
saving.value = true
|
saving.value = true
|
||||||
@ -309,18 +330,28 @@ const saveSummary = async () => {
|
|||||||
// 准备保存的数据
|
// 准备保存的数据
|
||||||
const saveData = {
|
const saveData = {
|
||||||
medicalSn: props.patient.medicalSn,
|
medicalSn: props.patient.medicalSn,
|
||||||
summaryResult: editableSummary.value
|
summaryResult: editableSummary.value,
|
||||||
|
}
|
||||||
|
//更新总检医生id
|
||||||
|
const saveData2 = {
|
||||||
|
medicalSn: props.patient.medicalSn,
|
||||||
|
chiefinspectorid: selectedDoctor.value.split('|')[0],
|
||||||
|
chiefinspector: selectedDoctor.value.split('|')[1]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 调用API保存数据
|
// 调用API保存数据
|
||||||
const response = await PatientApi.updatemedicalSn(saveData)
|
const response = await PatientApi.updatemedicalSn(saveData)
|
||||||
|
const response2 = await PatientApi.updatedoctorid(saveData2)
|
||||||
|
|
||||||
if (response && response.code === 200) {
|
if (response && response.code === 200) {
|
||||||
ElMessage.success('体检汇总保存成功')
|
ElMessage.success('体检汇总保存成功')
|
||||||
|
|
||||||
// 保存成功后重新查询数据
|
// 保存成功后重新查询患者数据
|
||||||
await queryPatientData()
|
const patientData = await PatientApi.getPatient(props.patient.id)
|
||||||
|
if (patientData && patientData.code === 200 && patientData.data) {
|
||||||
|
// 通过emit通知父组件更新患者信息
|
||||||
|
emit('update:patient', patientData.data)
|
||||||
|
}
|
||||||
|
|
||||||
// 检查患者状态
|
// 检查患者状态
|
||||||
checkPatientStatus()
|
checkPatientStatus()
|
||||||
@ -346,36 +377,79 @@ const queryPatientData = async () => {
|
|||||||
try {
|
try {
|
||||||
const response = await PatientApi.getByMedicalSn(props.patient.medicalSn)
|
const response = await PatientApi.getByMedicalSn(props.patient.medicalSn)
|
||||||
if (response && response.code === 200 && response.data) {
|
if (response && response.code === 200 && response.data) {
|
||||||
// 更新患者信息
|
|
||||||
if (response.data.summaryResult) {
|
if (response.data.summaryResult) {
|
||||||
editableSummary.value = response.data.summaryResult
|
editableSummary.value = response.data.summaryResult
|
||||||
}
|
}
|
||||||
|
|
||||||
// 如果患者状态已更新,检查是否需要设置只读
|
|
||||||
if (response.data.status) {
|
if (response.data.status) {
|
||||||
isReadOnly.value = response.data.status === 2
|
isReadOnly.value = response.data.status === 2
|
||||||
}
|
}
|
||||||
|
console.log(response.data.chiefinspector)
|
||||||
|
// 添加对医生ID的处理
|
||||||
|
if (response.data.chiefinspector) {
|
||||||
|
selectedDoctor.value = response.data.chiefinspector
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('查询患者数据失败:', error)
|
console.error('查询患者数据失败:', error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 组件挂载时加载数据
|
// 医生列表数据
|
||||||
onMounted(() => {
|
const doctorList = ref([])
|
||||||
|
const selectedDoctor = ref(null)
|
||||||
|
|
||||||
|
// 根据医生ID查询医生信息
|
||||||
|
const getDoctorInfo = async (doctorId) => {
|
||||||
|
try {
|
||||||
|
const response = await DoctorApi.getDoctorById(doctorId)
|
||||||
|
if (response) {
|
||||||
|
selectedDoctor.value = response
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('查询医生信息失败:', error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 加载医生列表
|
||||||
|
const loadDoctorList = async () => {
|
||||||
|
try {
|
||||||
|
const queryParams = {
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 100,
|
||||||
|
}
|
||||||
|
const response = await DoctorApi.getDoctorPage(queryParams)
|
||||||
|
if (response && response.list && response.list.length > 0) {
|
||||||
|
doctorList.value = response.list
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('加载医生列表失败:', error)
|
||||||
|
ElMessage.error('加载医生列表失败')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 初始化数据
|
||||||
|
const initData = () => {
|
||||||
loadPatientItems()
|
loadPatientItems()
|
||||||
checkPatientStatus()
|
checkPatientStatus()
|
||||||
|
loadDoctorList()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 组件挂载时加载数据
|
||||||
|
onMounted(() => {
|
||||||
|
initData()
|
||||||
})
|
})
|
||||||
|
|
||||||
// 监听患者信息变化
|
// 监听患者信息变化
|
||||||
watch(() => props.patient, (newVal) => {
|
watch(() => props.patient, (newVal) => {
|
||||||
if (newVal) {
|
if (newVal) {
|
||||||
// 立即检查状态
|
|
||||||
checkPatientStatus()
|
checkPatientStatus()
|
||||||
// 如果medicalSn变化则重新加载数据
|
|
||||||
if (newVal.medicalSn) {
|
if (newVal.medicalSn) {
|
||||||
loadPatientItems()
|
loadPatientItems()
|
||||||
}
|
}
|
||||||
|
if (newVal.chiefinspector) {
|
||||||
|
selectedDoctor.value = newVal.chiefinspector
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, { deep: true, immediate: true })
|
}, { deep: true, immediate: true })
|
||||||
|
|
||||||
@ -403,7 +477,16 @@ const insertTemplate = (templateContent) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 暴露保存汇总方法给父组件调用
|
// 暴露保存汇总方法给父组件调用
|
||||||
defineExpose({ saveSummary })
|
defineExpose({
|
||||||
|
saveSummary,
|
||||||
|
validateSummaryDoctor: () => {
|
||||||
|
if (!selectedDoctor.value) {
|
||||||
|
ElMessage.warning('请选择总检医生')
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
182
src/views/inspect/inspectdoctor/DoctorForm.vue
Normal file
182
src/views/inspect/inspectdoctor/DoctorForm.vue
Normal file
@ -0,0 +1,182 @@
|
|||||||
|
<template>
|
||||||
|
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
||||||
|
<el-form
|
||||||
|
ref="formRef"
|
||||||
|
:model="formData"
|
||||||
|
:rules="formRules"
|
||||||
|
label-width="100px"
|
||||||
|
v-loading="formLoading"
|
||||||
|
>
|
||||||
|
<el-form-item label="医生编号" prop="doctorid">
|
||||||
|
<el-input v-model="formData.doctorid" placeholder="请输入医生编号" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="医生姓名" prop="doctorname">
|
||||||
|
<el-input v-model="formData.doctorname" placeholder="请输入医生姓名" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="医生签名" prop="doctorsign">
|
||||||
|
<el-upload
|
||||||
|
class="avatar-uploader"
|
||||||
|
:show-file-list="false"
|
||||||
|
:auto-upload="false"
|
||||||
|
:on-change="handleImageChange"
|
||||||
|
accept="image/*"
|
||||||
|
>
|
||||||
|
<img v-if="formData.doctorsign" :src="formData.doctorsign" class="avatar" />
|
||||||
|
<el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
|
||||||
|
</el-upload>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="机构ID" prop="orgid">
|
||||||
|
<el-input v-model="formData.orgid" placeholder="请输入机构ID" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="机构名称" prop="orgname">
|
||||||
|
<el-input v-model="formData.orgname" placeholder="请输入机构名称" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||||
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
|
</template>
|
||||||
|
</Dialog>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { DoctorApi, DoctorVO } from '@/api/inspect/inspectdoctor'
|
||||||
|
import { Plus } from '@element-plus/icons-vue'
|
||||||
|
|
||||||
|
/** 保存医生签名信息 表单 */
|
||||||
|
defineOptions({ name: 'DoctorForm' })
|
||||||
|
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||||
|
const dialogTitle = ref('') // 弹窗的标题
|
||||||
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||||
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||||
|
const formData = ref({
|
||||||
|
id: undefined as number | undefined,
|
||||||
|
doctorid: undefined as string | undefined,
|
||||||
|
doctorname: undefined as string | undefined,
|
||||||
|
doctorsign: undefined as string | undefined,
|
||||||
|
orgid: undefined as string | undefined,
|
||||||
|
orgname: undefined as string | undefined,
|
||||||
|
})
|
||||||
|
const formRules = reactive({
|
||||||
|
doctorid: [
|
||||||
|
{ required: true, message: '请输入医生编号', trigger: 'blur' },
|
||||||
|
{ min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
doctorname: [
|
||||||
|
{ required: true, message: '请输入医生姓名', trigger: 'blur' },
|
||||||
|
{ min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
doctorsign: [
|
||||||
|
{ required: true, message: '请上传医生签名图片', trigger: 'change' }
|
||||||
|
],
|
||||||
|
orgid: [
|
||||||
|
{ required: true, message: '请输入机构ID', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
orgname: [
|
||||||
|
{ required: true, message: '请输入机构名称', trigger: 'blur' }
|
||||||
|
]
|
||||||
|
})
|
||||||
|
const formRef = ref() // 表单 Ref
|
||||||
|
|
||||||
|
/** 打开弹窗 */
|
||||||
|
const open = async (type: string, id?: number) => {
|
||||||
|
dialogVisible.value = true
|
||||||
|
dialogTitle.value = t('action.' + type)
|
||||||
|
formType.value = type
|
||||||
|
resetForm()
|
||||||
|
// 修改时,设置数据
|
||||||
|
if (id) {
|
||||||
|
formLoading.value = true
|
||||||
|
try {
|
||||||
|
formData.value = await DoctorApi.getDoctor(id)
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||||
|
|
||||||
|
/** 提交表单 */
|
||||||
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||||
|
const submitForm = async () => {
|
||||||
|
// 校验表单
|
||||||
|
await formRef.value.validate()
|
||||||
|
// 提交请求
|
||||||
|
formLoading.value = true
|
||||||
|
try {
|
||||||
|
const data = formData.value as unknown as DoctorVO
|
||||||
|
if (formType.value === 'create') {
|
||||||
|
await DoctorApi.createDoctor(data)
|
||||||
|
message.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await DoctorApi.updateDoctor(data)
|
||||||
|
message.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
dialogVisible.value = false
|
||||||
|
// 发送操作成功的事件
|
||||||
|
emit('success')
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置表单 */
|
||||||
|
const resetForm = () => {
|
||||||
|
formData.value = {
|
||||||
|
id: undefined,
|
||||||
|
doctorid: undefined,
|
||||||
|
doctorname: undefined,
|
||||||
|
doctorsign: undefined,
|
||||||
|
orgid: undefined,
|
||||||
|
orgname: undefined,
|
||||||
|
}
|
||||||
|
formRef.value?.resetFields()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 处理图片选择 */
|
||||||
|
const handleImageChange = (file: any) => {
|
||||||
|
const reader = new FileReader()
|
||||||
|
reader.onload = (e) => {
|
||||||
|
formData.value.doctorsign = e.target?.result as string
|
||||||
|
}
|
||||||
|
reader.readAsDataURL(file.raw)
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.avatar-uploader {
|
||||||
|
border: 1px dashed #d9d9d9;
|
||||||
|
border-radius: 6px;
|
||||||
|
cursor: pointer;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
width: 178px;
|
||||||
|
height: 178px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.avatar-uploader:hover {
|
||||||
|
border-color: #409EFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.avatar-uploader-icon {
|
||||||
|
font-size: 28px;
|
||||||
|
color: #8c939d;
|
||||||
|
width: 178px;
|
||||||
|
height: 178px;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 178px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.avatar {
|
||||||
|
width: 178px;
|
||||||
|
height: 178px;
|
||||||
|
display: block;
|
||||||
|
object-fit: contain;
|
||||||
|
}
|
||||||
|
</style>
|
197
src/views/inspect/inspectdoctor/index.vue
Normal file
197
src/views/inspect/inspectdoctor/index.vue
Normal file
@ -0,0 +1,197 @@
|
|||||||
|
<template>
|
||||||
|
<ContentWrap>
|
||||||
|
<!-- 搜索工作栏 -->
|
||||||
|
<el-form
|
||||||
|
class="-mb-15px"
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryFormRef"
|
||||||
|
:inline="true"
|
||||||
|
label-width="68px"
|
||||||
|
>
|
||||||
|
<el-form-item label="医生编号" prop="doctorid">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.doctorid"
|
||||||
|
placeholder="请输入医生编号"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-200px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="医生姓名" prop="doctorname">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.doctorname"
|
||||||
|
placeholder="请输入医生姓名"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-200px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="机构ID" prop="orgid">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.orgid"
|
||||||
|
placeholder="请输入机构ID"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-200px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="机构名称" prop="orgname">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.orgname"
|
||||||
|
placeholder="请输入机构名称"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-200px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||||
|
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
@click="openForm('create')"
|
||||||
|
>
|
||||||
|
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
@click="handleExport"
|
||||||
|
:loading="exportLoading"
|
||||||
|
>
|
||||||
|
<Icon icon="ep:download" class="mr-5px" /> 导出
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</ContentWrap>
|
||||||
|
|
||||||
|
<!-- 列表 -->
|
||||||
|
<ContentWrap>
|
||||||
|
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||||
|
<el-table-column label="医生编号" align="center" prop="doctorid" />
|
||||||
|
<el-table-column label="医生姓名" align="center" prop="doctorname" />
|
||||||
|
<el-table-column label="机构ID" align="center" prop="orgid" />
|
||||||
|
<el-table-column label="机构名称" align="center" prop="orgname" />
|
||||||
|
<el-table-column label="操作" align="center" min-width="120px">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
@click="openForm('update', scope.row.id)"
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="danger"
|
||||||
|
@click="handleDelete(scope.row.id)"
|
||||||
|
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!-- 分页 -->
|
||||||
|
<Pagination
|
||||||
|
:total="total"
|
||||||
|
v-model:page="queryParams.pageNo"
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</ContentWrap>
|
||||||
|
|
||||||
|
<!-- 表单弹窗:添加/修改 -->
|
||||||
|
<DoctorForm ref="formRef" @success="getList" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import download from '@/utils/download'
|
||||||
|
import { DoctorApi, DoctorVO } from '@/api/inspect/inspectdoctor'
|
||||||
|
import DoctorForm from './DoctorForm.vue'
|
||||||
|
|
||||||
|
/** 保存医生签名信息 列表 */
|
||||||
|
defineOptions({ name: 'InspectDoctor' })
|
||||||
|
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
|
const loading = ref(true) // 列表的加载中
|
||||||
|
const list = ref<DoctorVO[]>([]) // 列表的数据
|
||||||
|
const total = ref(0) // 列表的总页数
|
||||||
|
const queryParams = reactive({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
doctorid: undefined,
|
||||||
|
doctorname: undefined,
|
||||||
|
doctorsign: undefined,
|
||||||
|
orgid: undefined,
|
||||||
|
orgname: undefined,
|
||||||
|
})
|
||||||
|
const queryFormRef = ref() // 搜索的表单
|
||||||
|
const exportLoading = ref(false) // 导出的加载中
|
||||||
|
|
||||||
|
/** 查询列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const data = await DoctorApi.getDoctorPage(queryParams)
|
||||||
|
list.value = data.list
|
||||||
|
total.value = data.total
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
const handleQuery = () => {
|
||||||
|
queryParams.pageNo = 1
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
const resetQuery = () => {
|
||||||
|
queryFormRef.value.resetFields()
|
||||||
|
handleQuery()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 添加/修改操作 */
|
||||||
|
const formRef = ref()
|
||||||
|
const openForm = (type: string, id?: number) => {
|
||||||
|
formRef.value.open(type, id)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
const handleDelete = async (id: number) => {
|
||||||
|
try {
|
||||||
|
// 删除的二次确认
|
||||||
|
await message.delConfirm()
|
||||||
|
// 发起删除
|
||||||
|
await DoctorApi.deleteDoctor(id)
|
||||||
|
message.success(t('common.delSuccess'))
|
||||||
|
// 刷新列表
|
||||||
|
await getList()
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
const handleExport = async () => {
|
||||||
|
try {
|
||||||
|
// 导出的二次确认
|
||||||
|
await message.exportConfirm()
|
||||||
|
// 发起导出
|
||||||
|
exportLoading.value = true
|
||||||
|
const data = await DoctorApi.exportDoctor(queryParams)
|
||||||
|
download.excel(data, '保存医生签名信息.xls')
|
||||||
|
} catch {
|
||||||
|
} finally {
|
||||||
|
exportLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 初始化 **/
|
||||||
|
onMounted(() => {
|
||||||
|
getList()
|
||||||
|
})
|
||||||
|
</script>
|
Loading…
Reference in New Issue
Block a user