59 changed files with 1897 additions and 2802 deletions
@ -1,51 +0,0 @@ |
|||||||
import {BoxCardParams, BoxCardListItem, BoxCardListGetListResult} from '/@/api/platform/common/entity/boxCard'; |
|
||||||
import { defHttp } from '/@/utils/http/axios'; |
|
||||||
import {isDef} from '/@/utils/is'; |
|
||||||
|
|
||||||
const prefix = '/iot/equip'; |
|
||||||
|
|
||||||
enum Api { |
|
||||||
GetCardById = '/boxcard/getById', |
|
||||||
List = '/boxcard/list', |
|
||||||
ListForSelect = '/boxcard/listForSelect', |
|
||||||
Add = '/boxcard/add', |
|
||||||
Update = '/boxcard/update', |
|
||||||
Remove = '/boxcard/remove' |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* 查询根据id |
|
||||||
* @param params |
|
||||||
*/ |
|
||||||
export const getCardById = (params: { id: String } ) => |
|
||||||
defHttp.get<BoxCardListItem>({ url: prefix + Api.GetCardById, params }); |
|
||||||
|
|
||||||
/** |
|
||||||
* 条件查询list |
|
||||||
* @param params |
|
||||||
*/ |
|
||||||
export const cardList = (params: BoxCardParams) => |
|
||||||
defHttp.get<BoxCardListGetListResult>({ url: prefix + Api.List, params }); |
|
||||||
|
|
||||||
/** |
|
||||||
* 获取下拉列表的list |
|
||||||
* @param params |
|
||||||
*/ |
|
||||||
export const listForSelect = (params: {isUsed: number}) => |
|
||||||
defHttp.get<BoxCardListItem>({url: prefix + Api.ListForSelect}); |
|
||||||
|
|
||||||
/** |
|
||||||
* 新增或修改 |
|
||||||
* @param params |
|
||||||
*/ |
|
||||||
export const set = (params: BoxCardListItem) =>{ |
|
||||||
if (isDef(params.id)) { |
|
||||||
return defHttp.put<BoxCardListItem>({ url: prefix + Api.Update, params }); |
|
||||||
} else { |
|
||||||
return defHttp.post<BoxCardListItem>({ url: prefix + Api.Add, params }); |
|
||||||
} |
|
||||||
}; |
|
||||||
|
|
||||||
|
|
||||||
export const remove = (params: {ids: String}) => |
|
||||||
defHttp.delete<boolean>({url: prefix + Api.Remove + `/${params.ids}`}); |
|
@ -1,33 +1,25 @@ |
|||||||
import {DoctorParams,DoctorItem,DoctorItemListResult} from '/@/api/platform/common/entity/doctor'; |
/** |
||||||
|
* 提供api模板规范代码参考,请尽量保证编写代码风格跟模板规范代码一致 |
||||||
|
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved. |
||||||
|
* author entfrm开发团队-王翔 |
||||||
|
*/ |
||||||
|
import { DoctorParams, Doctor, DoctorResult } from '/@/api/platform/common/entity/doctor'; |
||||||
import { defHttp } from '/@/utils/http/axios'; |
import { defHttp } from '/@/utils/http/axios'; |
||||||
import {isDef} from '/@/utils/is'; |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
enum Api { |
enum Api { |
||||||
QueryById = '/system_proxy/system/doctor/query', |
list = '/common_proxy/common/doctor/list', |
||||||
list = '/system_proxy/system/doctor/list', |
get = '/common_proxy/common/doctor', |
||||||
add = '/system_proxy/system/doctor/add', |
save = '/common_proxy/common/doctor/save', |
||||||
edit = '/system_proxy/system/doctor/update', |
edit = '/common_proxy/common/doctor/update', |
||||||
del = '/system_proxy/system/doctor/remove', |
del = '/common_proxy/common/doctor/remove' |
||||||
get = '/system_proxy/system/doctor' |
|
||||||
} |
} |
||||||
|
|
||||||
export const queryById = (params: { id: String }) => |
export const listDoctor = (params?: Partial<DoctorParams>) => defHttp.get<DoctorResult>({ url: Api.list, params }, { isReturnResultResponse: true }); |
||||||
defHttp.get<DoctorItem>({url: Api.QueryById + `/${params.id}`}); |
|
||||||
|
|
||||||
/** 查询医生列表 */ |
|
||||||
export const listDoctor = (params?: Partial<DoctorItem>) => defHttp.get<DoctorItemListResult>({ url: Api.list, params }, { isReturnResultResponse: true }); |
|
||||||
|
|
||||||
/** 新增医生*/ |
export const addDoctor = (params: Partial<Doctor>) => defHttp.post({ url: Api.save, data: params }); |
||||||
export const addDoctor = (params: Partial<DoctorParams>) => defHttp.post({ url: Api.add, data: params }); |
|
||||||
|
|
||||||
/** 修改医生 */ |
export const editDoctor = (params: Partial<Doctor>) => defHttp.put({ url: Api.edit, data: params }); |
||||||
export const editDoctor = (params: Partial<DoctorParams>) => defHttp.put({ url: Api.edit, data: params }); |
|
||||||
|
|
||||||
/** 查询医生详细 */ |
export const getDoctor = (id: string) => defHttp.get<Doctor>({ url: `${Api.get}/${id}` }); |
||||||
export const getDoctor = (id: string) => defHttp.get<DoctorItem>({ url: `${Api.get}/${id}` }); |
|
||||||
|
|
||||||
/** 删除医生 */ |
export const delDoctor = (ids: string) => defHttp.delete({ url: `${Api.del}/${ids}` }); |
||||||
export const delDoctor = (id: string) => defHttp.delete({ url: `${Api.del}/${id}` }); |
|
||||||
|
@ -1,46 +1,25 @@ |
|||||||
import {HospitalParams,HospitalItem,HospitalItemListResult} from '/@/api/platform/common/entity/hospital'; |
/** |
||||||
|
* 提供api模板规范代码参考,请尽量保证编写代码风格跟模板规范代码一致 |
||||||
|
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved. |
||||||
|
* author entfrm开发团队-王翔 |
||||||
|
*/ |
||||||
|
import { HospitalParams, Hospital, HospitalResult } from '/@/api/platform/common/entity/hospital'; |
||||||
import { defHttp } from '/@/utils/http/axios'; |
import { defHttp } from '/@/utils/http/axios'; |
||||||
import {isDef} from '/@/utils/is'; |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
enum Api { |
enum Api { |
||||||
QueryById = '/system_proxy/system/hospital/query', |
list = '/common_proxy/common/hospital/list', |
||||||
list = '/system_proxy/system/hospital/list', |
get = '/common_proxy/common/hospital', |
||||||
add = '/system_proxy/system/hospital/add', |
save = '/common_proxy/common/hospital/save', |
||||||
edit = '/system_proxy/system/hospital/update', |
edit = '/common_proxy/common/hospital/update', |
||||||
del = '/system_proxy/system/hospital/remove', |
del = '/common_proxy/common/hospital/remove' |
||||||
get = '/system_proxy/system/hospital' |
|
||||||
} |
} |
||||||
|
|
||||||
// export const queryById = (params: { id: String }) =>
|
export const listHospital = (params: Partial<HospitalParams>) => defHttp.get<HospitalResult>({url: Api.list, params}, { isReturnResultResponse: true }); |
||||||
// defHttp.get<HospitalItem>({url: Api.QueryById, params});
|
|
||||||
//
|
export const addHospital = (params: Partial<Hospital>)=> defHttp.post({url: Api.save ,data: params}); |
||||||
// export const list = (params: HospitalParams) =>
|
|
||||||
// defHttp.get<HospitalItemListResult>({url: Api.list, params});
|
export const editHospital = (params: Partial<Hospital>) => defHttp.put({url: Api.edit, data: params}); |
||||||
//
|
|
||||||
// export const set = (params: HospitalItem) => {
|
export const getHospital = (id: string) => defHttp.get<Hospital>({url: `${Api.get}/${id}` }); |
||||||
// if (isDef(params.id)){
|
|
||||||
// defHttp.put<HospitalItem>({url: Api.edit, params});
|
|
||||||
// }else {
|
|
||||||
// defHttp.post<HospitalItem>({url: Api.add, params});
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
|
|
||||||
// export const remove = (params: {ids: String}) =>
|
export const delHospital = (ids: string) => defHttp.delete({ url: `${Api.del}/${ids}` }); |
||||||
// defHttp.delete<boolean>({url: Api.Remove + `/${params.ids}`});
|
|
||||||
// export const remove = (id: string) => defHttp.delete({ url: `${Api.del}/${id}` });
|
|
||||||
export const queryById = (params: { id: String }) => |
|
||||||
defHttp.get<HospitalItem>({url: Api.QueryById, params}); |
|
||||||
/** 查询医院列表*/ |
|
||||||
export const list = (params: HospitalParams) => |
|
||||||
defHttp.get<HospitalItemListResult>({url: Api.list, params}); |
|
||||||
// export const list = (params?:Partial<HospitalItem>) =>defHttp.get<HospitalItemListResult>({url: Api.list, params},{isReturnResultResponse: true});
|
|
||||||
/** 新增医院*/ |
|
||||||
export const addHospital = (params: Partial<HospitalParams>)=> defHttp.post({url: Api.add ,data: params}); |
|
||||||
/** 修改医院*/ |
|
||||||
export const editHospital = (params: Partial<HospitalParams>) => defHttp.put({url: Api.edit, data: params}); |
|
||||||
/** 查询医院详细*/ |
|
||||||
export const getHospital = (id: string) => defHttp.get<HospitalItem>({url: `${Api.get}/${id}` }); |
|
||||||
/** 删除项目 */ |
|
||||||
export const delHospital = (id: string) => defHttp.delete({ url: `${Api.del}/${id}` }); |
|
||||||
|
@ -1,52 +0,0 @@ |
|||||||
|
|
||||||
import {InstitutionParams,InstitutionItem,InstitutionItemListResult} from '/@/api/platform/common/entity/institution'; |
|
||||||
import { defHttp } from '/@/utils/http/axios'; |
|
||||||
import {isDef} from '/@/utils/is'; |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
enum Api { |
|
||||||
QueryById = '/system_proxy/system/institution/query', |
|
||||||
list = '/system_proxy/system/institution/list', |
|
||||||
add = '/system_proxy/system/institution/add', |
|
||||||
edit = '/system_proxy/system/institution/update', |
|
||||||
del = '/system_proxy/system/institution/remove', |
|
||||||
get = '/system_proxy/system/institution' |
|
||||||
} |
|
||||||
|
|
||||||
// export const queryById = (params: { id: String }) =>
|
|
||||||
// defHttp.get<InstitutionItem>({url: prefix + Api.QueryById, params});
|
|
||||||
//
|
|
||||||
// export const list = (params: InstitutionParams) =>
|
|
||||||
// defHttp.get<InstitutionItemListResult>({url: prefix + Api.List, params});
|
|
||||||
//
|
|
||||||
// export const set = (params: InstitutionItem) => {
|
|
||||||
// if (isDef(params.id)){
|
|
||||||
// defHttp.put<InstitutionItem>({url: prefix + Api.Update, params});
|
|
||||||
// }else {
|
|
||||||
// defHttp.post<InstitutionItem>({url: prefix + Api.Add, params});
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
//
|
|
||||||
// export const remove = (params: {ids: String}) =>
|
|
||||||
// defHttp.delete<boolean>({url: prefix + Api.Remove + `/${params.ids}`});
|
|
||||||
|
|
||||||
export const queryById = (params: { id: String }) => |
|
||||||
defHttp.get<InstitutionItem>({url: Api.QueryById + `/${params.id}`}); |
|
||||||
|
|
||||||
/** 查询机构列表 */ |
|
||||||
// export const list = (params?: Partial<InstitutionItem>) => defHttp.get<InstitutionItemListResult>({ url: Api.list, params }, { isReturnResultResponse: true });
|
|
||||||
export const list = (params: InstitutionParams) => |
|
||||||
defHttp.get<InstitutionItemListResult>({url: Api.list, params}); |
|
||||||
/** 新增机构*/ |
|
||||||
export const addInstitution = (params: Partial<InstitutionParams>) => defHttp.post({ url: Api.add, data: params }); |
|
||||||
|
|
||||||
/** 修改机构 */ |
|
||||||
export const editInstitution = (params: Partial<InstitutionParams>) => defHttp.put({ url: Api.edit, data: params }); |
|
||||||
|
|
||||||
/** 查询机构详细 */ |
|
||||||
export const getInstitution = (id: string) => defHttp.get<InstitutionItem>({ url: `${Api.get}/${id}` }); |
|
||||||
|
|
||||||
/** 删除机构 */ |
|
||||||
export const delInstitution= (id: string) => defHttp.delete({ url: `${Api.del}/${id}` }); |
|
@ -1,50 +1,25 @@ |
|||||||
import {OfficeParams,OfficeItem,OfficeItemListResult} from '/@/api/platform/common/entity/office'; |
/** |
||||||
|
* 提供api模板规范代码参考,请尽量保证编写代码风格跟模板规范代码一致 |
||||||
|
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved. |
||||||
|
* author entfrm开发团队-王翔 |
||||||
|
*/ |
||||||
|
import { OfficeParams, Office, OfficeResult } from '/@/api/platform/common/entity/office'; |
||||||
import { defHttp } from '/@/utils/http/axios'; |
import { defHttp } from '/@/utils/http/axios'; |
||||||
import {isDef} from '/@/utils/is'; |
|
||||||
import {HospitalItemListResult, HospitalParams} from "/@/api/platform/common/entity/hospital"; |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
enum Api { |
enum Api { |
||||||
QueryById = '/system_proxy/system/office/getById', |
list = '/common_proxy/common/office/list', |
||||||
list = '/system_proxy/system/office/list', |
save = '/common_proxy/common/office/save', |
||||||
add = '/system_proxy/system/office/add', |
edit = '/common_proxy/common/office/update', |
||||||
edit = '/system_proxy/system/office/update', |
del = '/common_proxy/common/office/remove', |
||||||
del = '/system_proxy/system/office/remove', |
get = '/common_proxy/common/office' |
||||||
get = '/system_proxy/system/office' |
|
||||||
} |
} |
||||||
//
|
|
||||||
// export const queryById = (params: { id: String }) =>
|
|
||||||
// defHttp.get<OfficeItem>({url:Api.QueryById, params});
|
|
||||||
//
|
|
||||||
// export const list = (params: OfficeParams) =>
|
|
||||||
// defHttp.get<OfficeItemListResult>({url: Api.List, params});
|
|
||||||
//
|
|
||||||
// export const set = (params: OfficeItem) => {
|
|
||||||
// if (isDef(params.id)){
|
|
||||||
// defHttp.put<OfficeItem>({url:Api.Update, params});
|
|
||||||
// }else {
|
|
||||||
// defHttp.post<OfficeItem>({url: Api.Add, params});
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
//
|
|
||||||
// export const remove = (params: {ids: String}) =>
|
|
||||||
// defHttp.delete<boolean>({url:Api.Remove + `/${params.ids}`});
|
|
||||||
export const queryById = (params: { id: String }) => |
|
||||||
defHttp.get<OfficeItem>({url: Api.QueryById + `/${params.id}`}); |
|
||||||
|
|
||||||
/** 查询科室列表 */ |
export const listOffice = (params?: Partial<OfficeParams>) => defHttp.get<OfficeResult>({url: Api.list, params}, { isReturnResultResponse: true }); |
||||||
// export const listOffice = (params?: Partial<OfficeItem>) => defHttp.get<OfficeItemListResult>({ url: Api.list, params }, { isReturnResultResponse: true });
|
|
||||||
export const listOffice = (params: OfficeItem) => |
export const addOffice = (params: Partial<Office>) => defHttp.post({ url: Api.save, data: params }); |
||||||
defHttp.get<OfficeItemListResult>({url: Api.list, params}); |
|
||||||
/** 新增科室*/ |
|
||||||
export const addOffice = (params: Partial<OfficeParams>) => defHttp.post({ url: Api.add, data: params }); |
|
||||||
|
|
||||||
/** 修改科室 */ |
export const editOffice = (params: Partial<Office>) => defHttp.put({ url: Api.edit, data: params }); |
||||||
export const editOffice = (params: Partial<OfficeParams>) => defHttp.put({ url: Api.edit, data: params }); |
|
||||||
|
|
||||||
/** 查询科室详细 */ |
export const getOffice = (id: string) => defHttp.get<Office>({ url: `${Api.get}/${id}` }); |
||||||
export const getOffice = (id: string) => defHttp.get<OfficeItem>({ url: `${Api.get}/${id}` }); |
|
||||||
|
|
||||||
/** 删除科室 */ |
export const delOffice = (ids: string) => defHttp.delete({ url: `${Api.del}/${ids}` }); |
||||||
export const delOffice = (id: string) => defHttp.delete({ url: `${Api.del}/${id}` }); |
|
||||||
|
@ -0,0 +1,20 @@ |
|||||||
|
import { OrgParams, Org, OrgResult } from '/@/api/platform/common/entity/org'; |
||||||
|
import { defHttp } from '/@/utils/http/axios'; |
||||||
|
|
||||||
|
enum Api { |
||||||
|
list = '/common_proxy/common/org/list', |
||||||
|
get = '/common_proxy/common/org', |
||||||
|
save = '/common_proxy/common/org/save', |
||||||
|
edit = '/common_proxy/common/org/update', |
||||||
|
del = '/common_proxy/common/org/remove' |
||||||
|
} |
||||||
|
|
||||||
|
export const listOrg = (params: OrgParams) => defHttp.get<OrgResult>({url: Api.list, params}, { isReturnResultResponse: true }); |
||||||
|
|
||||||
|
export const addOrg = (params: Partial<Org>) => defHttp.post({ url: Api.save, data: params }); |
||||||
|
|
||||||
|
export const editOrg = (params: Partial<Org>) => defHttp.put({ url: Api.edit, data: params }); |
||||||
|
|
||||||
|
export const getOrg = (id: string) => defHttp.get<Org>({ url: `${Api.get}/${id}` }); |
||||||
|
|
||||||
|
export const delOrg = (ids: string) => defHttp.delete({ url: `${Api.del}/${ids}` }); |
@ -1,33 +0,0 @@ |
|||||||
import {DoctorParams,DoctorItem,DoctorItemListResult} from '/@/api/platform/common/entity/doctor'; |
|
||||||
import { defHttp } from '/@/utils/http/axios'; |
|
||||||
import {isDef} from '/@/utils/is'; |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
enum Api { |
|
||||||
QueryById = '/system_proxy/system/doctor/query', |
|
||||||
list = '/system_proxy/system/doctor/list', |
|
||||||
add = '/system_proxy/system/doctor/add', |
|
||||||
edit = '/system_proxy/system/doctor/update', |
|
||||||
del = '/system_proxy/system/doctor/remove', |
|
||||||
get = '/system_proxy/system/doctor' |
|
||||||
} |
|
||||||
|
|
||||||
export const queryById = (params: { id: String }) => |
|
||||||
defHttp.get<DoctorItem>({url: Api.QueryById + `/${params.id}`}); |
|
||||||
|
|
||||||
/** 查询医生列表 */ |
|
||||||
export const listReport = (params?: Partial<DoctorItem>) => defHttp.get<DoctorItemListResult>({ url: Api.list, params }, { isReturnResultResponse: true }); |
|
||||||
|
|
||||||
/** 新增医生*/ |
|
||||||
export const addReport = (params: Partial<DoctorParams>) => defHttp.post({ url: Api.add, data: params }); |
|
||||||
|
|
||||||
/** 修改医生 */ |
|
||||||
export const editReport = (params: Partial<DoctorParams>) => defHttp.put({ url: Api.edit, data: params }); |
|
||||||
|
|
||||||
/** 查询医生详细 */ |
|
||||||
export const getReport = (id: string) => defHttp.get<DoctorItem>({ url: `${Api.get}/${id}` }); |
|
||||||
|
|
||||||
/** 删除医生 */ |
|
||||||
export const delReport = (id: string) => defHttp.delete({ url: `${Api.del}/${id}` }); |
|
@ -1,49 +1,26 @@ |
|||||||
// 引入基础包
|
|
||||||
import type { R } from '/#/axios'; |
import type { R } from '/#/axios'; |
||||||
import type { Page } from '/@/api/common/data/entity'; |
import type { Page } from '/@/api/common/data/entity'; |
||||||
|
import { CommonEntity } from '/@/api/common/data/entity'; |
||||||
|
|
||||||
export type DoctorParams = { |
/** 医生查询参数 */ |
||||||
name?: string; |
export type DoctorParams = Page & Doctor; |
||||||
beginTime?: string; |
|
||||||
endTime?: string; |
|
||||||
} & Page; |
|
||||||
|
|
||||||
|
/** 医生对象 */ |
||||||
export interface DoctorItem { |
export interface Doctor extends CommonEntity { |
||||||
|
|
||||||
/**医生ID*/ |
|
||||||
id: string; |
id: string; |
||||||
/**医生姓名*/ |
|
||||||
name: string; |
name: string; |
||||||
/**医生职称*/ |
|
||||||
title: string; |
title: string; |
||||||
/**医生性别*/ |
|
||||||
sex: string; |
sex: string; |
||||||
/**医生电话*/ |
|
||||||
phone: string; |
phone: string; |
||||||
/**医生邮箱*/ |
|
||||||
email: string; |
email: string; |
||||||
/**地址(门牌号)*/ |
|
||||||
detailAddress: string; |
detailAddress: string; |
||||||
/**组织类型*/ |
orgType: string; |
||||||
organType: string; |
orgId: string; |
||||||
/**组织id*/ |
orgName: string; |
||||||
organId: string; |
|
||||||
/**组织名称*/ |
|
||||||
organName: string; |
|
||||||
/**科室ID*/ |
|
||||||
officeId: string; |
officeId: string; |
||||||
/**科室名称*/ |
|
||||||
officeName: string; |
officeName: string; |
||||||
/**医生状态*/ |
|
||||||
status: string; |
status: string; |
||||||
|
|
||||||
createById: string; |
|
||||||
|
|
||||||
createByName: string; |
|
||||||
|
|
||||||
createTime: string; |
|
||||||
|
|
||||||
} |
} |
||||||
|
|
||||||
export type DoctorItemListResult = R<DoctorItem>; |
/** 医生响应对象 */ |
||||||
|
export type DoctorResult = R<Doctor[]>; |
||||||
|
@ -1,44 +1,28 @@ |
|||||||
// 引入基础包
|
|
||||||
import type { R } from '/#/axios'; |
import type { R } from '/#/axios'; |
||||||
import type { CommonEntity,Page } from '/@/api/common/data/entity'; |
import type { Page } from '/@/api/common/data/entity'; |
||||||
|
import { CommonEntity } from '/@/api/common/data/entity'; |
||||||
|
|
||||||
export type HospitalParams = { |
/** 医院查询参数 */ |
||||||
name?: string; |
export type HospitalParams = Hospital & Page; |
||||||
beginTime?: string; |
|
||||||
endTime?: string; |
|
||||||
} & Page; |
|
||||||
|
|
||||||
|
|
||||||
export interface HospitalItem extends CommonEntity{ |
|
||||||
|
|
||||||
|
/** 医院对象 */ |
||||||
|
export interface Hospital extends CommonEntity { |
||||||
id: string; |
id: string; |
||||||
|
|
||||||
name: string; |
name: string; |
||||||
|
type: string; |
||||||
type: number; |
contactName: string; |
||||||
|
contactPhone: string; |
||||||
contactsName: string; |
contactTitle: string; |
||||||
|
|
||||||
contactsTel: string; |
|
||||||
|
|
||||||
contactsTitle: string; |
|
||||||
|
|
||||||
payment: string; |
payment: string; |
||||||
|
|
||||||
addressIds: string; |
addressIds: string; |
||||||
|
|
||||||
detailAddress: string; |
detailAddress: string; |
||||||
|
|
||||||
status: string; |
status: string; |
||||||
|
mapOrientation: number; |
||||||
createById: string; |
mapLng: number; |
||||||
|
mapLat: number; |
||||||
createByName: string; |
mapNotify: string; |
||||||
|
orgIds: string[]; |
||||||
createTime: string; |
|
||||||
|
|
||||||
remarks: string; |
|
||||||
|
|
||||||
} |
} |
||||||
|
|
||||||
export type HospitalItemListResult = R<HospitalItem>; |
/** 医院响应对象 */ |
||||||
|
export type HospitalResult = R<Hospital[]>; |
||||||
|
@ -1,39 +0,0 @@ |
|||||||
// 引入基础包
|
|
||||||
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: string; |
|
||||||
|
|
||||||
contactsName: string; |
|
||||||
|
|
||||||
contactsTel: string; |
|
||||||
|
|
||||||
contactsTitle: string; |
|
||||||
|
|
||||||
addressId: string; |
|
||||||
|
|
||||||
detailAddress: string; |
|
||||||
|
|
||||||
status: string; |
|
||||||
|
|
||||||
createById: string; |
|
||||||
|
|
||||||
createByName: string; |
|
||||||
|
|
||||||
createTime: string; |
|
||||||
} |
|
||||||
|
|
||||||
export type InstitutionItemListResult = R<InstitutionItem>; |
|
@ -1,41 +1,18 @@ |
|||||||
// 引入基础包
|
|
||||||
import type { R } from '/#/axios'; |
import type { R } from '/#/axios'; |
||||||
import type { CommonEntity,Page } from '/@/api/common/data/entity'; |
import { CommonEntity, Page } from '/@/api/common/data/entity'; |
||||||
|
|
||||||
export type OfficeParams = { |
export type OfficeParams = Office & Page; |
||||||
name?: string; |
|
||||||
beginTime?: string; |
|
||||||
endTime?: string; |
|
||||||
} & Page; |
|
||||||
|
|
||||||
|
|
||||||
export interface OfficeItem extends CommonEntity{ |
|
||||||
|
|
||||||
|
export interface Office extends CommonEntity { |
||||||
id: string; |
id: string; |
||||||
|
|
||||||
name: string; |
name: string; |
||||||
|
orgType: string; |
||||||
organType: string; |
orgId: string; |
||||||
|
orgName: string; |
||||||
organId: string; |
manageName: string; |
||||||
|
managePhone: string; |
||||||
organName: string; |
|
||||||
|
|
||||||
directorName: string; |
|
||||||
|
|
||||||
directorTel: string; |
|
||||||
|
|
||||||
detailAddress: string; |
detailAddress: string; |
||||||
|
|
||||||
status: string; |
status: string; |
||||||
|
|
||||||
createById: string; |
|
||||||
|
|
||||||
createByName: string; |
|
||||||
|
|
||||||
createTime: string; |
|
||||||
|
|
||||||
remarks: string; |
|
||||||
} |
} |
||||||
|
|
||||||
export type OfficeItemListResult = R<OfficeItem>; |
export type OfficeResult = R<Office[]>; |
||||||
|
@ -0,0 +1,22 @@ |
|||||||
|
import type { R } from '/#/axios'; |
||||||
|
import type { CommonEntity, Page } from '/@/api/common/data/entity'; |
||||||
|
|
||||||
|
export type OrgParams = Org & Page; |
||||||
|
|
||||||
|
export interface Org extends CommonEntity{ |
||||||
|
id: string; |
||||||
|
name: string; |
||||||
|
type: string; |
||||||
|
contactName: string; |
||||||
|
contactPhone: string; |
||||||
|
contactTitle: string; |
||||||
|
addressNames: string; |
||||||
|
addressIds: string; |
||||||
|
detailAddress: string; |
||||||
|
status: string; |
||||||
|
mapLng: number; |
||||||
|
mapLat: number; |
||||||
|
mapNotify: string; |
||||||
|
} |
||||||
|
|
||||||
|
export type OrgResult = R<Org[]>; |
@ -0,0 +1,15 @@ |
|||||||
|
import type { R } from '/#/axios'; |
||||||
|
import type { TreeEntity, Page } from '/@/api/common/data/entity'; |
||||||
|
|
||||||
|
export type ProjectParams = Page & Project; |
||||||
|
|
||||||
|
export interface Project extends TreeEntity { |
||||||
|
code: string; |
||||||
|
contact: string; |
||||||
|
phone: string; |
||||||
|
address: string; |
||||||
|
email: string; |
||||||
|
status: string; |
||||||
|
} |
||||||
|
|
||||||
|
export type ProjectResult = R<Project[]>; |
@ -1,49 +0,0 @@ |
|||||||
// 引入基础包
|
|
||||||
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: string; |
|
||||||
/**组织id*/ |
|
||||||
organId: string; |
|
||||||
/**组织名称*/ |
|
||||||
organName: string; |
|
||||||
/**科室ID*/ |
|
||||||
officeId: string; |
|
||||||
/**科室名称*/ |
|
||||||
officeName: string; |
|
||||||
/**医生状态*/ |
|
||||||
status: string; |
|
||||||
|
|
||||||
createById: string; |
|
||||||
|
|
||||||
createByName: string; |
|
||||||
|
|
||||||
createTime: string; |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
export type DoctorItemListResult = R<DoctorItem>; |
|
@ -1,30 +0,0 @@ |
|||||||
/** |
|
||||||
* @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<Project[]>; |
|
@ -0,0 +1,198 @@ |
|||||||
|
<template> |
||||||
|
<a-cascader |
||||||
|
v-model:value="state" |
||||||
|
:options="options" |
||||||
|
:load-data="loadData" |
||||||
|
change-on-select |
||||||
|
:displayRender="handleRenderDisplay" |
||||||
|
@change="handleChange" |
||||||
|
> |
||||||
|
<template v-if="loading" #suffixIcon> |
||||||
|
<LoadingOutlined spin/> |
||||||
|
</template> |
||||||
|
<template v-if="loading" #notFoundContent> |
||||||
|
<span> |
||||||
|
<LoadingOutlined spin class="mr-1"/> |
||||||
|
{{ t('component.form.apiSelectNotFound') }} |
||||||
|
</span> |
||||||
|
</template> |
||||||
|
</a-cascader> |
||||||
|
</template> |
||||||
|
<script lang="ts"> |
||||||
|
import { defineComponent, PropType, ref, unref, watch, watchEffect } from 'vue'; |
||||||
|
import { Cascader } from 'ant-design-vue'; |
||||||
|
import { propTypes } from '/@/utils/propTypes'; |
||||||
|
import { isFunction } from '/@/utils/is'; |
||||||
|
import { get, omit } from 'lodash-es'; |
||||||
|
import { useRuleFormItem } from '/@/hooks/component/useFormItem'; |
||||||
|
import { LoadingOutlined } from '@ant-design/icons-vue'; |
||||||
|
import { useI18n } from '/@/hooks/web/useI18n'; |
||||||
|
interface Option { |
||||||
|
value: string; |
||||||
|
label: string; |
||||||
|
loading?: boolean; |
||||||
|
isLeaf?: boolean; |
||||||
|
children?: Option[]; |
||||||
|
} |
||||||
|
export default defineComponent({ |
||||||
|
name: 'ApiCascader', |
||||||
|
components: { |
||||||
|
LoadingOutlined, |
||||||
|
[Cascader.name]: Cascader, |
||||||
|
}, |
||||||
|
props: { |
||||||
|
value: { |
||||||
|
type: Array, |
||||||
|
}, |
||||||
|
api: { |
||||||
|
type: Function as PropType<(arg?: Recordable) => Promise<Option[]>>, |
||||||
|
default: null, |
||||||
|
}, |
||||||
|
numberToString: propTypes.bool, |
||||||
|
resultField: propTypes.string.def(''), |
||||||
|
labelField: propTypes.string.def('label'), |
||||||
|
valueField: propTypes.string.def('value'), |
||||||
|
childrenField: propTypes.string.def('children'), |
||||||
|
asyncFetchParamKey: propTypes.string.def('parentCode'), |
||||||
|
immediate: propTypes.bool.def(true), |
||||||
|
// init fetch params |
||||||
|
initFetchParams: { |
||||||
|
type: Object as PropType<Recordable>, |
||||||
|
default: () => ({}), |
||||||
|
}, |
||||||
|
// 是否有下级,默认是 |
||||||
|
isLeaf: { |
||||||
|
type: Function as PropType<(arg: Recordable) => boolean>, |
||||||
|
default: null, |
||||||
|
}, |
||||||
|
displayRenderArray: { |
||||||
|
type: Array, |
||||||
|
}, |
||||||
|
}, |
||||||
|
emits: ['change', 'defaultChange'], |
||||||
|
setup(props, { emit }) { |
||||||
|
const apiData = ref<any[]>([]); |
||||||
|
const options = ref<Option[]>([]); |
||||||
|
const loading = ref<boolean>(false); |
||||||
|
const emitData = ref<any[]>([]); |
||||||
|
const isFirstLoad = ref(true); |
||||||
|
const { t } = useI18n(); |
||||||
|
// Embedded in the form, just use the hook binding to perform form verification |
||||||
|
const [state] = useRuleFormItem(props, 'value', 'change', emitData); |
||||||
|
|
||||||
|
watch( |
||||||
|
apiData, |
||||||
|
(data) => { |
||||||
|
const opts = generatorOptions(data); |
||||||
|
options.value = opts; |
||||||
|
}, |
||||||
|
{ deep: true }, |
||||||
|
); |
||||||
|
|
||||||
|
function generatorOptions(options: any[]): Option[] { |
||||||
|
const { labelField, valueField, numberToString, childrenField, isLeaf } = props; |
||||||
|
return options.reduce((prev, next: Recordable) => { |
||||||
|
if (next) { |
||||||
|
const value = next[valueField]; |
||||||
|
const item = { |
||||||
|
...omit(next, [labelField, valueField]), |
||||||
|
label: next[labelField], |
||||||
|
value: numberToString ? `${value}` : value, |
||||||
|
isLeaf: isLeaf && typeof isLeaf === 'function' ? isLeaf(next) : false, |
||||||
|
}; |
||||||
|
const children = Reflect.get(next, childrenField); |
||||||
|
if (children) { |
||||||
|
Reflect.set(item, childrenField, generatorOptions(children)); |
||||||
|
} |
||||||
|
prev.push(item); |
||||||
|
} |
||||||
|
return prev; |
||||||
|
}, [] as Option[]); |
||||||
|
} |
||||||
|
|
||||||
|
async function initialFetch() { |
||||||
|
const api = props.api; |
||||||
|
if (!api || !isFunction(api)) return; |
||||||
|
apiData.value = []; |
||||||
|
loading.value = true; |
||||||
|
try { |
||||||
|
const res = await api(props.initFetchParams); |
||||||
|
if (Array.isArray(res)) { |
||||||
|
apiData.value = res; |
||||||
|
return; |
||||||
|
} |
||||||
|
if (props.resultField) { |
||||||
|
apiData.value = get(res, props.resultField) || []; |
||||||
|
} |
||||||
|
} catch (error) { |
||||||
|
console.warn(error); |
||||||
|
} finally { |
||||||
|
loading.value = false; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
async function loadData(selectedOptions: Option[]) { |
||||||
|
const targetOption = selectedOptions[selectedOptions.length - 1]; |
||||||
|
targetOption.loading = true; |
||||||
|
|
||||||
|
const api = props.api; |
||||||
|
if (!api || !isFunction(api)) return; |
||||||
|
try { |
||||||
|
const res = await api({ |
||||||
|
[props.asyncFetchParamKey]: Reflect.get(targetOption, 'value'), |
||||||
|
}); |
||||||
|
if (Array.isArray(res)) { |
||||||
|
const children = generatorOptions(res); |
||||||
|
targetOption.children = children; |
||||||
|
return; |
||||||
|
} |
||||||
|
if (props.resultField) { |
||||||
|
const children = generatorOptions(get(res, props.resultField) || []); |
||||||
|
targetOption.children = children; |
||||||
|
} |
||||||
|
} catch (e) { |
||||||
|
console.error(e); |
||||||
|
} finally { |
||||||
|
targetOption.loading = false; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
watchEffect(() => { |
||||||
|
props.immediate && initialFetch(); |
||||||
|
}); |
||||||
|
|
||||||
|
watch( |
||||||
|
() => props.initFetchParams, |
||||||
|
() => { |
||||||
|
!unref(isFirstLoad) && initialFetch(); |
||||||
|
}, |
||||||
|
{ deep: true }, |
||||||
|
); |
||||||
|
|
||||||
|
function handleChange(keys, args) { |
||||||
|
emitData.value = keys; |
||||||
|
emit('defaultChange', keys, args); |
||||||
|
} |
||||||
|
|
||||||
|
function handleRenderDisplay({ labels, selectedOptions }) { |
||||||
|
if (unref(emitData).length === selectedOptions.length) { |
||||||
|
return labels.join(' / '); |
||||||
|
} |
||||||
|
if (props.displayRenderArray) { |
||||||
|
return props.displayRenderArray.join(' / '); |
||||||
|
} |
||||||
|
return ''; |
||||||
|
} |
||||||
|
|
||||||
|
return { |
||||||
|
state, |
||||||
|
options, |
||||||
|
loading, |
||||||
|
t, |
||||||
|
handleChange, |
||||||
|
loadData, |
||||||
|
handleRenderDisplay, |
||||||
|
}; |
||||||
|
}, |
||||||
|
}); |
||||||
|
</script> |
@ -0,0 +1,134 @@ |
|||||||
|
<!-- |
||||||
|
* @Description:It is troublesome to implement radio button group in the form. So it is extracted independently as a separate component |
||||||
|
--> |
||||||
|
<template> |
||||||
|
<RadioGroup v-model:value="state" |
||||||
|
v-bind="attrs" |
||||||
|
button-style="solid" |
||||||
|
@change="handleChange" |
||||||
|
> |
||||||
|
<template v-for="item in getOptions" :key="`${item.value}`"> |
||||||
|
<RadioButton v-if="props.isBtn" :value="item.value" :disabled="item.disabled"> |
||||||
|
{{ item.label }} |
||||||
|
</RadioButton> |
||||||
|
<Radio v-else :value="item.value" :disabled="item.disabled"> |
||||||
|
{{ item.label }} |
||||||
|
</Radio> |
||||||
|
</template> |
||||||
|
</RadioGroup> |
||||||
|
</template> |
||||||
|
<script lang="ts"> |
||||||
|
import { defineComponent, PropType, ref, watchEffect, computed, unref, watch } from 'vue'; |
||||||
|
import { Radio } from 'ant-design-vue'; |
||||||
|
import { isFunction } from '/@/utils/is'; |
||||||
|
import { useRuleFormItem } from '/@/hooks/component/useFormItem'; |
||||||
|
import { useAttrs } from '/@/hooks/core/useAttrs'; |
||||||
|
import { propTypes } from '/@/utils/propTypes'; |
||||||
|
import { get, omit } from 'lodash-es'; |
||||||
|
import { useI18n } from '/@/hooks/web/useI18n'; |
||||||
|
type OptionsItem = { label: string; value: string | number | boolean; disabled?: boolean }; |
||||||
|
|
||||||
|
export default defineComponent({ |
||||||
|
name: 'ApiRadioGroup', |
||||||
|
components: { |
||||||
|
RadioGroup: Radio.Group, |
||||||
|
RadioButton: Radio.Button, |
||||||
|
Radio, |
||||||
|
}, |
||||||
|
props: { |
||||||
|
api: { |
||||||
|
type: Function as PropType<(arg?: Recordable | string) => Promise<OptionsItem[]>>, |
||||||
|
default: null, |
||||||
|
}, |
||||||
|
params: { |
||||||
|
type: [Object, String] as PropType<Recordable | string>, |
||||||
|
default: () => ({}), |
||||||
|
}, |
||||||
|
value: { |
||||||
|
type: [String, Number, Boolean] as PropType<string | number | boolean>, |
||||||
|
}, |
||||||
|
isBtn: { |
||||||
|
type: [Boolean] as PropType<boolean>, |
||||||
|
default: false, |
||||||
|
}, |
||||||
|
numberToString: propTypes.bool, |
||||||
|
resultField: propTypes.string.def(''), |
||||||
|
labelField: propTypes.string.def('label'), |
||||||
|
valueField: propTypes.string.def('value'), |
||||||
|
immediate: propTypes.bool.def(true), |
||||||
|
}, |
||||||
|
emits: ['options-change', 'change'], |
||||||
|
setup(props, { emit }) { |
||||||
|
const options = ref<OptionsItem[]>([]); |
||||||
|
const loading = ref(false); |
||||||
|
const isFirstLoad = ref(true); |
||||||
|
const emitData = ref<any[]>([]); |
||||||
|
const attrs = useAttrs(); |
||||||
|
const { t } = useI18n(); |
||||||
|
// Embedded in the form, just use the hook binding to perform form verification |
||||||
|
const [state] = useRuleFormItem(props); |
||||||
|
|
||||||
|
// Processing options value |
||||||
|
const getOptions = computed(() => { |
||||||
|
const { labelField, valueField, numberToString } = props; |
||||||
|
|
||||||
|
return unref(options).reduce((prev, next: Recordable) => { |
||||||
|
if (next) { |
||||||
|
const value = next[valueField]; |
||||||
|
prev.push({ |
||||||
|
label: next[labelField], |
||||||
|
value: numberToString ? `${value}` : value, |
||||||
|
...omit(next, [labelField, valueField]), |
||||||
|
}); |
||||||
|
} |
||||||
|
return prev; |
||||||
|
}, [] as OptionsItem[]); |
||||||
|
}); |
||||||
|
|
||||||
|
watchEffect(() => { |
||||||
|
props.immediate && fetch(); |
||||||
|
}); |
||||||
|
|
||||||
|
watch( |
||||||
|
() => props.params, |
||||||
|
() => { |
||||||
|
!unref(isFirstLoad) && fetch(); |
||||||
|
}, |
||||||
|
{ deep: true }, |
||||||
|
); |
||||||
|
|
||||||
|
async function fetch() { |
||||||
|
const api = props.api; |
||||||
|
if (!api || !isFunction(api)) return; |
||||||
|
options.value = []; |
||||||
|
try { |
||||||
|
loading.value = true; |
||||||
|
const res = await api(props.params); |
||||||
|
if (Array.isArray(res)) { |
||||||
|
options.value = res; |
||||||
|
emitChange(); |
||||||
|
return; |
||||||
|
} |
||||||
|
if (props.resultField) { |
||||||
|
options.value = get(res, props.resultField) || []; |
||||||
|
} |
||||||
|
emitChange(); |
||||||
|
} catch (error) { |
||||||
|
console.warn(error); |
||||||
|
} finally { |
||||||
|
loading.value = false; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
function emitChange() { |
||||||
|
emit('options-change', unref(getOptions)); |
||||||
|
} |
||||||
|
|
||||||
|
function handleChange(_, ...args) { |
||||||
|
emitData.value = args; |
||||||
|
} |
||||||
|
|
||||||
|
return { state, getOptions, attrs, loading, t, handleChange, props }; |
||||||
|
}, |
||||||
|
}); |
||||||
|
</script> |
@ -0,0 +1,90 @@ |
|||||||
|
<template> |
||||||
|
<a-tree v-bind="getAttrs" @change="handleChange"> |
||||||
|
<template v-for="item in Object.keys($slots)" #[item]="data"> |
||||||
|
<slot :name="item" v-bind="data || {}"/> |
||||||
|
</template> |
||||||
|
<template v-if="loading" #suffixIcon> |
||||||
|
<LoadingOutlined spin/> |
||||||
|
</template> |
||||||
|
</a-tree> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script lang="ts"> |
||||||
|
import { computed, defineComponent, watch, ref, onMounted, unref } from 'vue'; |
||||||
|
import { Tree } from 'ant-design-vue'; |
||||||
|
import { isArray, isFunction } from '/@/utils/is'; |
||||||
|
import { get } from 'lodash-es'; |
||||||
|
import { propTypes } from '/@/utils/propTypes'; |
||||||
|
import { LoadingOutlined } from '@ant-design/icons-vue'; |
||||||
|
export default defineComponent({ |
||||||
|
name: 'ApiTree', |
||||||
|
components: { ATree: Tree, LoadingOutlined }, |
||||||
|
props: { |
||||||
|
api: { type: Function as PropType<(arg?: Recordable) => Promise<Recordable>> }, |
||||||
|
params: { type: Object }, |
||||||
|
immediate: { type: Boolean, default: true }, |
||||||
|
resultField: propTypes.string.def(''), |
||||||
|
afterFetch: { type: Function as PropType<Fn> }, |
||||||
|
}, |
||||||
|
emits: ['options-change', 'change'], |
||||||
|
setup(props, { attrs, emit }) { |
||||||
|
const treeData = ref<Recordable[]>([]); |
||||||
|
const isFirstLoaded = ref<Boolean>(false); |
||||||
|
const loading = ref(false); |
||||||
|
const getAttrs = computed(() => { |
||||||
|
return { |
||||||
|
...(props.api ? { treeData: unref(treeData) } : {}), |
||||||
|
...attrs, |
||||||
|
}; |
||||||
|
}); |
||||||
|
|
||||||
|
function handleChange(...args) { |
||||||
|
emit('change', ...args); |
||||||
|
} |
||||||
|
|
||||||
|
watch( |
||||||
|
() => props.params, |
||||||
|
() => { |
||||||
|
!unref(isFirstLoaded) && fetch(); |
||||||
|
}, |
||||||
|
{ deep: true }, |
||||||
|
); |
||||||
|
|
||||||
|
watch( |
||||||
|
() => props.immediate, |
||||||
|
(v) => { |
||||||
|
v && !isFirstLoaded.value && fetch(); |
||||||
|
}, |
||||||
|
); |
||||||
|
|
||||||
|
onMounted(() => { |
||||||
|
props.immediate && fetch(); |
||||||
|
}); |
||||||
|
|
||||||
|
async function fetch() { |
||||||
|
const { api, afterFetch } = props; |
||||||
|
if (!api || !isFunction(api)) return; |
||||||
|
loading.value = true; |
||||||
|
treeData.value = []; |
||||||
|
let result; |
||||||
|
try { |
||||||
|
result = await api(props.params); |
||||||
|
} catch (e) { |
||||||
|
console.error(e); |
||||||
|
} |
||||||
|
if (afterFetch && isFunction(afterFetch)) { |
||||||
|
result = afterFetch(result); |
||||||
|
} |
||||||
|
loading.value = false; |
||||||
|
if (!result) return; |
||||||
|
if (!isArray(result)) { |
||||||
|
result = get(result, props.resultField); |
||||||
|
} |
||||||
|
treeData.value = (result as Recordable[]) || []; |
||||||
|
isFirstLoaded.value = true; |
||||||
|
emit('options-change', treeData.value); |
||||||
|
} |
||||||
|
return { getAttrs, loading, handleChange }; |
||||||
|
}, |
||||||
|
}); |
||||||
|
</script> |
@ -1,57 +0,0 @@ |
|||||||
<template> |
|
||||||
<BasicModal v-bind="$attrs" |
|
||||||
:title="getTitle" |
|
||||||
@register="registerModal" |
|
||||||
@ok="handleSubmit" |
|
||||||
> |
|
||||||
<BasicForm @register="registerForm"/> |
|
||||||
</BasicModal> |
|
||||||
</template> |
|
||||||
|
|
||||||
<script lang="ts" setup> |
|
||||||
import {ref, computed, unref} from 'vue'; |
|
||||||
import {BasicModal, useModalInner} from '/@/components/Modal'; |
|
||||||
import {cardFormSchema} from './boxcard.data'; |
|
||||||
import {BasicForm, useForm} from '/@/components/Form'; |
|
||||||
import {set} from '/@/api/platform/common/controller/boxcard'; |
|
||||||
const isUpdate = ref(true); |
|
||||||
// 定义emit |
|
||||||
const emit = defineEmits(['success', 'register']); |
|
||||||
/** |
|
||||||
* 表单 |
|
||||||
*/ |
|
||||||
const [registerForm, {resetFields, setFieldsValue, validate}] = useForm({ |
|
||||||
labelWidth: 100, |
|
||||||
schemas: cardFormSchema, |
|
||||||
showActionButtonGroup: false, |
|
||||||
actionColOptions: { |
|
||||||
span: 23, |
|
||||||
}, |
|
||||||
}); |
|
||||||
/** |
|
||||||
* 表单参数 |
|
||||||
*/ |
|
||||||
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => { |
|
||||||
resetFields(); |
|
||||||
setModalProps({confirmLoading: false}); |
|
||||||
isUpdate.value = !!data?.isUpdate; |
|
||||||
if (unref(isUpdate)) { |
|
||||||
setFieldsValue({ |
|
||||||
...data.record, |
|
||||||
}); |
|
||||||
} |
|
||||||
}); |
|
||||||
//表单标题 |
|
||||||
const getTitle = computed(() => (!unref(isUpdate) ? '新增网卡' : '编辑网卡')); |
|
||||||
async function handleSubmit() { |
|
||||||
try { |
|
||||||
const values = await validate(); |
|
||||||
setModalProps({confirmLoading: true}); |
|
||||||
await set(values);//保存网卡 |
|
||||||
closeModal(); |
|
||||||
emit('success'); |
|
||||||
} finally { |
|
||||||
setModalProps({confirmLoading: false}); |
|
||||||
} |
|
||||||
} |
|
||||||
</script> |
|
@ -1,160 +0,0 @@ |
|||||||
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: 'ID', |
|
||||||
dataIndex: 'id', |
|
||||||
width: 120, |
|
||||||
}, |
|
||||||
{ |
|
||||||
title: 'iccid', |
|
||||||
dataIndex: 'iccid', |
|
||||||
width: 120, |
|
||||||
}, |
|
||||||
{ |
|
||||||
title: '卡号', |
|
||||||
dataIndex: 'card', |
|
||||||
width: 120, |
|
||||||
}, |
|
||||||
{ |
|
||||||
title: '网卡厂商', |
|
||||||
dataIndex: 'company', |
|
||||||
width: 120, |
|
||||||
customRender: ({ record }) => { |
|
||||||
const com = record.company; |
|
||||||
switch (com) { |
|
||||||
case '1': return '中国移动'; |
|
||||||
case '2': return '中国联通'; |
|
||||||
case '3': return '中国电信'; |
|
||||||
default: return '未知厂商'; |
|
||||||
} |
|
||||||
} |
|
||||||
}, |
|
||||||
{ |
|
||||||
title: '卡是否已使用', |
|
||||||
dataIndex: 'isUsed', |
|
||||||
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: 'iccid', |
|
||||||
label: 'iccid', |
|
||||||
component: 'Input', |
|
||||||
componentProps: { |
|
||||||
placeholder: '请输入唯一标识iccid', |
|
||||||
}, |
|
||||||
colProps: { span: 5 }, |
|
||||||
}, |
|
||||||
{ |
|
||||||
field: 'card', |
|
||||||
label: '卡号', |
|
||||||
component: 'Input', |
|
||||||
componentProps: { |
|
||||||
placeholder: '请输入卡号', |
|
||||||
}, |
|
||||||
colProps: { span: 5 }, |
|
||||||
}, |
|
||||||
{ |
|
||||||
field: 'company', |
|
||||||
label: '网卡厂商', |
|
||||||
component: 'Input', |
|
||||||
componentProps: { |
|
||||||
placeholder: '请输入网卡厂商', |
|
||||||
}, |
|
||||||
colProps: { span: 4 }, |
|
||||||
}, |
|
||||||
{ |
|
||||||
field: 'beginTime', |
|
||||||
label: '起始时间', |
|
||||||
component: 'DatePicker', |
|
||||||
colProps: { span: 5 }, |
|
||||||
}, |
|
||||||
{ |
|
||||||
field: 'endTime', |
|
||||||
label: '截止时间', |
|
||||||
component: 'DatePicker', |
|
||||||
colProps: { span: 5 }, |
|
||||||
}, |
|
||||||
]; |
|
||||||
|
|
||||||
export const cardFormSchema: FormSchema[] = [ |
|
||||||
{ |
|
||||||
field: 'id', |
|
||||||
label: 'ID', |
|
||||||
component: 'Input', |
|
||||||
show: false, |
|
||||||
}, |
|
||||||
{ |
|
||||||
field: 'iccid', |
|
||||||
label: 'iccid', |
|
||||||
component: 'Input', |
|
||||||
helpMessage: ['唯一识别号'], |
|
||||||
required: true |
|
||||||
}, |
|
||||||
{ |
|
||||||
field: 'card', |
|
||||||
label: '卡号', |
|
||||||
component: 'Input', |
|
||||||
required: false, |
|
||||||
}, |
|
||||||
{ |
|
||||||
field: 'company', |
|
||||||
label: '网卡厂商', |
|
||||||
component: 'Select', |
|
||||||
required: true, |
|
||||||
componentProps: { |
|
||||||
options: [ |
|
||||||
{ label: '中国移动', value: '1' }, |
|
||||||
{ label: '中国联通', value: '2' }, |
|
||||||
{ label: '中国电信', value: '3' }, |
|
||||||
{ label: '未知厂商', value: ''||undefined||null } |
|
||||||
], |
|
||||||
|
|
||||||
} |
|
||||||
}, |
|
||||||
{ |
|
||||||
field: 'status', |
|
||||||
label: '状态', |
|
||||||
component: 'RadioButtonGroup', |
|
||||||
defaultValue: '0', |
|
||||||
componentProps: { |
|
||||||
options: [ |
|
||||||
{ label: '启用', value: '0' }, |
|
||||||
{ label: '禁用', value: '1' }, |
|
||||||
], |
|
||||||
}, |
|
||||||
}, |
|
||||||
{ |
|
||||||
label: '备注', |
|
||||||
field: 'remarks', |
|
||||||
component: 'InputTextArea', |
|
||||||
} |
|
||||||
]; |
|
@ -1,94 +0,0 @@ |
|||||||
<template> |
|
||||||
<div> |
|
||||||
<BasicTable @register="registerTable"> |
|
||||||
<template #toolbar> |
|
||||||
<a-button type="primary" @click="handleCreate">新增网卡</a-button> |
|
||||||
</template> |
|
||||||
<template #action="{ record }"> |
|
||||||
<TableAction |
|
||||||
:actions="[ |
|
||||||
{ |
|
||||||
icon: 'clarity:note-edit-line', |
|
||||||
onClick: handleEdit.bind(null, record), |
|
||||||
}, |
|
||||||
{ |
|
||||||
icon: 'ant-design:delete-outlined', |
|
||||||
color: 'error', |
|
||||||
popConfirm: { |
|
||||||
title: '是否确认删除', |
|
||||||
confirm: handleDelete.bind(null, record), |
|
||||||
}, |
|
||||||
}, |
|
||||||
]" |
|
||||||
/> |
|
||||||
</template> |
|
||||||
</BasicTable> |
|
||||||
|
|
||||||
<BoxCardModal @register="registerModal" @success="handleSuccess"/> |
|
||||||
</div> |
|
||||||
</template> |
|
||||||
|
|
||||||
<script lang="ts" setup> |
|
||||||
import {BasicTable, useTable, TableAction} from '/@/components/Table'; |
|
||||||
import {useModal} from '/@/components/Modal'; |
|
||||||
import BoxCardModal from './BoxCardModal.vue'; |
|
||||||
import {columns, searchFormSchema} from './boxcard.data'; |
|
||||||
import {useMessage} from '/@/hooks/web/useMessage'; |
|
||||||
import {cardList, remove} from '/@/api/platform/common/controller/boxcard'; |
|
||||||
const {createMessage} = useMessage(); |
|
||||||
const [registerModal, {openModal}] = useModal(); |
|
||||||
const [registerTable, {reload}] = useTable({ |
|
||||||
title: '网卡列表', |
|
||||||
api: cardList, |
|
||||||
columns, |
|
||||||
formConfig: { |
|
||||||
labelWidth: 120, |
|
||||||
schemas: searchFormSchema, |
|
||||||
}, |
|
||||||
pagination: true, |
|
||||||
striped: true, |
|
||||||
useSearchForm: true, |
|
||||||
showTableSetting: true, |
|
||||||
bordered: true, |
|
||||||
showIndexColumn: true, |
|
||||||
canResize: false, |
|
||||||
actionColumn: { |
|
||||||
width: 80, |
|
||||||
title: '操作', |
|
||||||
dataIndex: 'action', |
|
||||||
slots: {customRender: 'action'}, |
|
||||||
fixed: undefined, |
|
||||||
}, |
|
||||||
}); |
|
||||||
/** |
|
||||||
* 创建菜单 |
|
||||||
*/ |
|
||||||
function handleCreate() { |
|
||||||
openModal(true, { |
|
||||||
isUpdate: false, |
|
||||||
}); |
|
||||||
} |
|
||||||
/** |
|
||||||
* 编辑菜单 |
|
||||||
*/ |
|
||||||
function handleEdit(record: Recordable) { |
|
||||||
openModal(true, { |
|
||||||
record, |
|
||||||
isUpdate: true, |
|
||||||
}); |
|
||||||
} |
|
||||||
/** |
|
||||||
* 删除菜单 |
|
||||||
*/ |
|
||||||
async function handleDelete(record: Recordable) { |
|
||||||
await remove({ids: record.id}); |
|
||||||
createMessage.success('删除成功!'); |
|
||||||
handleSuccess(); |
|
||||||
} |
|
||||||
/** |
|
||||||
* 成功后重载表格 |
|
||||||
*/ |
|
||||||
function handleSuccess() { |
|
||||||
reload(); |
|
||||||
} |
|
||||||
</script> |
|
@ -1,274 +1,225 @@ |
|||||||
import { BasicColumn } from '/@/components/Table'; |
import { BasicColumn } from '/@/components/Table'; |
||||||
import { FormSchema } from '/@/components/Table'; |
import { FormSchema } from '/@/components/Table'; |
||||||
import {h, watch, watchEffect, watchSyncEffect} from 'vue'; |
import { h } from 'vue'; |
||||||
import {Tag} from 'ant-design-vue'; |
import { Tag } from 'ant-design-vue'; |
||||||
import { list as hospitalList } from '/@/api/platform/common/controller/hospital'; |
import { listHospital } from '/@/api/platform/common/controller/hospital'; |
||||||
import {list as institutionList} from '/@/api/platform/common/controller/institution'; |
import { listOrg } from '/@/api/platform/common/controller/org'; |
||||||
import { listOffice as officeList } from '/@/api/platform/common/controller/office'; |
import { listOffice } from '/@/api/platform/common/controller/office'; |
||||||
import {deepMerge} from '/@/utils'; |
|
||||||
|
|
||||||
|
|
||||||
export const columns: BasicColumn[] = [ |
export const columns: BasicColumn[] = [ |
||||||
{ |
{ |
||||||
title: 'ID', |
title: 'ID', |
||||||
dataIndex: 'id', |
dataIndex: 'id', |
||||||
width: 120, |
width: 120, |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
title: '医生姓名', |
title: '医生姓名', |
||||||
dataIndex: 'name', |
dataIndex: 'name', |
||||||
width: 120, |
width: 120, |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
title: '医生职称', |
title: '医生职称', |
||||||
dataIndex: 'title', |
dataIndex: 'title', |
||||||
width: 120, |
width: 120, |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
title: '医生性别', |
title: '医生电话', |
||||||
dataIndex: 'sex', |
dataIndex: 'phone', |
||||||
width: 120, |
width: 120, |
||||||
customRender: ({ record }) => { |
}, |
||||||
switch (record.sex) { |
{ |
||||||
case 'M': return '男'; |
title: '医生邮箱', |
||||||
case 'F': return '女'; |
dataIndex: 'email', |
||||||
default: return '未知'; |
width: 120, |
||||||
} |
}, |
||||||
} |
{ |
||||||
}, |
title: '详细地址', |
||||||
{ |
dataIndex: 'detailAddress', |
||||||
title: '医生电话', |
width: 120, |
||||||
dataIndex: 'phone', |
}, |
||||||
width: 120, |
{ |
||||||
}, |
title: '所属组织类型', |
||||||
{ |
dataIndex: 'orgType', |
||||||
title: '医生邮箱', |
width: 120, |
||||||
dataIndex: 'email', |
customRender: ({ record }) => { |
||||||
width: 120, |
const orgType = record.orgType; |
||||||
}, |
let text = '', color = ''; |
||||||
{ |
switch (orgType) { |
||||||
title: '地址', |
case '1': |
||||||
dataIndex: 'detailAddress', |
text = '医院'; |
||||||
width: 120, |
color = 'green'; |
||||||
}, |
break; |
||||||
{ |
case '2': |
||||||
title: '所属组织类型', |
text = '医检'; |
||||||
dataIndex: 'organType', |
color = 'blue'; |
||||||
width: 120, |
break; |
||||||
customRender: ({ record }) => { |
} |
||||||
const organType = record.organType; |
return h(Tag, { color: color }, () => text); |
||||||
let text = ''; |
} |
||||||
let color = ''; |
}, |
||||||
switch (organType) { |
{ |
||||||
case '1': |
title: '状态', |
||||||
text = '医院'; |
dataIndex: 'status', |
||||||
color = 'green'; |
width: 100, |
||||||
break; |
customRender: ({ record }) => { |
||||||
case '2': |
const status = record.status; |
||||||
text = '医检'; |
// 采用二进制~~取反,只要为null或者0等等一些其他的空元素都会转为0
|
||||||
color = 'blue'; |
// 第一次取反会运算为-1,在后一次取反会运算为0
|
||||||
break; |
const enable = ~~status === 0; |
||||||
default: |
const color = enable ? 'green' : 'red'; |
||||||
text = '未知'; |
const text = enable ? '启用' : '禁用'; |
||||||
color = 'gray'; |
return h(Tag, { color: color }, () => text); |
||||||
break; |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
return h(Tag, { color: color }, () => text); |
|
||||||
} |
|
||||||
}, |
|
||||||
// {
|
|
||||||
// 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, |
|
||||||
} |
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
title: '创建时间', |
||||||
|
dataIndex: 'createTime', |
||||||
|
width: 180, |
||||||
|
} |
||||||
]; |
]; |
||||||
|
|
||||||
export const searchFormSchema: FormSchema[] = [ |
export const searchFormSchema: FormSchema[] = [ |
||||||
{ |
{ |
||||||
field: 'name', |
field: 'name', |
||||||
label: '医生姓名', |
label: '医生姓名', |
||||||
component: 'Input', |
component: 'Input', |
||||||
componentProps: { |
componentProps: { |
||||||
placeholder: '请输入医生姓名', |
placeholder: '请输入医生姓名', |
||||||
}, |
}, |
||||||
colProps: { span: 5 }, |
colProps: { span: 8 }, |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
field: 'organType', |
field: 'orgType', |
||||||
label: '组织类型', |
label: '组织类型', |
||||||
component: 'Select', |
component: 'Select', |
||||||
|
componentProps: { |
||||||
componentProps: { |
options: [ |
||||||
options: [ |
{ label: '医院',value: '1' }, |
||||||
{label: '医院',value: '1'}, |
{ label: '医检',value: '2' } |
||||||
{label: '医检',value: '2'} |
] |
||||||
] |
}, |
||||||
}, |
colProps: { span: 7 } |
||||||
colProps: {span: 5} |
}, |
||||||
}, |
{ |
||||||
{ |
field: 'dateRange', |
||||||
field: 'dateRange', |
label: '创建时间', |
||||||
label: '创建时间', |
component: 'RangePicker', |
||||||
component: 'RangePicker', |
componentProps: { |
||||||
componentProps: { |
style: { width:'100%' }, |
||||||
style: { width:'100%' }, |
valueFormat: 'YYYY-MM-DD', |
||||||
valueFormat: 'YYYY-MM-DD', |
placeholder: ['开始日期','结束日期'] |
||||||
placeholder: ['开始日期','结束日期'] |
}, |
||||||
}, |
colProps: { span: 8 } |
||||||
colProps: { span: 8 } |
} |
||||||
} |
|
||||||
]; |
]; |
||||||
|
|
||||||
export const doctorFormSchema: FormSchema[] = [ |
export const formSchema: FormSchema[] = [ |
||||||
{ |
{ |
||||||
field: 'id', |
field: 'id', |
||||||
label: 'ID', |
label: 'ID', |
||||||
component: 'Input', |
component: 'Input', |
||||||
show: false, |
show: false, |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
field: 'name', |
field: 'name', |
||||||
label: '医生姓名', |
label: '医生姓名', |
||||||
component: 'Input', |
component: 'Input', |
||||||
|
required: true |
||||||
|
}, |
||||||
|
{ |
||||||
|
field: 'title', |
||||||
|
label: '医生职称', |
||||||
|
component: 'Input', |
||||||
|
required: true, |
||||||
|
}, |
||||||
|
{ |
||||||
|
field: 'sex', |
||||||
|
label: '医生性别', |
||||||
|
component: 'Select', |
||||||
|
defaultValue: '0', |
||||||
|
componentProps: { |
||||||
|
options: [ |
||||||
|
{ label: '男', value: '0' }, |
||||||
|
{ label: '女', value: '1' }, |
||||||
|
] |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
field: 'phone', |
||||||
|
label: '医生电话', |
||||||
|
component: 'Input', |
||||||
|
rules: [ |
||||||
|
{ |
||||||
|
pattern: new RegExp('^1[3|4|5|6|7|8|9][0-9]\\d{8}$'), |
||||||
|
message: '请输入正确的手机号', |
||||||
|
validateTrigger: 'change', |
||||||
required: true |
required: true |
||||||
}, |
} |
||||||
{ |
], |
||||||
field: 'title', |
}, |
||||||
label: '医生职称', |
{ |
||||||
component: 'Input', |
field: 'email', |
||||||
required: true, |
label: '医生邮箱', |
||||||
}, |
component: 'Input', |
||||||
{ |
rules: [ |
||||||
field: 'sex', |
{ |
||||||
label: '医生性别', |
type: 'email', |
||||||
component: 'Select', |
message: '请输入正确的邮箱', |
||||||
required: false, |
validateTrigger: 'change', |
||||||
defaultValue: 'M', |
required: true |
||||||
componentProps: { |
} |
||||||
options: [ |
], |
||||||
{ label: '男', value: 'M' }, |
}, |
||||||
{ label: '女', value: 'F' }, |
{ |
||||||
] |
field: 'detailAddress', |
||||||
} |
label: '地址', |
||||||
}, |
component: 'Input', |
||||||
{ |
required: false, |
||||||
field: 'phone', |
}, |
||||||
label: '医生电话', |
{ |
||||||
component: 'Input', |
field: 'orgType', |
||||||
rules: [ |
label: '所属组织类型', |
||||||
{ |
component: 'Select', |
||||||
pattern: new RegExp('^1[3|4|5|6|7|8|9][0-9]\\d{8}$'), |
defaultValue: '1', |
||||||
message: '请输入正确的手机号', |
componentProps: { |
||||||
validateTrigger: 'change', |
options: [ |
||||||
required: true |
{ label: '医院', value: '1' }, |
||||||
} |
{ label: '医检', value: '2' } |
||||||
], |
] |
||||||
}, |
}, |
||||||
{ |
required: true, |
||||||
field: 'email', |
}, |
||||||
label: '医生邮箱', |
{ |
||||||
component: 'Input', |
field: 'orgId', |
||||||
rules: [ |
label: '所属组织', |
||||||
{ |
component: 'ApiSelect', |
||||||
type: 'email', |
required: true, |
||||||
message: '请输入正确的邮箱', |
renderComponentContent: ({ schema, values, model, field }) => { |
||||||
validateTrigger: 'change', |
const organType = model.orgType; |
||||||
required: true |
const dataApi = ~~organType === 1 ? listHospital : listOrg; |
||||||
} |
schema.componentProps = { |
||||||
], |
api: dataApi, |
||||||
}, |
labelField: 'name', |
||||||
{ |
valueField: 'id', |
||||||
field: 'detailAddress', |
resultField: 'data' |
||||||
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: ({ schema, values, model, field }) => {
|
|
||||||
// const organType = model.organType;
|
|
||||||
// watch(organType,
|
|
||||||
// () => {
|
|
||||||
// const dataApi = organType=='1' ? hospitalList : institutionList;
|
|
||||||
// console.log(schema);
|
|
||||||
// schema.componentProps = deepMerge({
|
|
||||||
// api: dataApi,
|
|
||||||
// labelField: 'name',
|
|
||||||
// valueField: 'id'
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// immediate: true,
|
|
||||||
// }
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// field: 'officeId',
|
|
||||||
// label: '所属科室',
|
|
||||||
// component: 'ApiSelect',
|
|
||||||
// componentProps: {
|
|
||||||
// mode: 'multiple',
|
|
||||||
// resultField: 'list',
|
|
||||||
// labelField: 'name',
|
|
||||||
// valueField: 'id',
|
|
||||||
// api: officeList,
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
{ |
|
||||||
field: 'status', |
|
||||||
label: '状态', |
|
||||||
component: 'RadioButtonGroup', |
|
||||||
defaultValue: '0', |
|
||||||
componentProps: { |
|
||||||
options: [ |
|
||||||
{ label: '启用', value: '0' }, |
|
||||||
{ label: '禁用', value: '1' }, |
|
||||||
], |
|
||||||
}, |
|
||||||
}, |
|
||||||
{ |
|
||||||
label: '备注', |
|
||||||
field: 'remarks', |
|
||||||
component: 'InputTextArea', |
|
||||||
} |
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
field: 'status', |
||||||
|
label: '状态', |
||||||
|
component: 'RadioButtonGroup', |
||||||
|
defaultValue: '0', |
||||||
|
componentProps: { |
||||||
|
options: [ |
||||||
|
{ label: '启用', value: '0' }, |
||||||
|
{ label: '禁用', value: '1' }, |
||||||
|
], |
||||||
|
}, |
||||||
|
}, |
||||||
|
{ |
||||||
|
label: '备注', |
||||||
|
field: 'remarks', |
||||||
|
component: 'InputTextArea', |
||||||
|
} |
||||||
]; |
]; |
||||||
|
@ -1,262 +1,226 @@ |
|||||||
import { BasicColumn } from '/@/components/Table'; |
import { BasicColumn } from '/@/components/Table'; |
||||||
import { FormSchema } from '/@/components/Table'; |
import { FormSchema } from '/@/components/Table'; |
||||||
import {h} from 'vue'; |
import { h } from 'vue'; |
||||||
import {Tag} from 'ant-design-vue'; |
import { Tag } from 'ant-design-vue'; |
||||||
import {list as institutionList} from '/@/api/platform/common/controller/institution'; |
import { listOrg } from '/@/api/platform/common/controller/org'; |
||||||
|
|
||||||
|
|
||||||
export const columns: BasicColumn[] = [ |
export const columns: BasicColumn[] = [ |
||||||
{ |
{ |
||||||
title: 'ID', |
title: 'ID', |
||||||
dataIndex: 'id', |
dataIndex: 'id', |
||||||
width: 120, |
width: 120, |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
title: '医院名', |
title: '医院名', |
||||||
dataIndex: 'name', |
dataIndex: 'name', |
||||||
width: 120, |
width: 120, |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
title: '医院类型', |
title: '医院类型', |
||||||
dataIndex: 'card', |
dataIndex: 'type', |
||||||
width: 120, |
width: 120, |
||||||
customRender: ({ record }) =>{ |
customRender: ({ record }) => { |
||||||
const type = record.type; |
const type = record.type; |
||||||
let text = ''; |
let text = '', color = ''; |
||||||
let color = ''; |
switch (type) { |
||||||
switch (type) { |
case '0': |
||||||
case '1': |
text = '其他医院'; |
||||||
text = '合作医院'; |
color = 'gray'; |
||||||
color = 'green'; |
break; |
||||||
break; |
case '1': |
||||||
case '0': |
text = '合作医院'; |
||||||
text = '其他医院'; |
color = 'green'; |
||||||
color = 'gray'; |
break; |
||||||
break; |
} |
||||||
default: |
return h(Tag, { color: color }, () => text); |
||||||
text = '其他医院'; |
} |
||||||
color = 'gray'; |
}, |
||||||
break; |
{ |
||||||
} |
title: '联系人', |
||||||
|
dataIndex: 'contactName', |
||||||
return h(Tag, { color: color }, () => text); |
width: 120, |
||||||
} |
}, |
||||||
}, |
{ |
||||||
{ |
title: '联系人电话', |
||||||
title: '联系人', |
dataIndex: 'contactPhone', |
||||||
dataIndex: 'contactsName', |
width: 120, |
||||||
width: 120, |
}, |
||||||
}, |
{ |
||||||
{ |
title: '联系人职称', |
||||||
title: '联系人电话', |
dataIndex: 'contactTitle', |
||||||
dataIndex: 'contactsTel', |
width: 120, |
||||||
width: 120, |
}, |
||||||
}, |
{ |
||||||
{ |
title: '支付方式', |
||||||
title: '联系人职称', |
dataIndex: 'payment', |
||||||
dataIndex: 'contactsTitle', |
width: 120, |
||||||
width: 120, |
customRender: ({ record }) => { |
||||||
}, |
const com = record.payment; |
||||||
{ |
switch (com) { |
||||||
title: '支付方式', |
case '0': return '月付'; |
||||||
dataIndex: 'payment', |
case '1': return '预约付款'; |
||||||
width: 120, |
case '2': return '采样付款'; |
||||||
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, |
|
||||||
} |
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
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: 'createTime', |
||||||
|
width: 180, |
||||||
|
} |
||||||
]; |
]; |
||||||
|
|
||||||
export const searchFormSchema: FormSchema[] = [ |
export const searchFormSchema: FormSchema[] = [ |
||||||
{ |
{ |
||||||
field: 'name', |
field: 'name', |
||||||
label: '医院名称', |
label: '医院名称', |
||||||
component: 'Input', |
component: 'Input', |
||||||
componentProps: { |
componentProps: { |
||||||
placeholder: '请输入医院名称', |
placeholder: '请输入医院名称', |
||||||
}, |
}, |
||||||
colProps: { span: 5 }, |
colProps: { span: 8 } |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
field: 'type', |
field: 'type', |
||||||
label: '医院类型', |
label: '医院类型', |
||||||
component: 'Select', |
component: 'Select', |
||||||
|
componentProps: { |
||||||
componentProps: { |
options: [ |
||||||
options: [ |
{ label: '其他医院',value: '0' }, |
||||||
{label: '合作医院',value: '1'}, |
{ label: '合作医院',value: '1' } |
||||||
{label: '其他医院',value: '0'}, |
] |
||||||
] |
}, |
||||||
}, |
colProps: { span: 7 } |
||||||
colProps: {span: 7} |
}, |
||||||
}, |
{ |
||||||
{ |
field: 'dateRange', |
||||||
field: 'dateRange', |
label: '创建时间', |
||||||
label: '创建时间', |
component: 'RangePicker', |
||||||
component: 'RangePicker', |
componentProps: { |
||||||
componentProps: { |
style: { width:'100%' }, |
||||||
style: { width:'100%' }, |
valueFormat: 'YYYY-MM-DD', |
||||||
valueFormat: 'YYYY-MM-DD', |
placeholder: ['开始日期','结束日期'] |
||||||
placeholder: ['开始日期','结束日期'] |
}, |
||||||
}, |
colProps: { span: 8 } |
||||||
colProps: { span: 8 } |
} |
||||||
} |
|
||||||
// {
|
|
||||||
// field: 'beginTime',
|
|
||||||
// label: '起始时间',
|
|
||||||
// component: 'DatePicker',
|
|
||||||
// colProps: { span: 5 },
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// field: 'endTime',
|
|
||||||
// label: '截止时间',
|
|
||||||
// component: 'DatePicker',
|
|
||||||
// colProps: { span: 5 },
|
|
||||||
// },
|
|
||||||
]; |
]; |
||||||
|
|
||||||
export const hospitalFormSchema: FormSchema[] = [ |
export const formSchema: FormSchema[] = [ |
||||||
{ |
{ |
||||||
field: 'id', |
field: 'id', |
||||||
label: 'ID', |
label: 'ID', |
||||||
component: 'Input', |
component: 'Input', |
||||||
show: false, |
show: false, |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
field: 'name', |
field: 'name', |
||||||
label: '医院名称', |
label: '医院名称', |
||||||
component: 'Input', |
component: 'Input', |
||||||
required: true |
required: true |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
field: 'type', |
field: 'type', |
||||||
label: '医院类型', |
label: '医院类型', |
||||||
component: 'Select', |
component: 'Select', |
||||||
defaultValue: '0', |
defaultValue: '0', |
||||||
componentProps: { |
componentProps: { |
||||||
options: [ |
options: [ |
||||||
{label: '合作医院',value: '1'}, |
{ label: '其他医院',value: '0' }, |
||||||
{label: '其他医院',value: '0'}, |
{ label: '合作医院',value: '1' }, |
||||||
] |
] |
||||||
}, |
}, |
||||||
required: true, |
required: true, |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
field: 'contactsName', |
field: 'contactName', |
||||||
label: '联系人名称', |
label: '联系人名称', |
||||||
component: 'Input', |
component: 'Input', |
||||||
required: true |
required: true |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
field: 'contactsTel', |
field: 'contactPhone', |
||||||
label: '联系人电话', |
label: '联系人电话', |
||||||
component: 'Input', |
component: 'Input', |
||||||
rules: [ |
rules: [ |
||||||
{ |
{ |
||||||
pattern: new RegExp('^1[3|4|5|6|7|8|9][0-9]\\d{8}$'), |
pattern: new RegExp('^1[3|4|5|6|7|8|9][0-9]\\d{8}$'), |
||||||
message: '请输入正确的手机号', |
message: '请输入正确的手机号', |
||||||
validateTrigger: 'change', |
validateTrigger: 'change', |
||||||
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 |
required: true |
||||||
}, |
} |
||||||
{ |
], |
||||||
field: 'status', |
}, |
||||||
label: '状态', |
{ |
||||||
component: 'RadioButtonGroup', |
field: 'contactTitle', |
||||||
defaultValue: '0', |
label: '联系人职称', |
||||||
componentProps: { |
component: 'Input', |
||||||
options: [ |
required: true |
||||||
{ label: '启用', value: '0' }, |
}, |
||||||
{ label: '禁用', value: '1' }, |
{ |
||||||
], |
field: 'payment', |
||||||
}, |
label: '支付方式', |
||||||
}, |
component: 'Select', |
||||||
{ |
required: true, |
||||||
field: 'institutionIds', |
defaultValue: '0', |
||||||
label: '关联机构', |
componentProps: { |
||||||
component: 'ApiSelect', |
options: [ |
||||||
componentProps: { |
{ label: '月付', value: '0' }, |
||||||
mode: 'multiple', |
{ label: '预约付款', value: '1' }, |
||||||
resultField: 'list', |
{ label: '采样付款', value: '2' }, |
||||||
labelField: 'name', |
], |
||||||
valueField: 'id', |
|
||||||
api: institutionList, |
|
||||||
}, |
|
||||||
required:true |
|
||||||
}, |
|
||||||
|
|
||||||
{ |
|
||||||
label: '备注', |
|
||||||
field: 'remarks', |
|
||||||
component: 'InputTextArea', |
|
||||||
} |
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
field: 'detailAddress', |
||||||
|
label: '详细地址', |
||||||
|
component: 'Input', |
||||||
|
required: true |
||||||
|
}, |
||||||
|
{ |
||||||
|
field: 'status', |
||||||
|
label: '状态', |
||||||
|
component: 'RadioButtonGroup', |
||||||
|
defaultValue: '0', |
||||||
|
componentProps: { |
||||||
|
options: [ |
||||||
|
{ label: '启用', value: '0' }, |
||||||
|
{ label: '禁用', value: '1' }, |
||||||
|
], |
||||||
|
}, |
||||||
|
}, |
||||||
|
{ |
||||||
|
field: 'orgIds', |
||||||
|
label: '关联机构', |
||||||
|
component: 'ApiSelect', |
||||||
|
componentProps: { |
||||||
|
mode: 'multiple', |
||||||
|
resultField: 'data', |
||||||
|
labelField: 'name', |
||||||
|
valueField: 'id', |
||||||
|
api: listOrg |
||||||
|
}, |
||||||
|
required:true |
||||||
|
}, |
||||||
|
{ |
||||||
|
label: '备注', |
||||||
|
field: 'remarks', |
||||||
|
component: 'InputTextArea' |
||||||
|
} |
||||||
]; |
]; |
||||||
|
@ -1,136 +0,0 @@ |
|||||||
<template> |
|
||||||
<div> |
|
||||||
<BasicTable @register="registerTable" |
|
||||||
@selection-change="handleSelectionChange" |
|
||||||
> |
|
||||||
<template #toolbar> |
|
||||||
<a-button |
|
||||||
type="primary" |
|
||||||
@click="handleAdd()" |
|
||||||
>新增机构</a-button> |
|
||||||
<a-button type="primary" |
|
||||||
:disabled="state.single" |
|
||||||
@click="handleEdit()" |
|
||||||
>修改机构</a-button> |
|
||||||
<a-button type="primary" |
|
||||||
:disabled="state.multiple" |
|
||||||
@click="handleDel()" |
|
||||||
>删除机构</a-button> |
|
||||||
</template> |
|
||||||
<template #action="{ record }"> |
|
||||||
<TableAction :actions="[ |
|
||||||
{ |
|
||||||
label: '编辑', |
|
||||||
icon: 'fa6-regular:pen-to-square', |
|
||||||
onClick: handleEdit.bind(null, record) |
|
||||||
}, |
|
||||||
{ |
|
||||||
label: '删除', |
|
||||||
icon: 'ant-design:delete-outlined', |
|
||||||
color: 'error', |
|
||||||
onClick: handleDel.bind(null, record) |
|
||||||
}]" |
|
||||||
/> |
|
||||||
</template> |
|
||||||
</BasicTable> |
|
||||||
<!--弹出窗体区域--> |
|
||||||
<InstitutionModal @register="registerModal" @success="handleRefreshTable"/> |
|
||||||
</div> |
|
||||||
</template> |
|
||||||
|
|
||||||
<script lang="ts" setup> |
|
||||||
/** |
|
||||||
* 提供模板规范代码参考,请尽量保证编写代码风格跟模板规范代码一致 |
|
||||||
* 采用vben-动态表格表单封装组件编写,采用 setup 写法 |
|
||||||
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved. |
|
||||||
* author entfrm开发团队-王翔 |
|
||||||
*/ |
|
||||||
import { reactive, toRaw } from 'vue'; |
|
||||||
import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
|
||||||
import {list, delInstitution} from '/@/api/platform/common/controller/institution'; |
|
||||||
import { useModal } from '/@/components/Modal'; |
|
||||||
import { columns, searchFormSchema } from './institution.data'; |
|
||||||
import { useMessage } from '/@/hooks/web/useMessage'; |
|
||||||
import InstitutionModal from './InstitutionModal.vue'; |
|
||||||
|
|
||||||
/** 类型规范统一声明定义区域 */ |
|
||||||
interface TableState { |
|
||||||
single: boolean; |
|
||||||
multiple: boolean; |
|
||||||
} |
|
||||||
|
|
||||||
/** 通用变量统一声明区域 */ |
|
||||||
const state = reactive<TableState>({ |
|
||||||
// 非单个禁用 |
|
||||||
single: true, |
|
||||||
// 非多个禁用 |
|
||||||
multiple: true |
|
||||||
}); |
|
||||||
const { createConfirm, createMessage } = useMessage(); |
|
||||||
const [registerModal, { openModal }] = useModal(); |
|
||||||
const [registerTable, { reload, clearSelectedRowKeys, getSelectRowKeys }] = useTable({ |
|
||||||
title: '医生列表', |
|
||||||
api: list, |
|
||||||
rowKey: 'id', |
|
||||||
columns, |
|
||||||
formConfig: { |
|
||||||
labelWidth: 120, |
|
||||||
schemas: searchFormSchema, |
|
||||||
autoSubmitOnEnter: true, |
|
||||||
fieldMapToTime: [['dateRange', ['beginTime', 'endTime'], 'YYYY-MM-DD']] |
|
||||||
}, |
|
||||||
rowSelection: { type: 'checkbox' }, |
|
||||||
useSearchForm: true, |
|
||||||
showTableSetting: true, |
|
||||||
bordered: true, |
|
||||||
clickToRowSelect: false, |
|
||||||
showIndexColumn: false, |
|
||||||
actionColumn: { |
|
||||||
width: 220, |
|
||||||
title: '操作', |
|
||||||
dataIndex: 'action', |
|
||||||
slots: { customRender: 'action' }, |
|
||||||
fixed: false |
|
||||||
}, |
|
||||||
handleSearchInfoFn: () => clearSelectedRowKeys() |
|
||||||
}); |
|
||||||
|
|
||||||
/** 处理多选框选中数据 */ |
|
||||||
function handleSelectionChange(selection?: Recordable) { |
|
||||||
const rowSelection = toRaw(selection?.keys) || []; |
|
||||||
state.single = rowSelection.length != 1; |
|
||||||
state.multiple = !rowSelection.length; |
|
||||||
} |
|
||||||
|
|
||||||
/** 新增按钮操作,行内新增与工具栏局域新增通用 */ |
|
||||||
function handleAdd() { |
|
||||||
openModal(true,{ _tag: 'add' }); |
|
||||||
} |
|
||||||
|
|
||||||
/** 编辑按钮操作,行内编辑 */ |
|
||||||
function handleEdit(record?: Recordable) { |
|
||||||
record = record || { id: getSelectRowKeys() }; |
|
||||||
openModal(true, { _tag: 'edit', record }); |
|
||||||
} |
|
||||||
|
|
||||||
/** 删除按钮操作,行内删除 */ |
|
||||||
async function handleDel(record?: Recordable) { |
|
||||||
const id = record?.id || getSelectRowKeys(); |
|
||||||
createConfirm({ |
|
||||||
iconType: 'warning', |
|
||||||
title: '警告', |
|
||||||
content: `是否确认删除机构编号为${id}机构吗?`, |
|
||||||
onOk: async () => { |
|
||||||
await delInstitution(id); |
|
||||||
createMessage.success('删除成功!'); |
|
||||||
handleRefreshTable(); |
|
||||||
} |
|
||||||
}); |
|
||||||
} |
|
||||||
|
|
||||||
/** 处理表格刷新 */ |
|
||||||
function handleRefreshTable() { |
|
||||||
clearSelectedRowKeys(); |
|
||||||
reload(); |
|
||||||
} |
|
||||||
</script> |
|
@ -1,217 +1,196 @@ |
|||||||
import { BasicColumn } from '/@/components/Table'; |
import { BasicColumn } from '/@/components/Table'; |
||||||
import { FormSchema } from '/@/components/Table'; |
import { FormSchema } from '/@/components/Table'; |
||||||
import {h, watch} from 'vue'; |
import { h } from 'vue'; |
||||||
import {Tag} from 'ant-design-vue'; |
import { Tag } from 'ant-design-vue'; |
||||||
import { list as hospitalList } from '/@/api/platform/common/controller/hospital'; |
import { listHospital } from '/@/api/platform/common/controller/hospital'; |
||||||
import { list as institutionList } from '/@/api/platform/common/controller/institution'; |
import { listOrg } from '/@/api/platform/common/controller/org'; |
||||||
import {deepMerge} from '/@/utils'; |
|
||||||
|
|
||||||
|
|
||||||
export const columns: BasicColumn[] = [ |
export const columns: BasicColumn[] = [ |
||||||
{ |
{ |
||||||
title: 'ID', |
title: 'ID', |
||||||
dataIndex: 'id', |
dataIndex: 'id', |
||||||
width: 120, |
width: 120 |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
title: '科室名称', |
title: '科室名称', |
||||||
dataIndex: 'name', |
dataIndex: 'name', |
||||||
width: 120, |
width: 120 |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
title: '所属组织类型', |
title: '所属组织类型', |
||||||
dataIndex: 'organType', |
dataIndex: 'orgType', |
||||||
width: 120, |
width: 120, |
||||||
customRender: ({ record }) => { |
customRender: ({ record }) => { |
||||||
const organType = record.organType; |
const organType = record.orgType; |
||||||
let text = ''; |
let text = '', color = ''; |
||||||
let color = ''; |
switch (organType) { |
||||||
switch (organType) { |
case '1': |
||||||
case '1': |
text = '医院'; |
||||||
text = '医院'; |
color = 'green'; |
||||||
color = 'green'; |
break; |
||||||
break; |
case '2': |
||||||
case '2': |
text = '医检'; |
||||||
text = '医检'; |
color = 'blue'; |
||||||
color = 'blue'; |
break; |
||||||
break; |
} |
||||||
default: |
return h(Tag, { color: color }, () => text); |
||||||
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, |
|
||||||
} |
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
title: '组织名称', |
||||||
|
dataIndex: 'orgName', |
||||||
|
width: 120, |
||||||
|
}, |
||||||
|
{ |
||||||
|
title: '主任名称', |
||||||
|
dataIndex: 'manageName', |
||||||
|
width: 120, |
||||||
|
}, |
||||||
|
{ |
||||||
|
title: '主任电话', |
||||||
|
dataIndex: 'managePhone', |
||||||
|
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: 'createTime', |
||||||
|
width: 180 |
||||||
|
} |
||||||
]; |
]; |
||||||
|
|
||||||
export const searchFormSchema: FormSchema[] = [ |
export const searchFormSchema: FormSchema[] = [ |
||||||
{ |
{ |
||||||
field: 'name', |
field: 'name', |
||||||
label: '科室名称', |
label: '科室名称', |
||||||
component: 'Input', |
component: 'Input', |
||||||
componentProps: { |
componentProps: { |
||||||
placeholder: '请输入科室名称', |
placeholder: '请输入科室名称', |
||||||
}, |
}, |
||||||
colProps: { span: 5 }, |
colProps: { span: 8 }, |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
field: 'organType', |
field: 'orgType', |
||||||
label: '组织类型', |
label: '组织类型', |
||||||
component: 'Select', |
component: 'Select', |
||||||
|
componentProps: { |
||||||
componentProps: { |
options: [ |
||||||
options: [ |
{label: '医院',value: '1'}, |
||||||
{label: '医院',value: '1'}, |
{label: '医检',value: '2'} |
||||||
{label: '医检',value: '2'} |
] |
||||||
] |
}, |
||||||
}, |
colProps: { span: 7 } |
||||||
colProps: {span: 5} |
}, |
||||||
}, |
{ |
||||||
{ |
field: 'dateRange', |
||||||
field: 'dateRange', |
label: '创建时间', |
||||||
label: '创建时间', |
component: 'RangePicker', |
||||||
component: 'RangePicker', |
componentProps: { |
||||||
componentProps: { |
style: { width:'100%' }, |
||||||
style: { width:'100%' }, |
valueFormat: 'YYYY-MM-DD', |
||||||
valueFormat: 'YYYY-MM-DD', |
placeholder: ['开始日期','结束日期'] |
||||||
placeholder: ['开始日期','结束日期'] |
}, |
||||||
}, |
colProps: { span: 8 } |
||||||
colProps: { span: 8 } |
} |
||||||
} |
|
||||||
]; |
]; |
||||||
|
|
||||||
export const officeFormSchema: FormSchema[] = [ |
export const formSchema: FormSchema[] = [ |
||||||
{ |
{ |
||||||
field: 'id', |
field: 'id', |
||||||
label: 'ID', |
label: 'ID', |
||||||
component: 'Input', |
component: 'Input', |
||||||
show: false, |
show: false, |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
field: 'name', |
field: 'name', |
||||||
label: '科室名称', |
label: '科室名称', |
||||||
component: 'Input', |
component: 'Input', |
||||||
required: true |
required: true |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
field: 'organType', |
field: 'orgType', |
||||||
label: '所属组织类型', |
label: '所属组织类型', |
||||||
component: 'Select', |
component: 'Select', |
||||||
componentProps: { |
componentProps: { |
||||||
options: [ |
options: [ |
||||||
{ label: '医院', value: '1' }, |
{ label: '医院', value: '1' }, |
||||||
{ label: '医检', value: '2' } |
{ label: '医检', value: '2' } |
||||||
] |
] |
||||||
}, |
}, |
||||||
required: true, |
required: true, |
||||||
}, |
}, |
||||||
// {
|
{ |
||||||
// field: 'organId',
|
field: 'orgId', |
||||||
// label: '所属组织',
|
label: '所属组织', |
||||||
// component: 'ApiSelect',
|
component: 'ApiSelect', |
||||||
// required: true,
|
required: true, |
||||||
// renderComponentContent: ({ schema, values, model, field }) => {
|
renderComponentContent: ({ schema, values, model, field }) => { |
||||||
// const organType = model.organType;
|
const organType = model.orgType; |
||||||
// watch(organType,
|
const dataApi = ~~organType === 1 ? listHospital : listOrg; |
||||||
// () => {
|
schema.componentProps = { |
||||||
// const dataApi = organType=='1' ? hospitalList : institutionList;
|
api: dataApi, |
||||||
// console.log(schema);
|
labelField: 'name', |
||||||
// schema.componentProps = deepMerge({
|
valueField: 'id', |
||||||
// api: dataApi,
|
resultField: 'data' |
||||||
// labelField: 'name',
|
}; |
||||||
// valueField: 'id'
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// immediate: true,
|
|
||||||
// }
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
{ |
|
||||||
field: 'directorTel', |
|
||||||
label: '主任电话', |
|
||||||
component: 'Input', |
|
||||||
rules: [ |
|
||||||
{ |
|
||||||
pattern: new RegExp('^1[3|4|5|6|7|8|9][0-9]\\d{8}$'), |
|
||||||
message: '请输入正确的手机号', |
|
||||||
validateTrigger: 'change', |
|
||||||
required: true |
|
||||||
} |
|
||||||
], |
|
||||||
}, |
|
||||||
{ |
|
||||||
field: 'directorName', |
|
||||||
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', |
|
||||||
} |
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
field: 'manageName', |
||||||
|
label: '主任名称', |
||||||
|
component: 'Input', |
||||||
|
required: false |
||||||
|
}, |
||||||
|
{ |
||||||
|
field: 'managePhone', |
||||||
|
label: '主任电话', |
||||||
|
component: 'Input', |
||||||
|
rules: [ |
||||||
|
{ |
||||||
|
pattern: new RegExp('^1[3|4|5|6|7|8|9][0-9]\\d{8}$'), |
||||||
|
message: '请输入正确的手机号', |
||||||
|
validateTrigger: 'change', |
||||||
|
required: true |
||||||
|
} |
||||||
|
], |
||||||
|
}, |
||||||
|
{ |
||||||
|
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', |
||||||
|
} |
||||||
]; |
]; |
||||||
|
@ -0,0 +1,136 @@ |
|||||||
|
<template> |
||||||
|
<div> |
||||||
|
<BasicTable @register="registerTable" |
||||||
|
@selection-change="handleSelectionChange" |
||||||
|
> |
||||||
|
<template #toolbar> |
||||||
|
<a-button |
||||||
|
type="primary" |
||||||
|
@click="handleAdd()" |
||||||
|
>新增机构</a-button> |
||||||
|
<a-button type="primary" |
||||||
|
:disabled="state.single" |
||||||
|
@click="handleEdit()" |
||||||
|
>修改机构</a-button> |
||||||
|
<a-button type="primary" |
||||||
|
:disabled="state.multiple" |
||||||
|
@click="handleDel()" |
||||||
|
>删除机构</a-button> |
||||||
|
</template> |
||||||
|
<template #action="{ record }"> |
||||||
|
<TableAction :actions="[ |
||||||
|
{ |
||||||
|
label: '编辑', |
||||||
|
icon: 'fa6-regular:pen-to-square', |
||||||
|
onClick: handleEdit.bind(null, record) |
||||||
|
}, |
||||||
|
{ |
||||||
|
label: '删除', |
||||||
|
icon: 'ant-design:delete-outlined', |
||||||
|
color: 'error', |
||||||
|
onClick: handleDel.bind(null, record) |
||||||
|
}]" |
||||||
|
/> |
||||||
|
</template> |
||||||
|
</BasicTable> |
||||||
|
<!--弹出窗体区域--> |
||||||
|
<InstitutionModal @register="registerModal" @success="handleRefreshTable"/> |
||||||
|
</div> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script lang="ts" setup> |
||||||
|
/** |
||||||
|
* 提供模板规范代码参考,请尽量保证编写代码风格跟模板规范代码一致 |
||||||
|
* 采用vben-动态表格表单封装组件编写,采用 setup 写法 |
||||||
|
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved. |
||||||
|
* author entfrm开发团队-王翔 |
||||||
|
*/ |
||||||
|
import { reactive, toRaw } from 'vue'; |
||||||
|
import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
||||||
|
import {listOrg, delOrg} from '/@/api/platform/common/controller/org'; |
||||||
|
import { useModal } from '/@/components/Modal'; |
||||||
|
import { columns, searchFormSchema } from './org.data'; |
||||||
|
import { useMessage } from '/@/hooks/web/useMessage'; |
||||||
|
import InstitutionModal from './OrgModal.vue'; |
||||||
|
|
||||||
|
/** 类型规范统一声明定义区域 */ |
||||||
|
interface TableState { |
||||||
|
single: boolean; |
||||||
|
multiple: boolean; |
||||||
|
} |
||||||
|
|
||||||
|
/** 通用变量统一声明区域 */ |
||||||
|
const state = reactive<TableState>({ |
||||||
|
// 非单个禁用 |
||||||
|
single: true, |
||||||
|
// 非多个禁用 |
||||||
|
multiple: true |
||||||
|
}); |
||||||
|
const { createConfirm, createMessage } = useMessage(); |
||||||
|
const [registerModal, { openModal }] = useModal(); |
||||||
|
const [registerTable, { reload, clearSelectedRowKeys, getSelectRowKeys }] = useTable({ |
||||||
|
title: '医生列表', |
||||||
|
api: listOrg, |
||||||
|
rowKey: 'id', |
||||||
|
columns, |
||||||
|
formConfig: { |
||||||
|
labelWidth: 120, |
||||||
|
schemas: searchFormSchema, |
||||||
|
autoSubmitOnEnter: true, |
||||||
|
fieldMapToTime: [['dateRange', ['beginTime', 'endTime'], 'YYYY-MM-DD']] |
||||||
|
}, |
||||||
|
rowSelection: { type: 'checkbox' }, |
||||||
|
useSearchForm: true, |
||||||
|
showTableSetting: true, |
||||||
|
bordered: true, |
||||||
|
clickToRowSelect: false, |
||||||
|
showIndexColumn: false, |
||||||
|
actionColumn: { |
||||||
|
width: 220, |
||||||
|
title: '操作', |
||||||
|
dataIndex: 'action', |
||||||
|
slots: { customRender: 'action' }, |
||||||
|
fixed: false |
||||||
|
}, |
||||||
|
handleSearchInfoFn: () => clearSelectedRowKeys() |
||||||
|
}); |
||||||
|
|
||||||
|
/** 处理多选框选中数据 */ |
||||||
|
function handleSelectionChange(selection?: Recordable) { |
||||||
|
const rowSelection = toRaw(selection?.keys) || []; |
||||||
|
state.single = rowSelection.length != 1; |
||||||
|
state.multiple = !rowSelection.length; |
||||||
|
} |
||||||
|
|
||||||
|
/** 新增按钮操作,行内新增与工具栏局域新增通用 */ |
||||||
|
function handleAdd() { |
||||||
|
openModal(true,{ _tag: 'add' }); |
||||||
|
} |
||||||
|
|
||||||
|
/** 编辑按钮操作,行内编辑 */ |
||||||
|
function handleEdit(record?: Recordable) { |
||||||
|
record = record || { id: getSelectRowKeys() }; |
||||||
|
openModal(true, { _tag: 'edit', record }); |
||||||
|
} |
||||||
|
|
||||||
|
/** 删除按钮操作,行内删除 */ |
||||||
|
async function handleDel(record?: Recordable) { |
||||||
|
const id = record?.id || getSelectRowKeys(); |
||||||
|
createConfirm({ |
||||||
|
iconType: 'warning', |
||||||
|
title: '警告', |
||||||
|
content: `是否确认删除机构编号为${id}机构吗?`, |
||||||
|
onOk: async () => { |
||||||
|
await delOrg(id); |
||||||
|
createMessage.success('删除成功!'); |
||||||
|
handleRefreshTable(); |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
/** 处理表格刷新 */ |
||||||
|
function handleRefreshTable() { |
||||||
|
clearSelectedRowKeys(); |
||||||
|
reload(); |
||||||
|
} |
||||||
|
</script> |
@ -1,79 +0,0 @@ |
|||||||
<template> |
|
||||||
<BasicModal v-bind="$attrs" |
|
||||||
width="720px" |
|
||||||
@register="registerModal" |
|
||||||
@ok="handleSubmit" |
|
||||||
> |
|
||||||
<BasicForm @register="registerForm"/> |
|
||||||
</BasicModal> |
|
||||||
</template> |
|
||||||
<script lang="ts" setup> |
|
||||||
/** |
|
||||||
* 提供模板规范代码参考,请尽量保证编写代码风格跟模板规范代码一致 |
|
||||||
* 采用vben-动态表格表单封装组件编写,采用 setup 写法 |
|
||||||
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved. |
|
||||||
* author entfrm开发团队-王翔 |
|
||||||
*/ |
|
||||||
import { ref, unref } from 'vue'; |
|
||||||
import { BasicForm, useForm } from '/@/components/Form'; |
|
||||||
import { doctorFormSchema } from './report.data'; |
|
||||||
import {addReport, delReport,getReport,editReport} from '/@/api/platform/common/controller/report'; |
|
||||||
import { BasicModal, ModalProps, useModalInner } from '/@/components/Modal'; |
|
||||||
import { isEmpty } from '/@/utils/is'; |
|
||||||
|
|
||||||
/** 通用变量统一声明区域 */ |
|
||||||
const tag = ref<Nullable<string>>(''); |
|
||||||
/** https://v3.cn.vuejs.org/api/options-data.html#emits */ |
|
||||||
const emit = defineEmits(['success', 'register']); |
|
||||||
const [registerForm, { resetFields, setFieldsValue, validate, clearValidate, updateSchema }] = useForm({ |
|
||||||
labelWidth: 100, |
|
||||||
schemas: doctorFormSchema, |
|
||||||
showActionButtonGroup: false, |
|
||||||
baseColProps: { span: 24 } |
|
||||||
}); |
|
||||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data: WindowInnerData = { _tag: '' }) => { |
|
||||||
// 处理清除脏数据 |
|
||||||
await resetFields(); |
|
||||||
await clearValidate(); |
|
||||||
// 处理设置数据 |
|
||||||
tag.value = data._tag; |
|
||||||
const id = data.record?.id; |
|
||||||
const props: Partial<ModalProps> = { confirmLoading: false }; |
|
||||||
// 采用tag标签区分操作 |
|
||||||
switch (unref(tag)) { |
|
||||||
case 'add': |
|
||||||
props.title = '医生'; |
|
||||||
break; |
|
||||||
case 'edit': |
|
||||||
props.title = '编辑医生'; |
|
||||||
await setFieldsValue(await getReport(id)); |
|
||||||
break; |
|
||||||
} |
|
||||||
// 尾部:设置处理后的最终配置数据 |
|
||||||
setModalProps(props); |
|
||||||
}); |
|
||||||
|
|
||||||
/** 处理弹出框提交 */ |
|
||||||
async function handleSubmit() { |
|
||||||
try { |
|
||||||
// 提取验证数据 |
|
||||||
const formData = await validate(); |
|
||||||
// 处理提交之前逻辑 |
|
||||||
setModalProps({ confirmLoading: true }); |
|
||||||
// 采用tag标签区分操作 |
|
||||||
switch (unref(tag)) { |
|
||||||
case 'add': |
|
||||||
await addReport(formData); |
|
||||||
break; |
|
||||||
case 'edit': |
|
||||||
await editReport(formData); |
|
||||||
break; |
|
||||||
} |
|
||||||
// 处理提交完成之后逻辑 |
|
||||||
closeModal(); |
|
||||||
emit('success'); |
|
||||||
} finally { |
|
||||||
setModalProps({ confirmLoading: false }); |
|
||||||
} |
|
||||||
} |
|
||||||
</script> |
|
@ -1,256 +0,0 @@ |
|||||||
<template> |
|
||||||
<div> |
|
||||||
<BasicTable @register="registerTable" |
|
||||||
@selection-change="handleSelectionChange" |
|
||||||
> |
|
||||||
<template #tableTitle> |
|
||||||
<a-button |
|
||||||
type="primary" |
|
||||||
preIcon="ant-design:plus-outlined" |
|
||||||
@click="handleAdd()" |
|
||||||
>新增</a-button> |
|
||||||
<a-button |
|
||||||
preIcon="ant-design:plus-outlined" |
|
||||||
type="primary" |
|
||||||
@click="handleAdd()" |
|
||||||
>批量新增</a-button> |
|
||||||
<a-button type="primary" |
|
||||||
preIcon="ant-design:upload-outlined" |
|
||||||
@click="handleClickMergeUpload()" |
|
||||||
>合并上传</a-button> |
|
||||||
<a-button type="primary" |
|
||||||
preIcon="ant-design:user-outlined" |
|
||||||
@click="handleClickBatchCollect()" |
|
||||||
>设置收样员</a-button> |
|
||||||
<a-button type="primary" |
|
||||||
preIcon="ant-design:printer-outlined" |
|
||||||
@click="handleClickBatchPrint()" |
|
||||||
>批量打印</a-button> |
|
||||||
<a-button type="primary" |
|
||||||
preIcon="ant-design:download-outlined" |
|
||||||
@click="handleClickBatchDownload()" |
|
||||||
>批量下载</a-button> |
|
||||||
<a-button type="primary" |
|
||||||
preIcon="ant-design:export-outlined" |
|
||||||
@click="handleClickExport(0)" |
|
||||||
>导出</a-button> |
|
||||||
<a-button preIcon="ant-design:export-outlined" |
|
||||||
type="primary" |
|
||||||
@click="handleClickExport(1)" |
|
||||||
>合并导出</a-button> |
|
||||||
<a-button type="primary" |
|
||||||
preIcon="ant-design:export-outlined" |
|
||||||
@click="handleClickExportPreCode()" |
|
||||||
>导出预制码</a-button> |
|
||||||
</template> |
|
||||||
<template #action="{ record }"> |
|
||||||
<TableAction :dropDownActions="getDropDownAction(record)"/> |
|
||||||
</template> |
|
||||||
</BasicTable> |
|
||||||
<!--弹出窗体区域--> |
|
||||||
<ReportModal @register="registerModal" @success="handleRefreshTable"/> |
|
||||||
</div> |
|
||||||
</template> |
|
||||||
|
|
||||||
<script lang="ts" setup> |
|
||||||
/** |
|
||||||
* 提供模板规范代码参考,请尽量保证编写代码风格跟模板规范代码一致 |
|
||||||
* 采用vben-动态表格表单封装组件编写,采用 setup 写法 |
|
||||||
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved. |
|
||||||
* author entfrm开发团队-王翔 |
|
||||||
*/ |
|
||||||
import { reactive, ref, toRaw } from 'vue'; |
|
||||||
import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
|
||||||
import {listReport, delReport} from '/@/api/platform/common/controller/report'; |
|
||||||
import { useModal } from '/@/components/Modal'; |
|
||||||
import { columns, searchFormSchema } from './report.data'; |
|
||||||
import { useMessage } from '/@/hooks/web/useMessage'; |
|
||||||
import ReportModal from './ReportModal.vue'; |
|
||||||
import { useDrawer } from '/@/components/Drawer'; |
|
||||||
const showFooter = ref(true); |
|
||||||
|
|
||||||
/** 类型规范统一声明定义区域 */ |
|
||||||
interface TableState { |
|
||||||
single: boolean; |
|
||||||
multiple: boolean; |
|
||||||
} |
|
||||||
|
|
||||||
/** 通用变量统一声明区域 */ |
|
||||||
const state = reactive<TableState>({ |
|
||||||
// 非单个禁用 |
|
||||||
single: true, |
|
||||||
// 非多个禁用 |
|
||||||
multiple: true |
|
||||||
}); |
|
||||||
const { createConfirm, createMessage } = useMessage(); |
|
||||||
const [registerModal, { openModal }] = useModal(); |
|
||||||
const [rolePermissionDrawer, { openDrawer: openRolePermissionDrawer }] = useDrawer(); |
|
||||||
const [registerTable, { reload, clearSelectedRowKeys, getSelectRowKeys }] = useTable({ |
|
||||||
api: listReport, |
|
||||||
rowKey: 'id', |
|
||||||
columns, |
|
||||||
formConfig: { |
|
||||||
labelWidth: 120, |
|
||||||
schemas: searchFormSchema, |
|
||||||
autoSubmitOnEnter: true, |
|
||||||
fieldMapToTime: [['dateRange', ['beginTime', 'endTime'], 'YYYY-MM-DD']] |
|
||||||
}, |
|
||||||
rowSelection: { type: 'checkbox' }, |
|
||||||
useSearchForm: true, |
|
||||||
showTableSetting: true, |
|
||||||
bordered: true, |
|
||||||
clickToRowSelect: false, |
|
||||||
showIndexColumn: false, |
|
||||||
actionColumn: { |
|
||||||
width: 220, |
|
||||||
title: '操作', |
|
||||||
dataIndex: 'action', |
|
||||||
slots: { customRender: 'action' }, |
|
||||||
fixed: false |
|
||||||
}, |
|
||||||
handleSearchInfoFn: () => clearSelectedRowKeys() |
|
||||||
}); |
|
||||||
|
|
||||||
/** 处理多选框选中数据 */ |
|
||||||
function handleSelectionChange(selection?: Recordable) { |
|
||||||
const rowSelection = toRaw(selection?.keys) || []; |
|
||||||
state.single = rowSelection.length != 1; |
|
||||||
state.multiple = !rowSelection.length; |
|
||||||
} |
|
||||||
|
|
||||||
/** 新增按钮操作,行内新增与工具栏局域新增通用 */ |
|
||||||
function handleAdd() { |
|
||||||
openModal(true,{ _tag: 'add' }); |
|
||||||
} |
|
||||||
|
|
||||||
/** 编辑按钮操作,行内编辑 */ |
|
||||||
function handleEdit(record?: Recordable) { |
|
||||||
record = record || { id: getSelectRowKeys() }; |
|
||||||
openModal(true, { _tag: 'edit', record }); |
|
||||||
} |
|
||||||
|
|
||||||
/** 删除按钮操作,行内删除 */ |
|
||||||
async function handleDel(record?: Recordable) { |
|
||||||
const id = record?.id || getSelectRowKeys(); |
|
||||||
createConfirm({ |
|
||||||
iconType: 'warning', |
|
||||||
title: '警告', |
|
||||||
content: `是否确认删除医生编号为${id}医生吗?`, |
|
||||||
onOk: async () => { |
|
||||||
await delReport(id); |
|
||||||
createMessage.success('删除成功!'); |
|
||||||
handleRefreshTable(); |
|
||||||
} |
|
||||||
}); |
|
||||||
} |
|
||||||
|
|
||||||
/**编辑*/ |
|
||||||
function handleClickEditor(record) { |
|
||||||
|
|
||||||
} |
|
||||||
/**收取*/ |
|
||||||
function handleClickCollect(record) { |
|
||||||
|
|
||||||
} |
|
||||||
/**送达*/ |
|
||||||
function handleClickDelivered(record){ |
|
||||||
|
|
||||||
} |
|
||||||
/**确认收到*/ |
|
||||||
function handleClickReceived(record){ |
|
||||||
|
|
||||||
} |
|
||||||
/**上传结果*/ |
|
||||||
function handleClickUpload(record) { |
|
||||||
|
|
||||||
} |
|
||||||
/**查看病情*/ |
|
||||||
function handleClickPatientDetail(record){ |
|
||||||
|
|
||||||
} |
|
||||||
/**上传病情*/ |
|
||||||
function handleClickHealthUpload(record) { |
|
||||||
|
|
||||||
} |
|
||||||
/**联系医生*/ |
|
||||||
function handleClickLinkDoctor(record) { |
|
||||||
|
|
||||||
} |
|
||||||
/**合并上传*/ |
|
||||||
function handleClickMergeUpload() { |
|
||||||
|
|
||||||
} |
|
||||||
/**设置收样员*/ |
|
||||||
function handleClickBatchCollect() { |
|
||||||
|
|
||||||
} |
|
||||||
/**批量打印*/ |
|
||||||
function handleClickBatchPrint() { |
|
||||||
|
|
||||||
} |
|
||||||
/**批量下载*/ |
|
||||||
function handleClickBatchDownload() { |
|
||||||
|
|
||||||
} |
|
||||||
/**导出*/ |
|
||||||
function handleClickExport() { |
|
||||||
|
|
||||||
} |
|
||||||
/**导出预制码*/ |
|
||||||
function handleClickExportPreCode() { |
|
||||||
|
|
||||||
} |
|
||||||
function getDropDownAction(record) { |
|
||||||
return [ |
|
||||||
{ |
|
||||||
label: '查看', |
|
||||||
onClick: handleEdit.bind(null, record), |
|
||||||
}, |
|
||||||
{ |
|
||||||
label: '编辑', |
|
||||||
onClick: handleClickEditor.bind(null, record), |
|
||||||
}, |
|
||||||
{ |
|
||||||
label: '收取', |
|
||||||
onClick: handleClickCollect.bind(null, record), |
|
||||||
}, |
|
||||||
{ |
|
||||||
label: '送达', |
|
||||||
onClick: handleClickDelivered.bind(null, record), |
|
||||||
}, |
|
||||||
{ |
|
||||||
label: '确认收到', |
|
||||||
onClick: handleClickReceived.bind(null, record), |
|
||||||
}, |
|
||||||
{ |
|
||||||
label: '添加项目', |
|
||||||
onClick: handleAdd.bind(null, record), |
|
||||||
}, |
|
||||||
{ |
|
||||||
label: '上传结果', |
|
||||||
onClick: handleClickUpload.bind(null, record), |
|
||||||
}, |
|
||||||
{ |
|
||||||
label: '查看病情', |
|
||||||
onClick: handleClickPatientDetail.bind(null, record), |
|
||||||
}, |
|
||||||
{ |
|
||||||
label: '上传病情', |
|
||||||
onClick: handleClickHealthUpload.bind(null, record), |
|
||||||
}, |
|
||||||
{ |
|
||||||
label: '联系医生', |
|
||||||
onClick: handleClickLinkDoctor.bind(null, record), |
|
||||||
}, |
|
||||||
{ |
|
||||||
label: '删除', |
|
||||||
onClick: handleDel.bind(null, record), |
|
||||||
}, |
|
||||||
]; |
|
||||||
} |
|
||||||
/** 处理表格刷新 */ |
|
||||||
function handleRefreshTable() { |
|
||||||
clearSelectedRowKeys(); |
|
||||||
reload(); |
|
||||||
} |
|
||||||
</script> |
|
@ -1,430 +0,0 @@ |
|||||||
import { BasicColumn } from '/@/components/Table'; |
|
||||||
import { FormSchema } from '/@/components/Table'; |
|
||||||
|
|
||||||
export const columns: BasicColumn[] = [ |
|
||||||
{ |
|
||||||
title: '序号', |
|
||||||
dataIndex: 'id', |
|
||||||
width: 120, |
|
||||||
}, |
|
||||||
{ |
|
||||||
title: '送检时间', |
|
||||||
dataIndex: 'name', |
|
||||||
width: 120, |
|
||||||
}, |
|
||||||
{ |
|
||||||
title: '编号', |
|
||||||
dataIndex: 'title', |
|
||||||
width: 120, |
|
||||||
}, |
|
||||||
{ |
|
||||||
title: '姓名-性别-年龄', |
|
||||||
dataIndex: 'sex', |
|
||||||
width: 120, |
|
||||||
}, |
|
||||||
{ |
|
||||||
title: '医院-科室-医生', |
|
||||||
dataIndex: 'phone', |
|
||||||
width: 120, |
|
||||||
}, |
|
||||||
{ |
|
||||||
title: '医检机构', |
|
||||||
dataIndex: 'email', |
|
||||||
width: 120, |
|
||||||
}, |
|
||||||
{ |
|
||||||
title: '平台/医检条码号', |
|
||||||
dataIndex: 'detailAddress', |
|
||||||
width: 120, |
|
||||||
}, |
|
||||||
{ |
|
||||||
title: '送检项目', |
|
||||||
dataIndex: 'organType', |
|
||||||
width: 120, |
|
||||||
|
|
||||||
}, |
|
||||||
{ |
|
||||||
title: '检测/打印', |
|
||||||
dataIndex: 'officeName', |
|
||||||
width: 120, |
|
||||||
}, |
|
||||||
{ |
|
||||||
title: '报告时间', |
|
||||||
dataIndex: 'status', |
|
||||||
width: 100, |
|
||||||
|
|
||||||
}, |
|
||||||
{ |
|
||||||
title: '收样员', |
|
||||||
dataIndex: 'createByName', |
|
||||||
width: 180, |
|
||||||
}, |
|
||||||
{ |
|
||||||
title: '创建人', |
|
||||||
dataIndex: 'createTime', |
|
||||||
width: 180, |
|
||||||
}, |
|
||||||
{ |
|
||||||
title: '创建时间', |
|
||||||
dataIndex: 'createTime', |
|
||||||
width: 180, |
|
||||||
}, |
|
||||||
{ |
|
||||||
title: '上机状态', |
|
||||||
dataIndex: 'createTime', |
|
||||||
width: 180, |
|
||||||
}, |
|
||||||
{ |
|
||||||
title: '最新打印时间', |
|
||||||
dataIndex: 'createTime', |
|
||||||
width: 180, |
|
||||||
} |
|
||||||
]; |
|
||||||
|
|
||||||
export const searchFormSchema: FormSchema[] = [ |
|
||||||
{ |
|
||||||
field: 'name', |
|
||||||
label: ' ', |
|
||||||
component: 'Input', |
|
||||||
componentProps: { |
|
||||||
placeholder: '平台/医检条码号', |
|
||||||
}, |
|
||||||
colProps: { span: 5 }, |
|
||||||
}, |
|
||||||
{ |
|
||||||
field: 'organType', |
|
||||||
label: ' ', |
|
||||||
component: 'Input', |
|
||||||
componentProps: { |
|
||||||
placeholder: '送检项目', |
|
||||||
}, |
|
||||||
colProps: {span: 5} |
|
||||||
}, |
|
||||||
{ |
|
||||||
field: 'organType', |
|
||||||
label: ' ', |
|
||||||
component: 'Input', |
|
||||||
componentProps: { |
|
||||||
placeholder: '患者姓名/手机/身份证' |
|
||||||
}, |
|
||||||
colProps: { span: 5 } |
|
||||||
}, |
|
||||||
{ |
|
||||||
field: 'status', |
|
||||||
label: ' ', |
|
||||||
component: 'Select', |
|
||||||
componentProps: { |
|
||||||
placeholder: '收样员姓名', |
|
||||||
}, |
|
||||||
colProps: {span: 5} |
|
||||||
}, |
|
||||||
{ |
|
||||||
field: 'createByName', |
|
||||||
label: ' ', |
|
||||||
component: 'Select', |
|
||||||
componentProps: { |
|
||||||
placeholder: '医院名称', |
|
||||||
}, |
|
||||||
colProps: {span: 5} |
|
||||||
}, |
|
||||||
{ |
|
||||||
field: 'detailAddress', |
|
||||||
label: ' ', |
|
||||||
component: 'Select', |
|
||||||
componentProps: { |
|
||||||
placeholder: '科室名称', |
|
||||||
}, |
|
||||||
colProps: {span: 5} |
|
||||||
}, |
|
||||||
{ |
|
||||||
field: 'officeName', |
|
||||||
label: ' ', |
|
||||||
component: 'Select', |
|
||||||
componentProps: { |
|
||||||
placeholder: '医生名称', |
|
||||||
}, |
|
||||||
colProps: {span: 5} |
|
||||||
}, |
|
||||||
{ |
|
||||||
field: 'email', |
|
||||||
label: ' ', |
|
||||||
component: 'Select', |
|
||||||
componentProps: { |
|
||||||
placeholder: '医检名称', |
|
||||||
}, |
|
||||||
colProps: {span: 5} |
|
||||||
}, |
|
||||||
{ |
|
||||||
field: 'phone', |
|
||||||
label: ' ', |
|
||||||
component: 'Select', |
|
||||||
componentProps: { |
|
||||||
options:[ |
|
||||||
{label: '未收取',value:'0'}, |
|
||||||
{label: '已收取',value:'5'}, |
|
||||||
{label: '已送达',value:'10'}, |
|
||||||
{label: '已收到',value:'12'}, |
|
||||||
{label: '检测中',value:'15'}, |
|
||||||
{label: '已出部分结果',value:'17'}, |
|
||||||
{label: '已出结果',value:'20'}, |
|
||||||
], |
|
||||||
placeholder: '报告单状态', |
|
||||||
}, |
|
||||||
colProps: {span: 5} |
|
||||||
}, |
|
||||||
{ |
|
||||||
field: 'sex', |
|
||||||
label: ' ', |
|
||||||
component: 'Select', |
|
||||||
componentProps: { |
|
||||||
options:[ |
|
||||||
{label: '检测中',value:'0'}, |
|
||||||
{label: '已出结果',value:'1'}, |
|
||||||
], |
|
||||||
placeholder: '结果状态', |
|
||||||
}, |
|
||||||
colProps: {span: 5} |
|
||||||
}, |
|
||||||
{ |
|
||||||
field: 'card', |
|
||||||
label: ' ', |
|
||||||
component: 'Select', |
|
||||||
componentProps: { |
|
||||||
options:[ |
|
||||||
{label: '未打印',value:'0'}, |
|
||||||
{label: '已打印',value:'1'}, |
|
||||||
], |
|
||||||
placeholder: '打印状态', |
|
||||||
}, |
|
||||||
colProps: {span: 5} |
|
||||||
}, |
|
||||||
{ |
|
||||||
field: 'dateRange', |
|
||||||
label: ' ', |
|
||||||
component: 'RangePicker', |
|
||||||
componentProps: { |
|
||||||
|
|
||||||
valueFormat: 'YYYY-MM-DD', |
|
||||||
placeholder: ['送检开始日期','送检结束日期'] |
|
||||||
}, |
|
||||||
colProps: { span: 5 } |
|
||||||
}, |
|
||||||
{ |
|
||||||
field: 'contactsName', |
|
||||||
label: ' ', |
|
||||||
component: 'Select', |
|
||||||
componentProps: { |
|
||||||
options:[ |
|
||||||
{label: '条码号异常',value:'1'}, |
|
||||||
{label: '姓名/身份证异常',value:'2'}, |
|
||||||
{label: '年龄/性别异常',value: '3'}, |
|
||||||
{label: '多条结果',value: '4'}, |
|
||||||
{label: '报告单结果未全出',value: '7'}, |
|
||||||
{label: '认证错误',value: '8'} |
|
||||||
], |
|
||||||
placeholder: '异常状态', |
|
||||||
}, |
|
||||||
colProps: {span: 5} |
|
||||||
}, |
|
||||||
{ |
|
||||||
field: 'contactsTel', |
|
||||||
label: ' ', |
|
||||||
component: 'Input', |
|
||||||
componentProps: { |
|
||||||
placeholder: '采样编号', |
|
||||||
}, |
|
||||||
colProps: {span: 5} |
|
||||||
}, |
|
||||||
{ |
|
||||||
field: 'contactsTitle', |
|
||||||
label: ' ', |
|
||||||
component: 'Select', |
|
||||||
defaultValue: '1', |
|
||||||
componentProps: { |
|
||||||
options:[ |
|
||||||
{label: '正常',value:'1'}, |
|
||||||
{label: '已删除',value:'-1'}, |
|
||||||
], |
|
||||||
placeholder: '状态', |
|
||||||
}, |
|
||||||
colProps: {span: 5} |
|
||||||
}, |
|
||||||
]; |
|
||||||
|
|
||||||
export const doctorFormSchema: FormSchema[] = [ |
|
||||||
{ |
|
||||||
field: 'id', |
|
||||||
label: '医院名称', |
|
||||||
component: 'Select', |
|
||||||
componentProps:{ |
|
||||||
|
|
||||||
}, |
|
||||||
required: true, |
|
||||||
}, |
|
||||||
{ |
|
||||||
field: 'name', |
|
||||||
label: '科室名称', |
|
||||||
component: 'Select', |
|
||||||
componentProps:{ |
|
||||||
|
|
||||||
}, |
|
||||||
required: true |
|
||||||
}, |
|
||||||
{ |
|
||||||
field: 'title', |
|
||||||
label: '医生名称', |
|
||||||
component: 'Select', |
|
||||||
componentProps:{ |
|
||||||
|
|
||||||
}, |
|
||||||
required: true, |
|
||||||
}, |
|
||||||
{ |
|
||||||
field: 'title', |
|
||||||
label: '项目名称', |
|
||||||
component: 'Input', |
|
||||||
required: true, |
|
||||||
}, |
|
||||||
{ |
|
||||||
field: 'title', |
|
||||||
label: '医院项目', |
|
||||||
component: 'Select', |
|
||||||
componentProps:{ |
|
||||||
|
|
||||||
}, |
|
||||||
required: true, |
|
||||||
}, |
|
||||||
{ |
|
||||||
field: 'title', |
|
||||||
label: '医检名称', |
|
||||||
component: 'Select', |
|
||||||
componentProps:{ |
|
||||||
|
|
||||||
}, |
|
||||||
required: true, |
|
||||||
}, |
|
||||||
{ |
|
||||||
field: 'title', |
|
||||||
label: '科室名称', |
|
||||||
component: 'Select', |
|
||||||
componentProps:{ |
|
||||||
|
|
||||||
}, |
|
||||||
required: true, |
|
||||||
}, |
|
||||||
{ |
|
||||||
field: 'title', |
|
||||||
label: '患者姓名', |
|
||||||
component: 'Input', |
|
||||||
required: true, |
|
||||||
}, |
|
||||||
{ |
|
||||||
field: 'sex', |
|
||||||
label: '患者性别', |
|
||||||
component: 'Select', |
|
||||||
required: false, |
|
||||||
defaultValue: 'M', |
|
||||||
componentProps: { |
|
||||||
options: [ |
|
||||||
{ label: '男', value: 'M' }, |
|
||||||
{ label: '女', value: 'F' }, |
|
||||||
] |
|
||||||
} |
|
||||||
}, |
|
||||||
{ |
|
||||||
field: 'phone', |
|
||||||
label: '医生电话', |
|
||||||
component: 'Input', |
|
||||||
rules: [ |
|
||||||
{ |
|
||||||
pattern: new RegExp('^1[3|4|5|6|7|8|9][0-9]\\d{8}$'), |
|
||||||
message: '请输入正确的手机号', |
|
||||||
validateTrigger: 'change', |
|
||||||
required: true |
|
||||||
} |
|
||||||
], |
|
||||||
}, |
|
||||||
{ |
|
||||||
field: 'email', |
|
||||||
label: '医生邮箱', |
|
||||||
component: 'Input', |
|
||||||
rules: [ |
|
||||||
{ |
|
||||||
type: 'email', |
|
||||||
message: '请输入正确的邮箱', |
|
||||||
validateTrigger: 'change', |
|
||||||
required: true |
|
||||||
} |
|
||||||
], |
|
||||||
}, |
|
||||||
{ |
|
||||||
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: ({ schema, values, model, field }) => {
|
|
||||||
// const organType = model.organType;
|
|
||||||
// watch(organType,
|
|
||||||
// () => {
|
|
||||||
// const dataApi = organType=='1' ? hospitalList : institutionList;
|
|
||||||
// console.log(schema);
|
|
||||||
// schema.componentProps = deepMerge({
|
|
||||||
// api: dataApi,
|
|
||||||
// labelField: 'name',
|
|
||||||
// valueField: 'id'
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// immediate: true,
|
|
||||||
// }
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// field: 'officeId',
|
|
||||||
// label: '所属科室',
|
|
||||||
// component: 'ApiSelect',
|
|
||||||
// componentProps: {
|
|
||||||
// mode: 'multiple',
|
|
||||||
// resultField: 'list',
|
|
||||||
// labelField: 'name',
|
|
||||||
// valueField: 'id',
|
|
||||||
// api: officeList,
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
{ |
|
||||||
field: 'status', |
|
||||||
label: '状态', |
|
||||||
component: 'RadioButtonGroup', |
|
||||||
defaultValue: '0', |
|
||||||
componentProps: { |
|
||||||
options: [ |
|
||||||
{ label: '启用', value: '0' }, |
|
||||||
{ label: '禁用', value: '1' }, |
|
||||||
], |
|
||||||
}, |
|
||||||
}, |
|
||||||
{ |
|
||||||
label: '备注', |
|
||||||
field: 'remarks', |
|
||||||
component: 'InputTextArea', |
|
||||||
} |
|
||||||
]; |
|
Loading…
Reference in new issue