诊断模板

This commit is contained in:
旺仔 2024-08-31 03:10:42 +08:00
parent 8ce6e6f995
commit 601e6b59be
3 changed files with 270 additions and 61 deletions

View File

@ -15,6 +15,9 @@ export const DiagnosisTemplateApi = {
getPage: async (params: any) => { getPage: async (params: any) => {
return await request.get({ url: `/system/reporttemplate/page`, params }) return await request.get({ url: `/system/reporttemplate/page`, params })
}, },
getAllList: async () => {
return await request.get({ url: `/system/reporttemplate/getlist` })
},
get: async (id: any) => { get: async (id: any) => {
return await request.get({ url: `/system/reporttemplate/get?id=`+ id }) return await request.get({ url: `/system/reporttemplate/get?id=`+ id })
}, },

View File

@ -1,56 +1,44 @@
<template> <template>
<div> <div>
<Dialog :title="dialogTitle" v-model="dialogVisible" width="60%"> <Dialog :title="dialogTitle" v-model="dialogVisible" width="58%">
<el-form <el-form
ref="formRef" ref="formRef"
:model="formData" :model="formData"
size="default" size="default"
label-width="70px" label-width="90px"
label-position="right" label-position="right"
label-suffix="" label-suffix=""
class="-ml-30px" class="-ml-8px"
v-loading="formLoading" v-loading="formLoading"
> >
<el-row>
<el-col :span="24">
<el-form-item label="节点" prop="templateName" class="item-style">
<el-input
v-model="formData.templateName"
placeholder="请输入节点"
clearable
class="item-width"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="所见" prop="examDescription" class="item-style">
<el-input
v-model="formData.examDescription"
placeholder="请输入所见"
type="textarea"
:autosize="{ minRows: 4, maxRows: 9 }"
class="item-width"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="所得" prop="diagResults" class="item-style">
<el-input
v-model="formData.diagResults"
placeholder="请输入所得"
type="textarea"
:autosize="{ minRows: 4, maxRows: 9 }"
class="item-width"
/>
</el-form-item>
</el-col>
</el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="节点类型" prop="dataType" class="item-style">
<el-radio-group
v-model="formData.dataType"
:disabled="dataType_disabled"
@change="dataType_change"
>
<el-radio-button value="1">节点</el-radio-button>
<el-radio-button value="0">
<div style="width: 60px; text-align: left">诊断模板</div>
</el-radio-button>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row v-if="formData.dataType == '0'">
<el-col :span="12">
<el-form-item label="模板类型" class="item-style">
<el-radio-group v-model="templateLimitsType">
<el-radio-button value="1">公有</el-radio-button>
<el-radio-button value="2">
<div style="width: 60px; text-align: left">私有</div>
</el-radio-button>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12" v-if="templateLimitsType == '2'">
<el-form-item label="医生" prop="privateDoctorId" class="item-style"> <el-form-item label="医生" prop="privateDoctorId" class="item-style">
<el-select <el-select
v-model="formData.privateDoctorId" v-model="formData.privateDoctorId"
@ -67,6 +55,22 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="模板类别" prop="templateType" class="item-style">
<el-select
v-model="formData.templateType"
placeholder="请选择模板类别"
clearable
class="item-width"
>
<el-option label="体检模板" value="体检模板" />
<el-option label="门诊模板" value="门诊模板" />
<el-option label="住院模板" value="住院模板" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="机构" prop="orgId" class="item-style"> <el-form-item label="机构" prop="orgId" class="item-style">
<el-select <el-select
@ -85,6 +89,65 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row>
<el-col :span="24" v-if="formData.dataType == '0'">
<el-form-item label="父节点" prop="pid" class="item-style">
<el-select
v-model="parentTemplateInfo"
value-key="id"
placeholder="请选择父节点"
clearable
class="item-width"
@change="pid_change"
>
<el-option
v-for="item in templateList"
:key="item.id"
:label="item.templateName"
:value="item"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="节点" prop="templateName" class="item-style">
<el-input
v-model="formData.templateName"
placeholder="请输入节点"
clearable
class="item-width"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24" v-if="formData.dataType == '0'">
<el-form-item label="所见" prop="examDescription" class="item-style">
<el-input
v-model="formData.examDescription"
placeholder="请输入所见"
type="textarea"
:autosize="{ minRows: 4, maxRows: 9 }"
class="item-width"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24" v-if="formData.dataType == '0'">
<el-form-item label="所得" prop="diagResults" class="item-style">
<el-input
v-model="formData.diagResults"
placeholder="请输入所得"
type="textarea"
:autosize="{ minRows: 4, maxRows: 9 }"
class="item-width"
/>
</el-form-item>
</el-col>
</el-row>
</el-form> </el-form>
<template #footer> <template #footer>
@ -122,18 +185,45 @@ const formLoading = ref(false)
const formType = ref('') const formType = ref('')
const orgList = ref<any[]>([]) const orgList = ref<any[]>([])
const doctorList = ref<any[]>([]) const doctorList = ref<any[]>([])
const templateList = ref<any[]>([])
const parentTemplateInfo = ref<any>()
const templateLimitsType = ref<any>('2')
const dataType_disabled = ref(false)
// //
const formData = ref({ const formData = ref({
id: '',
pid: '',
dataType: '0',
privateDoctorId: '',
templateType: '',
templateName: '', templateName: '',
examDescription: '', examDescription: '',
diagResults: '', diagResults: '',
privateDoctorId: '', examPart: '',
examPartCode: '',
updateTime: undefined,
orgId: '' orgId: ''
}) })
/****** 自定义内容 ******/ /****** 自定义内容 ******/
const resetForm = () => { const resetForm = () => {
formRef.value?.resetFields() formData.value = {
id: '',
pid: '',
dataType: '0',
privateDoctorId: '',
templateType: '',
templateName: '',
examDescription: '',
diagResults: '',
examPart: '',
examPartCode: '',
updateTime: undefined,
orgId: ''
}
parentTemplateInfo.value = undefined
templateLimitsType.value = '2'
formRef.value?.clearValidate()
} }
const open = async (type: string, id?: number) => { const open = async (type: string, id?: number) => {
@ -144,19 +234,73 @@ const open = async (type: string, id?: number) => {
if (id) { if (id) {
formLoading.value = true formLoading.value = true
try { try {
formData.value = await DiagnosisTemplateApi.get(id) const data = await DiagnosisTemplateApi.get(id)
formData.value = data
if (data && !data.privateDoctorId) templateLimitsType.value = '1'
parentTemplateInfo.value = templateList.value?.find((item) => {
return item?.id && formData.value?.pid && item.id == formData.value.pid
})
} finally { } finally {
formLoading.value = false formLoading.value = false
} }
} }
dataType_disabled.value = true && !!formData.value?.id
} }
/****** 可参考内容 ******/ /****** 可参考内容 ******/
/** 组件事件 **/ /** 组件事件 **/
const pid_change = async (value: any) => {
formData.value.pid = value ? value.id : ''
}
const dataType_change = () => {
if (formData.value?.dataType == '1') {
templateLimitsType.value = '2'
formData.value.privateDoctorId = ''
formData.value.pid = '0'
formData.value.examDescription = ''
formData.value.diagResults = ''
} else if (formData.value?.dataType == '0') {
formData.value.pid = ''
}
}
const submitForm = async () => { const submitForm = async () => {
formLoading.value = true formLoading.value = true
try { try {
const data = formData.value const data = formData.value
//
if (!data.templateType) {
await message.alertWarning('请选择模板类别')
return
}
if (!data.orgId) {
await message.alertWarning('请选择机构')
return
}
if (!data.templateName || data.templateName.trim() == '') {
await message.alertWarning('请输入节点')
return
}
if (data.dataType && data.dataType == '0') {
if (templateLimitsType.value == '2' && !data.privateDoctorId) {
await message.alertWarning('请选择医生')
return
}
if (!data.pid || !parentTemplateInfo.value) {
await message.alertWarning('请选择父节点')
return
}
if (templateLimitsType.value == '1') {
data.privateDoctorId = ''
}
if (parentTemplateInfo.value) {
data.examPart = parentTemplateInfo.value.examPart
}
} else if (data.dataType && data.dataType == '1') {
data.examPart = data.templateName
}
//
if (formType.value === 'create') { if (formType.value === 'create') {
await DiagnosisTemplateApi.create(data) await DiagnosisTemplateApi.create(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
@ -173,15 +317,13 @@ const submitForm = async () => {
/** 钩子方法 **/ /** 钩子方法 **/
onMounted(async () => { onMounted(async () => {
//ceshi
orgList.value = await DiagnosisTemplateApi.getOrgList() orgList.value = await DiagnosisTemplateApi.getOrgList()
doctorList.value = await DiagnosisTemplateApi.getDoctorList() doctorList.value = await DiagnosisTemplateApi.getDoctorList()
templateList.value = await DiagnosisTemplateApi.getAllList()
}) })
/** 防空作用域 **/ /** 防空作用域 **/
console.log(dateFormatter) console.log(dateFormatter)
console.log(message)
console.log(t)
//console.log(null) //console.log(null)
/** 导出内容 **/ /** 导出内容 **/

View File

@ -24,9 +24,9 @@
<el-col :span="8"> <el-col :span="8">
<el-form-item label="模板类型" prop="templateLimitsType" class="item-style"> <el-form-item label="模板类型" prop="templateLimitsType" class="item-style">
<el-radio-group v-model="queryParams.templateLimitsType" class="radio-group"> <el-radio-group v-model="queryParams.templateLimitsType" class="radio-group">
<el-radio value="all" style="margin-left: 15px; margin-right: 15px">全部</el-radio> <el-radio value="0" style="margin-left: 15px; margin-right: 15px">全部</el-radio>
<el-radio value="public" style="margin-right: 15px">公共</el-radio> <el-radio value="1" style="margin-right: 15px">公共</el-radio>
<el-radio value="private" style="margin-right: 15px">私有</el-radio> <el-radio value="2" style="margin-right: 15px">私有</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -60,30 +60,53 @@
<ContentWrap class="mb-1px"> <ContentWrap class="mb-1px">
<el-table <el-table
ref="tableRef"
v-loading="loading" v-loading="loading"
size="default" size="default"
border border
:stripe="true" :stripe="false"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
:data="list_templates" :data="list_templates"
:header-cell-style="{ background: 'rgb(235, 241, 250)', height: '40px', color: '#333333' }" :header-cell-style="{ background: 'rgb(235, 241, 250)', height: '40px', color: '#333333' }"
:row-style="{ height: '40px' }" :row-style="{ height: '40px' }"
class="list_templates"
height="max(calc(100vh - 422px),80px)" height="max(calc(100vh - 422px),80px)"
:tree-props="{ children: 'children' }"
:row-key="
(row) => {
return row?.id?.toString()
}
"
:default-expand-all="false"
:expand-row-keys="expandRowKeys"
:row-class-name="handleRowClass"
@row-click="handleRowClick"
> >
<el-table-column type="index" label="序号" align="center" width="54px" /> <el-table-column
<el-table-column label="节点" align="center" prop="templateName" /> label="序号"
align="left"
header-align="center"
prop="rowNumIndex"
width="140px"
resizable
/>
<el-table-column label="节点" align="left" header-align="center" prop="templateName" />
<el-table-column label="所见" align="center" prop="examDescription" /> <el-table-column label="所见" align="center" prop="examDescription" />
<el-table-column label="所得" align="center" prop="diagResults" /> <el-table-column label="所得" align="center" prop="diagResults" />
<el-table-column label="操作" align="center" fixed="right" width="180px"> <el-table-column label="操作" align="center" fixed="right" width="180px">
<template #default="scope"> <template #default="scope">
<el-button <el-button
link link
@click="openForm('update', scope.row.id)" @click.stop="openForm('update', scope.row.id)"
style="color: rgb(56, 119, 246)" style="color: rgb(56, 119, 246)"
> >
编辑 编辑
</el-button> </el-button>
<el-button link @click="handleDelete(scope.row.id)" style="color: rgb(223, 65, 65)"> <el-button
link
@click.stop="handleDelete(scope.row.id)"
style="color: rgb(223, 65, 65)"
>
删除 删除
</el-button> </el-button>
</template> </template>
@ -121,6 +144,7 @@ defineOptions({ name: 'DiagnosisTemplate' })
/** 组件引用 **/ /** 组件引用 **/
const queryFormRef = ref() const queryFormRef = ref()
const formRef = ref() const formRef = ref()
const tableRef = ref()
/** 数据结构 **/ /** 数据结构 **/
const message = useMessage() const message = useMessage()
@ -130,18 +154,43 @@ const queryParams = ref({
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
templateName: '', templateName: '',
templateLimitsType: 'all' templateLimitsType: '0'
}) })
// //
const list_templates = ref<any[]>([]) const list_templates = ref<any[]>([])
const total = ref(0) const total = ref(0)
const loading = ref(false) const loading = ref(true)
const expandRowKeys = ref<any[]>([])
/****** 自定义内容 ******/ /****** 自定义内容 ******/
/****** 可参考内容 ******/ const setRowIndex = (items: any, parentIndex: string) => {
if (items && Array.isArray(items) && items.length > 0) {
items.forEach((item, i) => {
item.rowNumIndex = parentIndex + (i + 1)
if (item.children && Array.isArray(item.children) && item.children.length > 0) {
setRowIndex(item.children, item.rowNumIndex + '.')
}
})
}
}
/****** 可参考内容 ******/
/** 组件事件 **/ /** 组件事件 **/
const openForm = (type: string, id?: any) => { const handleRowClass = ({ row }) => {
if (row?.dataType == '1') {
return 'grey-row'
} else {
return ''
}
}
const handleRowClick = (row) => {
if (row?.dataType == '1') {
tableRef.value.toggleRowExpansion(row)
}
}
const openForm = async (type: string, id?: any) => {
formRef.value.open(type, id) formRef.value.open(type, id)
} }
@ -155,9 +204,11 @@ const handleDelete = async (id: any) => {
} }
const getList = async () => { const getList = async () => {
expandRowKeys.value = []
loading.value = true loading.value = true
try { try {
const data = await DiagnosisTemplateApi.getPage(queryParams.value) const data = await DiagnosisTemplateApi.getPage(queryParams.value)
setRowIndex(data.list, '')
list_templates.value = data.list list_templates.value = data.list
total.value = data.total total.value = data.total
} finally { } finally {
@ -165,13 +216,18 @@ const getList = async () => {
} }
} }
const handleQuery = () => { const handleQuery = async () => {
queryParams.value.pageNo = 1 queryParams.value.pageNo = 1
getList() getList()
} }
const resetQuery = async () => { const resetQuery = async () => {
/* aaaaa */ queryParams.value = {
pageNo: 1,
pageSize: 10,
templateName: '',
templateLimitsType: '0'
}
queryFormRef.value?.clearValidate() queryFormRef.value?.clearValidate()
handleQuery() handleQuery()
} }
@ -213,4 +269,12 @@ console.log(download)
.radio-group { .radio-group {
border: 1px solid #ececec; border: 1px solid #ececec;
} }
.list_templates :deep(.grey-row) {
--el-table-tr-bg-color: #f2f5f198;
}
.list_templates :deep(tbody) tr:hover > td {
background-color: transparent !important;
}
</style> </style>