<template>
|
<div class="static">
|
<el-dialog title="失败分析"
|
width="80%"
|
ref="dialog"
|
id="analysis"
|
@close="close"
|
:visible.sync="dialogVisible">
|
<div class="clearfix">
|
<div class="title">
|
<span>支付公司: {{payCompany}}</span>
|
<span>商户号: {{info.merId}}</span>
|
<span>交易: {{enumerMap(info.transType,'transType')}}</span>
|
<span>笔数: {{info.failCount}}</span>
|
</div>
|
<el-table :data="tableData.list"
|
v-loading="loading"
|
border
|
class="table">>
|
<el-table-column prop="retCode"
|
align="center"
|
min-width="30"
|
label="返回代码">
|
</el-table-column>
|
<el-table-column prop="retMessage"
|
align="center"
|
label="描述">
|
</el-table-column>
|
<el-table-column prop="failCount"
|
align="center"
|
min-width="30"
|
label="交易笔数">
|
</el-table-column>
|
<el-table-column prop="proportion"
|
align="center"
|
min-width="20"
|
label="占比">
|
<template slot-scope="scope">
|
<span>{{scope.row.proportion + "%"}}</span>
|
</template>
|
</el-table-column>
|
<el-table-column align="center"
|
min-width="20"
|
fixed="right"
|
label="操作">
|
<template slot-scope="scope">
|
<el-button size="mini" @click="detail(scope.row)">详情</el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
|
<el-pagination @current-change="handleCurrentChange"
|
layout="total,prev, pager, next, jumper"
|
style="margin: 10px 0px;"
|
background
|
:total.sync="tableData.totalSize">
|
</el-pagination>
|
</div>
|
</el-dialog>
|
|
<analysis-detail v-model="detailFlag"
|
:payCompany="payCompany"
|
:failInfo="failInfo"
|
:info="info"></analysis-detail>
|
</div>
|
</template>
|
|
<script>
|
import AnalysisDetail from "./AnalysisDetail";
|
import { staticAnaly } from "@/assets/api/api";
|
|
export default {
|
name: "staticAnalys",
|
|
props: {
|
value: {
|
type: String,
|
default: ""
|
},
|
statisticNo: {
|
type: String,
|
default: ""
|
},
|
info: {
|
type: Object,
|
default() {
|
return {};
|
}
|
},
|
payCompany: {
|
type: String,
|
default: ""
|
}
|
},
|
|
components: {
|
AnalysisDetail
|
},
|
|
data() {
|
return {
|
dialogVisible: false,
|
tableData: [],
|
loading: false,
|
detailFlag: "",
|
searchData: {
|
statisticNo: null,
|
page: 1,
|
pageSize: 10
|
},
|
failInfo: {}
|
};
|
},
|
|
watch: {
|
value: async function (n) {
|
this.dialogVisible = n === "analysis" ? true : false;
|
if (this.dialogVisible) {
|
this.searchData.statisticNo = this.statisticNo
|
let res = await staticAnaly(this.searchData);
|
if (res.data.retHeader.retCode === '0000') {
|
this.tableData = res.data.retBody;
|
} else {
|
this.tableData = { totalSize: 0, list: [] }
|
}
|
}
|
}
|
},
|
|
methods: {
|
// 关闭
|
close() {
|
this.$emit("input", "");
|
},
|
|
// 分页
|
async handleCurrentChange(val) {
|
this.searchData.page = val
|
let res = await staticAnaly(this.searchData);
|
this.tableData = res.data.retBody;
|
},
|
|
async detail(params) {
|
this.failInfo = params;
|
this.detailFlag = "analysisDetail";
|
}
|
|
}
|
};
|
</script>
|
|
<style lang="less" scoped>
|
#analysis {
|
.title {
|
width: 100%;
|
line-height: 40px;
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
}
|
}
|
</style>
|