<template>
|
<div class="menuPage">
|
<el-form :inline="true"
|
:model="searchData"
|
class="form-inline">
|
<el-form-item label="支付通道">
|
<el-select v-model="searchData.channelId"
|
clearable
|
placeholder="请选择">
|
<el-option v-for="item in channelData"
|
: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"
|
clearable
|
placeholder="请选择">
|
<el-option v-for="item in companyArr"
|
: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 transType"
|
:key="item.value"
|
:label="item.value"
|
:value="item.id">
|
</el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item label="银行名称">
|
<el-select v-model="searchData.bankId" filterable
|
placeholder="请选择"
|
clearable>
|
<el-option v-for="item in bank"
|
:key="item.bankId"
|
:label="item.bankName"
|
:value="item.bankId">
|
</el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item >
|
<el-button @click="search"
|
class="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"
|
v-if="isJump">新增</el-button>
|
</div>
|
<el-table :data="menuItems"
|
v-loading="loading"
|
border
|
class="table">
|
<el-table-column prop="channelName"
|
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="bankName"
|
align="center"
|
label="银行名称">
|
</el-table-column>
|
<el-table-column prop="isAllow"
|
align="center"
|
label="决策方向">
|
<template slot-scope="scope">
|
<span>{{enumerMap(scope.row.isAllow,'isAllow')}}</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 prop="amountPt"
|
align="center"
|
label="单笔限额">
|
</el-table-column>
|
<el-table-column prop="amountPd"
|
align="center"
|
label="单日限额">
|
|
</el-table-column>
|
<el-table-column prop="amountPm"
|
align="center"
|
label="单月限额">
|
|
</el-table-column>
|
<el-table-column prop="timesPd"
|
align="center"
|
label="单日限次">
|
|
</el-table-column>
|
<el-table-column align="center"
|
width="250px"
|
label="操作">
|
<template slot-scope="scope">
|
<el-button size="mini"
|
@click="view(scope.row.bankLimid)">查看</el-button>
|
<el-button size="mini"
|
@click="edit(scope.row.bankLimid)">编辑</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="showMask"
|
v-on:isCancel="hideMask"
|
:clickType="type"
|
:detailData="maskData"
|
:bankSelect="bank" :channelDataMask="channelData"></my-mask>
|
</div>
|
</template>
|
|
<script>
|
import { mapGetters } from "vuex";
|
import MyMask from "./Mask";
|
|
export default {
|
data() {
|
return {
|
isJump: true,
|
menuItems: [],
|
searchData: {channelId:"", channelName: "", bankId: "", companyId: "", transType: "", companyId: "" },
|
transType: [
|
{ value: "鉴权", id: "100" },
|
{ value: "批量代扣", id: "302" },
|
{ value: "协议代扣", id: "303" },
|
{ value: "单笔代扣", id: "301" },
|
{ value: "代付", id: "200" }
|
],
|
loading: false,
|
companyArr: [],
|
bank: [],
|
channelData: [],
|
showMask: false,
|
type: "",
|
maskData: {},
|
trueMenuItems: "",
|
currentPage: 1,
|
totalPage: 1
|
};
|
},
|
props: ["bankLimid","is_mask"],
|
components: {
|
MyMask
|
},
|
created() {
|
this.getMenuData();
|
this.getAllData();
|
this.getChannelData()
|
},
|
computed: {
|
...mapGetters(["getMenu"])
|
},
|
watch: {
|
getMenu: function (now, old) {
|
this.getMenuData();
|
},
|
showMask: function (n) {
|
if (n) return;
|
this.getMenuData()
|
},
|
is_mask(n) {
|
if(!n) return;
|
this.isJump = false;
|
this.$http
|
.post("bankLimit/getBankLimit", { bankLimid: this.bankLimid })
|
.then(Menu => {
|
if(Menu.data.retHeader.retCode==="0000"){
|
this.trueMenuItems = [Menu.data.retBody];
|
this.menuItems = [Menu.data.retBody];
|
this.loading = false
|
this.totalPage = this.menuItems.length;
|
}else{
|
this.$message.error(Menu.data.retHeader.retMessage)
|
}
|
});
|
}
|
},
|
methods: {
|
// 获取机构数据
|
getBankData() {
|
return this.$http.get("manage/getBankCodes");
|
},
|
// 获取公司数据
|
getCompanyData() {
|
return this.$http.get("manage/getCompanys");
|
},
|
// 获取菜单数据
|
getMenuData(isSearch) {
|
if(this.bankLimid && this.bankLimid != "" && !isSearch) return;
|
this.loading = true
|
this.isJump = true;
|
const that = this;
|
this.$http
|
.post("bankLimit/getBankLimits/", this.searchData)
|
.then(Menu => {
|
if(Menu.data.retHeader.retCode==="0000"){
|
that.trueMenuItems = Menu.data.retBody;
|
if (that.trueMenuItems.length >= 10) {
|
that.menuItems = that.trueMenuItems.slice(0, 10);
|
that.handleCurrentChange(that.currentPage);
|
} else {
|
that.menuItems = that.trueMenuItems;
|
}
|
that.loading = false
|
that.totalPage = parseInt(Menu.data.retBody.length);
|
}else{
|
that.loading = false
|
that.menuItems = []
|
that.totalPage = 0
|
this.$message.error(Menu.data.retHeader.retMessage)
|
}
|
})
|
.catch(err => {
|
that.loading = false
|
console.log(err);
|
});
|
},
|
// axios并发请求
|
getAllData() {
|
const that = this;
|
this.Axios.all([this.getBankData(), this.getCompanyData()])
|
.then(
|
this.Axios.spread(function (bank, Company) {
|
that.companyArr = Company.data;
|
that.bank = bank.data;
|
})
|
)
|
.catch(err => {
|
console.log(err);
|
});
|
},
|
// 查看
|
view(id) {
|
this.mapDetail(id);
|
this.showMask = true;
|
this.type = "view";
|
},
|
// 编辑
|
edit(id) {
|
this.mapDetail(id);
|
this.showMask = true;
|
this.type = "edit";
|
},
|
// 新增
|
add() {
|
this.showMask = true;
|
this.type = "add";
|
},
|
// 删除
|
deleteConfirm(row){
|
this.$confirm('是否确定删除该数据?', '提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
this.$http.post(`bankLimit/deleteBankLimit`,{bankLimid:row.bankLimid}).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.$route.params.data = null;
|
this.getMenuData(true);
|
},
|
|
// 重置
|
reset() {
|
this.searchData = {
|
bankId: "",
|
companyId: "",
|
transType: ""
|
};
|
this.currentPage = 1
|
this.getMenuData();
|
},
|
|
// 数据详情表单对应关系
|
mapDetail(id) {
|
for (var i = 0; i < this.trueMenuItems.length; i++) {
|
if (id == this.trueMenuItems[i].bankLimid) {
|
this.maskData = JSON.parse(JSON.stringify(this.trueMenuItems[i]));
|
}
|
}
|
},
|
// 隐藏蒙版
|
hideMask() {
|
this.getMenuData();
|
this.showMask = 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);
|
}
|
},
|
// 获取机构数据
|
getChannelData() {
|
this.$http
|
.post("/channel/getChannels", { institutionId: "", companyId: "" })
|
.then(response => {
|
if (response.data.retHeader.retCode === '0000') {
|
this.channelData = response.data.retBody;
|
} else {
|
this.$message.error(response.data.retHeader.retMessage)
|
}
|
})
|
.catch(err => {
|
console.log(err);
|
});
|
},
|
}
|
};
|
</script>
|
|
<style lang="less" scoped>
|
.add {
|
margin: 20px 0px;
|
}
|
.menuPage {
|
width: 100%;
|
padding: 0px 0px;
|
overflow: hidden;
|
|
.selectMenu {
|
width: 100%;
|
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;
|
border-top: 1px solid #ccc;
|
.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;
|
}
|
}
|
.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;
|
}
|
}
|
}
|
}
|
}
|
}
|
</style>
|