<template>
|
<div class="menuPage">
|
<div class="selectMenu">
|
<el-form :inline="true"
|
:model="searchData"
|
class="form-inline">
|
<el-form-item label="支付公司">
|
<el-select v-model="searchData.companyId"
|
placeholder="请选择"
|
clearable>
|
<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 institutionArr"
|
: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"
|
border
|
v-loading="loading"
|
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="交易类型">
|
</el-table-column>
|
<el-table-column prop="successRate"
|
align="center"
|
label="成功要求率">
|
</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 prop="timesPm"
|
align="center"
|
label="单月限次">
|
</el-table-column>
|
<el-table-column align="center"
|
width="250"
|
label="操作">
|
<template slot-scope="scope">
|
<el-button size="mini"
|
@click="edit(scope.row.channelLimid)">编辑</el-button>
|
<el-button size="mini"
|
@click="view(scope.row.channelLimid)">查看</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>
|
</div>
|
<my-mask v-on:showMask="hideMask"
|
v-model="isShowMask"
|
:detailData="maskData"
|
:clickType="type"></my-mask>
|
</div>
|
</template>
|
|
<script>
|
import { mapGetters, mapMutations } from "vuex";
|
import MyMask from "./Mask";
|
|
export default {
|
data() {
|
return {
|
isShowMask: false,
|
menuItems: [],
|
searchData: {
|
companyId: "",
|
transType: "",
|
cardType: ""
|
},
|
companyArr: "",
|
institutionArr: [
|
{ value: "鉴权", id: "100" },
|
{ value: "代扣", id: "300" },
|
{ value: "代付", id: "200" }
|
],
|
maskData: "",
|
type: "",
|
trueMenuItems: "",
|
currentPage: 1,
|
totalPage: 1,
|
loading: false
|
};
|
},
|
props: ["queryChannelRespDto"],
|
components: {
|
MyMask
|
},
|
|
watch: {
|
isShowMask: function (n) {
|
if (n) return;
|
this.getMenuData()
|
}
|
},
|
created() {
|
this.getAllData();
|
this.getMenuData();
|
},
|
methods: {
|
// 获取机构数据
|
getInstitutionsData() {
|
return this.$http.get("manage/getInstitutions");
|
},
|
// 获取公司数据
|
getCompanyData() {
|
return this.$http.get("manage/getCompanys");
|
},
|
// 获取表单数据
|
getMenuData() {
|
const that = this;
|
this.loading = true
|
this.$http.post("/channelLimit/getChannelLimits", this.searchData).then(response => {
|
if (response.data.retHeader.retCode === '0000') {
|
this.loading = false
|
that.trueMenuItems = response.data.retBody;
|
if (that.trueMenuItems.length >= 10) {
|
that.menuItems = that.trueMenuItems.slice(0, 10);
|
that.handleCurrentChange(that.currentPage);
|
} else {
|
that.menuItems = that.trueMenuItems;
|
}
|
that.menuItems = JSON.parse(JSON.stringify(that.menuItems));
|
that.$mapData(that.menuItems);
|
that.totalPage = parseInt(response.data.retBody.length);
|
} else {
|
this.loading = false
|
that.menuItems = []
|
that.totalPage = 0
|
this.$message.error(response.data.retHeader.retMessage)
|
}
|
});
|
},
|
// axios并发请求
|
getAllData() {
|
const that = this;
|
this.Axios.all([this.getCompanyData()])
|
.then(
|
this.Axios.spread(function (Company) {
|
that.companyArr = Company.data;
|
})
|
)
|
.catch(err => {
|
console.log(err);
|
});
|
},
|
|
// 查看
|
view(id) {
|
this.mapView(id);
|
this.isShowMask = true;
|
this.type = "view";
|
},
|
// 编辑
|
edit(id) {
|
this.mapView(id);
|
this.isShowMask = true;
|
this.type = "edit";
|
},
|
// 新增
|
add() {
|
this.isShowMask = true;
|
this.type = "add";
|
},
|
// 删除
|
deleteConfirm(row){
|
this.$confirm('是否确定删除该数据?', '提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
this.$http.post(`channelLimit/deleteChannelLimit`,{channelLimid:row.channelLimid}).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 = {
|
companyId: "",
|
transType: "",
|
cardType: ""
|
};
|
this.currentPage = 1
|
this.getMenuData();
|
},
|
// 隐藏蒙版
|
hideMask() {
|
this.isShowMask = false;
|
},
|
|
// 查看编辑数据对应
|
mapView(id, type) {
|
for (var i = 0; i < this.trueMenuItems.length; i++) {
|
if (id == this.trueMenuItems[i].channelLimid) {
|
this.maskData = this.trueMenuItems[i];
|
}
|
}
|
},
|
// 分页
|
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);
|
}
|
this.$mapData(this.menuItems);
|
}
|
}
|
};
|
</script>
|
|
<style lang="less" scoped>
|
.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%;
|
overflow: hidden;
|
.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>
|