import request, { postBlob, getBlob, handleImport } from '@/utils/request'

export function tradeListPage(data) {
  return request({
    url: `/trade/list/page?moduleId=${data.moduleId}`,
    method: 'post',
    data
  })
}

export function tradePageExport(data, name) {
  return postBlob({
    url: '/trade/pageExport',
    data,
    name
  })
}


export function tradeListOtherPage(data) {
  return request({
    url: `/trade/listOther/page?moduleId=${data.moduleId}`,
    method: 'post',
    data
  })
}

export function tradePageOtherExport(data, name) {
  return postBlob({
    url: '/trade/pageOtherExport',
    data,
    name
  })
}

export function tradeList(params) {
  return request({
    url: '/trade/list',
    method: 'get',
    params: params
  })
}

export function serviceCategoryAdd(data) {
  return request({
    url: '/trade/add',
    method: 'post',
    data: data
  })
}

export function serviceCategoryUpdate(data) {
  return request({
    url: '/trade/update',
    method: 'post',
    data: data
  })
}

export function serviceCategoryDel(params) {
  return request({
    url: '/trade/delete',
    method: 'post',
    params: params
  })
}

export function serviceCategoryDetail(params) {
  return request({
    url: '/trade/detail',
    method: 'get',
    params: params
  })
}

export function serviceCategoryItemAdd(data) {
  return request({
    url: '/trade/addItem',
    method: 'post',
    data: data
  })
}

export function serviceCategoryItemUpdate(data) {
  return request({
    url: '/trade/updateItem',
    method: 'post',
    data: data
  })
}

export function serviceCategoryItemDel(params) {
  return request({
    url: '/trade/deleteItem',
    method: 'post',
    params: params
  })
}

export function serviceCategoryItemDetail(params) {
  return request({
    url: '/trade/detailItem',
    method: 'get',
    params: params
  })
}