Commit ea099305 authored by 智勇's avatar 智勇

操作日志

parent 67d8c438
...@@ -39,3 +39,19 @@ export function lendLoan(data) { ...@@ -39,3 +39,19 @@ export function lendLoan(data) {
data data
}) })
} }
export function callbackRecord(query) {
return request({
url: '/order/orderCallbackRecordList',
method: 'get',
params: query
})
}
export function logHistory(query) {
return request({
url: '/opt/history/log/all',
method: 'get',
params: query
})
}
import axios from 'axios' import axios from 'axios'
import { Message, MessageBox } from 'element-ui' import { Message } from 'element-ui'
import store from '../store' import store from '../store'
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
...@@ -42,27 +42,15 @@ service.interceptors.response.use( ...@@ -42,27 +42,15 @@ service.interceptors.response.use(
// 50008:非法的token; 50012:其他客户端登录了; 500003:Token 过期了; // 50008:非法的token; 50012:其他客户端登录了; 500003:Token 过期了;
if (res.code === 501002 || res.code === 500003) { if (res.code === 501002 || res.code === 500003) {
store.dispatch('FedLogOut').then(() => {
location.reload() // 为了重新实例化vue-router对象 避免bug
})
Message({ Message({
message: 'token失效,你已被登出', message: 'token失效,你已被登出',
type: 'warning', type: 'warning',
duration: 1000 duration: 2000
})
store.dispatch('FedLogOut').then(() => {
location.reload() // 为了重新实例化vue-router对象 避免bug
}) })
// MessageBox.confirm(
// '你已被登出,可以取消继续留在该页面,或者重新登录',
// '确定登出',
// {
// confirmButtonText: '重新登录',
// cancelButtonText: '取消',
// type: 'warning'
// }
// ).then(() => {
// store.dispatch('FedLogOut').then(() => {
// location.reload() // 为了重新实例化vue-router对象 避免bug
// })
// })
} }
// return Promise.reject('error') // return Promise.reject('error')
} else { } else {
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
<div class="filter-container" style="padding-bottom:20px"> <div class="filter-container" style="padding-bottom:20px">
<el-input v-model="listQuery.channelOrderNumber" placeholder="订单号" clearable style="width: 200px;" class="filter-item" @keyup.enter.native="getOrders"/> <el-input v-model="listQuery.channelOrderNumber" placeholder="订单号" clearable style="width: 200px;" class="filter-item" @keyup.enter.native="getOrders"/>
<el-input v-model="listQuery.channelId" placeholder="渠道号" clearable style="width: 200px;" class="filter-item" @keyup.enter.native="getOrders"/> <el-input v-model="listQuery.channelId" placeholder="渠道号" clearable style="width: 200px;" class="filter-item" @keyup.enter.native="getOrders"/>
<el-input v-model="listQuery.loanId" placeholder="loanId" clearable style="width: 200px;" class="filter-item" @keyup.enter.native="getOrders"/>
<el-input v-model="listQuery.applyNo" placeholder="授信申请号" clearable style="width: 200px;" class="filter-item" @keyup.enter.native="getOrders"/>
<!-- <el-select v-model="listQuery.channelId" placeholder="渠道号" clearable style="width: 200px" class="filter-item" > <!-- <el-select v-model="listQuery.channelId" placeholder="渠道号" clearable style="width: 200px" class="filter-item" >
<el-option v-for="item in channelOptions" :key="item.key" :label="item.display_name" :value="item.key"/> <el-option v-for="item in channelOptions" :key="item.key" :label="item.display_name" :value="item.key"/>
</el-select> --> </el-select> -->
...@@ -22,7 +24,9 @@ ...@@ -22,7 +24,9 @@
<el-table-column label="ID" type="index" align="center" width="65"/> <el-table-column label="ID" type="index" align="center" width="65"/>
<el-table-column sortable label="订单号" prop="channelOrderNumber" align="center"/> <el-table-column sortable label="订单号" prop="channelOrderNumber" align="center"/>
<el-table-column sortable label="渠道号" width="180" prop="channelId" align="center"/> <el-table-column label="渠道号" width="100" prop="channelId" align="center"/>
<el-table-column v-if="isShow" label="loanId" width="120" prop="loanId" align="center"/>
<el-table-column v-if="isShow" label="授信申请号" prop="applyNo" align="center"/>
<el-table-column label="创建时间" width="180" prop="createdAt" align="center"/> <el-table-column label="创建时间" width="180" prop="createdAt" align="center"/>
<el-table-column label="订单状态" width="180" prop="status" align="center"/> <el-table-column label="订单状态" width="180" prop="status" align="center"/>
...@@ -37,7 +41,7 @@ ...@@ -37,7 +41,7 @@
<el-card class="box-card" > <el-card class="box-card" >
<el-tabs v-model="activeName" type="card" @tab-click="handleClick"> <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
<el-tab-pane label="订单状态" name="first"> <el-tab-pane label="订单状态" name="orderHistory">
<el-table <el-table
ref="orderTable" ref="orderTable"
:data="orderHistory" :data="orderHistory"
...@@ -50,8 +54,49 @@ ...@@ -50,8 +54,49 @@
</el-table> </el-table>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="通知记录" name="second">通知记录</el-tab-pane> <el-tab-pane label="通知记录" name="callbackRecords">
<el-table
:data="callbackRecords"
fit
highlight-current-row
style="margin-bottom:20px">
<el-table-column label="订单号" prop="channelOrderNo" align="center"/>
<el-table-column label="期数" prop="termNo" align="center"/>
<el-table-column label="通知类型" prop="noticeType" align="center"/>
<el-table-column label="状态枚举值" prop="callbackStatus" align="center"/>
<el-table-column label="重试次数" prop="retryTimes" align="center"/>
<el-table-column label="失败原因" prop="failCode" align="center"/>
<el-table-column label="是否活跃" prop="isActive" align="center"/>
<el-table-column label="其他数据" prop="exdata" align="center"/>
<el-table-column label="通知结果" prop="tableName" align="center"/>
<el-table-column label="创建时间" prop="createdAt" align="center"/>
<el-table-column label="修改时间" prop="updatedAt" align="center"/>
</el-table>
</el-tab-pane>
<el-tab-pane label="还款计划" name="third">还款计划</el-tab-pane> <el-tab-pane label="还款计划" name="third">还款计划</el-tab-pane>
<el-tab-pane label="操作日志" name="logHistory">
<el-table
:data="logHistory"
fit
highlight-current-row
style="margin-bottom:20px">
<el-table-column label="订单号" prop="channelOrderNumber" align="center"/>
<el-table-column label="操作" prop="optName" align="center"/>
<el-table-column label="操作员" prop="optUser" align="center"/>
<el-table-column label="日志详细" prop="optLogDetail" align="center"/>
<el-table-column label="操作结果" prop="optResult" align="center">
<template slot-scope="scope">
<el-tag >{{ scope.row.optResult | statusFilter }}</el-tag>
</template>
</el-table-column>
<el-table-column label="创建时间" prop="createTime" align="center"/>
</el-table>
</el-tab-pane>
</el-tabs> </el-tabs>
</el-card> </el-card>
...@@ -98,16 +143,26 @@ ...@@ -98,16 +143,26 @@
</template> </template>
<script> <script>
import { getOrders, getOrderHistory, approve, cancelLoan, lendLoan } from '@/api/order' import { getOrders, getOrderHistory, approve, cancelLoan, lendLoan, callbackRecord, logHistory } from '@/api/order'
import Pagination from '@/components/Pagination' import Pagination from '@/components/Pagination'
import store from '@/store'
export default { export default {
components: { Pagination }, components: { Pagination },
filters: { filters: {
statusFilter(status) {
const statusMap = {
true: '成功',
false: '失败'
}
return statusMap[status]
}
}, },
data() { data() {
return { return {
activeName: 'first', activeName: 'orderHistory',
roles: [],
isShow: true,
dialogTitle: '', dialogTitle: '',
count: 1, count: 1,
page: 1, page: 1,
...@@ -120,7 +175,9 @@ export default { ...@@ -120,7 +175,9 @@ export default {
opt: '', opt: '',
orders: [], orders: [],
order: {}, order: {},
callbackRecords: [],
orderHistory: [], orderHistory: [],
logHistory: [],
approveData: {}, approveData: {},
typeOptions: [ typeOptions: [
{ key: '0', display_name: '存管' }, { key: '0', display_name: '存管' },
...@@ -139,6 +196,8 @@ export default { ...@@ -139,6 +196,8 @@ export default {
}, },
created() { created() {
this.getOrders() this.getOrders()
this.roles = store.getters.roles
this.isShow = !!this.roles.includes('admin')
}, },
methods: { methods: {
getOrders() { getOrders() {
...@@ -164,10 +223,8 @@ export default { ...@@ -164,10 +223,8 @@ export default {
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.orderHistory = [] this.order = val
getOrderHistory({ channelOrderNumber: val.channelOrderNumber }).then(res => { this.handleClick()
this.orderHistory = res.data.historyStatus
})
}, },
handleOption(data, opt) { handleOption(data, opt) {
...@@ -230,22 +287,37 @@ export default { ...@@ -230,22 +287,37 @@ export default {
this.$notify({ this.$notify({
title: res.message, title: res.message,
type: 'success', type: 'success',
duration: 1000 duration: 5000
}) })
} else { } else {
this.$notify({ this.$notify({
title: res.message, title: res.message,
type: 'error', type: 'error',
duration: 2000 duration: 5000
}) })
} }
this.getOrders() this.getOrders()
}).catch(() => {
}) })
this.dialogFormVisible = false this.dialogFormVisible = false
}, },
handleClick() { handleClick() {
if (this.activeName === 'orderHistory') {
getOrderHistory({ channelOrderNumber: this.order.channelOrderNumber }).then(res => {
this.orderHistory = res.data.historyStatus
})
}
if (this.activeName === 'callbackRecords') {
callbackRecord({ channelOrderNumber: this.order.channelOrderNumber }).then(res => {
this.callbackRecords = res.data
})
}
if (this.activeName === 'logHistory') {
logHistory({ channelOrderNumber: this.order.channelOrderNumber }).then(res => {
this.logHistory = res.data
})
}
} }
} }
} }
......
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