修改价格套餐版本
This commit is contained in:
@@ -33,6 +33,16 @@
|
||||
<el-tag :type="statusTag(row)" size="small">{{ statusLabel(row) }}</el-tag>
|
||||
</template>
|
||||
|
||||
<template #col-activeDetail="{ row }">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
:loading="activeLoadingId === row.priceSetId"
|
||||
@click="handleActiveDetail(row)"
|
||||
v-hasPermi="['price:set:query']"
|
||||
>查看明细</el-button>
|
||||
</template>
|
||||
|
||||
<template #col-action="{ row }">
|
||||
<el-button link type="primary" @click="handleDetail(row)" v-hasPermi="['price:set:query']">详情</el-button>
|
||||
<el-button
|
||||
@@ -44,14 +54,21 @@
|
||||
</template>
|
||||
</basic-table>
|
||||
|
||||
<set-version-detail-drawer
|
||||
v-model="drawerVisible"
|
||||
:version="activeVersion"
|
||||
:set-type="drawerSetType"
|
||||
/>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="PriceSet">
|
||||
import {
|
||||
listPriceSet, disablePriceSet, copyPriceSet
|
||||
listPriceSet, disablePriceSet, copyPriceSet, getPriceSet
|
||||
} from '@/api/price/set'
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
import SetVersionDetailDrawer from './components/detail/SetVersionDetailDrawer.vue'
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
const tableRef = ref()
|
||||
@@ -88,6 +105,7 @@ const columns = [
|
||||
{ label: '套餐名称', prop: 'priceSetName', minWidth: 160 },
|
||||
{ label: '类型', prop: 'setType', width: 140 },
|
||||
{ label: '说明', prop: 'priceSetNote', minWidth: 160 },
|
||||
{ label: '生效明细', prop: 'activeDetail', width: 100 },
|
||||
{ label: '操作', prop: 'action', width: 160, showInToolbar: false }
|
||||
]
|
||||
|
||||
@@ -119,6 +137,30 @@ function handleDetail(row) {
|
||||
proxy.$router.push({ path: '/customer/setDetail', query: { priceSetId: row.priceSetId } })
|
||||
}
|
||||
|
||||
/** 生效明细:拉详情找生效版本(status=1)弹抽屉 */
|
||||
const drawerVisible = ref(false)
|
||||
const activeVersion = ref(null)
|
||||
const drawerSetType = ref('FIXED')
|
||||
const activeLoadingId = ref(null)
|
||||
|
||||
function handleActiveDetail(row) {
|
||||
activeLoadingId.value = row.priceSetId
|
||||
getPriceSet(row.priceSetId).then(res => {
|
||||
const data = res.data || {}
|
||||
const versions = data.versions || []
|
||||
const active = versions.find(v => String(v.status) === '1')
|
||||
if (!active || active.psvId == null) {
|
||||
proxy.$modal.msgWarning('该套餐暂无生效版本')
|
||||
return
|
||||
}
|
||||
drawerSetType.value = row.setType
|
||||
activeVersion.value = { psvId: active.psvId, versionNo: active.versionNo }
|
||||
drawerVisible.value = true
|
||||
}).finally(() => {
|
||||
activeLoadingId.value = null
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
function refresh() {
|
||||
tableRef.value?.refresh()
|
||||
|
||||
Reference in New Issue
Block a user