<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>
|