|
@@ -45,6 +45,7 @@
|
|
|
<ContentWrap>
|
|
<ContentWrap>
|
|
|
<div class="mb-10px">
|
|
<div class="mb-10px">
|
|
|
<ButtonAdd @click="openForm(undefined)" v-hasPermi="['records:rehabilitation-training:add']" />
|
|
<ButtonAdd @click="openForm(undefined)" v-hasPermi="['records:rehabilitation-training:add']" />
|
|
|
|
|
+ <ButtonImport @click="outTab(undefined)" v-hasPermi="['records:rehabilitation-training:add']" />
|
|
|
</div>
|
|
</div>
|
|
|
<el-table v-loading="loading" :data="list" :header-cell-style="tableHeaderColor">
|
|
<el-table v-loading="loading" :data="list" :header-cell-style="tableHeaderColor">
|
|
|
<el-table-column header-align="center" align="center" label="序号" width="60">
|
|
<el-table-column header-align="center" align="center" label="序号" width="60">
|
|
@@ -104,10 +105,13 @@
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
import { useUserStore } from '@/store/modules/user'
|
|
import { useUserStore } from '@/store/modules/user'
|
|
|
-import { trainingPage, trainingDelete } from "@/api/elderly/nursing/records/rehabilitation-training/index";
|
|
|
|
|
|
|
+import { trainingPage, trainingDelete } from "@/api/elderly/nursing/records/rehabilitation-training";
|
|
|
import download from "@/utils/download";
|
|
import download from "@/utils/download";
|
|
|
import { getTenantId } from '@/utils/auth'
|
|
import { getTenantId } from '@/utils/auth'
|
|
|
import { dateFormatter } from '@/utils/formatTime'
|
|
import { dateFormatter } from '@/utils/formatTime'
|
|
|
|
|
+import {formatToDateTime} from "@/utils/dateUtil";
|
|
|
|
|
+import {exportWithExpandedObjectArrays} from "@/utils/excel-export";
|
|
|
|
|
+import {careRecordsPage} from "@/api/member/appointment";
|
|
|
|
|
|
|
|
const AddForm = defineAsyncComponent(() => import('./AddForm.vue'))
|
|
const AddForm = defineAsyncComponent(() => import('./AddForm.vue'))
|
|
|
const EditForm = defineAsyncComponent(() => import('./EditForm.vue'))
|
|
const EditForm = defineAsyncComponent(() => import('./EditForm.vue'))
|
|
@@ -118,6 +122,7 @@ const message = useMessage() // 消息弹窗
|
|
|
const { t } = useI18n() // 国际化
|
|
const { t } = useI18n() // 国际化
|
|
|
const userStore = useUserStore()
|
|
const userStore = useUserStore()
|
|
|
const loading = ref(true) // 列表的加载中
|
|
const loading = ref(true) // 列表的加载中
|
|
|
|
|
+const exportLoading = ref(true) // 列表的加载中
|
|
|
const total = ref(0) // 列表的总页数
|
|
const total = ref(0) // 列表的总页数
|
|
|
const list = ref([]) // 列表的数据
|
|
const list = ref([]) // 列表的数据
|
|
|
let queryParams = reactive({
|
|
let queryParams = reactive({
|
|
@@ -165,6 +170,29 @@ const openForm = (recordId?: number) => {
|
|
|
formRef.value.open(queryParams.tenantId, recordId, false)
|
|
formRef.value.open(queryParams.tenantId, recordId, false)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+const outTab = async () => {
|
|
|
|
|
+// 处理批量导出
|
|
|
|
|
+ loading.value = true
|
|
|
|
|
+ try {
|
|
|
|
|
+ const list = await trainingPage(queryParams)
|
|
|
|
|
+ if (list.list.length <= 0) {
|
|
|
|
|
+ message.error('暂无数据可以导出!')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ const headers = [
|
|
|
|
|
+ { key: 'trainingTime', title: '训练时间' },
|
|
|
|
|
+ { key: 'contractNumber', title: '合同号' },
|
|
|
|
|
+ { key: 'elderName', title: '长者姓名' },
|
|
|
|
|
+ { key: 'bedInfo', title: '床位号' },
|
|
|
|
|
+ { key: 'recordContent', title: '记录内容' },
|
|
|
|
|
+ { key: 'therapist', title: '康复师' }
|
|
|
|
|
+ ]
|
|
|
|
|
+ exportWithExpandedObjectArrays(list.list, headers, `康复训练记录${formatToDateTime()}.xlsx`, '康复训练记录')
|
|
|
|
|
+ } catch (_) {}finally {
|
|
|
|
|
+ loading.value = false
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
/** 编辑操作 */
|
|
/** 编辑操作 */
|
|
|
const editRef = ref()
|
|
const editRef = ref()
|
|
|
const openFormEdit = (row: any = {}) => {
|
|
const openFormEdit = (row: any = {}) => {
|