feat: 优化发票和用户列表按钮渲染逻辑,并调整用户限额设置弹窗的初始化字段。
This commit is contained in:
parent
d40e8c2e0d
commit
f2068c7b16
@ -1,5 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { h, onMounted, ref, resolveDirective, withDirectives } from 'vue'
|
import { h, onMounted, ref } from 'vue'
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import { NButton, NInput, NTag, NSelect, NDatePicker, useMessage, useDialog } from 'naive-ui'
|
import { NButton, NInput, NTag, NSelect, NDatePicker, useMessage, useDialog } from 'naive-ui'
|
||||||
|
|
||||||
@ -15,7 +15,6 @@ defineOptions({ name: '开票记录' })
|
|||||||
|
|
||||||
const $table = ref(null)
|
const $table = ref(null)
|
||||||
const queryItems = ref({})
|
const queryItems = ref({})
|
||||||
const vPermission = resolveDirective('permission')
|
|
||||||
const $message = useMessage()
|
const $message = useMessage()
|
||||||
const dialog = useDialog()
|
const dialog = useDialog()
|
||||||
|
|
||||||
@ -201,31 +200,27 @@ const columns = [
|
|||||||
if (row.status === 'pending') {
|
if (row.status === 'pending') {
|
||||||
// 未开票:显示"开票"和"退款"按钮
|
// 未开票:显示"开票"和"退款"按钮
|
||||||
buttons.push(
|
buttons.push(
|
||||||
withDirectives(
|
h(
|
||||||
h(
|
NButton,
|
||||||
NButton,
|
{
|
||||||
{
|
size: 'small',
|
||||||
size: 'small',
|
type: 'primary',
|
||||||
type: 'primary',
|
onClick: () => handleInvoice(row),
|
||||||
onClick: () => handleInvoice(row),
|
},
|
||||||
},
|
{ default: () => '开票' }
|
||||||
{ default: () => '开票' }
|
),
|
||||||
),
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
buttons.push(
|
buttons.push(
|
||||||
withDirectives(
|
h(
|
||||||
h(
|
NButton,
|
||||||
NButton,
|
{
|
||||||
{
|
size: 'small',
|
||||||
size: 'small',
|
type: 'warning',
|
||||||
type: 'warning',
|
onClick: () => handleRefund(row),
|
||||||
onClick: () => handleRefund(row),
|
style: { marginLeft: '8px' },
|
||||||
style: { marginLeft: '8px' },
|
},
|
||||||
},
|
{ default: () => '退款' }
|
||||||
{ default: () => '退款' }
|
),
|
||||||
),
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
} else if (row.status === 'invoiced') {
|
} else if (row.status === 'invoiced') {
|
||||||
// 已开票:显示"查看"按钮
|
// 已开票:显示"查看"按钮
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { h, onMounted, ref, resolveDirective, withDirectives } from 'vue'
|
import { h, onMounted, ref } from 'vue'
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import { NButton, NForm, NFormItem, NInput, NDatePicker } from 'naive-ui'
|
import { NButton, NForm, NFormItem, NInput, NDatePicker } from 'naive-ui'
|
||||||
|
|
||||||
@ -20,7 +20,6 @@ defineOptions({ name: '用户管理' })
|
|||||||
const $table = ref(null)
|
const $table = ref(null)
|
||||||
const queryItems = ref({})
|
const queryItems = ref({})
|
||||||
const createdDateRange = ref(null)
|
const createdDateRange = ref(null)
|
||||||
const vPermission = resolveDirective('permission')
|
|
||||||
|
|
||||||
// 次数设置弹窗相关状态
|
// 次数设置弹窗相关状态
|
||||||
const limitModalVisible = ref(false)
|
const limitModalVisible = ref(false)
|
||||||
@ -135,35 +134,31 @@ const columns = [
|
|||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
render(row) {
|
render(row) {
|
||||||
return [
|
return [
|
||||||
withDirectives(
|
h(
|
||||||
h(
|
NButton,
|
||||||
NButton,
|
{
|
||||||
{
|
size: 'small',
|
||||||
size: 'small',
|
type: 'info',
|
||||||
type: 'info',
|
style: 'margin-right: 8px;',
|
||||||
style: 'margin-right: 8px;',
|
onClick: () => handleViewDetail(row),
|
||||||
onClick: () => handleViewDetail(row),
|
},
|
||||||
},
|
{
|
||||||
{
|
default: () => '详情',
|
||||||
default: () => '详情',
|
icon: renderIcon('material-symbols:info', { size: 16 }),
|
||||||
icon: renderIcon('material-symbols:info', { size: 16 }),
|
}
|
||||||
}
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
withDirectives(
|
h(
|
||||||
h(
|
NButton,
|
||||||
NButton,
|
{
|
||||||
{
|
size: 'small',
|
||||||
size: 'small',
|
type: 'primary',
|
||||||
type: 'primary',
|
style: 'margin-right: 8px;',
|
||||||
style: 'margin-right: 8px;',
|
onClick: () => handleSetLimit(row),
|
||||||
onClick: () => handleSetLimit(row),
|
},
|
||||||
},
|
{
|
||||||
{
|
default: () => '次数设置',
|
||||||
default: () => '次数设置',
|
icon: renderIcon('material-symbols:settings', { size: 16 }),
|
||||||
icon: renderIcon('material-symbols:settings', { size: 16 }),
|
}
|
||||||
}
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user