<!--
|
* @Author: 小明丶
|
* @Date: 2019-08-20 14:07:56
|
* @LastEditors: 小明丶
|
* @LastEditTime: 2019-09-04 16:11:37
|
* @Description: 花呗订单
|
-->
|
<template>
|
<div class="order-hb-box">
|
<v-navbar title="支付宝拉新" fixed>
|
<template v-slot:right>
|
<div class="flex-center-g" @click="isShow = true;">
|
<span>筛选</span>
|
<svg class="icon" aria-hidden="true" style="width:18px;height:18px;">
|
<use xlink:href="#iconshaixuan"></use>
|
</svg>
|
</div>
|
</template>
|
</v-navbar>
|
<!-- 订单列表 -->
|
<div class="order-list">
|
<v-datacard class='info' :list="orderData"></v-datacard>
|
<van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="init" >
|
<!-- <v-order-item :name="item.userName || '无'" :user='item.label' :time='+item.creTime' :list='item.list'
|
v-for="(item,k) in list" :key="k" @click="go(item.orderId)"></v-order-item> -->
|
<div class="lx-list fs-14" v-for="(item, index) in list" :key="index" @click="go(item.id)">
|
<div class="lx-list-head">
|
<div class="lx-list-head-item">
|
<p class="fw">{{ item.usrName }}</p>
|
<p>姓名</p>
|
</div>
|
<div class="lx-list-head-item" style="width: 40%;">
|
<p class="fw">{{ item.usrNo }}</p>
|
<p>手机号</p>
|
</div>
|
<div class="lx-list-head-item">
|
<p class="fw" :style="{color:item.status == 3?'#ED4014': item.status == 0 ? '#333' : '#19BE6B'}">{{ item.status == 0 ? '待确认' : item.status == 1? '拉新' : item.status == 2? '拉新+绑卡' : '无效' }}</p>
|
<p>订单状态</p>
|
</div>
|
</div>
|
<div class="lx-list-foot">
|
<div class="lx-list-foot-top">
|
<p class="flex">
|
<svg class="icon" aria-hidden="true" style="width:18px;height:18px;margin-ringt:7px;">
|
<use xlink:href="#iconyonghu"></use>
|
</svg>
|
<span style="margin-left:7px;">{{ }}</span>
|
|
</p>
|
<p class="flex">
|
<svg class="icon" aria-hidden="true" style="width:18px;height:18px;margin-ringt:7px;">
|
<use xlink:href="#iconshijian"></use>
|
</svg>
|
<span style="margin-left:7px;">{{ item.creTime | timeformat('yyyy-MM-dd HH:mm:ss') }}</span>
|
|
</p>
|
</div>
|
<div class="lx-list-foot-bottom flex">
|
<svg class="icon" aria-hidden="true" style="width:18px;height:18px;margin-ringt:7px;">
|
<use xlink:href="#iconshanghumingcheng"></use>
|
</svg>
|
<span style="margin-left:7px;">{{ orgType==4? item.mgrName : orgType==3? item.storeName : item.merName }}</span>
|
</div>
|
</div>
|
</div>
|
</van-list>
|
</div>
|
<v-button-circle icon='icondaochu' title='导出' @click="exportFile"></v-button-circle>
|
|
<v-filter v-model="isShow" :belongArr="belongArr" :statusArr="statusArr" :hasMoney='false'
|
@search="(v)=>search(v,true)"></v-filter>
|
<!-- <v-filter v-model="isShow" :belongArr="belongArr" :periodsArr="periodsArr" :statusArr="statusArr" customTitle="分期本金" :hasSearch="true"
|
@search="(v)=>search(v,true)"></v-filter> -->
|
|
|
<van-popup v-model="exporShow">
|
<div class="popup-content">
|
<div class="icon-box flex-center-g">
|
<div class="child flex-center-g">
|
<svg class="icon" aria-hidden="true" style="width:33px;height:27px;fill:#fff;" @click="$router.back()">
|
<use xlink:href="#iconyoujian"></use>
|
</svg>
|
</div>
|
</div>
|
<p class="text">
|
<span class="top">已将信息发送至邮箱,请注意查收</span>
|
<span v-text="userinfo.email || ''">1244667@163.com</span>
|
</p>
|
<van-button class="btn-submit" @click="exporShow=false;">确定</van-button>
|
</div>
|
</van-popup>
|
</div>
|
</template>
|
|
<script>
|
import {
|
mapState,
|
mapGetters
|
} from 'vuex';
|
import {
|
getParams
|
} from '@/utils/index';
|
export default {
|
data() {
|
return {
|
loading:false,
|
finished:false,
|
|
exporShow:false,
|
|
isShow: false,
|
list: [],
|
orderData: [],
|
belongArr: [],
|
periodsArr: [],
|
statusArr: [],
|
filter: {}
|
}
|
},
|
computed: {
|
...mapState(['userinfo']),
|
...mapGetters(['orgType']),
|
prodId() {
|
return this.$route.query.prodId
|
},
|
typeId(){
|
return this.$route.query.typeId
|
},
|
id() {
|
return this.$route.query.id;
|
},
|
dataLabel(){
|
if(this.orgType===1 || this.orgType===2){
|
return "交易商户数"
|
}else if(this.orgType ===3){
|
return "交易门店数"
|
}else{
|
return "交易门店数"
|
}
|
}
|
},
|
created() {
|
// console.log(null == 0)
|
this.init()
|
// console.log(this.orgType)
|
this.getOrderReport()
|
this.getOrderInit()
|
},
|
methods: {
|
search(v,isClear){
|
console.log(v)
|
v.status = v.orderStatus;
|
v.endTime = v.endDay;
|
v.staTime = v.startDay;
|
// v.orgId = v.mgrList[0] || '';
|
this.filter.orderId ="";
|
this.finished = false;
|
this.init(v,isClear)
|
this.getOrderReport(v)
|
},
|
// 获取过滤条件
|
getOrderInit() {
|
// this.$api.zfbLxReport({
|
|
// }).then((res) => {
|
// let body = res.body,
|
// insTermVoList = body.insTermVoList || [],
|
// orderStatusList = body.orderStatusList || [],
|
// orgBaseInfVoList = body.orgBaseInfVoList || [];
|
// this.periodsArr = insTermVoList;
|
// // this.statusArr = orderStatusList;
|
// // this.belongArr = orgBaseInfVoList;
|
|
// }).catch((err) => {
|
|
// });
|
|
},
|
// 跳转到详情页面
|
go(id) {
|
this.$router.push(`/order/lxOredrDetail?id=${id}`)
|
},
|
calcLabel(item){
|
switch (this.orgType) {
|
case 1:
|
item.label = item.merName
|
break;
|
case 2:
|
item.label = item.merName
|
break;
|
case 3:
|
item.label = item.storeName
|
break;
|
case 4:
|
item.label = item.recordPerson
|
break;
|
}
|
},
|
// 获取订单列表
|
init(params = this.filter,isClear) {
|
let p = getParams(this.orgType, this.id)
|
params.prodTypeId = this.typeId;
|
params = Object.assign(params, p)
|
this.loading = true;
|
// this.list = [
|
// {
|
// userName: '刘肖百',
|
// usrNo: 13688892222,
|
// statusStr: 0,
|
// bdUsr: '马小琴',
|
// time: '2019-08-13 11:59:09',
|
// address: '银川市金凤区鼎诚中国移动通讯服务'
|
// },
|
// {
|
// userName: '刘肖百',
|
// usrNo: 13688892222,
|
// statusStr: 2,
|
// bdUsr: '马小琴',
|
// time: '2019-08-13 11:59:09',
|
// address: '银川市金凤区鼎诚中国移动通讯服务'
|
// },
|
// {
|
// userName: '刘肖百',
|
// usrNo: 13688892222,
|
// statusStr: 1,
|
// bdUsr: '马小琴',
|
// time: '2019-08-13 11:59:09',
|
// address: '银川市金凤区鼎诚中国移动通讯服务'
|
// },
|
// ]
|
// console.log(new Date().valueOf())
|
//拉新列表初始化
|
this.$api.zfbLxInit().then(res => {
|
this.belongArr = res.body.orgInfList;
|
console.log(this.belongArr.length)
|
if(this.belongArr.length == 0){
|
console.log('this.belongArr')
|
this.belongArr.push({code:'code', name:''})
|
}
|
this.statusArr = res.body.statusList;
|
})
|
// this.$api.zfbLxList().then(res => {
|
|
// })
|
console.log(params.merList)
|
let date = {
|
status : params.orderStatus,
|
endTime : params.endDay,
|
staTime : params.startDay,
|
orgId : ''
|
}
|
if(params.merList) {
|
date.orgId = params.merList[0];
|
}
|
if(params.chanList) {
|
date.orgId = params.chanList[0];
|
}
|
if(params.storeList) {
|
date.orgId = params.storeList[0];
|
}
|
this.$api.zfbLxList({...date}).then(res => {
|
// console.log(res.body)
|
this.filter = {...params};
|
this.list = res.body;
|
// console.log(this.list)
|
this.$forceUpdate();
|
// if(isClear){
|
// this.list = [];
|
// console.log('is')
|
// }
|
let list = res.body || [],
|
len = list.length;
|
if (len) {
|
this.filter.orderId = list[list.length - 1].orderId;
|
// list.forEach(item => {
|
// this.calcLabel(item)
|
// let color = 'success';
|
// switch (item.status) {
|
// case 1:
|
// color = 'success';
|
// break;
|
// case 2:
|
// color = 'error';
|
// break;
|
// case 0:
|
// color = 'warning';
|
// break;
|
// case 3:
|
// color = 'warning';
|
// break;
|
// }
|
// this.list.push({
|
// ...item,
|
// list: [{
|
// value: item.settAmt,
|
// label: '分期本金(元)',
|
// },
|
// {
|
// value: item.insTermStr,
|
// label: '分期期数(月)',
|
// },
|
// {
|
// value: item.statusStr,
|
// label: '订单状态',
|
// color
|
// }
|
// ]
|
// })
|
// })
|
}
|
if (len < 10) {
|
this.finished = true;
|
}
|
this.loading = false;
|
this.isShow = false;
|
}).catch((err) => {
|
this.finished = true;
|
this.loading = false;
|
});
|
},
|
//订单导出
|
exportFile() {
|
if (!this.list.length) {
|
this.$notify('暂无数据导出')
|
return;
|
}
|
console.log(this.filter)
|
let date = {
|
status : this.filter.orderStatus,
|
endTime : this.filter.endDay,
|
staTime : this.filter.startDay,
|
orgId : ''
|
}
|
if(params.merList) {
|
date.orgId = params.merList[0];
|
}
|
if(params.chanList) {
|
date.orgId = params.chanList[0];
|
}
|
if(params.storeList) {
|
date.orgId = params.storeList[0];
|
}
|
this.$api.zfbLxExport(date).then((res) => {
|
|
this.exporShow = true;
|
|
// this.$dialog.alert({
|
// showCancelButton: false,
|
// message: `<div>
|
// <p>已将信息发送至邮箱,请注意查收</p>
|
// <p>${this.userinfo.email}</p>
|
// </div>`
|
// }).then(() => {
|
//
|
// });
|
}).catch((err) => {
|
|
});
|
},
|
// 获取订单统计数据
|
getOrderReport(params) {
|
console.log(params)
|
// params.status = params.orderStatus;
|
let date = {
|
status : '',
|
endTime : '',
|
staTime : '',
|
orgId : ''
|
}
|
if(params) {
|
console.log('1')
|
date.endTime = params.endDay;
|
date.staTime = params.startDay;
|
date.status = params.orderStatus;
|
if(params.merList) {
|
date.orgId = params.merList[0];
|
}
|
if(params.chanList) {
|
date.orgId = params.chanList[0];
|
}
|
if(params.storeList) {
|
date.orgId = params.storeList[0];
|
}
|
}
|
this.$api.zfbLxReport({
|
...date,
|
prodId: this.prodId,
|
pageType: 2,
|
}).then(({
|
body
|
}) => {
|
this.orderData = [];
|
this.orderData.push({
|
title: '待确认',
|
num: body.dqrNum || 0,
|
})
|
this.orderData.push({
|
title: '拉新',
|
num: body.lxNum || 0,
|
})
|
let num = body.lxAndBkNum || 0;
|
// if(this.orgType==4){
|
// num = "—";
|
// }
|
this.orderData.push({
|
title: "拉新+绑卡",
|
num
|
})
|
}).catch((err) => {
|
|
})
|
},
|
},
|
}
|
</script>
|
|
<style lang="less" scoped>
|
.fs-12{
|
font-size: 12px;
|
color: #999;
|
}
|
.fs-14{
|
font-size: 14px;
|
color: #333333;
|
}
|
.bor-box{
|
box-sizing: border-box;
|
}
|
.flex{
|
.flex();
|
}
|
.fw{
|
font-weight: bold;
|
}
|
.order-hb-box {
|
padding-top: 44px;
|
background-color: @c-bg-f5;
|
}
|
.order-list {
|
padding: 0 8px 30px;
|
|
.info {
|
margin-bottom: 20px;
|
}
|
}
|
.popup-content{
|
height: 150px;
|
width: 280px;
|
border-radius: 3px;
|
.icon-box{
|
z-index: 99999;
|
height: 64px;
|
width: 64px;
|
position: absolute;
|
left: 50%;
|
background:rgba(66,61,93,0.1);
|
border-radius: 50%;
|
transform: translate(-50%,-50%);
|
|
.child{
|
height: 55px;
|
width: 55px;
|
background:rgba(66,61,93,0.8);
|
border-radius: 50%;
|
}
|
}
|
.text{
|
width: 210px;
|
text-align: center;
|
margin: 0 auto;
|
padding-top: 50px;
|
line-height: 18px;
|
.top{
|
color: @c-text-666;
|
}
|
}
|
.btn-submit{
|
.lh(44px);
|
position: absolute;
|
width: 100%;
|
bottom: 0;
|
color: @c-text-default;
|
}
|
}
|
.lx-list{
|
width: 96%;
|
height: 135px;
|
margin: 0 2%;
|
background: #FFFFFF;
|
margin-top: 10px;
|
// &:extend(.bor-box);
|
// box-sizing: border-box;
|
&-head{
|
width: 100%;
|
.flex();
|
text-align: center;
|
&-item{
|
width: 30%;
|
height: 77px;
|
:first-child{
|
margin-top: 22px;
|
margin-bottom: 9px;
|
}
|
:last-child{
|
font-size: 12px;
|
color: #999;
|
}
|
}
|
}
|
&-foot{
|
height: 50px;
|
width: 92%;
|
margin: 0 2%;
|
padding: 0 2%;
|
font-size: 12px;
|
color: #999;
|
background: #F7F7FA;
|
&-top{
|
.flex(space-between, center);
|
height: 25px;
|
line-height: 25px;
|
margin-bottom: 3px;
|
}
|
}
|
}
|
</style>
|