增加专属报价功能

This commit is contained in:
wuweihua
2026-11-05 12:57:13 +08:00
parent 557d43a0b8
commit 308526ecee
32 changed files with 3817 additions and 567 deletions
@@ -0,0 +1,77 @@
import { inject, provide } from 'vue'
import { priceSetApi } from '@/api/price/set'
export const PRICE_SET_MODULE_KEY = 'priceSetModule'
const defaultModule = Object.freeze({
api: priceSetApi,
permPrefix: 'price:set',
exclusiveQuote: false,
onlyImportFresh: false,
routes: Object.freeze({
list: '/customer/set',
create: '/customer/setCreate',
detail: '/customer/setDetail'
}),
labels: Object.freeze({
entity: '套餐',
entityCode: '套餐编码',
entityName: '套餐名称',
createButton: '新建套餐',
saveProgressTitle: '正在保存套餐',
savedSuccess: '套餐已保存',
noActiveVersion: '该套餐暂无生效版本',
disableConfirm: '停用后该套餐不再参与计费命中,确认停用【{name}】?',
enableConfirm: '启用后该套餐将重新参与计费命中,确认启用【{name}】?',
basicEditTitle: '修改套餐基本信息',
keywordPlaceholder: '套餐编码 / 名称',
detailTitleFallback: '套餐详情'
})
})
export function createExclusiveModule(api) {
return Object.freeze({
api,
permPrefix: 'price:exclusive',
exclusiveQuote: true,
onlyImportFresh: true,
routes: Object.freeze({
list: '/exclusive/quote',
create: '/exclusive/quoteCreate',
detail: '/exclusive/quoteDetail'
}),
labels: Object.freeze({
entity: '专属报价',
entityCode: '报价编码',
entityName: '报价名称',
createButton: '新建报价',
saveProgressTitle: '正在保存专属报价',
savedSuccess: '专属报价已保存',
noActiveVersion: '该专属报价暂无生效版本',
disableConfirm: '停用后该专属报价不再参与计费命中,确认停用【{name}】?',
enableConfirm: '启用后该专属报价将重新参与计费命中,确认启用【{name}】?',
basicEditTitle: '修改专属报价基本信息',
keywordPlaceholder: '报价编码 / 名称',
detailTitleFallback: '专属报价详情'
})
})
}
/**
* Provide module for child inject, and return cfg for the providing page itself
* (same-component inject cannot see its own provide).
*/
export function providePriceSetModule(moduleConfig) {
const cfg = moduleConfig || defaultModule
provide(PRICE_SET_MODULE_KEY, cfg)
return cfg
}
export function usePriceSetModule() {
return inject(PRICE_SET_MODULE_KEY, defaultModule)
}
export function usePriceSetPerm(action) {
const mod = usePriceSetModule()
return [`${mod.permPrefix}:${action}`]
}