|
@@ -29,7 +29,11 @@ import MarkCheckinBillsPaidForm from './MarkCheckinBillsPaidForm.vue'
|
|
|
import AddItemForm from './AddItemForm.vue'
|
|
import AddItemForm from './AddItemForm.vue'
|
|
|
import DeleteItemForm from './DeleteItemForm.vue'
|
|
import DeleteItemForm from './DeleteItemForm.vue'
|
|
|
import { useUserStore } from '@/store/modules/user'
|
|
import { useUserStore } from '@/store/modules/user'
|
|
|
-import { getOtherFilesStatistics } from '@/api/elderly/elder/elderly-Info'
|
|
|
|
|
|
|
+import {
|
|
|
|
|
+ getOtherFilesStatistics,
|
|
|
|
|
+ getOverdueBillList,
|
|
|
|
|
+ getOverdueProcessList
|
|
|
|
|
+} from '@/api/elderly/elder/elderly-Info'
|
|
|
import { exportWithCustomHeaders } from '@/utils/excel-export'
|
|
import { exportWithCustomHeaders } from '@/utils/excel-export'
|
|
|
import { ElLoading } from 'element-plus'
|
|
import { ElLoading } from 'element-plus'
|
|
|
import { getUserGroupTenant } from '@/api/system/user'
|
|
import { getUserGroupTenant } from '@/api/system/user'
|
|
@@ -47,7 +51,9 @@ const cards = ref([
|
|
|
{ id: 1, title: '为长者增加月度费用', content: '只操作本机构的,集团账号时不要操作' },
|
|
{ id: 1, title: '为长者增加月度费用', content: '只操作本机构的,集团账号时不要操作' },
|
|
|
{ id: 2, title: '为长者删除月度费用', content: '只操作本机构的,集团账号时不要操作' },
|
|
{ id: 2, title: '为长者删除月度费用', content: '只操作本机构的,集团账号时不要操作' },
|
|
|
{ id: 3, title: '统计院区档案上传情况', content: '所有院区的档案上传情况统计' },
|
|
{ id: 3, title: '统计院区档案上传情况', content: '所有院区的档案上传情况统计' },
|
|
|
- { id: 4, title: '导入床头卡信息', content: '导入健康档案信息' }
|
|
|
|
|
|
|
+ { id: 4, title: '导入床头卡信息', content: '导入健康档案信息' },
|
|
|
|
|
+ { id: 5, title: '机构流程实时审批统计', content: '查询所有院区的' },
|
|
|
|
|
+ { id: 6, title: '账单缴费及时性统计', content: '查询所有院区的' }
|
|
|
])
|
|
])
|
|
|
|
|
|
|
|
const handleExportStatistics = async () => {
|
|
const handleExportStatistics = async () => {
|
|
@@ -104,6 +110,101 @@ const handleExportStatistics = async () => {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+const handleExportProcess = async () => {
|
|
|
|
|
+ const fullscreenLoading = ElLoading.service({
|
|
|
|
|
+ lock: true,
|
|
|
|
|
+ text: '正在获取机构数据...',
|
|
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
|
|
+ })
|
|
|
|
|
+ try {
|
|
|
|
|
+ // 获取机构数据
|
|
|
|
|
+ const treeRes = await getUserGroupTenant({ userId: 1 })
|
|
|
|
|
+ //console.log('getUserGroupTenant 返回:', treeRes)
|
|
|
|
|
+ const tenantIds = treeRes.map((item: any) => {
|
|
|
|
|
+ return { id: item.orgTenantId, name: item.orgTenantName }
|
|
|
|
|
+ })
|
|
|
|
|
+ console.log('tenantIds:', tenantIds)
|
|
|
|
|
+
|
|
|
|
|
+ fullscreenLoading.setText('正在导出,请稍候...')
|
|
|
|
|
+ const dataList = <any>[]
|
|
|
|
|
+ for (const tenantId of tenantIds) {
|
|
|
|
|
+ const data = await getOverdueProcessList({ tenantId: tenantId.id, timeoutDays: 3 })
|
|
|
|
|
+ if (data && tenantId.name != '测试居家') {
|
|
|
|
|
+ console.log('数据 返回:', data)
|
|
|
|
|
+ dataList.push({ orgName: tenantId.name, num: data.length })
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ console.log('数据 返回:', dataList)
|
|
|
|
|
+
|
|
|
|
|
+ if (dataList.length > 0) {
|
|
|
|
|
+ const headers = [
|
|
|
|
|
+ { key: 'orgName', title: '机构名称', width: 40 },
|
|
|
|
|
+ { key: 'num', title: '院区审批流程未及时审核,且超过3天的未审批数量(条)', width: 50 }
|
|
|
|
|
+ ]
|
|
|
|
|
+ console.log('准备导出的数据:', dataList)
|
|
|
|
|
+ await exportWithCustomHeaders(dataList, headers, '各院审批数据及时性统计.xlsx')
|
|
|
|
|
+ message.success('导出成功')
|
|
|
|
|
+ } else {
|
|
|
|
|
+ message.warning('没有数据可以导出')
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ console.error('导出失败:', e)
|
|
|
|
|
+ message.error(e instanceof Error ? e.message : '导出失败')
|
|
|
|
|
+ } finally {
|
|
|
|
|
+ fullscreenLoading.close()
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const handleExportBill = async () => {
|
|
|
|
|
+ const fullscreenLoading = ElLoading.service({
|
|
|
|
|
+ lock: true,
|
|
|
|
|
+ text: '正在获取机构数据...',
|
|
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
|
|
+ })
|
|
|
|
|
+ try {
|
|
|
|
|
+ // 获取机构数据
|
|
|
|
|
+ const treeRes = await getUserGroupTenant({ userId: 1 })
|
|
|
|
|
+ //console.log('getUserGroupTenant 返回:', treeRes)
|
|
|
|
|
+ const tenantIds = treeRes.map((item: any) => {
|
|
|
|
|
+ return { id: item.orgTenantId, name: item.orgTenantName }
|
|
|
|
|
+ })
|
|
|
|
|
+ // console.log('tenantIds:', tenantIds)
|
|
|
|
|
+
|
|
|
|
|
+ fullscreenLoading.setText('正在导出,请稍候...')
|
|
|
|
|
+ const dataList = <any>[]
|
|
|
|
|
+ for (const tenantId of tenantIds) {
|
|
|
|
|
+ const data = await getOverdueBillList({
|
|
|
|
|
+ pageNo: 1,
|
|
|
|
|
+ pageSize: 10,
|
|
|
|
|
+ tenantId: tenantId.id,
|
|
|
|
|
+ billStartMonth: '2026-01'
|
|
|
|
|
+ })
|
|
|
|
|
+ if (data && data.list && data.total && tenantId.name != '测试居家') {
|
|
|
|
|
+ console.log('数据 返回:', data)
|
|
|
|
|
+ dataList.push({ orgName: tenantId.name, num: data.total })
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ console.log('数据 返回:', dataList)
|
|
|
|
|
+
|
|
|
|
|
+ if (dataList.length > 0) {
|
|
|
|
|
+ const headers = [
|
|
|
|
|
+ { key: 'orgName', title: '机构名称', width: 40 },
|
|
|
|
|
+ { key: 'num', title: '院区审批流程未及时审核,且超过3天的未审批数量(条)', width: 50 }
|
|
|
|
|
+ ]
|
|
|
|
|
+ console.log('准备导出的数据:', dataList)
|
|
|
|
|
+ await exportWithCustomHeaders(dataList, headers, '各院审批数据及时性统计.xlsx')
|
|
|
|
|
+ message.success('导出成功')
|
|
|
|
|
+ } else {
|
|
|
|
|
+ message.warning('没有数据可以导出')
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ console.error('导出失败:', e)
|
|
|
|
|
+ message.error(e instanceof Error ? e.message : '导出失败')
|
|
|
|
|
+ } finally {
|
|
|
|
|
+ fullscreenLoading.close()
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
const itemClick = (id: any) => {
|
|
const itemClick = (id: any) => {
|
|
|
switch (id) {
|
|
switch (id) {
|
|
|
case 0: //把入院账单设置成已缴费状态
|
|
case 0: //把入院账单设置成已缴费状态
|
|
@@ -124,6 +225,12 @@ const itemClick = (id: any) => {
|
|
|
case 4: //导入
|
|
case 4: //导入
|
|
|
importRef.value.open(userStore.orgTenantId[0])
|
|
importRef.value.open(userStore.orgTenantId[0])
|
|
|
|
|
|
|
|
|
|
+ break
|
|
|
|
|
+ case 5: //院区流程及时性
|
|
|
|
|
+ handleExportProcess()
|
|
|
|
|
+ break
|
|
|
|
|
+ case 6: //院区流程及时性
|
|
|
|
|
+ handleExportBill()
|
|
|
break
|
|
break
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|