fix: 医生审核
This commit is contained in:
@@ -73,6 +73,26 @@ export async function openPcWindowsApi(id: number) {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核通过医生
|
||||
* @param id
|
||||
*/
|
||||
export async function auditApi(id: number) {
|
||||
return requestClient.post<any>(`${prefix}audit`, {
|
||||
id,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核拒绝医生
|
||||
* @param id
|
||||
*/
|
||||
export async function refuseApi(id: number) {
|
||||
return requestClient.post<any>(`${prefix}refuse`, {
|
||||
id,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取我绑定的银行卡
|
||||
*/
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import type { VbenFormProps } from '#/adapter/form';
|
||||
|
||||
import { getRoleOption } from '#/views/system/role/api';
|
||||
|
||||
export const formOptions: VbenFormProps = {
|
||||
// 默认展开
|
||||
collapsed: false,
|
||||
@@ -15,6 +13,41 @@ export const formOptions: VbenFormProps = {
|
||||
fieldName: 'name',
|
||||
label: '医生名称',
|
||||
},
|
||||
{
|
||||
component: 'VbenSelect',
|
||||
componentProps: {
|
||||
placeholder: '请选择状态',
|
||||
options: [
|
||||
{
|
||||
label: '全部',
|
||||
value: null,
|
||||
},
|
||||
{
|
||||
label: '已停用',
|
||||
value: -1,
|
||||
},
|
||||
{
|
||||
label: '待激活',
|
||||
value: 0,
|
||||
},
|
||||
{
|
||||
label: '待审核',
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
label: '已通过',
|
||||
value: 2,
|
||||
},
|
||||
{
|
||||
label: '已拒绝',
|
||||
value: 3,
|
||||
},
|
||||
],
|
||||
},
|
||||
defaultValue: null,
|
||||
fieldName: 'service_user_status',
|
||||
label: '审核状态',
|
||||
},
|
||||
// {
|
||||
// component: 'VbenInput',
|
||||
// componentProps: {
|
||||
|
||||
@@ -41,8 +41,9 @@ export const gridOptions: VxeGridProps<RowType> = {
|
||||
},
|
||||
{ field: 'su_id', title: 'wxID' },
|
||||
{ field: 'stores', title: '所属诊所', slots: { default: 'stores' } },
|
||||
{ field: 'service_user', title: '审核状态', slots: { default: 'service-user' } },
|
||||
{ field: 'created_at', title: '注册时间' },
|
||||
{ type: 'html', title: '操作', width: 200, slots: { default: 'action' } },
|
||||
{ type: 'html', title: '操作', width: 250, slots: { default: 'action' } },
|
||||
],
|
||||
keepSource: true,
|
||||
pagerConfig: {},
|
||||
|
||||
@@ -5,12 +5,12 @@ import { ref } from 'vue';
|
||||
|
||||
import { Page, useVbenModal } from '@vben/common-ui';
|
||||
|
||||
import { Button, Image, message } from 'ant-design-vue';
|
||||
import { Button, Image, message, Tag } from 'ant-design-vue';
|
||||
|
||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
import { TableAction } from '#/components/table-action';
|
||||
|
||||
import {openPcWindowsApi} from './api';
|
||||
import { auditApi, openPcWindowsApi, refuseApi } from './api';
|
||||
import FormModalDemo from './components/modal.vue';
|
||||
import { formOptions } from './config/search';
|
||||
import { gridOptions } from './config/table';
|
||||
@@ -40,15 +40,15 @@ const [FormModal, formModalApi] = useVbenModal({
|
||||
connectedComponent: FormModalDemo,
|
||||
});
|
||||
|
||||
const showModal = (data = {}, isUpdate = false) => {
|
||||
formModalApi.setData({
|
||||
// 表单值
|
||||
values: data,
|
||||
update: isUpdate,
|
||||
gridApi,
|
||||
});
|
||||
formModalApi.open();
|
||||
};
|
||||
// const showModal = (data = {}, isUpdate = false) => {
|
||||
// formModalApi.setData({
|
||||
// // 表单值
|
||||
// values: data,
|
||||
// update: isUpdate,
|
||||
// gridApi,
|
||||
// });
|
||||
// formModalApi.open();
|
||||
// };
|
||||
|
||||
const openPcWindows = (id: number) => {
|
||||
openPcWindowsApi(id).then(() => {
|
||||
@@ -56,6 +56,20 @@ const openPcWindows = (id: number) => {
|
||||
gridApi.reload();
|
||||
});
|
||||
};
|
||||
|
||||
const audit = (id: number) => {
|
||||
auditApi(id).then(() => {
|
||||
message.success('审核成功!');
|
||||
gridApi.reload();
|
||||
});
|
||||
};
|
||||
|
||||
const refuse = (id: number) => {
|
||||
refuseApi(id).then(() => {
|
||||
message.success('审核成功!');
|
||||
gridApi.reload();
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -98,20 +112,37 @@ const openPcWindows = (id: number) => {
|
||||
<Image :src="row.avatar" height="30" width="30" />
|
||||
</template>
|
||||
<template #stores="{ row }">
|
||||
<p v-for="item in row.stores" :key="item.store_id">{{ item?.store?.name }}</p>
|
||||
<p v-for="item in row.stores" :key="item.store_id">
|
||||
{{ item?.store?.name }}
|
||||
</p>
|
||||
</template>
|
||||
<template #service-user="{ row }">
|
||||
<Tag v-if="row.service_user?.status === 2" color="success">已通过</Tag>
|
||||
<Tag v-else-if="row.service_user?.status === 0" color="blue">
|
||||
待激活
|
||||
</Tag>
|
||||
<Tag v-else-if="row.service_user?.status === 1" color="warning">
|
||||
待审核
|
||||
</Tag>
|
||||
<Tag v-else-if="row.service_user?.status === 3" color="error">
|
||||
已拒绝
|
||||
</Tag>
|
||||
<Tag v-else-if="row.service_user?.status === -1" color="error">
|
||||
已停用
|
||||
</Tag>
|
||||
</template>
|
||||
<template #toolbar-tools></template>
|
||||
<template #action="{ row }">
|
||||
<TableAction
|
||||
:actions="[
|
||||
{
|
||||
label: '绑定诊所',
|
||||
type: 'link',
|
||||
icon: 'uil:edit',
|
||||
size: 'small',
|
||||
// auth: ['doctor', 'sys:role:detail'],
|
||||
onClick: showModal.bind(null, row, true),
|
||||
},
|
||||
// {
|
||||
// label: '绑定诊所',
|
||||
// type: 'link',
|
||||
// icon: 'uil:edit',
|
||||
// size: 'small',
|
||||
// // auth: ['doctor', 'sys:role:detail'],
|
||||
// onClick: showModal.bind(null, row, true),
|
||||
// },
|
||||
{
|
||||
label: '开通PC端',
|
||||
type: 'link',
|
||||
@@ -122,16 +153,24 @@ const openPcWindows = (id: number) => {
|
||||
},
|
||||
]"
|
||||
:drop-down-actions="[
|
||||
// {
|
||||
// label: '重置密码',
|
||||
// type: 'link',
|
||||
// icon: 'bitcoin-icons:refresh-filled',
|
||||
// size: 'small',
|
||||
// popConfirm: {
|
||||
// title: '确定重置密码吗?',
|
||||
// confirm: openPcWindows.bind(null, row.id),
|
||||
// },
|
||||
// },
|
||||
{
|
||||
label: '审核通过',
|
||||
type: 'link',
|
||||
icon: 'uil:edit',
|
||||
size: 'small',
|
||||
ifShow: row.service_user?.status === 1,
|
||||
// auth: ['doctor', 'sys:role:detail'],
|
||||
onClick: audit.bind(null, row.id),
|
||||
},
|
||||
{
|
||||
label: '拒绝审核',
|
||||
type: 'link',
|
||||
icon: 'uil:edit',
|
||||
size: 'small',
|
||||
ifShow: row.service_user?.status === 1,
|
||||
// auth: ['doctor', 'sys:role:detail'],
|
||||
onClick: refuse.bind(null, row.id),
|
||||
},
|
||||
]"
|
||||
/>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user