import request from '@/utils/request'

// 查询门店列表
export function listStore(data) {
  return request({
    url: '/sfa/store/list',
    method: 'post',
    data: data
  })
}

// 查询门店详细
export function getStore(storeId) {
  return request({
    url: '/sfa/store/' + storeId,
    method: 'get'
  })
}

// 新增门店
export function addStore(data) {
  return request({
    url: '/sfa/store',
    method: 'post',
    data: data
  })
}

// 修改门店
export function updateStore(data) {
  return request({
    url: '/sfa/store',
    method: 'put',
    data: data
  })
}

// 删除门店
export function delStore(storeId) {
  return request({
    url: '/sfa/store/' + storeId,
    method: 'delete'
  })
}
// 查询省市区（县）
export function getSelectRegionsList(query) {
  return request({
    url: '/sfa/store/street',
    method: 'get',
    params: query
  })
}
export function getOrderProductListByDeptId(query) {
  return request({
    url: '/sfa/store/getOrderProductListByDeptId',
    method: 'get',
    params: query
  })
}
// 门店无效
export function storeValid(query) {
  return request({
    url: '/sfa/store/valid',
    method: 'get',
    params: query
  })
}
// 门店无效
export function initPosition(query) {
  return request({
    url: '/sfa/store/lon',
    method: 'get',
    params: query
  })
}

// 重置门店地址修改次数
export function resetUpdateStoreNum(storeId) {
  return request({
    url: '/sfa/store/resetUpdateStoreNum/'+ storeId,
    method: 'get'
  })
}

export function beforeAdd(query) {
  return request({
    url: '/sfa/store/beforeAdd',
    method: 'get',
    params: query
  })
}
export function listChainsByCategory(query) {
  return request({
    url: '/sfa/store/listChainsByCategory',
    method: 'get',
    params: query
  })
}
