Jelajahi Sumber

一键退款

shish 1 tahun lalu
induk
melakukan
ed40da9269
2 mengubah file dengan 18 tambahan dan 1 penghapusan
  1. 14 1
      hdApp/src/admin/order/detail.vue
  2. 4 0
      hdApp/src/api/refund/index.js

+ 14 - 1
hdApp/src/admin/order/detail.vue

@@ -180,7 +180,8 @@
       <view class="flex-center"> </view>
       <view class="operate-btn-wrap">
         <button class="admin-button-com middle" @click.stop="cancelFn(orderInfo)" v-if="orderInfo.status == 1">取消</button>
-          <button class="admin-button-com middle" @click.stop="printOrder(orderInfo)" v-if="orderInfo.payStatus == 1">打印</button>
+        <button class="admin-button-com middle" @click.stop="printOrder(orderInfo)" v-if="orderInfo.payStatus == 1">打印</button>
+        <button class="admin-button-com middle" @click.stop="backMoney(orderInfo)" v-if="orderInfo.status == 5">一键退款</button>
       </view>
     </view>
   </view>
@@ -196,6 +197,7 @@ import { onlinePrintOrder,cancelOrder } from '@/api/order'
 import { getDetB} from "@/api/order";
 const commonUtil = require("@/utils/common.js");
 import { confirmSettle } from "@/api/settle/index"
+import { refundAmount } from "@/api/refund";
 export default {
   name: "detail",
   components: { detailGoods, AppCoupon, ModalModule, RateModule,detailItem,detailWork },
@@ -245,6 +247,17 @@ export default {
         })
 			})
     },
+		backMoney(info){
+			refundAmount({id:info.id}).then(res=>{
+				if(res.code == 1){
+					if(res.data.status == 1){
+						this.$msg('退款成功')
+					}else{
+						this.$msg(res.msg)
+					}
+				}
+			})
+		},
     printOrder(item){
       onlinePrintOrder({id:item.id}).then(res=>{
         if(res.code == 1){

+ 4 - 0
hdApp/src/api/refund/index.js

@@ -1,5 +1,9 @@
 import https from '@/plugins/luch-request_0.0.7/request'
 
+export const refundAmount = data => {
+	return https.get('/refund/refund-amount', data)
+}
+
 export const allRefund = data => {
 	return https.get('/refund/all-refund', data)
 }