|
|
@@ -9,19 +9,48 @@
|
|
|
:inline="true"
|
|
|
label-width="80px"
|
|
|
>
|
|
|
- <TenantSelect v-model="queryParams.tenantIds" placeholder="请选择机构名称" prop="tenantIds"/>
|
|
|
+ <TenantSelect v-model="queryParams.tenantIds" placeholder="请选择机构名称" prop="tenantIds" />
|
|
|
<el-form-item label="长者姓名" prop="elderName">
|
|
|
- <el-input @keyup.enter="handleQuery" v-model="queryParams.elderName" placeholder="请输入长者姓名" class="!w-240px" />
|
|
|
+ <el-input
|
|
|
+ @keyup.enter="handleQuery"
|
|
|
+ v-model="queryParams.elderName"
|
|
|
+ placeholder="请输入长者姓名"
|
|
|
+ class="!w-240px"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="合同号" prop="contractNumber">
|
|
|
+ <el-input
|
|
|
+ @keyup.enter="handleQuery"
|
|
|
+ v-model="queryParams.contractNumber"
|
|
|
+ placeholder="请输入长者姓名"
|
|
|
+ class="!w-240px"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
+
|
|
|
<el-form-item label="楼栋">
|
|
|
- <el-select v-model="queryParams.buildId" placeholder="选择楼栋" style="width: 180px" @change="handleBuildChange">
|
|
|
- <el-option v-for="(item,index) in buildList" :key="index" :label="item.buildName" :value="item.id" />
|
|
|
+ <el-select
|
|
|
+ v-model="queryParams.buildId"
|
|
|
+ placeholder="选择楼栋"
|
|
|
+ style="width: 180px"
|
|
|
+ @change="handleBuildChange"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in buildList"
|
|
|
+ :key="index"
|
|
|
+ :label="item.buildName"
|
|
|
+ :value="item.id"
|
|
|
+ />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="楼层">
|
|
|
- <el-select v-model="queryParams.floorId" placeholder="选择楼层" style="width: 180px" >
|
|
|
- <el-option v-for="(item,index) in floorList" :key="index" :label="item.floorName" :value="item.id" />
|
|
|
+ <el-select v-model="queryParams.floorId" placeholder="选择楼层" style="width: 180px">
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in floorList"
|
|
|
+ :key="index"
|
|
|
+ :label="item.floorName"
|
|
|
+ :value="item.id"
|
|
|
+ />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="入住状态" prop="inStatus">
|
|
|
@@ -35,7 +64,7 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="床位号" prop="bedId">
|
|
|
- <SelectRoom v-model="queryParams.bedId" class="!w-240px" :tId="queryParams.tenantIds"/>
|
|
|
+ <SelectRoom v-model="queryParams.bedId" class="!w-240px" :tId="queryParams.tenantIds" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="供养类型" prop="careType">
|
|
|
<el-select v-model="queryParams.careType" placeholder="请选择" class="!w-240px" clearable>
|
|
|
@@ -107,7 +136,7 @@
|
|
|
<!-- 导出床头卡弹窗 -->
|
|
|
<el-dialog
|
|
|
v-model="dialogVisible"
|
|
|
- :title="`批量导出${type==1?'床头卡':'分享卡'}`"
|
|
|
+ :title="`批量导出${type == 1 ? '床头卡' : '分享卡'}`"
|
|
|
:close-on-press-escape="false"
|
|
|
:close-on-click-modal="false"
|
|
|
width="28vw"
|
|
|
@@ -137,7 +166,6 @@
|
|
|
>
|
|
|
<template #prepend>数量</template>
|
|
|
</el-input>
|
|
|
-
|
|
|
</div>
|
|
|
|
|
|
<div class="description" style="margin-top: 20px">
|
|
|
@@ -148,9 +176,17 @@
|
|
|
<p>4. 建议单次导出数量不超过200张,以免影响系统性能</p>
|
|
|
<p>5. 导出需要较长时间,请耐心等待。200张大约需要20分钟!</p>
|
|
|
</div>
|
|
|
- <div style="width: 100%;display: flex;flex-direction: row">
|
|
|
- <el-button @click="dialogVisible=false" style="margin-top: 10px;margin-left: auto">关 闭</el-button>
|
|
|
- <el-button :loading="loadingImport" type="primary" @click="startExport" style="margin-top: 10px;margin-left: 20px">开始导出</el-button>
|
|
|
+ <div style="width: 100%; display: flex; flex-direction: row">
|
|
|
+ <el-button @click="dialogVisible = false" style="margin-top: 10px; margin-left: auto"
|
|
|
+ >关 闭</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ :loading="loadingImport"
|
|
|
+ type="primary"
|
|
|
+ @click="startExport"
|
|
|
+ style="margin-top: 10px; margin-left: 20px"
|
|
|
+ >开始导出</el-button
|
|
|
+ >
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
@@ -163,10 +199,10 @@ import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
|
|
|
import { useUserStore } from '@/store/modules/user'
|
|
|
import Import from '@/components/ImportFile/index.vue'
|
|
|
import download from '@/utils/download'
|
|
|
-import {importCard} from '@/utils/outBedCard'
|
|
|
-import {getElderHealthRecordById} from "@/api/elderly/elder/health-record";
|
|
|
-import {getBuildList} from "@/api/system/badManage";
|
|
|
-import {ref} from "vue";
|
|
|
+import { importCard } from '@/utils/outBedCard'
|
|
|
+import { getElderHealthRecordById } from '@/api/elderly/elder/health-record'
|
|
|
+import { getBuildList } from '@/api/system/badManage'
|
|
|
+import { ref } from 'vue'
|
|
|
defineOptions({ name: 'ElderFile' })
|
|
|
const userStore = useUserStore()
|
|
|
const message = useMessage()
|
|
|
@@ -181,11 +217,12 @@ const queryParams = reactive({
|
|
|
pageSize: 10,
|
|
|
buildId: '',
|
|
|
floorId: '',
|
|
|
+ contractNumber: '',
|
|
|
elderName: undefined,
|
|
|
inStatus: '1',
|
|
|
bedId: undefined,
|
|
|
careType: undefined,
|
|
|
- tenantIds: userStore.orgTenantId,
|
|
|
+ tenantIds: userStore.orgTenantId
|
|
|
})
|
|
|
const queryFormRef = ref() // 搜索的表单
|
|
|
const router = useRouter()
|
|
|
@@ -220,6 +257,7 @@ const handleQuery = async () => {
|
|
|
const resetQuery = () => {
|
|
|
queryParams.buildId = ''
|
|
|
queryParams.floorId = ''
|
|
|
+ queryParams.contractNumber = ''
|
|
|
queryFormRef.value.resetFields()
|
|
|
handleQuery()
|
|
|
}
|
|
|
@@ -229,11 +267,10 @@ const type = ref(1)
|
|
|
//批量导出
|
|
|
const handleImportCard = (t) => {
|
|
|
// 显示弹窗
|
|
|
- type.value=t
|
|
|
+ type.value = t
|
|
|
dialogVisible.value = true
|
|
|
}
|
|
|
|
|
|
-
|
|
|
const loadingImport = ref(false)
|
|
|
// 开始导出
|
|
|
const startExport = async () => {
|
|
|
@@ -258,37 +295,33 @@ const startExport = async () => {
|
|
|
elderName: undefined,
|
|
|
inStatus: '1',
|
|
|
bedId: undefined,
|
|
|
- tenantIds: userStore.orgTenantId,
|
|
|
+ tenantIds: userStore.orgTenantId
|
|
|
}
|
|
|
const data = await getElderlyPage(queryParams)
|
|
|
- if(type.value==1){
|
|
|
- for(const [index, item] of data.list.entries()){
|
|
|
+ if (type.value == 1) {
|
|
|
+ for (const [index, item] of data.list.entries()) {
|
|
|
try {
|
|
|
const res = await getElderHealthRecordById(item.id)
|
|
|
// console.log("长者健康档案:",index)
|
|
|
// 判断是否为最后一个数据
|
|
|
const param = index === data.list.length - 1 ? 3 : 2
|
|
|
- await importCard(res||{}, item, param)
|
|
|
- } catch (e) { }
|
|
|
+ await importCard(res || {}, item, param)
|
|
|
+ } catch (e) {}
|
|
|
}
|
|
|
- }else {
|
|
|
- for(const [index, item] of data.list.entries()){
|
|
|
+ } else {
|
|
|
+ for (const [index, item] of data.list.entries()) {
|
|
|
try {
|
|
|
const param = index === data.list.length - 1 ? 3 : 2
|
|
|
await importCard(undefined, item, param)
|
|
|
- } catch (e) { }
|
|
|
+ } catch (e) {}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
-
|
|
|
loadingImport.value = false
|
|
|
- }catch (_){
|
|
|
+ } catch (_) {
|
|
|
loadingImport.value = false
|
|
|
message.warning('获取数据失败,无法导出!')
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
/** 添加/修改操作 */
|
|
|
@@ -301,7 +334,7 @@ const openForm = (row: any = {}) => {
|
|
|
const openDetail = (row: any = {}) => {
|
|
|
router.push({
|
|
|
name: 'ElderFileDetail',
|
|
|
- params:{
|
|
|
+ params: {
|
|
|
id: row.id
|
|
|
}
|
|
|
})
|
|
|
@@ -309,11 +342,11 @@ const openDetail = (row: any = {}) => {
|
|
|
|
|
|
const handleSortChange = (val) => {
|
|
|
queryParams.prop = val.prop
|
|
|
- if(val.order === 'ascending'){
|
|
|
+ if (val.order === 'ascending') {
|
|
|
queryParams.order = 'asc'
|
|
|
- }else if(val.order === 'descending'){
|
|
|
+ } else if (val.order === 'descending') {
|
|
|
queryParams.order = 'desc'
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
queryParams.order = ''
|
|
|
}
|
|
|
if (queryParams.pageNo === 1) {
|
|
|
@@ -325,12 +358,12 @@ const handleSortChange = (val) => {
|
|
|
|
|
|
const ids = ref([])
|
|
|
const handleSelection = (val) => {
|
|
|
- ids.value = val.map(item => item.id)
|
|
|
+ ids.value = val.map((item) => item.id)
|
|
|
}
|
|
|
|
|
|
/** 删除按钮操作 */
|
|
|
const handleDelete = async () => {
|
|
|
- if(!ids.value.length){
|
|
|
+ if (!ids.value.length) {
|
|
|
message.error('请选择一条数据')
|
|
|
return
|
|
|
}
|
|
|
@@ -338,7 +371,7 @@ const handleDelete = async () => {
|
|
|
// 删除的二次确认
|
|
|
await message.delConfirm()
|
|
|
// 发起删除
|
|
|
- ids.value.map(async item=>{
|
|
|
+ ids.value.map(async (item) => {
|
|
|
await delElderlyInfo(item)
|
|
|
})
|
|
|
message.success(t('common.delSuccess'))
|
|
|
@@ -378,7 +411,6 @@ const handleBuildChange = (buildId: any) => {
|
|
|
const selectedBuild = buildList.value.find((item: any) => item.id === buildId)
|
|
|
if (selectedBuild) {
|
|
|
floorList.value = selectedBuild.floorList || []
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -386,9 +418,7 @@ const handleBuildChange = (buildId: any) => {
|
|
|
onMounted(async () => {
|
|
|
getList()
|
|
|
try {
|
|
|
- buildList.value = await getBuildList({tenantIds: queryParams.tenantIds[0]})
|
|
|
- } catch (e)
|
|
|
- {}
|
|
|
-
|
|
|
+ buildList.value = await getBuildList({ tenantIds: queryParams.tenantIds[0] })
|
|
|
+ } catch (e) {}
|
|
|
})
|
|
|
</script>
|