Преглед на файлове

fix: 单笔退款写入退款原因,退款申请原因改为可选

单笔退款分支创建 RefundLog 时漏写 reason,导致退款原因未入库;同时取消 admin-h5/admin-web 退款申请时退款原因的必填校验。
skyline преди 1 месец
родител
ревизия
47cf251c3e

+ 2 - 4
admin-h5/src/pages/user/list.vue

@@ -118,7 +118,7 @@
         </view>
         </view>
         <view class="modal-footer">
         <view class="modal-footer">
           <button class="modal-btn cancel" @click="closeRefundModal">取消</button>
           <button class="modal-btn cancel" @click="closeRefundModal">取消</button>
-          <button class="modal-btn confirm" @click="confirmRefund" :disabled="!refundReason.trim()">确认</button>
+          <button class="modal-btn confirm" @click="confirmRefund">确认</button>
         </view>
         </view>
       </view>
       </view>
     </view>
     </view>
@@ -224,12 +224,10 @@ const closeRefundModal = () => {
 }
 }
 
 
 const confirmRefund = async () => {
 const confirmRefund = async () => {
-  if (!refundReason.value.trim()) return
-
   try {
   try {
     const res = await applyRefund({
     const res = await applyRefund({
       userId: refundUser.value.userId,
       userId: refundUser.value.userId,
-      reason: refundReason.value.trim()
+      reason: (refundReason.value || '').trim()
     })
     })
     if (res && res.code === 200) {
     if (res && res.code === 200) {
       closeRefundModal()
       closeRefundModal()

+ 1 - 5
admin-web/src/views/admin/account/index.vue

@@ -306,12 +306,8 @@ const handleUserRefundApply = (row:any) => {
     ).then((res: any) => {
     ).then((res: any) => {
       let {value, action} = res;
       let {value, action} = res;
       if (action === 'confirm') {
       if (action === 'confirm') {
-        if(!value){
-          Msg.message("请明确退款原因,否则无法发起本操作",'error')
-          return
-        }
         Msg.showLoading(`请等待`);
         Msg.showLoading(`请等待`);
-        $body(`finance/applyRefund`,{userId:row.userId,reason:value}).then(()=>{
+        $body(`finance/applyRefund`,{userId:row.userId,reason:(value||'').trim()}).then(()=>{
           Msg.message("退款已发起")
           Msg.message("退款已发起")
           Msg.hideLoading()
           Msg.hideLoading()
           loadData(true)
           loadData(true)

+ 2 - 1
car-wash-service/src/main/java/com/kym/service/wechat/impl/WxPayServiceImpl.java

@@ -569,7 +569,8 @@ public class WxPayServiceImpl implements WxPayService {
                     .setTotal(payLogs.get(0).getTotal())
                     .setTotal(payLogs.get(0).getTotal())
                     .setRefund(refundAmount.get())
                     .setRefund(refundAmount.get())
                     .setDiscountAmount(account.getDiscountAmount())
                     .setDiscountAmount(account.getDiscountAmount())
-                    .setOutRefundNo(OrderUtils.getOrderNo());
+                    .setOutRefundNo(OrderUtils.getOrderNo())
+                    .setReason(reason);
             refundLogService.save(refundLog);
             refundLogService.save(refundLog);
         } else if (!CommUtil.isEmptyOrNull(payLogs) && payLogs.get(0).getTotal() < refundAmount.get()) {
         } else if (!CommUtil.isEmptyOrNull(payLogs) && payLogs.get(0).getTotal() < refundAmount.get()) {
             // 最后一次的充值金额不能覆盖退款金额,拆分成多笔退款
             // 最后一次的充值金额不能覆盖退款金额,拆分成多笔退款