diff --git a/src/api/platform/system/controller/address.ts b/src/api/platform/system/controller/address.ts new file mode 100644 index 0000000..12be90f --- /dev/null +++ b/src/api/platform/system/controller/address.ts @@ -0,0 +1,46 @@ +import {AddressParams,AddressItem,AddressItemListResult} from '/@/api/platform/system/entity/addressModel'; +import { defHttp } from '/@/utils/http/axios'; +import {isDef} from '/@/utils/is'; +import {listToTree} from '/@/utils/helper/treeHelper'; + +const prefix = '/system_proxy/system'; + +enum Api { + QueryById = '/address/query', + List = '/address/list', + QueryByParentIds = '/address/queryByParentIds', + Add = '/address/add', + Update = '/address/update', + Remove = '/address/remove' +} + +export const queryById = (params: { id: String }) => + defHttp.get({url: prefix + Api.QueryById + `/${params.id}`}); + +export const treeList = (params: AddressParams) => { + return defHttp.get({url: prefix + Api.List, params}).then(data =>{ + return listToTree(data, { + id: 'code', + parentId: 'parentId' + }); + }); +}; + +export const list = (params: AddressParams) => + defHttp.get({url: prefix + Api.List, params}); + + +export const queryByParentIds = (params) => + defHttp.get({url: prefix + Api.QueryByParentIds + `/${params}`}); + + +export const set = (params: AddressItem) => { + if (isDef(params.code)){ + defHttp.put({url: prefix + Api.Update, params}); + }else { + defHttp.post({url: prefix + Api.Add, params}); + } +}; + +export const remove = (params: {ids: String}) => + defHttp.delete({url: prefix + Api.Remove + `/${params.ids}`}); \ No newline at end of file diff --git a/src/api/platform/system/controller/doctor.ts b/src/api/platform/system/controller/doctor.ts new file mode 100644 index 0000000..2524836 --- /dev/null +++ b/src/api/platform/system/controller/doctor.ts @@ -0,0 +1,30 @@ +import {DoctorParams,DoctorItem,DoctorItemListResult} from '/@/api/platform/system/entity/doctorModel'; +import { defHttp } from '/@/utils/http/axios'; +import {isDef} from '/@/utils/is'; + +const prefix = '/system_proxy/system'; + +enum Api { + QueryById = '/doctor/query', + List = '/doctor/list', + Add = '/doctor/add', + Update = '/doctor/update', + Remove = '/doctor/remove' +} + +export const queryById = (params: { id: String }) => + defHttp.get({url: prefix + Api.QueryById + `/${params.id}`}); + +export const list = (params: DoctorParams) => + defHttp.get({url: prefix + Api.List, params}); + +export const set = (params: DoctorItem) => { + if (isDef(params.id)){ + defHttp.put({url: prefix + Api.Update, params}); + }else { + defHttp.post({url: prefix + Api.Add, params}); + } +}; + +export const remove = (params: {ids: String}) => + defHttp.delete({url: prefix + Api.Remove + `/${params.ids}`}); \ No newline at end of file diff --git a/src/api/platform/system/controller/hospital.ts b/src/api/platform/system/controller/hospital.ts new file mode 100644 index 0000000..5898cc8 --- /dev/null +++ b/src/api/platform/system/controller/hospital.ts @@ -0,0 +1,30 @@ +import {HospitalParams,HospitalItem,HospitalItemListResult} from '/@/api/platform/system/entity/hospitalModel'; +import { defHttp } from '/@/utils/http/axios'; +import {isDef} from '/@/utils/is'; + +const prefix = '/system_proxy/system'; + +enum Api { + QueryById = '/hospital/query', + List = '/hospital/list', + Add = '/hospital/add', + Update = '/hospital/update', + Remove = '/hospital/remove' +} + +export const queryById = (params: { id: String }) => + defHttp.get({url: prefix + Api.QueryById, params}); + +export const list = (params: HospitalParams) => + defHttp.get({url: prefix + Api.List, params}); + +export const set = (params: HospitalItem) => { + if (isDef(params.id)){ + defHttp.put({url: prefix + Api.Update, params}); + }else { + defHttp.post({url: prefix + Api.Add, params}); + } +}; + +export const remove = (params: {ids: String}) => + defHttp.delete({url: prefix + Api.Remove + `/${params.ids}`}); \ No newline at end of file diff --git a/src/api/platform/system/controller/institution.ts b/src/api/platform/system/controller/institution.ts new file mode 100644 index 0000000..ddf2d50 --- /dev/null +++ b/src/api/platform/system/controller/institution.ts @@ -0,0 +1,31 @@ + +import {InstitutionParams,InstitutionItem,InstitutionItemListResult} from '/@/api/platform/system/entity/institutionModel'; +import { defHttp } from '/@/utils/http/axios'; +import {isDef} from '/@/utils/is'; + +const prefix = '/system_proxy/system'; + +enum Api { + QueryById = '/institution/query', + List = '/institution/list', + Add = '/institution/add', + Update = '/institution/update', + Remove = '/institution/remove' +} + +export const queryById = (params: { id: String }) => + defHttp.get({url: prefix + Api.QueryById, params}); + +export const list = (params: InstitutionParams) => + defHttp.get({url: prefix + Api.List, params}); + +export const set = (params: InstitutionItem) => { + if (isDef(params.id)){ + defHttp.put({url: prefix + Api.Update, params}); + }else { + defHttp.post({url: prefix + Api.Add, params}); + } +}; + +export const remove = (params: {ids: String}) => + defHttp.delete({url: prefix + Api.Remove + `/${params.ids}`}); \ No newline at end of file diff --git a/src/api/platform/system/controller/office.ts b/src/api/platform/system/controller/office.ts new file mode 100644 index 0000000..997c3f2 --- /dev/null +++ b/src/api/platform/system/controller/office.ts @@ -0,0 +1,30 @@ +import {OfficeParams,OfficeItem,OfficeItemListResult} from '/@/api/platform/system/entity/officeModel'; +import { defHttp } from '/@/utils/http/axios'; +import {isDef} from '/@/utils/is'; + +const prefix = '/system_proxy/system'; + +enum Api { + QueryById = '/office/getById', + List = '/office/list', + Add = '/office/add', + Update = '/office/update', + Remove = '/office/remove' +} + +export const queryById = (params: { id: String }) => + defHttp.get({url: prefix + Api.QueryById, params}); + +export const list = (params: OfficeParams) => + defHttp.get({url: prefix + Api.List, params}); + +export const set = (params: OfficeItem) => { + if (isDef(params.id)){ + defHttp.put({url: prefix + Api.Update, params}); + }else { + defHttp.post({url: prefix + Api.Add, params}); + } +}; + +export const remove = (params: {ids: String}) => + defHttp.delete({url: prefix + Api.Remove + `/${params.ids}`}); \ No newline at end of file diff --git a/src/api/platform/system/controller/project.ts b/src/api/platform/system/controller/project.ts new file mode 100644 index 0000000..42c9476 --- /dev/null +++ b/src/api/platform/system/controller/project.ts @@ -0,0 +1,30 @@ +/** + * 提供api模板规范代码参考,请尽量保证编写代码风格跟模板规范代码一致 + * Copyright © 2020-2022 entfrm All rights reserved. + * author entfrm开发团队-王翔 + */ +import type { ProjectParams, Project } from '../entity/project'; +import { defHttp } from '/@/utils/http/axios'; + +enum Api { + list = '/system_proxy/system/project/list', + add = '/system_proxy/system/project/save', + get = '/system_proxy/system/project', + edit = '/system_proxy/system/project/update', + del = '/system_proxy/system/project/remove', +} + +/** 查询项目列表 */ +export const listProject = (params?: Partial) => defHttp.get({ url: Api.list, params }); + +/** 新增项目 */ +export const addProject = (params: Partial) => defHttp.post({ url: Api.add, data: params }); + +/** 修改项目 */ +export const editProject = (params: Partial) => defHttp.put({ url: Api.edit, data: params }); + +/** 查询项目详细 */ +export const getProject = (id: string) => defHttp.get({ url: `${Api.get}/${id}` }); + +/** 删除项目 */ +export const delProject = (id: string) => defHttp.delete({ url: `${Api.del}/${id}` }); diff --git a/src/api/platform/system/entity/addressModel.ts b/src/api/platform/system/entity/addressModel.ts new file mode 100644 index 0000000..383cda0 --- /dev/null +++ b/src/api/platform/system/entity/addressModel.ts @@ -0,0 +1,26 @@ +// 引入基础包 +import type { R } from '/#/axios'; +import type { TreeEntity,Page } from '/@/api/common/data/entity'; + +export type AddressParams = { + parentId?: string; + code?: string; + level?:string; + name?: string; + beginTime?: string; + endTime?: string; +} & Page; + + +export interface AddressItem extends TreeEntity{ + + code: string; + + level: number; + + lastLevel: boolean; + + +} + +export type AddressItemListResult = R; \ No newline at end of file diff --git a/src/api/platform/system/entity/doctorModel.ts b/src/api/platform/system/entity/doctorModel.ts new file mode 100644 index 0000000..d1e36b0 --- /dev/null +++ b/src/api/platform/system/entity/doctorModel.ts @@ -0,0 +1,49 @@ +// 引入基础包 +import type { R } from '/#/axios'; +import type { Page } from '/@/api/common/data/entity'; + +export type DoctorParams = { + name?: string; + beginTime?: string; + endTime?: string; +} & Page; + + +export interface DoctorItem { + + /**医生ID*/ + id: string; + /**医生姓名*/ + name: string; + /**医生职称*/ + title: string; + /**医生性别*/ + sex: string; + /**医生电话*/ + phone: string; + /**医生邮箱*/ + email: string; + /**地址(门牌号)*/ + detailAddress: string; + /**组织类型*/ + organType: number; + /**组织id*/ + organId: string; + /**组织名称*/ + organName: string; + /**科室ID*/ + officeId: string; + /**科室名称*/ + officeName: string; + /**医生状态*/ + status: string; + + createById: string; + + createByName: string; + + createTime: string; + +} + +export type DoctorItemListResult = R; \ No newline at end of file diff --git a/src/api/platform/system/entity/hospitalModel.ts b/src/api/platform/system/entity/hospitalModel.ts new file mode 100644 index 0000000..1357965 --- /dev/null +++ b/src/api/platform/system/entity/hospitalModel.ts @@ -0,0 +1,44 @@ +// 引入基础包 +import type { R } from '/#/axios'; +import type { CommonEntity,Page } from '/@/api/common/data/entity'; + +export type HospitalParams = { + name?: string; + beginTime?: string; + endTime?: string; +} & Page; + + +export interface HospitalItem extends CommonEntity{ + + id: string; + + name: string; + + type: number; + + contactsName: string; + + contactsTel: string; + + contactsTitle: string; + + payment: string; + + addressIds: string; + + detailAddress: string; + + status: string; + + createById: string; + + createByName: string; + + createTime: string; + + remarks: string; + +} + +export type HospitalItemListResult = R; \ No newline at end of file diff --git a/src/api/platform/system/entity/institutionModel.ts b/src/api/platform/system/entity/institutionModel.ts new file mode 100644 index 0000000..d8b69ab --- /dev/null +++ b/src/api/platform/system/entity/institutionModel.ts @@ -0,0 +1,39 @@ +// 引入基础包 +import type { R } from '/#/axios'; +import type { CommonEntity,Page } from '/@/api/common/data/entity'; + +export type InstitutionParams = { + name?: string; + beginTime?: string; + endTime?: string; +} & Page; + + +export interface InstitutionItem extends CommonEntity{ + + id: string; + + name: string; + + type: number; + + contactsName: string; + + contactsTel: string; + + contactsTitle: string; + + addressId: string; + + detailAddress: string; + + status: string; + + createById: string; + + createByName: string; + + createTime: string; +} + +export type InstitutionItemListResult = R; \ No newline at end of file diff --git a/src/api/platform/system/entity/officeModel.ts b/src/api/platform/system/entity/officeModel.ts new file mode 100644 index 0000000..10c883f --- /dev/null +++ b/src/api/platform/system/entity/officeModel.ts @@ -0,0 +1,41 @@ +// 引入基础包 +import type { R } from '/#/axios'; +import type { CommonEntity,Page } from '/@/api/common/data/entity'; + +export type OfficeParams = { + name?: string; + beginTime?: string; + endTime?: string; +} & Page; + + +export interface OfficeItem extends CommonEntity{ + + id: string; + + name: string; + + organType: number; + + organId: string; + + organName: string; + + directorName: string; + + directorTel: string; + + detailAddress: string; + + status: string; + + createById: string; + + createByName: string; + + createTime: string; + + remarks: string; +} + +export type OfficeItemListResult = R; \ No newline at end of file diff --git a/src/api/platform/system/entity/project.ts b/src/api/platform/system/entity/project.ts new file mode 100644 index 0000000..1a1d4a1 --- /dev/null +++ b/src/api/platform/system/entity/project.ts @@ -0,0 +1,30 @@ +/** + * @program: kicc-ui + * @description: 部门实体类 + * 类型定义 + * @author: entfrm开发团队-王翔 + * @create: 2022/4/8 + */ +import type { R } from '/#/axios'; +import type { CommonEntity, Page } from '/@/api/common/data/entity'; + +/** 部门查询参数 */ +export type ProjectParams = Page & Project; + +/** 部门对象 */ +export interface Project extends CommonEntity { + projectId: string; + code: string; + name: string; + parentId: string; + sort: number; + contacts: string; + phone: string; + address: string; + email: string; + status: string; + [key: string]: any; +} + +/** 项目响应对象 */ +export type ProjectResult = R; \ No newline at end of file diff --git a/src/views/institution/doctor/DoctorModal.vue b/src/views/institution/doctor/DoctorModal.vue new file mode 100644 index 0000000..61b195d --- /dev/null +++ b/src/views/institution/doctor/DoctorModal.vue @@ -0,0 +1,53 @@ + + + \ No newline at end of file diff --git a/src/views/institution/doctor/doctor.data.ts b/src/views/institution/doctor/doctor.data.ts new file mode 100644 index 0000000..1697126 --- /dev/null +++ b/src/views/institution/doctor/doctor.data.ts @@ -0,0 +1,232 @@ +import { BasicColumn } from '/@/components/Table'; +import { FormSchema } from '/@/components/Table'; +import {h} from "vue"; +import {Tag} from "ant-design-vue"; +import { list as hospitalList } from "/@/api/platform/system/controller/hospital"; +import {list as institutionList, list as institutalList} from "/@/api/platform/system/controller/institution"; +import { list as officeList } from "/@/api/platform/system/controller/office"; + + +export const columns: BasicColumn[] = [ + { + title: 'ID', + dataIndex: 'id', + width: 120, + }, + { + title: '医生姓名', + dataIndex: 'name', + width: 120, + }, + { + title: '医生职称', + dataIndex: 'title', + width: 120, + }, + { + title: '医生性别', + dataIndex: 'sex', + width: 120, + customRender: ({ record }) => { + switch (record.sex) { + case 'M': return '男'; + case 'F': return '女'; + default: return '未知'; + } + } + }, + { + title: '医生电话', + dataIndex: 'phone', + width: 120, + }, + { + title: '医生邮箱', + dataIndex: 'email', + width: 120, + }, + { + title: '地址', + dataIndex: 'detailAddress', + width: 120, + }, + { + title: '所属组织类型', + dataIndex: 'organType', + width: 120, + customRender: ({ record }) => { + const organType = record.organType; + let text = ''; + let color = ''; + switch (organType) { + case '1': + text = '医院'; + color = 'green'; + break; + case '2': + text = '医检'; + color = 'blue'; + break; + default: + text = '未知'; + color = 'gray'; + break; + } + return h(Tag, { color: color }, () => text); + } + }, + { + title: '组织名称', + dataIndex: 'organName', + width: 120, + }, + { + title: '科室名称', + dataIndex: 'officeName', + width: 120, + }, + { + title: '状态', + dataIndex: 'status', + width: 100, + customRender: ({ record }) => { + const status = record.status; + const enable = status === '0'; + const color = enable ? 'green' : 'red'; + const text = enable ? '启用' : '禁用'; + return h(Tag, { color: color }, () => text); + }, + }, + { + title: '创建人', + dataIndex: 'createByName', + width: 180, + }, + { + title: '创建时间', + dataIndex: 'createTime', + width: 180, + } +]; + +export const searchFormSchema: FormSchema[] = [ + { + field: 'name', + label: '医生姓名', + component: 'Input', + componentProps: { + placeholder: '请输入医生姓名', + }, + colProps: { span: 5 }, + }, + { + field: 'beginTime', + label: '起始时间', + component: 'DatePicker', + colProps: { span: 5 }, + }, + { + field: 'endTime', + label: '截止时间', + component: 'DatePicker', + colProps: { span: 5 }, + }, +]; + +export const doctorFormSchema: FormSchema[] = [ + { + field: 'id', + label: 'ID', + component: 'Input', + show: false, + }, + { + field: 'name', + label: '医生姓名', + component: 'Input', + required: true + }, + { + field: 'title', + label: '医生职称', + component: 'Input', + required: false, + }, + { + field: 'sex', + label: '医生性别', + component: 'Select', + required: false, + defaultValue: 'M', + componentProps: { + options: [ + { label: '男', value: 'M' }, + { label: '女', value: 'F' }, + ] + } + }, + { + field: 'phone', + label: '医生电话', + component: 'Input', + required: false, + }, + { + field: 'email', + label: '医生邮箱', + component: 'Input', + required: false, + }, + { + field: 'detailAddress', + label: '地址', + component: 'Input', + required: false, + }, + { + field: 'organType', + label: '所属组织类型', + component: 'Select', + componentProps: { + options: [ + { label: '医院', value: 1 }, + { label: '医检', value: 2 } + ] + }, + required: true, + }, + { + field: 'organId', + label: '所属组织', + component: 'ApiSelect', + required: true, + renderComponentContent: renderCallbackParams => { + const organType = renderCallbackParams.model.organType; + const dataApi = organType==1 ? hospitalList : institutionList; + + renderCallbackParams.schema.componentProps = { + resultField: 'list', + labelField: 'name', + valueField: 'id', + api: dataApi + } + }, + }, + { + field: 'status', + label: '状态', + component: 'RadioButtonGroup', + defaultValue: '0', + componentProps: { + options: [ + { label: '启用', value: '0' }, + { label: '禁用', value: '1' }, + ], + }, + }, + { + label: '备注', + field: 'remarks', + component: 'InputTextArea', + } +]; \ No newline at end of file diff --git a/src/views/institution/doctor/index.vue b/src/views/institution/doctor/index.vue new file mode 100644 index 0000000..3120fc0 --- /dev/null +++ b/src/views/institution/doctor/index.vue @@ -0,0 +1,94 @@ + + + \ No newline at end of file diff --git a/src/views/institution/hospital/HospitalModal.vue b/src/views/institution/hospital/HospitalModal.vue new file mode 100644 index 0000000..6aa6917 --- /dev/null +++ b/src/views/institution/hospital/HospitalModal.vue @@ -0,0 +1,61 @@ + + + \ No newline at end of file diff --git a/src/views/institution/hospital/hospital.data.ts b/src/views/institution/hospital/hospital.data.ts new file mode 100644 index 0000000..92beee1 --- /dev/null +++ b/src/views/institution/hospital/hospital.data.ts @@ -0,0 +1,230 @@ +import { BasicColumn } from '/@/components/Table'; +import { FormSchema } from '/@/components/Table'; +import {h} from "vue"; +import {Tag} from "ant-design-vue"; +import {list as addressList} from "/@/api/platform/system/controller/address"; +import {list as institutionList} from "/@/api/platform/system/controller/institution" + + +export const columns: BasicColumn[] = [ + { + title: 'ID', + dataIndex: 'id', + width: 120, + }, + { + title: '医院名', + dataIndex: 'name', + width: 120, + }, + { + title: '医院类型', + dataIndex: 'card', + width: 120, + customRender: ({ record }) =>{ + const type = record.type; + let text = ''; + let color = ''; + switch (type) { + case '1': + text = '合作医院'; + color = 'green'; + break; + case '0': + text = '其他医院'; + color = 'gray'; + break; + default: + text = '其他医院'; + color = 'gray'; + break; + } + + return h(Tag, { color: color }, () => text); + } + }, + { + title: '联系人', + dataIndex: 'contactsName', + width: 120, + }, + { + title: '联系人电话', + dataIndex: 'contactsTel', + width: 120, + }, + { + title: '联系人职称', + dataIndex: 'contactsTitle', + width: 120, + }, + { + title: '支付方式', + dataIndex: 'payment', + width: 120, + customRender: ({ record }) => { + const com = record.payment; + switch (com) { + case '0': return '月付'; + case '1': return '预约付款'; + case '2': return '采样付款'; + default: return '月付'; + } + } + }, + { + title: '详细地址', + dataIndex: 'detailAddress', + width: 180, + }, + { + title: '状态', + dataIndex: 'status', + width: 100, + customRender: ({ record }) => { + const status = record.status; + const enable = status === '0'; + const color = enable ? 'green' : 'red'; + const text = enable ? '启用' : '禁用'; + return h(Tag, { color: color }, () => text); + }, + }, + { + title: '创建人', + dataIndex: 'createByName', + width: 180, + }, + { + title: '创建时间', + dataIndex: 'createTime', + width: 180, + } +]; + +export const searchFormSchema: FormSchema[] = [ + { + field: 'name', + label: '医院名称', + component: 'Input', + componentProps: { + placeholder: '请输入医院名称', + }, + colProps: { span: 5 }, + }, + { + field: 'beginTime', + label: '起始时间', + component: 'DatePicker', + colProps: { span: 5 }, + }, + { + field: 'endTime', + label: '截止时间', + component: 'DatePicker', + colProps: { span: 5 }, + }, +]; + +export const hospitalFormSchema: FormSchema[] = [ + { + field: 'id', + label: 'ID', + component: 'Input', + show: false, + }, + { + field: 'name', + label: '医院名称', + component: 'Input', + required: true + }, + { + field: 'type', + label: '医院类型', + component: 'Select', + defaultValue: '0', + componentProps: { + options: [ + {label: '合作医院',value: '1'}, + {label: '其他医院',value: '0'}, + ] + }, + required: true, + }, + { + field: 'contactsName', + label: '联系人名称', + component: 'Input', + required: true + }, + { + field: 'contactsTel', + label: '联系人电话', + component: 'Input', + required: true + }, + { + field: 'contactsTitle', + label: '联系人职称', + component: 'Input', + required: true + }, + + { + field: 'payment', + label: '支付方式', + component: 'Select', + required: true, + defaultValue: '0', + componentProps: { + options: [ + { label: '月付', value: '0' }, + { label: '预约付款', value: '1' }, + { label: '采样付款', value: '2' }, + ], + } + }, + /* { + field: 'addressIds', + label: '地址', + component: 'ApiAddressCascader', + componentProps: { + api: addressList, + } + },*/ + { + field: 'detailAddress', + label: '详细地址', + component: 'Input', + required: true + }, + { + field: 'status', + label: '状态', + component: 'RadioButtonGroup', + defaultValue: '0', + componentProps: { + options: [ + { label: '启用', value: '0' }, + { label: '禁用', value: '1' }, + ], + }, + }, + { + field: 'institutionIds', + label: '关联机构', + component: 'ApiSelect', + componentProps: { + mode: "multiple", + resultField: 'list', + labelField: 'name', + valueField: 'id', + api: institutionList, + } + }, + { + label: '备注', + field: 'remarks', + component: 'InputTextArea', + } +]; \ No newline at end of file diff --git a/src/views/institution/hospital/index.vue b/src/views/institution/hospital/index.vue new file mode 100644 index 0000000..2d9012b --- /dev/null +++ b/src/views/institution/hospital/index.vue @@ -0,0 +1,94 @@ + + + \ No newline at end of file diff --git a/src/views/institution/institution/InstitutionModal.vue b/src/views/institution/institution/InstitutionModal.vue new file mode 100644 index 0000000..c3f098a --- /dev/null +++ b/src/views/institution/institution/InstitutionModal.vue @@ -0,0 +1,53 @@ + + + \ No newline at end of file diff --git a/src/views/institution/institution/index.vue b/src/views/institution/institution/index.vue new file mode 100644 index 0000000..127182c --- /dev/null +++ b/src/views/institution/institution/index.vue @@ -0,0 +1,94 @@ + + + \ No newline at end of file diff --git a/src/views/institution/institution/institution.data.ts b/src/views/institution/institution/institution.data.ts new file mode 100644 index 0000000..549e9e8 --- /dev/null +++ b/src/views/institution/institution/institution.data.ts @@ -0,0 +1,193 @@ +import { BasicColumn } from '/@/components/Table'; +import { FormSchema } from '/@/components/Table'; +import {h} from "vue"; +import {Tag} from "ant-design-vue"; +import {list as addressList} from "/@/api/platform/system/controller/address"; + + +export const columns: BasicColumn[] = [ + { + title: 'ID', + dataIndex: 'id', + width: 120, + }, + { + title: '医检名', + dataIndex: 'name', + width: 120, + }, + { + title: '医检类型', + dataIndex: 'card', + width: 120, + customRender: ({ record }) =>{ + const type = record.type; + let text = ''; + let color = ''; + switch (type) { + case '1': + text = '医检机构'; + color = 'green'; + break; + case '2': + text = '三甲机构'; + color = 'blue'; + break; + case '0': + text = '其他机构'; + color = 'gray'; + break; + default: + text = '其他医院'; + color = 'gray'; + break; + } + + return h(Tag, { color: color }, () => text); + } + }, + { + title: '联系人', + dataIndex: 'contactsName', + width: 120, + }, + { + title: '联系人电话', + dataIndex: 'contactsTel', + width: 120, + }, + { + title: '联系人职称', + dataIndex: 'contactsTitle', + width: 120, + }, + { + title: '详细地址', + dataIndex: 'detailAddress', + width: 180, + }, + { + title: '状态', + dataIndex: 'status', + width: 100, + customRender: ({ record }) => { + const status = record.status; + const enable = status === '0'; + const color = enable ? 'green' : 'red'; + const text = enable ? '启用' : '禁用'; + return h(Tag, { color: color }, () => text); + }, + }, + { + title: '创建人', + dataIndex: 'createByName', + width: 180, + }, + { + title: '创建时间', + dataIndex: 'createTime', + width: 180, + } +]; + +export const searchFormSchema: FormSchema[] = [ + { + field: 'name', + label: '医院名称', + component: 'Input', + componentProps: { + placeholder: '请输入医院名称', + }, + colProps: { span: 5 }, + }, + { + field: 'beginTime', + label: '起始时间', + component: 'DatePicker', + colProps: { span: 5 }, + }, + { + field: 'endTime', + label: '截止时间', + component: 'DatePicker', + colProps: { span: 5 }, + }, +]; + +export const institutionFormSchema: FormSchema[] = [ + { + field: 'id', + label: 'ID', + component: 'Input', + show: false, + }, + { + field: 'name', + label: '机构名称', + component: 'Input', + required: true + }, + { + field: 'type', + label: '机构类型', + component: 'Select', + defaultValue: '0', + componentProps: { + options: [ + {label: '医检机构',value: '1'}, + {label: '三甲机构',value: '2'}, + {label: '其他机构',value: '0'}, + ] + }, + required: true, + }, + { + field: 'contactsName', + label: '联系人名称', + component: 'Input', + required: true + }, + { + field: 'contactsTel', + label: '联系人电话', + component: 'Input', + required: true + }, + { + field: 'contactsTitle', + label: '联系人职称', + component: 'Input', + required: true + }, +/* { + field: 'addressIds', + label: '地址', + component: 'ApiAddressCascader', + componentProps: { + api: addressList + } + },*/ + { + field: 'detailAddress', + label: '详细地址', + component: 'Input', + required: true + }, + { + field: 'status', + label: '状态', + component: 'RadioButtonGroup', + defaultValue: '0', + componentProps: { + options: [ + { label: '启用', value: '0' }, + { label: '禁用', value: '1' }, + ], + }, + }, + { + label: '备注', + field: 'remarks', + component: 'InputTextArea', + } +]; \ No newline at end of file diff --git a/src/views/institution/office/OfficeModal.vue b/src/views/institution/office/OfficeModal.vue new file mode 100644 index 0000000..e0859ec --- /dev/null +++ b/src/views/institution/office/OfficeModal.vue @@ -0,0 +1,53 @@ + + + \ No newline at end of file diff --git a/src/views/institution/office/index.vue b/src/views/institution/office/index.vue new file mode 100644 index 0000000..ee22ad6 --- /dev/null +++ b/src/views/institution/office/index.vue @@ -0,0 +1,94 @@ + + + \ No newline at end of file diff --git a/src/views/institution/office/office.data.ts b/src/views/institution/office/office.data.ts new file mode 100644 index 0000000..4e85a12 --- /dev/null +++ b/src/views/institution/office/office.data.ts @@ -0,0 +1,190 @@ +import { BasicColumn } from '/@/components/Table'; +import { FormSchema } from '/@/components/Table'; +import {h} from "vue"; +import {Tag} from "ant-design-vue"; +import { list as hospitalList } from "/@/api/platform/system/controller/hospital"; +import { list as institutionList } from "/@/api/platform/system/controller/institution"; + + +export const columns: BasicColumn[] = [ + { + title: 'ID', + dataIndex: 'id', + width: 120, + }, + { + title: '科室名称', + dataIndex: 'name', + width: 120, + }, + { + title: '所属组织类型', + dataIndex: 'organType', + width: 120, + customRender: ({ record }) => { + const organType = record.organType; + let text = ''; + let color = ''; + switch (organType) { + case '1': + text = '医院'; + color = 'green'; + break; + case '2': + text = '医检'; + color = 'blue'; + break; + default: + text = '未知'; + color = 'gray'; + break; + } + return h(Tag, { color: color }, () => text); + } + }, + { + title: '组织名称', + dataIndex: 'organName', + width: 120, + }, + { + title: '主任名称', + dataIndex: 'directorName', + width: 120, + }, + { + title: '主任电话', + dataIndex: 'directorTel', + width: 120, + }, + { + title: '地址', + dataIndex: 'detailAddress', + width: 120, + }, + { + title: '状态', + dataIndex: 'status', + width: 100, + customRender: ({ record }) => { + const status = record.status; + const enable = status === '0'; + const color = enable ? 'green' : 'red'; + const text = enable ? '启用' : '禁用'; + return h(Tag, { color: color }, () => text); + }, + }, + { + title: '创建人', + dataIndex: 'createByName', + width: 180, + }, + { + title: '创建时间', + dataIndex: 'createTime', + width: 180, + } +]; + +export const searchFormSchema: FormSchema[] = [ + { + field: 'name', + label: '科室名称', + component: 'Input', + componentProps: { + placeholder: '请输入科室名称', + }, + colProps: { span: 5 }, + }, + { + field: 'beginTime', + label: '起始时间', + component: 'DatePicker', + colProps: { span: 5 }, + }, + { + field: 'endTime', + label: '截止时间', + component: 'DatePicker', + colProps: { span: 5 }, + }, +]; + +export const officeFormSchema: FormSchema[] = [ + { + field: 'id', + label: 'ID', + component: 'Input', + show: false, + }, + { + field: 'name', + label: '科室名称', + component: 'Input', + required: true + }, + { + field: 'organType', + label: '所属组织类型', + component: 'Select', + componentProps: { + options: [ + { label: '医院', value: 1 }, + { label: '医检', value: 2 } + ] + }, + required: true, + }, + { + field: 'organId', + label: '所属组织', + component: 'ApiSelect', + required: true, + renderComponentContent: renderCallbackParams => { + const organType = renderCallbackParams.model.organType; + const dataApi = organType==1 ? hospitalList : institutionList; + + renderCallbackParams.schema.componentProps = { + resultField: 'list', + labelField: 'name', + valueField: 'id', + api: dataApi + } + }, + }, + { + field: 'directorName', + label: '主任名称', + component: 'Input', + required: false + }, + { + field: 'directorTel', + label: '主任电话', + component: 'Input', + required: false + }, + { + field: 'detailAddress', + label: '科室地址', + component: 'Input', + required: false + }, + { + field: 'status', + label: '状态', + component: 'RadioButtonGroup', + defaultValue: '0', + componentProps: { + options: [ + { label: '启用', value: '0' }, + { label: '禁用', value: '1' }, + ], + }, + }, + { + label: '备注', + field: 'remarks', + component: 'InputTextArea', + } +]; \ No newline at end of file diff --git a/src/views/system/project/ProjectModal.vue b/src/views/system/project/ProjectModal.vue new file mode 100644 index 0000000..1e409f6 --- /dev/null +++ b/src/views/system/project/ProjectModal.vue @@ -0,0 +1,89 @@ + + \ No newline at end of file diff --git a/src/views/system/project/index.vue b/src/views/system/project/index.vue new file mode 100644 index 0000000..a7122ce --- /dev/null +++ b/src/views/system/project/index.vue @@ -0,0 +1,116 @@ + + + \ No newline at end of file diff --git a/src/views/system/project/project.data.ts b/src/views/system/project/project.data.ts new file mode 100644 index 0000000..35d33c9 --- /dev/null +++ b/src/views/system/project/project.data.ts @@ -0,0 +1,191 @@ +/** + * @program: kicc-ui + * @description: 部门模块动态渲染配置 + * @author: entfrm开发团队-王翔 + * @create: 2022/4/21 + */ + +import { BasicColumn } from '/@/components/Table'; +import { FormSchema } from '/@/components/Table'; +import { h } from 'vue'; +import { Tag } from 'ant-design-vue'; + +/** 表格列配置 */ +export const columns: BasicColumn[] = [ + { + title: '项目名称', + dataIndex: 'name', + align: 'left' + }, + { + title: '项目编码', + dataIndex: 'code' + }, + { + title: '排序', + dataIndex: 'sort' + }, + { + title: '状态', + dataIndex: 'status', + width: 80, + customRender: ({record}) => { + const status = record.status; + // 采用二进制~~取反,只要为null或者0等等一些其他的空元素都会转为0 + // 第一次取反会运算为-1,在后一次取反会运算为0 + const enable = ~~status === 0; + const color = enable ? 'green' : 'red'; + const text = enable ? '正常' : '停用'; + return h(Tag, { color: color }, () => text); + } + }, + { + title: '创建时间', + dataIndex: 'createTime' + } +]; + +/** 搜索表单配置 */ +export const searchFormSchema: FormSchema[] = [ + { + field: 'name', + label: '项目名称', + component: 'Input', + componentProps: { + placeholder: '请输入项目名称' + }, + colProps: {span: 8} + }, + { + field: 'status', + label: '状态', + component: 'Select', + componentProps: { + options: [ + { label: '正常', value: '0' }, + { label: '停用', value: '1' } + ] + }, + colProps: { span: 7 } + }, + { + field: 'dateRange', + label: '创建时间', + component: 'RangePicker', + componentProps: { + style: { width:'100%' }, + valueFormat: 'YYYY-MM-DD', + placeholder: ['开始日期','结束日期'] + }, + colProps: { span: 8 } + } +]; + +/** 表单配置 */ +export const formSchema: FormSchema[] = [ + { + field: 'projectId', + label: 'ID', + component: 'Input', + show: false + }, + { + field: 'parentId', + label: '上级项目', + component: 'TreeSelect', + defaultValue: '0', + componentProps: { + replaceFields: { + title: 'name', + key: 'projectId', + value: 'projectId', + }, + getPopupContainer: () => document.body, + } + }, + { + field: 'name', + label: '项目名称', + component: 'Input', + required: true, + colProps: { + span: 12 + } + }, + { + field: 'code', + label: '项目代码', + component: 'Input', + required: true, + colProps: { + span: 12 + } + }, + { + field: 'contacts', + label: '联系人', + component: 'Input', + colProps: { + span: 12 + } + }, + { + field: 'phone', + label: '联系人电话', + component: 'Input', + rules: [ + { + pattern: new RegExp('^1[3|4|5|6|7|8|9][0-9]\\d{8}$'), + message: '请输入正确的手机号码!', + validateTrigger: 'change' + } + ], + colProps: { + span: 12 + } + }, + { + field: 'sort', + label: '项目排序', + component: 'InputNumber', + componentProps: { + style: { width:'100%' }, + min: 0 + }, + required: true, + colProps: { + span: 12 + } + }, + { + field: 'email', + label: '邮箱', + component: 'Input', + rules: [ + { + type: 'email', + message: '请输入正确的邮箱地址!', + validateTrigger: 'change' + } + ], + colProps: { + span: 12 + } + }, + { + field: 'status', + label: '状态', + component: 'RadioGroup', + defaultValue: '0', + componentProps: { + options: [ + { label: '正常', value: '0' }, + { label: '停用', value: '1' } + ] + }, + required: true, + colProps: { + span: 12 + } + } +]; diff --git a/yarn.lock b/yarn.lock index f7ff7c0..395a85c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,9 +2,9 @@ # yarn lockfile v1 -"@amap/amap-jsapi-loader@^1.0.1": +"@amap/amap-jsapi-loader@1.0.1": version "1.0.1" - resolved "https://registry.npmmirror.com/@amap/amap-jsapi-loader/-/amap-jsapi-loader-1.0.1.tgz#9ec4b4d5d2467eac451f6c852e35db69e9f9f0c0" + resolved "https://registry.yarnpkg.com/@amap/amap-jsapi-loader/-/amap-jsapi-loader-1.0.1.tgz#9ec4b4d5d2467eac451f6c852e35db69e9f9f0c0" integrity sha512-nPyLKt7Ow/ThHLkSvn2etQlUzqxmTVgK7bIgwdBRTg2HK5668oN7xVxkaiRe3YZEzGzfV2XgH5Jmu2T73ljejw== "@ampproject/remapping@^2.1.0":