<template>
|
<div class="menuPage">
|
<div class="selectMenu">
|
<el-form
|
:inline="true"
|
:model="searchData"
|
class="form-inline"
|
label-width="100px"
|
>
|
<el-form-item label="客户名称">
|
<el-input
|
placeholder="请输入客户姓名"
|
v-model="searchData.acctName"
|
clearable
|
style="width: 197px"
|
></el-input>
|
</el-form-item>
|
<el-form-item label="放款银行账号">
|
<el-input
|
placeholder="请输入银行卡号"
|
v-model="searchData.acctNo"
|
clearable
|
style="width: 197px"
|
>
|
</el-input>
|
</el-form-item>
|
<el-form-item label="放款状态">
|
<el-select v-model="searchData.status" placeholder="请选择" clearable filterable >
|
<el-option
|
v-for="item in loanList"
|
:key="item.value"
|
:label="item.label"
|
:value="item.value"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item label="放款日期" prop="checkDate">
|
<el-date-picker
|
v-model="searchData.checkDate"
|
type="daterange"
|
range-separator="至"
|
start-placeholder="开始日期"
|
end-placeholder="结束日期"
|
value-format="yyyy-MM-dd"
|
>
|
</el-date-picker>
|
</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="acctName"
|
align="center"
|
min-width="100"
|
></el-table-column>
|
<el-table-column
|
label="证件号码"
|
prop="idNo"
|
align="center"
|
min-width="150"
|
></el-table-column>
|
<el-table-column
|
label="放款银行账户"
|
prop="acctNo"
|
align="center"
|
min-width="150"
|
></el-table-column>
|
<el-table-column
|
label="放款日期"
|
prop="putoutDate"
|
align="center"
|
min-width="100"
|
></el-table-column>
|
<el-table-column
|
label="放款金额"
|
prop="amount"
|
align="center"
|
min-width="100"
|
>
|
|
<template slot-scope="scope">
|
{{formatMoney(scope.row.amount)}}
|
</template>
|
|
</el-table-column>
|
|
<el-table-column
|
label="放款状态"
|
prop="status"
|
align="center"
|
min-width="100"
|
>
|
<template slot-scope="scope">
|
{{loanMap[scope.row.status]}}
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="放款结果"
|
prop="transResult"
|
align="center"
|
min-width="100"
|
></el-table-column>
|
<el-table-column
|
label="操作人"
|
prop="operateBy"
|
align="center"
|
min-width="120"
|
></el-table-column>
|
<el-table-column
|
label="操作时间"
|
prop="operateDate"
|
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"
|
:disabled="!(scope.row.status == 400 || scope.row.status == 500)"
|
@click="rePutout(scope.row)"
|
>重新放款</el-button
|
>
|
</template>
|
</el-table-column>
|
</el-table>
|
|
<el-pagination
|
@current-change="handleCurrentChange"
|
:current-page="currentPage"
|
:page-size="10"
|
layout="total,prev, pager, next, jumper"
|
background
|
style="margin-top: 10px"
|
:total.sync="totalPage"
|
></el-pagination>
|
</div>
|
</div>
|
</div>
|
<my-mask
|
ref="myMask"
|
:clickType="type"
|
:bankList="bankList"
|
:bankMap="bankMap"
|
@hide="hideMask"
|
></my-mask>
|
</div>
|
</template>
|
|
<script>
|
import { mapGetters, mapMutations } from "vuex";
|
import MyMask from "./Mask";
|
import utils from "@/assets/js/utils.js";
|
import * as dayjs from 'dayjs'
|
|
export default {
|
data() {
|
return {
|
type: "",
|
searchData: {
|
companyId: "",
|
institutionId: "",
|
},
|
bankList: [],
|
bankMap: {},
|
loanMap: {
|
100: "处理中",
|
200: "交易成功",
|
300: "完成提交",
|
400: "未能处理",
|
500: "交易失败",
|
600: "交易落地",
|
},
|
loanList: [
|
{ label: "处理中", value: "100" },
|
{ label: "交易成功", value: "200" },
|
{ label: "完成提交", value: "300" },
|
{ label: "未能处理", value: "400" },
|
{ label: "交易失败", value: "500" },
|
],
|
|
companyList: "",
|
menuItems: [],
|
totalPage: 0,
|
currentPage: 1,
|
loading: false,
|
trueMenuItems: ""
|
};
|
},
|
props: ["channelData"],
|
created() {
|
this.getMenuData();
|
},
|
components: {
|
MyMask,
|
},
|
|
watch: {
|
bankList:(newValue) => {
|
console.log(newValue)
|
}
|
},
|
|
computed: {
|
...mapGetters(["getMenu"]),
|
},
|
created() {
|
this.getAllData();
|
this.getMenuData();
|
},
|
methods: {
|
// 获取支持银行列表数据
|
async getBankList() {
|
return this.$http.get("handPutout/bankList", { companyId: "ALLINPAY" });
|
},
|
// 获取表单数据
|
getMenuData() {
|
const that = this;
|
this.loading = true;
|
|
let { searchData, currentPage } = this;
|
const checkDate = searchData.checkDate;
|
if (Array.isArray(checkDate) && checkDate.length > 1) {
|
searchData.putoutStartDate = dayjs(checkDate[0]).format('YYYY/MM/DD');
|
searchData.putoutEndDate = dayjs(checkDate[1]).format('YYYY/MM/DD');
|
} else {
|
searchData.putoutStartDate = "";
|
searchData.putoutEndDate = "";
|
}
|
let params = {...searchData}
|
delete params.checkDate
|
this.$http
|
.get("handPutout/list", {
|
...params,
|
pageSize: 10,
|
pageNum: currentPage
|
})
|
.then((response) => {
|
if (response.data.retHeader.retCode === "0000") {
|
that.menuItems = response.data.retBody.records;
|
// 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(response.data.retBody.total);
|
} else {
|
this.loading = false;
|
that.menuItems = [];
|
that.totalPage = 0;
|
this.$message.error(response.data.retHeader.retMessage);
|
}
|
})
|
.catch((err) => {
|
this.loading = false;
|
this.$message.error(`${err}`);
|
console.log(err);
|
});
|
},
|
// axios并发请求
|
getAllData() {
|
const that = this;
|
this.Axios.all([this.getBankList()])
|
.then(
|
this.Axios.spread(function (BankList) {
|
let banks = BankList.data.retBody;
|
that.bankList = banks
|
let bankMap ={}
|
banks.map(item => {
|
bankMap[item.BANK_ID] = item.BANK_NAME
|
})
|
that.bankMap = bankMap
|
})
|
)
|
.catch((err) => {
|
console.log(err);
|
});
|
},
|
// 查看
|
view(id) {
|
this.type = "view";
|
},
|
// 重新放款
|
rePutout(data) {
|
this.type = "edit";
|
this.$refs.myMask.initData('rePutout', data);
|
},
|
// 新增
|
add() {
|
this.type = "add";
|
this.$refs.myMask.initData('add', {});
|
},
|
// 查询
|
search() {
|
this.getMenuData();
|
},
|
// 隐藏蒙版
|
hideMask(status) {
|
console.log('hideMask:', status)
|
this.currentPage = 1;
|
status && this.getMenuData();
|
|
},
|
// 重置
|
reset() {
|
this.searchData = {
|
companyId: "",
|
institutionId: "",
|
};
|
this.currentPage = 1;
|
this.getMenuData();
|
},
|
|
// 点击分页
|
handleCurrentChange(val) {
|
this.currentPage = val;
|
this.getMenuData()
|
// 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);
|
// }
|
},
|
|
formatMoney(val) {
|
val = utils.formatMoney(val);
|
return val;
|
},
|
},
|
};
|
</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>
|