cmmodityLibrary.js 1.61 KB
import { http } from '@/main'

const defaultPath = 'scrm.api.live.'

const getWarehousListApi = params => {
  params.method = `${defaultPath}goods.list`
  return http({
    url: 'rop-scrm-live/router',
    method: 'GET',
    data: params,
    sign: true
  })
}

const auditGoodApi = params => {
  params.method = `${defaultPath}audit.goods`
  return http({
    url: 'rop-scrm-live/router',
    method: 'POST',
    data: params,
    sign: true,
    returnAll: true
  })
}

const getGoodInfoApi = params => {
  params.method = `${defaultPath}get.good.by.id`
  return http({
    url: 'rop-scrm-live/router',
    method: 'POST',
    data: params,
    sign: true
  })
}

const getGoodGroupInfoApi = params => {
  params.method = `${defaultPath}get.good.group.by.id`
  return http({
    url: 'rop-scrm-live/router',
    method: 'POST',
    data: params,
    sign: true
  })
}

const insertGoodApi = params => {
  params.method = `${defaultPath}insert.good`
  return http({
    url: 'rop-scrm-live/router',
    method: 'POST',
    data: params,
    sign: true,
    returnAll: true
  })
}

const insertGoodGroupApi = params => {
  params.method = `${defaultPath}insert.good.group`
  return http({
    url: 'rop-scrm-live/router',
    method: 'POST',
    data: params,
    sign: true,
    returnAll: true
  })
}

const deleteGoodApi = params => {
  params.method = `${defaultPath}delete.goods`
  return http({
    url: 'rop-scrm-live/router',
    method: 'POST',
    data: params,
    sign: true,
    returnAll: true
  })
}

export { getWarehousListApi, auditGoodApi, getGoodInfoApi, getGoodGroupInfoApi, insertGoodApi, insertGoodGroupApi, deleteGoodApi }