import request from 'utils/request';
import {$fetch,$post} from 'Vue';
import { baseApi } from 'utils/config' 

//获取部门下拉
export function getTeamSelect () {
  return request({
    url: baseApi + 'manageBase/dept/select',
    method: 'get',
    params: {
      deptId: 0
    }
  })
}
//获取项目下拉
export function getProjectSelect () {
  return request({
    url: baseApi + 'manageBase/project/select',
    method: 'get',
    params: {
      deptId: 0
    }
  })
}
//获取产品下拉
export function getProductSelect () {
  return request({
    url: baseApi + 'manageBase/product/select',
    method: 'get',
    params: {
      deptId: 0
    }
  })
}
//获取成本单位下拉
export function getCostTeamSelect () {
  return request({
    url: baseApi + 'manageBase/company/select',
    method: 'get',
    params: {
      deptId: 0
    }
  })
}
//获取成本类型下拉
export function getCostTypeSelect () {
  return request({
    url: baseApi + 'manageBase/costType/select',
    method: 'get',
    params: {
      deptId: 0
    }
  })
}
//查询经营列表
export function getManageList (params) {
  return this.$fetch('manageBase/manage')
  // return request({
  //   url: baseApi + 'manageBase/manage',
  //   method: 'get',
  //   params,
  // })
}
//增加经营数据
export function addManage (data) {
  return request({
    url: baseApi + 'manageBase/manage',
    method: 'post',
    data
  })
}
// 更新经营数据
export function setManage (data) {
  return request({
    url: baseApi + 'manageBase/manage',
    method: 'put',
    data
  })
}