修改产品套餐
This commit is contained in:
@@ -9,6 +9,15 @@ export function quoteBilling(data) {
|
||||
})
|
||||
}
|
||||
|
||||
/** Products from customer's bound effective package (trial dropdown) */
|
||||
export function listQuoteBoundProducts(customerCode, bizDate) {
|
||||
return request({
|
||||
url: '/price/billing/quote/products',
|
||||
method: 'get',
|
||||
params: { customerCode, bizDate }
|
||||
})
|
||||
}
|
||||
|
||||
/** Historical quote list */
|
||||
export function listQuote(query) {
|
||||
return request({
|
||||
|
||||
@@ -172,6 +172,15 @@ export function listSetDetail(query) {
|
||||
})
|
||||
}
|
||||
|
||||
/** All detail rows for one product under a version (no pagination). */
|
||||
export function listSetDetailByProduct(psvId, productCode) {
|
||||
return request({
|
||||
url: '/price/set/detail/byProduct',
|
||||
method: 'get',
|
||||
params: { psvId, productCode }
|
||||
})
|
||||
}
|
||||
|
||||
/** 版本明细搜索下拉选项:按版本去重后的 产品/国家/分区 */
|
||||
export function listSetDetailOptions(psvId) {
|
||||
return request({
|
||||
@@ -213,6 +222,31 @@ export async function importSetDetailPricesAsync(file, query, onProgress) {
|
||||
if (!taskId) {
|
||||
throw new Error('missing import taskId')
|
||||
}
|
||||
return pollPriceSetSaveTask(taskId, onProgress)
|
||||
}
|
||||
|
||||
/**
|
||||
* Async pull product library into package version details; poll until done.
|
||||
* @param {{ priceSetId: string|number, psvId?: string|number, force?: boolean }} query
|
||||
* @param {(task: object) => void} [onProgress]
|
||||
*/
|
||||
export async function pullSetDetailsFromLibraryAsync(query, onProgress) {
|
||||
const params = new URLSearchParams()
|
||||
if (query && query.priceSetId != null) params.set('priceSetId', query.priceSetId)
|
||||
if (query && query.psvId != null && query.psvId !== '') params.set('psvId', query.psvId)
|
||||
params.set('force', query && query.force ? 'true' : 'false')
|
||||
const submitRes = await request({
|
||||
url: '/price/set/detail/pullFromLibrary?' + params.toString(),
|
||||
method: 'post'
|
||||
})
|
||||
const taskId = pickSaveTaskId(submitRes)
|
||||
if (!taskId) {
|
||||
throw new Error('missing pull taskId')
|
||||
}
|
||||
return pollPriceSetSaveTask(taskId, onProgress)
|
||||
}
|
||||
|
||||
async function pollPriceSetSaveTask(taskId, onProgress) {
|
||||
const started = Date.now()
|
||||
const maxMs = 30 * 60 * 1000
|
||||
while (Date.now() - started < maxMs) {
|
||||
@@ -225,13 +259,13 @@ export async function importSetDetailPricesAsync(file, query, onProgress) {
|
||||
return { task }
|
||||
}
|
||||
if (task.status === 'FAIL') {
|
||||
const err = new Error(task.error || task.message || 'import failed')
|
||||
const err = new Error(task.error || task.message || 'task failed')
|
||||
err.task = task
|
||||
throw err
|
||||
}
|
||||
await new Promise(resolve => setTimeout(resolve, 800))
|
||||
}
|
||||
throw new Error('import timeout')
|
||||
throw new Error('task timeout')
|
||||
}
|
||||
|
||||
export function updateSetDetail(data) {
|
||||
|
||||
Reference in New Issue
Block a user