1. 修复了接诊页面的剂量、天数输入框过窄
This commit is contained in:
@@ -5,6 +5,7 @@ const UNUSED_ID_FIELDS = [
|
||||
'doctor_id',
|
||||
'pharmacist_id',
|
||||
'supplier_id',
|
||||
'delivery_warehouse_id',
|
||||
] as const;
|
||||
|
||||
function isEmptyId(value: unknown): boolean {
|
||||
@@ -53,15 +54,24 @@ export function normalizeAdminPayload(
|
||||
toZeroOrOmit(payload, 'store_id', true);
|
||||
toZeroOrOmit(payload, 'doctor_id', true);
|
||||
toZeroOrOmit(payload, 'pharmacist_id', true);
|
||||
toZeroOrOmit(payload, 'delivery_warehouse_id', true);
|
||||
break;
|
||||
case 'deliveryWarehouse':
|
||||
toZeroOrOmit(payload, 'store_id', true);
|
||||
toZeroOrOmit(payload, 'doctor_id', true);
|
||||
toZeroOrOmit(payload, 'pharmacist_id', true);
|
||||
toZeroOrOmit(payload, 'supplier_id', true);
|
||||
break;
|
||||
case 'clinic':
|
||||
toZeroOrOmit(payload, 'doctor_id', true);
|
||||
toZeroOrOmit(payload, 'pharmacist_id', true);
|
||||
toZeroOrOmit(payload, 'supplier_id', true);
|
||||
toZeroOrOmit(payload, 'delivery_warehouse_id', true);
|
||||
break;
|
||||
case 'doctor':
|
||||
toZeroOrOmit(payload, 'pharmacist_id', true);
|
||||
toZeroOrOmit(payload, 'supplier_id', true);
|
||||
toZeroOrOmit(payload, 'delivery_warehouse_id', true);
|
||||
if (isEmptyId(payload.doctor_id)) {
|
||||
payload.doctor_id = 0;
|
||||
}
|
||||
@@ -69,6 +79,7 @@ export function normalizeAdminPayload(
|
||||
case 'pharmacist':
|
||||
toZeroOrOmit(payload, 'doctor_id', true);
|
||||
toZeroOrOmit(payload, 'supplier_id', true);
|
||||
toZeroOrOmit(payload, 'delivery_warehouse_id', true);
|
||||
if (isEmptyId(payload.pharmacist_id)) {
|
||||
payload.pharmacist_id = 0;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ import type { VbenFormProps } from '#/adapter/form';
|
||||
import { useUserStore } from '@vben/stores';
|
||||
|
||||
import { z } from '#/adapter/form';
|
||||
import { getDeliveryWarehouseOption } from '#/views/system/delivery-warehouse/api';
|
||||
import { getSupplierOption } from '#/views/system/supplier/api';
|
||||
|
||||
import type { AdminFormType } from './role-meta';
|
||||
@@ -177,6 +178,29 @@ export function createAdminModalFormProps(
|
||||
});
|
||||
}
|
||||
|
||||
if (formType === 'deliveryWarehouse') {
|
||||
schema.push({
|
||||
component: 'ApiSelect',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
filterOption: true,
|
||||
showSearch: true,
|
||||
afterFetch: (data: { id: number; name: string }[]) => {
|
||||
return data.map((item) => ({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}));
|
||||
},
|
||||
api: getDeliveryWarehouseOption,
|
||||
placeholder: '请选择',
|
||||
},
|
||||
fieldName: 'delivery_warehouse_id',
|
||||
formItemClass: 'col-span-6',
|
||||
label: '所属配送仓库',
|
||||
rules: 'required',
|
||||
});
|
||||
}
|
||||
|
||||
if (formType === 'clinic' || formType === 'doctor' || formType === 'pharmacist') {
|
||||
schema.push({
|
||||
component: 'StorePicker',
|
||||
|
||||
@@ -2,6 +2,7 @@ export type AdminFormType =
|
||||
| 'basic'
|
||||
| 'address'
|
||||
| 'supplier'
|
||||
| 'deliveryWarehouse'
|
||||
| 'clinic'
|
||||
| 'doctor'
|
||||
| 'pharmacist';
|
||||
@@ -28,6 +29,8 @@ export const ADMIN_ROLE_LIST: AdminRoleMeta[] = [
|
||||
{ id: 10, title: '医生', slug: 'doctor', formType: 'doctor' },
|
||||
{ id: 11, title: '药师', slug: 'pharmacist', formType: 'pharmacist' },
|
||||
{ id: 14, title: '诊所推广员', slug: 'clinic-salesperson', formType: 'clinic' },
|
||||
{ id: 15, title: '订单管理员', slug: 'order', formType: 'basic' },
|
||||
{ id: 16, title: '配送仓库管理员', slug: 'delivery-warehouse', formType: 'deliveryWarehouse' },
|
||||
];
|
||||
|
||||
export const ROLE_CITY_MANAGER = 4;
|
||||
|
||||
@@ -82,6 +82,10 @@ function buildColumns(formType: AdminFormType, roleId: number) {
|
||||
cols.push({ field: 'supplier.name', title: '所属供应商' });
|
||||
}
|
||||
|
||||
if (formType === 'deliveryWarehouse') {
|
||||
cols.push({ field: 'delivery_warehouse.name', title: '所属配送仓库' });
|
||||
}
|
||||
|
||||
if (formType === 'clinic' || formType === 'doctor' || formType === 'pharmacist') {
|
||||
cols.push({
|
||||
field: 'store_id',
|
||||
|
||||
@@ -2,11 +2,13 @@ import type { VbenFormProps } from '#/adapter/form';
|
||||
|
||||
import { z } from '#/adapter/form';
|
||||
import { getRoleOption } from '#/views/system/role/api';
|
||||
import { getDeliveryWarehouseOption } from '#/views/system/delivery-warehouse/api';
|
||||
import { getSupplierOption } from '#/views/system/supplier/api';
|
||||
|
||||
const defaultPassword = 'Xk123456@';
|
||||
|
||||
const supplierId = 7;
|
||||
const deliveryWarehouseAdminId = 16;
|
||||
const pharmacistId = 3;
|
||||
const cityId = 4;
|
||||
const districtId = 5;
|
||||
@@ -123,6 +125,32 @@ export const modalFormProps: VbenFormProps = {
|
||||
label: '所属供应商',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
component: 'ApiSelect',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
filterOption: true,
|
||||
showSearch: true,
|
||||
afterFetch: (data: { id: number; name: string }[]) => {
|
||||
return data.map((item: any) => ({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}));
|
||||
},
|
||||
api: getDeliveryWarehouseOption,
|
||||
placeholder: '请选择',
|
||||
},
|
||||
dependencies: {
|
||||
show: (values) => {
|
||||
return values.role_id === deliveryWarehouseAdminId;
|
||||
},
|
||||
triggerFields: ['role_id'],
|
||||
},
|
||||
fieldName: 'delivery_warehouse_id',
|
||||
formItemClass: 'col-span-6',
|
||||
label: '所属配送仓库',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
fieldName: 'password',
|
||||
label: '密码',
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<script lang="ts" setup>
|
||||
/**
|
||||
* 配送仓管理员账号列表(角色 16)
|
||||
*/
|
||||
import AdminPage from '../_shared/admin-page.vue';
|
||||
</script>
|
||||
<template>
|
||||
<AdminPage :role-id="16" />
|
||||
</template>
|
||||
10
apps/web-antd/src/views/system/admin/order/index.vue
Normal file
10
apps/web-antd/src/views/system/admin/order/index.vue
Normal file
@@ -0,0 +1,10 @@
|
||||
<script lang="ts" setup>
|
||||
/**
|
||||
* 订单管理员账号列表(角色 15)
|
||||
* 本阶段仅账号入口,业务菜单权限后续再挂
|
||||
*/
|
||||
import AdminPage from '../_shared/admin-page.vue';
|
||||
</script>
|
||||
<template>
|
||||
<AdminPage :role-id="15" />
|
||||
</template>
|
||||
Reference in New Issue
Block a user