11-wms/src/api/basicData/CustomerSupplier/supplier.js

103 lines
1.9 KiB
JavaScript

/*
* @Author: zwq
* @Date: 2020-12-29 16:00:14
* @LastEditors: lb
* @LastEditTime: 2022-04-21 19:56:00
* @Description:
*/
import request from '@/utils/request'
/**
* 获取分页供应商
* @param {object} data
* @param {number} data.current
* @param {number} data.size
* @param {string} [data.name]
* @param {string} [data.code]
* @param {number} [data.enabled]
*/
export function list(data) {
return request({
url: '/basic/supplier/page',
method: 'post',
data
})
}
/**
* 获取供应商详情
* @param {number} id
*/
export function detail(id) {
return request({
url: '/basic/supplier/get',
method: 'post',
data: { id }
})
}
/**
* 更新供应商
* @param {object} data
* @param {number} data.id
* @param {string} data.name
* @param {string} data.code
* @param {string} data.email
* @param {string} data.contact
* @param {string} data.address
* @param {string} data.category
* @param {string} data.telephone
* @param {string} data.description
*/
export function update(data) {
// 更新供应商单条数据
return request({
url: '/basic/supplier/update',
method: 'post',
data
})
}
/**
* 新增供应商
* @param {object} data
* @param {number} [data.id]
* @param {string} data.name
* @param {string} data.code
* @param {string} data.email
* @param {string} data.contact
* @param {string} data.address
* @param {string} data.category
* @param {string} data.telephone
* @param {string} data.description
*/
export function add(data) {
return request({
url: '/basic/supplier/add',
method: 'post',
data
})
}
/**
* 获取供应商code
*/
export function getCode() {
return request({
url: '/basic/supplier/get-code',
method: 'post'
})
}
/**
* 删除供应商
* @param {number} id
*/
export function del(id) {
return request({
url: '/basic/supplier/delete',
method: 'post',
data: { id }
})
}