Przeglądaj źródła

Merge branch 'hrx0627'

HuRongxin 1 miesiąc temu
rodzic
commit
5ceb8da1fa

+ 2 - 0
src/api/parameter/basicPublicTemplate/consultantResultTemplate/types.ts

@@ -83,6 +83,8 @@ export interface ResultTemplateForm {
     */
     content?: string;
 
+    contentStr?:string
+
     /**
  * 创建时间
  */

+ 6 - 3
src/views/parameter/basicPublicTemplate/consultantResultTemplate/addOrEditForm.vue

@@ -45,7 +45,7 @@
             </div>
         </el-card>
         <!-- 添加模板类型管理弹窗 -->
-        <ResultTemplateTypeDialog ref="resultTemplateTypeDialogRef" @success="getTemplateTypeList"/>
+        <ResultTemplateTypeDialog ref="resultTemplateTypeDialogRef" @success="getTemplateTypeList" />
     </div>
 </template>
 
@@ -82,7 +82,8 @@
         templateName: undefined,
         description: undefined,
         templateTypeId: undefined,
-        content: undefined
+        content: undefined,
+        contentStr: undefined
     }
 
     const form = ref < ResultTemplateForm > ({ ...initFormData });
@@ -102,7 +103,7 @@
         ]
     };
 
-        /** 获取会诊模板类型列表 */
+    /** 获取会诊模板类型列表 */
     const getTemplateTypeList = async () => {
         try {
             const params: ResultTemplateTypeQuery = {
@@ -150,8 +151,10 @@
                 buttonLoading.value = true;
                 try {
                     if (form.value.id) {
+                        form.value.contentStr = window.btoa(encodeURIComponent(form.value.content))
                         await updateResultTemplate(form.value);
                     } else {
+                        form.value.contentStr = window.btoa(encodeURIComponent(form.value.content))
                         await addResultTemplate(form.value);
                     }
                     proxy ?.$modal.msgSuccess("操作成功");

+ 48 - 4
src/views/parameter/basicPublicTemplate/consultantResultTemplate/index.vue

@@ -12,7 +12,7 @@
 
                         </el-form-item>
                         <el-form-item label="创建人科室">
-                            <el-input v-model="queryParams.createBy" placeholder="请选择" clearable />
+                            <el-tree-select v-model="queryParams.createBy" :data="treeData" :props="treeProps" placeholder="请选择" check-strictly node-key="id" @keyup.enter="handleQuery" />
                         </el-form-item>
                         <el-form-item label="类型">
                             <el-select v-model="queryParams.templateTypeId" placeholder="请选择" clearable>
@@ -88,6 +88,7 @@
     import { listResultTemplateType } from '@/api/parameter/basicPublicTemplate/consultantResultTemplateType';
     import type { ResultTemplateTypeQuery } from '@/api/parameter/basicPublicTemplate/consultantResultTemplateType/types';
     import ResultTemplateTypeDialog from '../consultantResultTemplateType/resultTemplateTypeDialog.vue';
+    import { listDept } from '@/api/system/dept'; // 部门列表
 
     const { proxy } = getCurrentInstance() as ComponentInternalInstance;
     const resultTemplateList = ref < ResultTemplateVO[] > ([]);
@@ -99,6 +100,7 @@
     const multiple = ref(true);
     const total = ref(0);
     import { useRouter } from 'vue-router';
+    const treeData = ref([]); // 定义 treeData
     import { json } from 'stream/consumers';
     const router = useRouter();
     const queryFormRef = ref < ElFormInstance > ();
@@ -109,6 +111,11 @@
         value: string | number;
         label: string;
     }
+    const treeProps = ref({
+        value: 'deptId', // 对应部门的 deptId
+        label: 'deptName', // 对应部门的 deptName
+        children: 'children' // 保持原有的父子结构
+    });
     const templateTypeList = ref < ResultTemplateTypeOption[] > ([]);
 
     const dialog = reactive < DialogOption > ({
@@ -175,12 +182,48 @@
         loading.value = true;
         const res = await listResultTemplate(queryParams.value);
         resultTemplateList.value = res.rows;
-        console.log(JSON.stringify(resultTemplateList.value));
-
+        // 获取部门数据
+        const deptMap = new Map();
+        treeData.value.forEach(dept => {
+            deptMap.set(dept.deptId, dept.deptName);
+            if (dept.children) {
+                dept.children.forEach(child => {
+                    deptMap.set(child.deptId, child.deptName);
+                });
+            }
+        });
         total.value = res.total;
         loading.value = false;
     }
 
+    const getDeptList = async () => {
+        loading.value = true;
+        try {
+            const res = await listDept({});
+            if (!res.data) {
+                console.warn("部门数据为空");
+                treeData.value = [];
+                return;
+            }
+
+            // 处理树形数据
+            const processedData = proxy ?.handleTree(res.data, 'deptId');
+            if (!processedData) {
+                console.warn("树形数据处理失败");
+                treeData.value = [];
+                return;
+            }
+
+            treeData.value = processedData;
+
+        } catch (error) {
+            console.error('获取部门列表失败:', error);
+            treeData.value = [];
+        } finally {
+            loading.value = false;
+        }
+    };
+
     /** 获取会诊模板类型列表 */
     const getTemplateTypeList = async () => {
         try {
@@ -303,6 +346,7 @@
 
     onMounted(() => {
         getList();
-        getTemplateTypeList(); // 初始化时加载供应商数据
+        getDeptList(); // 初始化时加载部门数据
+        getTemplateTypeList();
     });
 </script>

+ 4 - 4
src/views/patients/medicalRecord/index.vue

@@ -175,7 +175,7 @@
     };
 
     const handlePrev = () => {
-        currentComponent.value=componentMap['medicalRecord']
+        currentComponent.value = componentMap['medicalRecord']
         if (currentPatientIndex.value > 0) {
             patientInfo.value = patientList.value[currentPatientIndex.value - 1];
             currentPatientIndex.value--;
@@ -183,7 +183,7 @@
     };
 
     const handleNext = () => {
-       currentComponent.value=componentMap['medicalRecord']
+        currentComponent.value = componentMap['medicalRecord']
         patientInfo.value = patientList.value[currentPatientIndex.value + 1];
         if (currentPatientIndex.value < patientList.value.length - 1) {
             currentPatientIndex.value++;
@@ -312,8 +312,8 @@
 
     onMounted(() => {
         // 获取体力活动字典
-        const { physical_activity } = toRefs(proxy?.useDict('physical_activity'));
-        physicalActivityDict.value = physical_activity?.value || [];
+        const { physical_activity } = toRefs(proxy ?.useDict('physical_activity'));
+        physicalActivityDict.value = physical_activity ?.value || [];
         getList();
     });
 </script>

+ 3 - 3
src/views/patients/nutriDiagnosis/index.vue

@@ -8,9 +8,9 @@
                             <el-form-item>
                                 <el-date-picker v-model="queryParams.dateRange" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" />
                             </el-form-item>
-                            <el-form-item label="检验类型">
+                            <el-form-item label="看诊类型">
                                 <el-select v-model="form.visitType" class="spec-unit-select">
-                                    <el-option v-for="dict in check_type" :key="dict.value" :label="dict.label" :value="dict.value" />
+                                    <el-option v-for="dict in treatment_user_type" :key="dict.value" :label="dict.label" :value="dict.value" />
                                 </el-select>
                             </el-form-item>
                             <el-form-item>
@@ -107,7 +107,7 @@
     const { proxy } = getCurrentInstance() as ComponentInternalInstance;
 
     const ConsultantTemplateDialog = defineAsyncComponent(() => import('./consultantTemplateDialog.vue'));
-    const { check_type } = toRefs < any > (proxy ?.useDict('check_type'));
+    const { treatment_user_type } = toRefs < any > (proxy ?.useDict('treatment_user_type'));
 
 
     const diagnosisList = ref < DiagnosisVO[] > ([]);