shish 2 年 前
コミット
2a7a6c0a47

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

@@ -44,6 +44,7 @@ import modify from '@/service/modify/index';
 import purchaseOrder from '@/service/purchase-order/index';
 import purchaseOrderItem from '@/service/purchase-order-item/index';
 import customBalanceChange from '@/service/custom-balance-change/index';
+import customDebtChange from '@/service/custom-debt-change/index';
 
 export function SET_SERVICE({ store }) {
 	// const files = require.context('@/service/', true, /\.js$/);
@@ -54,6 +55,7 @@ export function SET_SERVICE({ store }) {
 		statItem,
 		modify,
 		customBalanceChange,
+		customDebtChange,
 		purchaseOrderItem,
 		cg,
 		purchaseOrder,

+ 3 - 2
ghs/src/mock/userInfo.js

@@ -150,9 +150,10 @@ 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: '228',parentId: 2,name: '客户业绩',type: 1,icon: 'iconkehuguanli',orderNum: 2,router: '/custom/yj',viewPath: 'views/custom/yj.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: '230',parentId: 2,name: '历史应收',type: 1,icon: 'iconkehuguanli',orderNum: 2,router: '/custom/pastAccount',viewPath: 'views/custom/pastAccount.vue',keepAlive: 1},
-		{id: '235',parentId: 2,name: '客户业绩',type: 1,icon: 'iconkehuguanli',orderNum: 2,router: '/custom/yj',viewPath: 'views/custom/yj.vue',keepAlive: 1},
+		{id: '230',parentId: 2,name: '历应明细',type: 1,icon: 'iconkehuguanli',orderNum: 2,router: '/custom/pastAccountChange',viewPath: 'views/custom/pastAccountChange.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},

+ 13 - 0
ghs/src/service/custom-debt-change/index.js

@@ -0,0 +1,13 @@
+import { BaseService, Service } from '@/cool';
+@Service('custom-debt-change')
+export class CustomDebtChangeService extends BaseService {
+
+	getList(data) {
+		return this.request({
+			url: '/list',
+			params: data
+		});
+	}
+
+}
+export default new CustomDebtChangeService();

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

@@ -19,6 +19,13 @@ export class OrderService extends BaseService {
 		});
 	}
 
+	getPastList(data) {
+		return this.request({
+			url: '/past-list',
+			params: data
+		});
+	}
+
 	getAccountList(data) {
 		return this.request({
 			url: '/account-list',

+ 20 - 47
ghs/src/views/custom/pastAccount.vue

@@ -1,17 +1,9 @@
 <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 #slot-date-select>
+				<el-date-picker v-model="endTime" type="date" placeholder="选择日期" @change="getSearchDate" value-format="yyyy-MM-dd"> </el-date-picker>
 			</template>
 
             <template #slot-total-amount>
@@ -22,6 +14,10 @@
 				<el-button type="primary" size="mini" style="margin-left:60px;" @click="exportDue()">导出数据</el-button>
 			</template>
 
+			<template #slot-column-option="{scope}">
+				<el-button size="small" type="primary" @click="goChange(scope.row)">查看明细</el-button>
+			</template>
+
 		</x-crud>
 	</div>
 </template>
@@ -31,33 +27,6 @@ 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:'',
@@ -70,8 +39,14 @@ export default {
 		...mapGetters(['shopInfo']),
 	},
 	methods: {
+		goChange(data){
+			let query = {};
+			query.customId = data.id
+			query.endTime = this.endTime
+			this.$router.push({ path: '/custom/pastAccountChange', query });
+		},
 		exportDue(){
-			this.$service.order.getAccountList({searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,debt:this.debt,export:1}).then(res => {
+			this.$service.order.getPastList({searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,export:1}).then(res => {
 				if(res.file){
 					window.location.href = res.file
 				}
@@ -81,7 +56,7 @@ export default {
                 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) => {
+                        return this.$service.order.getPastList({searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime}).then((res) => {
                             this.totalAmount = res.totalAmount ? res.totalAmount : 0
                             return {
                                 list: res.list
@@ -102,13 +77,13 @@ export default {
 							align: 'center',
 						},
 						{
-							label: '订单数',
-							prop: 'num',
+							label: '手机号',
+							prop: 'mobile',
 							align: 'center',
 						},
 						{
-							label: '金额',
-							prop: 'amount',
+							label: '欠款金额',
+							prop: 'currentDebAmount',
 							align: 'center',
 						}
 					],
@@ -120,12 +95,11 @@ export default {
 							fixed: 'right',
 							label: '操作'
 						},
-						layout: []
+						layout: ['slot-column-option']
 					}
 				})
 				.set('layout', [
 					[   'slot-date-select',
-                        'slot-order-debt',
 						'flex1',
                         'slot-export-due',
 						'refresh-btn',
@@ -138,8 +112,7 @@ export default {
 		},
         getSearchDate(){
             this.searchTime = 'custom'
-            this.startTime = this.currentDateList[0]
-            this.endTime = this.currentDateList[1]
+            this.startTime = this.endTime
             this.app.refresh({searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,debt:this.debt});
         },
     	changeDebt(e){

+ 90 - 0
ghs/src/views/custom/pastAccountChange.vue

@@ -0,0 +1,90 @@
+<template>
+	<div class="shop-list">
+		<x-crud @load="onLoad">
+
+			<template #table-column-amount="{scope}">
+				<span v-if="scope.row.io == 0">-{{ scope.row.amount }}</span>
+				<span v-else>+{{ scope.row.amount }}</span>
+			</template>
+
+		</x-crud>
+	</div>
+</template>
+<script>
+import { mapGetters } from 'vuex';
+export default {
+	data() {
+		return {
+			crud: null,
+            endTime:'',
+			customId:0
+		};
+	},
+	methods: {
+		onLoad({ ctx, app }) {
+			this.app = app;
+			if (this.$route.query.customId) {
+				this.customId = this.$route.query.customId;
+			}
+			if (this.$route.query.endTime) {
+				this.endTime = this.$route.query.endTime
+			}
+			ctx.service({
+				page: () => {
+					return this.$service.customDebtChange.getList({endTime:this.endTime,customId:this.customId}).then((res) => {
+						this.totalAmount = res.totalAmount ? res.totalAmount : 0
+						return {
+							list: res.list
+						};
+					});
+				}
+			})
+			.set('table', {
+				columns: [
+					{
+						label: '日期',
+						prop: 'addTime',
+						align: 'center',
+					},
+					{
+						label: '事项',
+						prop: 'event',
+						align: 'center',
+					},
+					{
+						label: '变动',
+						prop: 'amount',
+						align: 'center',
+					},
+					{
+						label: '剩余欠款',
+						prop: 'balance',
+						align: 'center',
+					}
+				],
+				op: {
+					visible: true,
+					props: {
+						width: 250,
+						align: 'center',
+						fixed: 'right',
+						label: '操作'
+					},
+					layout: []
+				}
+			})
+			.set('layout', [
+				[ 'data-table' ],
+				['flex1', 'pagination']
+			])
+			.done()
+			app.refresh({endTime:this.endTime,customId:this.customId})
+		}
+	},
+};
+</script>
+<style lang="stylus" scoped>
+.shop-list {
+  height: 100%;
+}
+</style>