ソースを参照

平台新增收入明细 与 支出明细

jf 5 年 前
コミット
9eb0f7c15a

+ 2 - 0
pt/src/cool/request/index.js

@@ -33,6 +33,7 @@ import item from '@/service/item/index';
 import unit from '@/service/unit/index';
 import merchant from '@/service/merchant/index';
 import shopAdmin from '@/service/shop-admin/index';
+import shopCapital from '@/service/shop-capital/index';
 import cash from '@/service/deposit/index';
 import ptYeChange from '@/service/assets/ptYeChange/index';
 import ptAsset from '@/service/ptAsset/index';
@@ -75,6 +76,7 @@ export function SET_SERVICE({ store }) {
 		unit,
     merchant,
     shopAdmin,
+	shopCapital,
     cash,
 	ptYeChange,
 	ptAsset

+ 136 - 0
pt/src/saas/shop/components/amount-detail.vue

@@ -0,0 +1,136 @@
+<template>
+	<div class="order-detail">
+		<!-- 抽屉 -->
+		<el-drawer :visible.sync="showBalanceDetail" size="1200px" :before-close="closeFn" custom-class="order-draw-wrap">
+			<x-crud class="liu-crud-wrap" @load="onLoad">
+				<template #table-column-amount="{scope}">
+					<div class="flex-center-center">
+						<div class="">{{ scope.row.io==1?'+':'-' }} {{ scope.row.amount }}</div>
+					</div>
+				</template>
+			</x-crud>
+		</el-drawer>
+	</div>
+</template>
+
+<script>
+export default {
+	name: 'order-detail',
+	props: {
+		show: {
+			type: Boolean,
+			default: false
+		},
+		orderOperate: {
+			type: Object,
+			default: () => {}
+		}
+	},
+	data() {
+		return {
+			app: null,
+			showBalanceDetail: false,
+			data: [],
+			tabIndex: '-1',
+			tabsData: [
+				{
+					text: '全部',
+					key: '-1',
+					val: 0
+				},
+				{
+					text: '可提现余额',
+					key: '0',
+					val: 0
+				},
+			]
+		};
+	},
+	methods: {
+		init() {
+			this.showBalanceDetail = true;
+		},
+		closeFn() {
+			this.$emit('closeFn')
+			this.showBalanceDetail = false;
+		},
+		onLoad({ ctx, app }) {
+			this.app = app;
+			// console.log(this.orderOperate,'orderOperate')
+			ctx.service(this.$service.shopCapital)
+				.set('table', {
+					columns: [
+						{
+							prop: 'id',
+							label: 'ID',
+							align: 'center'
+						},
+						{
+							prop: 'event',
+							label: '事项',
+							align: 'center',
+							'min-width': '120px'
+						},
+						{
+							prop: 'amount',
+							label: '金额',
+							align: 'center',
+							emptyText: '无'
+						},{
+							prop: 'shopId',
+							label: '来源',
+							align: 'center',
+							emptyText: '无'
+						},{
+							prop: 'payWay',
+							label: '支付方式',
+							align: 'center',
+							emptyText: '无'
+						},
+						{
+							prop: this.orderOperate.io==1?'totalIncome':'totalExpend',
+							label: this.orderOperate.io==1?'累计收入':'累计支出',
+							align: 'center',
+							emptyText: '无'
+						},
+						{
+							prop: 'addTime',
+							label: '时间',
+							align: 'center',
+							emptyText: '无'
+						}
+					],
+					// 操作列
+					op: {
+						visible: true, // 是否显示
+						// 同 element-ui Table-column Attributes
+						props: {
+							width: 150,
+							align: 'center',
+							fixed: 'right',
+							label: '操作'
+						},
+						// 布局,请移步 `layout`
+						layout: []
+					}
+				})
+				.set('layout', [
+					['slot-tabs'],
+					['flex1', 'refresh-btn'],
+					['data-table'],
+					['flex1', 'pagination']
+				])
+				.on('refresh', async (params, { next }) => {
+					// 继续执行刷新
+					let { asset } = await next(params);
+					if (this.$util.isEmpty(asset)) return false;
+					console.log(asset,)
+				})
+				.done();
+			app.refresh({ shopId:this.orderOperate.id,io: this.orderOperate.io });
+
+		}
+	}
+};
+</script>
+

+ 21 - 1
pt/src/saas/shop/shop.vue

@@ -5,6 +5,14 @@
             <template #table-column-balance="{scope}">
                 <el-link :underline="true" @click="detailShowFn(scope.row)" style="font-size:12px;display:inline-block;">{{ scope.row.balance }}</el-link>
             </template>
+            <!-- 收入 -->
+            <template #table-column-totalIncome="{scope}">
+                <el-link :underline="true" @click="AmountShowFn(scope.row,'1')" style="font-size:12px;display:inline-block;">{{ scope.row.totalIncome }}</el-link>
+            </template>
+            <!-- 支出 -->
+            <template #table-column-totalExpend="{scope}">
+                <el-link :underline="true" @click="AmountShowFn(scope.row,'0')" style="font-size:12px;display:inline-block;">{{ scope.row.totalExpend }}</el-link>
+            </template>
             <!-- 收款码 -->
             <template #table-column-gatheringCode="{scope}">
                 <el-button type="text" @click="gotoPage(1,scope.row)">查看</el-button>
@@ -12,18 +20,21 @@
         </x-crud>
         <!-- 用户详情 -->
         <balance-detail v-if='showBalanceDetail' @closeFn='showBalanceDetail = false' ref="balanceDetail" :orderOperate="optionData" />
+        <amount-detail v-if='showAmountDetail' @closeFn='showAmountDetail = false' ref="amountDetail" :orderOperate="optionData" />
     </div>
 </template>
 
 <script>
     import { getFirstHost } from '@/cool/utils';
     import balanceDetail from './components/balance-detail';
+    import amountDetail from './components/amount-detail';
     export default {
-        components:{balanceDetail},
+        components:{balanceDetail,amountDetail},
         data() {
             return {
                 app: null,
                 showBalanceDetail: false,
+                showAmountDetail: false,
                 optionData: {},
             };
         },
@@ -147,6 +158,15 @@
                     this.$refs.balanceDetail.init();
                 });
             },
+            AmountShowFn(item,type){
+                this.optionData = {...item,io: type}
+                console.log(this.optionData)
+                // this.optionData = item;
+                this.showAmountDetail = true;
+                setTimeout(() => {
+                    this.$refs.amountDetail.init();
+                });
+            },
             gotoPage(type,data) {
                 console.log(data)
                 let host = `http://api.pt.${getFirstHost()}`;

+ 7 - 0
pt/src/service/shop-capital/index.js

@@ -0,0 +1,7 @@
+import { BaseService, Service } from '@/cool';
+
+@Service('shop-capital')
+export class shopAdminService extends BaseService {
+
+}
+export default new shopAdminService();