|
|
@@ -0,0 +1,473 @@
|
|
|
+<template>
|
|
|
+ <view class="creat">
|
|
|
+ <cu-custom bgColor="bg-fff" :isBack="true">
|
|
|
+ <block slot="content">金豆账单</block>
|
|
|
+ </cu-custom>
|
|
|
+ <view class="fix">
|
|
|
+ <view class="balanceBill-con">
|
|
|
+ <text style="margin-right: 10px;" :style="showCategoryPopup ? 'color: #449AFF;' : ''"
|
|
|
+ @click="showCategoryPopup = !showCategoryPopup">全部账单<i
|
|
|
+ :class="showCategoryPopup ? 'typeI' : ''"></i></text>
|
|
|
+ </view>
|
|
|
+ <view class="beans-list">
|
|
|
+ <!-- 顶部月份和总额 -->
|
|
|
+ <view class="header">
|
|
|
+
|
|
|
+ <picker mode="date" :value="dateTime" fields="month" @change="bindDateChange">
|
|
|
+ <view class="month-select">
|
|
|
+ <text>{{ this.dateTime }}</text>
|
|
|
+ <u-icon name="arrow-down" size="24"></u-icon>
|
|
|
+ </view>
|
|
|
+ </picker>
|
|
|
+ <view>
|
|
|
+ <text class="total-amount" style="margin-right: 18rpx;"> 支出¥{{ expense || 0 }}</text>
|
|
|
+ <text class="total-amount">收入¥{{ income || 0 }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <mescroll-uni class="list" :fixed="false" ref="mescrollRef" @up="getList" @init="mescrollInit" :use="false">
|
|
|
+ <!-- 明细列表 -->
|
|
|
+ <view class="list-content">
|
|
|
+ <view class="list-item" v-for="(item, index) in listData" :key="index">
|
|
|
+ <view class="item-info">
|
|
|
+ <view class="item-left">
|
|
|
+ <image v-if="item.typeCode == '1'" class="icon-wrapper"
|
|
|
+ src="/static/financial/yue/icon (6).png"></image>
|
|
|
+ <image v-if="item.typeCode == '2'" class="icon-wrapper"
|
|
|
+ src="/static/financial/jindou/icon (1).png"></image>
|
|
|
+ <image v-if="item.typeCode == '3'" class="icon-wrapper"
|
|
|
+ src="/static/financial/yue/icon (7).png"></image>
|
|
|
+ <image v-if="item.typeCode == '4'" class="icon-wrapper"
|
|
|
+ src="/static/financial/jifen/icon (3).png"></image>
|
|
|
+ <image v-if="item.typeCode == '5'" class="icon-wrapper"
|
|
|
+ src="/static/financial/jindou/icon (2).png"></image>
|
|
|
+ <image v-if="item.typeCode == '6'" class="icon-wrapper"
|
|
|
+ src="/static/financial/jifen/icon (4).png"></image>
|
|
|
+ <image v-if="item.typeCode == '7'" class="icon-wrapper"
|
|
|
+ src="/static/financial/jindou/icon.png"></image>
|
|
|
+ <image v-if="item.typeCode == '8'" class="icon-wrapper"
|
|
|
+ src="/static/financial/jindou/icon (3).png"></image>
|
|
|
+ <image v-if="item.typeCode == '9'" class="icon-wrapper"
|
|
|
+ src="/static/financial/jindou/icon (4).png"></image>
|
|
|
+ <text class="item-title">{{ item.type }}</text>
|
|
|
+ </view>
|
|
|
+ <text class="item-time">{{ item.createTime }}</text>
|
|
|
+ </view>
|
|
|
+ <text class="item-amount" :class="{ 'income': item.amount > 0 }">
|
|
|
+ {{ item.amount }}
|
|
|
+ </text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </mescroll-uni>
|
|
|
+
|
|
|
+ <u-popup v-model="showCategoryPopup" :round="10" mode="bottom ">
|
|
|
+ <view class="payment-popup">
|
|
|
+ <view class="popup-header">
|
|
|
+ <text class="popup-title">全部账单</text>
|
|
|
+ <view class="popup-icon">
|
|
|
+ <u-icon name="close" size="20" @click="closePopup"></u-icon>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view>
|
|
|
+ <!-- 收支类型 -->
|
|
|
+ <view class="filter-section">
|
|
|
+ <view class="section-title">收支类型</view>
|
|
|
+ <view class="radio-group">
|
|
|
+ <view class="radio-item" :class="{ active: changeType === '999' }"
|
|
|
+ @tap="selectIncomeType('999')">全部</view>
|
|
|
+ <view class="radio-item" :class="{ active: changeType === '2' }"
|
|
|
+ @tap="selectIncomeType('2')">支出</view>
|
|
|
+ <view class="radio-item" :class="{ active: changeType === '1' }"
|
|
|
+ @tap="selectIncomeType('1')">收入</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 交易类型 -->
|
|
|
+ <view class="filter-section">
|
|
|
+ <view class="section-title">交易类型</view>
|
|
|
+ <view class="transaction-types">
|
|
|
+ <view class="radio-item" :class="{ active: transType === '999' }"
|
|
|
+ @tap="selectTransType('999')">全部</view>
|
|
|
+ <view class="radio-item" v-for="(val, index) in cashTypeArr" :key="index" :class="{
|
|
|
+ active: transType === val.code,
|
|
|
+ disabled: changeType === val.type,
|
|
|
+ }" @tap="selectTransType(val.code)">{{ val.desc }}</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="action-buttons">
|
|
|
+ <view class="cancel-btn" @click="closePopup">取消</view>
|
|
|
+ <view class="confirm-btn" @click="handlePayment">确定</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </u-popup>
|
|
|
+ </view>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import { USER_INFO } from "@/common/util/constants"
|
|
|
+
|
|
|
+export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+
|
|
|
+ changeType: '999',
|
|
|
+ transType: '999',
|
|
|
+ show: true,
|
|
|
+ showCategoryPopup: false,
|
|
|
+ listData: [],
|
|
|
+ cashTypeArr: [],
|
|
|
+ dateTime: '',
|
|
|
+ dateTimeSu: '',
|
|
|
+ expense: '',
|
|
|
+ income: '',
|
|
|
+ mescroll: '',
|
|
|
+ upOption: {
|
|
|
+ page: {
|
|
|
+ pageNo: 1,
|
|
|
+ pageSize: 10
|
|
|
+ },
|
|
|
+ noMoreSize: 5, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
|
|
|
+ empty: {
|
|
|
+ tip: '暂无相关数据'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onLoad() {
|
|
|
+ let curDate = new Date();
|
|
|
+ let curYear = curDate.getFullYear();
|
|
|
+ let curMonth = curDate.getMonth() + 1;
|
|
|
+ if (curMonth >= 1 && curMonth <= 9) {
|
|
|
+ curMonth = "0" + curMonth;
|
|
|
+ }
|
|
|
+ this.dateTime = curYear + '年' + curMonth + '月'
|
|
|
+ this.dateTimeSu = curYear + '-' + curMonth
|
|
|
+ this.$http.get('/merchant/app/finance/cashType?type=2').then(res => {
|
|
|
+ if (res.data.success) {
|
|
|
+ this.cashTypeArr = res.data.result
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ this.$tip.error(res.data.message);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.mescroll.optDown.use = false
|
|
|
+ // this.getList()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getList(page) {
|
|
|
+ let data = {
|
|
|
+ type: 2,
|
|
|
+ merchantUserId: uni.getStorageSync(USER_INFO).id,
|
|
|
+ changeType: this.changeType == '999' ? null : this.changeType,
|
|
|
+ date: this.dateTimeSu,
|
|
|
+ incomeType: this.transType == '999' ? '' : this.transType,
|
|
|
+ pageSize: page.size,
|
|
|
+ pageNo: page.num,
|
|
|
+ }
|
|
|
+ this.$http.post('/merchant/app/finance/cashBill', data).then(res => {
|
|
|
+ if (res.data.success) {
|
|
|
+ this.listData = res.data.result.page ? this.listData.concat(res.data.result.page.records) : this.listData
|
|
|
+ this.expense = res.data.result.expense
|
|
|
+ this.income = res.data.result.income
|
|
|
+ this.mescroll.endSuccess(res.data.result.page.records, res.data.result.page.total);
|
|
|
+ uni.showTabBar()
|
|
|
+ }
|
|
|
+
|
|
|
+ else {
|
|
|
+ this.listData = []
|
|
|
+ this.mescroll.endErr()
|
|
|
+ this.$tip.error(res.data.message);
|
|
|
+
|
|
|
+ }
|
|
|
+ }).catch(() => {
|
|
|
+ this.mescroll.endErr()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ mescrollInit(mescroll) {
|
|
|
+ this.mescroll = mescroll;
|
|
|
+ },
|
|
|
+ bindDateChange(e) {
|
|
|
+ let page = {
|
|
|
+ num: 1,
|
|
|
+ size: 10
|
|
|
+ }
|
|
|
+ const value = e.detail.value
|
|
|
+ this.dateTimeSu = value
|
|
|
+ this.dateTime = value.split('-')[0] + '年' + value.split('-')[1] + '月'
|
|
|
+ this.getList(page)
|
|
|
+ },
|
|
|
+ selectIncomeType(type) {
|
|
|
+ this.changeType = type
|
|
|
+ this.transType = '999'
|
|
|
+ },
|
|
|
+ selectTransType(type) {
|
|
|
+ this.transType = type
|
|
|
+ },
|
|
|
+ handlePayment() {
|
|
|
+ let page = {
|
|
|
+ num: 1,
|
|
|
+ size: 10
|
|
|
+ }
|
|
|
+ this.getList(page)
|
|
|
+ this.showCategoryPopup = false
|
|
|
+ },
|
|
|
+ closePopup() {
|
|
|
+ this.showCategoryPopup = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+<style scoped lang="scss">
|
|
|
+.creat {
|
|
|
+ width: 100vw;
|
|
|
+ height: 100vh;
|
|
|
+ background: #F7F8FC;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ position: fixed;
|
|
|
+}
|
|
|
+
|
|
|
+.balanceBill-con {
|
|
|
+ padding: 26rpx 35rpx;
|
|
|
+
|
|
|
+ text {
|
|
|
+ background: #EAEEF5;
|
|
|
+ border-radius: 67rpx;
|
|
|
+ padding: 14rpx 26rpx;
|
|
|
+ font-size: 26rpx;
|
|
|
+ color: #333333;
|
|
|
+
|
|
|
+ i {
|
|
|
+ margin-left: 12rpx;
|
|
|
+ display: inline-block;
|
|
|
+ width: 0;
|
|
|
+ height: 0;
|
|
|
+ border: 4px solid;
|
|
|
+ border-color: #AFB0B3;
|
|
|
+ border-bottom: 4px solid transparent;
|
|
|
+ border-right: 4px solid transparent;
|
|
|
+ border-left: 4px solid transparent;
|
|
|
+ }
|
|
|
+
|
|
|
+ .typeI {
|
|
|
+ border-color: #449AFF;
|
|
|
+ border-top: 4px solid transparent;
|
|
|
+ border-right: 4px solid transparent;
|
|
|
+ border-left: 4px solid transparent;
|
|
|
+ margin-bottom: 8rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+.beans-list {
|
|
|
+ // min-height: 100vh;
|
|
|
+ background: #FFFFFF;
|
|
|
+
|
|
|
+
|
|
|
+ .header {
|
|
|
+ padding: 26rpx 34rpx;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ border-bottom: 1px solid #EEEEEE;
|
|
|
+
|
|
|
+ .month-select {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ font-size: 32rpx;
|
|
|
+ color: #333;
|
|
|
+
|
|
|
+ .u-icon {
|
|
|
+ margin-left: 10rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .total-amount {
|
|
|
+ font-size: 28rpx;
|
|
|
+ color: #999999;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.list-content {
|
|
|
+ padding: 0 34rpx;
|
|
|
+ width: 100%;
|
|
|
+
|
|
|
+ .list-item {
|
|
|
+ padding: 18rpx 0;
|
|
|
+ // border-radius: 12rpx;
|
|
|
+ // margin-bottom: 20rpx;
|
|
|
+ border-bottom: 1px solid #EEEEEE;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ .item-amount {
|
|
|
+ font-weight: bold;
|
|
|
+ font-size: 34rpx;
|
|
|
+ color: #333333;
|
|
|
+ }
|
|
|
+
|
|
|
+ .icon-wrapper {
|
|
|
+ width: 42rpx;
|
|
|
+ height: 42rpx;
|
|
|
+ // border-radius: 50%;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ margin-right: 14rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .item-info {
|
|
|
+ .item-title {
|
|
|
+ color: #333;
|
|
|
+ margin-bottom: 8rpx;
|
|
|
+ display: block;
|
|
|
+ font-weight: 500;
|
|
|
+ font-size: 32rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .item-time {
|
|
|
+ font-size: 24rpx;
|
|
|
+ color: #999;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .item-left {
|
|
|
+ display: flex;
|
|
|
+ align-items: flex-start;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.payment-popup {
|
|
|
+ padding: 30rpx;
|
|
|
+
|
|
|
+ .popup-header {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ padding-bottom: 20rpx;
|
|
|
+ border-bottom: 1px solid #EEEEEE;
|
|
|
+ margin-bottom: 26rpx;
|
|
|
+
|
|
|
+ .popup-title {
|
|
|
+ font-size: 34rpx;
|
|
|
+ color: #333;
|
|
|
+ font-weight: 500;
|
|
|
+ transform: translateX(37vw);
|
|
|
+ }
|
|
|
+
|
|
|
+ .popup-icon {
|
|
|
+ background: #DEDEDE;
|
|
|
+ width: 39rpx;
|
|
|
+ height: 39rpx;
|
|
|
+ text-align: center;
|
|
|
+ border-radius: 50%
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .action-buttons {
|
|
|
+ display: flex;
|
|
|
+ margin-top: 20rpx;
|
|
|
+ gap: 20rpx;
|
|
|
+ padding-top: 20rpx;
|
|
|
+ border-top: 1rpx solid #EEEEEE;
|
|
|
+
|
|
|
+ .cancel-btn,
|
|
|
+ .confirm-btn {
|
|
|
+ flex: 1;
|
|
|
+ height: 78rpx;
|
|
|
+ line-height: 78rpx;
|
|
|
+ text-align: center;
|
|
|
+ border-radius: 44rpx;
|
|
|
+ font-size: 28rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .cancel-btn {
|
|
|
+ background: #F5F6FA;
|
|
|
+ color: #666;
|
|
|
+ }
|
|
|
+
|
|
|
+ .confirm-btn {
|
|
|
+ background: #5B9CF9;
|
|
|
+ color: #FFFFFF;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.filter-section {
|
|
|
+ margin-bottom: 26rpx;
|
|
|
+
|
|
|
+ .section-title {
|
|
|
+ font-size: 28rpx;
|
|
|
+ color: #333;
|
|
|
+ margin-bottom: 26rpx;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.radio-group {
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ gap: 20rpx;
|
|
|
+}
|
|
|
+
|
|
|
+.transaction-types {
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ gap: 20rpx;
|
|
|
+}
|
|
|
+
|
|
|
+.radio-item {
|
|
|
+ width: 31.5%;
|
|
|
+ height: 86rpx;
|
|
|
+ line-height: 86rpx;
|
|
|
+ text-align: center;
|
|
|
+ // padding: 16rpx 30rpx;
|
|
|
+ background-color: #f5f7fa;
|
|
|
+ border-radius: 10rpx;
|
|
|
+ font-size: 28rpx;
|
|
|
+ color: #333;
|
|
|
+
|
|
|
+ &.active {
|
|
|
+ color: #2983EC;
|
|
|
+ border: 1px solid #449AFF;
|
|
|
+ background: rgba(68, 154, 255, 0.1);
|
|
|
+ }
|
|
|
+
|
|
|
+ &.disabled {
|
|
|
+ background-color: #f5f5f5;
|
|
|
+ color: #999;
|
|
|
+ cursor: not-allowed;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.fix {
|
|
|
+ width: 100%;
|
|
|
+ height: auto;
|
|
|
+ background: #F7F8FC;
|
|
|
+ position: sticky;
|
|
|
+ top: 0px;
|
|
|
+
|
|
|
+ /*#ifdef APP-PLUS*/
|
|
|
+ .top {
|
|
|
+ width: 100%;
|
|
|
+ height: var(--status-bar-height);
|
|
|
+ background: linear-gradient(87deg, #E2F4F8 0%, #A3CDFF 100%), linear-gradient(to bottom, #FFFFFF, #FFFFFF);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.list {
|
|
|
+ flex: 1;
|
|
|
+ width: 100%;
|
|
|
+ overflow-y: auto;
|
|
|
+ background: #FFFFFF;
|
|
|
+
|
|
|
+}
|
|
|
+</style>
|