提交 eff1b4ef authored 作者: leon's avatar leon

医生管理-审核

上级 782cdc07
<template> <template>
<Card :bordered="false" :loading="!data.isOver"> <div>
<template #extra> <Card :bordered="false" :loading="!data.isOver">
<a-space> <template #extra v-if="data.isOver">
<a-button type="primary" v-if="isShowHandleEdit(data.detail.status)" @click="reload">编辑</a-button> <a-button type="primary" v-if="isShowHandleEdit(data.detail.status)" @click="handleEdit">
<a-button type="primary" v-if="isShowHandlePassed(data.detail.status)">通过</a-button> <template #icon> <Icon icon="clarity:note-edit-line" /></template>
<a-button type="danger" v-if="isShowHandleReject(data.detail.status)">拒绝</a-button> 编辑
<a-button type="danger" v-if="isShowHandleForbidden(data.detail.status)">禁用</a-button> </a-button>
<a-button type="danger" v-if="isShowHandleDelete()">删除</a-button> <a-popconfirm
</a-space> class="ml-4"
</template> title="确定通过吗"
<Descriptions bordered :column="3"> ok-text="是"
<Descriptions.Item cancel-text="否"
v-for="p in displayProps" @confirm="handleVerify(StatusValEnum.PASSED)"
:key="p.title" >
:label="p.title" <a-button type="primary" v-if="isShowHandlePassed(data.detail.status)">通过</a-button>
:span="['avatar'].includes(p.name) ? 3 : 1" </a-popconfirm>
>
<span v-if="p.key === 'avatar'"> <a-popconfirm
<img :src="p.value" style="width: 120px; height: 120px" /> class="ml-4"
</span> title="确定拒绝吗"
<template v-else> ok-text="是"
{{ p.value }} cancel-text="否"
</template> @confirm="handleVerify(StatusValEnum.PASSED)"
</Descriptions.Item> >
</Descriptions> <a-button type="danger" v-if="isShowHandleReject(data.detail.status)">拒绝</a-button>
</Card> </a-popconfirm>
<a-popconfirm
class="ml-4"
title="确定禁用吗"
ok-text="是"
cancel-text="否"
@confirm="handleVerify(StatusValEnum.FORBIDDEN)"
>
<a-button type="danger" v-if="isShowHandleForbidden(data.detail.status)">禁用</a-button>
</a-popconfirm>
<a-popconfirm
class="ml-4"
title="确定删除吗"
ok-text="是"
cancel-text="否"
@confirm="handleVerify(StatusValEnum.FORBIDDEN)"
>
<a-button type="danger" v-if="isShowHandleDelete()">删除</a-button>
</a-popconfirm>
</template>
<Descriptions bordered :column="3">
<Descriptions.Item
v-for="p in displayProps"
:key="p.title"
:label="p.title"
:span="['avatar'].includes(p.name) ? 3 : 1"
>
<span v-if="p.key === 'avatar'">
<img :src="p.value" style="width: 120px; height: 120px" />
</span>
<template v-else>
{{ p.value }}
</template>
</Descriptions.Item>
</Descriptions>
</Card>
<DoctorDrawer @register="registerDrawer" @success="handleSuccess" />
</div>
</template> </template>
<script lang="ts" setup name="DeviceDetail"> <script lang="ts" setup name="DeviceDetail">
import { Icon } from '/@/components/Icon';
import { import {
isShowHandleEdit, isShowHandleEdit,
isShowHandlePassed, isShowHandlePassed,
...@@ -34,7 +74,9 @@ ...@@ -34,7 +74,9 @@
isShowHandleReject, isShowHandleReject,
isShowHandleDelete, isShowHandleDelete,
getVerifyParams, getVerifyParams,
StatusValEnum,
} from './schema'; } from './schema';
import DoctorDrawer from './drawer.vue';
import { onMounted, computed, ref, reactive, toRef } from 'vue'; import { onMounted, computed, ref, reactive, toRef } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { ComputedRef } from '@vue/reactivity'; import { ComputedRef } from '@vue/reactivity';
...@@ -42,7 +84,8 @@ ...@@ -42,7 +84,8 @@
import { descriptionColumns } from './schema'; import { descriptionColumns } from './schema';
import * as DoctorApi from '/@/api/system/doctorApi'; import * as DoctorApi from '/@/api/system/doctorApi';
import { Device } from '/@/api/model/device'; import { Device } from '/@/api/model/device';
import { useDrawer } from '/@/components/Drawer';
const [registerDrawer, { openDrawer }] = useDrawer();
const route = useRoute(); const route = useRoute();
const id = ref(route.params?.id); const id = ref(route.params?.id);
let data = reactive({ let data = reactive({
...@@ -55,6 +98,11 @@ ...@@ -55,6 +98,11 @@
data.detail = res; data.detail = res;
}); });
}; };
onMounted(() => {
getDetail();
});
const reload = () => { const reload = () => {
data.isOver = false; data.isOver = false;
data.detail = {}; data.detail = {};
...@@ -64,12 +112,26 @@ ...@@ -64,12 +112,26 @@
}); });
}; };
onMounted(() => { const handleSuccess = () => {
getDetail(); reload();
}); };
const handleVerify = (record: Recordable, status: string) => { const handleEdit = () => {
DoctorApi.batchVerify(getVerifyParams(record, status)).then((_) => {}); openDrawer(true, {
record: data.detail,
isUpdate: true,
});
};
const handleDelete = () => {
DoctorApi.remove(data.detail.id).then((_) => {
reload();
});
};
const handleVerify = (status: string) => {
DoctorApi.batchVerify(getVerifyParams(data.detail, status)).then((_) => {
reload();
});
}; };
const displayProps: ComputedRef<Array<any>> = computed(() => { const displayProps: ComputedRef<Array<any>> = computed(() => {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论