186 lines
3.9 KiB
JavaScript
186 lines
3.9 KiB
JavaScript
import request from '@/utils/request'
|
|
|
|
export function listLabelPackage(query) {
|
|
return request({
|
|
url: '/price/label/list',
|
|
method: 'get',
|
|
params: query
|
|
})
|
|
}
|
|
|
|
export function getLabelPackage(priceSetId) {
|
|
return request({
|
|
url: '/price/label/' + priceSetId,
|
|
method: 'get'
|
|
})
|
|
}
|
|
|
|
export function updateLabelBasic(data) {
|
|
return request({
|
|
url: '/price/label/basic',
|
|
method: 'put',
|
|
data
|
|
})
|
|
}
|
|
|
|
export function disableLabelPackage(priceSetId) {
|
|
return request({
|
|
url: '/price/label/' + priceSetId + '/disable',
|
|
method: 'put'
|
|
})
|
|
}
|
|
|
|
export function enableLabelPackage(priceSetId) {
|
|
return request({
|
|
url: '/price/label/' + priceSetId + '/enable',
|
|
method: 'put'
|
|
})
|
|
}
|
|
|
|
export function delLabelPackage(priceSetIds) {
|
|
return request({
|
|
url: '/price/label/' + priceSetIds,
|
|
method: 'delete'
|
|
})
|
|
}
|
|
|
|
export function previewLabel(file, dictValue, progressId, onUploadProgress, priceSetId) {
|
|
const data = new FormData()
|
|
data.append('file', file)
|
|
if (dictValue) data.append('dictValue', dictValue)
|
|
if (progressId) data.append('progressId', progressId)
|
|
if (priceSetId) data.append('priceSetId', priceSetId)
|
|
return request({
|
|
url: '/price/label/preview',
|
|
method: 'post',
|
|
data,
|
|
headers: { 'Content-Type': 'multipart/form-data', repeatSubmit: false },
|
|
timeout: 10 * 60 * 1000,
|
|
onUploadProgress
|
|
})
|
|
}
|
|
|
|
export function labelParseProgress(progressId) {
|
|
return request({
|
|
url: '/price/label/preview/progress',
|
|
method: 'get',
|
|
params: { progressId },
|
|
headers: { repeatSubmit: false }
|
|
})
|
|
}
|
|
|
|
export function saveLabelImport(data) {
|
|
return request({
|
|
url: '/price/label/importSave',
|
|
method: 'post',
|
|
data,
|
|
timeout: 10 * 60 * 1000
|
|
})
|
|
}
|
|
|
|
export function listLabelVersions(priceSetId) {
|
|
return request({
|
|
url: '/price/label/' + priceSetId + '/versions',
|
|
method: 'get'
|
|
})
|
|
}
|
|
|
|
export function activateLabelVersion(priceSetId, versionNo, data) {
|
|
return request({
|
|
url: '/price/label/' + priceSetId + '/versions/' + versionNo + '/activate',
|
|
method: 'put',
|
|
data
|
|
})
|
|
}
|
|
|
|
export function deleteLabelVersion(priceSetId, versionNo) {
|
|
return request({
|
|
url: '/price/label/' + priceSetId + '/versions/' + versionNo,
|
|
method: 'delete'
|
|
})
|
|
}
|
|
|
|
export function listLabelProducts(priceSetId, versionNo) {
|
|
return request({
|
|
url: '/price/label/' + priceSetId + '/products',
|
|
method: 'get',
|
|
params: versionNo != null ? { versionNo } : undefined
|
|
})
|
|
}
|
|
|
|
export function listLabelCustomer(query) {
|
|
return request({
|
|
url: '/price/label/customer/list',
|
|
method: 'get',
|
|
params: query
|
|
})
|
|
}
|
|
|
|
export function addLabelCustomer(data) {
|
|
return request({
|
|
url: '/price/label/customer',
|
|
method: 'post',
|
|
data
|
|
})
|
|
}
|
|
|
|
export function batchAddLabelCustomer(data) {
|
|
return request({
|
|
url: '/price/label/customer/batch',
|
|
method: 'post',
|
|
data
|
|
})
|
|
}
|
|
|
|
export function updateLabelCustomer(data) {
|
|
return request({
|
|
url: '/price/label/customer',
|
|
method: 'put',
|
|
data
|
|
})
|
|
}
|
|
|
|
export function delLabelCustomer(ids) {
|
|
return request({
|
|
url: '/price/label/customer/' + ids,
|
|
method: 'delete'
|
|
})
|
|
}
|
|
|
|
export function getLabelProduct(productId, termId) {
|
|
return request({
|
|
url: '/price/label/product/' + productId,
|
|
method: 'get',
|
|
params: termId ? { termId } : undefined
|
|
})
|
|
}
|
|
|
|
export function removeLabelProducts(priceSetId, productIds) {
|
|
return request({
|
|
url: '/price/label/' + priceSetId + '/products/' + productIds,
|
|
method: 'delete'
|
|
})
|
|
}
|
|
|
|
export function listLabelChannels(priceSetId) {
|
|
return request({
|
|
url: '/price/label/' + priceSetId + '/channels',
|
|
method: 'get'
|
|
})
|
|
}
|
|
|
|
export function bindLabelChannels(priceSetId, data) {
|
|
return request({
|
|
url: '/price/label/' + priceSetId + '/channels',
|
|
method: 'put',
|
|
data
|
|
})
|
|
}
|
|
|
|
export function unbindLabelChannel(priceSetId, channelId) {
|
|
return request({
|
|
url: '/price/label/' + priceSetId + '/channels/' + channelId,
|
|
method: 'delete'
|
|
})
|
|
}
|