import request from '@/utils/request' 
import Qs from 'qs'

export function talentList(query) {
  return request({
    url: '/dytalent/talentList',
    method: 'get',
    params: query
  })
}
export function addNewTalent(data) {
  return request({
      url: '/dytalent/addNewTalent',
      method: 'post',
      data
  })
}
export function queryPlanList(data) {
  return request({
      url: '/dyplan/queryPlanList',
      method: 'post',
      data
  })
}
export function createCommonPlan(data) {
  return request({
      url: '/dyplan/createCommonPlan',
      method: 'post',
      data
  })
}
export function createNonCommonPlan(data) {
  return request({
      url: '/dyplan/createNonCommonPlan',
      method: 'post',
      data,
      paramsSerializer: function(params) {
          return Qs.stringify(params, { arrayFormat: 'repeat' })
      }
  })
}
export function queryPlanDetail(query) {
  return request({
    url: '/dyplan/queryPlanDetail',
    method: 'get',
    params: query
  })
}
export function updatePlanStatus(data) {
  return request({
      url: '/dyplan/updatePlanStatus',
      method: 'post',
      data
  })
}
export function cancelPlanTalent(query) {
  return request({
    url: '/dytalent/cancelPlanTalent',
    method: 'get',
    params: query
  })
}

export function updateTalent(data) {
  return request({
    url: '/dytalent/updateTalent',
    method: 'post',
    data
  })
}


export function dyGoodsGoodsList(query) {
  return request({
    url: '/dyGoods/goodsList',
    method: 'get',
    params: query
  })
}
 
export function importTalent(data, config) {
  return request({
    url: '/dytalent/batchAdd',
    method: 'post',
    config: config,
    data
  })
}

/**
 * 获取所有服务商
 * @param {} query 
 * @returns 
 */
export function selectOperator(query) {
  return request({
    url: '/dytalent/queryProvider',
    method: 'get',
    params: query
  })
}

export function selectTalnetByOperator(query) {
  return request({
    url: '/dytalent/queryByOperator',
    method: 'get',
    params: query
  })
}

export function deleteTalentList(data){
  return request({
    url: '/dytalent/delete',
    method: 'post',
    data
})
}

export function talentByPlan(query){
  return request({
    url: '/dyplan/talentByPlan',
    method: 'get',
    params: query
  })
}