修改套餐状态

This commit is contained in:
wuweihua
2026-09-20 10:29:10 +08:00
parent 24435e4113
commit cc5f1cf5de
15 changed files with 96 additions and 61 deletions
+5 -8
View File
@@ -13,7 +13,7 @@
:set="set"
@back="goList"
@disable="onDisable"
@copy="onCopy"
@enable="onEnable"
/>
<set-basic-info-card :set="set" />
@@ -77,7 +77,7 @@ import SetVersionDetailDrawer from './components/detail/SetVersionDetailDrawer.v
import PriceEditPanel from './components/create/PriceEditPanel.vue'
import { usePriceSetRefData } from './composables/usePriceSetRefData'
import {
getPriceSet, disablePriceSet, copyPriceSet, activatePriceSetVersion, copyPriceSetVersion, deletePriceSetVersion
getPriceSet, disablePriceSet, enablePriceSet, activatePriceSetVersion, copyPriceSetVersion, deletePriceSetVersion
} from '@/api/price/set'
const { proxy } = getCurrentInstance()
@@ -121,6 +121,9 @@ function confirmAction(text, request, successText, done) {
function onDisable() {
confirmAction('停用后不再参与计费命中,确认停用?', () => disablePriceSet(set.value.priceSetId), '已停用')
}
function onEnable() {
confirmAction('启用后套餐将重新参与计费命中,确认启用?', () => enablePriceSet(set.value.priceSetId), '已启用')
}
function formatNow() {
const d = new Date()
const p = n => String(n).padStart(2, '0')
@@ -199,12 +202,6 @@ function submitActivate() {
})
})
}
function onCopy() {
copyPriceSet(set.value.priceSetId).then(res => {
proxy.$modal.msgSuccess('已复制为草稿')
proxy.$router.push({ path: '/customer/setCreate', query: { priceSetId: res.data } })
})
}
function onCopyVersion(row) {
if (!row || row.psvId == null) return
const hasDraft = (set.value.versions || []).some(v => v && String(v.status) === '0')