/*
 * @Author: your name
 * @Date: 2021-07-26 08:54:08
 * @LastEditTime: 2021-07-29 23:13:14
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /TracerMethodology_PC/src/pages/DepartmentMana/service.js
 */

import { request } from 'umi';


//获取科室列表
export async function getDepartmentList(params, options) {
    const {departmentName,current,pageSize} = params;
    return request('/api/costAccount/department/list', {
      method: 'GET',
      params:{
          name:departmentName,
          current,
          pageSize
      },
      ...(options || {}),
    });
}

//编辑科室
export async function editDepartmentList(body, options) {
  return request('/api/costAccount/department/update', {
    method: 'POST',
    data:{...body},
    ...(options || {}),
  });
}

//新增科室
export async function addDepartment(body, options) {
  return request('/api/costAccount/department/save', {
    method: 'POST',
    data:{...body},
    ...(options || {}),
  });
}

//删除科室
export async function delDepartment(params, options) {
  const {id} = params;
  const ids = [id];
  return request(`/api/costAccount/department/delete`, {
    method: 'POST',
    data:ids,
    ...(options || {}),
  });
}

