shish пре 3 дана
родитељ
комит
e5b458c088

+ 49 - 0
ghsApp/src/admin/billing/freeRefundList.vue

@@ -83,6 +83,14 @@
               cancel: item.status == 3
               cancel: item.status == 3
             }"
             }"
           >{{ statusText(item.status) }}</view>
           >{{ statusText(item.status) }}</view>
+          <!-- 已通过且返充余额:列表直接看凭证,避免再进详情 -->
+          <view
+            v-if="Number(item.status) === 1 && Number(item.fundType) === 2"
+            class="poster-btn-wrap"
+            @click.stop="goPoster(item)"
+          >
+            <button class="admin-button-com middle blue poster-btn">查看凭证</button>
+          </view>
           <view class="arrow iconfont iconxiangyou"></view>
           <view class="arrow iconfont iconxiangyou"></view>
         </view>
         </view>
       </block>
       </block>
@@ -305,6 +313,40 @@ export default {
         query: { id: item.id, from: 1 }
         query: { id: item.id, from: 1 }
       })
       })
     },
     },
+    /**
+     * 返充余额凭证:跳转 forwardResult 补发海报
+     * 有原单带 orderId=0 亦可生成(海报不依赖销售单 id)
+     */
+    goPoster(item) {
+      if (!item || !item.id) {
+        return
+      }
+      const payload = {
+        fundType: item.fundType,
+        amount: item.refundPrice,
+        customId: item.customId,
+        customName: item.customName || '',
+        forwardSn: item.orderSn || '',
+        forwardId: item.id || 0,
+        // 无原单=0 显示「退款成功」;有原单列表未带销售单 id,同样用 0 不影响凭证内容
+        orderId: 0,
+        mode: 'repost'
+      }
+      uni.setStorageSync('forwardResultPayload', payload)
+      this.$util.pageTo({
+        url: '/admin/billing/forwardResult',
+        query: {
+          fundType: payload.fundType,
+          amount: payload.amount,
+          customId: payload.customId,
+          customName: encodeURIComponent(payload.customName || ''),
+          forwardSn: payload.forwardSn,
+          forwardId: payload.forwardId,
+          orderId: payload.orderId,
+          mode: 'repost'
+        }
+      })
+    },
     _list() {
     _list() {
       const params = {
       const params = {
         page: this.list.page,
         page: this.list.page,
@@ -496,6 +538,13 @@ export default {
 .status.cancel {
 .status.cancel {
   color: #999;
   color: #999;
 }
 }
+.poster-btn-wrap {
+  margin-top: 16upx;
+}
+.poster-btn {
+  width: 180upx;
+  margin: 0;
+}
 .arrow {
 .arrow {
   position: absolute;
   position: absolute;
   right: 20upx;
   right: 20upx;

+ 12 - 0
ghsApp/src/admin/home/components/OrderItem.vue

@@ -167,6 +167,10 @@
       <view class="more-popup-body">
       <view class="more-popup-body">
         <view class="text-center"><button class="admin-button-com" @click="openPrintLog(item)">打印时间</button></view>
         <view class="text-center"><button class="admin-button-com" @click="openPrintLog(item)">打印时间</button></view>
         <view class="text-center"><button class="admin-button-com" @click="openRemarkEdit(item)">备注</button></view>
         <view class="text-center"><button class="admin-button-com" @click="openRemarkEdit(item)">备注</button></view>
+        <!-- 待付款/已取消不可发起售后,其余跳转售后页 -->
+        <view class="text-center" v-if="item.status != 1 && item.status != 5">
+          <button class="admin-button-com" @click="goRefund(item)">发起售后</button>
+        </view>
         <block v-if="item.sendStatus == -4 && item.status == 2">
         <block v-if="item.sendStatus == -4 && item.status == 2">
           <view class="text-center"><button class="admin-button-com" @click="callIntraCity(item)">呼叫跑腿</button></view>
           <view class="text-center"><button class="admin-button-com" @click="callIntraCity(item)">呼叫跑腿</button></view>
         </block>
         </block>
@@ -443,6 +447,14 @@ export default {
     closeMore() {
     closeMore() {
       this.$refs.morePopup.close();
       this.$refs.morePopup.close();
     },
     },
+    /** 列表「更多」→ 发起售后:跳转售后选花页 */
+    goRefund(item) {
+      this.closeMore();
+      if (!item || !item.id) {
+        return;
+      }
+      this.$util.pageTo({ url: '/pagesOrder/refund?id=' + item.id });
+    },
     openPrintLog(item) {
     openPrintLog(item) {
       this.closeMore();
       this.closeMore();
       uni.showLoading({ title: '加载中...' });
       uni.showLoading({ title: '加载中...' });

+ 2 - 2
ghsApp/src/components/forward-options-popup.vue

@@ -50,9 +50,9 @@ export default {
 				return '无关联销售单:退货回库;资金按下方选择处理。'
 				return '无关联销售单:退货回库;资金按下方选择处理。'
 			}
 			}
 			if (this.orderCleared) {
 			if (this.orderCleared) {
-				return '订单已结账,按隔天售后处理:不扣减订单实付,金额记入发起售后那天累计退款。'
+				return '订单已结账,按隔天售后处理:不扣减订单实付,金额记入天累计退款。'
 			}
 			}
-			return '隔天售后不扣减订单实付,金额记入发起售后那天累计退款。'
+			return '隔天售后不扣减订单实付,金额记入天累计退款。'
 		},
 		},
 		fundOptions() {
 		fundOptions() {
 			if (this.forceBalance) {
 			if (this.forceBalance) {

+ 44 - 0
ghsApp/src/pagesOrder/refundAllList.vue

@@ -21,6 +21,12 @@
               <text>时间:{{item.addTime.substr(5,11)}}</text>
               <text>时间:{{item.addTime.substr(5,11)}}</text>
               <text v-if="!$util.isEmpty(item.refundInfo.remark)" style="color:red;font-weight:bold;">备注:{{item.refundInfo.remark}}</text>
               <text v-if="!$util.isEmpty(item.refundInfo.remark)" style="color:red;font-weight:bold;">备注:{{item.refundInfo.remark}}</text>
               <text>状态:{{ item.status==0?'待审核':item.status==1?'已通过':item.status==2?'已驳回':item.status==3 ? '已取消':'' }}</text>
               <text>状态:{{ item.status==0?'待审核':item.status==1?'已通过':item.status==2?'已驳回':item.status==3 ? '已取消':'' }}</text>
+              <!-- 已通过且返充余额:列表可直接查看凭证 -->
+              <text
+                v-if="Number(item.refundInfo.status) === 1 && Number(item.refundInfo.fundType) === 2"
+                class="poster-link"
+                @click.stop="goPoster(item.refundInfo)"
+              >查看凭证</text>
           </view>
           </view>
           <view class="flex val">¥{{parseFloat(item.xhPrice)}} <view class="iconfont iconxiangyou"></view> </view>
           <view class="flex val">¥{{parseFloat(item.xhPrice)}} <view class="iconfont iconxiangyou"></view> </view>
         </block>
         </block>
@@ -174,6 +180,39 @@ export default {
       }
       }
       this.$util.pageTo({url: '/pagesOrder/refundDetail?from=1&id='+item.id})
       this.$util.pageTo({url: '/pagesOrder/refundDetail?from=1&id='+item.id})
     },
     },
+    /**
+     * 返充余额凭证:跳转 forwardResult 补发海报
+     * @param {Object} refundInfo 售后主单(含 fundType/customId/orderSn)
+     */
+    goPoster(refundInfo) {
+      if (!refundInfo || !refundInfo.id) {
+        return
+      }
+      const payload = {
+        fundType: refundInfo.fundType,
+        amount: refundInfo.refundPrice,
+        customId: refundInfo.customId,
+        customName: refundInfo.customName || '',
+        forwardSn: refundInfo.orderSn || '',
+        forwardId: refundInfo.id || 0,
+        orderId: 0,
+        mode: 'repost'
+      }
+      uni.setStorageSync('forwardResultPayload', payload)
+      this.$util.pageTo({
+        url: '/admin/billing/forwardResult',
+        query: {
+          fundType: payload.fundType,
+          amount: payload.amount,
+          customId: payload.customId,
+          customName: encodeURIComponent(payload.customName || ''),
+          forwardSn: payload.forwardSn,
+          forwardId: payload.forwardId,
+          orderId: payload.orderId,
+          mode: 'repost'
+        }
+      })
+    },
     getRefundData() {
     getRefundData() {
       let ids = []
       let ids = []
       this.itemClassData.forEach((item) => {
       this.itemClassData.forEach((item) => {
@@ -234,6 +273,11 @@ export default {
 .qa_cause{
 .qa_cause{
   color:blue;
   color:blue;
 }
 }
+.poster-link {
+  color: #3385ff;
+  font-weight: bold;
+  margin-top: 6upx;
+}
 .class-popup-style {
 .class-popup-style {
   z-index: 99999;
   z-index: 99999;
 }
 }

+ 66 - 2
ghsApp/src/pagesOrder/refundDetail.vue

@@ -64,6 +64,11 @@
 				</view>
 				</view>
 			</view>
 			</view>
 
 
+			<view class="refund-row" v-if="Number(info.sameDay) === 0 || Number(info.fundType) > 0">
+				<view class="refund-label">售后类型</view>
+				<view class="refund-value">{{ sameDayFundText }}</view>
+			</view>
+
 			<view class="refund-row">
 			<view class="refund-row">
 				<view class="refund-label">操作人员</view>
 				<view class="refund-label">操作人员</view>
 				<view class="refund-value">{{ info.shopAdminName || '' }}</view>
 				<view class="refund-value">{{ info.shopAdminName || '' }}</view>
@@ -112,6 +117,12 @@
 				class="admin-button-com big refund-actions__btn refund-actions__btn--reject"
 				class="admin-button-com big refund-actions__btn refund-actions__btn--reject"
 				@click="reject()"
 				@click="reject()"
 			>驳回</button>
 			>驳回</button>
+			<!-- 返充余额:查看/补发退款凭证海报 -->
+			<button
+				v-if="canShowPoster"
+				class="admin-button-com big blue refund-actions__btn"
+				@click="goPoster()"
+			>查看凭证</button>
 			<button
 			<button
 				v-if="info.status == 1"
 				v-if="info.status == 1"
 				class="admin-button-com big blue refund-actions__btn"
 				class="admin-button-com big blue refund-actions__btn"
@@ -171,6 +182,20 @@ export default {
 		}
 		}
 	},
 	},
 	computed: {
 	computed: {
+		/** 已通过且返充余额时可查看凭证 */
+		canShowPoster() {
+			return Number(this.info.status) === 1 && Number(this.info.fundType) === 2
+		},
+		/** 隔天/资金方式文案 */
+		sameDayFundText() {
+			const sameDay = Number(this.info.sameDay)
+			const fund = Number(this.info.fundType)
+			const dayText = sameDay === 0 ? '隔天售后' : '当天售后'
+			if (fund === 2) return dayText + ' · 返充余额'
+			if (fund === 3) return dayText + ' · 仅记账'
+			if (fund === 1) return dayText + ' · 原路退回'
+			return dayText
+		},
 		/** 申请原因文案 */
 		/** 申请原因文案 */
 		causeText() {
 		causeText() {
 			const causeMap = {
 			const causeMap = {
@@ -284,7 +309,12 @@ export default {
 							that.needCancelRemind(res.data.clearId)
 							that.needCancelRemind(res.data.clearId)
 						} else {
 						} else {
 							that.$msg('操作成功')
 							that.$msg('操作成功')
-							that.init()
+							// 通过后若返充余额,直接进凭证页
+							that.init().then(() => {
+								if (that.canShowPoster) {
+									that.goPoster()
+								}
+							})
 						}
 						}
 					}
 					}
 				})
 				})
@@ -296,6 +326,40 @@ export default {
 				that.$util.pageTo({ url: '/admin/clear/customInfo?id=' + id })
 				that.$util.pageTo({ url: '/admin/clear/customInfo?id=' + id })
 			})
 			})
 		},
 		},
+		/**
+		 * 跳转退款凭证海报(mode=repost 从详情补发)
+		 * fundType=2 返充余额才有凭证
+		 */
+		goPoster() {
+			const info = this.info || {}
+			const orderId = info.relateOrderId
+				|| (info.orderInfo && info.orderInfo.id)
+				|| 0
+			const payload = {
+				fundType: info.fundType,
+				amount: info.refundPrice,
+				customId: info.customId,
+				customName: info.customName || '',
+				forwardSn: info.orderSn || '',
+				forwardId: info.id || 0,
+				orderId: orderId,
+				mode: 'repost'
+			}
+			uni.setStorageSync('forwardResultPayload', payload)
+			this.$util.pageTo({
+				url: '/admin/billing/forwardResult',
+				query: {
+					fundType: payload.fundType,
+					amount: payload.amount,
+					customId: payload.customId,
+					customName: encodeURIComponent(payload.customName || ''),
+					forwardSn: payload.forwardSn,
+					forwardId: payload.forwardId,
+					orderId: payload.orderId,
+					mode: 'repost'
+				}
+			})
+		},
 		/** 预览售后图片:urls 与列表缩略图同源,current 传 URL 避免 App 端滑动加载失败 */
 		/** 预览售后图片:urls 与列表缩略图同源,current 传 URL 避免 App 端滑动加载失败 */
 		showBig(index) {
 		showBig(index) {
 			const urls = this.getPreviewImageUrls()
 			const urls = this.getPreviewImageUrls()
@@ -329,7 +393,7 @@ export default {
 			this.$util.pageTo({ url: '/pagesOrder/refundSuccess?id=' + this.option.id })
 			this.$util.pageTo({ url: '/pagesOrder/refundSuccess?id=' + this.option.id })
 		},
 		},
 		init() {
 		init() {
-			refundDetail({ id: this.option.id }).then(res => {
+			return refundDetail({ id: this.option.id }).then(res => {
 				this.product = res.data.itemList || []
 				this.product = res.data.itemList || []
 				this.refundType = res.data.info.refundType || 0
 				this.refundType = res.data.info.refundType || 0
 				this.refundPrice = res.data.info.refundPrice ? parseFloat(res.data.info.refundPrice) : 0
 				this.refundPrice = res.data.info.refundPrice ? parseFloat(res.data.info.refundPrice) : 0