Kaynağa Gözat

申请售后

shish 2 yıl önce
ebeveyn
işleme
12a86d16ba
1 değiştirilmiş dosya ile 43 ekleme ve 7 silme
  1. 43 7
      hdApp/src/pagesPurchase/purDetails.vue

+ 43 - 7
hdApp/src/pagesPurchase/purDetails.vue

@@ -263,22 +263,22 @@
       style="margin-right:50upx;padding-left:50upx;padding-right:50upx;">邀请付款</button>
 
       <block v-if="detailInfo.book == 0">
-        <button class="admin-button-com blue big" v-if="detailInfo.status== 3 || detailInfo.status== 2" @click="confirmTake()" style="margin-right:50upx;padding-left:50upx;padding-right:50upx;">确认收货</button>
+        <button class="admin-button-com blue big" v-if="detailInfo.status== 3 || detailInfo.status== 2" @click="affirmTake()" style="margin-right:50upx;padding-left:50upx;padding-right:50upx;">确认收货</button>
       </block>
       <block v-else>
-        <button class="admin-button-com blue big" v-if="detailInfo.status== 3" @click="confirmTake()" style="margin-right:50upx;padding-left:50upx;padding-right:50upx;">确认收货</button>
+        <button class="admin-button-com blue big" v-if="detailInfo.status== 3" @click="affirmTake()" style="margin-right:50upx;padding-left:50upx;padding-right:50upx;">确认收货</button>
       </block>
 
-      <button class="admin-button-com blue big" v-if="detailInfo.status== 4" @click="confirmTake()" style="margin-right:50upx;padding-left:50upx;padding-right:50upx;">再改价</button>
+      <button class="admin-button-com blue big" v-if="detailInfo.status== 4" @click="affirmTake()" style="margin-right:50upx;padding-left:50upx;padding-right:50upx;">再改价</button>
 
       <block v-if="detailInfo.status == 1">
         <button class="admin-button-com blue big" @click="toPay">去付款</button>
       </block>
       <block v-else>
         <block v-if="afterSale == 1">
-          <button class="admin-button-com default big" style="margin-right:60upx;" @click="refundOrder" v-if="detailInfo.status == 4">申请售后</button>
+          <button class="admin-button-com blue big" style="margin-right:60upx;" @click="refundOrder()">申请售后</button>
         </block>
-        <button class="admin-button-com blue big" @click="clearOrder" v-if="detailInfo.debt == 1">付款结清</button>
+        <button class="admin-button-com blue big" @click="clearOrder" v-if="detailInfo.debt == 1">结清本单</button>
       </block>
 
 		</view>
@@ -363,7 +363,7 @@ export default {
     this.beginInit()
   },
   methods: {
-    confirmTake(){
+    affirmTake(){
         this.pageTo({url: '/pagesPurchase/confirmTake?id='+this.detailInfo.id})
     },
 		copyWl(val){
@@ -376,7 +376,43 @@ export default {
 			});
 		},
     refundOrder(){
-      this.pageTo({url: '/pagesPurchase/refund?id='+this.detailInfo.id})
+      if(this.loginStyle == 0){
+        this.$msg('请先登录')
+        return false
+      }
+      let that = this
+      if(that.detailInfo.status == 5){
+        that.$util.confirmModal({content:'订单已取消'},() => {
+          that.beginInit()
+        })
+        return false
+      }
+      if(this.detailInfo.status == 1){
+        let that = this
+        that.$util.confirmModal({content:'订单未付款'},() => {
+          that.beginInit()
+        })
+        return false
+      }
+      if(this.detailInfo.status == 4){
+        that.pageTo({url: '/pagesPurchase/refund?id='+this.detailInfo.id})
+      }else{
+          if(this.detailInfo.pfShopId && this.detailInfo.pfShopId>0){
+            that.$util.confirmModal({content:'请先确认收货'},() => {
+              that.affirmTake()
+            })            
+          }else{
+            that.$util.confirmModal({content:'确认已收货?'},() => {
+              uni.showLoading({mask:true})
+              confirmTake({id:that.detailInfo.id}).then(res=>{
+                uni.hideLoading()
+                if(res.code == 1){
+                  that.pageTo({url: '/pagesPurchase/refund?id='+this.detailInfo.id})
+                }
+              })
+            })
+          }
+      }
     },
     clearOrder(){
       let arr = []