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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
<template>
    <div class="menuPage clearfix">
        <el-form :inline="true"
                 :model="searchData"
                 class="form-inline">
            <el-form-item label="机构通道">
                <el-select v-model="searchData.channelId"
                           placeholder="请选择"
                           clearable>
                    <el-option v-for="item in institutionList"
                               :key="item.channelId"
                               :label="item.channelName"
                               :value="item.channelId">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="支付公司">
                <el-select v-model="searchData.companyId"
                           placeholder="请选择"
                           clearable>
                    <el-option v-for="item in companyList"
                               :key="item.companyId"
                               :label="item.payCompany"
                               :value="item.companyId">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="交易名称">
                <el-select v-model="searchData.transType"
                           placeholder="请选择"
                           clearable>
                    <el-option v-for="item in transTypeList"
                               :key="item.id"
                               :label="item.value"
                               :value="item.id">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="卡类型">
                <el-select v-model="searchData.cardType"
                           placeholder="请选择"
                           clearable>
                    <el-option v-for="item in cardTypeList"
                               :key="item.id"
                               :label="item.value"
                               :value="item.id">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item class="search">
                <el-button @click="search"
                           type="primary">查询</el-button>
                <el-button @click="reset">重置</el-button>
            </el-form-item>
        </el-form>
        <div class="channelMenu">
            <div class="add">
                <el-button @click="add">新增</el-button>
            </div>
            <el-table :data="menuItems"
                      v-loading="loading"
                      border
                      class="table">
                <el-table-column prop="feeId"
                                 align="center"
                                 label="费率编号">
                </el-table-column>
                <el-table-column prop="channelName"
                                 align="center"
                                 label="通道名称">
                </el-table-column>
                <el-table-column prop="institution"
                                 align="center"
                                 label="接入机构">
                </el-table-column>
                <el-table-column prop="payCompany"
                                 align="center"
                                 label="支付公司">
                </el-table-column>
                <el-table-column prop="transType"
                                 align="center"
                                 label="交易名称">
                    <template slot-scope="scope">
                        <span>{{enumerMap(scope.row.transType,'transType')}}</span>
                    </template>
                </el-table-column>
                <el-table-column prop="cardType"
                                 align="center"
                                 label="卡类型">
                    <template slot-scope="scope">
                        <span>{{enumerMap(scope.row.cardType,'cardType')}}</span>
                    </template>
                </el-table-column>
                <el-table-column prop="status"
                                 align="center"
                                 label="状态">
                    <template slot-scope="scope">
                        <span>{{enumerMap(scope.row.status,'status')}}</span>
                    </template>
                </el-table-column>
                <el-table-column align="center"
                                 width="250"
                                 label="操作">
                    <template slot-scope="scope">
                        <el-button size="mini"
                                   @click="edit(scope.row.feeId)">编辑</el-button>
                        <el-button size="mini"
                                   @click="view(scope.row.feeId)">查看</el-button>
                        <el-button size="mini" type="danger"
                                   @click="deleteConfirm(scope.row)">删除</el-button>
 
                    </template>
                </el-table-column>
            </el-table>
 
            <el-pagination @current-change="handleCurrentChange"
                            :current-page="currentPage"
                           layout="total,prev, pager, next, jumper"
                           background
                           style="margin-top: 10px;"
                           :total.sync="totalPage">
            </el-pagination>
        </div>
 
        <my-mask v-model="maskShow"
                 v-on:hide="hideMask"
                 :clickType="type"
                 :feeId="feeId"></my-mask>
    </div>
</template>
 
<script>
import { mapGetters, mapMutations } from "vuex";
import MyMask from "./Mask";
import { Message } from "element-ui";
 
export default {
    data() {
        return {
            maskShow: false,
            menuItems: [],
            searchData: {
                channelId: "",
                companyId: "",
                cardType: "",
                transType: ""
            },
            type: "",
            feeId: "",
            companyList: "",
            institutionList: "",
            transTypeList: [
                { value: "所有", id: "" },
                { value: "二要素", id: "105" },
                { value: "三要素", id: "101" },
                { value: "四要素", id: "102" },
                { value: "四要素+短信", id: "103" },
                { value: "五要素+签约", id: "104" },
                { value: "单笔代扣", id: "301" },
                { value: "批量代扣", id: "302" },
                { value: "单笔代付", id: "201" },
                { value: "批量代付", id: "202" },
                { value: "协议代扣", id: "303" }
            ],
            cardTypeList: [
                { value: "所有", id: "" },
                { value: "借记卡", id: 0 },
                { value: "贷记卡", id: 1 }
            ],
            trueMenuItems: [],
            currentPage: 1,
            totalPage: 1,
            loading: false
        };
    },
    props: ["Data", "channelData"],
    created() {
        this.getAllData();
        this.getMenuData();
    },
 
    watch: {
        maskShow: function (n) {
            if (n) return;
            this.getMenuData()
        }
    },
    components: {
        MyMask
    },
    methods: {
        // 获取机构数据
        getInstitutionsData() {
            return this.$http.post('channel/getChannels',{companyId: "",institutionId: ""})
        },
        // 获取公司数据
        getCompanyData() {
            return this.$http.get("manage/getCompanys");
        },
        // 获取表单数据
        getMenuData() {
            const that = this;
            this.loading = true
            this.$http.post(`transFee/getFees/`,that.searchData).then(Menu => {
                    if (Menu.data.retHeader.retCode === '0000') {
                        this.loading = false
                        if (Menu.data.length == 0) {
                            // Message.error("暂时没有数据");
                            that.menuItems = []
                        } else {
                            that.trueMenuItems = Menu.data.retBody;
                            if (Menu.data.retBody.length >= 10) {
                                that.menuItems = Menu.data.retBody.slice(0, 10);
                                that.handleCurrentChange(that.currentPage);
                            } else {
                                that.menuItems = Menu.data.retBody;
                            }
                            that.totalPage = parseInt(Menu.data.retBody.length);
                        }
                    } else {
                        this.loading = false
                        that.menuItems = []
                        that.totalPage = 0
                        this.$message.error(Menu.data.retHeader.retMessage)
                    }
                });
        },
        // 并发请求
        getAllData() {
            const that = this;
            this.Axios.all([this.getInstitutionsData(), this.getCompanyData()])
                .then(
                    this.Axios.spread(function (Institutions, Company) {
                        that.companyList = Company.data;
                        that.institutionList = Institutions.data.retBody;
                    })
                )
                .catch(err => {
                    console.log(err);
                });
        },
        // 查看
        view(id) {
            this.maskShow = true;
            this.type = "view";
            this.feeId = id;
        },
        // 编辑
        edit(id) {
            this.maskShow = true;
            this.type = "edit";
            this.feeId = id;
        },
        // 新增
        add() {
            this.type = "add";
            this.maskShow = true;
        },
        // 删除
        deleteConfirm(row){
            this.$confirm('是否确定删除该数据?', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning'
            }).then(() => {
                this.$http.post(`transFee/deleteFee`,{feeId:row.feeId}).then(response => {
                    if (response.data.retHeader.retCode === '0000') {
                        this.$message.success(response.data.retHeader.retMessage)
                        this.getMenuData();
                    } else {
                        this.$message.error(response.data.retHeader.retMessage)
                    }
                })
            }).catch(() => {       
            });
        },
        // 查询 
        search() {
            this.getMenuData();
        },
        // 重置
        reset() {
            this.searchData = {
                channelId: "",
                companyId: "",
                cardType: "",
                transType: ""
            };
            this.currentPage = 1
            this.getMenuData();
        },
        // 隐藏mask
        hideMask() {
            this.maskShow = false;
        },
 
        // 点击分页
        handleCurrentChange(val) {
            this.currentPage = val;
            const start = (val - 1) * 10;
            if (parseInt(start) + 10 <= this.trueMenuItems.length) {
                const end = parseInt(start) + 10;
                this.menuItems = this.trueMenuItems.slice(start, end);
            } else {
                this.menuItems = this.trueMenuItems.slice(start);
            }
        }
    }
};
</script>
 
<style lang="less" scoped>
table {
  width: 100%;
  > tr {
    width: 100%;
    &:first-child {
      > td {
        background-color: #333333;
        color: white;
      }
    }
    td {
      padding: 6px;
      text-align: center;
      font-size: 14px;
      > a {
        color: blue;
        font-size: 14px;
      }
    }
  }
}
.menuPage {
  width: 100%;
  padding: 0px 0px;
  overflow: hidden;
  .selectOptions {
    width: 60%;
    overflow: hidden;
    border-bottom: 1px solid #eee;
    .subMenuItem {
      width: 50%;
      float: left;
      padding: 8px 0px;
      color: black;
      > span {
        display: inline-block;
        font-size: 14px;
        width: 26%;
        height: 100%;
        text-align: right;
      }
    }
  }
  .selectBtn {
    width: 60%;
    height: 100%;
    padding: 10px 0px;
    .center {
      margin-left: 50%;
      transform: translateX(-50%);
      > button {
        padding: 8px 23px;
        margin-right: 20px;
      }
    }
  }
  .channelMenu {
    width: 100%;
    margin-top: 20px;
    .channelMenuTitle {
      width: 100%;
      height: 30px;
      > div {
        height: 100%;
        float: left;
        background-color: #333333;
        border: 1px solid #999;
        line-height: 30px;
        text-align: center;
        color: white;
        font-size: 14px;
        width: 12.5%;
        margin-right: -1px;
      }
    }
    .add {
      margin: 20px 0px;
    }
    .channelMenuContent {
      width: 100%;
      .contentItem {
        width: 100%;
        height: 36px;
        > .contentValue {
          float: left;
          width: 12.5%;
          height: 36px;
          border: 1px solid #797979;
          border-top: none;
          text-align: center;
          line-height: 36px;
          background-color: #fff;
          margin-right: -1px;
          > a {
            display: inline-block;
            border: 1px solid #eee;
            background-color: #66b1ff;
            width: 50px;
            height: 30px;
            border-radius: 6px;
            outline: none;
            font-size: 14px;
            line-height: 30px;
          }
        }
      }
    }
  }
}
</style>