Browse Source

页面优化

lilei 4 years ago
parent
commit
6f42480a5b

+ 9 - 2
src/views/SetmealSales/SetmealDetailModal.vue

@@ -70,10 +70,11 @@
             :columns="setMealColumns"
             :dataSource="setMealData"
             :pagination="false"
+            :loading="loading"
             bordered>
             <!-- 到期时间 -->
             <span slot="expiryDate" slot-scope="text, record">
-              <span v-if="record.cycleFlag==0">{{record.expiryDate}}</span>
+              <span v-if="record.cycleFlag==0">{{ record.expiryDate }}</span>
               <span v-else>--</span>
             </span>
             <!-- 操作 -->
@@ -154,12 +155,14 @@ export default {
       recordData: [], //  使用记录
       detailsData: null, //  套餐数据
       setDelay: false, //  延期设置
-      serverData: null //  套餐包含服务 数据
+      serverData: null, //  套餐包含服务 数据
+      loading: false
     }
   },
   methods: {
     // 套餐详情
     getSetmealInfo () {
+      this.loading = true
       //  套餐详情
       customerBundleDetail({ id: this.setmealId }).then(res => {
         if (res.status == 200) {
@@ -177,6 +180,7 @@ export default {
           this.detailsData = null
           this.setMealData = []
         }
+        this.loading = false
       })
       //  使用记录
       customerBundleUseHistory({ id: this.setmealId }).then(res => {
@@ -231,6 +235,9 @@ export default {
     isShow (val) {
       if (!val) {
         this.$emit('close')
+        this.setMealData = []
+        this.recordData = []
+        this.detailsData = null
       }
     },
     setmealId (newValue, oldValue) {

+ 5 - 0
src/views/SetmealSales/SetmealItemDetailModal.vue

@@ -19,6 +19,7 @@
           :columns="columns_item"
           :dataSource="bundleItemList"
           :pagination="false"
+          :loading="loading"
           bordered>
           <!-- 服务价格 -->
           <template slot="itemPrice" slot-scope="text, record">{{ record.itemPrice ? record.itemPrice : 0 }}元</template>
@@ -55,6 +56,7 @@ export default {
   },
   data () {
     return {
+      loading: false,
       isShow: this.openModal, //  弹框是否展示
       columns_item: [
         { title: '服务名称', dataIndex: 'itemName', width: 120, align: 'center' },
@@ -69,6 +71,7 @@ export default {
   methods: {
     //  套餐信息
     getSetmealInfo (id) {
+      this.loading = true
       getBundleDetails({ id: id }).then(res => {
         console.log(res)
         if (res.status == 200) {
@@ -76,6 +79,7 @@ export default {
         } else {
           this.bundleItemList = []
         }
+        this.loading = false
       })
     }
   },
@@ -88,6 +92,7 @@ export default {
     isShow (val) {
       if (!val) {
         this.$emit('close')
+        this.bundleItemList = []
       }
     },
     setmealId (newValue, oldValue) {