Просмотр исходного кода

fix: 修复透析病历中问题

fan 2 лет назад
Родитель
Сommit
8f2d7f8afb

+ 1 - 1
src/views/biz/archives/diagnosisHistory/data.ts

@@ -308,7 +308,7 @@ export const columnsMulti: BasicColumn[] = [
   {
     title: '名称',
     dataIndex: 'name',
-    width: 220,
+    width: 200,
     edit: true,
     editable: true,
     editComponent: 'Select',

+ 7 - 4
src/views/biz/archives/formula/FormDrawer.vue

@@ -66,6 +66,7 @@
     archivesFormulaTemplateEdit,
   } from '@/api/biz/archives/formulaTemplateApi';
   import FormDrawerHistory from './FormDrawerHistory.vue';
+  import dayjs from 'dayjs';
   const emit = defineEmits(['success', 'register']);
 
   const getTitle = ref('透析处方');
@@ -108,13 +109,14 @@
     console.log('🚀 ~ file: FormDrawer.vue:49 ~ data:', data);
     await resetFields();
     setDrawerProps({ confirmLoading: false });
-    isUpdate.value = data?.isUpdate;
+    isUpdate.value = data.isUpdate;
     getTitle.value = `${isUpdate.value ? '编辑透析处方模板' : '新建透析处方模板'} ( ${
       data.record.name
     } | ${data.record.gender} | ${data.record.age}岁 )`;
     bizDictOptions.accessType = await listDictModel({ dictCode: 'va_type' });
     patientBasicId.value = data.record.patientBasicId;
     rowId.value = data.record?.id;
+    console.log('unref(isUpdate)', unref(isUpdate));
     if (unref(isUpdate)) {
       const resData = await archivesFormulaTemplateDetail(rowId.value);
       if (resData.suppliesTemplate) {
@@ -128,9 +130,6 @@
         await nextTick();
         await setTableData(tableData.value);
       }
-      // delete resData.suppliesTemplate;
-      // console.log('🚀 ~ file: FormDrawer.vue:119 ~ resData:', resData);
-      // const fieldData = resData.
       await setFieldsValue({
         ...resData,
       });
@@ -149,6 +148,10 @@
           },
         });
       }
+    } else {
+      await setFieldsValue({
+        enactedTime: dayjs().format('YYYY-MM-DD'),
+      });
     }
   });
 

+ 6 - 2
src/views/biz/archives/formula/data.ts

@@ -92,8 +92,12 @@ export const dataFormSchema: FormSchema[] = [
     field: 'enactedTime',
     required: true,
     component: 'DatePicker',
-    componentProps: {
-      placeholder: '请输入制定日期',
+    componentProps: () => {
+      return {
+        placeholder: '请输入制定日期',
+        getPopupContainer: () => document.body,
+        valueFormat: 'YYYY-MM-DD',
+      };
     },
   },
   {

+ 3 - 2
src/views/biz/archives/formula/index.vue

@@ -118,13 +118,14 @@
     });
     console.log('🚀 ~ file: index.vue:168 ~ getData ~ timeLineData.value :', timeLineData.value);
   }
-  function handleAdd(data) {
-    console.log('🚀 ~ file: index.vue:205 ~ handleAdd ~ data:', data);
+  function handleAdd() {
     const info = {
       ...props.info,
       patientBasicId: props.info.id,
     };
+    console.log('🚀 ~ file: index.vue:205 ~ handleAdd ~ data:', info);
     openDrawer(true, {
+      isUpdate: false,
       record: { ...info },
     });
   }

+ 27 - 17
src/views/biz/archives/index/index.vue

@@ -30,7 +30,17 @@
             }}
           </template>
           <template v-if="column.key === 'gender'">
-            {{ formatDictValue(bizDictOptions.gender, record.gender) }}
+            <span
+              :style="{
+                backgroundColor: formatDictColor(bizDictOptions.gender, record.gender),
+                color: formatDictFontColor(bizDictOptions.gender, record.gender),
+                padding: '1px 6px',
+                borderRadius: '2px',
+                marginRight: '4px',
+              }"
+            >
+              {{ formatDictValue(bizDictOptions.gender, record.gender) }}
+            </span>
           </template>
           <template v-if="column.key === 'firstDialysisType'">
             {{ formatDictValue(bizDictOptions.firstDialysisType, record.firstDialysisType) }}
@@ -39,22 +49,22 @@
             {{ formatDictValue(bizDictOptions.type, record.type) }}
           </template>
           <template v-if="column.key === 'infectiousDiseases'">
-            <span
-              :style="{
-                backgroundColor: formatDictColor(
-                  bizDictOptions.infectiousDiseases,
-                  record.infectiousDiseases,
-                ),
-                color: formatDictFontColor(
-                  bizDictOptions.infectiousDiseases,
-                  record.infectiousDiseases,
-                ),
-                padding: '1px 4px',
-                borderRadius: '6px',
-              }"
-            >
-              {{ formatDictValue(bizDictOptions.infectiousDiseases, record.infectiousDiseases) }}
-            </span>
+            <div class="flex">
+              <div
+                v-for="item in record.infectiousDiseases"
+                :key="item"
+                :style="{
+                  backgroundColor: formatDictColor(bizDictOptions.infectiousDiseases, item),
+                  color: formatDictFontColor(bizDictOptions.infectiousDiseases, item),
+                  padding: '1px 6px',
+                  borderRadius: '2px',
+                  marginRight: '4px',
+                }"
+              >
+                <!-- {{ record.infectiousDiseases }} -->
+                {{ formatDictValue(bizDictOptions.infectiousDiseases, item) }}
+              </div>
+            </div>
           </template>
           <template v-if="column.key === 'vascularAccess'">
             {{ formatDictValue(bizDictOptions.vascularAccess, record.vascularAccess) }}

+ 2 - 1
src/views/biz/archives/patientBasic/index.vue

@@ -137,6 +137,7 @@
           return ele;
         })) ||
       [];
+    basicData.value[2].data = [];
     // 诊断记录
     const DiagnosisHistoryMulti = await archivesDiagnosisHistoryQueryListMulti(props.info?.id);
     console.log(
@@ -176,7 +177,7 @@
     //   [];
     // const mapData = [];
     for (const i in DiagnosisHistoryMulti) {
-      console.log('🚀 ~ file: index.vue:178 ~ getData ~  i:', i);
+      // console.log('🚀 ~ file: index.vue:178 ~ getData ~  i:', i);
       getDiagnosisMulti(DiagnosisHistoryMulti[i], i);
     }
     const firstDialysisRes = await archivesDiagnosisHistoryQueryListSingle(props.info?.id);

+ 6 - 0
src/views/biz/archives/patientReturn/FormModal.vue

@@ -25,6 +25,7 @@
     archivesPatientReturnEdit,
     archivesPatientReturnDetail,
   } from '/@/api/biz/archives/patientReturnApi';
+  import dayjs from 'dayjs';
 
   const emit = defineEmits(['success', 'register']);
 
@@ -48,12 +49,17 @@
     setModalProps({ confirmLoading: false });
     isUpdate.value = !!data?.isUpdate;
     patientBasicId.value = data.record?.patientBasicId;
+
     if (unref(isUpdate)) {
       const resData = await archivesPatientReturnDetail(data.record.id);
       rowId.value = resData.id;
       await setFieldsValue({
         ...resData,
       });
+    } else {
+      await setFieldsValue({
+        returnTime: dayjs().format('YYYY-MM-DD'),
+      });
     }
   });