浏览代码

bug修改

wangfei 6 年前
父节点
当前提交
761851fc04
共有 1 个文件被更改,包括 49 次插入49 次删除
  1. 49
    49
      src/pages/sales/cardAndCouponNum/index.vue

+ 49
- 49
src/pages/sales/cardAndCouponNum/index.vue 查看文件

@@ -50,13 +50,13 @@
50 50
               <span>用户领取</span>
51 51
             </li>
52 52
             <li class="flex-h" v-for="(item,index) in data.CustomerCard" :key="index">
53
-              <span>{{salesData(item).name}}</span>
53
+              <span>{{item.RealName}}</span>
54 54
               <div class="flex-item">
55 55
                 <div>
56
-                  <span>{{salesData(item).receive}}</span>
56
+                  <span>{{item.ReceiveNum}}</span>
57 57
                 </div>
58 58
               </div>
59
-              <span>{{salesData(item).used}}</span>
59
+              <span>{{item.UsedNum}}</span>
60 60
             </li>
61 61
           </ul>
62 62
         </div>
@@ -79,68 +79,68 @@ export default {
79 79
   created () {
80 80
     if (this.$route.query.type === 'card') {
81 81
       this.getCardNum({ id: this.$route.query.id }).then(() => {
82
-        this.getSales({ type: 'sales' }).then(() => {
83
-          this.data = this.cardAndCoupon
84
-          this.data.CustomerCard = this.data.CustomerCard || []
85
-          this.showPage = true
86
-        })
82
+        // this.getSales({ type: 'sales' }).then(() => {
83
+        this.data = this.cardAndCoupon
84
+        this.data.CustomerCard = this.data.CustomerCard || []
85
+        this.showPage = true
86
+        // })
87 87
       })
88 88
     } else {
89 89
       this.getCouponNum({ id: this.$route.query.id }).then(() => {
90
-        this.getSales({ type: 'sales' }).then(() => {
90
+        // this.getSales({ type: 'sales' }).then(() => {
91 91
           this.data = this.cardAndCoupon
92 92
           this.data.CustomerCard = this.data.CustomerCoupon || []
93 93
           this.showPage = true
94
-        })
94
+        // })
95 95
       })
96 96
     }
97 97
   },
98 98
   computed: {
99 99
     ...mapForbidState({
100
-      salesList: x => x.salesList,
100
+      // salesList: x => x.salesList,
101 101
       cardAndCoupon: x => x.cardAndCoupon
102 102
     })
103 103
   },
104 104
   methods: {
105
-    ...mapForbidActions(['getCardNum', 'getCouponNum', 'getSales']),
106
-    salesData (item) {
107
-      let receive = 0
108
-      let used = 0
109
-      let name
110
-      if (this.$route.query.type === 'card') {
111
-        for (let i = 0; i < this.salesList.length; i++) {
112
-          this.salesList[i].CustomerCard = this.salesList[i].CustomerCard || []
113
-          for (let j = 0; j < this.salesList[i].CustomerCard.length; j++) {
114
-            if (this.salesList[i].CustomerCard[j].SalesId === item.SalesId) {
115
-              name = this.salesList[i].RealName
116
-              receive++
117
-              if (!item.VerifyStatus) {
118
-                used++
119
-              }
120
-            }
121
-          }
122
-        }
123
-      } else {
124
-        for (let i = 0; i < this.salesList.length; i++) {
125
-          this.salesList[i].CustomerCoupon = this.salesList[i].CustomerCoupon || []
126
-          for (let j = 0; j < this.salesList[i].CustomerCoupon.length; j++) {
127
-            if (this.salesList[i].CustomerCoupon[j].SalesId === item.SalesId) {
128
-              name = this.salesList[i].RealName
129
-              receive++
130
-              if (!item.VerifyStatus) {
131
-                used++
132
-              }
133
-            }
134
-          }
135
-        }
136
-      }
105
+    ...mapForbidActions(['getCardNum', 'getCouponNum']),
106
+    // salesData (item) {
107
+    //   let receive = 0
108
+    //   let used = 0
109
+    //   let name
110
+    //   if (this.$route.query.type === 'card') {
111
+    //     for (let i = 0; i < this.salesList.length; i++) {
112
+    //       this.salesList[i].CustomerCard = this.salesList[i].CustomerCard || []
113
+    //       for (let j = 0; j < this.salesList[i].CustomerCard.length; j++) {
114
+    //         if (this.salesList[i].CustomerCard[j].SalesId === item.SalesId) {
115
+    //           name = this.salesList[i].RealName
116
+    //           receive++
117
+    //           if (!item.VerifyStatus) {
118
+    //             used++
119
+    //           }
120
+    //         }
121
+    //       }
122
+    //     }
123
+    //   } else {
124
+    //     for (let i = 0; i < this.salesList.length; i++) {
125
+    //       this.salesList[i].CustomerCoupon = this.salesList[i].CustomerCoupon || []
126
+    //       for (let j = 0; j < this.salesList[i].CustomerCoupon.length; j++) {
127
+    //         if (this.salesList[i].CustomerCoupon[j].SalesId === item.SalesId) {
128
+    //           name = this.salesList[i].RealName
129
+    //           receive++
130
+    //           if (!item.VerifyStatus) {
131
+    //             used++
132
+    //           }
133
+    //         }
134
+    //       }
135
+    //     }
136
+    //   }
137 137
 
138
-      return {
139
-        'name': name,
140
-        'receive': receive,
141
-        'used': used
142
-      }
143
-    },
138
+    //   return {
139
+    //     'name': name,
140
+    //     'receive': receive,
141
+    //     'used': used
142
+    //   }
143
+    // },
144 144
   }
145 145
 }
146 146
 </script>