Răsfoiți Sursa

应收统计

shish 2 ani în urmă
părinte
comite
315736918e

+ 1 - 0
ghs/src/mock/userInfo.js

@@ -150,6 +150,7 @@ let menu = {
 		{id: '2',parentId: null,name: '客户',type: 0,icon: 'iconkehuguanli',orderNum: 2,router: '/member/list',viewPath: 'views/member/list.vue',keepAlive: 1},
         {id: '201',parentId: 2,name: '客户列表',type: 1,icon: 'iconkehuguanli',orderNum: 2,router: '/member/list',viewPath: 'views/member/list.vue',keepAlive: 1},
 		{id: '221',parentId: 2,name: '余额明细',type: 1,icon: 'iconkehuguanli',orderNum: 2,router: '/member/custom-balance-list',viewPath: 'views/member/custom-balance-list.vue',keepAlive: 1},
+		{id: '226',parentId: 2,name: '应收统计',type: 1,icon: 'iconkehuguanli',orderNum: 2,router: '/custom/account',viewPath: 'views/custom/account.vue',keepAlive: 1},
 
 		{id: '3',parentId: null,name: '订单',type: 0,icon: 'icondingdanguanli',orderNum: 3,router: '/order/list',viewPath: 'views/order/list.vue',keepAlive: 1},
         {id: '301',parentId: 3,name: '订单列表',type: 1,icon: 'icondingdanguanli',orderNum: 3,router: '/order/list',viewPath: 'views/order/list.vue',keepAlive: 1},

+ 7 - 0
ghs/src/service/order/index.js

@@ -5,6 +5,13 @@ import { baseUrl } from '@/config/env';
 @Service('order')
 export class OrderService extends BaseService {
 
+	getAccountList(data) {
+		return this.request({
+			url: '/account-list',
+			params: data
+		});
+	}
+
 	fh(data) {
 		return this.request({
 			url: '/fh',

+ 157 - 0
ghs/src/views/custom/account.vue

@@ -0,0 +1,157 @@
+<template>
+	<div class="shop-list">
+		<x-crud @load="onLoad">
+			<template #slot-date-select>
+                <el-date-picker v-model="currentDateList" type="daterange" align="right" unlink-panels range-separator="至" start-placeholder="开始日期" @change="getSearchDate" value-format="yyyy-MM-dd"
+                end-placeholder="结束日期" :picker-options="pickerOptions" size="mini"> </el-date-picker>
+			</template>
+
+			<template #slot-order-debt="{scope}">
+				<el-radio-group v-model="debt" @change="changeDebt" style="margin-right:20px;padding-top:6px;margin-left:20px;">
+				<el-radio label="-1">全部</el-radio>
+				<el-radio label="1">待结款</el-radio>
+                <el-radio label="0">已结款</el-radio>
+				</el-radio-group>
+			</template>
+
+            <template #slot-total-amount>
+				<span style="font-size:15px;font-weight:bold;">累计金额:{{ totalAmount }}</span>
+			</template>
+
+			<template #slot-export-due>
+				<el-button type="primary" size="mini" style="margin-left:60px;" @click="exportDue()">导出数据</el-button>
+			</template>
+
+		</x-crud>
+	</div>
+</template>
+<script>
+import { mapGetters } from 'vuex';
+export default {
+	data() {
+		return {
+			crud: null,
+            pickerOptions: {
+            shortcuts: [{
+                text: '最近一周',
+                onClick(picker) {
+                const end = new Date();
+                const start = new Date();
+                start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
+                picker.$emit('pick', [start, end]);
+                }
+            }, {
+                text: '最近一个月',
+                onClick(picker) {
+                const end = new Date();
+                const start = new Date();
+                start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+                picker.$emit('pick', [start, end]);
+                }
+            }, {
+                text: '最近三个月',
+                onClick(picker) {
+                const end = new Date();
+                const start = new Date();
+                start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
+                picker.$emit('pick', [start, end]);
+                }
+            }]
+            },
+            currentDateList:'',
+            startTime:'',
+            endTime:'',
+            searchTime:'',
+            totalAmount:0,
+            debt:'-1'
+		};
+	},
+	computed: {
+		...mapGetters(['shopInfo']),
+	},
+	methods: {
+		exportDue(){
+			this.$service.order.getAccountList({searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,debt:this.debt,export:1}).then(res => {
+				if(res.file){
+					window.location.href = res.file
+				}
+			})
+		},
+		onLoad({ ctx, app }) {
+                this.app = app;
+                ctx.service({
+                    page: () => {
+                        return this.$service.order.getAccountList({searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,debt:this.debt}).then((res) => {
+                            this.totalAmount = res.totalAmount ? res.totalAmount : 0
+                            return {
+                                list: res.list
+                            };
+                        });
+                    }
+                })
+				.set('table', {
+					columns: [
+						{
+							label: 'ID',
+							prop: 'id',
+							align: 'center',
+						},
+						{
+							label: '名称',
+							prop: 'name',
+							align: 'center',
+						},
+						{
+							label: '订单数',
+							prop: 'num',
+							align: 'center',
+						},
+						{
+							label: '金额',
+							prop: 'amount',
+							align: 'center',
+						}
+					],
+					op: {
+						visible: true,
+						props: {
+							width: 250,
+							align: 'center',
+							fixed: 'right',
+							label: '操作'
+						},
+						layout: []
+					}
+				})
+				.set('layout', [
+					[   'slot-date-select',
+                        'slot-order-debt',
+						'flex1',
+                        'slot-export-due',
+						'refresh-btn',
+					],
+					[ 'data-table' ],
+                    ['slot-total-amount','flex1']
+				])
+				.done();
+			    app.refresh();
+		},
+        getSearchDate(){
+            this.searchTime = 'custom'
+            this.startTime = this.currentDateList[0]
+            this.endTime = this.currentDateList[1]
+            this.app.refresh({searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,debt:this.debt});
+        },
+    	changeDebt(e){
+			this.debt = e
+			this.app.refresh({searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,debt:this.debt})
+		},
+	},
+};
+</script>
+
+<style lang="stylus" scoped>
+.shop-list {
+  height: 100%;
+}
+</style>

+ 5 - 0
ghs/src/views/in/due.vue

@@ -101,6 +101,11 @@ export default {
 							prop: 'name',
 							align: 'center',
 						},
+						{
+							label: '订单数',
+							prop: 'num',
+							align: 'center',
+						},
 						{
 							label: '金额',
 							prop: 'amount',