shish 11 месяцев назад
Родитель
Сommit
5614e12013

+ 186 - 0
hdApp/src/admin/custom/balanceGiveChange.vue

@@ -0,0 +1,186 @@
+<template>
+    <view class="app-content">
+            <block v-if="!$util.isEmpty(list.data)">
+                <view class="balance-table">
+                    <view class="table-header table-row">
+                        <view class="table-cell cell-date">日期</view>
+                        <view class="table-cell cell-event">事项</view>
+                        <view class="table-cell cell-staff">操作</view>
+                        <view class="table-cell cell-amount">变动</view>
+                        <view class="table-cell cell-balance">余额</view>
+                    </view>
+                    <view v-for="(item, index) in list.data" :key="index" class="table-body">
+                        <view class="table-row table-row-data" @click="goDetail(item)">
+                            <view class="table-cell cell-date">{{ item.addTime.substr(5,11) }}</view>
+                            <view class="table-cell cell-event">{{ item.event }}</view>
+                            <view class="table-cell cell-staff">{{ item.staffName }}</view>
+                            <view class="table-cell cell-amount">{{ item.amount }}</view>
+                            <view class="table-cell cell-balance">{{ parseFloat(item.balance) }}</view>
+                        </view>
+                        <view class="table-row table-row-extra" v-if="Number(item.settleId)>0 || !$util.isEmpty(item.remark) || Number(item.refundOrderId)>0 || Number(item.shOrderId)>0">
+                            <view class="table-cell cell-extra" :colspan="5">
+                                <view v-if="Number(item.settleId)>0" @click.stop="goSettle(item)">结账单 {{item.settleNo}} {{item.settleAmount?parseFloat(item.settleAmount):0}}元</view>
+                                
+                                <view v-if="Number(item.settleAmount)>0 && Number(item.becomeBalance)>0">余额 {{item.becomeBalance}}元</view>
+                                
+                                <view v-if="Number(item.shOrderId)>0" @click.stop="goShPayOrder(item)">售后付款单{{ item.shOrderSn }}</view>
+
+                                <view v-if="Number(item.refundOrderId)>0" @click.stop="goRefundOrder(item)">订单 {{ item.refundOrderSn }}</view>
+
+                                <view v-if="!$util.isEmpty(item.remark)">{{ item.remark }}</view>
+                            </view>
+                        </view>
+                    </view>
+                </view>
+            </block>
+            <block v-else>
+                <AppWrapperEmpty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
+            </block>
+        </view>
+    </template>
+    <script>
+    import AppWrapperEmpty from "@/components/app-wrapper-empty";
+    import { getBalanceGiveChangeList } from '@/api/custom'
+    import list from '@/mixins/list'
+    export default {
+        name: "balanceChange",
+        components: {
+            AppWrapperEmpty
+        },
+        mixins:[list],
+        data() {
+            return {
+            };
+        },
+        methods: {
+            goRefundOrder(item){
+                this.$util.pageTo({ url: '/admin/order/detail?id='+item.refundOrderId})
+            },
+            goShPayOrder(item){
+                this.$util.pageTo({ url: '/admin/order/detail?id='+item.shOrderId})
+            },
+            goSettle(item){
+                this.$util.pageTo({url:'/admin/settle/detail?id='+item.settleId})
+            },
+            goDetail(item){
+                if(item.capitalType == 0){
+                    //订单详情
+                    this.$util.pageTo({url: '/admin/order/detail?id='+item.relateId})
+                }
+                if(item.capitalType == 59){
+                    //售后单
+                    this.$util.pageTo({url: '/admin/order/refundDetail?id='+item.relateId})
+                }
+            },
+            async init(){
+                let id = this.option.id ? this.option.id : 0
+                const res = await getBalanceGiveChangeList({ page:this.list.page,customId:id })
+                if (this.$util.isEmpty(res.data.list)){
+                    this.completes(res)
+                    return
+                }
+                let currentList = res.data.list
+
+                currentList.forEach(function(item,index,array){
+                    array[index].amount = item.io == 0 ? '-'+parseFloat(item.amount) : '+'+parseFloat(item.amount)
+                });
+
+                res.data.list = currentList
+                this.completes(res)
+            }
+        },
+        async onPullDownRefresh() {
+            this.resetList();
+            await this.init()
+            uni.stopPullDownRefresh();
+        },
+        async onReachBottom() {
+            if (!this.list.finished) {
+                await this.init()
+                uni.stopPullDownRefresh();;
+            } else {
+                uni.stopPullDownRefresh();
+            }
+        }
+    };
+    </script>
+    <style lang="scss" scoped>
+    .balance-table {
+        width: 100%;
+        border-radius: 16upx;
+        overflow: hidden;
+        background: #fff;
+        box-shadow: 0 4upx 24upx rgba(0,0,0,0.06);
+        margin: 20upx 0;
+        .table-row {
+            display: flex;
+            align-items: center;
+            min-height: 72upx;
+            border-bottom: 1px solid #f0f0f0;
+            &.table-header {
+                background: #f5f7fa;
+                font-weight: bold;
+                font-size: 30upx;
+                color: #333;
+            }
+            &.table-row-data {
+                font-size: 26upx;
+                color: #222;
+                transition: background 0.2s;
+                cursor: pointer;
+                &:hover {
+                    background: #f0f9ff;
+                }
+            }
+            &.table-row-remark {
+                background: #fafbfc;
+                color: #989494;
+                font-size: 24upx;
+                .cell-remark {
+                    padding: 16upx 20upx;
+                }
+            }
+            &.table-row-extra {
+                background: #f8f8f8;
+                color: #989494;
+                font-size: 24upx;
+                .cell-extra {
+                    padding: 16upx 20upx;
+                    display: flex;
+                    flex-direction: column;
+                    gap: 2upx;
+                }
+            }
+        }
+        .table-cell {
+            flex: 1;
+            padding: 18upx 8upx 18upx 8upx;
+            &.cell-date {
+                text-align: center;
+                min-width: 100upx;
+                flex: 1.2;
+            }
+            &.cell-staff {
+                text-align: center;
+                min-width: 60upx;
+                flex: 0.8;
+            }
+            &.cell-event {
+                text-align: left;
+                min-width: 200upx;
+                flex: 2.2;
+            }
+            &.cell-amount {
+                text-align: right;
+                min-width: 100upx;
+                flex: 1;
+            }
+            &.cell-balance {
+                text-align: right;
+                min-width: 100upx;
+                padding-right: 32upx;
+                flex: 1;
+            }
+        }
+    }
+    </style>

+ 186 - 0
hdApp/src/admin/custom/balancePayChange.vue

@@ -0,0 +1,186 @@
+<template>
+    <view class="app-content">
+            <block v-if="!$util.isEmpty(list.data)">
+                <view class="balance-table">
+                    <view class="table-header table-row">
+                        <view class="table-cell cell-date">日期</view>
+                        <view class="table-cell cell-event">事项</view>
+                        <view class="table-cell cell-staff">操作</view>
+                        <view class="table-cell cell-amount">变动</view>
+                        <view class="table-cell cell-balance">余额</view>
+                    </view>
+                    <view v-for="(item, index) in list.data" :key="index" class="table-body">
+                        <view class="table-row table-row-data" @click="goDetail(item)">
+                            <view class="table-cell cell-date">{{ item.addTime.substr(5,11) }}</view>
+                            <view class="table-cell cell-event">{{ item.event }}</view>
+                            <view class="table-cell cell-staff">{{ item.staffName }}</view>
+                            <view class="table-cell cell-amount">{{ item.amount }}</view>
+                            <view class="table-cell cell-balance">{{ parseFloat(item.balance) }}</view>
+                        </view>
+                        <view class="table-row table-row-extra" v-if="Number(item.settleId)>0 || !$util.isEmpty(item.remark) || Number(item.refundOrderId)>0 || Number(item.shOrderId)>0">
+                            <view class="table-cell cell-extra" :colspan="5">
+                                <view v-if="Number(item.settleId)>0" @click.stop="goSettle(item)">结账单 {{item.settleNo}} {{item.settleAmount?parseFloat(item.settleAmount):0}}元</view>
+                                
+                                <view v-if="Number(item.settleAmount)>0 && Number(item.becomeBalance)>0">余额 {{item.becomeBalance}}元</view>
+                                
+                                <view v-if="Number(item.shOrderId)>0" @click.stop="goShPayOrder(item)">售后付款单{{ item.shOrderSn }}</view>
+
+                                <view v-if="Number(item.refundOrderId)>0" @click.stop="goRefundOrder(item)">订单 {{ item.refundOrderSn }}</view>
+
+                                <view v-if="!$util.isEmpty(item.remark)">{{ item.remark }}</view>
+                            </view>
+                        </view>
+                    </view>
+                </view>
+            </block>
+            <block v-else>
+                <AppWrapperEmpty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
+            </block>
+        </view>
+    </template>
+    <script>
+    import AppWrapperEmpty from "@/components/app-wrapper-empty";
+    import { getBalancePayChangeList } from '@/api/custom'
+    import list from '@/mixins/list'
+    export default {
+        name: "balanceChange",
+        components: {
+            AppWrapperEmpty
+        },
+        mixins:[list],
+        data() {
+            return {
+            };
+        },
+        methods: {
+            goRefundOrder(item){
+                this.$util.pageTo({ url: '/admin/order/detail?id='+item.refundOrderId})
+            },
+            goShPayOrder(item){
+                this.$util.pageTo({ url: '/admin/order/detail?id='+item.shOrderId})
+            },
+            goSettle(item){
+                this.$util.pageTo({url:'/admin/settle/detail?id='+item.settleId})
+            },
+            goDetail(item){
+                if(item.capitalType == 0){
+                    //订单详情
+                    this.$util.pageTo({url: '/admin/order/detail?id='+item.relateId})
+                }
+                if(item.capitalType == 59){
+                    //售后单
+                    this.$util.pageTo({url: '/admin/order/refundDetail?id='+item.relateId})
+                }
+            },
+            async init(){
+                let id = this.option.id ? this.option.id : 0
+                const res = await getBalancePayChangeList({ page:this.list.page,customId:id })
+                if (this.$util.isEmpty(res.data.list)){
+                    this.completes(res)
+                    return
+                }
+                let currentList = res.data.list
+
+                currentList.forEach(function(item,index,array){
+                    array[index].amount = item.io == 0 ? '-'+parseFloat(item.amount) : '+'+parseFloat(item.amount)
+                });
+
+                res.data.list = currentList
+                this.completes(res)
+            }
+        },
+        async onPullDownRefresh() {
+            this.resetList();
+            await this.init()
+            uni.stopPullDownRefresh();
+        },
+        async onReachBottom() {
+            if (!this.list.finished) {
+                await this.init()
+                uni.stopPullDownRefresh();;
+            } else {
+                uni.stopPullDownRefresh();
+            }
+        }
+    };
+    </script>
+    <style lang="scss" scoped>
+    .balance-table {
+        width: 100%;
+        border-radius: 16upx;
+        overflow: hidden;
+        background: #fff;
+        box-shadow: 0 4upx 24upx rgba(0,0,0,0.06);
+        margin: 20upx 0;
+        .table-row {
+            display: flex;
+            align-items: center;
+            min-height: 72upx;
+            border-bottom: 1px solid #f0f0f0;
+            &.table-header {
+                background: #f5f7fa;
+                font-weight: bold;
+                font-size: 30upx;
+                color: #333;
+            }
+            &.table-row-data {
+                font-size: 26upx;
+                color: #222;
+                transition: background 0.2s;
+                cursor: pointer;
+                &:hover {
+                    background: #f0f9ff;
+                }
+            }
+            &.table-row-remark {
+                background: #fafbfc;
+                color: #989494;
+                font-size: 24upx;
+                .cell-remark {
+                    padding: 16upx 20upx;
+                }
+            }
+            &.table-row-extra {
+                background: #f8f8f8;
+                color: #989494;
+                font-size: 24upx;
+                .cell-extra {
+                    padding: 16upx 20upx;
+                    display: flex;
+                    flex-direction: column;
+                    gap: 2upx;
+                }
+            }
+        }
+        .table-cell {
+            flex: 1;
+            padding: 18upx 8upx 18upx 8upx;
+            &.cell-date {
+                text-align: center;
+                min-width: 100upx;
+                flex: 1.2;
+            }
+            &.cell-staff {
+                text-align: center;
+                min-width: 60upx;
+                flex: 0.8;
+            }
+            &.cell-event {
+                text-align: left;
+                min-width: 200upx;
+                flex: 2.2;
+            }
+            &.cell-amount {
+                text-align: right;
+                min-width: 100upx;
+                flex: 1;
+            }
+            &.cell-balance {
+                text-align: right;
+                min-width: 100upx;
+                padding-right: 32upx;
+                flex: 1;
+            }
+        }
+    }
+    </style>

+ 12 - 7
hdApp/src/admin/member/detail.vue

@@ -25,8 +25,18 @@
       <div class="user-bottom">
 
         <div class="data-list" @click="pageTo({ url: '/admin/custom/balanceChange?id='+data.id })">
-          <div class="app-size-30 app-bold">{{ balance }}</div>
-          <div class="app-color-3">余额</div>
+          <div class="app-size-30 app-bold">{{ data.balance?parseFloat(data.balance):0 }}</div>
+          <div class="app-color-3">总余额</div>
+        </div>
+
+        <div class="data-list" @click="pageTo({ url: '/admin/custom/balancePayChange?id='+data.id })">
+          <div class="app-size-30">{{ data.balancePay?parseFloat(data.balancePay):0 }}</div>
+          <div class="app-color-3">充值余额</div>
+        </div>
+
+        <div class="data-list" @click="pageTo({ url: '/admin/custom/balanceGiveChange?id='+data.id })">
+          <div class="app-size-30">{{ data.balanceGive?parseFloat(data.balanceGive):0 }}</div>
+          <div class="app-color-3">赠送余额</div>
         </div>
 
         <div class="data-list">
@@ -1028,21 +1038,16 @@ export default {
       }
     }
   }
-  
   .user-bottom {
     width: 100%;
     @include disFlex(center, space-around);
     padding-top: 20upx;
     border-top: 1upx solid #f5f5f5;
-    
     .data-list {
       text-align: center;
-      
       .app-size-30 {
         margin-bottom: 8upx;
-        font-weight: 600;
       }
-      
       .app-color-3 {
         font-size: 24upx;
       }

+ 8 - 0
hdApp/src/api/custom/index.js

@@ -12,6 +12,14 @@ export const getBalanceChangeList = data => {
 	return https.get('/balance-change/list', data)
 }
 
+export const getBalancePayChangeList = data => {
+	return https.get('/balance-pay-change/list', data)
+}
+
+export const getBalanceGiveChangeList = data => {
+	return https.get('/balance-give-change/list', data)
+}
+
 //修改会员等级
 export const changeMemberLevel = data => {
 	return https.get('/custom/change-level', data)

+ 3 - 1
hdApp/src/pages.json

@@ -53,7 +53,9 @@
 				{"path": "addCustom","style": {"navigationBarTitleText": "添加客户"}},
 				{"path": "selectCustom","style": {"navigationBarTitleText": "选择客户"}},
 				{"path": "showTotalBalance","style": {"navigationBarTitleText": "赊账与余额汇总"}},
-				{"path": "balanceChange","style": {"navigationBarTitleText": "余额变动"}},
+				{"path": "balanceChange","style": {"navigationBarTitleText": "总余额变动"}},
+				{"path": "balancePayChange","style": {"navigationBarTitleText": "充值余额变动"}},
+				{"path": "balanceGiveChange","style": {"navigationBarTitleText": "赠送余额变动"}},
 				{"path": "debtChange","style": {"navigationBarTitleText": "欠款变动明细"}},
 				{"path": "rechargeChange","style": {"navigationBarTitleText": "充值记录"}},
 				{"path": "levelChange","style": {"navigationBarTitleText": "等级变动记录"}}