zhaoxiaoqiang1
2026-01-04 f1d30d03186c79ca2cbcfe60d6d2ce7d73fba97b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<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>