Jelajahi Sumber

退款申请

shish 3 tahun lalu
induk
melakukan
4c5a42d2ab

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

@@ -1,5 +1,9 @@
 import https from '@/plugins/luch-request_0.0.7/request'
 
+export const cancelRefund = data => {
+	return https.get("/cg-refund/cancel-refund", data);
+};
+
 export const createRefund = data => {
 	return https.post("/cg-refund/create-refund", data);
 };

+ 5 - 5
hdApp/src/pagesPurchase/purDetails.vue

@@ -104,14 +104,14 @@
           <view>{{ detailInfo.status==1?'待付款' :detailInfo.status==2?'待配送' :detailInfo.status==3?'配送中' :detailInfo.status==4?'已完成' :detailInfo.status==5?'已取消' :'待付款' }}</view>
         </view>
 
-        <view v-if="detailInfo.refund == 2" class="order-info_box">
+        <view v-if="detailInfo.refundLog && detailInfo.refundLog == 1" class="order-info_box">
           <view>累计退款:</view>
-          <view style="color:red;font-weight:bold;font-size:30upx;">¥{{parseFloat(detailInfo.tkPrice)}}</view>
-            <view class="price" v-if="detailInfo.refund == 2">
-              <button @click="pageTo({url: '/pagesPurchase/refundList',query: {id: detailInfo.id}})" class="admin-button-com">退款记录</button>
+          <view style="color:red;font-weight:bold;font-size:30upx;">¥{{detailInfo.tkPrice?parseFloat(detailInfo.tkPrice):0}}</view>
+            <view class="price" v-if="detailInfo.refundLog && detailInfo.refundLog == 1">
+              <button @click="pageTo({url: '/pagesPurchase/refundList?id='+detailInfo.id})" class="admin-button-com">退款记录</button>
             </view>
         </view>
-        <view v-if="detailInfo.refund == 2" class="order-info_box">
+        <view v-if="detailInfo.refundLog && detailInfo.refundLog == 1" class="order-info_box">
           <view>退款方式:</view>
           <view style="color:red;font-weight:bold;font-size:30upx;">{{detailInfo.tkExplain||''}}</view>
         </view>

+ 45 - 4
hdApp/src/pagesPurchase/refundDetail.vue

@@ -5,7 +5,7 @@
       <view class="module-com content-box proInfo">
         <view class="commodity-view">
           <view class="infoAEdit">
-            <text>退款花材</text>
+            <text>申请退款花材</text>
           </view>
           <view class="commodity-list">
             <view v-for="(s, idx) in refundData.itemList" :key="idx" class="commodity-item">
@@ -31,25 +31,48 @@
 			<view class="content-box price-detail">
 				<div class="module-com input-line-wrap">
 
+          <tui-list-cell class="line-cell" :hover="false">
+						<div class="tui-title">状态</div>
+            <div class="detail-price_box">
+              {{ refundData.info.status==0?'待审核':refundData.info.status==1?'已通过':refundData.info.status==2?'已驳回':refundData.info.status==3?'已取消':'' }}
+            </div>
+					</tui-list-cell>
+
 					<tui-list-cell class="line-cell" :hover="false">
 						<div class="tui-title">金额</div>
             <div class="detail-price_box red">¥{{ refundPrice }}</div>
 					</tui-list-cell>
 
-          <tui-list-cell class="line-cell" :hover="false" v-if="detailInfo.remark !=''">
+          <tui-list-cell class="line-cell" :hover="false" v-if="refundData.info.remark !=''">
             <div class="tui-title">备注</div>
             <div class="detail-price_box">{{ refundData.info.remark }}</div>
           </tui-list-cell>
 
 				</div>
 			</view>
+      <block v-if="refundData.info && refundData.info.smallImgList && !$util.isEmpty(refundData.info.smallImgList)">
+        <view style="background-color: white;border-radius: 10upx;height:200upx;">
+          <view style="font-size:26upx;padding-left:20upx;text-align:left;color:#666666;margin-bottom:20upx;padding-top:20upx;">花损图片</view>
+          <view v-for="(itemImg, indexImg) in refundData.info.smallImgList" :key="indexImg">
+            <image :src="itemImg" style="width:100upx;height:100upx;float:left;margin-left:20upx;" @click="showBig(indexImg)" mode="widthFix"></image>
+          </view>
+        </view>
+      </block>
 
     </view>
+
+    <view class="app-footer">
+      <view class="flex-center"> </view>
+      <view class="operate-btn-wrap">
+        <button class="admin-button-com middle" @click.stop="cancelFn(refundData.info)" v-if="refundData.info.status == 0">取消申请</button>
+      </view>
+    </view>
+
   </view>
 </template>
-
 <script>
 import { getRefundData} from "@/api/purchase/refund";
+import { cancelRefund } from "@/api/cg-refund"
 import TuiListCell from "@/components/plugin/list-cell";
 export default {
   name: "refundDetail",
@@ -71,6 +94,24 @@ export default {
     this.initData()
   },
   methods: {
+    showBig(index){
+      if(this.refundData.info && this.refundData.info.bigImgList && !this.$util.isEmpty(this.refundData.info.bigImgList)){
+        if(this.refundData.info.bigImgList[index]){
+          uni.previewImage({ urls: [this.refundData.info.bigImgList[index]] })
+        }
+      }
+    },
+    cancelFn(){
+      let that = this
+      that.$util.confirmModal({content:'确认取消?'},() => {
+        cancelRefund({id:this.option.id}).then((res) => {
+          if(res.code == 1){
+            that.$msg(res.msg)
+            that.initData()
+          }    
+        })
+      })
+    },
     init(){
 
     },
@@ -266,7 +307,7 @@ export default {
   }
   .detail-price_box {
     color: #333333;
-    font-size: 28upx;
+    font-size: 26upx;
     text-align: right;
     flex: 1;
     font-weight: 600;

+ 1 - 3
hdApp/src/pagesPurchase/refundList.vue

@@ -8,9 +8,7 @@
               <text>单号:{{item.orderSn}}</text>
               <text>操作:{{item.shopAdminName}}</text>
               <text>类型:{{item.book == 1 ? '预订单多退少补' :'普通'}}</text>
-
-              <text style="position:absolute;right:-425upx;top:0upx;">{{ item.status==0?'退款中':item.status==1?'已完成':'退款中' }}</text>    
-
+              <text style="position:absolute;right:-425upx;top:0upx;">{{ item.status==0?'待审核':item.status==1?'已通过':item.status==2?'已驳回':item.status==3?'已取消':'' }}</text>    
           </view>
           <view class="flex val">{{parseFloat(item.refundPrice)}} <view class="iconfont iconxiangyou"></view> </view>