@@ -32,4 +32,16 @@ export const apiUrl = { | |||||
cancel: "/api/couponOrder/verify", | cancel: "/api/couponOrder/verify", | ||||
// 已被核销的券包 | // 已被核销的券包 | ||||
couponOrderListVerified: '/api/couponOrder/listVerified', | couponOrderListVerified: '/api/couponOrder/listVerified', | ||||
/** | |||||
* B端用户详情 | |||||
*/ | |||||
userDetail: '/api/user/detail', | |||||
/** | |||||
*C端扫B端储值卡交易流水(消费记录 + 补贴)列表接口 | |||||
*/ | |||||
cardPayList:"/api/cardPay/list", | |||||
/** | |||||
*C端扫B端储值卡交易流水SUM | |||||
*/ | |||||
payMum:"/api/cardPay/sum", | |||||
} | } |
@@ -12,13 +12,20 @@ Vue.use(Vuex) | |||||
export default new Vuex.Store({ | export default new Vuex.Store({ | ||||
state: { | state: { | ||||
token: '', | token: '', | ||||
merchant_id:'', | |||||
merchant_id_scan:'', | |||||
}, | }, | ||||
mutations: { | mutations: { | ||||
setToken (state, token) { | setToken (state, token) { | ||||
state.token = token | state.token = token | ||||
} | |||||
}, | |||||
setMerchantId(state,id){ | |||||
state.merchant_id = id | |||||
}, | |||||
setMerchantIdScan(state,id){ | |||||
state.merchant_id_scan = id | |||||
}, | |||||
}, | }, | ||||
actions: { | actions: { | ||||
doLogin ({commit}, res) { | doLogin ({commit}, res) { | ||||
@@ -65,6 +65,9 @@ | |||||
</template> | </template> | ||||
<script type="text/babel"> | <script type="text/babel"> | ||||
import Vue from "vue"; | |||||
import {mapMutations} from 'vuex' | |||||
import { Toast } from "vant"; | |||||
// 组件 | // 组件 | ||||
export default { | export default { | ||||
name: 'page-index', | name: 'page-index', | ||||
@@ -111,12 +114,13 @@ export default { | |||||
}; | }; | ||||
}, | }, | ||||
mounted() { | mounted() { | ||||
this.setUser(); | |||||
this.getTabletListOrder(); | this.getTabletListOrder(); | ||||
this.getTabletListVerify(); | this.getTabletListVerify(); | ||||
this.getMicroPayAmountOnDate(); | this.getMicroPayAmountOnDate(); | ||||
}, | }, | ||||
methods: { | methods: { | ||||
...mapMutations(['setMerchantId','setMerchantIdScan']), | |||||
toWriteoff(path){ | toWriteoff(path){ | ||||
this.$router.push(path) | this.$router.push(path) | ||||
}, | }, | ||||
@@ -382,8 +386,28 @@ export default { | |||||
}] | }] | ||||
}; | }; | ||||
chart.setOption(option) | chart.setOption(option) | ||||
}, | |||||
/** | |||||
* 设置用户信息 | |||||
*/ | |||||
setUser(){ | |||||
this.$http.userDetail({ | |||||
method:'get' | |||||
}).then(res=>{ | |||||
console.log(res,"????"); | |||||
const {code ,data,message}= res | |||||
if(code==200){ | |||||
this.setMerchantId(data.merchant_id) | |||||
this.setMerchantIdScan(data.merchant_id_scan) | |||||
}else{ | |||||
Toast(message); | |||||
} | |||||
}).catch(res=>{ | |||||
Toast(res); | |||||
}) | |||||
} | } | ||||
} | } | ||||
} | } | ||||
</script> | </script> | ||||
@@ -16,13 +16,13 @@ | |||||
<div class="inquire">查询</div> | <div class="inquire">查询</div> | ||||
<div class="acounts"> | <div class="acounts"> | ||||
<div class="title">收款总计(元)</div> | <div class="title">收款总计(元)</div> | ||||
<div class="num">0.2</div> | |||||
<div class="title1">1笔</div> | |||||
<div class="num">{{(sum_real_payment1+sum_real_payment2+sum_real_payment3)/100}}</div> | |||||
<div class="title1">{{`${list.length} 笔`}}</div> | |||||
<div class="billBox"> | <div class="billBox"> | ||||
<div class="billBox_left"> | <div class="billBox_left"> | ||||
<div>已到账(元)</div> | <div>已到账(元)</div> | ||||
<div style="color: #333; font-weight: bold; padding-bottom: 0.5rem"> | <div style="color: #333; font-weight: bold; padding-bottom: 0.5rem"> | ||||
0.2 | |||||
{{(sum_real_payment2+sum_real_payment3)/100}} | |||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class="billBox_right"> | <div class="billBox_right"> | ||||
@@ -30,18 +30,19 @@ | |||||
<div | <div | ||||
style="color: #ff6a6a; font-weight: bold; padding-bottom: 0.5rem" | style="color: #ff6a6a; font-weight: bold; padding-bottom: 0.5rem" | ||||
> | > | ||||
0 | |||||
{{sum_real_payment1/100}} | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class="content"> | |||||
<div class="content" v-for="(item,index) in list" :key="index"> | |||||
<div class="content_left"> | <div class="content_left"> | ||||
<div class="content_left_text">2020-09-28 09:47:53</div> | |||||
<div class="customer">{{item.onickName}}</div> | |||||
<div>{{setTiem(item.createDate,"YYYY-MM-DD HH:mm:ss")}}</div> | |||||
</div> | </div> | ||||
<div class="content_rigth"> | <div class="content_rigth"> | ||||
<div class="price">¥100</div> | |||||
<div style="color: red">实收 ¥0.2</div> | |||||
<div class="price">{{`¥${item.deductionAmount/100}`}}</div> | |||||
<div style="color: red">{{`实收 ¥${item.realPayment/100}`}}</div> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class="noData">暂无数据</div> | <div class="noData">暂无数据</div> | ||||
@@ -64,10 +65,11 @@ | |||||
</template> | </template> | ||||
<script> | <script> | ||||
import { formatDate } from "@/utils/cloud-utils"; | import { formatDate } from "@/utils/cloud-utils"; | ||||
import moment from "moment"; | |||||
import Vue from "vue"; | import Vue from "vue"; | ||||
import { Calendar } from "vant"; | |||||
Vue.use(Calendar); | |||||
import { Calendar,Toast } from "vant"; | |||||
import{ mapState} from "vuex"; | |||||
Vue.use(Calendar).use(Toast); | |||||
export default { | export default { | ||||
data() { | data() { | ||||
return { | return { | ||||
@@ -79,9 +81,95 @@ export default { | |||||
startMaxDate:new Date(2025, 0, 1), | startMaxDate:new Date(2025, 0, 1), | ||||
endMinDate:new Date(2015, 0, 1), | endMinDate:new Date(2015, 0, 1), | ||||
endMaxDate:new Date(2025, 0, 1), | endMaxDate:new Date(2025, 0, 1), | ||||
sum_real_payment1: 0, | |||||
sum_real_payment2: 0, | |||||
sum_real_payment3:0, | |||||
pageNum:1, | |||||
pageSize:10, | |||||
list:[], | |||||
startdate: moment(new Date().getTime()).format("YYYY-MM-DD")+' 00:00:00', | |||||
enddate: moment(new Date().getTime()).format("YYYY-MM-DD")+' 23:59:59', | |||||
}; | }; | ||||
}, | }, | ||||
computed: { | |||||
...mapState(['merchant_id']) | |||||
}, | |||||
methods: { | methods: { | ||||
//查询消费卡扫码记录列表 | |||||
getCardPay() { | |||||
this.$http.cardPayList({ | |||||
methods: "get", | |||||
params: { | |||||
pageNum:this.pageNum, | |||||
pageSize:this.pageSize, | |||||
startdate: this.startdate, | |||||
enddate: this.enddate, | |||||
}, | |||||
}).then(res=>{ | |||||
const {code,message,data} = res | |||||
if(code ==200){ | |||||
this.list = data.list | |||||
}else{ | |||||
Toast(message); | |||||
} | |||||
}).catch(res=>{ | |||||
Toast(res); | |||||
}) | |||||
}, | |||||
payMum1(){ | |||||
this.$http.payMum({ | |||||
methods: "get", | |||||
params:{ | |||||
merchantId: this.merchant_id, | |||||
startdate: moment(new Date().getTime()).format("YYYY-MM-DD")+' 00:00:00', | |||||
enddate: moment(new Date().getTime()).format("YYYY-MM-DD")+' 23:59:59', | |||||
payStatus:0 | |||||
} | |||||
}).then(res=>{ | |||||
const{code , data,message}=res | |||||
if(code==200){ | |||||
this.sum_real_payment1= Number(data.length!=0?res.data[0].sum_real_payment:0) | |||||
}else{ | |||||
Toast(message); | |||||
} | |||||
}) | |||||
}, | |||||
payMum2(){ | |||||
this.$http.payMum({ | |||||
methods: "get", | |||||
params:{ | |||||
merchantId: this.merchant_id, | |||||
startdate: moment(new Date().getTime()).format("YYYY-MM-DD")+' 00:00:00', | |||||
enddate: moment(new Date().getTime()).format("YYYY-MM-DD")+' 23:59:59', | |||||
payStatus:1 | |||||
} | |||||
}).then(res=>{ | |||||
const{code , data,message}=res | |||||
if(code==200){ | |||||
this.sum_real_payment2= Number(data.length!=0?res.data[0].sum_real_payment:0) | |||||
}else{ | |||||
Toast(message); | |||||
} | |||||
}) | |||||
}, | |||||
payMum3(){ | |||||
this.$http.payMum({ | |||||
methods: "get", | |||||
params:{ | |||||
merchantId: this.merchant_id, | |||||
startdate: moment(new Date().getTime()).format("YYYY-MM-DD")+' 00:00:00', | |||||
enddate: moment(new Date().getTime()).format("YYYY-MM-DD")+' 23:59:59', | |||||
payStatus:2 | |||||
} | |||||
}).then(res=>{ | |||||
const{code , data,message}=res | |||||
if(code==200){ | |||||
this.sum_real_payment3= Number(data.length!=0?res.data[0].sum_real_payment:0) | |||||
}else{ | |||||
Toast(message); | |||||
} | |||||
}) | |||||
}, | |||||
onConfirm1(date){ | onConfirm1(date){ | ||||
const tmepTime = formatDate(new Date(date), "yyyy-MM-dd") | const tmepTime = formatDate(new Date(date), "yyyy-MM-dd") | ||||
this.startTiem = tmepTime | this.startTiem = tmepTime | ||||
@@ -94,8 +182,18 @@ export default { | |||||
this.endTiem = tmepTime | this.endTiem = tmepTime | ||||
this.endTiemShow = false | this.endTiemShow = false | ||||
console.log(this.endTiem ,"????"); | console.log(this.endTiem ,"????"); | ||||
}, | |||||
//时间处理 | |||||
setTiem(temp,format){//第一个参数是时间戳 第二个参数是格式 参考momentJS | |||||
return moment(Number(temp)).format(format) | |||||
} | } | ||||
}, | }, | ||||
mounted(){ | |||||
this.getCardPay(); | |||||
this.payMum1(); | |||||
this.payMum2(); | |||||
this.payMum3(); | |||||
} | |||||
}; | }; | ||||
</script> | </script> | ||||
<style scoped> | <style scoped> | ||||
@@ -184,13 +282,25 @@ export default { | |||||
color: #999; | color: #999; | ||||
} | } | ||||
.content { | .content { | ||||
overflow: hidden; | |||||
background-color: #fff; | background-color: #fff; | ||||
margin-top: 0.5rem; | |||||
padding: 0 0.6rem; | |||||
overflow: hidden; | |||||
font-size: 0.42rem; | |||||
font-family: PingFang-SC-Medium; | |||||
font-weight: 500; | |||||
border-bottom: 0.01rem solid #f6f6f6; | |||||
color: rgba(153, 153, 153, 1); | |||||
padding-top: 0.5rem; | |||||
} | } | ||||
.content_left { | .content_left { | ||||
width: 50%; | width: 50%; | ||||
float: left; | float: left; | ||||
line-height: 1rem; | |||||
text-align: left; | |||||
} | |||||
.customer{ | |||||
color: #000; | |||||
font-size: 0.48rem; | |||||
} | } | ||||
.content_rigth { | .content_rigth { | ||||
width: 50%; | width: 50%; | ||||
@@ -2,41 +2,148 @@ | |||||
<div class="Box"> | <div class="Box"> | ||||
<div class="topbox"> | <div class="topbox"> | ||||
<div class="title">今日收款总额(元)</div> | <div class="title">今日收款总额(元)</div> | ||||
<div class="num">0.2</div> | |||||
<div class="piece">1 笔</div> | |||||
<div class="num">{{(sum_real_payment1+sum_real_payment2+sum_real_payment3)/100}}</div> | |||||
<div class="piece">{{`${list.length} 笔`}}</div> | |||||
<div class="intOne"> | <div class="intOne"> | ||||
<div class="left"> | <div class="left"> | ||||
<div class="text1">已到账(元)</div> | <div class="text1">已到账(元)</div> | ||||
<div class="text" style="color: #fff; font-weight: bold">5</div> | |||||
<div class="text" style="color: #fff; font-weight: bold">{{(sum_real_payment2+sum_real_payment3)/100}}</div> | |||||
</div> | </div> | ||||
<div class="right"> | <div class="right"> | ||||
<div class="text1">未到账(元)</div> | <div class="text1">未到账(元)</div> | ||||
<div class="text" style="color: #fff; font-weight: bold">6</div> | |||||
<div class="text" style="color: #fff; font-weight: bold">{{sum_real_payment1/100}}</div> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class="clearfix"> | <div class="clearfix"> | ||||
<div class="clearfix_left">2020-9-28</div> | |||||
<div class="clearfix_left">{{setTiem(new Date().getTime(),"YYYY-MM-DD")}}</div> | |||||
<div class="clearfix_right" @click="goCurrent">按日期查询</div> | <div class="clearfix_right" @click="goCurrent">按日期查询</div> | ||||
</div> | </div> | ||||
<div class="contents"> | |||||
<div class="contents_left">2020-09-28 09:47:53</div> | |||||
<div class="contents" v-for="(item,index) in list" :key="index"> | |||||
<div class="contents_left"> | |||||
<div class="customer">{{item.onickName}}</div> | |||||
<div>{{setTiem(item.createDate,"YYYY-MM-DD HH:mm:ss")}}</div> | |||||
</div> | |||||
<div class="contents_right"> | <div class="contents_right"> | ||||
<div style="color: #000;line-height: 1rem;">¥120</div> | |||||
<div>实收 ¥0.2</div> | |||||
<div style="color: #000; line-height: 1rem;text-align: right;">{{`¥${item.deductionAmount/100}`}}</div> | |||||
<div>{{`实收 ¥${item.realPayment/100}`}}</div> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class="noData">暂无数据</div> | <div class="noData">暂无数据</div> | ||||
</div> | </div> | ||||
</template> | </template> | ||||
<script> | <script> | ||||
import Vue from "vue"; | |||||
import moment from "moment"; | |||||
import { Toast } from "vant"; | |||||
import{ mapState} from "vuex"; | |||||
export default { | export default { | ||||
methods: { | |||||
goCurrent(){ | |||||
this.$router.push('/current') | |||||
data() { | |||||
return { | |||||
pageNum:1, | |||||
pageSize:10, | |||||
list:[], | |||||
sum_real_payment1: 0, | |||||
sum_real_payment2: 0, | |||||
sum_real_payment3:0, | |||||
} | |||||
}, | |||||
computed: { | |||||
...mapState(['merchant_id']) | |||||
}, | |||||
methods: { | |||||
goCurrent() { | |||||
this.$router.push("/current"); | |||||
}, | |||||
//查询消费卡扫码记录列表 | |||||
getCardPay() { | |||||
this.$http.cardPayList({ | |||||
methods: "get", | |||||
params: { | |||||
pageNum:this.pageNum, | |||||
pageSize:this.pageSize, | |||||
startdate: moment(new Date().getTime()).format("YYYY-MM-DD")+' 00:00:00', | |||||
enddate: moment(new Date().getTime()).format("YYYY-MM-DD")+' 23:59:59', | |||||
}, | |||||
}).then(res=>{ | |||||
const {code,message,data} = res | |||||
if(code ==200){ | |||||
this.list = data.list | |||||
}else{ | |||||
Toast(message); | |||||
} | } | ||||
}).catch(res=>{ | |||||
Toast(res); | |||||
}) | |||||
}, | }, | ||||
} | |||||
payMum1(){ | |||||
this.$http.payMum({ | |||||
methods: "get", | |||||
params:{ | |||||
merchantId: this.merchant_id, | |||||
startdate: moment(new Date().getTime()).format("YYYY-MM-DD")+' 00:00:00', | |||||
enddate: moment(new Date().getTime()).format("YYYY-MM-DD")+' 23:59:59', | |||||
payStatus:0 | |||||
} | |||||
}).then(res=>{ | |||||
const{code , data,message}=res | |||||
if(code==200){ | |||||
this.sum_real_payment1= Number(data.length!=0?res.data[0].sum_real_payment:0) | |||||
}else{ | |||||
Toast(message); | |||||
} | |||||
}) | |||||
}, | |||||
payMum2(){ | |||||
this.$http.payMum({ | |||||
methods: "get", | |||||
params:{ | |||||
merchantId: this.merchant_id, | |||||
startdate: moment(new Date().getTime()).format("YYYY-MM-DD")+' 00:00:00', | |||||
enddate: moment(new Date().getTime()).format("YYYY-MM-DD")+' 23:59:59', | |||||
payStatus:1 | |||||
} | |||||
}).then(res=>{ | |||||
const{code , data,message}=res | |||||
if(code==200){ | |||||
this.sum_real_payment2= Number(data.length!=0?res.data[0].sum_real_payment:0) | |||||
}else{ | |||||
Toast(message); | |||||
} | |||||
}) | |||||
}, | |||||
payMum3(){ | |||||
this.$http.payMum({ | |||||
methods: "get", | |||||
params:{ | |||||
merchantId: this.merchant_id, | |||||
startdate: moment(new Date().getTime()).format("YYYY-MM-DD")+' 00:00:00', | |||||
enddate: moment(new Date().getTime()).format("YYYY-MM-DD")+' 23:59:59', | |||||
payStatus:2 | |||||
} | |||||
}).then(res=>{ | |||||
const{code , data,message}=res | |||||
if(code==200){ | |||||
this.sum_real_payment3= Number(data.length!=0?res.data[0].sum_real_payment:0) | |||||
}else{ | |||||
Toast(message); | |||||
} | |||||
}) | |||||
}, | |||||
//时间处理 | |||||
setTiem(temp,format){//第一个参数是时间戳 第二个参数是格式 参考momentJS | |||||
return moment(Number(temp)).format(format) | |||||
} | |||||
}, | |||||
mounted() { | |||||
this.getCardPay(); | |||||
this.payMum1(); | |||||
this.payMum2(); | |||||
this.payMum3(); | |||||
}, | |||||
}; | |||||
</script> | </script> | ||||
<style scoped> | <style scoped> | ||||
@@ -107,16 +214,21 @@ export default { | |||||
padding-top: 0.5rem; | padding-top: 0.5rem; | ||||
} | } | ||||
.contents_left { | .contents_left { | ||||
float: left; | |||||
line-height: 1rem; | |||||
float: left; | |||||
line-height: 1rem; | |||||
text-align: left; | |||||
} | |||||
.customer{ | |||||
color: #000; | |||||
font-size: 0.48rem; | |||||
} | } | ||||
.contents_right { | .contents_right { | ||||
float: right; | |||||
line-height: 0.8rem; | |||||
padding-bottom: 0.5rem; | |||||
float: right; | |||||
line-height: 0.8rem; | |||||
padding-bottom: 0.5rem; | |||||
} | } | ||||
.noData{ | |||||
line-height: 2rem; | |||||
text-align: center; | |||||
.noData { | |||||
line-height: 2rem; | |||||
text-align: center; | |||||
} | } | ||||
</style> | </style> |