import request from '@/utils/request'

// 分页查询
export const pageList = (query) => {
  return request({
    url: '/merchant/priceInfo/pageList',
    method: 'get',
    params: query
  })
}

// 新增
export const saveAndEdit = (data) => {
  return request({
    url: '/merchant/priceInfo/insertOrUpdate',
    method: 'post',
    data: data
  })
}

// 修改
export const saveAndUpdate = (data) => {
  return request({
    url: '/merchant/priceInfo/update',
    method: 'put',
    data: data
  })
}

// 查询详情
export function getSelectById(params) {
  return request({
    url: '/merchant/priceInfo/selectById',
    method: 'get',
    params
  })
}


// 查询价格日历列表
export function getCalendarList(params) {
  return request({
    url: '/merchant/priceCalendar/pageList',
    method: 'get',
    params
  })
}

// 删除模板
export const deleteById = (params) => {
  return request({
    url: '/merchant/priceInfo/deleteById',
    method: 'delete',
    params
  })
}

// 更新状态
export const updateById = (data) => {
  return request({
    url: '/merchant/priceInfo/updateById',
    method: 'put',
    data
  })
}

// 绑定团队
export const bindTeamApi = (data) => {
  return request({
    url: '/merchant/priceInfo/bindTeam',
    method: 'post',
    data
  })
}

// 查询团队
export const getTeamList = (params) => {
  return request({
    url: '/merchant/priceInfo/teamList',
    method: 'get',
    params
  })
}

//移除团队
export const removeTeamApi = (data) => {
  return request({
    url: '/merchant/priceInfo/removeTeam',
    method: 'post',
    data
  })
}

// 全部团队
export const allTeamList = (query) => {
  return request({
    url: '/member/marketTeam/pageList',
    method: 'get',
    params: query
  })
}