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

临时调订单

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