Bladeren bron

fix: 修复透析病历中存在问题

fan 2 jaren geleden
bovenliggende
commit
a872ed7488

+ 28 - 0
src/api/biz/archives/vitalsHistoryApi.ts

@@ -0,0 +1,28 @@
+import { defHttp } from '/@/utils/http/axios';
+
+enum Api {
+  archivesVitalsHistoryQueryList = '/archives/vitalsHistory/query/list',
+  archivesVitalsHistoryAddOrEdit = '/archives/vitalsHistory/addOrEdit',
+}
+
+/**
+ *
+ * @author fan
+ * @date  2023/07/11 13:59
+ * @description: 添加体征数据,权限 - archives:vitalsHistory:edit
+ * @method: POST
+ */
+export const archivesVitalsHistoryAddOrEdit = (params?: object) => {
+  return defHttp.post({ url: Api.archivesVitalsHistoryAddOrEdit, params: params });
+};
+
+/**
+ *
+ * @author fan
+ * @date  2023/07/11 13:59
+ * @description: 查询体征历史数据,权限 -
+ * @method: POST
+ */
+export const archivesVitalsHistoryQueryList = (params?: object) => {
+  return defHttp.post({ url: Api.archivesVitalsHistoryQueryList, params: params });
+};

+ 53 - 12
src/views/biz/archives/diagnosisHistory/FormModal.vue

@@ -164,7 +164,7 @@
     archivesDiagnosisHistoryMultiAddOrEdit,
   } from '/@/api/biz/archives/diagnosisHistoryApi';
   import { nanoid } from 'nanoid';
-  import { listDictModelBatch } from '@/api/common';
+  import { listDictModel, listDictModelBatch } from '@/api/common';
   import dayjs from 'dayjs';
 
   const emit = defineEmits(['success', 'register']);
@@ -179,6 +179,7 @@
   // 表格数据
   // 过敏史
   const tableDataAllergic = ref([]);
+  const tableRecordType = ref('');
   // 传染病史
   const tableDataContagious = ref([]);
   const tableDataOperation = ref([]);
@@ -189,28 +190,28 @@
   const { createMessage } = useMessage();
   const bizDictOptions = reactive<any>({});
   const bizDictData = ref([
-    { key: 'dh_allergic', dictCode: 'dh_allergic' },
+    { key: 'allergic', dictCode: 'allergic' },
     { key: 'allergic_food', dictCode: 'allergic_food' },
     { key: 'allergic_touch', dictCode: 'allergic_touch' },
     { key: 'allergic_air', dictCode: 'allergic_air' },
     { key: 'allergic_inject', dictCode: 'allergic_inject' },
-    { key: 'dh_contagious_status', dictCode: 'dh_contagious_status' },
+    { key: 'contagious', dictCode: 'contagious' },
     { key: 'pb_epidemic', dictCode: 'pb_epidemic' },
-    { key: 'dh_complications', dictCode: 'dh_complications' },
+    { key: 'complications', dictCode: 'complications' },
     { key: 'complications_breath', dictCode: 'complications_breath' },
     { key: 'complications_blood', dictCode: 'complications_blood' },
     { key: 'complications_incretion', dictCode: 'complications_incretion' },
-    { key: 'dh_clinic', dictCode: 'dh_clinic' },
+    { key: 'clinic', dictCode: 'clinic' },
     { key: 'clinic_breath', dictCode: 'clinic_breath' },
     { key: 'clinic_heart', dictCode: 'clinic_heart' },
     { key: 'clinic_blood', dictCode: 'clinic_blood' },
     { key: 'clinic_hbgr', dictCode: 'clinic_hbgr' },
-    { key: 'dh_pathological', dictCode: 'dh_pathological' },
+    { key: 'pathological', dictCode: 'pathological' },
     { key: 'pathological_breath', dictCode: 'pathological_breath' },
     { key: 'pathological_heart', dictCode: 'pathological_heart' },
     { key: 'pathological_blood', dictCode: 'pathological_blood' },
     { key: 'pathological_hbgr', dictCode: 'pathological_hbgr' },
-    { key: 'dh_ckd', dictCode: 'dh_ckd' },
+    { key: 'ckd', dictCode: 'ckd' },
     { key: 'ckd_breath', dictCode: 'ckd_breath' },
     { key: 'ckd_heart', dictCode: 'ckd_heart' },
     { key: 'ckd_blood', dictCode: 'ckd_blood' },
@@ -254,6 +255,7 @@
           data.content.map(ele => {
             const nameOptions = bizDictOptions[ele.contentType];
             return {
+              type: type.value,
               contentType: ele.contentType,
               typeOptions: typeOptions.value,
               name: ele.multiName,
@@ -271,6 +273,7 @@
         (data.content.length &&
           data.content.map(ele => {
             return {
+              type: type.value,
               singleName: ele.singleName,
               recordTime: dayjs(ele.recordTime).format('YYYY-MM-DD'),
               remark: ele.remark,
@@ -288,6 +291,7 @@
         (data.content.length &&
           data.content.map(ele => {
             return {
+              type: type.value,
               contentType: ele.contentType,
               typeOptions: typeOptions.value,
               startTime: ele.startTime ? dayjs(ele.startTime).format('YYYY-MM-DD') : '',
@@ -314,6 +318,7 @@
           data.multiContent.map(ele => {
             const nameOptions = bizDictOptions[ele.type];
             return {
+              type: type.value,
               contentType: ele.type,
               typeOptions: typeOptions.value,
               name: ele.multiName || [],
@@ -332,15 +337,17 @@
     //   type: type.value,
     // };
     resData = {
-      recordTime: dayjs(data.updateTime).format('YYYY-MM-DD'),
+      recordTime: data.updateTime
+        ? dayjs(data.updateTime).format('YYYY-MM-DD')
+        : dayjs().format('YYYY-MM-DD'),
       name: data.updatorName,
       type: type.value,
     };
     // 首次透析方式
     if (type.value == DiagnosisEnum.firstDialysis_field) {
-      resData.firstDialysisType = data.content[0].contentType;
+      resData.firstDialysisType = data.content[0]?.contentType;
       resData.firstDialysisDate = dayjs().format('YYYY-MM-DD');
-      resData.recordTime = dayjs(data.content[0].recordTime).format('YYYY-MM-DD');
+      resData.recordTime = dayjs(data.content[0]?.recordTime).format('YYYY-MM-DD');
     }
     await setFieldsValue({
       ...resData,
@@ -421,6 +428,7 @@
   async function handleAdd() {
     if (type.value == DiagnosisEnum.allergic_field) {
       tableDataAllergic.value.push({
+        type: type.value,
         contentType: '',
         typeOptions: typeOptions.value,
         name: [],
@@ -436,6 +444,7 @@
     }
     if (type.value == DiagnosisEnum.operation_field) {
       tableDataOperation.value.push({
+        type: type.value,
         singleName: '',
         recordTime: dayjs().format('YYYY-MM-DD'),
         remark: '',
@@ -450,6 +459,7 @@
     }
     if (type.value == DiagnosisEnum.contagious_field) {
       tableDataContagious.value.push({
+        type: type.value,
         contentType: '',
         startTime: '',
         endTime: '',
@@ -471,6 +481,7 @@
       type.value == DiagnosisEnum.ckd_field
     ) {
       tableDataMulti.value.push({
+        type: type.value,
         contentType: '',
         typeOptions: typeOptions.value,
         name: [],
@@ -486,6 +497,7 @@
     }
     if (type.value == DiagnosisEnum.elseRemark_field) {
       tableDataOther.value.push({
+        type: type.value,
         remark: '',
         id: nanoid(5),
       });
@@ -614,7 +626,7 @@
       unref(isSingle)
         ? await archivesDiagnosisHistorySingleAddOrEdit(sendData)
         : await archivesDiagnosisHistoryMultiAddOrEdit(sendData);
-      createMessage.success(`${rowId.value || isSingle.value ? '编辑' : '新增'}成功!`);
+      createMessage.success(`${rowId.value ? '编辑' : '新增'}成功!`);
       closeModal();
       emit('success');
     } finally {
@@ -623,7 +635,36 @@
   }
   // 回调
   async function callEditChange({ record }) {
-    console.log('🚀 ~ file: FormModal.vue:164 ~ callAllergicChange ~ data:', record);
+    if (
+      record.type == DiagnosisEnum.complications_field ||
+      record.type == DiagnosisEnum.clinic_field ||
+      record.type == DiagnosisEnum.pathological_field ||
+      record.type == DiagnosisEnum.ckd_field ||
+      record.type == DiagnosisEnum.allergic_field
+    ) {
+      if (tableRecordType.value != record.contentType) {
+        tableRecordType.value = record.contentType;
+        let res = [];
+        res = await listDictModel({ dictCode: record.contentType });
+        record.nameOptions = res;
+        record.name = [];
+      } else {
+        if (record.name.length > 3) {
+          // createMessage.error('每次最多选择4个');
+          record.nameOptions = record.nameOptions.map(ele => {
+            if (!record.name.includes(ele.value)) {
+              ele.disabled = true;
+            }
+            return ele;
+          });
+        } else {
+          record.nameOptions = record.nameOptions.map(ele => {
+            ele.disabled = false;
+            return ele;
+          });
+        }
+      }
+    }
   }
 </script>
 <style lang="less" scoped>

+ 26 - 64
src/views/biz/archives/diagnosisHistory/data.ts

@@ -1,6 +1,7 @@
 import { listDictModel } from '@/api/common';
 import { FormSchema } from '@/components/Form';
 import { BasicColumn } from '@/components/Table';
+import dayjs from 'dayjs';
 
 // 枚举类型
 export enum DiagnosisEnum {
@@ -36,15 +37,6 @@ export const dataFormSchema: FormSchema[] = [
     label: '记录日期',
     field: 'recordTime',
     component: 'PlainText',
-    // required: true,
-    // component: 'DatePicker',
-    // componentProps: {
-    //   format: 'YYYY-MM-DD',
-    //   placeholder: '请输入记录日期',
-    //   getPopupContainer: () => document.body,
-    //   valueFormat: 'YYYY-MM-DD',
-    //   disabled: true,
-    // },
   },
   {
     label: '记录人',
@@ -82,21 +74,6 @@ export const dataFormSchema: FormSchema[] = [
       return values.type == DiagnosisEnum.firstDialysis_field;
     },
   },
-  // {
-  //   label: '备注',
-  //   field: 'remark',
-  //   required: true,
-  //   component: 'InputTextArea',
-  //   componentProps: {
-  //     placeholder: '请输入备注',
-  //   },
-  //   colProps: {
-  //     span: 24,
-  //   },
-  //   ifShow: ({ values }) => {
-  //     return values.type == DiagnosisEnum.elseRemark_field;
-  //   },
-  // },
 ];
 
 export const columnsAllergic: BasicColumn[] = [
@@ -121,22 +98,10 @@ export const columnsAllergic: BasicColumn[] = [
     editRule: true,
     editComponentProps: ({ record }) => {
       return {
-        // api: listDictModel,
-        // params: {
-        //   // dictCode: 'dh_allergic',
-        //   dictCode: record.typeDict,
-        // },
         options: record.typeOptions,
         showSearch: true,
         placeholder: '请选择',
         getPopupContainer: () => document.body,
-        onChange: async data => {
-          console.log('🚀 ~ onChange file: data.ts:99 ~ data:', data);
-          const res = await listDictModel({ dictCode: data });
-          // console.log('🚀 ~ file: data.ts:99 ~ res:', res);
-          record.nameOptions = res;
-          record.name = [];
-        },
       };
     },
   },
@@ -146,6 +111,7 @@ export const columnsAllergic: BasicColumn[] = [
     width: 220,
     edit: true,
     editable: true,
+    // ApiSelect 多选会出现闪屏问题,请尽量使用默认隐藏字段
     // editComponent: 'ApiSelect',
     // // 默认必填校验
     // editRule: true,
@@ -258,11 +224,16 @@ export const columnsContagious: BasicColumn[] = [
     editComponent: 'DatePicker',
     // 默认必填校验
     editRule: true,
-    editComponentProps: {
-      placeholder: '请选择时间',
-      format: 'YYYY-MM-DD',
-      valueFormat: 'YYYY-MM-DD',
-      getPopupContainer: () => document.body,
+    editComponentProps: ({ record }) => {
+      return {
+        placeholder: '请选择时间',
+        format: 'YYYY-MM-DD',
+        valueFormat: 'YYYY-MM-DD',
+        getPopupContainer: () => document.body,
+        disabledDate: current => {
+          return current < dayjs(record.startTime).subtract(1, 'day').endOf('day');
+        },
+      };
     },
   },
   {
@@ -277,7 +248,7 @@ export const columnsContagious: BasicColumn[] = [
     editComponentProps: {
       api: listDictModel,
       params: {
-        dictCode: 'dh_contagious_status',
+        dictCode: 'contagious',
       },
       placeholder: '请选择',
       getPopupContainer: () => document.body,
@@ -294,6 +265,11 @@ export const columnsContagious: BasicColumn[] = [
 ];
 
 export const columnsMulti: BasicColumn[] = [
+  {
+    title: '诊断类型',
+    dataIndex: 'type',
+    ifShow: false,
+  },
   {
     title: '名称数组',
     dataIndex: 'nameOptions',
@@ -318,13 +294,14 @@ export const columnsMulti: BasicColumn[] = [
         options: record.typeOptions,
         placeholder: '请选择',
         getPopupContainer: () => document.body,
-        onChange: async data => {
-          console.log('🚀 ~ onChange file: data.ts:99 ~ data:', data);
-          const res = await listDictModel({ dictCode: data });
-          // console.log('🚀 ~ file: data.ts:99 ~ res:', res);
-          record.nameOptions = res;
-          record.name = [];
-        },
+        // 尽量不要在 此处使用 onChange,不然会有 warning 错误
+        // onChange: async data => {
+        //   console.log('🚀 ~ onChange file: data.ts:99 ~ data:', data);
+        //   const res = await listDictModel({ dictCode: data });
+        //   // console.log('🚀 ~ file: data.ts:99 ~ res:', res);
+        //   record.nameOptions = res;
+        //   record.name = [];
+        // },
       };
     },
   },
@@ -342,21 +319,6 @@ export const columnsMulti: BasicColumn[] = [
       };
     },
   },
-  // {
-  //   title: '备注',
-  //   dataIndex: 'remark',
-  //   width: 220,
-  //   edit: true,
-  //   editable: true,
-  //   editComponent: 'Input',
-  //   editComponentProps: {
-  //     placeholder: '请输入备注',
-  //   },
-  //   ifShow(column) {
-  //     console.log('🚀 ~ file: data.ts:299 ~ ifShow ~ column:', column);
-  //     return true;
-  //   },
-  // },
 ];
 
 export const columnsOther: BasicColumn[] = [

+ 35 - 45
src/views/biz/archives/diagnosisHistory/index.vue

@@ -12,13 +12,14 @@
     <div v-for="(item, index) in singleData" :key="item.type" class="mb-4">
       <DescCard
         :id="index"
-        icon=""
+        :icon="item['data'].length ? '' : 'icon-xt-add_default'"
         :title="item['title']"
         :type="item['type']"
         :data="item['data']"
         :right="item['right']"
         @edit="callEdit"
         @delete="callDel"
+        @icon="callEdit"
       />
     </div>
     <div v-for="(item, index) in multiData" :key="item.type" class="mb-4">
@@ -61,46 +62,32 @@
       default: () => {},
     } as any,
   });
-  const bizDictOptions = reactive({
-    gender: [],
-    dt: [],
-    dh_allergic: [],
-    allergic_food: [],
-    allergic_touch: [],
-    allergic_air: [],
-    allergic_inject: [],
-    dh_contagious_status: [],
-    pb_epidemic: [],
-    dh_complications: [],
-    complications_breath: [],
-    complications_blood: [],
-    complications_incretion: [],
-  });
+  const bizDictOptions = reactive<any>({});
   const bizDictData = ref([
     { key: 'gender', dictCode: 'pb_sex' },
     { key: 'dt', dictCode: 'dt' },
-    { key: 'dh_allergic', dictCode: 'dh_allergic' },
+    { key: 'allergic', dictCode: 'allergic' },
     { key: 'allergic_food', dictCode: 'allergic_food' },
     { key: 'allergic_touch', dictCode: 'allergic_touch' },
     { key: 'allergic_air', dictCode: 'allergic_air' },
     { key: 'allergic_inject', dictCode: 'allergic_inject' },
-    { key: 'dh_contagious_status', dictCode: 'dh_contagious_status' },
+    { key: 'contagious_status', dictCode: 'contagious_status' },
     { key: 'pb_epidemic', dictCode: 'pb_epidemic' },
-    { key: 'dh_complications', dictCode: 'dh_complications' },
+    { key: 'complications', dictCode: 'complications' },
     { key: 'complications_breath', dictCode: 'complications_breath' },
     { key: 'complications_blood', dictCode: 'complications_blood' },
     { key: 'complications_incretion', dictCode: 'complications_incretion' },
-    { key: 'dh_clinic', dictCode: 'dh_clinic' },
+    { key: 'clinic', dictCode: 'clinic' },
     { key: 'clinic_breath', dictCode: 'clinic_breath' },
     { key: 'clinic_heart', dictCode: 'clinic_heart' },
     { key: 'clinic_blood', dictCode: 'clinic_blood' },
     { key: 'clinic_hbgr', dictCode: 'clinic_hbgr' },
-    { key: 'dh_pathological', dictCode: 'dh_pathological' },
+    { key: 'pathological', dictCode: 'pathological' },
     { key: 'pathological_breath', dictCode: 'pathological_breath' },
     { key: 'pathological_heart', dictCode: 'pathological_heart' },
     { key: 'pathological_blood', dictCode: 'pathological_blood' },
     { key: 'pathological_hbgr', dictCode: 'pathological_hbgr' },
-    { key: 'dh_ckd', dictCode: 'dh_ckd' },
+    { key: 'ckd', dictCode: 'ckd' },
     { key: 'ckd_breath', dictCode: 'ckd_breath' },
     { key: 'ckd_heart', dictCode: 'ckd_heart' },
     { key: 'ckd_blood', dictCode: 'ckd_blood' },
@@ -211,14 +198,14 @@
           if (i == DiagnosisEnum.allergic_field) {
             detail.push({
               label: '过敏原/名称',
-              value: formatDictValue(bizDictOptions.dh_allergic, ele.contentType),
+              value: formatDictValue(bizDictOptions.allergic, ele.contentType),
               tags: ele.multiName.map(mEle => {
                 return {
                   id: nanoid(),
                   label: formatDictValue(bizDictOptions[ele.contentType], mEle),
                   // type: 'warning',
-                  fontColor: formatDictFontColor(bizDictOptions.dh_allergic, ele.contentType),
-                  bgColor: formatDictColor(bizDictOptions.dh_allergic, ele.contentType),
+                  fontColor: formatDictFontColor(bizDictOptions.allergic, ele.contentType),
+                  bgColor: formatDictColor(bizDictOptions.allergic, ele.contentType),
                 };
               }),
             });
@@ -234,10 +221,10 @@
               tags: [
                 {
                   id: nanoid(),
-                  label: formatDictValue(bizDictOptions.dh_contagious_status, ele.status),
+                  label: formatDictValue(bizDictOptions.contagious, ele.status),
                   // type: ele.status == 'contagious_status_stop' ? 'muted' : 'error',
-                  fontColor: formatDictFontColor(bizDictOptions.dh_contagious_status, ele.status),
-                  bgColor: formatDictColor(bizDictOptions.dh_contagious_status, ele.status),
+                  fontColor: formatDictFontColor(bizDictOptions.contagious, ele.status),
+                  bgColor: formatDictColor(bizDictOptions.contagious, ele.status),
                 },
               ],
             });
@@ -266,13 +253,13 @@
     for (const i in resMulti) {
       // console.log('resMulti ', i, resMulti[i]);
       if (i == DiagnosisEnum.complications_field) {
-        setMultiData(i, resMulti[i], 'dh_complications');
+        setMultiData(i, resMulti[i], 'complications');
       } else if (i == DiagnosisEnum.clinic_field) {
-        setMultiData(i, resMulti[i], 'dh_clinic');
+        setMultiData(i, resMulti[i], 'clinic');
       } else if (i == DiagnosisEnum.pathological_field) {
-        setMultiData(i, resMulti[i], 'dh_pathological');
+        setMultiData(i, resMulti[i], 'pathological');
       } else if (i == DiagnosisEnum.ckd_field) {
-        setMultiData(i, resMulti[i], 'dh_ckd');
+        setMultiData(i, resMulti[i], 'ckd');
       } else {
         setMultiData(i, resMulti[i], '', '诊断结果');
       }
@@ -325,14 +312,23 @@
   function callEdit(data) {
     console.log('🚀 ~ file: index.vue:181 ~ callEdit ~ data:', data);
     // openModal(true, singleData.value[data.type]);
+    console.log('...originSingleData.value[data.type]', originSingleData.value[data.type]);
+    let modelData = {} as any;
+    if (originSingleData.value[data.type] == null) {
+      modelData = {
+        updatorName: useUser.getUserInfo.nickname,
+        content: [],
+      };
+    } else {
+      modelData = originSingleData.value[data.type];
+    }
     openModal(true, {
-      ...originSingleData.value[data.type],
+      ...modelData,
       title: singleData.value[data.type]?.title,
-      dictOptions:
-        bizDictOptions[
-          data.type == DiagnosisEnum.contagious_field ? 'dh_contagious_status' : `dh_${data.type}`
-        ],
+      dictOptions: bizDictOptions[data.type],
+      type: data.type,
       patientBasicId: props.info?.id,
+      id: modelData.content.length ? nanoid(5) : '',
       isSingle: true,
     });
   }
@@ -346,10 +342,7 @@
       ...filterData,
       title: multiData.value[data.type]?.title,
       id: data.data.id,
-      dictOptions:
-        bizDictOptions[
-          data.type == DiagnosisEnum.contagious_field ? 'dh_contagious_status' : `dh_${data.type}`
-        ],
+      dictOptions: bizDictOptions[data.type],
       patientBasicId: props.info?.id,
       isSingle: false,
     });
@@ -378,10 +371,7 @@
       multiContent: [],
       title: multiData.value[data.type]?.title,
       id: '',
-      dictOptions:
-        bizDictOptions[
-          data.type == DiagnosisEnum.contagious_field ? 'dh_contagious_status' : `dh_${data.type}`
-        ],
+      dictOptions: bizDictOptions[data.type],
       patientBasicId: props.info?.id,
       isSingle: false,
     });

+ 158 - 31
src/views/biz/archives/formula/FormDrawer.vue

@@ -8,26 +8,67 @@
     @ok="handleSubmit"
     :showFooter="true"
   >
-    <BasicForm @register="registerForm" layout="vertical" class="!px-6 !pt-4" />
+    <BasicForm
+      @register="registerForm"
+      layout="vertical"
+      class="!px-6 !pt-4"
+      @field-value-change="callFormFieldChange"
+    >
+      <template #suppliesTemplate>
+        <div>
+          <a-button type="primary" shape="round" @click="handleAdd">
+            <template #icon>
+              <PlusOutlined />
+            </template>
+            添加
+          </a-button>
+          <div class="w-full mt-2">
+            <BasicTable @register="registerTable">
+              <template #bodyCell="{ column, record }">
+                <template v-if="column.key === 'action'">
+                  <TableAction
+                    :actions="[
+                      {
+                        auth: 'archives:diagnosisHistory:edit',
+                        icon: 'icon-xt-details_delete_default|iconfont',
+                        tooltip: '删除',
+                        popConfirm: {
+                          title: '是否取消删除',
+                          placement: 'left',
+                          confirm: handleDel.bind(null, record, column),
+                        },
+                      },
+                    ]"
+                  />
+                </template>
+              </template>
+            </BasicTable>
+          </div>
+        </div>
+      </template>
+    </BasicForm>
+    <FormDrawerHistory @register="registerDrawerHistory" />
   </BasicDrawer>
 </template>
 <script lang="ts" setup>
-  import { ref, reactive, unref } from 'vue';
-  import { BasicDrawer, useDrawerInner } from '/@/components/Drawer';
+  import { ref, reactive, unref, nextTick } from 'vue';
+  import { BasicDrawer, useDrawer, useDrawerInner } from '/@/components/Drawer';
   import { BasicForm, useForm } from '/@/components/Form';
   import { useMessage } from '/@/hooks/web/useMessage';
-  import { dataFormSchemaVascularAccess } from './data';
-  import {
-    archivesVascularAccessDetail,
-    archivesVascularAccessEdit,
-    archivesVascularAccessAdd,
-  } from '/@/api/biz/archives/vascularAccessApi';
+  import { columnsDrawer, dataFormSchema } from './data';
   import { listDictModel } from '/@/api/common';
-  import { formatDictValue } from '/@/utils';
-
+  import { PlusOutlined } from '@ant-design/icons-vue';
+  import { BasicTable, useTable, TableAction } from '@/components/Table';
+  import { nanoid } from 'nanoid';
+  import {
+    archivesFormulaTemplateAdd,
+    archivesFormulaTemplateDetail,
+    archivesFormulaTemplateEdit,
+  } from '@/api/biz/archives/formulaTemplateApi';
+  import FormDrawerHistory from './FormDrawerHistory.vue';
   const emit = defineEmits(['success', 'register']);
 
-  const getTitle = ref(`血管通路`);
+  const getTitle = ref('透析处方');
   const width = '70%';
   const isUpdate = ref(false);
   const rowId = ref();
@@ -35,40 +76,80 @@
   const bizDictOptions = reactive({
     accessType: [],
   });
-  const accessType = ref();
+  // 表格数据
+  const tableData = ref([]);
 
   const { createMessage } = useMessage();
-  const [registerForm, { setFieldsValue, resetFields, validate }] = useForm({
-    schemas: dataFormSchemaVascularAccess,
+  const [registerDrawerHistory, { openDrawer }] = useDrawer();
+
+  const [registerForm, { setFieldsValue, resetFields, validate, updateSchema }] = useForm({
+    schemas: dataFormSchema,
     showActionButtonGroup: false,
     baseColProps: {
       span: 6,
     },
   });
+  const [registerTable, { setTableData, getDataSource }] = useTable({
+    rowKey: 'id',
+    showIndexColumn: false,
+    bordered: true,
+    striped: false,
+    pagination: false,
+    maxHeight: 200,
+    actionColumn: {
+      width: 80,
+      title: '操作',
+      dataIndex: 'action',
+    },
+    dataSource: tableData.value,
+    columns: columnsDrawer,
+  });
   const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async data => {
     console.log('🚀 ~ file: FormDrawer.vue:49 ~ data:', data);
     await resetFields();
     setDrawerProps({ confirmLoading: false });
+    isUpdate.value = data?.isUpdate;
+    getTitle.value = `${isUpdate.value ? '编辑透析处方模板' : '新建透析处方模板'} ( ${
+      data.record.name
+    } | ${data.record.gender} | ${data.record.age}岁 )`;
     bizDictOptions.accessType = await listDictModel({ dictCode: 'va_type' });
-    isUpdate.value = !!data?.isUpdate;
-    patientBasicId.value = data.record.id;
+    patientBasicId.value = data.record.patientBasicId;
+    rowId.value = data.record?.id;
     if (unref(isUpdate)) {
-      const resData = await archivesVascularAccessDetail(patientBasicId.value);
-      rowId.value = resData.id;
-      resData.accessType = resData.type;
-      accessType.value = formatDictValue(bizDictOptions.accessType, resData.type);
+      const resData = await archivesFormulaTemplateDetail(rowId.value);
+      if (resData.suppliesTemplate) {
+        tableData.value = resData.suppliesTemplate.map(ele => {
+          return {
+            name: ele.name,
+            typeName: ele.typeName,
+            count: ele.count,
+          };
+        });
+        await nextTick();
+        await setTableData(tableData.value);
+      }
+      // delete resData.suppliesTemplate;
+      // console.log('🚀 ~ file: FormDrawer.vue:119 ~ resData:', resData);
+      // const fieldData = resData.
       await setFieldsValue({
         ...resData,
       });
-    } else {
-      accessType.value = formatDictValue(bizDictOptions.accessType, data.record.accessType);
-      await setFieldsValue({
-        accessType: data.record.accessType,
-      });
+      if (resData.dialysisType) {
+        updateSchema({
+          // label: '透析模式',
+          field: 'dialysisType',
+          // required: true,
+          // component: 'ApiSelect',
+          componentProps: {
+            disabled: true,
+            // api: listDictModel,
+            // params: {
+            //   dictCode: 'dt',
+            // },
+          },
+        });
+      }
     }
-    getTitle.value = `${isUpdate.value ? '编辑' : '新建'}${accessType.value}   ( ${
-      data.record.name
-    } | ${data.record.gender} | ${data.record.age}岁 )`;
   });
 
   // 提交按钮事件
@@ -78,8 +159,8 @@
       setDrawerProps({ confirmLoading: true });
       values.patientBasicId = patientBasicId.value;
       !unref(isUpdate)
-        ? await archivesVascularAccessAdd({ ...values })
-        : await archivesVascularAccessEdit({ ...values, id: rowId.value });
+        ? await archivesFormulaTemplateAdd({ ...values })
+        : await archivesFormulaTemplateEdit({ ...values, id: rowId.value });
       !unref(isUpdate) ? createMessage.success('新增成功!') : createMessage.success('编辑成功!');
       closeDrawer();
       emit('success', {
@@ -90,4 +171,50 @@
       setDrawerProps({ confirmLoading: false });
     }
   }
+
+  async function handleAdd() {
+    console.log('添加');
+    tableData.value.push({
+      typeId: '',
+      name: '',
+      nanoid: nanoid(5),
+    });
+    console.log(
+      '🚀 ~ file: FormModal.vue:135 ~ handleAdd ~ tableDataAllergic.value:',
+      tableData.value,
+    );
+    await nextTick();
+    await setTableData(tableData.value);
+  }
+  function handleDel(record) {
+    console.log('删除');
+    const data = getDataSource();
+    const index = data.findIndex(item => item.id === record.id);
+    tableData.value.splice(index, 1);
+    setTableData(tableData.value);
+  }
+  function callFormFieldChange(key) {
+    console.log('🚀 ~ file: FormDrawer.vue:169 ~ callFormFieldChange ~ key:', key);
+    if (key == 'vitals') {
+      console.log('打开体征历史数据');
+      openDrawer(true, {
+        record: {
+          patientBasicId: patientBasicId.value,
+        },
+      });
+    }
+  }
 </script>
+<style lang="less" scoped>
+  ::v-deep(.ant-table-body) {
+    height: 200px !important;
+  }
+
+  ::v-deep(label[for='form_item_suppliesTemplate']) {
+    display: none;
+  }
+
+  ::v-deep(.ant-btn-link) {
+    color: rgb(61 65 85 / 100%);
+  }
+</style>

+ 146 - 0
src/views/biz/archives/formula/FormDrawerHistory.vue

@@ -0,0 +1,146 @@
+<template>
+  <BasicDrawer
+    v-bind="$attrs"
+    destroyOnClose
+    @register="registerDrawer"
+    :title="getTitle"
+    :width="width"
+    :showFooter="false"
+  >
+    <div class="w-full mt-2">
+      <XTForm :form-data="formData" @change="callForm" />
+      <div class="my-2">
+        <ChartsCard
+          title="透前血压趋势"
+          :has-safe="false"
+          :colors="chartData.colors"
+          height="200px"
+          :date-data="chartData.dateData"
+          :info-data="chartData.infoData"
+        />
+      </div>
+      <BasicTable @register="registerTable" />
+    </div>
+  </BasicDrawer>
+</template>
+<script lang="ts" setup>
+  import { ref, reactive, nextTick } from 'vue';
+  import { BasicDrawer, useDrawerInner } from '/@/components/Drawer';
+  import { columnsHistory } from './data';
+  import { BasicTable, useTable } from '@/components/Table';
+  import { archivesVitalsHistoryQueryList } from '@/api/biz/archives/vitalsHistoryApi';
+  import ChartsCard from '/@/components/XTCard/src/ChartsCard.vue';
+  import { XTForm } from '/@/components/XTForm/index';
+
+  import dayjs from 'dayjs';
+  const getTitle = ref('体征历史数据');
+  const width = '70%';
+  const patientBasicId = ref();
+  const createTime = ref([
+    dayjs().subtract(3, 'month').format('YYYY-MM-DD'),
+    dayjs().format('YYYY-MM-DD'),
+  ]);
+  // 表格数据
+  const tableData = ref([]);
+  const formData = [
+    {
+      name: 'createTime',
+      label: '记录日期',
+      componentType: 'RangePicker',
+      placeholder: '请选择',
+      format: 'YYYY-MM-DD',
+      valueFormat: 'YYYY-MM-DD',
+      defaultValue: [
+        dayjs().subtract(3, 'month').format('YYYY-MM-DD'),
+        dayjs().format('YYYY-MM-DD'),
+      ],
+    },
+  ];
+  const chartData = reactive({
+    colors: [
+      {
+        color: 'rgba(33, 201, 153, 1)',
+        label: '透前血压 (mmHg)',
+        dot: 'rgba(33, 201, 153, 1)',
+      },
+    ],
+    infoData: [],
+    dateData: [],
+  });
+
+  const [registerTable, { setTableData }] = useTable({
+    rowKey: 'id',
+    showIndexColumn: false,
+    bordered: true,
+    striped: false,
+    pagination: false,
+    maxHeight: 200,
+    dataSource: tableData.value,
+    columns: columnsHistory,
+  });
+  const [registerDrawer, { setDrawerProps }] = useDrawerInner(async data => {
+    console.log('🚀 ~ file: FormDrawer.vue:49 ~ data:', data);
+    setDrawerProps({ confirmLoading: false });
+    patientBasicId.value = data.record.patientBasicId;
+    await getData();
+  });
+
+  async function getData() {
+    const resData = await archivesVitalsHistoryQueryList({
+      createTime: createTime.value,
+      patientBasicId: patientBasicId.value,
+    });
+    // 折线图
+    chartData.dateData = resData.map(ele => {
+      return ele.dialysisTime ? dayjs(ele.dialysisTime).format('YYYY-MM-DD') : '';
+    });
+    chartData.infoData = resData.map(ele => {
+      return ele.preBloodPressure;
+    });
+    tableData.value = resData;
+    await nextTick();
+    await setTableData(tableData.value);
+  }
+
+  async function callForm(data) {
+    console.log('🚀 ~ file: FormDrawerHistory.vue:100 ~ callForm ~ data:', data);
+    createTime.value = data.createTime;
+    await getData();
+  }
+</script>
+<style lang="less" scoped>
+  ::v-deep(.ant-table-body) {
+    height: 500px !important;
+  }
+
+  ::v-deep(.ant-table-tbody > tr > td) {
+    border-right: 0 !important;
+    border-left: 0 !important;
+    border-bottom: 1px solid #f0f0f0;
+  }
+
+  ::v-deep(.ant-table-wrapper table) {
+    border: 0;
+  }
+
+  ::v-deep(.ant-table-cell-fix-right-first::after, .ant-table-cell-fix-right-last::after) {
+    content: '';
+    top: auto;
+    width: 0;
+  }
+
+  ::v-deep(.ant-input) {
+    border-color: #c2ccd4;
+    border-radius: 4px;
+  }
+
+  ::v-deep(.ant-input-affix-wrapper) {
+    border-color: #c2ccd4;
+    border-radius: 4px;
+  }
+
+  ::v-deep(.ant-picker) {
+    border-color: #c2ccd4 !important;
+    border-radius: 4px;
+  }
+</style>

+ 247 - 17
src/views/biz/archives/formula/data.ts

@@ -1,11 +1,71 @@
 import { FormSchema } from '@/components/Form';
 import { listDictModel } from '/@/api/common';
+import { BasicColumn } from '@/components/Table';
 
-// 通路转归 Form 表单
-export const dataFormSchemaVascularAccess: FormSchema[] = [
+// 抽屉 Table 表格
+export const columnsDrawer: BasicColumn[] = [
+  {
+    title: '类型',
+    dataIndex: 'typeName',
+    edit: true,
+    editable: true,
+    editComponent: 'Input',
+    editRule: true,
+    width: 150,
+    // editComponent: 'ApiSelect',
+    // editComponentProps: ({ record }) => {
+    //   return {
+    //     api: listDictModel,
+    //     params: {
+    //       dictCode: 'dh_allergic',
+    //     },
+    //     showSearch: true,
+    //     placeholder: '请选择',
+    //     getPopupContainer: () => document.body,
+    //   };
+    // },
+  },
+  {
+    title: '名称',
+    dataIndex: 'name',
+    edit: true,
+    editable: true,
+    editComponent: 'Input',
+    editRule: true,
+    width: 150,
+    // editComponent: 'ApiSelect',
+    // // 默认必填校验
+    // editRule: true,
+    // editComponentProps: ({ record }) => {
+    //   // console.log('🚀 ~ file: data.ts:103 ~ record:', record);
+    //   return {
+    //     api: listDictModel,
+    //     params: {
+    //       dictCode: 'dh_allergic',
+    //     },
+    //     placeholder: '请选择',
+    //   };
+    // },
+  },
+  {
+    title: '数量',
+    dataIndex: 'count',
+    width: 200,
+    edit: true,
+    editable: true,
+    editComponent: 'InputNumber',
+    // 默认必填校验
+    editRule: true,
+    editComponentProps: {
+      placeholder: '请输入',
+    },
+  },
+];
+// 抽屉 Form 表单
+export const dataFormSchema: FormSchema[] = [
   {
     label: '血管通路',
-    field: 'puncture',
+    field: 'vascularAccess',
     required: true,
     component: 'ApiSelect',
     componentProps: {
@@ -17,7 +77,7 @@ export const dataFormSchemaVascularAccess: FormSchema[] = [
   },
   {
     label: '透析模式',
-    field: 'puncture',
+    field: 'dialysisType',
     required: true,
     component: 'ApiSelect',
     componentProps: {
@@ -29,7 +89,7 @@ export const dataFormSchemaVascularAccess: FormSchema[] = [
   },
   {
     label: '制定日期',
-    field: 'setUpTime',
+    field: 'enactedTime',
     required: true,
     component: 'DatePicker',
     componentProps: {
@@ -37,39 +97,44 @@ export const dataFormSchemaVascularAccess: FormSchema[] = [
     },
   },
   {
-    field: 'PlainTitle',
+    field: 'vitals',
     component: 'PlainTitle',
     defaultValue: '体征',
+    subLabel: '查看历史',
+    subLabelColor: 'rgba(0, 109, 255, 1)',
     colProps: {
       span: 24,
     },
   },
   {
     label: '干体重 (kg)',
-    field: 'tizhong',
+    field: 'vitals.dryWeight',
     component: 'InputNumber',
     componentProps: {
       placeholder: '请输入干体重',
+      step: '0.01',
     },
   },
   {
-    label: 'CH值 (kg)',
-    field: 'tizhong',
+    label: 'OH值 (kg)',
+    field: 'vitals.oh',
     component: 'InputNumber',
     componentProps: {
       placeholder: '请输入干体重',
+      step: '0.01',
     },
   },
   {
     label: 'V值 (kg)',
-    field: 'tizhong',
+    field: 'vitals.v',
     component: 'InputNumber',
     componentProps: {
       placeholder: '请输入干体重',
+      step: '0.01',
     },
   },
   {
-    field: 'PlainTitle',
+    field: 'anticoagulant',
     component: 'PlainTitle',
     defaultValue: '抗凝',
     colProps: {
@@ -78,7 +143,7 @@ export const dataFormSchemaVascularAccess: FormSchema[] = [
   },
   {
     label: '抗凝方式',
-    field: 'tizhong',
+    field: 'anticoagulant.type',
     component: 'InputNumber',
     componentProps: {
       placeholder: '请输入抗凝方式',
@@ -88,7 +153,7 @@ export const dataFormSchemaVascularAccess: FormSchema[] = [
     },
   },
   {
-    field: 'idCard',
+    field: 'anticoagulant.firstDose',
     label: '首剂',
     component: 'ApiInputDict',
     componentProps: ({ formModel }) => {
@@ -101,21 +166,22 @@ export const dataFormSchemaVascularAccess: FormSchema[] = [
         },
         onChange: e => {
           console.log('🚀 ~ file: data.ts:81 ~ e:', e);
-          return (formModel['idCard'] = e);
+          return (formModel['firstDose'] = e);
         },
       };
     },
   },
   {
     label: '追加 (mg)',
-    field: 'tizhong',
+    field: 'anticoagulant.appendDose',
     component: 'InputNumber',
     componentProps: {
       placeholder: '请输入追加',
+      step: '0.01',
     },
   },
   {
-    field: 'PlainTitle',
+    field: 'suppliesTemplateTitle',
     component: 'PlainTitle',
     defaultValue: '耗材',
     colProps: {
@@ -123,11 +189,175 @@ export const dataFormSchemaVascularAccess: FormSchema[] = [
     },
   },
   {
-    field: 'PlainTitle',
+    field: 'suppliesTemplate',
+    component: 'PlainText',
+    slot: 'suppliesTemplate',
+    labelClass: 'hidden',
+    colProps: {
+      span: 24,
+    },
+  },
+  {
+    field: 'dialysisParam11',
     component: 'PlainTitle',
     defaultValue: '透析参数',
     colProps: {
       span: 24,
     },
   },
+  {
+    label: '透析时长 (h)',
+    field: 'dialysisParam.dialysisTime',
+    component: 'InputNumber',
+    componentProps: {
+      placeholder: '请输入',
+      step: '0.01',
+    },
+  },
+  {
+    label: '流量 (ml/min)',
+    field: 'dialysisParam.flowRate',
+    component: 'InputNumber',
+    componentProps: {
+      placeholder: '请输入',
+      step: '0.01',
+    },
+  },
+  {
+    label: '湿度 (℃)',
+    field: 'dialysisParam.temperature',
+    component: 'InputNumber',
+    componentProps: {
+      placeholder: '请输入',
+      step: '0.01',
+    },
+  },
+  {
+    label: '血流量 (ml/min)',
+    field: 'dialysisParam.bloodFlow',
+    component: 'InputNumber',
+    componentProps: {
+      placeholder: '请输入',
+      step: '0.01',
+    },
+  },
+  {
+    label: 'K (mmolL)',
+    field: 'dialysisParam.k',
+    component: 'InputNumber',
+    componentProps: {
+      placeholder: '请输入',
+      step: '0.01',
+    },
+  },
+  {
+    label: 'Na (mmolL)',
+    field: 'dialysisParam.na',
+    component: 'InputNumber',
+    componentProps: {
+      placeholder: '请输入',
+      step: '0.01',
+    },
+  },
+  {
+    label: 'Ca (mmolL)',
+    field: 'dialysisParam.ca',
+    component: 'InputNumber',
+    componentProps: {
+      placeholder: '请输入',
+      step: '0.01',
+    },
+  },
+  {
+    label: '碳酸氢根 (mmolL)',
+    field: 'dialysisParam.hco',
+    component: 'InputNumber',
+    componentProps: {
+      placeholder: '请输入',
+      step: '0.01',
+    },
+  },
+  {
+    label: 'Mg (mmolL)',
+    field: 'dialysisParam.mg',
+    component: 'InputNumber',
+    componentProps: {
+      placeholder: '请输入',
+      step: '0.01',
+    },
+  },
+  {
+    label: 'Cl (mmolL)',
+    field: 'dialysisParam.cl',
+    component: 'InputNumber',
+    componentProps: {
+      placeholder: '请输入',
+      step: '0.01',
+    },
+  },
+  {
+    label: '葡萄糖 (mmolL)',
+    field: 'dialysisParam.glucose',
+    component: 'InputNumber',
+    componentProps: {
+      placeholder: '请输入',
+      step: '0.01',
+    },
+  },
+  {
+    label: '置换液',
+    field: 'dialysisParam.dsplacementFluid',
+    component: 'Input',
+    componentProps: {
+      placeholder: '请输入',
+    },
+    ifShow: ({ values }) => {
+      return values.dialysisType == 'dt_hd_crrt';
+    },
+  },
+  {
+    label: '稀释方式',
+    field: 'dialysisParam.dilute',
+    component: 'Input',
+    componentProps: {
+      placeholder: '请输入',
+    },
+    ifShow: ({ values }) => {
+      return values.dialysisType == 'dt_hd_crrt';
+    },
+  },
+];
+
+// 抽屉 History Table 表格
+export const columnsHistory: BasicColumn[] = [
+  {
+    title: '时间',
+    dataIndex: 'dialysisTime',
+    align: 'left',
+  },
+  {
+    title: '透前血压(mmHg)',
+    dataIndex: 'preBloodPressure',
+    align: 'left',
+  },
+  {
+    title: '透前体重(kg)',
+    dataIndex: 'preWeight',
+    align: 'left',
+  },
+  {
+    title: '透后体重(kg)',
+    dataIndex: 'postWeight',
+    align: 'left',
+  },
+  {
+    title: '干体重(kg)',
+    dataIndex: 'dryWeight',
+    align: 'left',
+  },
+  {
+    title: '实际超滤量(kg)',
+    dataIndex: 'actualUltrafiltration',
+    align: 'left',
+  },
 ];

+ 37 - 25
src/views/biz/archives/formula/index.vue

@@ -60,29 +60,30 @@
     console.log('🚀 ~ file: index.vue:105 ~ getData ~ res:', res);
     timeLineData.value = res.map(ele => {
       const innerData = {
+        id: ele.id,
         title: '基本信息',
         icon: 'icon-xt-edit_default',
         type: 'basic',
         data: [
           { field: 'vascularAccess', label: '血管通路', value: '', dict: true },
-          { field: 'setUpHospital', label: '干体重 (kg)', value: '' },
-          { field: 'setUpHospital', label: 'CH值 (kg)', value: '' },
-          { field: 'setUpHospital', label: 'V值 (kg)', value: '' },
-          { field: 'setUpHospital', label: '首剂 (mg)', value: '' },
-          { field: 'setUpHospital', label: '追加 (mg)', value: '' },
-          { field: 'setUpHospital', label: '抗凝方式', value: '', span: 12 },
-          { field: 'setUpHospital', label: '耗材使用', value: '', span: 24 },
-          { field: 'setUpHospital', label: '透析时长 (h)', value: '' },
-          { field: 'setUpHospital', label: '流量 (ml/min)', value: '' },
-          { field: 'setUpHospital', label: '湿度 (℃)', value: '' },
-          { field: 'setUpHospital', label: '血流量 (ml/min)', value: '' },
-          { field: 'setUpHospital', label: 'K (mmolL)', value: '' },
-          { field: 'setUpHospital', label: 'Na (mmolL)', value: '' },
-          { field: 'setUpHospital', label: 'Ca (mmolL)', value: '' },
-          { field: 'setUpHospital', label: '碳酸氢根 (mmolL)', value: '' },
-          { field: 'setUpHospital', label: 'Mg (mmolL)', value: '' },
-          { field: 'setUpHospital', label: 'Cl (mmolL)', value: '' },
-          { field: 'setUpHospital', label: '葡萄糖 (mmolL)', value: '' },
+          { field: 'dryWeight', label: '干体重 (kg)', value: '', prefix: 'vitals' },
+          { field: 'oh', label: 'OH值 (kg)', value: '', prefix: 'vitals' },
+          { field: 'v', label: 'V值 (kg)', value: '', prefix: 'vitals' },
+          { field: 'firstDose', label: '首剂 (mg)', value: '', prefix: 'anticoagulant' },
+          { field: 'appendDose', label: '追加 (mg)', value: '', prefix: 'anticoagulant' },
+          { field: 'type', label: '抗凝方式', value: '', span: 12, prefix: 'anticoagulant' },
+          { field: 'suppliesTemplate', label: '耗材使用', value: '', span: 24 },
+          { field: 'dialysisTime', label: '透析时长 (h)', value: '', prefix: 'dialysisParam' },
+          { field: 'flowRate', label: '流量 (ml/min)', value: '', prefix: 'dialysisParam' },
+          { field: 'temperature', label: '湿度 (℃)', value: '', prefix: 'dialysisParam' },
+          { field: 'bloodFlow', label: '血流量 (ml/min)', value: '', prefix: 'dialysisParam' },
+          { field: 'k', label: 'K (mmolL)', value: '', prefix: 'dialysisParam' },
+          { field: 'na', label: 'Na (mmolL)', value: '', prefix: 'dialysisParam' },
+          { field: 'ca', label: 'Ca (mmolL)', value: '', prefix: 'dialysisParam' },
+          { field: 'hco', label: '碳酸氢根 (mmolL)', value: '', prefix: 'dialysisParam' },
+          { field: 'mg', label: 'Mg (mmolL)', value: '', prefix: 'dialysisParam' },
+          { field: 'cl', label: 'Cl (mmolL)', value: '', prefix: 'dialysisParam' },
+          { field: 'glucose', label: '葡萄糖 (mmolL)', value: '', prefix: 'dialysisParam' },
         ],
       };
       innerData.title = formatDictValue(bizDictOptions.dt, ele.dialysisType);
@@ -95,16 +96,19 @@
           } else {
             eleC.value = formatDictValue(bizDictOptions[eleC.field], ele[eleC.field]);
           }
+        } else if (eleC.prefix) {
+          eleC.value = ele[eleC.prefix][eleC.field];
+        } else if (eleC.field == 'suppliesTemplate') {
+          eleC.value = ele[eleC.field]
+            ?.map(eleS => {
+              return `${eleS.name}-${eleS.type ? eleS.type + '-' : ''}${eleS.count}个`;
+            })
+            .join('; ');
         } else {
           eleC.value = ele[eleC.field];
         }
-        // if (ele.type == 'va_avf' || ele.type == 'va_avg') {
-        //   // 置管引导
-        //   eleC.hidden = eleC.field == 'catheterGuidance' ? true : false;
-        // }
         return eleC;
       });
-      // console.log('🚀 ~ file: index.vue:168 ~ getData ~ cnt:', innerData);
       return {
         id: ele.id,
         dot: ele.updatorName,
@@ -116,8 +120,12 @@
   }
   function handleAdd(data) {
     console.log('🚀 ~ file: index.vue:205 ~ handleAdd ~ data:', data);
+    const info = {
+      ...props.info,
+      patientBasicId: props.info.id,
+    };
     openDrawer(true, {
-      record: { ...props.info, accessType: data },
+      record: { ...info },
     });
   }
   onUnmounted(() => {
@@ -131,9 +139,13 @@
     timeOuter.value = true;
   }
   function callIcon(data) {
+    const info = {
+      ...props.info,
+      patientBasicId: props.info.id,
+    };
     openDrawer(true, {
       isUpdate: true,
-      record: { ...props.info, ...data },
+      record: { ...info, ...data },
     });
   }
 </script>

+ 16 - 3
src/views/biz/archives/index/data.ts

@@ -16,7 +16,7 @@ export const BasicTab = [
     value: 12,
     hasValue: true,
     prefixColor: '#1BC1B3',
-    valueColor: 'red',
+    // valueColor: 'red',
     hasBracket: true,
   },
   {
@@ -24,7 +24,7 @@ export const BasicTab = [
     label: '无处方',
     value: 18,
     hasValue: true,
-    prefixColor: '#854AFF',
+    prefixColor: '#D3D8DD',
     hasBracket: true,
   },
   {
@@ -32,7 +32,7 @@ export const BasicTab = [
     label: '阳性',
     value: 18,
     hasValue: true,
-    prefixColor: '#854AFF',
+    prefixColor: '#F7B500',
     hasBracket: true,
   },
 ];
@@ -118,54 +118,67 @@ export const columns: BasicColumn[] = [
   {
     title: '编号',
     dataIndex: 'uniqueNo',
+    align: 'left',
   },
   {
     title: '姓名',
     dataIndex: 'name',
+    align: 'left',
   },
   {
     title: '性别',
     dataIndex: 'gender',
+    align: 'left',
   },
   {
     title: '出生日期',
     dataIndex: 'birthday',
+    align: 'left',
   },
   {
     title: '年龄',
     dataIndex: 'age',
+    align: 'left',
   },
   {
     title: '身高(cm)',
     dataIndex: 'height',
+    align: 'left',
   },
   {
     title: '建档时间',
     dataIndex: 'createTime',
+    align: 'left',
     width: 180,
   },
   {
     title: '类型',
     dataIndex: 'type',
+    align: 'left',
   },
   {
     title: '首次透析日期',
     dataIndex: 'firstDialysisTime',
+    align: 'left',
   },
   {
     title: '首次透析方式',
     dataIndex: 'firstDialysisType',
+    align: 'left',
   },
   {
     title: '当前血管通路',
     dataIndex: 'vascularAccess',
+    align: 'left',
   },
   {
     title: '传染标识',
     dataIndex: 'infectiousDiseases',
+    align: 'left',
   },
   {
     title: '转归',
     dataIndex: 'patientReturn',
+    align: 'left',
   },
 ];

+ 50 - 6
src/views/biz/archives/index/index.vue

@@ -17,22 +17,44 @@
       </div>
       <BasicTable @register="registerTable">
         <template #bodyCell="{ column, record }">
+          <template v-if="column.key === 'name'">
+            <span :class="['table-dot', 'table-dot--' + record.status]" />
+            <span>{{ record.name }}</span>
+          </template>
           <template v-if="column.key === 'birthday'">
-            {{ dayjs(record.birthday).format('YYYY-MM-DD') }}
+            {{ record.birthday ? dayjs(record.birthday).format('YYYY-MM-DD') : '' }}
           </template>
           <template v-if="column.key === 'firstDialysisTime'">
-            {{ dayjs(record.firstDialysisTime).format('YYYY-MM-DD') || '' }}
+            {{
+              record.firstDialysisTime ? dayjs(record.firstDialysisTime).format('YYYY-MM-DD') : ''
+            }}
           </template>
           <template v-if="column.key === 'gender'">
             {{ formatDictValue(bizDictOptions.gender, record.gender) }}
           </template>
+          <template v-if="column.key === 'firstDialysisType'">
+            {{ formatDictValue(bizDictOptions.firstDialysisType, record.firstDialysisType) }}
+          </template>
           <template v-if="column.key === 'type'">
             {{ formatDictValue(bizDictOptions.type, record.type) }}
           </template>
           <template v-if="column.key === 'infectiousDiseases'">
-            <div>
+            <span
+              :style="{
+                backgroundColor: formatDictColor(
+                  bizDictOptions.infectiousDiseases,
+                  record.infectiousDiseases,
+                ),
+                color: formatDictFontColor(
+                  bizDictOptions.infectiousDiseases,
+                  record.infectiousDiseases,
+                ),
+                padding: '1px 4px',
+                borderRadius: '6px',
+              }"
+            >
               {{ formatDictValue(bizDictOptions.infectiousDiseases, record.infectiousDiseases) }}
-            </div>
+            </span>
           </template>
           <template v-if="column.key === 'vascularAccess'">
             {{ formatDictValue(bizDictOptions.vascularAccess, record.vascularAccess) }}
@@ -75,7 +97,7 @@
     archivesPatientBasicStats,
   } from '/@/api/biz/archives/patientBasicApi';
   import { listDictModelBatch } from '@/api/common';
-  import { formatDictValue } from '/@/utils';
+  import { formatDictColor, formatDictFontColor, formatDictValue } from '/@/utils';
   import { onMounted, reactive } from 'vue';
   import dayjs from 'dayjs';
   import { useModal } from '/@/components/Modal';
@@ -98,6 +120,8 @@
     { key: 'vascularAccess', dictCode: 'va_type' },
     // 转归原因
     { key: 'return', dictCode: 'va_return' },
+    // 首次透析方式
+    { key: 'firstDialysisType', dictCode: 'dt' },
   ]);
   // 路由跳转
   const router = useRouter();
@@ -308,4 +332,24 @@
   }
 </script>
 
-<style lang="less" scoped></style>
+<style lang="less" scoped>
+  .table-dot {
+    display: inline-block;
+    width: 10px;
+    height: 10px;
+    margin-right: 6px;
+    border-radius: 50%;
+
+    &--1 {
+      background-color: #1bc1b3;
+    }
+
+    &--2 {
+      background-color: #d3d8dd;
+    }
+
+    &--3 {
+      background-color: #f7b500;
+    }
+  }
+</style>

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

@@ -190,7 +190,7 @@ export const dataFormSchema: FormSchema[] = [
   },
   {
     label: '家属电话',
-    field: 'familyMoblie',
+    field: 'familyMobile',
     required: true,
     component: 'Input',
     componentProps: {

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

@@ -114,8 +114,9 @@
     });
   }
 
-  function callSuccess(data) {
+  async function callSuccess(data) {
     console.log('🚀 ~ file: index.vue:39 ~ handleSuccess ~ data:', data);
+    await getData();
   }
 </script>
 

+ 6 - 3
src/views/biz/archives/vascularAccess/ViewDrawerComplication.vue

@@ -189,7 +189,7 @@
     }
   }
   async function handleSave(record: EditRecordRow) {
-    // console.log('🚀 ~ file: ViewDrawerComplication.vue:166 ~ handleSave ~ record:', record);
+    console.log('🚀 ~ file: ViewDrawerComplication.vue:166 ~ handleSave ~ record:', record);
     record.onEdit?.(false, true);
     const data = {
       id: record?.id || '',
@@ -207,8 +207,11 @@
     createMessage.success(data.id ? '编辑成功' : '新增成功!');
     await getData();
   }
-  function handleCancel(record: EditRecordRow) {
-    console.log('🚀 ~ file: ViewDrawerComplication.vue:179 ~ handleCancel ~ record:', record);
+  async function handleCancel(record: EditRecordRow) {
+    // console.log('🚀 ~ file: ViewDrawerComplication.vue:179 ~ handleCancel ~ record:', record);
+    tableData.value.shift();
+    await nextTick();
+    setTableData(tableData.value);
     record.onEdit?.(false);
   }
   function onEditChange({ column, value, record }) {

+ 5 - 2
src/views/biz/archives/vascularAccess/index.vue

@@ -56,7 +56,10 @@
 <script setup lang="ts">
   import { ref, reactive, onUnmounted } from 'vue';
   import TimeLine from '/@/components/XTTimeLine/src/TimeLine.vue';
-  import { archivesVascularAccessQueryList } from '/@/api/biz/archives/vascularAccessApi';
+  import {
+    archivesVascularAccessQueryList,
+    archivesVascularAccessRemove,
+  } from '/@/api/biz/archives/vascularAccessApi';
   import { onMounted } from 'vue';
   import dayjs from 'dayjs';
   import { listDictModelBatch } from '/@/api/common';
@@ -287,7 +290,7 @@
         iconType: 'warning',
         onOk: async () => {
           // 删除
-          await archivesVascularAccessQueryList({});
+          await archivesVascularAccessRemove([data.id]);
           createMessage.success('删除成功!');
           await getData();
         },