/*
 * @Author: code4eat awesomedema@gmail.com
 * @Date: 2023-03-03 16:31:27
 * @LastEditors: code4eat awesomedema@gmail.com
 * @LastEditTime: 2024-04-17 15:49:32
 * @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/service.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */

import { request } from 'umi';

//获取检查列表
export const getCheckListReq = (params: any) => {
  return request('/costAccount/costData/getCheckList', {
    method: 'GET',
    params,
  });
};

//一键获取
export const oneKeyGetDataReq = (params: any) => {
  return request('/costAccount/costData/getAllData', {
    method: 'POST',
    params,
  });
};

//获取收入数据科室列表
export const getIncomeDepartmentList = (params: any) => {
  return request('/costAccount/costData/getIncomeDepartment', {
    method: 'GET',
    params,
  });
};

//获取成本数据科室列表
export const getCostDepartmentList = (params: any) => {
  return request('/costAccount/costData/getCostDepartment', {
    method: 'GET',
    params,
  });
};

//获取成本分摊科室列表
export const getCostShareDepartmentList = () => {
  return request('/costAccount/costData/getShareParamDepartment', {
    method: 'GET',
  });
};

//获取患者信息室列表
export const getPatientInfoDepartmentList = (
  computeDate: string,
  type: number,
) => {
  return request('/costAccount/costData/getPatientInfoDepartment', {
    method: 'GET',
    params: { computeDate, type },
  });
};

//获取患者收费项目列表（分页，支持filter）
export const getPatientChargeItemList = (
  computeDate: string,
  current: number,
  pageSize: number,
  filter?: string,
) => {
  return request('/costAccount/costData/getPatientItemPatientInfo', {
    method: 'GET',
    params: { computeDate, current, pageSize, filter },
  });
};

//重新检查
export const reCheckListReq = (computeDate: string) => {
  return request('/costAccount/costData/check', {
    method: 'POST',
    params: { computeDate },
  });
};

//撤销
export const cancelReq = (computeDate: string, type: number) => {
  return request('/costAccount/costData/removeData', {
    method: 'POST',
    params: { computeDate, type },
  });
};

//获取
export const getReq = (computeDate: string, type: number) => {
  return request('/costAccount/costData/getData', {
    method: 'POST',
    params: { computeDate, type },
  });
};

//计算闲置成本
export const calcIdleCostReq = (computeDate: string) => {
  return request('/costAccount/freeCost/computeFreeCost', {
    method: 'POST',
    params: { computeDate },
  });
};
