import request from '@/utils/request'

export function allOrg(query) {
  return request({
    url: '/system/store/allOrg',
    method: 'get',
    params: query
  })
}

// 查询门店列表
export function listStore(query) {
  return request({
    url: '/system/store/list',
    method: 'get',
    params: query
  })
}

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

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

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

// 删除门店
export function delStore(id) {
  return request({
    url: '/system/store/' + id,
    method: 'delete'
  })
}

// 门店状态修改
export function changeStoreStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/system/store/changeStatus',
    method: 'put',
    data: data
  })
}
export function getStoreInfo() {
  return request({
    url: '/system/store/info',
    method: 'get'
  })
}

export function getStoreByFactoryId() {
  return request({
    url: '/system/store/getStoreByFactoryId',
    method: 'get'
  })
}
