|
|
@@ -39,43 +39,47 @@
|
|
|
<el-table-column prop="elderName" label="姓名" width="150" />
|
|
|
<el-table-column prop="gender" label="性别" width="80">
|
|
|
<template #default="scope">
|
|
|
- {{ scope.row.gender === 1 ? '男' : '女' }}
|
|
|
+ {{ scope.row.sex === "1" ? '男' : scope.row.sex === "2"?'女':'--' }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="age" label="年龄" width="80" />
|
|
|
- <el-table-column prop="personalPhone" label="手机号" width="180" />
|
|
|
- <el-table-column prop="homeTel" label="固定电话" width="180" />
|
|
|
- <el-table-column prop="selfCareStatus" label="自理情况" width="180">
|
|
|
+ <el-table-column prop="age" label="年龄" width="80" >
|
|
|
<template #default="scope">
|
|
|
- {{ scope.row.selfCareStatus === '1' ? '自理' : scope.row.selfCareStatus === '2' ? '半自理' : '不能自理' }}
|
|
|
+ {{ scope.row.age || '--' }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="phone" label="手机号" width="180" />
|
|
|
+ <el-table-column prop="telephone" label="固定电话" width="180" />
|
|
|
+ <el-table-column prop="selfCareSituation" label="自理情况" width="180">
|
|
|
+ <template #default="scope">
|
|
|
+ {{ getDictLabel(DICT_TYPE.ABILITY_LEVEL_ARR, parseInt(scope.row.selfCareSituation||"999")) }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="liveSituation" label="居住情况" width="180">
|
|
|
<template #default="scope">
|
|
|
- {{ scope.row.liveSituation === '1' ? '独居' : scope.row.liveSituation === '2' ? '与配偶同住' : '与子女同住' }}
|
|
|
+ {{ getDictLabel(DICT_TYPE.LIVE_ARR, parseInt(scope.row.liveSituation||'999')) }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="账户余额" width="150" align="center">
|
|
|
+ <el-table-column label="账户余额" width="180" align="center">
|
|
|
<template #default="scope">
|
|
|
- <div>代金券:{{scope.row.voucherBalance || 0}}元</div>
|
|
|
- <div>现金:{{scope.row.cashBalance || 0}}元</div>
|
|
|
+ {{scope.row.accountBalance}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="是否享受服务" width="120" align="center">
|
|
|
<template #default="scope">
|
|
|
- <el-switch v-model="scope.row.isEnjoyService" active-value="1" inactive-value="0" disabled />
|
|
|
+ <el-switch v-model="scope.row.isService" active-value="1" inactive-value="0" disabled />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="serviceTimes" label="年享受服务次数" width="180" align="center" />
|
|
|
- <el-table-column prop="currentAddress" label="居住地址" width="200" show-overflow-tooltip />
|
|
|
- <el-table-column prop="registerTime" label="登记入住时间" width="180" />
|
|
|
+ <el-table-column prop="currentLiveAddress" label="居住地址" width="200" show-overflow-tooltip />
|
|
|
+ <el-table-column prop="serviceTimesYear" label="登记入住时间" width="180" />
|
|
|
|
|
|
- <el-table-column label="操作" width="150" fixed="right" align="center">
|
|
|
+ <el-table-column label="操作" width="200" fixed="right" align="center">
|
|
|
<template #default="scope">
|
|
|
|
|
|
<el-button type="text" @click="handleEdit(scope.row,false)">编辑</el-button>
|
|
|
<el-button type="text" @click="handleEdit(scope.row,true)">详情</el-button>
|
|
|
- <el-button type="text" style="color: #f56c6c" @click="handleDelete(scope.row)">退住</el-button>
|
|
|
+ <el-button type="text" style="color: #f56c6c" @click="handleDelete2(scope.row)">退住</el-button>
|
|
|
+ <el-button type="text" style="color: #fb0000" @click="handleDelete(scope.row)">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -117,13 +121,14 @@
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
import { ref, onMounted } from 'vue'
|
|
|
+import { DICT_TYPE, getDictLabel } from '@/utils/dict'
|
|
|
import { useRouter } from 'vue-router'
|
|
|
import {deleteElderlyBatch} from '@/api/ykCenter'
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
import Import from "@/components/ImportFile/index.vue";
|
|
|
import Form from "./Form.vue";
|
|
|
import {useUserStore} from "@/store/modules/user";
|
|
|
-import {deleteOutElderly, getHomeElderlyList} from "@/api/living-home/elderly";
|
|
|
+import {deleteOutElderly, deleteOutElderly2, getHomeElderlyList} from "@/api/living-home/elderly";
|
|
|
const router = useRouter()
|
|
|
const userStore = useUserStore()
|
|
|
const importRef = ref() //导入
|
|
|
@@ -408,7 +413,7 @@ const handleEdit = async (row: any,detail:boolean) => {
|
|
|
const handleDelete = async (row: any) => {
|
|
|
try {
|
|
|
await ElMessageBox.confirm(
|
|
|
- `确定要退住长者 "${row.elderName}" 吗?`,
|
|
|
+ `确定要删除长者 "${row.elderName}" 吗?`,
|
|
|
'删除确认',
|
|
|
{
|
|
|
confirmButtonText: '确定',
|
|
|
@@ -428,6 +433,31 @@ const handleDelete = async (row: any) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+// 退住长者
|
|
|
+const handleDelete2 = async (row: any) => {
|
|
|
+ try {
|
|
|
+ await ElMessageBox.confirm(
|
|
|
+ `确定要退住长者 "${row.elderName}" 吗?`,
|
|
|
+ '删除确认',
|
|
|
+ {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }
|
|
|
+ )
|
|
|
+ await deleteOutElderly2(row.id)
|
|
|
+
|
|
|
+ ElMessage.success('删除成功')
|
|
|
+ await getList()
|
|
|
+ } catch (error) {
|
|
|
+ if (error !== 'cancel') {
|
|
|
+ console.error('删除长者失败:', error)
|
|
|
+ ElMessage.error('删除长者失败')
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
getList()
|
|
|
})
|