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

import { request } from 'umi';


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

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

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

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


//为成本分摊设置会计科目
export async function updateCostShareParamByAccountId(body, options) {
  return request('/api/costAccount/costshareparam/updateCostShareParamByAccountId', {
    method: 'POST',
    data:{...body},
    ...(options || {}),
  });
}

