You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

412 lines
14 KiB
Vue

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<template>
<view>
<!-- <scroll-view scroll-x class="bg-white nav text-center" style="margin-top: 20upx;">
<view class="flex text-center">
<view class="cu-item light flex-sub" v-for="(item,index) in itemList" :key='index'
:class="[TabCur==item.docType?'bg-red cur text-white':'']" @tap="tabSelect" data-id="card_recharge">
{{item.docTypeName}}
</view>
</view>
</scroll-view> -->
<view class="account_header">
<view class="cu-bar bg-blue search ">
<view class="search-form radius">
<text class="cuIcon-search"></text>
<input @blur="InputBlur" v-model="tradeName" :adjust-position="false" type="text"
placeholder="输入项目名称关键字" confirm-type="search"></input>
</view>
<view class="action">
<picker mode="date" fields="month" :value="date" @change="bindDateChange">
<view class="uni-input">{{date}}</view>
</picker>
<text class="cuIcon-triangledownfill"></text>
</view>
</view>
</view>
<view style="height: 100rpx;width: 100%;"></view>
<view v-show="pageInfo.total==0">
<view class='empty cuIcon-info'></view>
<view class='empty-text text-gray'>暂无数据</view>
</view>
<view class="cu-list menu-avatar accountList" v-for="(item,index) in pageInfo.accountList" :key='index'>
<!-- <navigator :url="'account-detail/account-detail?account=' + JSON.stringify(item)"> -->
<navigator>
<view class=" margin-left flex justify-between ">
<text class="text-black text-bold">{{item.tradeName}}</text>
<text class="text-cyan margin-right">{{item.inputDate}}</text>
</view>
<view class="flex-sub text-center ">
<view class="solid-bottom padding margin">
<text class="text-grey">
交易金额
</text>
<view class=" text-xxl text-red text-price padding">
{{item.tradeMoney}}
</view>
</view>
</view>
<view class="margin-left">
<text class="text-gray margin-right">单据类型</text>
<text class="">{{item.docTypeName}}</text>
</view>
<view class="margin-left">
<text class="text-gray margin-right">单据编号</text>
<text class="">{{item.docNum}}</text>
</view>
</navigator>
</view>
<text class="margin-left">共 {{pageInfo.total}} 条记录</text>
<view class="text-bold bg-gray padding-xs shadow-warp" style="position: fixed;bottom: 20rpx;right: 30rpx;">
{{pageInfo.total}}
</view>
</view>
</template>
<script>
import {
listByMember
} from '@/static/js/api/account/account.js'
export default {
data() {
return {
userInfo: null,
TabCur: null,
date: null,
itemList: [
//单据全部类型
{
docType: "upgrade_out",
docTypeName: "升级转出",
},
{
docType: "upgrade_in",
docTypeName: "升级充值",
},
{
docType: "demotion_out",
docTypeName: "降级转出",
},
{
docType: "demotion_in",
docTypeName: "降级充值",
},
{
docType: "store_room",
docTypeName: "前台收银",
},
{
docType: "init",
docTypeName: "初始化",
},
{
docType: "card_recharge",
docTypeName: "充值开卡",
},
{
docType: "recharge_roll_course",
docTypeName: "疗程转充值卡",
},
{
docType: "card_change",
docTypeName: "加价转疗程",
},
{
docType: "card_use",
docTypeName: "疗程开卡",
},
{
docType: "card_use_additione",
docTypeName: "疗程开卡补单",
},
{
docType: "store_cash",
docTypeName: "收银",
},
{
docType: "card_repay",
docTypeName: "还款",
},
{
docType: "refund_recharge",
docTypeName: "充值退款",
},
{
docType: "refund_course",
docTypeName: "疗程退款",
},
{
docType: "refund_cash",
docTypeName: "消费退款",
},
{
docType: "promotion",
docTypeName: "促销活动",
},
{
docType: "promotion_card_repay",
docTypeName: "促销还款",
},
],
pageInfo: {
total: 0,
pageNum: 1,
pageSize: 10,
accountList: [],
},
tradeName: null,
}
},
methods: {
bindDateChange: function(e) {
this.date = e.target.value
this.listPage()
},
InputFocus() {
},
InputBlur() {
this.listPage()
},
tabSelect(e) {
this.TabCur = e.currentTarget.dataset.id
},
dateFormat(fmt, date) {
let ret;
const opt = {
"Y+": date.getFullYear().toString(), // 年
"M+": (date.getMonth() + 1).toString(), // 月
"D+": date.getDate().toString(), // 日
"h+": date.getHours().toString(), // 时
"m+": date.getMinutes().toString(), // 分
"s+": date.getSeconds().toString() // 秒
};
for (let k in opt) {
ret = new RegExp("(" + k + ")").exec(fmt);
if (ret) {
fmt = fmt.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0")))
};
};
return fmt;
},
listPage() {
// let date = new Date(this.date)
// date = this.dateFormat("YYYY-MM-DD hh:mm:ss", date)
let page = {
inputDate: this.date + '-01' + ' ' + '00:00:00',
tradeName: this.tradeName,
memberId: this.userInfo.id,
// memberName: this.userInfo.memberName,
// memberPhone: this.userInfo.mobilePhone,
// storeId: this.userInfo.storeId,
// storeName: this.userInfo.storeName,
pageNum: this.pageInfo.pageNum,
pageSize: this.pageInfo.pageSize,
}
listByMember(page).then(res => {
console.log(res);
if (res.code == '000000') {
res.pageInfo.list.forEach((item) => {
this.itemList.forEach((items) => {
if (item.docType == items.docType) {
item.docTypeName = items.docTypeName;
}
});
});
for(let i=0;i<res.pageInfo.list.length;i++){
let item = res.pageInfo.list[i]
if(item.accountType == 'member_mobile_phone_change_old'){
item.docTypeName = ")";
}
if(item.accountType == 'member_mobile_phone_change_new'){
item.docTypeName = "";
}
if(item.accountType == 'CZZCMD'){
item.docTypeName = "";
}
if(item.accountType == 'CZZRMD'){
item.docTypeName = "";
}
if(item.accountType == 'project_consume'&& item.docType == 'store_cash'){
item.docTypeName = '';
}
if(item.accountType == 'project_consume'&& item.docType == 'card_change'){
item.docTypeName = ''
}
if(item.accountType == 'project' && item.docType=='promotion'){
item.docTypeName = ''
}
if (item.type == "card_repay") {
if (item.orderType == "course") {
item.docTypeName = "" + item.docTypeName;
}
if (item.orderType == "recharge") {
item.docTypeName = "" + item.docTypeName;
}
}
if(item.docType == 'card_use_addition'){
item.docTypeName = ''
}
if (item.docType == "refund_cash_room") {
if (item.accountType == "refund_cash_unaudit_room") {
item.docTypeName = "退";
}
if (item.accountType == "refund_cash_audit_room") {
item.docTypeName = "退";
}
}
if (item.docType == "recharge_Transition") {
if (item.accountType == "recharge_Transition_out") {
item.docTypeName = "";
}
if (item.accountType == "recharge_Transition_out_cancel") {
item.docTypeName = "";
}
if (item.accountType == "recharge_Transition_in") {
item.docTypeName = "";
}
if (item.accountType == "recharge_Transition_in_cancel") {
item.docTypeName = "";
}
if (item.accountType == "recharge_Transition_out_cancel") {
item.docTypeName = "";
}
}
if (item.accountType == "recharge_in") {
item.docTypeName = "";
}
if (item.accountType == "recharge_out") {
item.docTypeName = "";
}
if (item.accountType == "recharge_in_cancel") {
item.docTypeName = "";
item.orderStatu = 1
}
if (item.accountType == "recharge_out_cancel") {
item.orderStatu = 1
item.docTypeName = "";
}
if (item.accountType == "project_in") {
item.docTypeName = "";
}
if (item.accountType == "project_out") {
item.docTypeName = "";
}
if (item.accountType == "project_in_cancel") {
item.docTypeName = "";
item.orderStatu = 1
}
if (item.accountType == "project_out_cancel") {
item.docTypeName = "";
}
if (item.type == "turn_card_use") {
if (item.orderType == "project_in ") {
item.docTypeName = "";
}
}
if(item.accountType == 'project'&&item.docType =='card_change'){
item.docTypeName = ''
}
if(item.accountType == 'project'&&item.docType =='card_use'){
item.docTypeName = ''
}
if(item.docType =='LCZCMD'){
item.docTypeName = ''
}
if(item.docType =='LCZRMD'){
item.docTypeName = ''
}
if (item.docType == "card_repay"&&item.accountType == 'course_repay') {
item.docTypeName = "";
}
if(item.accountType == 'recharge_groupon_cancel'){
item.docTypeName = ''
}
if(item.accountType == 'recharge_groupon'){
item.docTypeName = ''
}
if(item.accountType == 'XFT'){
item.docTypeName = '退'
}
if(item.accountType == 'cancel_Debt'){
item.docTypeName = ''
}
if(item.accountType == 'cancel_Debt_cancel'){
item.docTypeName = ''
}
if(item.docType == 'dabao'){
item.docTypeName = ''
}
if(item.accountType == 'LCNTZR'){
item.docTypeName = ''
}
if(item.accountType == 'LCNTZC'){
item.docTypeName = ''
}
if(item.accountType == 'LCNTZCZF'){
item.docTypeName = ''
}
if(item.accountType == 'zengka'){
item.docTypeName = ''
}
}
res.pageInfo.accountList = res.pageInfo.list
this.pageInfo = res.pageInfo
} else {}
})
}
},
onShow: function() {
this.userInfo = uni.getStorageSync('userInfo')
let date = new Date()
this.date = this.dateFormat("YYYY-MM", date)
this.listPage()
},
onPullDownRefresh: function() {
setTimeout(function() {
uni.redirectTo({
url: './account'
})
uni.showToast({
title: '',
icon: 'success',
duration: 2000
});
uni.stopPullDownRefresh();
}, 1000);
},
onReachBottom: function() {
this.pageInfo.pageSize = this.pageInfo.pageSize + 5
this.listPage()
},
}
</script>
<style scoped>
.bg-blue{
background-color: #409EFF !important;
border-color: #409EFF !important;
}
.accountList {
width: 94%;
margin: 50upx 3%;
background: #FFFFFF;
padding: 20upx;
border-radius: 15upx;
}
.account_header {
position: fixed;
/* top:80rpx; */
width: 100%;
background-color: #FFFFFF;
z-index: 999;
padding-top: 10rpx;
}
</style>