Explorar o código

添加南沙院护理记录的导入和导出功能

陈军 hai 4 meses
pai
achega
5a364f176e

+ 1 - 1
src/views/elderly/nursing/records/check-room-records/AddForm.vue

@@ -156,7 +156,7 @@ import { computed, ref, reactive } from 'vue'
 import { FormRules } from 'element-plus'
 import { useMediaQuery } from '@vueuse/core'
 import { SelectUpload } from '@/components/UploadFile'
-import { checkRoomCreate } from "@/api/elderly/nursing/records/check-room/index";
+import { checkRoomCreate } from "@/api/elderly/nursing/records/check-room";
 import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
 
 const message = useMessage() // 消息弹窗

+ 18 - 3
src/views/elderly/nursing/records/family-communication-records/index.vue

@@ -46,6 +46,9 @@
     <div class="mb-10px">
       <ButtonAdd @click="openForm(undefined)" v-hasPermi="['records:family-communication:add']" />
       <ButtonImport @click="outTab(undefined)" v-hasPermi="['records:family-communication:add']" />
+      <el-button type="info" plain @click="importRef.open()" v-hasPermi="['records:medical-care-records:output']">
+        <Icon icon="ep:download" /> 导入
+      </el-button>
     </div>
     <el-table v-loading="loading" :data="list" :header-cell-style="tableHeaderColor">
       <el-table-column header-align="center" align="center" label="序号" width="60">
@@ -102,6 +105,19 @@
   <AddForm ref="formRef" @success="getList" />
   <EditForm ref="editRef" @success="getList" />
   <DetailForm ref="detailRef" @success="getList" />
+
+  <Import
+    ref="importRef"
+    @success="getList"
+    :config="{
+      title: '导入',
+      downloadUrl: '/family/communicationRecord/import-template',
+      excelTempName: '机构养老-【家属沟通记录】模板',
+      importUrl: '/family/communicationRecord/import',
+      failExportUrl: '/elderlyInfo/downErrorExcel'
+    }"
+  />
+
 </template>
 
 <script setup lang="ts">
@@ -109,11 +125,9 @@ import { useUserStore } from '@/store/modules/user'
 import { familyCommunicationPage, familyCommunicationDelete } from "@/api/elderly/nursing/records/family-communication";
 import { getTenantId } from '@/utils/auth'
 import { dateFormatter } from '@/utils/formatTime'
-import {
-  rehabilitationAssessmentPage
-} from "@/api/elderly/nursing/records/rehabilitation-assessment";
 import {exportWithExpandedObjectArrays} from "@/utils/excel-export";
 import {formatTimestampYMD, formatToDateTime} from "@/utils/dateUtil";
+import Import from "@/components/ImportFile/index.vue";
 
 const AddForm = defineAsyncComponent(() => import('./AddForm.vue'))
 const EditForm = defineAsyncComponent(() => import('./EditForm.vue'))
@@ -124,6 +138,7 @@ const message = useMessage() // 消息弹窗
 const { t } = useI18n() // 国际化
 const loading = ref(true) // 列表的加载中
 const total = ref(0) // 列表的总页数
+const importRef = ref()
 const list = ref([]) // 列表的数据
 let queryParams = reactive({
   pageNo: 1,

+ 26 - 6
src/views/elderly/nursing/records/medical-care-records/index.vue

@@ -46,7 +46,9 @@
 
       <ButtonAdd @click="openForm(undefined)" v-hasPermi="['records:medical-care-records:add']" />
       <ButtonImport @click="handleImportCard" v-hasPermi="['records:medical-care-records:output']" />
-
+      <el-button type="info" plain @click="importRef.open()" v-hasPermi="['records:medical-care-records:output']">
+        <Icon icon="ep:download" /> 导入
+      </el-button>
     </div>
     <el-table v-loading="loading" :data="list" :header-cell-style="tableHeaderColor">
       <el-table-column header-align="center" align="center" label="序号" width="60">
@@ -62,7 +64,7 @@
       <el-table-column prop="bedInfo" header-align="center" align="center" label="床位号" min-width="200" show-overflow-tooltip/>
       <el-table-column prop="discoveryTime" header-align="center" align="center" label="发现时间" min-width="150" show-overflow-tooltip>
         <template #default="scope">
-          {{(scope.row.discoveryTime)}}
+          {{(formatTimestamp(scope.row.discoveryTime))}}
         </template>
       </el-table-column>
       <el-table-column prop="conditionDesc" header-align="center" align="center" label="情况描述" min-width="220" show-overflow-tooltip/>
@@ -124,6 +126,17 @@
     @cancel="showBatchExport = false"
   />
 
+  <Import
+    ref="importRef"
+    @success="getList"
+    :config="{
+      title: '导入',
+      downloadUrl: '/medical/careRecords/import-template',
+      excelTempName: '机构养老-【医疗护理记录】模板',
+      importUrl: '/medical/careRecords/import',
+      failExportUrl: '/elderlyInfo/downErrorExcel'
+    }"
+  />
 
 </template>
 
@@ -138,16 +151,20 @@ import {
 } from "@/api/member/appointment";
 import download from "@/utils/download";
 import { useUserStore } from '@/store/modules/user'
-import {formatToDateTime, getCurrentMonthRange} from "@/utils/dateUtil";
-import {exportWithCustomHeaders, exportWithExpandedObjectArrays} from "@/utils/excel-export";
 import {
-  rehabilitationAssessmentPage
-} from "@/api/elderly/nursing/records/rehabilitation-assessment";
+  formatTimestamp,
+  formatTimestampYMD,
+  formatToDateTime,
+  getCurrentMonthRange
+} from "@/utils/dateUtil";
+import {exportWithCustomHeaders, exportWithExpandedObjectArrays} from "@/utils/excel-export";
+import Import from "@/components/ImportFile/index.vue";
 const message = useMessage() // 消息弹窗
 const { t } = useI18n() // 国际化
 const userStore = useUserStore()
 const loading = ref(true) // 列表的加载中
 const detailRef = ref()
+const importRef = ref()
 const total = ref(0) // 列表的总页数
 const list = ref([]) // 列表的数据
 
@@ -194,6 +211,9 @@ const handleImportCard = async () => {
       { key: 'handlingNote', title: '处理说明' },
       { key: 'discoverer', title: '发现人' }
     ]
+    for (const header of list.list) {
+      header.discoveryTime = formatTimestampYMD(header.discoveryTime,'YYYY-MM-DD HH:mm:ss')
+    }
     exportWithExpandedObjectArrays(list.list, headers, `医疗护理记录${formatToDateTime()}.xlsx`, '医疗护理记录')
   } catch (_) {}finally {
     loading.value = false

+ 15 - 9
src/views/elderly/nursing/records/medical-records/AddForm.vue

@@ -97,19 +97,19 @@
 
         <el-row>
           <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
-            <el-form-item label="沟通的长者家属" prop="conditionDesc">
-              <el-input v-if="!isDetail" placeholder="输入长者或者家属"  v-model="dataForm.conditionDesc" />
-              <el-text v-else>{{dataForm.conditionDesc}}</el-text>
+            <el-form-item label="沟通的长者家属" prop="communicateFamilyMember">
+              <el-input v-if="!isDetail" placeholder="输入长者或者家属"  v-model="dataForm.communicateFamilyMember" />
+              <el-text v-else>{{dataForm.communicateFamilyMember}}</el-text>
             </el-form-item>
           </el-col>
           <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
-            <el-form-item label="沟通方式" prop="conditionDesc">
-              <el-radio-group v-if="!isDetail" v-model="contact">
-                <el-radio :value="1" size="large">面谈</el-radio>
-                <el-radio :value="2" size="large">电联<el-input :disabled="contact!=2" placeholder="输入电话号码"  v-model="dataForm.conditionDesc" /></el-radio>
-                <el-radio :value="3" size="large">微信或短信</el-radio>
+            <el-form-item label="沟通方式" prop="communicateType">
+              <el-radio-group v-if="!isDetail" v-model="dataForm.communicateType">
+                <el-radio value="面谈" size="large">面谈</el-radio>
+                <el-radio value="电联" size="large">电联<el-input :disabled="dataForm.communicateType!='电联'" placeholder="输入电话号码"  v-model="dataForm.phone" /></el-radio>
+                <el-radio value="微信或短信" size="large">微信或短信</el-radio>
               </el-radio-group>
-              <el-text v-else>{{dataForm.conditionDesc}}</el-text>
+              <el-text v-else>{{dataForm.communicateType}}{{dataForm.communicateType=='电联'?`(${dataForm.phone})`:''}}</el-text>
             </el-form-item>
           </el-col>
         </el-row>
@@ -182,6 +182,9 @@ let dataForm = ref({
   attachments: [],
   conditionDesc: '',
   handlingNote: '',//
+  communicateFamilyMember: '',//
+  communicateType: '',//
+  phone: '',//
   appointmentInstructions: '',//
   tenantId: undefined
 })
@@ -335,6 +338,9 @@ const resetForm = () => {
     conditionDesc: '',
     handlingNote: '',//
     appointmentInstructions: '',//
+    communicateFamilyMember: '',//
+    communicateType: '',//
+    phone: '',//
     tenantId: undefined
   }
   formRef.value?.resetFields()

+ 44 - 5
src/views/elderly/nursing/records/medical-records/index.vue

@@ -18,6 +18,17 @@
         />
       </el-form-item>
 
+      <el-form-item label="是否沟通过" prop="isCommunication">
+        <el-select v-model="queryParams.isCommunication" placeholder="请选择" class="!w-240px">
+          <el-option
+            v-for="(dict, index) in [{label:'全部',value:0},{label:'是',value:1},{label:'否',value:2}]"
+            :key="index"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
+
       <el-form-item label="预约日期">
         <el-date-picker
           size="default"
@@ -47,7 +58,9 @@
 
       <ButtonAdd @click="openForm(undefined)" v-hasPermi="['records:medical-records:add']" />
       <ButtonImport @click="handleExport" v-hasPermi="['records:medical-records:output']" />
-
+      <el-button type="info" plain @click="importRef.open()" v-hasPermi="['records:medical-care-records:output']">
+        <Icon icon="ep:download" /> 导入
+      </el-button>
     </div>
     <el-table v-loading="loading" :data="list" :header-cell-style="tableHeaderColor">
       <el-table-column header-align="center" align="center" label="序号" width="60">
@@ -62,7 +75,7 @@
       <el-table-column prop="bedInfo" header-align="center" align="center" label="床位号" min-width="200" show-overflow-tooltip/>
       <el-table-column prop="discoveryTime" header-align="center" align="center" label="发现时间" min-width="150" show-overflow-tooltip>
         <template #default="scope">
-          {{(scope.row.discoveryTime)}}
+          {{formatTimestamp(scope.row.discoveryTime)}}
         </template>
       </el-table-column>
       <el-table-column prop="conditionDesc" header-align="center" align="center" label="情况描述" min-width="220" show-overflow-tooltip/>
@@ -109,6 +122,18 @@
   <AddForm ref="formRef" @success="getList" />
   <DetailForm ref="detailRef" @success="getList" />
 
+  <Import
+    ref="importRef"
+    @success="getList"
+    :config="{
+      title: '导入',
+      downloadUrl: '/medical/records/import-template',
+      excelTempName: '机构养老-【医疗记录】模板',
+      importUrl: '/medical/records/import',
+      failExportUrl: '/elderlyInfo/downErrorExcel'
+    }"
+  />
+
 </template>
 
 <script setup lang="ts">
@@ -121,20 +146,27 @@ import {
   recordsDelete, recordsPage
 } from "@/api/member/appointment";
 import { useUserStore } from '@/store/modules/user'
-import {formatToDateTime, getCurrentMonthRange} from "@/utils/dateUtil";
-import {trainingPage} from "@/api/elderly/nursing/records/rehabilitation-training";
+import {
+  formatTimestamp,
+  formatTimestampYMD,
+  formatToDateTime,
+  getCurrentMonthRange
+} from "@/utils/dateUtil";
 import {exportWithExpandedObjectArrays} from "@/utils/excel-export";
+import Import from "@/components/ImportFile/index.vue";
 const message = useMessage() // 消息弹窗
 const { t } = useI18n() // 国际化
 const userStore = useUserStore()
 const loading = ref(true) // 列表的加载中
 const detailRef = ref()
+const importRef = ref()
 const total = ref(0) // 列表的总页数
 const list = ref([]) // 列表的数据
 let queryParams = reactive({
   pageNo: 1,
   pageSize: 10,
   elderName: '',
+  isCommunication: 0,
   discoveryTime: getCurrentMonthRange(),
   tenantId: userStore.orgTenantId[0]
 })
@@ -165,6 +197,7 @@ const handleQuery = async () => {
 /** 重置按钮操作 */
 const resetQuery = () => {
   queryParams.elderName = ''
+  queryParams.isCommunication = 0
   queryParams.tenantId = userStore.orgTenantId[0]
   queryParams.discoveryTime= getCurrentMonthRange()
   queryFormRef.value.resetFields()
@@ -204,8 +237,14 @@ const handleExport = async () => {
       { key: 'bedInfo', title: '床位号' },
       { key: 'conditionDesc', title: '情况描述' },
       { key: 'handlingNote', title: '处理说明' },
-      { key: 'discoverer', title: '发现人' }
+      { key: 'discoverer', title: '发现人' },
+      { key: 'communicateFamilyMember', title: '沟通的家属姓名' },
+      { key: 'communicateType', title: '沟通方式' },
+      { key: 'phone', title: '沟通的家属电话' },
     ]
+    for (const header of list.list) {
+      header.discoveryTime = formatTimestampYMD(header.discoveryTime,'YYYY-MM-DD HH:mm:ss')
+    }
     exportWithExpandedObjectArrays(list.list, headers, `医疗记录${formatToDateTime()}.xlsx`, '医疗记录')
   } catch (_) {}finally {
     loading.value = false

+ 19 - 1
src/views/elderly/nursing/records/rehabilitation-assessment/index.vue

@@ -46,6 +46,9 @@
     <div class="mb-10px">
       <ButtonAdd @click="openForm(undefined)" v-hasPermi="['records:rehabilitation-assessment:add']" />
       <ButtonImport @click="outTab(undefined)" v-hasPermi="['records:rehabilitation-assessment:add']" />
+      <el-button type="info" plain @click="importRef.open()" v-hasPermi="['records:medical-care-records:output']">
+        <Icon icon="ep:download" /> 导入
+      </el-button>
     </div>
     <el-table v-loading="loading" :data="list" :header-cell-style="tableHeaderColor">
       <el-table-column header-align="center" align="center" label="序号" width="60">
@@ -101,15 +104,29 @@
   <AddForm ref="formRef" @success="getList" />
   <EditForm ref="editRef" @success="getList" />
   <DetailForm ref="detailRef" @success="getList" />
+
+  <Import
+    ref="importRef"
+    @success="getList"
+    :config="{
+      title: '导入',
+      downloadUrl: '/rehabilitation/assessments/import-template',
+      excelTempName: '机构养老-【康复评估记录】模板',
+      importUrl: '/rehabilitation/assessments/import',
+      failExportUrl: '/elderlyInfo/downErrorExcel'
+    }"
+  />
+
 </template>
 
 <script setup lang="ts">
-import { rehabilitationAssessmentPage,rehabilitationAssessmentDelete } from "@/api/elderly/nursing/records/rehabilitation-assessment/index";
+import { rehabilitationAssessmentPage,rehabilitationAssessmentDelete } from "@/api/elderly/nursing/records/rehabilitation-assessment";
 import { getTenantId } from '@/utils/auth'
 import { dateFormatter } from '@/utils/formatTime'
 import {trainingPage} from "@/api/elderly/nursing/records/rehabilitation-training";
 import {exportWithExpandedObjectArrays} from "@/utils/excel-export";
 import {formatToDateTime} from "@/utils/dateUtil";
+import Import from "@/components/ImportFile/index.vue";
 
 const AddForm = defineAsyncComponent(() => import('./AddForm.vue'))
 const EditForm = defineAsyncComponent(() => import('./EditForm.vue'))
@@ -120,6 +137,7 @@ const message = useMessage() // 消息弹窗
 const { t } = useI18n() // 国际化
 const loading = ref(true) // 列表的加载中
 const total = ref(0) // 列表的总页数
+const importRef = ref()
 const list = ref([]) // 列表的数据
 let queryParams = reactive({
   pageNo: 1,

+ 18 - 0
src/views/elderly/nursing/records/rehabilitation-training/index.vue

@@ -46,6 +46,9 @@
     <div class="mb-10px">
       <ButtonAdd @click="openForm(undefined)" v-hasPermi="['records:rehabilitation-training:add']" />
       <ButtonImport @click="outTab(undefined)" v-hasPermi="['records:rehabilitation-training:add']" />
+      <el-button type="info" plain @click="importRef.open()" v-hasPermi="['records:medical-care-records:output']">
+        <Icon icon="ep:download" /> 导入
+      </el-button>
     </div>
     <el-table v-loading="loading" :data="list" :header-cell-style="tableHeaderColor">
       <el-table-column header-align="center" align="center" label="序号" width="60">
@@ -101,6 +104,19 @@
   <AddForm ref="formRef" @success="getList" />
   <EditForm ref="editRef" @success="getList" />
   <DetailForm ref="detailRef" @success="getList" />
+
+  <Import
+    ref="importRef"
+    @success="getList"
+    :config="{
+      title: '导入',
+      downloadUrl: '/training/records/import-template',
+      excelTempName: '机构养老-【康复训练记录】模板',
+      importUrl: '/training/records/import',
+      failExportUrl: '/elderlyInfo/downErrorExcel'
+    }"
+  />
+
 </template>
 
 <script setup lang="ts">
@@ -112,6 +128,7 @@ import { dateFormatter } from '@/utils/formatTime'
 import {formatToDateTime} from "@/utils/dateUtil";
 import {exportWithExpandedObjectArrays} from "@/utils/excel-export";
 import {careRecordsPage} from "@/api/member/appointment";
+import Import from "@/components/ImportFile/index.vue";
 
 const AddForm = defineAsyncComponent(() => import('./AddForm.vue'))
 const EditForm = defineAsyncComponent(() => import('./EditForm.vue'))
@@ -122,6 +139,7 @@ const message = useMessage() // 消息弹窗
 const { t } = useI18n() // 国际化
 const userStore = useUserStore()
 const loading = ref(true) // 列表的加载中
+const importRef = ref()
 const exportLoading = ref(true) // 列表的加载中
 const total = ref(0) // 列表的总页数
 const list = ref([]) // 列表的数据