|
@@ -1,130 +1,23 @@
|
|
<!-- -->
|
|
<!-- -->
|
|
<template>
|
|
<template>
|
|
<div class="white-bgc pa-3 pt-3">
|
|
<div class="white-bgc pa-3 pt-3">
|
|
- <v-tabs v-model="tab" align-tabs="start" color="primary" bg-color="#f7f8fa" @update:model-value="handleChangeTab">
|
|
|
|
|
|
+ <v-tabs v-model="tab" align-tabs="start" color="primary" bg-color="#f7f8fa">
|
|
<v-tab value="tab_transaction">{{ '交易订单' }}</v-tab>
|
|
<v-tab value="tab_transaction">{{ '交易订单' }}</v-tab>
|
|
<v-tab value="tab_recharge">{{ '充值订单' }}</v-tab>
|
|
<v-tab value="tab_recharge">{{ '充值订单' }}</v-tab>
|
|
</v-tabs>
|
|
</v-tabs>
|
|
- <CtTable
|
|
|
|
- class="mt-3"
|
|
|
|
- :items="dataList"
|
|
|
|
- :headers="headersList[tab]"
|
|
|
|
- :loading="false"
|
|
|
|
- :elevation="0"
|
|
|
|
- :isTools="false"
|
|
|
|
- :showPage="true"
|
|
|
|
- :total="total"
|
|
|
|
- :page-info="query"
|
|
|
|
- itemKey="id"
|
|
|
|
- @pageHandleChange="handleChangePage"
|
|
|
|
- >
|
|
|
|
- </CtTable>
|
|
|
|
|
|
+ <Transaction v-if="tab === 'tab_transaction'"></Transaction>
|
|
|
|
+ <Recharge v-if="tab === 'tab_recharge'"></Recharge>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
defineOptions({name: 'enterprise-memberCenter-tradingOrder'})
|
|
defineOptions({name: 'enterprise-memberCenter-tradingOrder'})
|
|
-import {
|
|
|
|
- getEnterpriseTradeOrderPage,
|
|
|
|
- getEnterpriseCurrencyRechargePage,
|
|
|
|
-} from '@/api/recruit/enterprise/member/points'
|
|
|
|
import { ref } from 'vue'
|
|
import { ref } from 'vue'
|
|
-import { timesTampChange } from '@/utils/date'
|
|
|
|
-import { getDict } from '@/hooks/web/useDictionaries'
|
|
|
|
-import { FenYuanTransform, rechargeRatio } from '@/utils/position'
|
|
|
|
|
|
+import Transaction from './components/transaction.vue'
|
|
|
|
+import Recharge from './components/recharge.vue'
|
|
|
|
|
|
const tab = ref('tab_transaction')
|
|
const tab = ref('tab_transaction')
|
|
-const total = ref(0)
|
|
|
|
-const query = ref({
|
|
|
|
- pageNo: 1,
|
|
|
|
- pageSize: 10,
|
|
|
|
- payStatus: true, // 支付状态,订单数据true只显示已支付的
|
|
|
|
-})
|
|
|
|
-const dataList = ref([])
|
|
|
|
-
|
|
|
|
-const getData = async () => {
|
|
|
|
- dataList.value = []; total.value = 0
|
|
|
|
- const api = {
|
|
|
|
- 'tab_transaction': getEnterpriseTradeOrderPage,
|
|
|
|
- 'tab_recharge': getEnterpriseCurrencyRechargePage,
|
|
|
|
- }
|
|
|
|
- const res = await api[tab.value](query.value)
|
|
|
|
- dataList.value = res?.list || []
|
|
|
|
- total.value = res.total
|
|
|
|
-}
|
|
|
|
-getData()
|
|
|
|
-
|
|
|
|
-const handleChangePage = (e) => {
|
|
|
|
- query.value.pageNo = e
|
|
|
|
- getData()
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-// 切换
|
|
|
|
-const handleChangeTab = (value) => {
|
|
|
|
- tab.value = value
|
|
|
|
- query.value.pageNo = 1
|
|
|
|
- initDict()
|
|
|
|
- getData()
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-const headersList = {
|
|
|
|
- tab_transaction: [
|
|
|
|
- { title: '商品名称', key: 'spuName', sortable: false },
|
|
|
|
- { title: '使用点数', key: 'price', sortable: false },
|
|
|
|
- { title: '是否已支付', key: 'payStatus', sortable: false, value: item => item.payStatus ? '已支付' : '未支付' },
|
|
|
|
- { title: '支付订单编号', key: 'payOrderId', sortable: false },
|
|
|
|
- { title: '订单支付时间', key: 'payTime', value: item => timesTampChange(item.payTime), sortable: false },
|
|
|
|
- // { title: '支付渠道', key: 'payChannelCode', value: item => channelData.value.find(e => e.value === item.payChannelCode)?.label, sortable: false },
|
|
|
|
- // { title: '退款订单编号', key: 'payReFundId', sortable: false },
|
|
|
|
- // { title: '退款金额', key: 'refundPrice', sortable: false, value: item => FenYuanTransform(item.refundPrice) },
|
|
|
|
- // { title: '退款时间', key: 'refundTime', value: item => timesTampChange(item.refundTime), sortable: false },
|
|
|
|
- // { title: '更新时间', key: 'updateTime', value: item => timesTampChange(item.updateTime), sortable: false },
|
|
|
|
- ],
|
|
|
|
- tab_recharge: [
|
|
|
|
- { title: '充值点数', key: '点数', value: item => rechargeRatio()*FenYuanTransform(item.payPrice), sortable: false },
|
|
|
|
- { title: '支付金额', key: 'payPrice', value: item => FenYuanTransform(item.payPrice)+'元', sortable: false },
|
|
|
|
- { title: '订单支付时间', key: 'payTime', value: item => timesTampChange(item.payTime), sortable: false },
|
|
|
|
- { title: '支付成功的外部订单号', key: 'payOrderChannelOrderNo', sortable: false },
|
|
|
|
- { title: '支付渠道名', key: 'payChannelName', sortable: false },
|
|
|
|
- // { title: '支付状态', key: 'payStatus', sortable: false },
|
|
|
|
- // { title: '退款状态', key: 'refundStatus', value: item => pay_refund_status.value.find(e => e.value-0 === item.refundStatus-0)?.label, sortable: false },
|
|
|
|
- // { title: '用户实际到账余额', key: 'totalPrice', value: item => FenYuanTransform(item.totalPrice), sortable: false },
|
|
|
|
- // { title: '赠送金额', key: 'bonusPrice', value: item => FenYuanTransform(item.bonusPrice), sortable: false },
|
|
|
|
- // { title: '编号', key: 'id', sortable: false },
|
|
|
|
- // { title: '支付成功的支付渠道', key: 'payChannelCode', sortable: false },
|
|
|
|
- // { title: '支付订单编号', key: 'payOrderId', sortable: false },
|
|
|
|
- ],
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-// 字典查询
|
|
|
|
-
|
|
|
|
-// 支付渠道
|
|
|
|
-const channelData = ref([])
|
|
|
|
-const getPayChannelCode = async () => {
|
|
|
|
- const { data } = await getDict('pay_channel_code')
|
|
|
|
- channelData.value = data
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-// 退款订单状态
|
|
|
|
-const pay_refund_status = ref([])
|
|
|
|
-const get_pay_refund_status = async () => {
|
|
|
|
- const { data } = await getDict('pay_refund_status')
|
|
|
|
- pay_refund_status.value = data
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-// // 交易订单取消类型
|
|
|
|
-// const menduner_trade_order_cancel_type = ref([])
|
|
|
|
-// const get_menduner_trade_order_cancel_type = async () => {
|
|
|
|
-// const { data } = await getDict('menduner_trade_order_cancel_type')
|
|
|
|
-// menduner_trade_order_cancel_type.value = data
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
-const initDict = () => { // 对应标签下的字典
|
|
|
|
- if (tab.value === 'tab_transaction') getPayChannelCode()
|
|
|
|
- if (tab.value === 'tab_recharge') get_pay_refund_status()
|
|
|
|
-}
|
|
|
|
-initDict()
|
|
|
|
-
|
|
|
|
</script>
|
|
</script>
|
|
|
|
+
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
</style>
|
|
</style>
|