/*
 * @Author: code4eat awesomedema@gmail.com
 * @Date: 2023-03-03 16:31:27
 * @LastEditors: code4eat awesomedema@gmail.com
 * @LastEditTime: 2023-11-21 11:08:53
 * @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 { Key } from 'react';
import { request } from 'umi';

//获取  全院其他收支设置列表
export const getWholeHospCostList = (params: any) => {
  return request('/costAccount/costotherpayments/list', {
    method: 'GET',
    params: { ...params },
  });
};

//新增
export type AddTableDataType = {
  paymentsType: number;
  paymentsName: string;
};

export const addData = (data: AddTableDataType) => {
  return request('/costAccount/costotherpayments/save', {
    method: 'POST',
    data: { ...data },
  });
};

//编辑表格数据

export type TableRowEditType = {
  id: number;
} & AddTableDataType;

export const editData = (data: any) => {
  return request('/costAccount/costotherpayments/update', {
    method: 'POST',
    data,
  });
};

//删除表格操作
export const delData = (ids: Key[]) => {
  return request('/costAccount/costotherpayments/delete', {
    method: 'POST',
    data: [...ids],
  });
};
