Commit b9a29b71 by zhuzhequan
parents 26ced3ba 1ecf605f
import axios from '../axios'
export function getUserRechargeRecordListApi(params) {
return axios.post('/pay/businessPayRecord/list_page', params)
}
...@@ -6,7 +6,7 @@ import LoginPage from '@/views/LoginPage.vue' ...@@ -6,7 +6,7 @@ import LoginPage from '@/views/LoginPage.vue'
import menuPage from '@/views/menu.vue' import menuPage from '@/views/menu.vue'
import TaskManage from '@/views/taskManage/index.vue' import TaskManage from '@/views/taskManage/index.vue'
import HomePage from '@/views/homePage/index.vue' import HomePage from '@/views/homePage/index.vue'
import { getToken } from '@/utils/auth'
export const DEFAULT_DASHBOARD = 'home' export const DEFAULT_DASHBOARD = 'home'
Vue.use(VueRouter) Vue.use(VueRouter)
...@@ -85,12 +85,18 @@ const routes = [ ...@@ -85,12 +85,18 @@ const routes = [
meta: { title: '州省简称' } meta: { title: '州省简称' }
}, },
{ {
path: '/saas/management', path: '/saas/user/management',
component: () => import('@/views/system/management.vue'), component: () => import('@/views/user/management.vue'),
name: 'system_management', name: 'system_management',
meta: { title: '客户管理' } meta: { title: '客户管理' }
}, },
{ {
path: '/saas/user/recharge-record',
component: () => import('@/views/user/rechargeRecord.vue'),
name: 'user_recharge_record',
meta: { title: '充值记录' }
},
{
path: '/saas/logistics/transporters', path: '/saas/logistics/transporters',
component: () => import('@/views/system/transporters.vue'), component: () => import('@/views/system/transporters.vue'),
name: 'system_transporters', name: 'system_transporters',
...@@ -133,7 +139,6 @@ const routes = [ ...@@ -133,7 +139,6 @@ const routes = [
meta: { title: '丢单管理' } meta: { title: '丢单管理' }
}, },
{ {
path: '/operation/exceptionMessage', path: '/operation/exceptionMessage',
component: () => import('@/views/operation/exceptionMessage.vue'), component: () => import('@/views/operation/exceptionMessage.vue'),
name: 'exceptionMessage', name: 'exceptionMessage',
...@@ -159,10 +164,30 @@ const routes = [ ...@@ -159,10 +164,30 @@ const routes = [
] ]
} }
] ]
const router = new VueRouter({ const router = new VueRouter({
mode: 'history', mode: 'history',
base: process.env.BASE_URL, base: process.env.BASE_URL,
routes routes
}) })
// 导航守卫
router.beforeEach((to, from, next) => {
const token = getToken()
if (to.name === 'home' && !token) {
// 如果用户尝试访问首页但没有token,则重定向到登录页
next('/login')
} else if (to.name === 'login' && token) {
// 如果用户已经在登录状态且尝试访问登录页,则重定向到首页
next('/')
} else {
// 其他情况,正常放行
next()
}
})
// 修改 Vue Router 的 push 方法,使其在发生异常时不会抛出错误,而是返回一个包含错误信息的 Promise
const VueRouterPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(to) {
return VueRouterPush.call(this, to).catch((err) => err)
}
export default router export default router
...@@ -256,8 +256,8 @@ export default { ...@@ -256,8 +256,8 @@ export default {
id: 5, id: 5,
path: '', path: '',
label: '功能管理', label: '功能管理',
icon: '', icon: 'el-icon-setting',
index: '', index: '/setting',
children: [ children: [
{ {
id: 1, id: 1,
...@@ -283,14 +283,7 @@ export default { ...@@ -283,14 +283,7 @@ export default {
index: '/saas/abbreviation', index: '/saas/abbreviation',
children: [] children: []
}, },
{
id: 6,
path: '',
label: '客户管理',
icon: 'el-icon-s-custom',
index: '/saas/management',
children: []
},
{ {
id: 7, id: 7,
path: '', path: '',
...@@ -383,6 +376,31 @@ export default { ...@@ -383,6 +376,31 @@ export default {
// children: [] // children: []
// }, // },
{ {
id: 7,
path: '',
label: '客户管理',
icon: 'el-icon-user',
index: '/user',
children: [
{
id: 1,
path: '',
label: '客户管理',
icon: 'el-icon-s-custom',
index: '/saas/user/management',
children: []
},
{
id: 2,
path: '',
label: '充值记录',
icon: 'el-icon-user',
index: '/saas/user/recharge-record',
children: []
}
]
},
{
id: 8, id: 8,
path: '', path: '',
label: '应用版本管理', label: '应用版本管理',
...@@ -497,6 +515,7 @@ export default { ...@@ -497,6 +515,7 @@ export default {
}) })
} }
}, },
async submitOm() { async submitOm() {
if (!this.editForm.content) { if (!this.editForm.content) {
return this.$message.warning('请输入内容') return this.$message.warning('请输入内容')
......
...@@ -5,15 +5,14 @@ ...@@ -5,15 +5,14 @@
:key="t.id" :key="t.id"
class="page-tag" class="page-tag"
:class="{ active: activeTag === t.name }" :class="{ active: activeTag === t.name }"
@click="switchTag(t)" @click="switchTag(t)">
>
<span class="page-tag-title">{{ t.title }}</span> <span class="page-tag-title">{{ t.title }}</span>
<span <span
v-if="t.name !== DEFAULT_DASHBOARD" v-if="t.name !== DEFAULT_DASHBOARD"
class="page-tag-close" class="page-tag-close"
@click.stop="closeTag(t)" @click.stop="closeTag(t)">
><i class="el-icon-close"></i <i class="el-icon-close"></i>
></span> </span>
</div> </div>
</div> </div>
</template> </template>
...@@ -25,15 +24,16 @@ export default { ...@@ -25,15 +24,16 @@ export default {
name: 'pageTags', name: 'pageTags',
data() { data() {
return { return {
DEFAULT_DASHBOARD, DEFAULT_DASHBOARD
} }
}, },
computed: { computed: {
...mapState('tags', ['tags', 'activeTag']), ...mapState('tags', ['tags', 'activeTag']),
...mapGetters('tags', ['currentTag']), ...mapGetters('tags', ['currentTag'])
}, },
methods: { methods: {
switchTag(t) { switchTag(t) {
if (this.$route.path === t.path) return
this.$store.commit('tags/setActive', t.name) this.$store.commit('tags/setActive', t.name)
this.$router.push(t.path) this.$router.push(t.path)
}, },
...@@ -43,12 +43,12 @@ export default { ...@@ -43,12 +43,12 @@ export default {
// 切换到前一个标签页 // 切换到前一个标签页
if (this.$route.fullPath !== this.currentTag.path) { if (this.$route.fullPath !== this.currentTag.path) {
this.$router.push({ this.$router.push({
path: this.currentTag.path, path: this.currentTag.path
}) })
} }
} }
}, }
}, }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -87,9 +87,9 @@ export default { ...@@ -87,9 +87,9 @@ export default {
} }
&.active { &.active {
background-color: #1565C0; background-color: #1565c0;
color: #fff; color: #fff;
border: 1px solid #1565C0; border: 1px solid #1565c0;
} }
} }
......
<template>
<div class="recharge-record card">
<div class="search">
<el-form :model="searchForm" size="small" :inline="true">
<el-form-item label="客户">
<el-input
v-model="searchForm.namespace"
placeholder="请输入客户"
clearable></el-input>
</el-form-item>
<el-form-item label="套餐版本">
<el-input
v-model="searchForm.subject"
placeholder="请输入客户"
clearable></el-input>
</el-form-item>
<el-form-item label="交易号">
<el-input
v-model="searchForm.tradeNo"
placeholder="请输入交易号"
clearable></el-input>
</el-form-item>
<el-form-item label="订单号">
<el-input
v-model="searchForm.outTradeNo"
placeholder="请输入订单号"
clearable></el-input>
</el-form-item>
<el-form-item label="业务类型">
<el-input
v-model="searchForm.businessType"
placeholder="请输入业务类型"
clearable></el-input>
</el-form-item>
<el-form-item>
<el-button
type="primary"
size="small"
icon="el-icon-search"
@click="search">
查询
</el-button>
</el-form-item>
</el-form>
</div>
<div class="table-wrap" v-loading="loading">
<el-table
ref="table"
:data="rechargeRecordList"
border
width="100%"
height="100%"
:highlight-current-row="true"
header-row-class-name="header-row-class-name">
<el-table-column
label="序号"
type="index"
width="50"
align="center"
fixed="left"
header-align="center"></el-table-column>
<el-table-column
label="客户"
prop="namespace"
header-align="center"
align="center"
width="80"
fixed="left"
:show-overflow-tooltip="true"></el-table-column>
<el-table-column
label="套餐版本"
prop="subject"
header-align="center"
align="center"
width="100"
:show-overflow-tooltip="true"></el-table-column>
<el-table-column
label="交易号"
prop="tradeNo"
header-align="center"
align="center"
min-width="120"
:show-overflow-tooltip="true"></el-table-column>
<el-table-column
label="购买数量"
prop="month"
header-align="center"
align="center"
width="100"
:show-overflow-tooltip="true"></el-table-column>
<el-table-column
label="交易金额"
prop="totalAmount"
header-align="center"
align="center"
width="100"
:show-overflow-tooltip="true"></el-table-column>
<el-table-column
label="支付方式"
prop="payType"
header-align="center"
align="center"
width="100"
:show-overflow-tooltip="true"></el-table-column>
<el-table-column
label="业务类型"
prop="businessType"
header-align="center"
align="left"
min-width="120"
:show-overflow-tooltip="true"></el-table-column>
<el-table-column
label="订单号"
prop="outTradeNo"
min-width="180"
:show-overflow-tooltip="true"
align="center"
header-align="center"></el-table-column>
<el-table-column
label="商户原始订单号"
prop="merchantOrderNo"
header-align="center"
align="center"
width="130"
:show-overflow-tooltip="true"></el-table-column>
<el-table-column
label="订单标题"
prop="subject"
header-align="center"
align="center"
width="100"
:show-overflow-tooltip="true"></el-table-column>
<el-table-column
label="订单附加信息"
prop="body"
header-align="center"
align="center"
min-width="130"
:show-overflow-tooltip="true"></el-table-column>
<el-table-column
label="产品码"
prop="productCode"
header-align="center"
align="center"
min-width="220"
:show-overflow-tooltip="true"></el-table-column>
<el-table-column
label="付款时间"
prop="clientTime"
header-align="center"
align="center"
width="160"
:show-overflow-tooltip="true"></el-table-column>
<el-table-column
label="下单时间"
prop="createTime"
header-align="center"
align="center"
width="160"
:show-overflow-tooltip="true"></el-table-column>
<el-table-column
label="订单过期时间"
prop="expirationTime"
header-align="center"
align="center"
width="160"
:show-overflow-tooltip="true"></el-table-column>
</el-table>
</div>
<div class="pagination">
<el-pagination
layout="sizes, total, prev, pager, next, jumper"
background
:total="total"
:page-size="pageSize"
:current-page="currentPage"
@size-change="sizeChange"
@current-change="onCurrentChange"></el-pagination>
</div>
</div>
</template>
<script>
import { getUserRechargeRecordListApi } from '@/common/api/user/user'
export default {
name: 'rechargeRecord',
data() {
return {
period: [],
searchForm: {},
total: 0,
pageSize: 50,
currentPage: 1,
loading: false,
rechargeRecordList: []
}
},
async created() {
this.loadData()
},
methods: {
async loadData() {
const data = {
...this.searchForm,
currentPage: this.currentPage,
pageSize: this.pageSize
}
this.loading = true
try {
const res = await getUserRechargeRecordListApi(data)
if (res.code !== 200) return
this.rechargeRecordList = res.data.records
this.total = res.data.total
} catch (e) {
console.error(e)
} finally {
this.loading = false
}
},
search() {
this.currentPage = 1
this.loadData()
},
onCurrentChange(currentPage) {
this.currentPage = currentPage
this.loadData()
},
sizeChange(pageSize) {
this.pageSize = pageSize
this.loadData()
}
}
}
</script>
<style lang="scss" scoped>
.recharge-record {
height: 100%;
overflow: hidden;
display: flex;
flex-direction: column;
&::v-deep {
.el-table .el-table__cell {
padding: 6px 0;
}
.el-input__inner {
padding: 0 4px;
}
.el-input--small .el-input__inner {
height: 30px;
line-height: 30px;
}
.el-icon-time:before {
content: '';
}
.el-dialog__footer {
text-align: center;
.el-button--small {
padding: 9px 50px;
}
}
.el-dialog__body {
padding: 10px 20px;
}
.el-icon-edit:before {
color: #ff9800;
font-weight: bold;
}
.el-range-editor--small .el-range-separator {
line-height: 31px;
}
.header-row-class-name th {
background-color: #f8f8f9;
}
.el-input-group__append {
padding-left: 0;
}
}
}
.search {
background: #fff;
}
.table-wrap {
background: #fff;
flex: 1;
overflow: hidden;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment