From 596bbb2fa93739bbe85ac4c805e897feedcc2623 Mon Sep 17 00:00:00 2001 From: lq Date: Wed, 16 Apr 2025 14:48:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8C=BB=E7=94=9F=E5=AE=A1=E6=A0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/doctor/doctor/api/index.ts | 20 ++++ .../src/views/doctor/doctor/config/search.ts | 37 ++++++- .../src/views/doctor/doctor/config/table.ts | 3 +- .../src/views/doctor/doctor/index.vue | 99 +++++++++++++------ 4 files changed, 126 insertions(+), 33 deletions(-) diff --git a/apps/web-antd/src/views/doctor/doctor/api/index.ts b/apps/web-antd/src/views/doctor/doctor/api/index.ts index 5b08e68a..1fde8e27 100644 --- a/apps/web-antd/src/views/doctor/doctor/api/index.ts +++ b/apps/web-antd/src/views/doctor/doctor/api/index.ts @@ -73,6 +73,26 @@ export async function openPcWindowsApi(id: number) { }); } +/** + * 审核通过医生 + * @param id + */ +export async function auditApi(id: number) { + return requestClient.post(`${prefix}audit`, { + id, + }); +} + +/** + * 审核拒绝医生 + * @param id + */ +export async function refuseApi(id: number) { + return requestClient.post(`${prefix}refuse`, { + id, + }); +} + /** * 获取我绑定的银行卡 */ diff --git a/apps/web-antd/src/views/doctor/doctor/config/search.ts b/apps/web-antd/src/views/doctor/doctor/config/search.ts index ab1ca191..6125b673 100644 --- a/apps/web-antd/src/views/doctor/doctor/config/search.ts +++ b/apps/web-antd/src/views/doctor/doctor/config/search.ts @@ -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: { diff --git a/apps/web-antd/src/views/doctor/doctor/config/table.ts b/apps/web-antd/src/views/doctor/doctor/config/table.ts index ce3b6bc8..f25e28ba 100644 --- a/apps/web-antd/src/views/doctor/doctor/config/table.ts +++ b/apps/web-antd/src/views/doctor/doctor/config/table.ts @@ -41,8 +41,9 @@ export const gridOptions: VxeGridProps = { }, { 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: {}, diff --git a/apps/web-antd/src/views/doctor/doctor/index.vue b/apps/web-antd/src/views/doctor/doctor/index.vue index 86da8d3f..02a0363b 100644 --- a/apps/web-antd/src/views/doctor/doctor/index.vue +++ b/apps/web-antd/src/views/doctor/doctor/index.vue @@ -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(); + }); +}; +