Browse Source

bug 修复

zhangdan 4 years ago
parent
commit
e859b3f02a
2 changed files with 13 additions and 6 deletions
  1. 9 1
      src/views/Order/OrderCenter.vue
  2. 4 5
      src/views/Order/OrderDetailModal.vue

+ 9 - 1
src/views/Order/OrderCenter.vue

@@ -70,6 +70,11 @@
         <template v-if=" record.payStatus == 'PAID' ">{{ record.paymentAmount }}</template>
         <template v-if=" record.payStatus == 'PAID' ">{{ record.paymentAmount }}</template>
         <template v-else-if=" record.payStatus != 'PAID' ">{{ 0 }}</template>
         <template v-else-if=" record.payStatus != 'PAID' ">{{ 0 }}</template>
       </span>
       </span>
+      <!-- 优惠 -->
+      <span slot="couponAmount" slot-scope="text, record">
+        <template v-if=" record.orderStatus != 'CANCELED' ">{{ record.couponAmount }}</template>
+        <template v-else-if=" record.orderStatus == 'CANCELED' ">{{ 0 }}</template>
+      </span>
       <!-- 操作 -->
       <!-- 操作 -->
       <span slot="action" slot-scope="text, record">
       <span slot="action" slot-scope="text, record">
         <a-button type="primary" @click="seeDetail(record)">查看</a-button>
         <a-button type="primary" @click="seeDetail(record)">查看</a-button>
@@ -178,7 +183,10 @@ export default {
         title: '优惠(¥)',
         title: '优惠(¥)',
         dataIndex: 'couponAmount',
         dataIndex: 'couponAmount',
         minWidth: '40',
         minWidth: '40',
-        align: 'center'
+        align: 'center',
+        scopedSlots: {
+          customRender: 'couponAmount'
+        }
       },
       },
       {
       {
         title: '状态',
         title: '状态',

+ 4 - 5
src/views/Order/OrderDetailModal.vue

@@ -58,7 +58,7 @@
             </a-col>
             </a-col>
             <a-col :span="8">
             <a-col :span="8">
               <a-form-item label="优惠(¥)" :label-col="{ span:6 }" :wrapper-col="{ span:12}">
               <a-form-item label="优惠(¥)" :label-col="{ span:6 }" :wrapper-col="{ span:12}">
-                <span>{{ orderDetailData.couponAmount }} 元</span>
+                <span>{{ orderDetailData.orderCoupons ? orderDetailData.couponAmount : 0 }} 元</span>
               </a-form-item>
               </a-form-item>
             </a-col>
             </a-col>
           </a-row>
           </a-row>
@@ -66,7 +66,6 @@
             <a-col :span="8">
             <a-col :span="8">
               <a-form-item label="使用优惠券" :label-col="{ span:6 }" :wrapper-col="{ span:12}">
               <a-form-item label="使用优惠券" :label-col="{ span:6 }" :wrapper-col="{ span:12}">
                 <span>{{ orderDetailData.orderCoupons ? orderDetailData.orderCoupons[0].couponTitle : '-' }}</span>
                 <span>{{ orderDetailData.orderCoupons ? orderDetailData.orderCoupons[0].couponTitle : '-' }}</span>
-
               </a-form-item>
               </a-form-item>
             </a-col>
             </a-col>
             <a-col :span="8">
             <a-col :span="8">
@@ -75,7 +74,8 @@
                   <div class="imgBox">
                   <div class="imgBox">
                     <div>
                     <div>
                       <img v-if="orderDetailData.beginImage" class="imgCar" :src="orderDetailData.beginImage" alt="" @click="isShowBeginImageModal=true">
                       <img v-if="orderDetailData.beginImage" class="imgCar" :src="orderDetailData.beginImage" alt="" @click="isShowBeginImageModal=true">
-                      <div v-if="!orderDetailData.beginImage" class="imgCar">--</div>
+                      <!-- <div v-else-if="orderDetailData.beginImage">{{ orderDetailData.beginImage }}</div> -->
+                      <div v-else-if="!orderDetailData.beginImage" class="imgCar">--</div>
                     </div>
                     </div>
                     <div>洗车前</div>
                     <div>洗车前</div>
                   </div>
                   </div>
@@ -86,7 +86,6 @@
                     </div>
                     </div>
                     <div>洗车后</div>
                     <div>洗车后</div>
                   </div>
                   </div>
-
                 </div>
                 </div>
               </a-form-item>
               </a-form-item>
             </a-col>
             </a-col>
@@ -169,12 +168,12 @@ export default {
           id: newValue
           id: newValue
         }).then(res => {
         }).then(res => {
           // console.log(res, '------------')
           // console.log(res, '------------')
+          this.orderDetailData = res.data
           if (res.status == 200) {
           if (res.status == 200) {
             setTimeout(() => {
             setTimeout(() => {
               res.data.orderStatus = this.$refs.orderStatus.getNameByCode(res.data.orderStatus)
               res.data.orderStatus = this.$refs.orderStatus.getNameByCode(res.data.orderStatus)
             }, 500)
             }, 500)
           }
           }
-          this.orderDetailData = res.data
         })
         })
       }
       }
     },
     },