shish 6 ore fa
parent
commit
8f1e1c6657

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

@@ -200,13 +200,14 @@ let menu = {
 		{id: '12',parentId: null,name: '统计',type: 0,icon: 'icondingdanguanli',orderNum: 12,router: '/assets/profit',viewPath: 'views/assets/profit.vue',keepAlive: 1},
 		{id: '1199',parentId: '12',name: '利润表',type: 1,icon: 'icondingdanguanli',orderNum: 0,router: '/assets/profit',viewPath: 'views/assets/profit.vue',keepAlive: 1},
 		{id: '1200',parentId: '12',name: '收入统计',type: 1,icon: 'icondingdanguanli',orderNum: 1,router: '/assets/kdIncome',viewPath: 'views/assets/kdIncome.vue',keepAlive: 1},
-		{id: '12001',parentId: '12',name: '跨天售后影响',type: 1,icon: 'icondingdanguanli',orderNum: 2,router: '/assets/nextDayAffect',viewPath: 'views/assets/nextDayAffect.vue',keepAlive: 1},
 		{id: '1201',parentId: '12',name: '余额明细',type: 1,icon: 'icondingdanguanli',orderNum: 12,router: '/assets/list',viewPath: 'views/assets/list.vue',keepAlive: 1},
 		{id: '1202',parentId: '12',name: '支出明细',type: 1,icon: 'icondingdanguanli',orderNum: 12,router: '/assets/expendList',viewPath: 'views/assets/expendList.vue',keepAlive: 1},
 		{id: '1203',parentId: '12',name: '收支分类',type: 1,icon: 'icondingdanguanli',orderNum: 12,router: '/assets/incomeClass',viewPath: 'views/assets/incomeClass.vue',keepAlive: 1},
 		{id: '1203',parentId: '12',name: '收支花材',type: 1,icon: 'icondingdanguanli',orderNum: 12,router: '/assets/incomeOutItem',viewPath: 'views/assets/incomeOutItem.vue',keepAlive: 1},
 		{id: '1205',parentId: '12',name: '花材销量',type: 1,icon: 'icondingdanguanli',orderNum: 12,router: '/assets/itemSale',viewPath: 'views/assets/itemSale.vue',keepAlive: 1},
 		{id: '1210',parentId: '12',name: '采购花材',type: 1,icon: 'icondingdanguanli',orderNum: 12,router: '/assets/cgItem',viewPath: 'views/assets/cgItem.vue',keepAlive: 1},
+		// 放统计最后:orderNum 大于其它子项,侧栏按 orderNum 排
+		{id: '12001',parentId: '12',name: '跨天售后影响',type: 1,icon: 'icondingdanguanli',orderNum: 13,router: '/assets/nextDayAffect',viewPath: 'views/assets/nextDayAffect.vue',keepAlive: 1},
 
 		{id: '13',parentId: null,name: '设置',type: 0,icon: 'iconshezhi',orderNum: 12,router: '/goods/list',viewPath: 'views/goods/goods-list.vue',keepAlive: 1},
 		{id: '1301',parentId: '13',name: '密码设置',type: 1,icon: 'iconkehuguanli',orderNum: 12,router: '/setting/set-password',viewPath: 'views/setting/set-password.vue',keepAlive: 1}

+ 4 - 4
ghs/src/views/assets/nextDayAffect.vue

@@ -99,15 +99,15 @@ export default {
 			currentDateList: '',
 			startTime: '',
 			endTime: '',
-			searchTime: 'today',
+			searchTime: 'sinceUpgrade',
 			dayList: [],
 			monthList: [],
 			totalAmount: 0
 		}
 	},
 	mounted() {
-		this.setDefaultRange(30)
-		this.loadData()
+		// 进页默认「自系统升级以来」,与按钮高亮、接口 sinceUpgrade 一致
+		this.querySinceUpgrade()
 	},
 	methods: {
 		/** 数字展示:不用 truthy,避免 0 被当成空 */
@@ -173,7 +173,7 @@ export default {
 				refundEndTime: this.endTime
 			}
 		},
-		/** 跳转销售售后记录:跨天+已通过,并带上原单日期和售后创建时间 */
+		/** 跳转销售售后记录:跨天+已通过,并带上原单日期和售后创建时间;列表用 fromAffect 按 payTime 对齐 */
 		goRefundList(orderStart, orderEnd) {
 			this.$router.push({
 				path: '/order/refund-list',

+ 49 - 11
ghs/src/views/order/refund-list.vue

@@ -1,6 +1,7 @@
 <!--
   PC 销售售后记录列表:展示售后类型后增加「原单时间」(当天订单/历史订单),对齐小程序 refundList。
   支持 query.fromAffect:从跨天售后影响带入订单日期、售后申请日、sameDay、status。
+  列表走自定义 page(),每次请求都带上售后申请日,避免 x-crud 默认刷新丢掉导致金额对不上。
 -->
 <template>
 	<div class="app-list-content">
@@ -179,7 +180,9 @@ export default {
 			currentCustomName:'',
 			currentCustomId:0,
 			customList:[],
-			loading:false
+			loading:false,
+			/** 从跨天售后影响进来:列表按原单 payTime 对齐统计 */
+			fromAffect: false
 		};
 	},
 	computed: {
@@ -266,13 +269,35 @@ export default {
 			}
 			this.refreshData()
 		},
+		/** 列表/导出共用筛选:申请日必须每次都带上,不能依赖 x-crud 缓存的 params */
+		listQuery(extra) {
+			const params = {
+				status: this.status,
+				searchTime: this.searchTime,
+				startTime: this.startTime,
+				endTime: this.endTime,
+				refundSearchTime: this.refundSearchTime,
+				refundStartTime: this.refundStartTime,
+				refundEndTime: this.refundEndTime,
+				shopAdminId: this.currentStaffId,
+				customId: this.currentCustomId,
+				sameDay: this.sameDayQuery(),
+				...(extra || {})
+			}
+			// 影响页点进来:后端按 payTime JOIN 原单,与统计同一批单
+			if (this.fromAffect) {
+				params.matchPayTime = 1
+				params.fromAffect = 1
+			}
+			return params
+		},
 		refreshData(){
-      		this.app.refresh({status:this.tabIndex,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,refundSearchTime:this.refundSearchTime,refundStartTime:this.refundStartTime,
-				refundEndTime:this.refundEndTime,shopAdminId:this.currentStaffId,status:this.status,customId:this.currentCustomId,sameDay:this.sameDayQuery()})
+			if (this.app) {
+				this.app.refresh()
+			}
     	},
 		exportData(){
-			this.$service.refund.getRefundList({status:this.tabIndex,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,refundSearchTime:this.refundSearchTime,refundStartTime:this.refundStartTime,
-				refundEndTime:this.refundEndTime,shopAdminId:this.currentStaffId,status:this.status,pageSize:9999999,export:1,customId:this.currentCustomId,sameDay:this.sameDayQuery()}).then(res => {
+			this.$service.refund.getRefundList(this.listQuery({ pageSize: 9999999, export: 1 })).then(res => {
 				if(res.file){
 					window.location.href = res.file
 				}
@@ -288,6 +313,7 @@ export default {
 			if (!q.fromAffect && !q.customId) {
 				return false
 			}
+			this.fromAffect = q.fromAffect === '1' || q.fromAffect === 1
 			if (q.customId) {
 				this.currentCustomId = q.customId
 				this.currentCustomName = q.customName ? q.customName : ''
@@ -319,7 +345,23 @@ export default {
 			this.app = app;
 			this.applyRouteQuery()
 
-			ctx.service(this.$service.refund)
+			ctx.service({
+				page: (params) => {
+					const page = (params && params.page) || 1
+					const pageSize = (params && (params.pageSize || params.size)) || 20
+					return this.$service.refund.getRefundList(this.listQuery({ page, pageSize })).then((res) => {
+						this.totalRefundPrice = res.totalRefundPrice ? parseFloat(res.totalRefundPrice) : 0
+						return {
+							list: res.list || [],
+							pagination: {
+								page,
+								size: pageSize,
+								total: res.totalNum || 0
+							}
+						}
+					})
+				}
+			})
 				.set('table', {
 					columns: [
 						{
@@ -436,12 +478,8 @@ export default {
 					['data-table'],
 					['slot-total-amount','flex1', 'pagination']
 				])
-				.on('refresh', async (params, { next }) => {
-					let result = await next(params)
-					this.totalRefundPrice = result.totalRefundPrice ? parseFloat(result.totalRefundPrice) : 0
-				})
 				.done();
-                this.refreshData()
+			this.refreshData()
 		}
 	}
 };