fix: 新增药师
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CI / CI OK (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
Lock Threads / action (push) Has been cancelled
Issue Close Require / close-issues (push) Has been cancelled
Close stale issues / stale (push) Has been cancelled

This commit is contained in:
2025-05-29 17:02:04 +08:00
parent 3c9e64c242
commit 79e5a7c8e4
8 changed files with 404 additions and 50 deletions

View File

@@ -128,22 +128,58 @@ const handleMenuClick = (e: any) => {
getActions?.some((item: ActionItem) => item.type === 'link') ? 0 : 8
"
>
<template v-for="(action, index) in getActions" :key="index">
<div v-if="getActions.length > 2" class="grid grid-cols-2 gap-3 md:gap-4">
<template v-for="(action, index) in getActions" :key="index">
<Popconfirm
v-if="action.popConfirm"
v-bind="getPopConfirmProps(action.popConfirm)"
class="w-full"
>
<template v-if="action.popConfirm.icon" #icon>
<Icon :icon="action.popConfirm.icon" />
</template>
<Button v-bind="getButtonProps(action)" class="w-full">
<template v-if="action.icon" #icon>
<Icon :icon="action.icon" />
</template>
{{ action.label }}
</Button>
</Popconfirm>
<Button
v-else
v-bind="getButtonProps(action)"
@click="action.onClick"
class="w-full"
>
<template v-if="action.icon" #icon>
<Icon :icon="action.icon" />
</template>
{{ action.label }}
</Button>
</template>
</div>
<template v-for="(action, index) in getActions" v-else :key="index">
<Popconfirm
v-if="action.popConfirm"
v-bind="getPopConfirmProps(action.popConfirm)"
class="w-full"
>
<template v-if="action.popConfirm.icon" #icon>
<Icon :icon="action.popConfirm.icon" />
</template>
<Button v-bind="getButtonProps(action)">
<Button v-bind="getButtonProps(action)" class="w-full">
<template v-if="action.icon" #icon>
<Icon :icon="action.icon" />
</template>
{{ action.label }}
</Button>
</Popconfirm>
<Button v-else v-bind="getButtonProps(action)" @click="action.onClick">
<Button
v-else
v-bind="getButtonProps(action)"
@click="action.onClick"
class="w-full"
>
<template v-if="action.icon" #icon>
<Icon :icon="action.icon" />
</template>

View File

@@ -96,6 +96,18 @@ const todoItems = ref<WorkbenchTodoItem[]>([
},
]);
const trendItems: WorkbenchTrendItem[] = [
{
avatar: 'svg:logo',
content: `药师审方功能上线啦!`,
date: '2025-5-26',
title: '萧康云医',
},
{
avatar: 'svg:logo',
content: `诊所、医生、药师基础功能已完成`,
date: '2025-4-30',
title: '萧康云医',
},
{
avatar: 'svg:logo',
content: `医生开方功能上线啦!`,

View File

@@ -8,6 +8,13 @@ const prefix = 'pharmacist/';
export async function getPharmacistList(data: any) {
return requestClient.get<any>(`${prefix}list`, { params: data });
}
/**
* 分页查询用户列表
* @param data
*/
export async function getPharmacistTitleOptionApi(data: any = {}) {
return requestClient.get<any>(`${prefix}title-option`, { params: data });
}
/**
* 分页查询用户列表
* @param data

View File

@@ -5,9 +5,10 @@ import { useVbenModal } from '@vben/common-ui';
import { message, Select } from 'ant-design-vue';
import { updatePharmacistStoreBindApi } from '../api';
import { getStoreOption } from '#/views/system/store/api';
import { updatePharmacistStoreBindApi } from '../api';
const gridApi = ref();
const data = ref();
const optioinData = ref();
@@ -21,7 +22,7 @@ const [Modal, modalApi] = useVbenModal({
onConfirm: async () => {
updatePharmacistStoreBindApi({
doctor_id: data.value.su_id,
store_ids: data.value.stores,
store_ids: data.value.store_ids,
}).then(() => {
modalApi.close();
message.success('保存成功');
@@ -35,7 +36,7 @@ const [Modal, modalApi] = useVbenModal({
if (values) {
// 拷贝 values
data.value = JSON.parse(JSON.stringify(values));
data.value.stores = data.value.stores.map((item: any) => item.store_id);
data.value.store_ids = data.value.bind_stores.map((item: any) => item.id);
getStoreOptionFun();
}
}
@@ -59,7 +60,7 @@ const getStoreOptionFun = () => {
<Modal class="w-[60%]" title="绑定诊所">
<div style="width: 60%; margin: 30px auto;">
<Select
v-model:value="data.stores"
v-model:value="data.store_ids"
:options="optioinData"
mode="multiple"
style="width: 100%"

View File

@@ -3,11 +3,12 @@ import { ref } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { message } from 'ant-design-vue';
import { message, Alert } from 'ant-design-vue';
import { useVbenForm } from '#/adapter/form';
import { createPharmacist, updatePharmacist } from '../api';
import { modalFormProps } from '../config/form';
import { infoModalFormProps } from '../config/form';
defineOptions({
name: 'FormModelDemo',
@@ -16,7 +17,7 @@ defineOptions({
const isUpdate = ref(false);
const gridApi = ref();
const [Form, formApi] = useVbenForm(modalFormProps);
const [Form, formApi] = useVbenForm(infoModalFormProps);
const [Modal, modalApi] = useVbenModal({
fullscreenButton: false,
@@ -51,6 +52,21 @@ const [Modal, modalApi] = useVbenModal({
isUpdate.value = update;
formApi.setValues(values);
}
const img = 'https://img2.baidu.com/it/u=3046024791,55863177&fm=253&fmt=auto&app=138&f=JPEG';
formApi.setValues({
name: '测试药师',
mobile: '15110000000',
idcard: '134111000022225555',
type: 1,
sign_type: 2,
qualification: img,
practicing: img,
title: img,
card_up: img,
card_down: img,
sign_image: img,
avatar: img,
});
}
},
});
@@ -60,6 +76,11 @@ const [Modal, modalApi] = useVbenModal({
:title="`${isUpdate === true ? '编辑' : '新增'}药师`"
class="w-[60%]"
>
<Alert
description="* 添加的时候确认好药师信息,暂时不支持修改"
message="重要提示"
type="error"
/>
<Form />
</Modal>
</template>

View File

@@ -1,6 +1,7 @@
import type { VbenFormProps } from '#/adapter/form';
import {getStoreOption} from "#/views/system/store/api";
import {getPharmacistTitleOptionApi} from "#/views/doctor/pharmacist/api";
export const modalFormProps: VbenFormProps = {
wrapperClass: 'grid-cols-12', // 24栅格,
@@ -52,3 +53,263 @@ export const modalFormProps: VbenFormProps = {
],
showDefaultActions: false,
};
export const infoModalFormProps: VbenFormProps = {
wrapperClass: 'grid-cols-12', // 24栅格,
commonConfig: {
formItemClass: 'col-span-12',
// 所有表单项
componentProps: {
class: 'w-full',
},
},
// handleSubmit: onSubmit,
layout: 'horizontal',
schema: [
{
component: 'VbenInput',
fieldName: 'id',
label: 'ID',
formItemClass: 'col-span-6',
dependencies: {
show: false,
triggerFields: ['id'],
},
},
{
fieldName: 'otherinfo',
label: '基础信息',
component: 'Divider',
formItemClass: 'col-span-12',
componentProps: {},
hideLabel: true,
renderComponentContent: () => {
return {
default: () => {
return '基础信息';
},
};
},
},
{
component: 'Avatar',
componentProps: {
placeholder: '请上传药师头像',
},
fieldName: 'avatar',
formItemClass: 'col-span-12',
label: '药师头像',
rules: 'required',
},
{
component: 'ApiSelect',
componentProps: {
allowClear: true,
filterOption: (input: string, option: any) => {
// 自定义过滤逻辑,确保可以根据 name 进行搜索
return option?.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
},
showSearch: true,
// 菜单接口转options格式
afterFetch: (data: { id: number; name: string }[]) => {
return data.map((item: any) => ({
label: item.name,
value: item.id,
}));
},
api: getStoreOption,
placeholder: '请选择诊所',
model: 'multiple',
},
fieldName: 'store_id',
formItemClass: 'col-span-6',
label: '诊所',
rules: 'required',
},
{
component: 'ApiSelect',
componentProps: {
allowClear: true,
filterOption: (input: string, option: any) => {
// 自定义过滤逻辑,确保可以根据 name 进行搜索
return option?.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
},
showSearch: true,
// 菜单接口转options格式
afterFetch: (data: { id: number; name: string }[]) => {
return data.map((item: any) => ({
label: item.name,
value: item.id,
}));
},
api: getPharmacistTitleOptionApi,
placeholder: '请选择职称',
},
fieldName: 'title_id',
formItemClass: 'col-span-6',
label: '职称',
rules: 'required',
},
{
component: 'VbenInput',
componentProps: {
placeholder: '请填写药师名称',
},
fieldName: 'name',
formItemClass: 'col-span-6',
label: '药师名称',
rules: 'required',
},
{
component: 'VbenInput',
componentProps: {
placeholder: '请填写手机号码',
},
fieldName: 'mobile',
formItemClass: 'col-span-6',
label: '手机号码',
rules: 'required',
},
{
component: 'VbenInput',
componentProps: {
placeholder: '请填写身份证',
},
fieldName: 'idcard',
formItemClass: 'col-span-6',
label: '身份证',
rules: 'required',
},
{
component: 'VbenSelect',
componentProps: {
placeholder: '请填选择身份',
options: [
{
label: '中医药师',
value: 1,
},
{
label: '西医药师',
value: 2,
},
],
},
fieldName: 'type',
formItemClass: 'col-span-6',
label: '身份',
rules: 'required',
},
{
component: 'VbenSelect',
componentProps: {
placeholder: '请填选择签名类型',
options: [
{
label: '电子签名',
value: 1,
},
{
label: '手写签名',
value: 2,
},
],
},
fieldName: 'sign_type',
formItemClass: 'col-span-6',
label: '签名类型',
rules: 'required',
},
{
fieldName: 'otherinfo',
label: '执业&身份信息',
component: 'Divider',
formItemClass: 'col-span-12',
componentProps: {},
hideLabel: true,
renderComponentContent: () => {
return {
default: () => {
return '执业&身份信息';
},
};
},
},
{
component: 'Avatar',
componentProps: {
placeholder: '请上传资格证书',
},
fieldName: 'qualification',
formItemClass: 'col-span-6',
label: '资格证书',
rules: 'required',
},
{
component: 'Avatar',
componentProps: {
placeholder: '请上传执业证书',
},
fieldName: 'practicing',
formItemClass: 'col-span-6',
label: '执业证书',
rules: 'required',
},
{
component: 'Avatar',
componentProps: {
placeholder: '请上传职称证书',
},
fieldName: 'title',
formItemClass: 'col-span-6',
label: '职称证书',
rules: 'required',
},
// {
// fieldName: 'otherinfo',
// label: '身份信息',
// component: 'Divider',
// formItemClass: 'col-span-12',
// componentProps: {},
// hideLabel: true,
// renderComponentContent: () => {
// return {
// default: () => {
// return '身份信息';
// },
// };
// },
// },
{
component: 'Avatar',
componentProps: {
placeholder: '请上传身份证正面',
},
fieldName: 'card_up',
formItemClass: 'col-span-6',
label: '身份证正面',
rules: 'required',
},
{
component: 'Avatar',
componentProps: {
placeholder: '请上传身份证反面',
},
fieldName: 'card_down',
formItemClass: 'col-span-6',
label: '身份证反面',
rules: 'required',
},
{
component: 'Avatar',
componentProps: {
placeholder: '请上传签名图片',
},
fieldName: 'sign_image',
formItemClass: 'col-span-6',
label: '签名图片',
rules: 'required',
},
],
showDefaultActions: false,
};

View File

@@ -12,8 +12,8 @@ import { TableAction } from '#/components/table-action';
import { auditApi, openPcWindowsApi, refuseApi } from './api';
import BindStore from './components/BindStoreModal.vue';
import FormModalDemo from './components/modal.vue';
import PharmacistDetail from './components/detail.vue';
import FormModalDemo from './components/modal.vue';
import { formOptions } from './config/search';
import { gridOptions } from './config/table';
@@ -108,13 +108,13 @@ const refuse = (id: number) => {
<template #toolbar-buttons>
<TableAction
:actions="[
// {
// label: '新增',
// type: 'primary',
// icon: 'ant-design:plus-outlined',
// // auth: ['超级药师', 'sys:user:save'],
// onClick: showModal.bind(null),
// },
{
label: '新增',
type: 'primary',
icon: 'ant-design:plus-outlined',
// auth: ['超级药师', 'sys:user:save'],
onClick: showModal.bind(null),
},
]"
:drop-down-actions="[
// {
@@ -141,8 +141,8 @@ const refuse = (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 v-for="item in row.bind_stores" :key="item.id">
{{ item?.name }}
</p>
</template>
<template #service-user="{ row }">
@@ -172,22 +172,22 @@ const refuse = (id: number) => {
// auth: ['pharmacist', 'sys:role:detail'],
onClick: showPharmacistDetailModal.bind(null, row),
},
// {
// label: '绑定诊所',
// type: 'link',
// icon: 'uil:edit',
// size: 'small',
// // auth: ['pharmacist', 'sys:role:detail'],
// onClick: showBindStoreModal.bind(null, row),
// },
// {
// label: '开通PC端',
// type: 'link',
// icon: 'uil:edit',
// size: 'small',
// // auth: ['pharmacist', 'sys:role:detail'],
// onClick: openPcWindows.bind(null, row.id),
// },
{
label: '绑定诊所',
type: 'link',
icon: 'uil:edit',
size: 'small',
// auth: ['pharmacist', 'sys:role:detail'],
onClick: showBindStoreModal.bind(null, row),
},
{
label: '开通PC端',
type: 'link',
icon: 'uil:edit',
size: 'small',
// auth: ['pharmacist', 'sys:role:detail'],
onClick: openPcWindows.bind(null, row.id),
},
]"
:drop-down-actions="[
{

View File

@@ -122,20 +122,6 @@ const reject = (id) => {
<template #action="{ row }">
<TableAction
:actions="[
{
label: '通过审核',
type: 'link',
// auth: ['超级订单', 'sys:user:save'],
onClick: pass.bind(null, row.id),
},
{
label: '拒绝审核',
type: 'link',
// auth: ['超级订单', 'sys:user:save'],
onClick: reject.bind(null, row.id),
},
]"
:drop-down-actions="[
{
label: '查看处方',
type: 'link',
@@ -150,6 +136,36 @@ const reject = (id) => {
// auth: ['超级订单', 'sys:user:save'],
onClick: openPrescriptionSourceModal.bind(null, row.id),
},
{
label: '通过审核',
type: 'link',
icon: 'marketeq:eye',
// auth: ['超级订单', 'sys:user:save'],
onClick: pass.bind(null, row.id),
},
{
label: '拒绝审核',
type: 'link',
icon: 'marketeq:eye',
// auth: ['超级订单', 'sys:user:save'],
onClick: reject.bind(null, row.id),
},
]"
:drop-down-actions="[
// {
// label: '查看处方',
// type: 'link',
// icon: 'marketeq:eye',
// // auth: ['超级订单', 'sys:user:save'],
// onClick: openPrescriptionDetail.bind(null, row.id),
// },
// {
// label: '处方溯源',
// type: 'link',
// icon: 'marketeq:eye',
// // auth: ['超级订单', 'sys:user:save'],
// onClick: openPrescriptionSourceModal.bind(null, row.id),
// },
]"
/>
</template>