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

医生管理-审核

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