product.js 1.44 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
import request from '@/utils/request'

// 创建产品
export function createProduct(data) {
  return request({
    url: '/ecw/product/create',
    method: 'post',
    data: data
  })
}

// 更新产品
export function updateProduct(data) {
  return request({
    url: '/ecw/product/update',
    method: 'put',
    data: data
  })
}

// 删除产品
export function deleteProduct(id) {
  return request({
    url: '/ecw/product/delete?id=' + id,
    method: 'delete'
  })
}

// 获得产品
export function getProduct(id) {
  return request({
    url: '/ecw/product/get?id=' + id,
    method: 'get'
  })
}

黄卓's avatar
黄卓 committed
37 38 39 40 41 42 43 44
// 获得产品列表
export function getProductList() {
  return request({
    url: '/ecw/product/list',
    method: 'get'
  })
}

45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
// 获得产品分页
export function getProductPage(query) {
  return request({
    url: '/ecw/product/page',
    method: 'get',
    params: query
  })
}

// 导出产品 Excel
export function exportProductExcel(query) {
  return request({
    url: '/ecw/product/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
ylpmty's avatar
ylpmty committed
63 64 65 66 67 68 69 70 71

// 批量更新产品
export function batchUpdateProduct(data) {
  return request({
    url: '/ecw/product/batchUpdate',
    method: 'put',
    data: data
  })
}
dragondean@qq.com's avatar
dragondean@qq.com committed
72 73 74 75 76 77 78 79 80

// 计算单种运输方式的商品费用(单个商品也做数组传参)
export function calculationPrice(data){
  return request({
    url: '/product/line/price/calculation',
    method: 'post',
    data: data
  })
}