许成详 6 yıl önce
ebeveyn
işleme
1e67b8a1ba

+ 26
- 12
src/pages/system/cardAndCouponManager/couponManager/edit.vue Dosyayı Görüntüle

@@ -132,6 +132,9 @@
132 132
                 <el-table-column
133 133
                   prop="TargetType"
134 134
                   label="分类">
135
+                  <template slot-scope="scope">
136
+                    {{returnGoodsType(scope.row.TargetType)}}
137
+                  </template>
135 138
                 </el-table-column>
136 139
                 <el-table-column label="操作">
137 140
                   <template slot-scope="scope">
@@ -409,18 +412,20 @@ export default {
409 412
         page: 1,
410 413
         pagesize: 10000
411 414
       }).then(() => {
412
-        if (this.$route.query.id) {
413
-          this.getCouponById({
414
-            id: this.$route.query.id
415
-          }).then((res) => {
416
-            // console.log(JSON.stringify(res))
417
-            res.coupon.IsAll = String(res.coupon.IsAll)
418
-            if (res.coupon.VideoUrl !== '') {
419
-              this.videoOff = true
420
-            }
421
-            this.couponInfo = res.coupon
422
-          })
423
-        }
415
+        this.GetGoodTypes({ pagesize: 1000, caseid: this.$route.query.caseid }).then(() => {
416
+          if (this.$route.query.id) {
417
+            this.getCouponById({
418
+              id: this.$route.query.id
419
+            }).then((res) => {
420
+              // console.log(JSON.stringify(res))
421
+              res.coupon.IsAll = String(res.coupon.IsAll)
422
+              if (res.coupon.VideoUrl !== '') {
423
+                this.videoOff = true
424
+              }
425
+              this.couponInfo = res.coupon
426
+            })
427
+          }
428
+        })
424 429
       })
425 430
     })
426 431
   },
@@ -434,6 +439,7 @@ export default {
434 439
     }),
435 440
     ...mapGoodsState({
436 441
       goodsList: x => x.goodsList,
442
+      goodsTypes: x => x.goodsTypes.list,
437 443
     }),
438 444
     ...mapCourseState({
439 445
       courseList: x => x.courseList,
@@ -450,6 +456,7 @@ export default {
450 456
   methods: {
451 457
     ...mapGoodsActions([
452 458
       'GetGoodsList',
459
+      'GetGoodTypes',
453 460
     ]),
454 461
     ...mapCouponActions([
455 462
       'addCoupon',
@@ -462,6 +469,13 @@ export default {
462 469
     ...mapCourseActions([
463 470
       'GetCourseList',
464 471
     ]),
472
+    returnGoodsType (val) {
473
+      for (var n = 0; n < this.goodsTypes.length; n++) {
474
+        if (this.goodsTypes[n].TypeId === val) {
475
+          return this.goodsTypes[n].TypeName
476
+        }
477
+      }
478
+    },
465 479
     deleteVideo () { // 删除视频
466 480
       this.couponInfo.VideoUrl = ''
467 481
       this.videoOff = false

+ 1
- 1
src/pages/system/cardAndCouponManager/couponManager/index.vue Dosyayı Görüntüle

@@ -282,7 +282,7 @@ export default {
282 282
       this.getList()
283 283
     },
284 284
     handleEdit (index, row) { // 编辑
285
-      this.$router.push({ name: 'editCoupon', query: { type: row.CouponTypeId, id: row.CouponId } })
285
+      this.$router.push({ name: 'editCoupon', query: { type: row.CouponTypeId, id: row.CouponId, caseid: row.CaseId } })
286 286
     },
287 287
     handleDelete (index, row) { // 删除
288 288
       let name = '确认删除渠道“' + row.ChannelName + '”?'

+ 10
- 7
src/store/goods/goods.js Dosyayı Görüntüle

@@ -38,13 +38,16 @@ export default {
38 38
       })
39 39
     },
40 40
     GetGoodTypes ({ commit }, payload) {
41
-      ajax(api.goodsManager.getGoodsTypeList.url, {
42
-        method: api.goodsManager.getGoodsTypeList.method,
43
-        queryData: {
44
-          ...payload,
45
-        }
46
-      }).then(res => {
47
-        commit('updateTypes', res)
41
+      return new Promise((resolve, reject) => {
42
+        ajax(api.goodsManager.getGoodsTypeList.url, {
43
+          method: api.goodsManager.getGoodsTypeList.method,
44
+          queryData: {
45
+            ...payload,
46
+          }
47
+        }).then(res => {
48
+          commit('updateTypes', res)
49
+          resolve(res)
50
+        }).catch(reject)
48 51
       })
49 52
     },
50 53
     GetGoodSpecs ({ commit }, payload) {