Refactor billing options retrieval to include data permissions and add effective date handling for product imports

This commit is contained in:
wuweihua
2026-10-09 09:27:28 +08:00
parent fea34d1d10
commit c95a9861cc
42 changed files with 984 additions and 219 deletions
+18 -3
View File
@@ -9,6 +9,15 @@ export function listProduct(query) {
})
}
/** 产品下拉选项(非分页,不要求 price:product:list 权限) */
export function listProductOptions(query) {
return request({
url: '/price/product/optionselect',
method: 'get',
params: query
})
}
/** 查询产品详情 */
export function getProduct(productId) {
return request({
@@ -111,13 +120,17 @@ async function pollProductImportTask(taskId, onProgress) {
/**
* Async all-country product import; poll until done.
* @param {File|Blob} file
* @param {string} effectiveDate yyyy-MM-dd (required)
* @param {(task: object) => void} [onProgress]
*/
export async function importProductExcelAsync(file, onProgress) {
export async function importProductExcelAsync(file, effectiveDate, onProgress) {
const formData = new FormData()
formData.append('file', file)
const params = new URLSearchParams()
params.set('updateSupport', '0')
if (effectiveDate) params.set('effectiveDate', effectiveDate)
const submitRes = await request({
url: '/price/product/importData?updateSupport=0',
url: '/price/product/importData?' + params.toString(),
method: 'post',
data: formData,
headers: { 'Content-Type': 'multipart/form-data' }
@@ -133,13 +146,15 @@ export async function importProductExcelAsync(file, onProgress) {
* Async single-country product import; poll until done.
* @param {File|Blob} file
* @param {string} countryCode
* @param {string} effectiveDate yyyy-MM-dd
* @param {(task: object) => void} [onProgress]
*/
export async function importProductCountryExcelAsync(file, countryCode, onProgress) {
export async function importProductCountryExcelAsync(file, countryCode, effectiveDate, onProgress) {
const formData = new FormData()
formData.append('file', file)
const params = new URLSearchParams()
params.set('countryCode', countryCode)
if (effectiveDate) params.set('effectiveDate', effectiveDate)
const submitRes = await request({
url: '/price/product/importCountryData?' + params.toString(),
method: 'post',
+8
View File
@@ -128,6 +128,14 @@ export function copyPriceSetVersion(psvId) {
})
}
/** Create empty draft version under package */
export function createPriceSetVersion(priceSetId) {
return request({
url: '/price/set/version/create/' + priceSetId,
method: 'post'
})
}
export function deletePriceSetVersion(psvId) {
return request({
url: '/price/set/version/' + psvId,