import { request } from '@/service/request';

/** 获取所属企业列表 */
export function fetchBackendChannelSelect(params?: any) {
  return request<Api.System.DictDataList>({
    url: `/smqjh-oms/api/v1/order/backendChannelSelect`,
    method: 'get',
    params
  });
}

/**
 * 分页获取门店详细列表
 * @param data
 * @returns
 */
export function fetchGetStoreList(data: any) {
  return request<Api.Store.ShopDetail[]>({
    url: '/smqjh-pms/api/v1/shopDetail/page',
    method: 'GET',
    params: data
  });
}

/**
 * 分页获取区域
 * @param data
 * @returns
 */
export function fetchGetAreaList(data: any) {
  return request<Api.Store.ShopDetail[]>({
    url: '/smqjh-pms/api/v1/goods/area',
    method: 'GET',
    params: data
  });
}

/**
 * 添加门店
 * @param data
 * @returns
 */
export function fetchAddShop(data: any) {
  return request({
    url: '/smqjh-pms/api/v1/shopDetail/djkShopInfoSave',
    method: 'post',
    data
  });
}

/**
 * 编辑门店
 * @param data
 * @returns
 */
export function fetchEditShop(data: any) {
  return request({
    url: '/smqjh-pms/api/v1/shopDetail/djkShopInfoUpdate',
    method: 'post',
    data
  });
}

/**
 * 删除门店
 * @param data
 * @returns
 */
export function fetchDelShop(shopId: any) {
  return request({
    url: `/smqjh-pms/api/v1/shopDetail/${shopId}`,
    method: 'delete'
  });
}
/**
 * 获取门店城市
 * @param data
 * @returns
 */
export function fetchGetShopCity(data: any) {
  return request({
    url: '/smqjh-pms/api/v1/shopDetail/getShopCity',
    method: 'GET',
    params: data
  });
}
/**
 * 通过地址获取经纬度信息
 * @param data
 * @returns
 */
export function fetchParseAddress(data: any) {
  return request({
    url: '/smqjh-pms/api/v1/shopDetail/parseAddress',
    method: 'GET',
    params: data
  });
}

/**
 * 查询商品导入记录
 * @param data
 * @returns
 */
export function fetchImportLogList(data: any) {
  return request({
    url: '/smqjh-pms/api/v1/channelProdRecord/group',
    method: 'GET',
    params: data
  });
}
