|
@@ -23,6 +23,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 { exportWithCustomHeaders } from '@/utils/excel-export'
|
|
|
|
|
+import { ElLoading } from 'element-plus'
|
|
|
|
|
+import { getUserGroupTenant } from '@/api/system/user'
|
|
|
|
|
+
|
|
|
const message = useMessage() // 消息弹窗
|
|
const message = useMessage() // 消息弹窗
|
|
|
const userStore = useUserStore()
|
|
const userStore = useUserStore()
|
|
|
const refMarkCheckinBillsPaid = ref()
|
|
const refMarkCheckinBillsPaid = ref()
|
|
@@ -33,11 +38,53 @@ const cards = ref([
|
|
|
{ id: 0, title: '把入院账单设置成已缴费状态', content: '只操作本机构的,集团账号时不要操作' },
|
|
{ id: 0, title: '把入院账单设置成已缴费状态', content: '只操作本机构的,集团账号时不要操作' },
|
|
|
{ id: 1, title: '为长者增加月度费用', content: '只操作本机构的,集团账号时不要操作' },
|
|
{ id: 1, title: '为长者增加月度费用', content: '只操作本机构的,集团账号时不要操作' },
|
|
|
{ id: 2, title: '为长者删除月度费用', content: '只操作本机构的,集团账号时不要操作' },
|
|
{ id: 2, title: '为长者删除月度费用', content: '只操作本机构的,集团账号时不要操作' },
|
|
|
-
|
|
|
|
|
|
|
+ { id: 3, title: '各院档案及数据完整率', content: '各院档案及数据完整率' }
|
|
|
])
|
|
])
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+const handleExportStatistics = 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) => item.orgTenantId)
|
|
|
|
|
+ console.log('tenantIds:', tenantIds)
|
|
|
|
|
+
|
|
|
|
|
+ fullscreenLoading.setText('正在导出,请稍候...')
|
|
|
|
|
+
|
|
|
|
|
+ const data = await getOtherFilesStatistics({ tenantIds: tenantIds.join(',') })
|
|
|
|
|
+ console.log('getOtherFilesStatistics 返回:', data)
|
|
|
|
|
+ if (data && data.length > 0) {
|
|
|
|
|
+ // 处理数据,添加已上传档案数
|
|
|
|
|
+ const processedData = data.map((item: any) => ({
|
|
|
|
|
+ ...item,
|
|
|
|
|
+ uploadedOtherFilesCount: item.totalCount - item.emptyOtherFilesCount
|
|
|
|
|
+ }))
|
|
|
|
|
+
|
|
|
|
|
+ const headers = [
|
|
|
|
|
+ { key: 'tenantName', title: '机构名称', width: 45 },
|
|
|
|
|
+ { key: 'totalCount', title: '长者总数', width: 12 },
|
|
|
|
|
+ { key: 'uploadedOtherFilesCount', title: '已上传档案数', width: 15 },
|
|
|
|
|
+ { key: 'emptyOtherFilesCount', title: '未上传档案数', width: 15 },
|
|
|
|
|
+ { key: 'emptyOtherFilesPercentage', title: '档案为空占比', width: 15 }
|
|
|
|
|
+ ]
|
|
|
|
|
+ console.log('准备导出的数据:', processedData)
|
|
|
|
|
+ await exportWithCustomHeaders(processedData, 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){
|
|
@@ -52,6 +99,9 @@ const itemClick=(id:any)=>{
|
|
|
case 2: //删除月度费用
|
|
case 2: //删除月度费用
|
|
|
deleteItemForm.value.open(undefined,false,"月度费用",undefined,userStore.orgTenantId)
|
|
deleteItemForm.value.open(undefined,false,"月度费用",undefined,userStore.orgTenantId)
|
|
|
|
|
|
|
|
|
|
+ break
|
|
|
|
|
+ case 3: //各院档案及数据完整率
|
|
|
|
|
+ handleExportStatistics()
|
|
|
break
|
|
break
|
|
|
}
|
|
}
|
|
|
|
|
|