<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.institutionId" placeholder="请选择" clearable>
|
<el-option
|
v-for="item in institutionList"
|
:key="item.institutionId"
|
:label="item.institution"
|
:value="item.institutionId"
|
></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-input v-model="searchData.merId"
|
placeholder="请输入商户号"
|
style="width: 197px;"></el-input>
|
</el-form-item>
|
<el-form-item label="终端号">
|
<el-input v-model="searchData.termId"
|
placeholder="请输入终端号"
|
style="width: 197px;"></el-input>
|
</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>
|
<div class="channelMenuContent">
|
<el-table :data="menuItems" v-loading="loading">
|
<el-table-column label="支付通道" prop="channelName" align="center" min-width="100"></el-table-column>
|
<el-table-column label="接入机构" prop="institution" align="center" min-width="100"></el-table-column>
|
<el-table-column label="商户号" prop="merId" align="center" min-width="150"></el-table-column>
|
<el-table-column label="终端号" prop="termId" align="center" min-width="150"></el-table-column>
|
<el-table-column label="支付公司" prop="payCompany" align="center" min-width="100"></el-table-column>
|
<el-table-column label="状态" prop="status" align="center" min-width="100"></el-table-column>
|
<el-table-column label="创建人" prop="creater" align="center" min-width="120"></el-table-column>
|
<el-table-column label="创建时间" prop="createTime" align="center" min-width="150"></el-table-column>
|
<el-table-column label="操作" align="center" fixed="right" min-width="160">
|
<template slot-scope="scope">
|
<el-button size="mini" @click="edit(scope.row.channelId)">编辑</el-button>
|
<el-button size="mini" @click="view(scope.row.channelId)">查看</el-button>
|
<!-- <el-button size="mini"
|
@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>
|
</div>
|
<el-dialog :visible.sync="showMask" width="80%" @close="hideMask">
|
<p slot="title">编辑</p>
|
<my-mask
|
:dataId="maskId"
|
:clickType="type"
|
:showMask="showMask"
|
:companySelect="companyList"
|
:institutionSelect="institutionList"
|
v-on:hide="hideMask"
|
></my-mask>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script>
|
import { mapGetters, mapMutations } from "vuex";
|
import MyMask from "./Mask";
|
|
export default {
|
data() {
|
return {
|
showMask: false,
|
type: "",
|
maskId: "",
|
searchData: {
|
companyId: "",
|
institutionId: ""
|
},
|
institutionList: "",
|
companyList: "",
|
menuItems: [],
|
totalPage: 1,
|
currentPage: 1,
|
trueMenuItems: "",
|
loading: false
|
};
|
},
|
props: ["channelData"],
|
created() {
|
this.getMenuData();
|
},
|
components: {
|
MyMask
|
},
|
|
watch: {
|
showMask: function (n) {
|
if (n) return;
|
this.getMenuData()
|
}
|
},
|
|
computed: {
|
...mapGetters(["getMenu"])
|
},
|
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('channel/getChannels', { ...this.searchData })
|
.then(response => {
|
if (response.data.retHeader.retCode === '0000') {
|
this.showMask = false;
|
this.loading = false;
|
that.trueMenuItems = response.data.retBody;
|
if (that.trueMenuItems.length >= 10) {
|
that.menuItems = that.trueMenuItems.slice(0, 10);
|
} 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)
|
}
|
})
|
.catch(err => {
|
this.loading = false;
|
console.log(err);
|
});
|
},
|
// axios并发请求
|
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;
|
})
|
)
|
.catch(err => {
|
console.log(err);
|
});
|
},
|
// 查看
|
view(id) {
|
this.showMask = true;
|
this.type = "view";
|
this.maskId = id;
|
},
|
// 编辑
|
edit(id) {
|
this.type = "edit";
|
this.maskId = id;
|
this.showMask = true;
|
},
|
// 新增
|
add() {
|
this.showMask = true;
|
this.type = "add";
|
},
|
// 删除
|
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();
|
},
|
// 隐藏蒙版
|
hideMask() {
|
this.showMask = false;
|
this.currentPage = 1
|
// this.getMenuData();
|
},
|
// 重置
|
reset() {
|
this.searchData = {
|
companyId: "",
|
institutionId: ""
|
};
|
this.currentPage = 1
|
this.getMenuData();
|
},
|
|
// 点击分页
|
handleCurrentChange(val) {
|
this.currentPage = val
|
const start = (val - 1) * 10;
|
const end = parseInt(start) + 10;
|
this.menuItems = this.trueMenuItems.slice(start, end);
|
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%;
|
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>
|