fix: 医生审核

This commit is contained in:
2025-04-16 14:48:46 +08:00
parent 34d6d9f8f5
commit 596bbb2fa9
4 changed files with 126 additions and 33 deletions

View File

@@ -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,
});
}
/** /**
* 获取我绑定的银行卡 * 获取我绑定的银行卡
*/ */

View File

@@ -1,7 +1,5 @@
import type { VbenFormProps } from '#/adapter/form'; import type { VbenFormProps } from '#/adapter/form';
import { getRoleOption } from '#/views/system/role/api';
export const formOptions: VbenFormProps = { export const formOptions: VbenFormProps = {
// 默认展开 // 默认展开
collapsed: false, collapsed: false,
@@ -15,6 +13,41 @@ export const formOptions: VbenFormProps = {
fieldName: 'name', fieldName: 'name',
label: '医生名称', 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', // component: 'VbenInput',
// componentProps: { // componentProps: {

View File

@@ -41,8 +41,9 @@ export const gridOptions: VxeGridProps<RowType> = {
}, },
{ field: 'su_id', title: 'wxID' }, { field: 'su_id', title: 'wxID' },
{ field: 'stores', title: '所属诊所', slots: { default: 'stores' } }, { field: 'stores', title: '所属诊所', slots: { default: 'stores' } },
{ field: 'service_user', title: '审核状态', slots: { default: 'service-user' } },
{ field: 'created_at', title: '注册时间' }, { field: 'created_at', title: '注册时间' },
{ type: 'html', title: '操作', width: 200, slots: { default: 'action' } }, { type: 'html', title: '操作', width: 250, slots: { default: 'action' } },
], ],
keepSource: true, keepSource: true,
pagerConfig: {}, pagerConfig: {},

View File

@@ -5,12 +5,12 @@ import { ref } from 'vue';
import { Page, useVbenModal } from '@vben/common-ui'; 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 { useVbenVxeGrid } from '#/adapter/vxe-table';
import { TableAction } from '#/components/table-action'; import { TableAction } from '#/components/table-action';
import {openPcWindowsApi} from './api'; import { auditApi, openPcWindowsApi, refuseApi } from './api';
import FormModalDemo from './components/modal.vue'; import FormModalDemo from './components/modal.vue';
import { formOptions } from './config/search'; import { formOptions } from './config/search';
import { gridOptions } from './config/table'; import { gridOptions } from './config/table';
@@ -40,15 +40,15 @@ const [FormModal, formModalApi] = useVbenModal({
connectedComponent: FormModalDemo, connectedComponent: FormModalDemo,
}); });
const showModal = (data = {}, isUpdate = false) => { // const showModal = (data = {}, isUpdate = false) => {
formModalApi.setData({ // formModalApi.setData({
// 表单值 // // 表单值
values: data, // values: data,
update: isUpdate, // update: isUpdate,
gridApi, // gridApi,
}); // });
formModalApi.open(); // formModalApi.open();
}; // };
const openPcWindows = (id: number) => { const openPcWindows = (id: number) => {
openPcWindowsApi(id).then(() => { openPcWindowsApi(id).then(() => {
@@ -56,6 +56,20 @@ const openPcWindows = (id: number) => {
gridApi.reload(); 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> </script>
<template> <template>
@@ -98,20 +112,37 @@ const openPcWindows = (id: number) => {
<Image :src="row.avatar" height="30" width="30" /> <Image :src="row.avatar" height="30" width="30" />
</template> </template>
<template #stores="{ row }"> <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>
<template #toolbar-tools></template> <template #toolbar-tools></template>
<template #action="{ row }"> <template #action="{ row }">
<TableAction <TableAction
:actions="[ :actions="[
{ // {
label: '绑定诊所', // label: '绑定诊所',
type: 'link', // type: 'link',
icon: 'uil:edit', // icon: 'uil:edit',
size: 'small', // size: 'small',
// auth: ['doctor', 'sys:role:detail'], // // auth: ['doctor', 'sys:role:detail'],
onClick: showModal.bind(null, row, true), // onClick: showModal.bind(null, row, true),
}, // },
{ {
label: '开通PC端', label: '开通PC端',
type: 'link', type: 'link',
@@ -122,16 +153,24 @@ const openPcWindows = (id: number) => {
}, },
]" ]"
:drop-down-actions="[ :drop-down-actions="[
// { {
// label: '重置密码', label: '审核通过',
// type: 'link', type: 'link',
// icon: 'bitcoin-icons:refresh-filled', icon: 'uil:edit',
// size: 'small', size: 'small',
// popConfirm: { ifShow: row.service_user?.status === 1,
// title: '确定重置密码吗', // auth: ['doctor', 'sys:role:detail'],
// confirm: openPcWindows.bind(null, row.id), 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> </template>