yuantianjiao 6 years ago
parent
commit
bb3dd6ddfa

+ 1
- 0
config/index.js View File

15
         // target: 'http://192.168.0.62:8080', //wf
15
         // target: 'http://192.168.0.62:8080', //wf
16
         // target: 'http://localhost:8080', 
16
         // target: 'http://localhost:8080', 
17
         target: 'http://192.168.0.11', //ys
17
         target: 'http://192.168.0.11', //ys
18
+        // target: 'http://192.168.0.11', //ys
18
         // target: 'http://dev.ycjcjy.com/', //frp
19
         // target: 'http://dev.ycjcjy.com/', //frp
19
         changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
20
         changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
20
         // pathRewrite: {
21
         // pathRewrite: {

+ 84
- 175
src/pages/system/cardAndCouponManager/bodyBuildingCardManager/edit.vue View File

6
           <span>选择案场:</span>
6
           <span>选择案场:</span>
7
           <div class="flex-item">
7
           <div class="flex-item">
8
             <div style="width:50%">
8
             <div style="width:50%">
9
-              <el-select v-model="cardInfo.CaseId" placeholder="请选择" @change="caseChange">
9
+              <el-select v-model="cardInfo.CaseId" placeholder="请选择" @change="caseChange" :disabled="disabled">
10
                 <el-option
10
                 <el-option
11
                   v-for="item in cases"
11
                   v-for="item in cases"
12
                   :key="item.CaseId"
12
                   :key="item.CaseId"
21
           <span>卡图片:</span>
21
           <span>卡图片:</span>
22
           <div class="flex-item">
22
           <div class="flex-item">
23
             <div>
23
             <div>
24
+              <a v-if="cardInfo.CardImageUrl && cardInfo.CardImageUrl.indexOf('.mp4') > -1" :href="cardInfo.CardImageUrl" target="blank" style="line-height:40px;">{{cardInfo.CardImageUrl}}</a>
24
               <el-upload
25
               <el-upload
25
                 class="avatar-uploader"
26
                 class="avatar-uploader"
26
                 :action='$api.file.image.url'
27
                 :action='$api.file.image.url'
27
                 :show-file-list="false"
28
                 :show-file-list="false"
28
                 :on-success="handleAvatarSuccess">
29
                 :on-success="handleAvatarSuccess">
29
-                <img v-if="cardInfo.Images" :src="cardInfo.Images[0].CardImageUrl" class="avatar">
30
-                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
30
+                <img v-if="cardInfo.CardImageUrl && cardInfo.CardImageUrl.indexOf('.mp4') === -1" :src="cardInfo.CardImageUrl" class="avatar">
31
+                <el-button type="primary" size="mini" v-if="!cardInfo.CardImageUrl || cardInfo.CardImageUrl.indexOf('.mp4') > -1">{{cardInfo.CardImageUrl.indexOf('.mp4') > -1 ? '更换' : '上传'}}文件</el-button>
32
+                <!-- <i v-else class="el-icon-plus avatar-uploader-icon"></i> -->
31
               </el-upload>
33
               </el-upload>
32
             </div>
34
             </div>
33
           </div>
35
           </div>
38
             <div style="width:200px;">
40
             <div style="width:200px;">
39
               <el-input
41
               <el-input
40
                 placeholder="请输入"
42
                 placeholder="请输入"
41
-                v-model="cardInfo.CardName"
42
-                clearable>
43
+                v-model="cardInfo.GymCardName"
44
+                clearable
45
+                :disabled="disabled">
43
               </el-input>
46
               </el-input>
44
             </div>
47
             </div>
45
           </div>
48
           </div>
46
         </li>
49
         </li>
50
+        <li class="flex-h">
51
+          <span>卡类型:</span>
52
+          <div class="flex-item">
53
+            <div>
54
+              <el-select v-model="cardInfo.GymTypeId" placeholder="请选择" :disabled="disabled">
55
+                <el-option
56
+                  v-for="item in GymTypeList"
57
+                  :key="item.id"
58
+                  :label="item.name"
59
+                  :value="item.id">
60
+                </el-option>
61
+              </el-select>
62
+            </div>
63
+          </div>
64
+        </li>
47
         <li class="flex-h">
65
         <li class="flex-h">
48
           <span>卡价格:</span>
66
           <span>卡价格:</span>
49
           <div class="flex-item">
67
           <div class="flex-item">
51
               <el-input
69
               <el-input
52
                 placeholder="请输入"
70
                 placeholder="请输入"
53
                 v-model="cardInfo.Price"
71
                 v-model="cardInfo.Price"
54
-                clearable>
72
+                clearable
73
+                :disabled="disabled">
55
               </el-input>
74
               </el-input>
56
             </div>
75
             </div>
57
           </div>
76
           </div>
63
               <el-input
82
               <el-input
64
                 placeholder="请输入"
83
                 placeholder="请输入"
65
                 v-model="cardInfo.TotalCount"
84
                 v-model="cardInfo.TotalCount"
66
-                clearable>
85
+                clearable
86
+                :disabled="disabled">
67
               </el-input>
87
               </el-input>
68
             </div>
88
             </div>
69
           </div>
89
           </div>
72
           <span>发送类型:</span>
92
           <span>发送类型:</span>
73
           <div class="flex-item">
93
           <div class="flex-item">
74
             <div>
94
             <div>
75
-              <el-radio v-model="cardInfo.SendType" label="channel">渠道</el-radio>
76
-              <el-radio v-model="cardInfo.SendType" label="case">案场</el-radio>
77
-              <el-radio v-model="cardInfo.SendType" label="system">系统</el-radio>
95
+              <el-radio v-model="cardInfo.SendType" label="channel" :disabled="disabled">渠道</el-radio>
96
+              <el-radio v-model="cardInfo.SendType" label="case" :disabled="disabled">案场</el-radio>
97
+              <el-radio v-model="cardInfo.SendType" label="system" :disabled="disabled">系统</el-radio>
78
             </div>
98
             </div>
79
           </div>
99
           </div>
80
         </li>
100
         </li>
82
           <span>选择渠道:</span>
102
           <span>选择渠道:</span>
83
           <div class="flex-item">
103
           <div class="flex-item">
84
             <div style="width:50%">
104
             <div style="width:50%">
85
-              <el-select v-model="cardInfo.ChannelId" placeholder="请选择">
105
+              <el-select v-model="cardInfo.ChannelId" placeholder="请选择" :disabled="disabled">
86
                 <el-option
106
                 <el-option
87
                   v-for="item in channelList"
107
                   v-for="item in channelList"
88
                   :key="item.ChannelId"
108
                   :key="item.ChannelId"
93
             </div>
113
             </div>
94
           </div>
114
           </div>
95
         </li>
115
         </li>
96
-        <li class="flex-h">
97
-          <span>目标课程:</span>
98
-          <div class="flex-item">
99
-            <div>
100
-              <el-select v-model="cardInfo.Targets[0].TargetId" placeholder="请选择">
101
-                <el-option
102
-                  v-for="item in courseList"
103
-                  :key="item.CourseId"
104
-                  :label="item.CourseName"
105
-                  :value="item.CourseId"
106
-                  :disabled="item.Status !== 1">
107
-                </el-option>
108
-              </el-select>
109
-            </div>
110
-          </div>
111
-        </li>
112
         <li class="flex-h">
116
         <li class="flex-h">
113
           <span>卡有效时间:</span>
117
           <span>卡有效时间:</span>
114
           <div class="flex-item">
118
           <div class="flex-item">
115
             <div>
119
             <div>
116
               <div class="addLine flex-h" style="align-item:center;margin-bottom:20px;">
120
               <div class="addLine flex-h" style="align-item:center;margin-bottom:20px;">
117
-                <!-- <el-date-picker
121
+                <el-date-picker
118
                   v-model="cardInfo.StartDate"
122
                   v-model="cardInfo.StartDate"
119
                   type="date"
123
                   type="date"
120
-                  placeholder="选择起始日期">
124
+                  placeholder="选择起始日期"
125
+                  :disabled="disabled">
121
                 </el-date-picker>
126
                 </el-date-picker>
122
                 <span style="line-height:40px;">至</span>
127
                 <span style="line-height:40px;">至</span>
123
                 <el-date-picker
128
                 <el-date-picker
124
                   v-model="cardInfo.EndDate"
129
                   v-model="cardInfo.EndDate"
125
                   type="date"
130
                   type="date"
126
-                  placeholder="选择截止日期">
127
-                </el-date-picker> -->
128
-                <el-date-picker
129
-                  v-model="date"
130
-                  type="daterange"
131
-                  range-separator="至"
132
-                  start-placeholder="开始日期"
133
-                  end-placeholder="结束日期"
134
-                  :picker-options="pickerOptions">
131
+                  placeholder="选择截止日期"
132
+                  :disabled="disabled">
135
                 </el-date-picker>
133
                 </el-date-picker>
136
               </div>
134
               </div>
137
             </div>
135
             </div>
138
           </div>
136
           </div>
139
         </li>
137
         </li>
140
-        <li class="flex-h">
141
-          <span>视频:</span>
142
-          <div class="flex-item">
143
-            <div style="vertical-align: middle;">
144
-              <a style="line-height: 40px;" v-if="videoOff" :href="cardInfo.VideoUrl" target="blank">{{cardInfo.VideoUrl}}</a>
145
-              <el-upload
146
-                class="avatar-uploader"
147
-                :action='$api.file.image.url'
148
-                :show-file-list="false"
149
-                :on-success="videoSuccess">
150
-                <a style="line-height: 40px;padding: 0 10px;">{{videoOff ? '更换' : '添加'}}视频</a>
151
-              </el-upload>
152
-              <el-button v-if="videoOff" type="danger" @click="deleteVideo">删除视频</el-button>
153
-            </div>
154
-          </div>
155
-        </li>
156
         <li class="flex-h">
138
         <li class="flex-h">
157
           <span>分享描述:</span>
139
           <span>分享描述:</span>
158
           <div class="flex-item">
140
           <div class="flex-item">
161
                 type="textarea"
143
                 type="textarea"
162
                 :rows="2"
144
                 :rows="2"
163
                 placeholder="请输入"
145
                 placeholder="请输入"
164
-                v-model="cardInfo.Share.CardShareInfo">
146
+                v-model="cardInfo.CardShareInfo">
165
               </el-input>
147
               </el-input>
166
             </div>
148
             </div>
167
           </div>
149
           </div>
174
                 type="textarea"
156
                 type="textarea"
175
                 :rows="2"
157
                 :rows="2"
176
                 placeholder="请输入"
158
                 placeholder="请输入"
177
-                v-model="cardInfo.Share.CardUseRule">
159
+                v-model="cardInfo.CardUseRule">
178
               </el-input>
160
               </el-input>
179
             </div>
161
             </div>
180
           </div>
162
           </div>
187
                 type="textarea"
169
                 type="textarea"
188
                 :rows="2"
170
                 :rows="2"
189
                 placeholder="请输入"
171
                 placeholder="请输入"
190
-                v-model="cardInfo.Share.CardUseInstruction">
172
+                v-model="cardInfo.CardUseInstruction">
191
               </el-input>
173
               </el-input>
192
             </div>
174
             </div>
193
           </div>
175
           </div>
203
 
185
 
204
 <script>
186
 <script>
205
 import { mapState, createNamespacedHelpers } from 'vuex'
187
 import { mapState, createNamespacedHelpers } from 'vuex'
206
-const { mapActions: mapCardActions } = createNamespacedHelpers('card')
188
+const { mapActions: mapGymCardActions } = createNamespacedHelpers('gymcard')
207
 const { mapState: mapChannelState, mapActions: mapChannelActions } = createNamespacedHelpers('channel')
189
 const { mapState: mapChannelState, mapActions: mapChannelActions } = createNamespacedHelpers('channel')
208
-const { mapActions: mapCourseActions } = createNamespacedHelpers('course')
209
 
190
 
210
 export default {
191
 export default {
211
   name: '',
192
   name: '',
212
   data () {
193
   data () {
213
     return {
194
     return {
195
+      disabled: false,
214
       date: '',
196
       date: '',
215
       courseList: [],
197
       courseList: [],
216
       videoOff: false,
198
       videoOff: false,
217
       total: 0,
199
       total: 0,
218
       type: this.$route.query.type,
200
       type: this.$route.query.type,
219
       isEdit: this.$route.query.id === undefined ? 0 : 1,
201
       isEdit: this.$route.query.id === undefined ? 0 : 1,
202
+      GymTypeList: [{ // 卡类型
203
+        id: 'once',
204
+        name: '次卡'
205
+      }, {
206
+        id: 'month',
207
+        name: '月卡'
208
+      }, {
209
+        id: 'quarter',
210
+        name: '季卡'
211
+      }, {
212
+        id: 'year',
213
+        name: '年卡'
214
+      }],
220
       ChannelList: [], // 渠道列表
215
       ChannelList: [], // 渠道列表
221
       TypeList: [], // 类型列表
216
       TypeList: [], // 类型列表
222
       GoodsList: [], // 商品列表
217
       GoodsList: [], // 商品列表
223
-      currentList: [{
224
-        Name: 'ccc',
225
-        Type: 'xxx'
226
-      }], // 指定商品数据
227
       cardInfo: {
218
       cardInfo: {
228
-        CardName: '',
219
+        GymCardId: '',
220
+        CardImageUrl: '',
221
+        GymCardName: '',
222
+        GymTypeId: '',
223
+        Price: '',
224
+        TotalCount: '',
229
         SendType: '',
225
         SendType: '',
230
-        VideoUrl: '',
231
-        Price: ' ',
226
+        ChannelId: '',
232
         StartDate: '',
227
         StartDate: '',
233
         EndDate: '',
228
         EndDate: '',
234
-        TotalCount: '',
229
+        CardShareInfo: '',
230
+        CardUseRule: '',
231
+        CardUseInstruction: '',
235
         CaseId: '',
232
         CaseId: '',
236
-        OrgId: '',
237
-        Share: {
238
-          CardShareInfo: '',
239
-          CardUseRule: '',
240
-          CardUseInstruction: ''
241
-        },
242
-        Images: [{
243
-          CardImageUrl: ''
244
-        }],
245
-        Targets: [{
246
-          TargetType: '',
247
-          TargetId: '',
248
-          TargetName: ''
249
-        }],
250
-        ChannelId: ''
233
+        OrgId: ''
251
       },
234
       },
252
       postData: {
235
       postData: {
253
         page: 1,
236
         page: 1,
262
         page: 1,
245
         page: 1,
263
         pagesize: 10000
246
         pagesize: 10000
264
       }).then(() => {
247
       }).then(() => {
265
-        this.GetCourseList({
266
-          caseid: this.defaultCaseId,
267
-          page: 1,
268
-          pagesize: 10000
269
-        }).then((res) => {
270
-          this.courseList = res.list
271
-          if (this.$route.query.id) {
272
-            this.getCardById({
273
-              id: this.$route.query.id
274
-            }).then((res) => {
275
-              // console.log(JSON.stringify(res.Card))
276
-              this.cardInfo = res.Card
277
-              if (res.Card.VideoUrl) {
278
-                this.videoOff = true
279
-              }
280
-              if (res.Card.Images === null) {
281
-                this.cardInfo.Images = [{
282
-                  CardImageUrl: ''
283
-                }]
284
-              }
285
-              if (res.Card.StartDate) {
286
-                this.date = [res.Card.StartDate, res.Card.EndDate]
287
-              }
288
-            })
289
-          }
290
-        })
248
+        if (this.$route.query.id) {
249
+          this.disabled = true
250
+          this.getGymCardById({
251
+            id: this.$route.query.id
252
+          }).then((res) => {
253
+            // console.log(JSON.stringify(res.Card))
254
+            this.cardInfo = res
255
+          })
256
+        }
291
       })
257
       })
292
     })
258
     })
293
   },
259
   },
300
       defaultCaseId: x => x.app.cases.default,
266
       defaultCaseId: x => x.app.cases.default,
301
       OrgId: x => x.app.user.OrgId,
267
       OrgId: x => x.app.user.OrgId,
302
     }),
268
     }),
303
-    pickerOptions () {
304
-      const courseId = this.cardInfo.Targets[0].TargetId
305
-      const couse = (this.courseList || []).filter(x => x.CourseId === courseId)[0] || {}
306
-      const beginDate = new Date(couse.BeginDate).getTime()
307
-      const endDate = new Date(couse.EndDate).getTime()
308
-      return {
309
-        disabledDate (time) {
310
-          return time.getTime() < beginDate || time.getTime() > endDate
311
-        }
312
-      }
313
-    },
314
     CaseId: {
269
     CaseId: {
315
       get () {
270
       get () {
316
         return this.postData.caseid || this.defaultCaseId
271
         return this.postData.caseid || this.defaultCaseId
321
     }
276
     }
322
   },
277
   },
323
   methods: {
278
   methods: {
324
-    ...mapCardActions([
325
-      'addCard',
326
-      'getCardById',
327
-      'editCard',
328
-    ]),
329
-    ...mapCourseActions([
330
-      'GetCourseList',
279
+    ...mapGymCardActions([
280
+      'addGymCard',
281
+      'getGymCardById',
282
+      'editGymCard',
331
     ]),
283
     ]),
332
     ...mapChannelActions([
284
     ...mapChannelActions([
333
       'GetChannelListList',
285
       'GetChannelListList',
338
         page: 1,
290
         page: 1,
339
         pagesize: 10000
291
         pagesize: 10000
340
       })
292
       })
341
-      this.GetCourseList({
342
-        caseid: this.cardInfo.CaseId,
343
-        page: 1,
344
-        pagesize: 10000
345
-      }).then((res) => {
346
-        this.courseList = res.list
347
-      })
348
-      this.cardInfo.Targets = [{
349
-        TargetType: '',
350
-        TargetId: '',
351
-        TargetName: ''
352
-      }]
353
       this.cardInfo.ChannelId = ''
293
       this.cardInfo.ChannelId = ''
354
     },
294
     },
355
-    deleteVideo () { // 删除视频
356
-      this.cardInfo.VideoUrl = ''
357
-      this.videoOff = false
358
-    },
359
-    videoSuccess (res, file) {
360
-      this.videoOff = true
361
-      this.cardInfo.VideoUrl = res.result.url
362
-    },
363
-    addGoods () { // 添加指定商品
364
-      this.centerDialogVisible = true
365
-    },
366
     submit () { // 保存
295
     submit () { // 保存
367
       if (this.$route.query.id) {
296
       if (this.$route.query.id) {
368
-        if (this.date !== '') {
369
-          this.cardInfo.StartDate = this.date[0]
370
-          this.cardInfo.EndDate = this.date[1]
371
-        }
372
-        for (var x = 0; x < this.courseList.length; x++) {
373
-          if (this.courseList[x].CourseId === this.cardInfo.Targets[0].TargetId) {
374
-            this.cardInfo.Targets[0].TargetType = this.courseList[x].CourseType
375
-            this.cardInfo.Targets[0].TargetName = this.courseList[x].CourseName
376
-          }
377
-        }
378
         this.cardInfo.TotalCount = this.cardInfo.TotalCount - 0
297
         this.cardInfo.TotalCount = this.cardInfo.TotalCount - 0
379
         console.log(JSON.stringify(this.cardInfo))
298
         console.log(JSON.stringify(this.cardInfo))
380
-        this.editCard(this.cardInfo).then((res) => {
299
+        this.editGymCard(this.cardInfo).then((res) => {
381
           this.$alert('操作成功', '提示', {
300
           this.$alert('操作成功', '提示', {
382
             confirmButtonText: '确定',
301
             confirmButtonText: '确定',
383
             callback: action => {
302
             callback: action => {
384
-              this.$router.push({ name: 'cardList' })
303
+              this.$router.push({ name: 'bodyBuildingCardManager' })
385
             }
304
             }
386
           })
305
           })
387
         })
306
         })
388
       } else {
307
       } else {
389
         this.cardInfo.OrgId = this.OrgId
308
         this.cardInfo.OrgId = this.OrgId
390
-        if (this.date !== '') {
391
-          this.cardInfo.StartDate = this.date[0]
392
-          this.cardInfo.EndDate = this.date[1]
393
-        }
394
-        for (var n = 0; n < this.courseList.length; n++) {
395
-          if (this.courseList[n].CourseId === this.cardInfo.Targets[0].TargetId) {
396
-            this.cardInfo.Targets[0].TargetType = this.courseList[n].CourseType
397
-            this.cardInfo.Targets[0].TargetName = this.courseList[n].CourseName
398
-          }
399
-        }
400
         this.cardInfo.TotalCount = this.cardInfo.TotalCount - 0
309
         this.cardInfo.TotalCount = this.cardInfo.TotalCount - 0
401
         console.log(JSON.stringify(this.cardInfo))
310
         console.log(JSON.stringify(this.cardInfo))
402
-        this.addCard(this.cardInfo).then((res) => {
311
+        this.addGymCard(this.cardInfo).then((res) => {
403
           this.$alert('操作成功', '提示', {
312
           this.$alert('操作成功', '提示', {
404
             confirmButtonText: '确定',
313
             confirmButtonText: '确定',
405
             callback: action => {
314
             callback: action => {
406
-              this.$router.push({ name: 'cardList' })
315
+              this.$router.push({ name: 'bodyBuildingCardManager' })
407
             }
316
             }
408
           })
317
           })
409
         })
318
         })
410
       }
319
       }
411
     },
320
     },
412
     cancel () { // 取消
321
     cancel () { // 取消
413
-      this.$router.push({ name: 'couponList' })
322
+      this.$router.push({ name: 'bodyBuildingCardManager' })
414
     },
323
     },
415
     handleAvatarSuccess (res, file) {
324
     handleAvatarSuccess (res, file) {
416
-      this.cardInfo.Images[0].CardImageUrl = res.result.url
325
+      this.cardInfo.CardImageUrl = res.result.url
417
     },
326
     },
418
   }
327
   }
419
 }
328
 }

+ 13
- 19
src/pages/system/cardAndCouponManager/bodyBuildingCardManager/index.vue View File

25
     </div>
25
     </div>
26
     <div class="system-table-box">
26
     <div class="system-table-box">
27
       <el-table
27
       <el-table
28
-        :data="cardList.list"
28
+        :data="gymCardList.list"
29
         stripe
29
         stripe
30
         style="width: 100%">
30
         style="width: 100%">
31
         <el-table-column
31
         <el-table-column
32
-          prop="CardName"
32
+          prop="GymCardName"
33
           label="卡名称">
33
           label="卡名称">
34
         </el-table-column>
34
         </el-table-column>
35
-        <!-- <el-table-column
36
-          prop="xxx"
37
-          label="卡类型">
38
-        </el-table-column> -->
39
         <el-table-column
35
         <el-table-column
40
           prop="Price"
36
           prop="Price"
41
           label="卡价格">
37
           label="卡价格">
53
         <el-table-column
49
         <el-table-column
54
           prop="SendType"
50
           prop="SendType"
55
           label="发放类型">
51
           label="发放类型">
52
+          <template slot-scope="scope">
53
+            {{scope.row.SendType === 'channel' ? '渠道' : scope.row.SendType === 'system' ? '系统' : '案场'}}
54
+          </template>
56
         </el-table-column>
55
         </el-table-column>
57
         <el-table-column
56
         <el-table-column
58
           prop="TotalCount"
57
           prop="TotalCount"
214
 <script>
213
 <script>
215
 import Clipboard from 'clipboard'
214
 import Clipboard from 'clipboard'
216
 import { mapState, createNamespacedHelpers } from 'vuex'
215
 import { mapState, createNamespacedHelpers } from 'vuex'
217
-const { mapState: mapCardState, mapActions: mapCardActions } = createNamespacedHelpers('card')
216
+const { mapState: mapGymCardState, mapActions: mapGymCardActions } = createNamespacedHelpers('gymcard')
218
 const { mapState: mapCustomerState, mapActions: mapCustomerActions } = createNamespacedHelpers('customer')
217
 const { mapState: mapCustomerState, mapActions: mapCustomerActions } = createNamespacedHelpers('customer')
219
 
218
 
220
 export default {
219
 export default {
250
     })
249
     })
251
   },
250
   },
252
   computed: {
251
   computed: {
253
-    ...mapCardState({
254
-      cardList: x => x.cardList,
252
+    ...mapGymCardState({
253
+      gymCardList: x => x.gymCardList,
255
     }),
254
     }),
256
     ...mapState({
255
     ...mapState({
257
       cases: x => x.app.cases.list,
256
       cases: x => x.app.cases.list,
270
     }
269
     }
271
   },
270
   },
272
   methods: {
271
   methods: {
273
-    ...mapCardActions([
274
-      'GetCardList',
275
-      'giveCard',
272
+    ...mapGymCardActions([
273
+      'getGymCardList',
276
     ]),
274
     ]),
277
     ...mapCustomerActions([
275
     ...mapCustomerActions([
278
       'GetCustomerList',
276
       'GetCustomerList',
333
       this.getList()
331
       this.getList()
334
     },
332
     },
335
     getList () { // 获取列表
333
     getList () { // 获取列表
336
-      this.GetCardList({
334
+      this.getGymCardList({
337
         ...this.postData,
335
         ...this.postData,
338
         caseid: this.CaseId || this.defaultCaseId
336
         caseid: this.CaseId || this.defaultCaseId
339
       }).then((res) => {
337
       }).then((res) => {
345
       this.getList()
343
       this.getList()
346
     },
344
     },
347
     handleEdit (index, row) { // 编辑
345
     handleEdit (index, row) { // 编辑
348
-      this.$router.push({ name: 'editCard', query: { id: row.CardId } })
346
+      this.$router.push({ name: 'editBodyBuildingCard', query: { id: row.GymCardId } })
349
     },
347
     },
350
-    // handleCopy (url) { // 复制弹窗
351
-    //   this.currentCopyUrl = url
352
-    //   this.copyDialogVisible = true
353
-    // },
354
     toCopy (index, row) { // 复制
348
     toCopy (index, row) { // 复制
355
       console.log(1)
349
       console.log(1)
356
       var clipboard = new Clipboard(this.$refs['copy' + index])
350
       var clipboard = new Clipboard(this.$refs['copy' + index])
364
       })
358
       })
365
     },
359
     },
366
     addCard () {
360
     addCard () {
367
-      this.$router.push({ name: 'editCard', query: {} })
361
+      this.$router.push({ name: 'editBodyBuildingCard', query: {} })
368
     }
362
     }
369
   }
363
   }
370
 }
364
 }

+ 78
- 0
src/store/card/gymCard.js View File

1
+import ajax from '../../util/ajax'
2
+import api from '../../util/api'
3
+
4
+export default {
5
+  namespaced: true,
6
+  state: {
7
+    gymCardList: [],
8
+  },
9
+  mutations: {
10
+    updateList (state, payload) {
11
+      state.gymCardList = payload || []
12
+    },
13
+  },
14
+  actions: {
15
+    getGymCardList ({ commit }, payload) { // 获取卡列表
16
+      return new Promise((resolve, reject) => {
17
+        ajax(api.gymCardManager.gymCardList.url, {
18
+          method: api.gymCardManager.gymCardList.method,
19
+          queryData: {
20
+            ...payload,
21
+          }
22
+        }).then(res => {
23
+          commit('updateList', res)
24
+          resolve(res)
25
+        }).catch(reject)
26
+      })
27
+    },
28
+    addGymCard ({ commit }, payload) { // 新增卡
29
+      return new Promise((resolve, reject) => {
30
+        ajax(api.gymCardManager.addGymCard.url, {
31
+          method: api.gymCardManager.addGymCard.method,
32
+          data: {
33
+            info: JSON.stringify(payload)
34
+          }
35
+        }).then(res => {
36
+          resolve(res)
37
+        }).catch(reject)
38
+      })
39
+    },
40
+    getGymCardById ({ commit }, { id }) { // 获取卡详情
41
+      return new Promise((resolve, reject) => {
42
+        ajax(api.gymCardManager.getGymCardById.url, {
43
+          method: api.gymCardManager.getGymCardById.method,
44
+          urlData: {
45
+            id,
46
+          }
47
+        }).then(res => {
48
+          resolve(res)
49
+        }).catch(reject)
50
+      })
51
+    },
52
+    editGymCard ({ commit }, payload) { // 编辑更新卡
53
+      return new Promise((resolve, reject) => {
54
+        ajax(api.gymCardManager.editGymCard.url, {
55
+          method: api.gymCardManager.editGymCard.method,
56
+          data: {
57
+            info: JSON.stringify(payload)
58
+          },
59
+        }).then(res => {
60
+          resolve(res)
61
+        }).catch(reject)
62
+      })
63
+    },
64
+    // giveCard ({ commit }, { id, users }) {
65
+    //   return new Promise((resolve, reject) => {
66
+    //     ajax(api.cardManager.giveCard.url, {
67
+    //       method: api.cardManager.giveCard.method,
68
+    //       urlData: {
69
+    //         id,
70
+    //         users
71
+    //       },
72
+    //     }).then(res => {
73
+    //       resolve(res)
74
+    //     }).catch(reject)
75
+    //   })
76
+    // }
77
+  }
78
+}

+ 1
- 0
src/store/index.js View File

26
   cmscase: () => require('./cms/case').default,
26
   cmscase: () => require('./cms/case').default,
27
   caserecord: () => require('./case/record').default,
27
   caserecord: () => require('./case/record').default,
28
   vip: () => require('./card/vip').default,
28
   vip: () => require('./card/vip').default,
29
+  gymcard: () => require('./card/gymCard').default,
29
   card: () => require('./card/card').default,
30
   card: () => require('./card/card').default,
30
   coupon: () => require('./coupon/coupon').default,
31
   coupon: () => require('./coupon/coupon').default,
31
   channel: () => require('./channel/channel').default,
32
   channel: () => require('./channel/channel').default,

+ 18
- 0
src/util/api.js View File

632
       url: `${baseUrl}${common}/coupon/:id/to/:users`
632
       url: `${baseUrl}${common}/coupon/:id/to/:users`
633
     },
633
     },
634
   },
634
   },
635
+  gymCardManager: {
636
+    gymCardList: {
637
+      method: 'get',
638
+      url: `${baseUrl}${common}/gymcard`
639
+    },
640
+    addGymCard: {
641
+      method: 'post',
642
+      url: `${baseUrl}${common}/gymcard`
643
+    },
644
+    editGymCard: {
645
+      method: 'put',
646
+      url: `${baseUrl}${common}/gymcard`
647
+    },
648
+    getGymCardById: {
649
+      method: 'get',
650
+      url: `${baseUrl}${common}/gymcard/:id`
651
+    }
652
+  },
635
   customerManager: {
653
   customerManager: {
636
     getByTel: {
654
     getByTel: {
637
       method: 'get',
655
       method: 'get',