新增按版本获取价格设置明细的接口,优化产品下拉选项查询,更新相关服务和前端调用逻辑。

This commit is contained in:
wuweihua
2026-10-29 16:13:18 +08:00
parent 59eb4b23cc
commit c3456ca92a
14 changed files with 218 additions and 29 deletions
@@ -227,7 +227,7 @@ import {
surchargeAppliesToRow,
toDetailPayload
} from '../../utils/priceSet'
import { getPriceSet, listSetDetailByProduct, importSetDetailPricesAsync, pullSetDetailsFromLibraryAsync, previewPullFromLibrary, previewImportDetailPrices, updateSetDetail, updateSetDetailSurchargeAsync, delSetDetail } from '@/api/price/set'
import { getPriceSet, listSetDetailByProduct, listSetDetailByVersion, importSetDetailPricesAsync, pullSetDetailsFromLibraryAsync, previewPullFromLibrary, previewImportDetailPrices, updateSetDetail, updateSetDetailSurchargeAsync, delSetDetail } from '@/api/price/set'
import { listRegionOptions } from '@/api/data/region'
const props = defineProps({
@@ -437,12 +437,8 @@ async function loadLatestPriorVersionDraft() {
return row
})
if (!products.length) return false
const chunks = await Promise.all(products.map(p =>
listSetDetailByProduct(prior.psvId, p.productCode)
.then(r => r.data || [])
.catch(() => [])
))
applyLocalDraft(products, chunks.flat())
const detailRes = await listSetDetailByVersion(prior.psvId)
applyLocalDraft(products, detailRes.data || [])
return true
} finally {
pulling.value = false