Files
ipms-sjy/yudao-ui-admin-vue3/src/views/pay/refund/index.vue

68 lines
1.9 KiB
Vue
Raw Normal View History

2022-11-30 15:33:58 +08:00
<template>
<ContentWrap>
<!-- 列表 -->
2023-01-03 11:21:27 +08:00
<XTable @register="registerTable">
2022-11-30 15:33:58 +08:00
<template #toolbar_buttons>
<!-- 操作导出 -->
<XButton
type="warning"
preIcon="ep:download"
:title="t('action.export')"
v-hasPermi="['pay:refund:export']"
@click="handleExport()"
/>
</template>
<template #actionbtns_default="{ row }">
<!-- 操作详情 -->
<XTextButton
preIcon="ep:view"
:title="t('action.detail')"
v-hasPermi="['pay:refund:query']"
@click="handleDetail(row.id)"
/>
</template>
2023-01-03 11:21:27 +08:00
</XTable>
2022-11-30 15:33:58 +08:00
</ContentWrap>
<XModal v-model="dialogVisible" :title="t('action.detail')">
<!-- 对话框(详情) -->
<Descriptions :schema="allSchemas.detailSchema" :data="detailData" />
<!-- 操作按钮 -->
<template #footer>
<el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button>
</template>
</XModal>
</template>
2022-11-23 22:26:25 +08:00
<script setup lang="ts" name="Refund">
2022-07-18 19:06:37 +08:00
import { ref } from 'vue'
import { useI18n } from '@/hooks/web/useI18n'
2023-01-03 11:21:27 +08:00
import { useXTable } from '@/hooks/web/useXTable'
2022-07-18 19:06:37 +08:00
import { allSchemas } from './refund.data'
import * as RefundApi from '@/api/pay/refund'
2022-11-30 15:33:58 +08:00
2022-07-18 19:06:37 +08:00
const { t } = useI18n() // 国际化
2022-11-30 15:33:58 +08:00
// 列表相关的变量
2023-01-03 11:21:27 +08:00
const [registerTable, { exportList }] = useXTable({
2022-11-30 15:33:58 +08:00
allSchemas: allSchemas,
2022-07-18 19:06:37 +08:00
getListApi: RefundApi.getRefundPageApi,
exportListApi: RefundApi.exportRefundApi
})
2022-11-30 15:33:58 +08:00
// 导出操作
const handleExport = async () => {
2023-01-03 11:21:27 +08:00
await exportList('退款订单.xls')
2022-11-30 15:33:58 +08:00
}
2022-07-18 19:06:37 +08:00
// ========== CRUD 相关 ==========
const dialogVisible = ref(false) // 是否显示弹出层
2022-11-30 15:33:58 +08:00
const detailData = ref() // 详情 Ref
2022-07-18 19:06:37 +08:00
// 详情操作
2022-11-30 15:33:58 +08:00
const handleDetail = async (rowId: number) => {
2022-07-18 19:06:37 +08:00
// 设置数据
2022-11-30 15:33:58 +08:00
detailData.value = RefundApi.getRefundApi(rowId)
2022-07-18 19:06:37 +08:00
dialogVisible.value = true
}
</script>