shish 10 часов назад
Родитель
Сommit
b236e266fe
2 измененных файлов с 113 добавлено и 21 удалено
  1. 67 6
      ghs/src/views/assets/nextDayAffect.vue
  2. 46 15
      ghs/src/views/order/refund-list.vue

+ 67 - 6
ghs/src/views/assets/nextDayAffect.vue

@@ -31,18 +31,26 @@
 		<div class="total-line">所选售后创建期内,影响原单合计 ¥{{ formatNum(totalAmount) }}</div>
 		<div class="tables">
 			<div class="table-block">
-				<div class="table-title">按原单日期</div>
-				<el-table :data="dayList" border size="small" empty-text="该创建期内没有跨天售后">
-					<el-table-column prop="day" label="原单日期" align="center"></el-table-column>
+				<div class="table-title">按原单日期(点击看售后记录)</div>
+				<el-table :data="dayList" border size="small" empty-text="该创建期内没有跨天售后" @row-click="goDayRefund">
+					<el-table-column prop="day" label="原单日期" align="center">
+						<template slot-scope="scope">
+							<span class="jump-link">{{ scope.row.day }}</span>
+						</template>
+					</el-table-column>
 					<el-table-column label="影响金额" align="center">
 						<template slot-scope="scope">¥{{ formatNum(scope.row.amount) }}</template>
 					</el-table-column>
 				</el-table>
 			</div>
 			<div class="table-block">
-				<div class="table-title">按原单月份</div>
-				<el-table :data="monthList" border size="small" empty-text="该创建期内没有跨天售后">
-					<el-table-column prop="month" label="原单月份" align="center"></el-table-column>
+				<div class="table-title">按原单月份(点击看售后记录)</div>
+				<el-table :data="monthList" border size="small" empty-text="该创建期内没有跨天售后" @row-click="goMonthRefund">
+					<el-table-column prop="month" label="原单月份" align="center">
+						<template slot-scope="scope">
+							<span class="jump-link">{{ scope.row.month }}</span>
+						</template>
+					</el-table-column>
 					<el-table-column label="影响金额" align="center">
 						<template slot-scope="scope">¥{{ formatNum(scope.row.amount) }}</template>
 					</el-table-column>
@@ -150,6 +158,55 @@ export default {
 			this.searchTime = (this.startTime === '2026-08-18' && this.endTime === today) ? 'sinceUpgrade' : 'custom'
 			this.loadData()
 		},
+		/** 售后申请日期:跟当前页创建时间筛选一致,列表页不认识 sinceUpgrade */
+		refundQueryRange() {
+			if (this.searchTime === 'sinceUpgrade') {
+				return {
+					refundSearchTime: 'custom',
+					refundStartTime: '2026-08-18',
+					refundEndTime: this.formatDate(new Date())
+				}
+			}
+			return {
+				refundSearchTime: this.searchTime || 'custom',
+				refundStartTime: this.startTime,
+				refundEndTime: this.endTime
+			}
+		},
+		/** 跳转销售售后记录:跨天+已通过,并带上原单日期和售后创建时间 */
+		goRefundList(orderStart, orderEnd) {
+			this.$router.push({
+				path: '/order/refund-list',
+				query: {
+					fromAffect: '1',
+					searchTime: 'custom',
+					startTime: orderStart,
+					endTime: orderEnd,
+					sameDay: '0',
+					status: '1',
+					...this.refundQueryRange()
+				}
+			})
+		},
+		goDayRefund(row) {
+			if (!row || !row.day) {
+				return
+			}
+			this.goRefundList(row.day, row.day)
+		},
+		goMonthRefund(row) {
+			if (!row || !row.month) {
+				return
+			}
+			const parts = String(row.month).split('-')
+			const y = parseInt(parts[0], 10)
+			const m = parseInt(parts[1], 10)
+			if (!y || !m) {
+				return
+			}
+			const last = new Date(y, m, 0)
+			this.goRefundList(row.month + '-01', this.formatDate(last))
+		},
 		/** 拉取日/月汇总 */
 		loadData() {
 			this.$service.statKd.getNextDayAffect(this.queryParams()).then((res) => {
@@ -201,4 +258,8 @@ export default {
   font-size: 14px;
   font-weight: bold;
 }
+.jump-link {
+  color: #409eff;
+  cursor: pointer;
+}
 </style>

+ 46 - 15
ghs/src/views/order/refund-list.vue

@@ -1,5 +1,6 @@
 <!--
   PC 销售售后记录列表:展示售后类型后增加「原单时间」(当天订单/历史订单),对齐小程序 refundList。
+  支持 query.fromAffect:从跨天售后影响带入订单日期、售后申请日、sameDay、status。
 -->
 <template>
 	<div class="app-list-content">
@@ -184,6 +185,17 @@ export default {
 	computed: {
 		...mapGetters(['token'])
 	},
+	watch: {
+		/** 从跨天售后影响再次点日期时,keepAlive 不会重跑 onLoad,要跟 query 刷新 */
+		'$route.query'() {
+			if (!this.app || this.$route.path !== '/order/refund-list') {
+				return
+			}
+			if (this.applyRouteQuery()) {
+				this.refreshData()
+			}
+		}
+	},
 	created() {
 	},
 	mounted() {
@@ -270,23 +282,42 @@ export default {
 			this.status = this.tabIndex
 			this.refreshData()
 		},
+		/** 从跨天售后影响/客户页带入筛选:订单日期、售后申请日、历史订单、已通过 */
+		applyRouteQuery() {
+			const q = this.$route.query || {}
+			if (!q.fromAffect && !q.customId) {
+				return false
+			}
+			if (q.customId) {
+				this.currentCustomId = q.customId
+				this.currentCustomName = q.customName ? q.customName : ''
+			}
+			if (q.searchTime || q.startTime) {
+				this.searchTime = q.searchTime || ''
+				this.startTime = q.startTime || ''
+				this.endTime = q.endTime || ''
+				this.currentDateList = (this.startTime && this.endTime) ? [this.startTime, this.endTime] : []
+			}
+			if (q.refundSearchTime || q.refundStartTime) {
+				this.refundSearchTime = q.refundSearchTime || ''
+				this.refundStartTime = q.refundStartTime || ''
+				this.refundEndTime = q.refundEndTime || ''
+				this.currentRefundDateList = (this.refundStartTime && this.refundEndTime) ? [this.refundStartTime, this.refundEndTime] : []
+			}
+			if (q.sameDay === '0' || q.sameDay === 0) {
+				this.sameDayFilter = 0
+			} else if (q.sameDay === '1' || q.sameDay === 1) {
+				this.sameDayFilter = 1
+			}
+			if (q.status !== undefined && q.status !== '') {
+				this.status = q.status.toString()
+				this.tabIndex = this.status
+			}
+			return true
+		},
 		onLoad({ ctx, app }) {
 			this.app = app;
-
-			if(this.$route.query.customId){
-				this.currentCustomId = this.$route.query.customId
-				this.currentCustomName = this.$route.query.customName?this.$route.query.customName:''
-				this.searchTime = this.$route.query.searchTime?this.$route.query.searchTime:''
-				this.startTime = this.$route.query.startTime?this.$route.query.startTime:''
-				this.endTime = this.$route.query.endTime?this.$route.query.endTime:''
-				if(this.startTime!='' && this.endTime !=''){
-					this.currentDateList =[this.startTime,this.endTime]
-				}
-				if(this.$route.query.status){
-					this.status = this.$route.query.status
-					this.tabIndex = this.status.toString()
-				}
-			}
+			this.applyRouteQuery()
 
 			ctx.service(this.$service.refund)
 				.set('table', {