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

import { request } from 'umi';


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



//编辑成本项目
export async function editCostProject(body, options) {
  return request('/api/costAccount/product/edit', {
    method: 'POST',
    data:{...body},
    ...(options || {}),
  });
}

//新增成本项目
export async function addCostProject(body, options) {
  return request('/api/costAccount/product/save', {
    method: 'POST',
    data:{...body},
    ...(options || {}),
  });
}

//删除成本项目
export async function delCostProject(params, options) {
  const {id} = params;
  const ids = [id];
  return request(`/api/costAccount/product/delete`, {
    method: 'POST',
    data:ids,
    ...(options || {}),
  });
}


//获取所有可选会计科目
export async function getAccountingSubjectForSelecter(params, options) {

  return request(`/api/costAccount/accounting/selectAccounting`, {
    method: 'GET',
    ...(options || {}),
  });
}

