123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177 |
- /*
- * @Author: your name
- * @Date: 2022-01-13 09:15:59
- * @LastEditTime: 2023-03-06 13:47:16
- * @LastEditors: code4eat awesomedema@gmail.com
- * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
- * @FilePath: /KC-MiddlePlatform/src/service/hospList.ts
- */
- import { Key } from 'react';
- import { request } from 'umi';
- //获取当前登陆院区以及互通的院区列表
- export const getShareHospList = async () => {
- return request<
- {
- id: number;
- name: string;
- }[]
- >('/centerSys/hospital/currentAndShareHosp', {
- method: 'GET',
- });
- };
- //获取所有院区
- export const getHospList = async () => {
- return request<
- {
- id: number;
- name: string;
- }[]
- >('/centerSys/hospital/getAllMainList', {
- method: 'GET',
- });
- };
- //获取主院
- export const getMainHosp = async () => {
- return request<{
- id: number;
- name: string;
- }[]>('/centerSys/hospital/getMainList', {
- method: 'GET',
- });
- };
- export type HospTableItem = {
- id: number;
- hospName: string;
- hospSign: string;
- hospAbbreviation: string;
- mainHospId: number;
- mainHospName: string;
- updateTime: string;
- systemName: string;
- dataShare: string;
- };
- //获取医院列表
- export const getAllHosp = async (params?: {
- current: number;
- pageSize: number;
- hospitalName?: string;
- }) => {
- return request<{
- current: number;
- pageSize: number;
- totalCount: number;
- totalPage: number;
- list?: HospTableItem[];
- }>('/centerSys/hospital/list', {
- method: 'GET',
- params: params,
- });
- };
- export type AddHospDataType = {
- hospAbbreviation: string; //医院简称
- hospName: string;
- hospSign: string;
- isDataShare: number; //是否数据共享,0.默认,不共享,1.共享数据
- mainHospId: number;
- mainHospName: string;
- systemName: string;
- };
- //添加院区
- export const addHosp = async (data: AddHospDataType) => {
- return request('/centerSys/hospital/addHospital', {
- method: 'POST',
- data: data,
- });
- };
- //院区管理删除院区
- export const delHosp = async (data: number[]) => {
- return request('/centerSys/hospital/deleteHosp', {
- method: 'POST',
- data: data,
- });
- };
- //院区管理编辑院区
- export type EditHospType = {
- id: number;
- hospAbbreviation: string;
- hospName: string;
- hospSign: string;
- isDataShare: string;
- systemName: string;
- };
- export const editHosp = async (data: EditHospType) => {
- return request('/centerSys/hospital/editHosp', {
- method: 'POST',
- data: data,
- });
- };
- //院区绑定菜单
- export const hospBindMenu = async (data: { hospId: number; menuIds: string[] }) => {
- return request('/centerSys/hospital/addHospMenu', {
- method: 'POST',
- data: data,
- });
- };
- export type YoushuAccountsType = {
- id: number;
- userName: string;
- account: string;
- password: string;
- isDefault: number; //是否默认0,非默认,1.默认
- };
- export type GetHospYoushuAccountsType = {
- reportUrl: string;
- reportId: string;
- youshuUsers: YoushuAccountsType[];
- };
- export const getHospYoushuAccounts = async (data: { hospId: number }) => {
- return request<GetHospYoushuAccountsType>('/centerSys/hospital/getHospReport', {
- method: 'GET',
- params: data,
- });
- };
- export type YoushuUserSaveDTOs = {
- userName: string;
- account: string;
- password: string;
- };
- export type HospBindYoushuAccountReqBodyType = {
- hospId: number;
- reportId: number;
- reportUrl: string;
- userId: number;
- youshuUserSaveDTOs: YoushuUserSaveDTOs[];
- };
- export const hospBindYoushuAccount = async (data: HospBindYoushuAccountReqBodyType) => {
- return request('/centerSys/hospital/saveHospReport', {
- method: 'POST',
- data: data,
- });
- };
- //院区初始化
- export const hospInit = async (hospId:Key) => {
- return request('/centerSys/role/init', {
- method: 'POST',
- params:{hospId},
- });
- };
|