提交 1d76f3e5 authored 作者: leon's avatar leon

临时调订单

上级 deb06025
......@@ -5,12 +5,16 @@ import * as DistributorApi from '/@/api/system/distributorApi';
import get from 'lodash.get';
import * as HospitalApi from '/@/api/system/hospitalApi';
import * as DoctorApi from '/@/api/system/doctorApi';
import * as UserApi from '/@/api/system/userApi';
import { StatusValEnum as DoctorStatusValEnum } from '/@/views/system/doctor/schema';
import { StatusValEnum as UserStatusValEnum } from '/@/views/system/user/schema';
import { RoleEnum } from '/@/views/system/role/role.data';
import { useUserStore } from '/@/store/modules/user';
interface gerPropType {
colProps?: any;
onChange?: any;
}
const userStore = useUserStore();
export const getDistributorText = (text) => {
if (text === 0) {
return '供应商创建';
......@@ -99,7 +103,9 @@ const getDoctorId = ({ colProps }) => {
componentProps: {
labelInValue: true,
api: DoctorApi.all,
params: {},
params: {
status: DoctorStatusValEnum.PASSED,
},
resultField: 'records',
labelField: 'name',
valueField: 'id',
......@@ -108,6 +114,7 @@ const getDoctorId = ({ colProps }) => {
optionFilterProp: 'label',
showSearch: true,
disabled: true,
immediate: false,
},
colProps,
component: 'ApiSelect',
......@@ -124,7 +131,6 @@ const getHospitalIdAndDoctorId = ({ colProps }) => {
getHospitalId({
colProps,
onChange: ({ formActionType, formModel, e }) => {
console.log('onChange', e);
const { updateSchema } = formActionType;
updateSchema([
{ field: 'doctorId', componentProps: { params: { hospitalId: e.value } } },
......@@ -136,4 +142,40 @@ const getHospitalIdAndDoctorId = ({ colProps }) => {
getDoctorId({ colProps }),
];
};
export { getDistributorId, getHospitalId, getDoctorId, getHospitalIdAndDoctorId };
const getSaleUserId = ({ colProps }) => {
return {
field: 'saleUserId',
label: '业务员',
defaultValue: undefined,
form: {
itemProps: {
validateTrigger: 'blur',
},
componentProps: {
labelInValue: true,
api: UserApi.all,
params: {
roel: RoleEnum.SALESMAN,
status: UserStatusValEnum.PASSED,
distributorId: userStore.getDistributorId,
},
resultField: 'records',
labelField: 'name',
valueField: 'id',
allowClear: false,
placeholder: '业务员',
optionFilterProp: 'label',
showSearch: true,
},
colProps,
component: 'ApiSelect',
rules: [{ required: true, type: 'object', message: '请选择业务员' }],
},
table: {
customRender: ({ record }) => {
return get(record, 'user.name');
},
},
};
};
export { getDistributorId, getHospitalId, getDoctorId, getHospitalIdAndDoctorId, getSaleUserId };
......@@ -9,7 +9,7 @@
import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { useUserStore } from '/@/store/modules/user';
import { getDistributorId, getDoctorId, getHospitalId, getHospitalIdAndDoctorId } from '/@/commonSchemaProperty';
import { getDistributorId, getHospitalIdAndDoctorId, getSaleUserId } from '/@/commonSchemaProperty';
export enum YesNoEnum {
YES = '是',
......@@ -89,20 +89,7 @@ export const schema = {
table: {},
},
...getHospitalIdAndDoctorId({ colProps }),
{
field: 'saleUserId',
label: '业务员id',
defaultValue: undefined,
form: {
componentProps: {
allowClear: true,
placeholder: '业务员id',
},
colProps,
component: 'InputNumber',
},
table: {},
},
getSaleUserId({ colProps }),
{
field: 'saleUserName',
label: '业务员名称',
......@@ -417,7 +404,7 @@ const queryFields = [
'type',
'remark',
'deleteStatus',
'editorId',
// 'editorId',
'editorName',
'createTime',
'updateTime',
......
import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
export enum RoleEnum {
SALESMAN = 'salesman',
}
export const columns: BasicColumn[] = [
{
title: '角色名称',
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论