Kaynağa Gözat

Merge branch 'dev' of http://git.ycjcjy.com/SpaceOfCheng/admin into dev

yuantianjiao 6 yıl önce
ebeveyn
işleme
77c104f3b4
48 değiştirilmiş dosya ile 19334 ekleme ve 604 silme
  1. 2
    1
      config/index.js
  2. 16245
    0
      package-lock.json
  3. 1
    0
      package.json
  4. 432
    0
      src/pages/system/cardAndCouponManager/bodyBuildingCardManager/edit.vue
  5. 398
    0
      src/pages/system/cardAndCouponManager/bodyBuildingCardManager/index.vue
  6. 27
    0
      src/pages/system/cardAndCouponManager/bodyBuildingCardManager/page.scss
  7. 217
    113
      src/pages/system/cardAndCouponManager/cardManager/edit.vue
  8. 146
    66
      src/pages/system/cardAndCouponManager/cardManager/index.vue
  9. 304
    62
      src/pages/system/cardAndCouponManager/couponManager/edit.vue
  10. 103
    36
      src/pages/system/cardAndCouponManager/couponManager/index.vue
  11. 1
    0
      src/pages/system/cardAndCouponManager/couponManager/page.scss
  12. 11
    6
      src/pages/system/caseManager/caseAreaManager/index.vue
  13. 18
    4
      src/pages/system/caseManager/caseInfo/addCase/index.vue
  14. 18
    4
      src/pages/system/caseManager/caseInfo/editCase/index.vue
  15. 4
    0
      src/pages/system/caseManager/caseInfo/index.vue
  16. 1
    0
      src/pages/system/caseManager/caseTableManager/add.vue
  17. 1
    0
      src/pages/system/caseManager/caseTableManager/edit.vue
  18. 1
    1
      src/pages/system/caseManager/signinManager/index.vue
  19. 34
    23
      src/pages/system/cmsManager/bannerManager/add.vue
  20. 45
    34
      src/pages/system/cmsManager/bannerManager/edit.vue
  21. 93
    60
      src/pages/system/cmsManager/majorProjects/edit.vue
  22. 35
    23
      src/pages/system/cmsManager/newsManager/add.vue
  23. 47
    36
      src/pages/system/cmsManager/newsManager/edit.vue
  24. 2
    3
      src/pages/system/courseManager/fiveA/edit.vue
  25. 16
    24
      src/pages/system/dataStatistics/courseOrderList/index.vue
  26. 125
    54
      src/pages/system/dataStatistics/goodsOrderList/index.vue
  27. 42
    0
      src/pages/system/dataStatistics/goodsOrderList/page.scss
  28. 37
    21
      src/pages/system/goodsManager/goodManager/edit.vue
  29. 3
    0
      src/pages/system/goodsManager/goodManager/index.vue
  30. 9
    3
      src/pages/system/goodsManager/goodsTypeManager/index.vue
  31. 214
    0
      src/pages/system/marketingActivities/activitiesList/index.vue
  32. 33
    0
      src/pages/system/marketingActivities/activitiesList/page.scss
  33. 200
    0
      src/pages/system/marketingActivities/addActivities/index.vue
  34. 39
    0
      src/pages/system/marketingActivities/addActivities/page.scss
  35. 19
    0
      src/pages/system/marketingActivities/index.vue
  36. 31
    0
      src/pages/system/page.js
  37. 27
    0
      src/pages/system/systemSet/userManager/add.vue
  38. 27
    0
      src/pages/system/systemSet/userManager/edit.vue
  39. 3
    3
      src/pages/system/systemSet/userManager/index.vue
  40. 3
    2
      src/store/app.js
  41. 81
    0
      src/store/card/card.js
  42. 29
    0
      src/store/channel/channel.js
  43. 81
    0
      src/store/coupon/coupon.js
  44. 13
    10
      src/store/course/course.js
  45. 20
    0
      src/store/customer/customer.js
  46. 20
    14
      src/store/goods/goods.js
  47. 3
    0
      src/store/index.js
  48. 73
    1
      src/util/api.js

+ 2
- 1
config/index.js Dosyayı Görüntüle

@@ -12,7 +12,8 @@ module.exports = {
12 12
     proxyTable: {
13 13
       '/api': {
14 14
         // target: 'https://dp.huiju360.com.cn/hj_operations',
15
-        target: 'http://192.168.0.62:8080', //wf
15
+        // target: 'http://192.168.0.62:8080', //wf
16
+        target: 'http://localhost:8080', 
16 17
         // target: 'http://192.168.0.11', //ys
17 18
         // target: 'http://dev.ycjcjy.com/', //frp
18 19
         changeOrigin: true, // 如果接口跨域,需要进行这个参数配置

+ 16245
- 0
package-lock.json
Dosya farkı çok büyük olduğundan ihmal edildi
Dosyayı Görüntüle


+ 1
- 0
package.json Dosyayı Görüntüle

@@ -17,6 +17,7 @@
17 17
   "dependencies": {
18 18
     "@antv/g2": "^3.2.7",
19 19
     "axios": "^0.18.0",
20
+    "clipboard": "^2.0.1",
20 21
     "element-ui": "^2.4.5",
21 22
     "g2-vue": "^1.0.1",
22 23
     "js-base64": "^2.4.8",

+ 432
- 0
src/pages/system/cardAndCouponManager/bodyBuildingCardManager/edit.vue Dosyayı Görüntüle

@@ -0,0 +1,432 @@
1
+<template>
2
+  <div class="subPage">
3
+    <form class="mainForm">
4
+      <ul>
5
+        <li class="flex-h">
6
+          <span>选择案场:</span>
7
+          <div class="flex-item">
8
+            <div style="width:50%">
9
+              <el-select v-model="cardInfo.CaseId" placeholder="请选择" @change="caseChange">
10
+                <el-option
11
+                  v-for="item in cases"
12
+                  :key="item.CaseId"
13
+                  :label="item.CaseName"
14
+                  :value="item.CaseId">
15
+                </el-option>
16
+              </el-select>
17
+            </div>
18
+          </div>
19
+        </li>
20
+        <li class="flex-h">
21
+          <span>卡图片:</span>
22
+          <div class="flex-item">
23
+            <div>
24
+              <el-upload
25
+                class="avatar-uploader"
26
+                :action='$api.file.image.url'
27
+                :show-file-list="false"
28
+                :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>
31
+              </el-upload>
32
+            </div>
33
+          </div>
34
+        </li>
35
+        <li class="flex-h">
36
+          <span>卡名称:</span>
37
+          <div class="flex-item">
38
+            <div style="width:200px;">
39
+              <el-input
40
+                placeholder="请输入"
41
+                v-model="cardInfo.CardName"
42
+                clearable>
43
+              </el-input>
44
+            </div>
45
+          </div>
46
+        </li>
47
+        <li class="flex-h">
48
+          <span>卡价格:</span>
49
+          <div class="flex-item">
50
+            <div style="width:200px;">
51
+              <el-input
52
+                placeholder="请输入"
53
+                v-model="cardInfo.Price"
54
+                clearable>
55
+              </el-input>
56
+            </div>
57
+          </div>
58
+        </li>
59
+        <li class="flex-h">
60
+          <span>总张数:</span>
61
+          <div class="flex-item">
62
+            <div style="width:200px;">
63
+              <el-input
64
+                placeholder="请输入"
65
+                v-model="cardInfo.TotalCount"
66
+                clearable>
67
+              </el-input>
68
+            </div>
69
+          </div>
70
+        </li>
71
+        <li class="flex-h">
72
+          <span>发送类型:</span>
73
+          <div class="flex-item">
74
+            <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>
78
+            </div>
79
+          </div>
80
+        </li>
81
+        <li class="flex-h" v-if="cardInfo.SendType === 'channel'">
82
+          <span>选择渠道:</span>
83
+          <div class="flex-item">
84
+            <div style="width:50%">
85
+              <el-select v-model="cardInfo.ChannelId" placeholder="请选择">
86
+                <el-option
87
+                  v-for="item in channelList"
88
+                  :key="item.ChannelId"
89
+                  :label="item.ChannelName"
90
+                  :value="item.ChannelId">
91
+                </el-option>
92
+              </el-select>
93
+            </div>
94
+          </div>
95
+        </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">
113
+          <span>卡有效时间:</span>
114
+          <div class="flex-item">
115
+            <div>
116
+              <div class="addLine flex-h" style="align-item:center;margin-bottom:20px;">
117
+                <!-- <el-date-picker
118
+                  v-model="cardInfo.StartDate"
119
+                  type="date"
120
+                  placeholder="选择起始日期">
121
+                </el-date-picker>
122
+                <span style="line-height:40px;">至</span>
123
+                <el-date-picker
124
+                  v-model="cardInfo.EndDate"
125
+                  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">
135
+                </el-date-picker>
136
+              </div>
137
+            </div>
138
+          </div>
139
+        </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">
157
+          <span>分享描述:</span>
158
+          <div class="flex-item">
159
+            <div>
160
+              <el-input
161
+                type="textarea"
162
+                :rows="2"
163
+                placeholder="请输入"
164
+                v-model="cardInfo.Share.CardShareInfo">
165
+              </el-input>
166
+            </div>
167
+          </div>
168
+        </li>
169
+        <li class="flex-h">
170
+          <span>规则描述:</span>
171
+          <div class="flex-item">
172
+            <div>
173
+              <el-input
174
+                type="textarea"
175
+                :rows="2"
176
+                placeholder="请输入"
177
+                v-model="cardInfo.Share.CardUseRule">
178
+              </el-input>
179
+            </div>
180
+          </div>
181
+        </li>
182
+        <li class="flex-h">
183
+          <span>使用说明:</span>
184
+          <div class="flex-item">
185
+            <div>
186
+              <el-input
187
+                type="textarea"
188
+                :rows="2"
189
+                placeholder="请输入"
190
+                v-model="cardInfo.Share.CardUseInstruction">
191
+              </el-input>
192
+            </div>
193
+          </div>
194
+        </li>
195
+        <li style="text-align:center">
196
+          <el-button type="primary" size="mini" @click="submit">保存</el-button>
197
+          <el-button type="danger" size="mini" @click="cancel">取消</el-button>
198
+        </li>
199
+      </ul>
200
+    </form>
201
+  </div>
202
+</template>
203
+
204
+<script>
205
+import { mapState, createNamespacedHelpers } from 'vuex'
206
+const { mapActions: mapCardActions } = createNamespacedHelpers('card')
207
+const { mapState: mapChannelState, mapActions: mapChannelActions } = createNamespacedHelpers('channel')
208
+const { mapActions: mapCourseActions } = createNamespacedHelpers('course')
209
+
210
+export default {
211
+  name: '',
212
+  data () {
213
+    return {
214
+      date: '',
215
+      courseList: [],
216
+      videoOff: false,
217
+      total: 0,
218
+      type: this.$route.query.type,
219
+      isEdit: this.$route.query.id === undefined ? 0 : 1,
220
+      ChannelList: [], // 渠道列表
221
+      TypeList: [], // 类型列表
222
+      GoodsList: [], // 商品列表
223
+      currentList: [{
224
+        Name: 'ccc',
225
+        Type: 'xxx'
226
+      }], // 指定商品数据
227
+      cardInfo: {
228
+        CardName: '',
229
+        SendType: '',
230
+        VideoUrl: '',
231
+        Price: ' ',
232
+        StartDate: '',
233
+        EndDate: '',
234
+        TotalCount: '',
235
+        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: ''
251
+      },
252
+      postData: {
253
+        page: 1,
254
+        pagesize: 10,
255
+      },
256
+    }
257
+  },
258
+  mounted () {
259
+    this.$nextTick(function () {
260
+      this.GetChannelListList({
261
+        caseid: this.defaultCaseId,
262
+        page: 1,
263
+        pagesize: 10000
264
+      }).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
+        })
291
+      })
292
+    })
293
+  },
294
+  computed: {
295
+    ...mapChannelState({
296
+      channelList: x => x.channelList,
297
+    }),
298
+    ...mapState({
299
+      cases: x => x.app.cases.list,
300
+      defaultCaseId: x => x.app.cases.default,
301
+      OrgId: x => x.app.user.OrgId,
302
+    }),
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: {
315
+      get () {
316
+        return this.postData.caseid || this.defaultCaseId
317
+      },
318
+      set (val) {
319
+        this.postData.caseid = val
320
+      }
321
+    }
322
+  },
323
+  methods: {
324
+    ...mapCardActions([
325
+      'addCard',
326
+      'getCardById',
327
+      'editCard',
328
+    ]),
329
+    ...mapCourseActions([
330
+      'GetCourseList',
331
+    ]),
332
+    ...mapChannelActions([
333
+      'GetChannelListList',
334
+    ]),
335
+    caseChange () { // 选择案场
336
+      this.GetChannelListList({
337
+        caseid: this.cardInfo.CaseId,
338
+        page: 1,
339
+        pagesize: 10000
340
+      })
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 = ''
354
+    },
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 () { // 保存
367
+      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
379
+        console.log(JSON.stringify(this.cardInfo))
380
+        this.editCard(this.cardInfo).then((res) => {
381
+          this.$alert('操作成功', '提示', {
382
+            confirmButtonText: '确定',
383
+            callback: action => {
384
+              this.$router.push({ name: 'cardList' })
385
+            }
386
+          })
387
+        })
388
+      } else {
389
+        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
401
+        console.log(JSON.stringify(this.cardInfo))
402
+        this.addCard(this.cardInfo).then((res) => {
403
+          this.$alert('操作成功', '提示', {
404
+            confirmButtonText: '确定',
405
+            callback: action => {
406
+              this.$router.push({ name: 'cardList' })
407
+            }
408
+          })
409
+        })
410
+      }
411
+    },
412
+    cancel () { // 取消
413
+      this.$router.push({ name: 'couponList' })
414
+    },
415
+    handleAvatarSuccess (res, file) {
416
+      this.cardInfo.Images[0].CardImageUrl = res.result.url
417
+    },
418
+  }
419
+}
420
+</script>
421
+
422
+<!-- Add "scoped" attribute to limit CSS to this component only -->
423
+<style lang="scss" scoped>
424
+.addLine {
425
+  > * {
426
+    margin-right: 10px;
427
+  }
428
+}
429
+.mainForm > ul > li > div > div > button {
430
+  margin-top: 0;
431
+}
432
+</style>

+ 398
- 0
src/pages/system/cardAndCouponManager/bodyBuildingCardManager/index.vue Dosyayı Görüntüle

@@ -0,0 +1,398 @@
1
+<template>
2
+  <div class="subPage">
3
+    <div class="system-table-search">
4
+      <div class="flex-h">
5
+        <div class="flex-item flex-h">
6
+          <el-button size="mini" type="success" @click="addCard">新增健身卡</el-button>
7
+        </div>
8
+        <ul>
9
+          <li>
10
+            <el-select v-model="CaseId" placeholder="请选择案场">
11
+              <el-option
12
+                v-for="item in cases"
13
+                :key="item.CaseId"
14
+                :label="item.CaseName"
15
+                :value="item.CaseId">
16
+              </el-option>
17
+            </el-select>
18
+          </li>
19
+        </ul>
20
+        <el-button
21
+          size="mini"
22
+          type="primary" @click="search">搜索</el-button>
23
+      </div>
24
+      <div class="moreFilter"></div>
25
+    </div>
26
+    <div class="system-table-box">
27
+      <el-table
28
+        :data="cardList.list"
29
+        stripe
30
+        style="width: 100%">
31
+        <el-table-column
32
+          prop="CardName"
33
+          label="卡名称">
34
+        </el-table-column>
35
+        <!-- <el-table-column
36
+          prop="xxx"
37
+          label="卡类型">
38
+        </el-table-column> -->
39
+        <el-table-column
40
+          prop="Price"
41
+          label="卡价格">
42
+        </el-table-column>
43
+        <el-table-column
44
+          prop="StartDate"
45
+          label="有效期"
46
+          width="150">
47
+          <template slot-scope="scope">
48
+            <span style="width:100%;display:block;text-align:center;white-space: nowrap;">{{toolClass.dateFormat(scope.row.StartDate)}}</span>
49
+            <span style="width:100%;display:block;text-align:center;white-space: nowrap;">至</span>
50
+            <span style="width:100%;display:block;text-align:center;white-space: nowrap;">{{toolClass.dateFormat(scope.row.EndDate)}}</span>
51
+          </template>
52
+        </el-table-column>
53
+        <el-table-column
54
+          prop="SendType"
55
+          label="发放类型">
56
+        </el-table-column>
57
+        <el-table-column
58
+          prop="TotalCount"
59
+          label="总数量">
60
+        </el-table-column>
61
+        <el-table-column
62
+          prop="SentCount"
63
+          label="已发">
64
+        </el-table-column>
65
+        <el-table-column
66
+          prop="UsedCount"
67
+          label="实际使用">
68
+        </el-table-column>
69
+        <el-table-column
70
+          prop="Status"
71
+          label="状态">
72
+          <template slot-scope="scope">
73
+            {{scope.row.Status == 1 ? '正常' : '已过期'}}
74
+          </template>
75
+        </el-table-column>
76
+        <el-table-column label="操作" fixed='right' width="350">
77
+          <template slot-scope="scope">
78
+            <el-button
79
+              size="mini"
80
+              type="warning"
81
+              @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
82
+            <el-button
83
+              size="mini"
84
+              type="danger"
85
+              @click="sendCard(scope.$index, scope.row)">赠送客户</el-button>
86
+            <a class="copyBtn" :data-clipboard-text="'www.baidu.com'" :ref="'copy' + scope.$index" @click="toCopy(scope.$index, scope.row)">点击复制链接</a>
87
+          </template>
88
+        </el-table-column>
89
+      </el-table>
90
+    </div>
91
+    <el-pagination
92
+      @current-change="handleCurrentChange"
93
+      :current-page.sync="postData.page"
94
+      :page-size="postData.pagesize"
95
+      layout="prev, pager, next, jumper"
96
+      :total="total">
97
+    </el-pagination>
98
+    <el-dialog
99
+      title="选择赠送客户"
100
+      :visible.sync="centerDialogVisible"
101
+      width="800px"
102
+      center>
103
+      <div>
104
+        <ul class="dialogSearchList flex-h" style="margin-bottom:10px;">
105
+          <li class="flex-item">
106
+            <el-input
107
+              placeholder="请输入用户名"
108
+              v-model="dialogPostData.username"
109
+              clearable>
110
+            </el-input>
111
+          </li>
112
+          <li class="flex-item">
113
+            <el-input
114
+              placeholder="请输入手机号"
115
+              v-model="dialogPostData.phone"
116
+              clearable>
117
+            </el-input>
118
+          </li>
119
+          <li class="flex-item">
120
+            <el-input
121
+              placeholder="请输入推荐人"
122
+              v-model="dialogPostData.recommendname"
123
+              clearable>
124
+            </el-input>
125
+          </li>
126
+          <li>
127
+            <el-button type="primary" @click="dialogSearch">搜索</el-button>
128
+          </li>
129
+        </ul>
130
+        <ul class="dialogSearchList flex-h">
131
+          <li class="flex-item">
132
+            <el-date-picker
133
+              v-model="dialogPostData.begindate"
134
+              type="date"
135
+              placeholder="选择起始日期">
136
+            </el-date-picker>
137
+            <el-date-picker
138
+              v-model="dialogPostData.enddate"
139
+              type="date"
140
+              placeholder="选择截止日期">
141
+            </el-date-picker>
142
+          </li>
143
+        </ul>
144
+      </div>
145
+      <div>
146
+        <el-table
147
+          ref="multipleTable"
148
+          :data="customers.list"
149
+          tooltip-effect="dark"
150
+          style="width: 100%"
151
+          @selection-change="handleSelectionChange">
152
+          <el-table-column
153
+            type="selection">
154
+          </el-table-column>
155
+          <el-table-column
156
+            prop="Name"
157
+            label="姓名">
158
+          </el-table-column>
159
+          <el-table-column
160
+            prop="CustomerName"
161
+            label="微信昵称">
162
+          </el-table-column>
163
+          <el-table-column
164
+            prop="Phone"
165
+            label="手机号">
166
+          </el-table-column>
167
+          <el-table-column
168
+            prop="CreatDate"
169
+            label="创建时间">
170
+            <template slot-scope="scope">
171
+              <span>{{toolClass.dateFormat(scope.row.CreateDate, 'yyyy-MM-dd')}}</span>
172
+            </template>
173
+          </el-table-column>
174
+          <el-table-column
175
+            prop="RecommendName"
176
+            label="推荐人">
177
+          </el-table-column>
178
+        </el-table>
179
+      </div>
180
+      <div>
181
+        <el-pagination
182
+          @current-change="handleCurrentChangeDialog"
183
+          :current-page.sync="dialogPostData.page"
184
+          :page-size="dialogPostData.pagesize"
185
+          layout="prev, pager, next, jumper"
186
+          :total="dialogTotal">
187
+        </el-pagination>
188
+      </div>
189
+      <span slot="footer" class="dialog-footer">
190
+        <el-button @click="closeDialog">取 消</el-button>
191
+        <el-button type="primary" @click="toSendCard">确 定</el-button>
192
+      </span>
193
+    </el-dialog>
194
+    <el-dialog
195
+      title="手动复制"
196
+      :visible.sync="copyDialogVisible"
197
+      width="300px"
198
+      center>
199
+      <div>
200
+        <el-input
201
+          placeholder="请输入内容"
202
+          v-model="currentCopyUrl"
203
+          clearable>
204
+        </el-input>
205
+        <!-- <a :data-clipboard-text="currentCopyUrl" ref="copy" @click="toCopy">复制链接</a> -->
206
+      </div>
207
+      <span slot="footer" class="dialog-footer">
208
+        <el-button type="primary" @click="copyDialogVisible = false">确 定</el-button>
209
+      </span>
210
+    </el-dialog>
211
+  </div>
212
+</template>
213
+
214
+<script>
215
+import Clipboard from 'clipboard'
216
+import { mapState, createNamespacedHelpers } from 'vuex'
217
+const { mapState: mapCardState, mapActions: mapCardActions } = createNamespacedHelpers('card')
218
+const { mapState: mapCustomerState, mapActions: mapCustomerActions } = createNamespacedHelpers('customer')
219
+
220
+export default {
221
+  name: '',
222
+  data () {
223
+    return {
224
+      currentCopyUrl: '',
225
+      copyDialogVisible: false,
226
+      selectCustomer: [],
227
+      dialogTotal: 0,
228
+      dialogPostData: {
229
+        username: '',
230
+        phone: '',
231
+        recommendname: '',
232
+        begindate: '',
233
+        enddate: '',
234
+        page: 1, // 当前页码
235
+        pagesize: 10, // 请求数据量
236
+      },
237
+      customerList: [],
238
+      centerDialogVisible: false,
239
+      total: 0,
240
+      postData: { // 表格搜索条件
241
+        caseid: '', // 案场id
242
+        page: 1, // 当前页码
243
+        pagesize: 10, // 请求数据量
244
+      },
245
+    }
246
+  },
247
+  mounted () {
248
+    this.$nextTick(function () {
249
+      this.getList()
250
+    })
251
+  },
252
+  computed: {
253
+    ...mapCardState({
254
+      cardList: x => x.cardList,
255
+    }),
256
+    ...mapState({
257
+      cases: x => x.app.cases.list,
258
+      defaultCaseId: x => x.app.cases.default
259
+    }),
260
+    ...mapCustomerState({
261
+      customers: x => x.customers,
262
+    }),
263
+    CaseId: {
264
+      get () {
265
+        return this.postData.caseid || this.defaultCaseId
266
+      },
267
+      set (val) {
268
+        this.postData.caseid = val
269
+      }
270
+    }
271
+  },
272
+  methods: {
273
+    ...mapCardActions([
274
+      'GetCardList',
275
+      'giveCard',
276
+    ]),
277
+    ...mapCustomerActions([
278
+      'GetCustomerList',
279
+      'SetCustomerListNull',
280
+    ]),
281
+    toSendHistory () { // 查看赠送记录
282
+      this.$router.push({ name: 'givingRecords' })
283
+    },
284
+    dialogSearch () { // 赠送客户搜索
285
+      this.GetCustomerList(this.dialogPostData)
286
+    },
287
+    handleCurrentChangeDialog (val) {
288
+      this.dialogPostData.page = val
289
+      this.GetCustomerList(this.dialogPostData)
290
+    },
291
+    handleSelectionChange (val) {
292
+      // console.log(val)
293
+      this.selectCustomer = val
294
+    },
295
+    toSendCard () { // 赠送卡
296
+      if (this.selectCustomer.length) {
297
+        this.selectCustomer = this.selectCustomer.map(x => x.CustomerId).join(',')
298
+        this.giveCard({
299
+          id: this.currentCardId,
300
+          users: this.selectCustomer,
301
+        }).then(res => {
302
+          this.$message({
303
+            type: 'success',
304
+            message: '赠送成功!'
305
+          })
306
+          this.centerDialogVisible = false
307
+          this.selectCustomer = []
308
+          if (this.customers.list.length) {
309
+            this.customers.list = []
310
+          }
311
+          this.getList()
312
+        })
313
+      } else {
314
+        this.$message({
315
+          type: 'error',
316
+          message: '请先选择需要赠送的客户!'
317
+        })
318
+      }
319
+    },
320
+    closeDialog () { // 关闭弹窗
321
+      this.centerDialogVisible = false
322
+      if (this.customers.list.length) {
323
+        this.customers.list = []
324
+      }
325
+    },
326
+    sendCard (index, row) { // 赠送卡弹窗
327
+      this.currentCardId = row.CardId
328
+      this.centerDialogVisible = true
329
+    },
330
+    search () { // 搜索
331
+      this.postData.page = 1
332
+      this.currentList = []
333
+      this.getList()
334
+    },
335
+    getList () { // 获取列表
336
+      this.GetCardList({
337
+        ...this.postData,
338
+        caseid: this.CaseId || this.defaultCaseId
339
+      }).then((res) => {
340
+        this.total = res.pagenum
341
+        // console.log(JSON.stringify(res))
342
+      })
343
+    },
344
+    handleCurrentChange (val) { // 跳转到分页
345
+      this.getList()
346
+    },
347
+    handleEdit (index, row) { // 编辑
348
+      this.$router.push({ name: 'editCard', query: { id: row.CardId } })
349
+    },
350
+    // handleCopy (url) { // 复制弹窗
351
+    //   this.currentCopyUrl = url
352
+    //   this.copyDialogVisible = true
353
+    // },
354
+    toCopy (index, row) { // 复制
355
+      console.log(1)
356
+      var clipboard = new Clipboard(this.$refs['copy' + index])
357
+      clipboard.on('success', e => {
358
+        console.log('复制成功')
359
+        clipboard.destroy()
360
+      })
361
+      clipboard.on('error', e => {
362
+        console.log('该浏览器不支持自动复制')
363
+        clipboard.destroy()
364
+      })
365
+    },
366
+    addCard () {
367
+      this.$router.push({ name: 'editCard', query: {} })
368
+    }
369
+  }
370
+}
371
+</script>
372
+
373
+<!-- Add "scoped" attribute to limit CSS to this component only -->
374
+<style lang="scss" scoped>
375
+@import "page.scss";
376
+.dialogSearchList {
377
+  align-items: center;
378
+  > li {
379
+    font-size: 0;
380
+    margin-left: 10px;
381
+    &:first-child {
382
+      margin-left: 0;
383
+    }
384
+    > *:nth-child(2) {
385
+      margin-left: 10px;
386
+    }
387
+  }
388
+}
389
+.copyBtn{
390
+  line-height: 29px;
391
+  border-radius: 3px;
392
+  color: #fff;
393
+  background: #67c23a;
394
+  display: inline-block;
395
+  padding: 0 15px;
396
+  margin-left: 10px;
397
+}
398
+</style>

+ 27
- 0
src/pages/system/cardAndCouponManager/bodyBuildingCardManager/page.scss Dosyayı Görüntüle

@@ -0,0 +1,27 @@
1
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+

+ 217
- 113
src/pages/system/cardAndCouponManager/cardManager/edit.vue Dosyayı Görüntüle

@@ -1,13 +1,12 @@
1 1
 <template>
2 2
   <div class="subPage">
3 3
     <form class="mainForm">
4
-      <h1 style="font-size:22px;">{{isEdit === 0 ? '新建' : '编辑'}}{{type === 'course' ? '课程体验卡' : '健身卡'}}</h1>
5 4
       <ul>
6 5
         <li class="flex-h">
7 6
           <span>选择案场:</span>
8 7
           <div class="flex-item">
9 8
             <div style="width:50%">
10
-              <el-select v-model="postData.CaseId" placeholder="请选择">
9
+              <el-select v-model="cardInfo.CaseId" placeholder="请选择" @change="caseChange">
11 10
                 <el-option
12 11
                   v-for="item in cases"
13 12
                   :key="item.CaseId"
@@ -27,7 +26,7 @@
27 26
                 :action='$api.file.image.url'
28 27
                 :show-file-list="false"
29 28
                 :on-success="handleAvatarSuccess">
30
-                <img v-if="postData.Img" :src="postData.Img" class="avatar">
29
+                <img v-if="cardInfo.Images" :src="cardInfo.Images[0].CardImageUrl" class="avatar">
31 30
                 <i v-else class="el-icon-plus avatar-uploader-icon"></i>
32 31
               </el-upload>
33 32
             </div>
@@ -39,34 +38,19 @@
39 38
             <div style="width:200px;">
40 39
               <el-input
41 40
                 placeholder="请输入"
42
-                v-model="postData.Name"
41
+                v-model="cardInfo.CardName"
43 42
                 clearable>
44 43
               </el-input>
45 44
             </div>
46 45
           </div>
47 46
         </li>
48
-        <li class="flex-h">
49
-          <span>卡类型:</span>
50
-          <div class="flex-item">
51
-            <div style="width:50%">
52
-              <el-select v-model="postData.Type" placeholder="请选择">
53
-                <el-option
54
-                  v-for="item in TypeList"
55
-                  :key="item.id"
56
-                  :label="item.name"
57
-                  :value="item.id">
58
-                </el-option>
59
-              </el-select>
60
-            </div>
61
-          </div>
62
-        </li>
63 47
         <li class="flex-h">
64 48
           <span>卡价格:</span>
65 49
           <div class="flex-item">
66 50
             <div style="width:200px;">
67 51
               <el-input
68 52
                 placeholder="请输入"
69
-                v-model="postData.Price"
53
+                v-model="cardInfo.Price"
70 54
                 clearable>
71 55
               </el-input>
72 56
             </div>
@@ -78,7 +62,7 @@
78 62
             <div style="width:200px;">
79 63
               <el-input
80 64
                 placeholder="请输入"
81
-                v-model="postData.TotalNum"
65
+                v-model="cardInfo.TotalCount"
82 66
                 clearable>
83 67
               </el-input>
84 68
             </div>
@@ -88,126 +72,85 @@
88 72
           <span>发送类型:</span>
89 73
           <div class="flex-item">
90 74
             <div>
91
-              <el-radio v-model="postData.SendType" label="1">渠道</el-radio>
92
-              <el-radio v-model="postData.SendType" label="3">案场</el-radio>
93
-              <el-radio v-model="postData.SendType" label="2">系统</el-radio>
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>
94 78
             </div>
95 79
           </div>
96 80
         </li>
97
-        <li class="flex-h" v-if="type === 'bodybuilding'">
81
+        <li class="flex-h" v-if="cardInfo.SendType === 'channel'">
98 82
           <span>选择渠道:</span>
99 83
           <div class="flex-item">
100 84
             <div style="width:50%">
101
-              <el-select v-model="postData.ChannelId" placeholder="请选择">
85
+              <el-select v-model="cardInfo.ChannelId" placeholder="请选择">
102 86
                 <el-option
103
-                  v-for="item in ChannelList"
104
-                  :key="item.id"
105
-                  :label="item.name"
106
-                  :value="item.id">
87
+                  v-for="item in channelList"
88
+                  :key="item.ChannelId"
89
+                  :label="item.ChannelName"
90
+                  :value="item.ChannelId">
107 91
                 </el-option>
108 92
               </el-select>
109 93
             </div>
110 94
           </div>
111 95
         </li>
112
-        <li class="flex-h" v-if="type === 'course'">
113
-          <span>目标商品:</span>
96
+        <li class="flex-h">
97
+          <span>目标课程:</span>
114 98
           <div class="flex-item">
115 99
             <div>
116
-              <el-select v-model="postData.GoodsId" placeholder="请选择">
100
+              <el-select v-model="cardInfo.Targets[0].TargetId" placeholder="请选择">
117 101
                 <el-option
118
-                  v-for="item in GoodsList"
119
-                  :key="item.id"
120
-                  :label="item.name"
121
-                  :value="item.id">
102
+                  v-for="item in courseList"
103
+                  :key="item.CourseId"
104
+                  :label="item.CourseName"
105
+                  :value="item.CourseId"
106
+                  :disabled="item.Status !== 1">
122 107
                 </el-option>
123 108
               </el-select>
124 109
             </div>
125 110
           </div>
126 111
         </li>
127
-        <li class="flex-h" v-if="postData.Assign === '2'">
128
-          <div class="flex-item">
129
-            <div style="border: 1px solid #eee;">
130
-              <el-table
131
-                :data="currentList"
132
-                stripe
133
-                style="width: 100%">
134
-                <el-table-column
135
-                  prop="Name"
136
-                  label="商品">
137
-                </el-table-column>
138
-                <el-table-column
139
-                  prop="Type"
140
-                  label="分类">
141
-                </el-table-column>
142
-                <el-table-column label="操作">
143
-                  <template slot-scope="scope">
144
-                    <el-button
145
-                      size="mini"
146
-                      type="warning"
147
-                      @click="deleteGoodsItem(scope.$index, scope.row)">删除</el-button>
148
-                  </template>
149
-                </el-table-column>
150
-              </el-table>
151
-              <div style="text-align:center;padding:10px 0;">
152
-                <el-button type="success" size="mini" @click="addGoods">添加商品</el-button>
153
-              </div>
154
-            </div>
155
-          </div>
156
-        </li>
157
-        <li class="flex-h" v-if="type === 'drink'">
112
+        <li class="flex-h">
158 113
           <span>卡有效时间:</span>
159 114
           <div class="flex-item">
160 115
             <div>
161 116
               <div class="addLine flex-h" style="align-item:center;margin-bottom:20px;">
162
-                <el-radio v-model="postData.TimeType" label="1">固定时间</el-radio>
163
-                <el-date-picker
164
-                  v-model="postData.StartDate"
117
+                <!-- <el-date-picker
118
+                  v-model="cardInfo.StartDate"
165 119
                   type="date"
166 120
                   placeholder="选择起始日期">
167 121
                 </el-date-picker>
168 122
                 <span style="line-height:40px;">至</span>
169 123
                 <el-date-picker
170
-                  v-model="postData.EndDate"
124
+                  v-model="cardInfo.EndDate"
171 125
                   type="date"
172 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">
173 135
                 </el-date-picker>
174 136
               </div>
175
-              <div class="addLine flex-h" style="align-item:center;">
176
-                <el-radio v-model="postData.TimeType" label="2">领取后</el-radio>
177
-                <span style="width:100px;">
178
-                  <el-input
179
-                    placeholder="请输入"
180
-                    v-model="postData.Days"
181
-                    clearable>
182
-                  </el-input>
183
-                </span>
184
-                <span style="line-height:40px;">天</span>
185
-              </div>
186
-            </div>
187
-          </div>
188
-        </li>
189
-        <li class="flex-h" v-if="type === 'course'">
190
-          <span>卡有效时间:</span>
191
-          <div class="flex-item">
192
-            <div>
193
-              <el-date-picker
194
-                v-model="postData.StartDate"
195
-                type="date"
196
-                placeholder="选择起始日期">
197
-              </el-date-picker>
198
-              <span style="line-height:40px;">至</span>
199
-              <el-date-picker
200
-                v-model="postData.EndDate"
201
-                type="date"
202
-                placeholder="选择截止日期">
203
-              </el-date-picker>
204 137
             </div>
205 138
           </div>
206 139
         </li>
207 140
         <li class="flex-h">
208 141
           <span>视频:</span>
209 142
           <div class="flex-item">
210
-            <div></div>
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>
211 154
           </div>
212 155
         </li>
213 156
         <li class="flex-h">
@@ -218,7 +161,7 @@
218 161
                 type="textarea"
219 162
                 :rows="2"
220 163
                 placeholder="请输入"
221
-                v-model="postData.ShareDesc">
164
+                v-model="cardInfo.Share.CardShareInfo">
222 165
               </el-input>
223 166
             </div>
224 167
           </div>
@@ -231,7 +174,7 @@
231 174
                 type="textarea"
232 175
                 :rows="2"
233 176
                 placeholder="请输入"
234
-                v-model="postData.RuleDesc">
177
+                v-model="cardInfo.Share.CardUseRule">
235 178
               </el-input>
236 179
             </div>
237 180
           </div>
@@ -244,7 +187,7 @@
244 187
                 type="textarea"
245 188
                 :rows="2"
246 189
                 placeholder="请输入"
247
-                v-model="postData.UsedDesc">
190
+                v-model="cardInfo.Share.CardUseInstruction">
248 191
               </el-input>
249 192
             </div>
250 193
           </div>
@@ -259,12 +202,18 @@
259 202
 </template>
260 203
 
261 204
 <script>
262
-import { mapState } from 'vuex'
205
+import { mapState, createNamespacedHelpers } from 'vuex'
206
+const { mapActions: mapCardActions } = createNamespacedHelpers('card')
207
+const { mapState: mapChannelState, mapActions: mapChannelActions } = createNamespacedHelpers('channel')
208
+const { mapActions: mapCourseActions } = createNamespacedHelpers('course')
263 209
 
264 210
 export default {
265 211
   name: '',
266 212
   data () {
267 213
     return {
214
+      date: '',
215
+      courseList: [],
216
+      videoOff: false,
268 217
       total: 0,
269 218
       type: this.$route.query.type,
270 219
       isEdit: this.$route.query.id === undefined ? 0 : 1,
@@ -275,6 +224,31 @@ export default {
275 224
         Name: 'ccc',
276 225
         Type: 'xxx'
277 226
       }], // 指定商品数据
227
+      cardInfo: {
228
+        CardName: '',
229
+        SendType: '',
230
+        VideoUrl: '',
231
+        Price: ' ',
232
+        StartDate: '',
233
+        EndDate: '',
234
+        TotalCount: '',
235
+        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: ''
251
+      },
278 252
       postData: {
279 253
         page: 1,
280 254
         pagesize: 10,
@@ -282,13 +256,61 @@ export default {
282 256
     }
283 257
   },
284 258
   mounted () {
285
-    this.$nextTick(function () { })
259
+    this.$nextTick(function () {
260
+      this.GetChannelListList({
261
+        caseid: this.defaultCaseId,
262
+        page: 1,
263
+        pagesize: 10000
264
+      }).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
+        })
291
+      })
292
+    })
286 293
   },
287 294
   computed: {
295
+    ...mapChannelState({
296
+      channelList: x => x.channelList,
297
+    }),
288 298
     ...mapState({
289 299
       cases: x => x.app.cases.list,
290
-      defaultCaseId: x => x.app.cases.default
300
+      defaultCaseId: x => x.app.cases.default,
301
+      OrgId: x => x.app.user.OrgId,
291 302
     }),
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
+    },
292 314
     CaseId: {
293 315
       get () {
294 316
         return this.postData.caseid || this.defaultCaseId
@@ -299,20 +321,99 @@ export default {
299 321
     }
300 322
   },
301 323
   methods: {
324
+    ...mapCardActions([
325
+      'addCard',
326
+      'getCardById',
327
+      'editCard',
328
+    ]),
329
+    ...mapCourseActions([
330
+      'GetCourseList',
331
+    ]),
332
+    ...mapChannelActions([
333
+      'GetChannelListList',
334
+    ]),
335
+    caseChange () { // 选择案场
336
+      this.GetChannelListList({
337
+        caseid: this.cardInfo.CaseId,
338
+        page: 1,
339
+        pagesize: 10000
340
+      })
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 = ''
354
+    },
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
+    },
302 363
     addGoods () { // 添加指定商品
303 364
       this.centerDialogVisible = true
304 365
     },
305 366
     submit () { // 保存
306
-      // 1
367
+      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
379
+        console.log(JSON.stringify(this.cardInfo))
380
+        this.editCard(this.cardInfo).then((res) => {
381
+          this.$alert('操作成功', '提示', {
382
+            confirmButtonText: '确定',
383
+            callback: action => {
384
+              this.$router.push({ name: 'cardList' })
385
+            }
386
+          })
387
+        })
388
+      } else {
389
+        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
401
+        console.log(JSON.stringify(this.cardInfo))
402
+        this.addCard(this.cardInfo).then((res) => {
403
+          this.$alert('操作成功', '提示', {
404
+            confirmButtonText: '确定',
405
+            callback: action => {
406
+              this.$router.push({ name: 'cardList' })
407
+            }
408
+          })
409
+        })
410
+      }
307 411
     },
308 412
     cancel () { // 取消
309 413
       this.$router.push({ name: 'couponList' })
310 414
     },
311
-    deleteGoodsItem () { // 删除指定商品item
312
-      // 1
313
-    },
314 415
     handleAvatarSuccess (res, file) {
315
-      this.postData.Img = res.result.url
416
+      this.cardInfo.Images[0].CardImageUrl = res.result.url
316 417
     },
317 418
   }
318 419
 }
@@ -325,4 +426,7 @@ export default {
325 426
     margin-right: 10px;
326 427
   }
327 428
 }
429
+.mainForm > ul > li > div > div > button {
430
+  margin-top: 0;
431
+}
328 432
 </style>

+ 146
- 66
src/pages/system/cardAndCouponManager/cardManager/index.vue Dosyayı Görüntüle

@@ -3,8 +3,7 @@
3 3
     <div class="system-table-search">
4 4
       <div class="flex-h">
5 5
         <div class="flex-item flex-h">
6
-          <el-button size="mini" type="success" @click="addCard('course')">新增课程体验卡</el-button>
7
-          <el-button size="mini" type="success" @click="addCard('bodybuilding')">新增健身卡</el-button>
6
+          <el-button size="mini" type="success" @click="addCard">新增课程体验卡</el-button>
8 7
         </div>
9 8
         <ul>
10 9
           <li>
@@ -27,44 +26,53 @@
27 26
     </div>
28 27
     <div class="system-table-box">
29 28
       <el-table
30
-        :data="currentList"
29
+        :data="cardList.list"
31 30
         stripe
32 31
         style="width: 100%">
33 32
         <el-table-column
34
-          prop="xxx"
33
+          prop="CardName"
35 34
           label="卡名称">
36 35
         </el-table-column>
37
-        <el-table-column
36
+        <!-- <el-table-column
38 37
           prop="xxx"
39 38
           label="卡类型">
40
-        </el-table-column>
39
+        </el-table-column> -->
41 40
         <el-table-column
42
-          prop="xxx"
41
+          prop="Price"
43 42
           label="卡价格">
44 43
         </el-table-column>
45 44
         <el-table-column
46
-          prop="xxx"
47
-          label="有效期">
45
+          prop="StartDate"
46
+          label="有效期"
47
+          width="150">
48
+          <template slot-scope="scope">
49
+            <span style="width:100%;display:block;text-align:center;white-space: nowrap;">{{toolClass.dateFormat(scope.row.StartDate)}}</span>
50
+            <span style="width:100%;display:block;text-align:center;white-space: nowrap;">至</span>
51
+            <span style="width:100%;display:block;text-align:center;white-space: nowrap;">{{toolClass.dateFormat(scope.row.EndDate)}}</span>
52
+          </template>
48 53
         </el-table-column>
49 54
         <el-table-column
50
-          prop="xxx"
55
+          prop="SendType"
51 56
           label="发放类型">
52 57
         </el-table-column>
53 58
         <el-table-column
54
-          prop="xxx"
59
+          prop="TotalCount"
55 60
           label="总数量">
56 61
         </el-table-column>
57 62
         <el-table-column
58
-          prop="xxx"
63
+          prop="SentCount"
59 64
           label="已发">
60 65
         </el-table-column>
61 66
         <el-table-column
62
-          prop="xxx"
67
+          prop="UsedCount"
63 68
           label="实际使用">
64 69
         </el-table-column>
65 70
         <el-table-column
66
-          prop="xxx"
71
+          prop="Status"
67 72
           label="状态">
73
+          <template slot-scope="scope">
74
+            {{scope.row.Status == 1 ? '正常' : '已过期'}}
75
+          </template>
68 76
         </el-table-column>
69 77
         <el-table-column label="操作" fixed='right' width="350">
70 78
           <template slot-scope="scope">
@@ -76,10 +84,7 @@
76 84
               size="mini"
77 85
               type="danger"
78 86
               @click="sendCard(scope.$index, scope.row)">赠送客户</el-button>
79
-            <el-button
80
-              size="mini"
81
-              type="success"
82
-              @click="handleDelete(scope.$index, scope.row)">点击复制链接</el-button>
87
+            <a class="copyBtn" :data-clipboard-text="'www.baidu.com'" :ref="'copy' + scope.$index" @click="toCopy(scope.$index, scope.row)">点击复制链接</a>
83 88
           </template>
84 89
         </el-table-column>
85 90
       </el-table>
@@ -115,7 +120,7 @@
115 120
           <li class="flex-item">
116 121
             <el-input
117 122
               placeholder="请输入推荐人"
118
-              v-model="dialogPostData.referrer"
123
+              v-model="dialogPostData.recommendname"
119 124
               clearable>
120 125
             </el-input>
121 126
           </li>
@@ -126,7 +131,7 @@
126 131
         <ul class="dialogSearchList flex-h">
127 132
           <li class="flex-item">
128 133
             <el-date-picker
129
-              v-model="dialogPostData.startdate"
134
+              v-model="dialogPostData.begindate"
130 135
               type="date"
131 136
               placeholder="选择起始日期">
132 137
             </el-date-picker>
@@ -141,7 +146,7 @@
141 146
       <div>
142 147
         <el-table
143 148
           ref="multipleTable"
144
-          :data="customerList"
149
+          :data="customers.list"
145 150
           tooltip-effect="dark"
146 151
           style="width: 100%"
147 152
           @selection-change="handleSelectionChange">
@@ -153,7 +158,7 @@
153 158
             label="姓名">
154 159
           </el-table-column>
155 160
           <el-table-column
156
-            prop="NickName"
161
+            prop="CustomerName"
157 162
             label="微信昵称">
158 163
           </el-table-column>
159 164
           <el-table-column
@@ -163,9 +168,12 @@
163 168
           <el-table-column
164 169
             prop="CreatDate"
165 170
             label="创建时间">
171
+            <template slot-scope="scope">
172
+              <span>{{toolClass.dateFormat(scope.row.CreateDate, 'yyyy-MM-dd')}}</span>
173
+            </template>
166 174
           </el-table-column>
167 175
           <el-table-column
168
-            prop="Referrer"
176
+            prop="RecommendName"
169 177
             label="推荐人">
170 178
           </el-table-column>
171 179
         </el-table>
@@ -180,23 +188,50 @@
180 188
         </el-pagination>
181 189
       </div>
182 190
       <span slot="footer" class="dialog-footer">
183
-        <el-button @click="centerDialogVisible = false">取 消</el-button>
184
-        <el-button type="primary" @click="centerDialogVisible = false">确 定</el-button>
191
+        <el-button @click="closeDialog">取 消</el-button>
192
+        <el-button type="primary" @click="toSendCard">确 定</el-button>
193
+      </span>
194
+    </el-dialog>
195
+    <el-dialog
196
+      title="手动复制"
197
+      :visible.sync="copyDialogVisible"
198
+      width="300px"
199
+      center>
200
+      <div>
201
+        <el-input
202
+          placeholder="请输入内容"
203
+          v-model="currentCopyUrl"
204
+          clearable>
205
+        </el-input>
206
+        <!-- <a :data-clipboard-text="currentCopyUrl" ref="copy" @click="toCopy">复制链接</a> -->
207
+      </div>
208
+      <span slot="footer" class="dialog-footer">
209
+        <el-button type="primary" @click="copyDialogVisible = false">确 定</el-button>
185 210
       </span>
186 211
     </el-dialog>
187 212
   </div>
188 213
 </template>
189 214
 
190 215
 <script>
191
-import { mapState } from 'vuex'
216
+import Clipboard from 'clipboard'
217
+import { mapState, createNamespacedHelpers } from 'vuex'
218
+const { mapState: mapCardState, mapActions: mapCardActions } = createNamespacedHelpers('card')
219
+const { mapState: mapCustomerState, mapActions: mapCustomerActions } = createNamespacedHelpers('customer')
192 220
 
193 221
 export default {
194 222
   name: '',
195 223
   data () {
196 224
     return {
225
+      currentCopyUrl: '',
226
+      copyDialogVisible: false,
227
+      selectCustomer: [],
197 228
       dialogTotal: 0,
198 229
       dialogPostData: {
199
-        caseid: '', // 案场id
230
+        username: '',
231
+        phone: '',
232
+        recommendname: '',
233
+        begindate: '',
234
+        enddate: '',
200 235
         page: 1, // 当前页码
201 236
         pagesize: 10, // 请求数据量
202 237
       },
@@ -208,9 +243,6 @@ export default {
208 243
         page: 1, // 当前页码
209 244
         pagesize: 10, // 请求数据量
210 245
       },
211
-      currentList: [{
212
-        xxx: 'xxx'
213
-      }]
214 246
     }
215 247
   },
216 248
   mounted () {
@@ -219,10 +251,16 @@ export default {
219 251
     })
220 252
   },
221 253
   computed: {
254
+    ...mapCardState({
255
+      cardList: x => x.cardList,
256
+    }),
222 257
     ...mapState({
223 258
       cases: x => x.app.cases.list,
224 259
       defaultCaseId: x => x.app.cases.default
225 260
     }),
261
+    ...mapCustomerState({
262
+      customers: x => x.customers,
263
+    }),
226 264
     CaseId: {
227 265
       get () {
228 266
         return this.postData.caseid || this.defaultCaseId
@@ -233,19 +271,61 @@ export default {
233 271
     }
234 272
   },
235 273
   methods: {
274
+    ...mapCardActions([
275
+      'GetCardList',
276
+      'giveCard',
277
+    ]),
278
+    ...mapCustomerActions([
279
+      'GetCustomerList',
280
+      'SetCustomerListNull',
281
+    ]),
236 282
     toSendHistory () { // 查看赠送记录
237
-      this.$router.push({name: 'givingRecords'})
283
+      this.$router.push({ name: 'givingRecords' })
238 284
     },
239 285
     dialogSearch () { // 赠送客户搜索
240
-      // 1
286
+      this.GetCustomerList(this.dialogPostData)
241 287
     },
242 288
     handleCurrentChangeDialog (val) {
243
-      // 1
289
+      this.dialogPostData.page = val
290
+      this.GetCustomerList(this.dialogPostData)
244 291
     },
245 292
     handleSelectionChange (val) {
246
-      // 1
293
+      // console.log(val)
294
+      this.selectCustomer = val
295
+    },
296
+    toSendCard () { // 赠送卡
297
+      if (this.selectCustomer.length) {
298
+        this.selectCustomer = this.selectCustomer.map(x => x.CustomerId).join(',')
299
+        this.giveCard({
300
+          id: this.currentCardId,
301
+          users: this.selectCustomer,
302
+        }).then(res => {
303
+          this.$message({
304
+            type: 'success',
305
+            message: '赠送成功!'
306
+          })
307
+          this.centerDialogVisible = false
308
+          this.selectCustomer = []
309
+          if (this.customers.list.length) {
310
+            this.customers.list = []
311
+          }
312
+          this.getList()
313
+        })
314
+      } else {
315
+        this.$message({
316
+          type: 'error',
317
+          message: '请先选择需要赠送的客户!'
318
+        })
319
+      }
247 320
     },
248
-    sendCard (index, row) { // 赠送卡
321
+    closeDialog () { // 关闭弹窗
322
+      this.centerDialogVisible = false
323
+      if (this.customers.list.length) {
324
+        this.customers.list = []
325
+      }
326
+    },
327
+    sendCard (index, row) { // 赠送卡弹窗
328
+      this.currentCardId = row.CardId
249 329
       this.centerDialogVisible = true
250 330
     },
251 331
     search () { // 搜索
@@ -254,47 +334,38 @@ export default {
254 334
       this.getList()
255 335
     },
256 336
     getList () { // 获取列表
257
-      this.$ajax(this.$api.channelManager.getChannelList.url, {
258
-        method: this.$api.channelManager.getChannelList.method,
259
-        queryData: { ...this.postData, caseid: this.CaseId }
260
-      }).then(res => {
261
-        this.currentList = res.list
262
-        this.postData.page = res.page
337
+      this.GetCardList({
338
+        ...this.postData,
339
+        caseid: this.CaseId || this.defaultCaseId
340
+      }).then((res) => {
263 341
         this.total = res.pagenum
342
+        // console.log(JSON.stringify(res))
264 343
       })
265 344
     },
266 345
     handleCurrentChange (val) { // 跳转到分页
267 346
       this.getList()
268 347
     },
269 348
     handleEdit (index, row) { // 编辑
270
-      this.$router.push({ name: 'editChannel', query: { id: row.ChannelId } })
349
+      this.$router.push({ name: 'editCard', query: { id: row.CardId } })
271 350
     },
272
-    handleDelete (index, row) { // 删除
273
-      let name = '确认删除渠道“' + row.ChannelName + '”?'
274
-      this.$confirm(name, '提示', {
275
-        confirmButtonText: '确定',
276
-        cancelButtonText: '取消',
277
-        type: 'warning'
278
-      }).then(() => {
279
-        this.$ajax(this.$api.channelManager.deleteChannel.url, {
280
-          method: this.$api.channelManager.deleteChannel.method,
281
-          urlData: { channelId: row.ChannelId }
282
-        }).then(res => {
283
-          this.$message({
284
-            type: 'success',
285
-            message: '删除成功!'
286
-          })
287
-          this.search()
288
-        })
289
-      }).catch(() => {
290
-        this.$message({
291
-          type: 'info',
292
-          message: '已取消删除'
293
-        })
351
+    // handleCopy (url) { // 复制弹窗
352
+    //   this.currentCopyUrl = url
353
+    //   this.copyDialogVisible = true
354
+    // },
355
+    toCopy (index, row) { // 复制
356
+      console.log(1)
357
+      var clipboard = new Clipboard(this.$refs['copy' + index])
358
+      clipboard.on('success', e => {
359
+        console.log('复制成功')
360
+        clipboard.destroy()
361
+      })
362
+      clipboard.on('error', e => {
363
+        console.log('该浏览器不支持自动复制')
364
+        clipboard.destroy()
294 365
       })
295 366
     },
296
-    addCard (val) {
297
-      this.$router.push({ name: 'editCard', query: { type: val } })
367
+    addCard () {
368
+      this.$router.push({ name: 'editCard', query: {} })
298 369
     }
299 370
   }
300 371
 }
@@ -316,4 +387,13 @@ export default {
316 387
     }
317 388
   }
318 389
 }
390
+.copyBtn{
391
+  line-height: 29px;
392
+  border-radius: 3px;
393
+  color: #fff;
394
+  background: #67c23a;
395
+  display: inline-block;
396
+  padding: 0 15px;
397
+  margin-left: 10px;
398
+}
319 399
 </style>

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

@@ -1,13 +1,13 @@
1 1
 <template>
2 2
   <div class="subPage">
3 3
     <form class="mainForm">
4
-      <h1 style="font-size:22px;">{{isEdit === 0 ? '新建' : '编辑'}}{{type === 'drink' ? '饮品优惠券' : '课程优惠券'}}</h1>
4
+      <!-- <h1 style="font-size:22px;">{{isEdit === 0 ? '新建' : '编辑'}}{{couponInfo.CouponType === 'goods' ? '饮品优惠券' : '课程优惠券'}}</h1> -->
5 5
       <ul>
6 6
         <li class="flex-h">
7 7
           <span>选择案场:</span>
8 8
           <div class="flex-item">
9 9
             <div style="width:50%">
10
-              <el-select v-model="postData.CaseId" placeholder="请选择">
10
+              <el-select v-model="couponInfo.CaseId" placeholder="请选择" @change="caseChange">
11 11
                 <el-option
12 12
                   v-for="item in cases"
13 13
                   :key="item.CaseId"
@@ -27,7 +27,7 @@
27 27
                 :action='$api.file.image.url'
28 28
                 :show-file-list="false"
29 29
                 :on-success="handleAvatarSuccess">
30
-                <img v-if="postData.Img" :src="postData.Img" class="avatar">
30
+                <img v-if="couponInfo.Images[0].CouponImageUrl" :src="couponInfo.Images[0].CouponImageUrl" class="avatar">
31 31
                 <i v-else class="el-icon-plus avatar-uploader-icon"></i>
32 32
               </el-upload>
33 33
             </div>
@@ -39,7 +39,7 @@
39 39
             <div style="width:200px;">
40 40
               <el-input
41 41
                 placeholder="请输入"
42
-                v-model="postData.Name"
42
+                v-model="couponInfo.CouponName"
43 43
                 clearable>
44 44
               </el-input>
45 45
             </div>
@@ -49,11 +49,11 @@
49 49
           <span>券类型:</span>
50 50
           <div class="flex-item">
51 51
             <div style="width:50%">
52
-              <el-select v-model="postData.Type" placeholder="请选择">
52
+              <el-select v-model="couponInfo.CouponType" placeholder="请选择" @change="couponTypeChange">
53 53
                 <el-option
54 54
                   v-for="item in TypeList"
55 55
                   :key="item.id"
56
-                  :label="item.name"
56
+                  :label="item.value"
57 57
                   :value="item.id">
58 58
                 </el-option>
59 59
               </el-select>
@@ -66,7 +66,7 @@
66 66
             <div style="width:200px;">
67 67
               <el-input
68 68
                 placeholder="请输入"
69
-                v-model="postData.Price"
69
+                v-model="couponInfo.Price"
70 70
                 clearable>
71 71
               </el-input>
72 72
             </div>
@@ -78,7 +78,7 @@
78 78
             <div style="width:200px;">
79 79
               <el-input
80 80
                 placeholder="请输入"
81
-                v-model="postData.TotalNum"
81
+                v-model="couponInfo.TotalCount"
82 82
                 clearable>
83 83
               </el-input>
84 84
             </div>
@@ -88,22 +88,22 @@
88 88
           <span>发送类型:</span>
89 89
           <div class="flex-item">
90 90
             <div>
91
-              <el-radio v-model="postData.SendType" label="1">渠道</el-radio>
92
-              <el-radio v-if="type === 'course'" v-model="postData.SendType" label="3">案场</el-radio>
93
-              <el-radio v-model="postData.SendType" label="2">系统</el-radio>
91
+              <el-radio v-model="couponInfo.SendType" label="channel">渠道</el-radio>
92
+              <el-radio v-if="couponInfo.CouponType === 'case'" v-model="couponInfo.SendType" label="case">案场</el-radio>
93
+              <el-radio v-model="couponInfo.SendType" label="system">系统</el-radio>
94 94
             </div>
95 95
           </div>
96 96
         </li>
97
-        <li class="flex-h">
97
+        <li class="flex-h" v-if="couponInfo.SendType === 'channel'">
98 98
           <span>选择渠道:</span>
99 99
           <div class="flex-item">
100 100
             <div style="width:50%">
101
-              <el-select v-model="postData.ChannelId" placeholder="请选择">
101
+              <el-select v-model="couponInfo.ChannelId" placeholder="请选择">
102 102
                 <el-option
103
-                  v-for="item in ChannelList"
104
-                  :key="item.id"
105
-                  :label="item.name"
106
-                  :value="item.id">
103
+                  v-for="item in channelList"
104
+                  :key="item.ChannelId"
105
+                  :label="item.ChannelName"
106
+                  :value="item.ChannelId">
107 107
                 </el-option>
108 108
               </el-select>
109 109
             </div>
@@ -113,25 +113,28 @@
113 113
           <span>目标商品:</span>
114 114
           <div class="flex-item">
115 115
             <div>
116
-              <el-radio v-model="postData.Assign" label="1">全部商品</el-radio>
117
-              <el-radio v-model="postData.Assign" label="2">指定商品</el-radio>
116
+              <el-radio v-model="couponInfo.IsAll" label="1">全部商品</el-radio>
117
+              <el-radio v-model="couponInfo.IsAll" label="0">指定商品</el-radio>
118 118
             </div>
119 119
           </div>
120 120
         </li>
121
-        <li class="flex-h" v-if="postData.Assign === '2'">
121
+        <li class="flex-h" v-if="couponInfo.IsAll === '0'">
122 122
           <div class="flex-item">
123 123
             <div style="border: 1px solid #eee;">
124 124
               <el-table
125
-                :data="currentList"
125
+                :data="couponInfo.Targets"
126 126
                 stripe
127 127
                 style="width: 100%">
128 128
                 <el-table-column
129
-                  prop="Name"
129
+                  prop="TargetName"
130 130
                   label="商品">
131 131
                 </el-table-column>
132 132
                 <el-table-column
133
-                  prop="Type"
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">
@@ -148,20 +151,20 @@
148 151
             </div>
149 152
           </div>
150 153
         </li>
151
-        <li class="flex-h" v-if="type === 'drink'">
154
+        <li class="flex-h" v-if="couponInfo.CouponType === 'goods'">
152 155
           <span>券有效时间:</span>
153 156
           <div class="flex-item">
154 157
             <div>
155 158
               <div class="addLine flex-h" style="align-item:center;margin-bottom:20px;">
156 159
                 <el-radio v-model="postData.TimeType" label="1">固定时间</el-radio>
157 160
                 <el-date-picker
158
-                  v-model="postData.StartDate"
161
+                  v-model="couponInfo.StartDate"
159 162
                   type="date"
160 163
                   placeholder="选择起始日期">
161 164
                 </el-date-picker>
162 165
                 <span style="line-height:40px;">至</span>
163 166
                 <el-date-picker
164
-                  v-model="postData.EndDate"
167
+                  v-model="couponInfo.EndDate"
165 168
                   type="date"
166 169
                   placeholder="选择截止日期">
167 170
                 </el-date-picker>
@@ -171,7 +174,7 @@
171 174
                 <span style="width:100px;">
172 175
                   <el-input
173 176
                     placeholder="请输入"
174
-                    v-model="postData.Days"
177
+                    v-model="couponInfo.ValidDays"
175 178
                     clearable>
176 179
                   </el-input>
177 180
                 </span>
@@ -185,13 +188,13 @@
185 188
           <div class="flex-item">
186 189
             <div>
187 190
               <el-date-picker
188
-                v-model="postData.StartDate"
191
+                v-model="couponInfo.StartDate"
189 192
                 type="date"
190 193
                 placeholder="选择起始日期">
191 194
               </el-date-picker>
192 195
               <span style="line-height:40px;">至</span>
193 196
               <el-date-picker
194
-                v-model="postData.EndDate"
197
+                v-model="couponInfo.EndDate"
195 198
                 type="date"
196 199
                 placeholder="选择截止日期">
197 200
               </el-date-picker>
@@ -201,7 +204,17 @@
201 204
         <li class="flex-h">
202 205
           <span>视频:</span>
203 206
           <div class="flex-item">
204
-            <div></div>
207
+            <div style="vertical-align: middle;">
208
+              <a style="line-height: 40px;" v-if="videoOff" :href="couponInfo.VideoUrl" target="blank">{{couponInfo.VideoUrl}}</a>
209
+              <el-upload
210
+                class="avatar-uploader"
211
+                :action='$api.file.image.url'
212
+                :show-file-list="false"
213
+                :on-success="videoSuccess">
214
+                <a style="line-height: 40px;padding: 0 10px;">{{videoOff ? '更换' : '添加'}}视频</a>
215
+              </el-upload>
216
+              <el-button v-if="videoOff" type="danger" @click="deleteVideo">删除视频</el-button>
217
+            </div>
205 218
           </div>
206 219
         </li>
207 220
         <li class="flex-h">
@@ -212,7 +225,7 @@
212 225
                 type="textarea"
213 226
                 :rows="2"
214 227
                 placeholder="请输入"
215
-                v-model="postData.ShareDesc">
228
+                v-model="couponInfo.Share.CouponShareInfo">
216 229
               </el-input>
217 230
             </div>
218 231
           </div>
@@ -225,7 +238,7 @@
225 238
                 type="textarea"
226 239
                 :rows="2"
227 240
                 placeholder="请输入"
228
-                v-model="postData.RuleDesc">
241
+                v-model="couponInfo.Share.UseRule">
229 242
               </el-input>
230 243
             </div>
231 244
           </div>
@@ -238,7 +251,7 @@
238 251
                 type="textarea"
239 252
                 :rows="2"
240 253
                 placeholder="请输入"
241
-                v-model="postData.UsedDesc">
254
+                v-model="couponInfo.Share.UseInstruction">
242 255
               </el-input>
243 256
             </div>
244 257
           </div>
@@ -255,22 +268,22 @@
255 268
       width="650px"
256 269
       center>
257 270
       <div>
258
-        <div v-if="type === 'drink'">
271
+        <div v-if="couponInfo.CouponType === 'goods'">
259 272
           <el-table
260 273
             ref="multipleTable"
261
-            :data="drinkList"
274
+            :data="goodsList.list"
262 275
             tooltip-effect="dark"
263 276
             style="width: 100%"
264
-            @selection-change="handleSelectionChange">
277
+            @selection-change="handleGoodsChange">
265 278
             <el-table-column
266 279
               type="selection">
267 280
             </el-table-column>
268 281
             <el-table-column
269
-              prop="Name"
282
+              prop="GoodsName"
270 283
               label="商品名称">
271 284
             </el-table-column>
272 285
             <el-table-column
273
-              prop="Type"
286
+              prop="TypeId"
274 287
               label="类别">
275 288
             </el-table-column>
276 289
             <el-table-column
@@ -286,22 +299,22 @@
286 299
             :total="total">
287 300
           </el-pagination>
288 301
         </div>
289
-        <div v-if="type === 'course'">
302
+        <div v-if="couponInfo.CouponType === 'course'">
290 303
           <el-table
291 304
             ref="multipleTable"
292
-            :data="courseList"
305
+            :data="courseList.list"
293 306
             tooltip-effect="dark"
294 307
             style="width: 100%"
295
-            @selection-change="handleSelectionChange">
308
+            @selection-change="handleCourseChange">
296 309
             <el-table-column
297 310
               type="selection">
298 311
             </el-table-column>
299 312
             <el-table-column
300
-              prop="Name"
313
+              prop="CourseName"
301 314
               label="商品名称">
302 315
             </el-table-column>
303 316
             <el-table-column
304
-              prop="StartDate"
317
+              prop="BeginDate"
305 318
               label="开始时间">
306 319
             </el-table-column>
307 320
             <el-table-column
@@ -309,7 +322,7 @@
309 322
               label="结束时间">
310 323
             </el-table-column>
311 324
             <el-table-column
312
-              prop="Type"
325
+              prop="CourseType"
313 326
               label="类别">
314 327
             </el-table-column>
315 328
             <el-table-column
@@ -328,75 +341,301 @@
328 341
       </div>
329 342
       <span slot="footer" class="dialog-footer">
330 343
         <el-button @click="centerDialogVisible = false">取 消</el-button>
331
-        <el-button type="primary" @click="centerDialogVisible = false">确 定</el-button>
344
+        <el-button type="primary" @click="sureAddItem">确 定</el-button>
332 345
       </span>
333 346
     </el-dialog>
334 347
   </div>
335 348
 </template>
336 349
 
337 350
 <script>
338
-import { mapState } from 'vuex'
351
+import { mapState, createNamespacedHelpers } from 'vuex'
352
+const { mapActions: mapCouponActions } = createNamespacedHelpers('coupon')
353
+const { mapState: mapChannelState, mapActions: mapChannelActions } = createNamespacedHelpers('channel')
354
+const { mapState: mapGoodsState, mapActions: mapGoodsActions } = createNamespacedHelpers('goods')
355
+const { mapState: mapCourseState, mapActions: mapCourseActions } = createNamespacedHelpers('course')
339 356
 
340 357
 export default {
341 358
   name: '',
342 359
   data () {
343 360
     return {
361
+      videoOff: false,
344 362
       total: 0,
345
-      drinkList: [], // 饮品列表
346
-      courseList: [], // 课程列表
347 363
       centerDialogVisible: false,
348
-      type: this.$route.query.type,
364
+      type: this.$route.query.type || '', // goods、course
349 365
       isEdit: this.$route.query.id === undefined ? 0 : 1,
350 366
       ChannelList: [], // 渠道列表
351
-      TypeList: [], // 类型列表
367
+      TypeList: [{ // 类型列表
368
+        value: '商品券',
369
+        id: 'goods'
370
+      }, {
371
+        value: '课程券',
372
+        id: 'course'
373
+      }],
352 374
       currentList: [{
353 375
         Name: 'ccc',
354 376
         Type: 'xxx'
355 377
       }], // 指定商品数据
378
+      couponInfo: {
379
+        CaseId: '',
380
+        CouponName: '',
381
+        CouponType: '',
382
+        Price: '',
383
+        TotalCount: '',
384
+        SendType: '',
385
+        IsAll: '',
386
+        StartDate: '',
387
+        EndDate: '',
388
+        ValidDays: '',
389
+        VideoUrl: '',
390
+        ChannelId: '',
391
+        Images: [{
392
+          CouponImageUrl: ''
393
+        }],
394
+        Share: {
395
+          CouponShareInfo: '',
396
+          UseRule: '',
397
+          UseInstruction: ''
398
+        },
399
+        Targets: []
400
+      },
356 401
       postData: {
357 402
         page: 1,
358
-        pagesize: 10,
403
+        pagesize: 6,
359 404
       },
405
+      currentSelectArr: [],
360 406
     }
361 407
   },
362 408
   mounted () {
363
-    this.$nextTick(function () { })
409
+    this.$nextTick(function () {
410
+      this.GetChannelListList({
411
+        caseid: this.defaultCaseId,
412
+        page: 1,
413
+        pagesize: 10000
414
+      }).then(() => {
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
+        })
429
+      })
430
+    })
364 431
   },
365 432
   computed: {
366 433
     ...mapState({
367 434
       cases: x => x.app.cases.list,
368 435
       defaultCaseId: x => x.app.cases.default
369 436
     }),
437
+    ...mapChannelState({
438
+      channelList: x => x.channelList,
439
+    }),
440
+    ...mapGoodsState({
441
+      goodsList: x => x.goodsList,
442
+      goodsTypes: x => x.goodsTypes.list,
443
+    }),
444
+    ...mapCourseState({
445
+      courseList: x => x.courseList,
446
+    }),
370 447
     CaseId: {
371 448
       get () {
372
-        return this.postData.caseid || this.defaultCaseId
449
+        return this.couponInfo.caseid || this.defaultCaseId
373 450
       },
374 451
       set (val) {
375
-        this.postData.caseid = val
452
+        this.couponInfo.caseid = val
376 453
       }
377 454
     }
378 455
   },
379 456
   methods: {
380
-    handleSelectionChange (val) {
381
-      // this.multipleSelection = val;
457
+    ...mapGoodsActions([
458
+      'GetGoodsList',
459
+      'GetGoodTypes',
460
+    ]),
461
+    ...mapCouponActions([
462
+      'addCoupon',
463
+      'getCouponById',
464
+      'editCoupon',
465
+    ]),
466
+    ...mapChannelActions([
467
+      'GetChannelListList',
468
+    ]),
469
+    ...mapCourseActions([
470
+      'GetCourseList',
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
+    },
479
+    deleteVideo () { // 删除视频
480
+      this.couponInfo.VideoUrl = ''
481
+      this.videoOff = false
482
+    },
483
+    caseChange () { // 选择案场
484
+      this.couponInfo.ChannelId = ''
485
+      this.GetChannelListList({
486
+        caseid: this.couponInfo.CaseId,
487
+        page: 1,
488
+        pagesize: 10000
489
+      })
490
+    },
491
+    sureAddItem () { // 确定添加指定商品
492
+      var bool = true
493
+      if (this.couponInfo.CouponType === 'goods') {
494
+        for (var n = 0; n < this.currentSelectArr.length; n++) {
495
+          if (this.couponInfo.Targets.length) {
496
+            bool = true
497
+            for (var a = 0; a < this.couponInfo.Targets.length; a++) {
498
+              if (this.currentSelectArr[n].GoodsId === this.couponInfo.Targets[a].TargetId) {
499
+                bool = false
500
+              }
501
+            }
502
+            if (bool) {
503
+              this.couponInfo.Targets.push({
504
+                TargetName: this.currentSelectArr[n].GoodsName,
505
+                TargetId: this.currentSelectArr[n].GoodsId,
506
+                TargetType: this.currentSelectArr[n].TypeId
507
+              })
508
+            }
509
+          } else {
510
+            this.couponInfo.Targets.push({
511
+              TargetName: this.currentSelectArr[n].GoodsName,
512
+              TargetId: this.currentSelectArr[n].GoodsId,
513
+              TargetType: this.currentSelectArr[n].TypeId
514
+            })
515
+          }
516
+        }
517
+      } else if (this.couponInfo.CouponType === 'course') {
518
+        for (var x = 0; x < this.currentSelectArr.length; x++) {
519
+          if (this.couponInfo.Targets.length) {
520
+            bool = true
521
+            for (var y = 0; y < this.couponInfo.Targets.length; y++) {
522
+              if (this.currentSelectArr[x].CourseId === this.couponInfo.Targets[y].TargetId) {
523
+                bool = false
524
+              }
525
+            }
526
+            if (bool) {
527
+              this.couponInfo.Targets.push({
528
+                TargetName: this.currentSelectArr[x].CourseName,
529
+                TargetId: this.currentSelectArr[x].CourseId,
530
+                TargetType: this.currentSelectArr[x].CourseType
531
+              })
532
+            }
533
+          } else {
534
+            this.couponInfo.Targets.push({
535
+              TargetName: this.currentSelectArr[x].CourseName,
536
+              TargetId: this.currentSelectArr[x].CourseId,
537
+              TargetType: this.currentSelectArr[x].CourseType
538
+            })
539
+          }
540
+        }
541
+      }
542
+      this.centerDialogVisible = false
543
+    },
544
+    handleGoodsChange (val) {
545
+      this.currentSelectArr = val
546
+    },
547
+    handleCourseChange (val) {
548
+      this.currentSelectArr = val
549
+    },
550
+    couponTypeChange () {
551
+      if (this.goodsList.length) {
552
+        this.goodsList = []
553
+      }
554
+      if (this.courseList.length) {
555
+        this.courseList = []
556
+      }
557
+      this.couponInfo.Targets = []
382 558
     },
383 559
     addGoods () { // 添加指定商品
384
-      this.centerDialogVisible = true
560
+      if (this.couponInfo.CouponType === 'goods') {
561
+        this.GetGoodsList({
562
+          ...this.postData,
563
+          caseid: this.couponInfo.CaseId
564
+        }).then((res) => {
565
+          this.total = res.pagenum
566
+          this.centerDialogVisible = true
567
+        })
568
+      } else if (this.couponInfo.CouponType === 'course') {
569
+        this.GetCourseList({
570
+          ...this.postData,
571
+          caseid: this.couponInfo.CaseId
572
+        }).then((res) => {
573
+          this.total = res.pagenum
574
+          this.centerDialogVisible = true
575
+        })
576
+      }
385 577
     },
386 578
     submit () { // 保存
387
-      // 1
579
+      if (this.$route.query.id) {
580
+        this.editCoupon({
581
+          ...this.couponInfo,
582
+          IsAll: this.couponInfo.IsAll - 0,
583
+          TotalCount: this.couponInfo.TotalCount - 0,
584
+          ValidDays: this.couponInfo.ValidDays || 0
585
+        }).then((res) => {
586
+          this.$alert('操作成功', '提示', {
587
+            confirmButtonText: '确定',
588
+            callback: action => {
589
+              this.$router.push({ name: 'couponList' })
590
+            }
591
+          })
592
+        })
593
+      } else {
594
+        this.addCoupon({
595
+          ...this.couponInfo,
596
+          IsAll: this.couponInfo.IsAll - 0,
597
+          TotalCount: this.couponInfo.TotalCount - 0,
598
+          ValidDays: this.couponInfo.ValidDays || 0
599
+        }).then((res) => {
600
+          this.$alert('操作成功', '提示', {
601
+            confirmButtonText: '确定',
602
+            callback: action => {
603
+              this.$router.push({ name: 'couponList' })
604
+            }
605
+          })
606
+        })
607
+      }
388 608
     },
389 609
     cancel () { // 取消
390 610
       this.$router.push({ name: 'couponList' })
391 611
     },
392
-    deleteGoodsItem () { // 删除指定商品item
393
-      // 1
612
+    deleteGoodsItem (index, row) { // 删除指定商品item
613
+      this.couponInfo.Targets.splice(index, 1)
394 614
     },
395 615
     handleAvatarSuccess (res, file) {
396
-      this.postData.Img = res.result.url
616
+      this.couponInfo.Images[0].CouponImageUrl = res.result.url
617
+    },
618
+    videoSuccess (res, file) {
619
+      this.videoOff = true
620
+      this.couponInfo.VideoUrl = res.result.url
397 621
     },
398 622
     handleCurrentChange (val) { // 跳转到分页
399
-      // this.getList()
623
+      this.postData.page = val
624
+      if (this.couponInfo.CouponType === 'goods') {
625
+        this.GetGoodsList({
626
+          ...this.postData,
627
+          caseid: this.couponInfo.CaseId
628
+        }).then((res) => {
629
+          this.total = res.pagenum
630
+        })
631
+      } else if (this.couponInfo.CouponType === 'course') {
632
+        this.GetCourseList({
633
+          ...this.postData,
634
+          caseid: this.couponInfo.CaseId
635
+        }).then((res) => {
636
+          this.total = res.pagenum
637
+        })
638
+      }
400 639
     },
401 640
   }
402 641
 }
@@ -409,4 +648,7 @@ export default {
409 648
     margin-right: 10px;
410 649
   }
411 650
 }
651
+.mainForm > ul > li > div > div > button {
652
+  margin-top: 0;
653
+}
412 654
 </style>

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

@@ -3,8 +3,9 @@
3 3
     <div class="system-table-search">
4 4
       <div class="flex-h">
5 5
         <div class="flex-item flex-h">
6
-          <el-button size="mini" type="success" @click="addCoupon('drink')">新增饮品优惠券</el-button>
7
-          <el-button size="mini" type="success" @click="addCoupon('course')">新增课程优惠券</el-button>
6
+          <el-button size="mini" type="success" @click="addCoupon('')">新增优惠券</el-button>
7
+          <!-- <el-button size="mini" type="success" @click="addCoupon('drink')">新增饮品优惠券</el-button>
8
+          <el-button size="mini" type="success" @click="addCoupon('course')">新增课程优惠券</el-button> -->
8 9
         </div>
9 10
         <ul>
10 11
           <li>
@@ -27,44 +28,55 @@
27 28
     </div>
28 29
     <div class="system-table-box">
29 30
       <el-table
30
-        :data="currentList"
31
+        :data="couponList.list"
31 32
         stripe
32 33
         style="width: 100%">
33 34
         <el-table-column
34
-          prop="xxx"
35
+          prop="CouponName"
35 36
           label="券名称">
36 37
         </el-table-column>
37 38
         <el-table-column
38
-          prop="xxx"
39
+          prop="CouponType"
39 40
           label="券类型">
41
+          <template slot-scope="scope">{{scope.row.CouponType === 'goods' ? '商品券' : '课程券'}}</template>
40 42
         </el-table-column>
41 43
         <el-table-column
42
-          prop="xxx"
44
+          prop="Price"
43 45
           label="券价格">
44 46
         </el-table-column>
45 47
         <el-table-column
46
-          prop="xxx"
47
-          label="有效期">
48
+          prop="StartDate"
49
+          label="有效期"
50
+          width="150">
51
+          <template slot-scope="scope">
52
+            <span style="width:100%;display:block;text-align:center;white-space: nowrap;">{{toolClass.dateFormat(scope.row.StartDate)}}</span>
53
+            <span style="width:100%;display:block;text-align:center;white-space: nowrap;">至</span>
54
+            <span style="width:100%;display:block;text-align:center;white-space: nowrap;">{{toolClass.dateFormat(scope.row.EndDate)}}</span>
55
+          </template>
48 56
         </el-table-column>
49 57
         <el-table-column
50
-          prop="xxx"
58
+          prop="SendType"
51 59
           label="发放类型">
60
+          <template slot-scope="scope">{{scope.row.SendType === 'channel' ? '渠道' : scope.row.SendType === 'case' ? '案场' : '系统'}}</template>
52 61
         </el-table-column>
53 62
         <el-table-column
54
-          prop="xxx"
63
+          prop="TotalCount"
55 64
           label="总数量">
56 65
         </el-table-column>
57 66
         <el-table-column
58
-          prop="xxx"
67
+          prop="SentCount"
59 68
           label="已发">
60 69
         </el-table-column>
61 70
         <el-table-column
62
-          prop="xxx"
71
+          prop="UsedCount"
63 72
           label="实际使用">
64 73
         </el-table-column>
65 74
         <el-table-column
66
-          prop="xxx"
75
+          prop="Status"
67 76
           label="状态">
77
+          <template slot-scope="scope">
78
+            <span>{{scope.row.Status === 1 ? '正常' : '已过期'}}</span>
79
+          </template>
68 80
         </el-table-column>
69 81
         <el-table-column label="操作" fixed='right' width="350">
70 82
           <template slot-scope="scope">
@@ -115,7 +127,7 @@
115 127
           <li class="flex-item">
116 128
             <el-input
117 129
               placeholder="请输入推荐人"
118
-              v-model="dialogPostData.referrer"
130
+              v-model="dialogPostData.recommendname"
119 131
               clearable>
120 132
             </el-input>
121 133
           </li>
@@ -126,7 +138,7 @@
126 138
         <ul class="dialogSearchList flex-h">
127 139
           <li class="flex-item">
128 140
             <el-date-picker
129
-              v-model="dialogPostData.startdate"
141
+              v-model="dialogPostData.begindate"
130 142
               type="date"
131 143
               placeholder="选择起始日期">
132 144
             </el-date-picker>
@@ -141,7 +153,7 @@
141 153
       <div>
142 154
         <el-table
143 155
           ref="multipleTable"
144
-          :data="customerList"
156
+          :data="customers.list"
145 157
           tooltip-effect="dark"
146 158
           style="width: 100%"
147 159
           @selection-change="handleSelectionChange">
@@ -153,7 +165,7 @@
153 165
             label="姓名">
154 166
           </el-table-column>
155 167
           <el-table-column
156
-            prop="NickName"
168
+            prop="CustomerName"
157 169
             label="微信昵称">
158 170
           </el-table-column>
159 171
           <el-table-column
@@ -161,11 +173,14 @@
161 173
             label="手机号">
162 174
           </el-table-column>
163 175
           <el-table-column
164
-            prop="CreatDate"
176
+            prop="CreateDate"
165 177
             label="创建时间">
178
+            <template slot-scope="scope">
179
+              <span>{{toolClass.dateFormat(scope.row.CreateDate, 'yyyy-MM-dd')}}</span>
180
+            </template>
166 181
           </el-table-column>
167 182
           <el-table-column
168
-            prop="Referrer"
183
+            prop="RecommendName"
169 184
             label="推荐人">
170 185
           </el-table-column>
171 186
         </el-table>
@@ -176,19 +191,21 @@
176 191
           :current-page.sync="dialogPostData.page"
177 192
           :page-size="dialogPostData.pagesize"
178 193
           layout="prev, pager, next, jumper"
179
-          :total="dialogTotal">
194
+          :total="customers.pagenum">
180 195
         </el-pagination>
181 196
       </div>
182 197
       <span slot="footer" class="dialog-footer">
183 198
         <el-button @click="centerDialogVisible = false">取 消</el-button>
184
-        <el-button type="primary" @click="centerDialogVisible = false">确 定</el-button>
199
+        <el-button type="primary" @click="ForCustomer">确 定</el-button>
185 200
       </span>
186 201
     </el-dialog>
187 202
   </div>
188 203
 </template>
189 204
 
190 205
 <script>
191
-import { mapState } from 'vuex'
206
+import { mapState, createNamespacedHelpers } from 'vuex'
207
+const { mapState: mapCouponState, mapActions: mapCouponActions } = createNamespacedHelpers('coupon')
208
+const { mapState: mapCustomerState, mapActions: mapCustomerActions } = createNamespacedHelpers('customer')
192 209
 
193 210
 export default {
194 211
   name: '',
@@ -196,11 +213,14 @@ export default {
196 213
     return {
197 214
       dialogTotal: 0,
198 215
       dialogPostData: {
199
-        caseid: '', // 案场id
216
+        username: '',
217
+        phone: '',
218
+        recommendname: '',
219
+        begindate: '',
220
+        enddate: '',
200 221
         page: 1, // 当前页码
201 222
         pagesize: 10, // 请求数据量
202 223
       },
203
-      customerList: [],
204 224
       centerDialogVisible: false,
205 225
       total: 0,
206 226
       postData: { // 表格搜索条件
@@ -208,9 +228,8 @@ export default {
208 228
         page: 1, // 当前页码
209 229
         pagesize: 10, // 请求数据量
210 230
       },
211
-      currentList: [{
212
-        xxx: 'xxx'
213
-      }]
231
+      currentInfo: {},
232
+      selUsers: '',
214 233
     }
215 234
   },
216 235
   mounted () {
@@ -219,6 +238,12 @@ export default {
219 238
     })
220 239
   },
221 240
   computed: {
241
+    ...mapCouponState({
242
+      couponList: x => x.couponList,
243
+    }),
244
+    ...mapCustomerState({
245
+      customers: x => x.customers,
246
+    }),
222 247
     ...mapState({
223 248
       cases: x => x.app.cases.list,
224 249
       defaultCaseId: x => x.app.cases.default
@@ -233,38 +258,53 @@ export default {
233 258
     }
234 259
   },
235 260
   methods: {
261
+    ...mapCouponActions([
262
+      'GetCouponList',
263
+      'GiveCoupon',
264
+    ]),
265
+    ...mapCustomerActions([
266
+      'GetCustomerList',
267
+      'SetCustomerListNull',
268
+    ]),
236 269
     dialogSearch () { // 赠送客户搜索
270
+      this.GetCustomerList(this.dialogPostData)
237 271
       // 1
238 272
     },
239 273
     handleCurrentChangeDialog (val) {
240 274
       // 1
241 275
     },
242 276
     handleSelectionChange (val) {
277
+      this.selUsers = val.map(x => x.CustomerId).join(',')
243 278
       // 1
244 279
     },
245 280
     sendCoupon (index, row) { // 赠送优惠券
281
+      this.currentInfo = row
282
+      this.selUsers = ''
283
+      this.SetCustomerListNull()
246 284
       this.centerDialogVisible = true
247 285
     },
248 286
     search () { // 搜索
249 287
       this.postData.page = 1
250
-      this.currentList = []
288
+      if (this.couponList.length) {
289
+        this.couponList = []
290
+      }
251 291
       this.getList()
252 292
     },
253 293
     getList () { // 获取列表
254
-      this.$ajax(this.$api.channelManager.getChannelList.url, {
255
-        method: this.$api.channelManager.getChannelList.method,
256
-        queryData: { ...this.postData, caseid: this.CaseId }
257
-      }).then(res => {
258
-        this.currentList = res.list
259
-        this.postData.page = res.page
294
+      this.GetCouponList({
295
+        ...this.postData,
296
+        caseid: this.CaseId || this.defaultCaseId
297
+      }).then((res) => {
260 298
         this.total = res.pagenum
299
+        // console.log(JSON.stringify(res))
261 300
       })
262 301
     },
263 302
     handleCurrentChange (val) { // 跳转到分页
303
+      this.postData.page = val
264 304
       this.getList()
265 305
     },
266 306
     handleEdit (index, row) { // 编辑
267
-      this.$router.push({ name: 'editChannel', query: { id: row.ChannelId } })
307
+      this.$router.push({ name: 'editCoupon', query: { type: row.CouponType, id: row.CouponId, caseid: row.CaseId } })
268 308
     },
269 309
     handleDelete (index, row) { // 删除
270 310
       let name = '确认删除渠道“' + row.ChannelName + '”?'
@@ -292,12 +332,39 @@ export default {
292 332
     },
293 333
     addCoupon (val) {
294 334
       this.$router.push({ name: 'editCoupon', query: { type: val } })
335
+    },
336
+    ForCustomer () {
337
+      if (this.selUsers === '') {
338
+        this.$message({
339
+          type: 'error',
340
+          message: '请先选择客户!'
341
+        })
342
+        return false
343
+      }
344
+      if (!this.currentInfo || this.currentInfo.CouponId === '') {
345
+        this.$message({
346
+          type: 'error',
347
+          message: '请先选择需要赠送的优惠券!'
348
+        })
349
+        return false
350
+      }
351
+      this.GiveCoupon({
352
+        id: this.currentInfo.CouponId,
353
+        users: this.selUsers,
354
+      }).then(res => {
355
+        this.$message({
356
+          type: 'success',
357
+          message: '赠送成功!'
358
+        })
359
+        this.centerDialogVisible = false
360
+        this.getList()
361
+      })
295 362
     }
296 363
   }
297 364
 }
298 365
 </script>
299 366
 
300
-<!-- Add "scoped" attribute to limit CSS to this component only -->
367
+<!-- Add "scoped" attrib0 0ute to limit CSS to this component only -->
301 368
 <style lang="scss" scoped>
302 369
 @import "page.scss";
303 370
 .dialogSearchList {

+ 1
- 0
src/pages/system/cardAndCouponManager/couponManager/page.scss Dosyayı Görüntüle

@@ -23,5 +23,6 @@
23 23
 
24 24
 
25 25
 
26
+
26 27
 
27 28
 

+ 11
- 6
src/pages/system/caseManager/caseAreaManager/index.vue Dosyayı Görüntüle

@@ -57,8 +57,10 @@
57 57
           </template>
58 58
         </el-table-column>
59 59
         <el-table-column
60
-          prop="CaseName"
61
-          label="案场">
60
+          label="案场" >
61
+          <template slot-scope="scope">
62
+            <span>{{getCaseName(scope.row.CaseId)}}</span>
63
+          </template>
62 64
         </el-table-column>
63 65
         <el-table-column label="操作">
64 66
           <template slot-scope="scope">
@@ -117,7 +119,7 @@ export default {
117 119
       set (val) {
118 120
         this.postData.caseid = val
119 121
       }
120
-    }
122
+    },
121 123
   },
122 124
   methods: {
123 125
     search () { // 搜索
@@ -125,14 +127,17 @@ export default {
125 127
       this.currentList = []
126 128
       this.getList()
127 129
     },
130
+    getCaseName (caseid) {
131
+      return (this.cases.filter(x => x.CaseId === caseid)[0] || {}).CaseName
132
+    },
128 133
     getList () { // 获取列表
129 134
       this.$ajax(this.$api.caseManager.getCaseAreaList.url, {
130 135
         method: this.$api.caseManager.getCaseAreaList.method,
131 136
         queryData: { ...this.postData, caseid: this.CaseId }
132 137
       }).then(res => {
133
-        for (var n = 0; n < res.list.length; n++) {
134
-          res.list[n].CaseName = this.cases.filter(x => x.CaseId === res.list[n].CaseId)[0].CaseName
135
-        }
138
+        // for (var n = 0; n < res.list.length; n++) {
139
+        //   res.list[n].CaseName = this.cases.filter(x => x.CaseId === res.list[n].CaseId)[0].CaseName
140
+        // }
136 141
         this.currentList = res.list
137 142
         this.postData.page = res.page
138 143
         this.total = res.pagenum

+ 18
- 4
src/pages/system/caseManager/caseInfo/addCase/index.vue Dosyayı Görüntüle

@@ -16,7 +16,7 @@
16 16
           </div>
17 17
         </li>
18 18
         <li class="flex-h">
19
-          <span>案场地址:</span>
19
+          <span>案场地址:<em>*</em></span>
20 20
           <div class="flex-item">
21 21
             <div>
22 22
               <el-input
@@ -57,7 +57,7 @@
57 57
           </div>
58 58
         </li>
59 59
         <li class="flex-h">
60
-          <span>案场头像:</span>
60
+          <span>案场头像:<em>*</em></span>
61 61
           <div class="flex-item">
62 62
             <div>
63 63
               <!-- <a class="formImg">
@@ -176,14 +176,28 @@ export default {
176 176
       if (this.postData.CaseName === '') {
177 177
         this.$message({
178 178
           type: 'error',
179
-          message: '案场名称不能为空'
179
+          message: '请填写案场名称!'
180
+        })
181
+        return false
182
+      }
183
+      if (this.postData.CaseAddress === '') {
184
+        this.$message({
185
+          type: 'error',
186
+          message: '请填写案场地址!'
187
+        })
188
+        return false
189
+      }
190
+      if (this.postData.CaseIcon === '') {
191
+        this.$message({
192
+          type: 'error',
193
+          message: '请上传案场图片!'
180 194
         })
181 195
         return false
182 196
       }
183 197
       if (this.postData.Coordinate === '') {
184 198
         this.$message({
185 199
           type: 'error',
186
-          message: '案场经纬度不能为空'
200
+          message: '案场在地图上的位置不明确,请在地图上抓取地址获取经纬度!'
187 201
         })
188 202
         return false
189 203
       }

+ 18
- 4
src/pages/system/caseManager/caseInfo/editCase/index.vue Dosyayı Görüntüle

@@ -15,7 +15,7 @@
15 15
           </div>
16 16
         </li>
17 17
         <li class="flex-h">
18
-          <span>案场地址:</span>
18
+          <span>案场地址:<em>*</em></span>
19 19
           <div class="flex-item">
20 20
             <div>
21 21
               <el-input
@@ -53,7 +53,7 @@
53 53
           </div>
54 54
         </li>
55 55
         <li class="flex-h">
56
-          <span>案场头像:</span>
56
+          <span>案场头像:<em>*</em></span>
57 57
           <div class="flex-item">
58 58
             <div>
59 59
               <!-- <a class="formImg">
@@ -183,14 +183,28 @@ export default {
183 183
       if (this.postData.CaseName === '') {
184 184
         this.$message({
185 185
           type: 'error',
186
-          message: '案场名称不能为空'
186
+          message: '请填写案场名称!'
187
+        })
188
+        return false
189
+      }
190
+      if (this.postData.CaseAddress === '') {
191
+        this.$message({
192
+          type: 'error',
193
+          message: '请填写案场地址!'
194
+        })
195
+        return false
196
+      }
197
+      if (this.postData.CaseIcon === '') {
198
+        this.$message({
199
+          type: 'error',
200
+          message: '请上传案场图片!'
187 201
         })
188 202
         return false
189 203
       }
190 204
       if (this.postData.Coordinate === '') {
191 205
         this.$message({
192 206
           type: 'error',
193
-          message: '案场经纬度不能为空'
207
+          message: '案场在地图上的位置不明确,请在地图上抓取地址获取经纬度!'
194 208
         })
195 209
         return false
196 210
       }

+ 4
- 0
src/pages/system/caseManager/caseInfo/index.vue Dosyayı Görüntüle

@@ -48,6 +48,7 @@
48 48
 
49 49
 <script>
50 50
 import tableSearch from '@/components/tableSearch/index'
51
+import { mapActions } from 'vuex'
51 52
 
52 53
 export default {
53 54
   name: '',
@@ -71,6 +72,9 @@ export default {
71 72
     })
72 73
   },
73 74
   methods: {
75
+    ...mapActions([
76
+      'updateSystemInfo',
77
+    ]),
74 78
     pplConcerned (index, row) { // 相关人员
75 79
       this.$router.push({name: 'pplConcerned', query: {id: row.CaseId}})
76 80
     },

+ 1
- 0
src/pages/system/caseManager/caseTableManager/add.vue Dosyayı Görüntüle

@@ -9,6 +9,7 @@
9 9
               <el-input
10 10
                 placeholder="请输入名称"
11 11
                 v-model="postData.TableNo"
12
+                maxlength="6"
12 13
                 clearable>
13 14
               </el-input>
14 15
             </div>

+ 1
- 0
src/pages/system/caseManager/caseTableManager/edit.vue Dosyayı Görüntüle

@@ -9,6 +9,7 @@
9 9
               <el-input
10 10
                 placeholder="请输入名称"
11 11
                 v-model="postData.TableNo"
12
+                maxlength="6"
12 13
                 clearable>
13 14
               </el-input>
14 15
             </div>

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

@@ -101,7 +101,7 @@ export default {
101 101
         page: 1, // 当前页码
102 102
         pageSize: 10, // 请求数据量
103 103
       },
104
-      total: '', // 总数
104
+      total: 0, // 总数
105 105
       // 数据体
106 106
       // {date: '2016-05-02',name: '王小虎',address: '上海市普陀区金沙江路 1518 弄'}
107 107
       tableData: [],

+ 34
- 23
src/pages/system/cmsManager/bannerManager/add.vue Dosyayı Görüntüle

@@ -77,7 +77,7 @@
77 77
         <li class="flex-h">
78 78
           <span>图片:</span>
79 79
           <div class="flex-item">
80
-            <el-upload
80
+            <!-- <el-upload
81 81
               :action="$api.file.image.url"
82 82
               :limit='limit'
83 83
               list-type="picture-card"
@@ -89,7 +89,15 @@
89 89
             </el-upload>
90 90
             <el-dialog :visible.sync="dialogVisible">
91 91
               <img width="100%" :src="imgs" alt="">
92
-            </el-dialog>
92
+            </el-dialog> -->
93
+            <el-upload
94
+              class="avatar-uploader"
95
+              :action='$api.file.image.url'
96
+              :show-file-list="false"
97
+              :on-success="handleAvatarSuccess">
98
+              <img v-if="postData.ImageUrl" :src="postData.ImageUrl" class="avatar">
99
+              <i v-else class="el-icon-plus avatar-uploader-icon"></i>
100
+            </el-upload>
93 101
           </div>
94 102
         </li>
95 103
         <!-- <li class="flex-h">
@@ -192,13 +200,13 @@ export default {
192 200
       }
193 201
       this.postData.OrgId = this.OrgId
194 202
       this.postData.ForwardType === '1' ? this.postData.ForwardType = 'url' : this.postData.ForwardType = 'course'
195
-      this.postData.ImageUrl = ''
196
-      for (let i = 0; i < this.imgsArr.length; i++) {
197
-        this.postData.ImageUrl += this.imgsArr[i].response.result.url + ','
198
-      }
199
-      if (this.postData.ImageUrl) {
200
-        this.postData.ImageUrl = this.postData.ImageUrl.substr(0, this.postData.ImageUrl.length - 1)
201
-      }
203
+      // this.postData.ImageUrl = ''
204
+      // for (let i = 0; i < this.imgsArr.length; i++) {
205
+      //   this.postData.ImageUrl += this.imgsArr[i].response.result.url + ','
206
+      // }
207
+      // if (this.postData.ImageUrl) {
208
+      //   this.postData.ImageUrl = this.postData.ImageUrl.substr(0, this.postData.ImageUrl.length - 1)
209
+      // }
202 210
       this.$ajax(this.$api.cms.addImage.url, {
203 211
         method: this.$api.cms.addImage.method,
204 212
         data: this.postData
@@ -218,21 +226,24 @@ export default {
218 226
     cancel () {
219 227
       this.$router.go(-1)
220 228
     },
221
-    handlePictureCardPreview (res, file, fileList) {
222
-      this.imgs = res.result.url
223
-      this.dialogVisible = false
224
-      this.imgsArr = fileList
225
-    },
226
-    handleRemove (file, fileList) {
227
-      this.imgsArr = fileList
229
+    // handlePictureCardPreview (res, file, fileList) {
230
+    //   this.imgs = res.result.url
231
+    //   this.dialogVisible = false
232
+    //   this.imgsArr = fileList
233
+    // },
234
+    // handleRemove (file, fileList) {
235
+    //   this.imgsArr = fileList
236
+    // },
237
+    // exceed () {
238
+    //   this.$message({
239
+    //     message: '超过可传的图片上限',
240
+    //     type: 'info',
241
+    //     duration: 1000
242
+    //   })
243
+    // }
244
+    handleAvatarSuccess (res, file) {
245
+      this.postData.ImageUrl = res.result.url
228 246
     },
229
-    exceed () {
230
-      this.$message({
231
-        message: '超过可传的图片上限',
232
-        type: 'info',
233
-        duration: 1000
234
-      })
235
-    }
236 247
   }
237 248
 }
238 249
 </script>

+ 45
- 34
src/pages/system/cmsManager/bannerManager/edit.vue Dosyayı Görüntüle

@@ -77,7 +77,7 @@
77 77
         <li class="flex-h">
78 78
           <span>图片:</span>
79 79
           <div class="flex-item">
80
-            <el-upload
80
+            <!-- <el-upload
81 81
               :action="$api.file.image.url"
82 82
               :limit='limit'
83 83
               list-type="picture-card"
@@ -89,7 +89,15 @@
89 89
             </el-upload>
90 90
             <el-dialog :visible.sync="dialogVisible">
91 91
               <img width="100%" :src="imgs" alt="">
92
-            </el-dialog>
92
+            </el-dialog> -->
93
+            <el-upload
94
+              class="avatar-uploader"
95
+              :action='$api.file.image.url'
96
+              :show-file-list="false"
97
+              :on-success="handleAvatarSuccess">
98
+              <img v-if="postData.ImageUrl" :src="postData.ImageUrl" class="avatar">
99
+              <i v-else class="el-icon-plus avatar-uploader-icon"></i>
100
+            </el-upload>
93 101
           </div>
94 102
         </li>
95 103
         <!-- <li class="flex-h">
@@ -187,13 +195,13 @@ export default {
187 195
       this.postData.OrgId = this.OrgId
188 196
       this.postData.CaseId = this.CaseId
189 197
       this.postData.ForwardType === '1' ? this.postData.ForwardType = 'url' : this.postData.ForwardType = 'course'
190
-      this.postData.ImageUrl = ''
191
-      for (let i = 0; i < this.imgsArr.length; i++) {
192
-        this.postData.ImageUrl += this.imgsArr[i].response.result.url + ','
193
-      }
194
-      if (this.postData.ImageUrl) {
195
-        this.postData.ImageUrl = this.postData.ImageUrl.substr(0, this.postData.ImageUrl.length - 1)
196
-      }
198
+      // this.postData.ImageUrl = ''
199
+      // for (let i = 0; i < this.imgsArr.length; i++) {
200
+      //   this.postData.ImageUrl += this.imgsArr[i].response.result.url + ','
201
+      // }
202
+      // if (this.postData.ImageUrl) {
203
+      //   this.postData.ImageUrl = this.postData.ImageUrl.substr(0, this.postData.ImageUrl.length - 1)
204
+      // }
197 205
       this.$ajax(this.$api.cms.editImage.url, {
198 206
         method: this.$api.cms.editImage.method,
199 207
         data: this.postData,
@@ -226,37 +234,40 @@ export default {
226 234
         console.log(res)
227 235
         res.Status = res.Status + ''
228 236
         res.ForwardType === 'url' ? res.ForwardType = '1' : res.ForwardType = '0'
229
-        let imgsArr = []
230
-        let item = {
231
-          url: res.ImageUrl,
232
-          response: {
233
-            result: {
234
-              url: res.ImageUrl
235
-            }
236
-          }
237
-        }
238
-        imgsArr.push(item)
239
-        this.imgsArr = imgsArr
237
+        // let imgsArr = []
238
+        // let item = {
239
+        //   url: res.ImageUrl,
240
+        //   response: {
241
+        //     result: {
242
+        //       url: res.ImageUrl
243
+        //     }
244
+        //   }
245
+        // }
246
+        // imgsArr.push(item)
247
+        // this.imgsArr = imgsArr
240 248
         this.postData = res
241 249
       }).catch(msg => {
242 250
 
243 251
       })
244 252
     },
245
-    handlePictureCardPreview (res, file, fileList) {
246
-      this.imgs = res.result.url
247
-      this.dialogVisible = false
248
-      this.imgsArr = fileList
249
-    },
250
-    handleRemove (file, fileList) {
251
-      this.imgsArr = fileList
253
+    // handlePictureCardPreview (res, file, fileList) {
254
+    //   this.imgs = res.result.url
255
+    //   this.dialogVisible = false
256
+    //   this.imgsArr = fileList
257
+    // },
258
+    // handleRemove (file, fileList) {
259
+    //   this.imgsArr = fileList
260
+    // },
261
+    // exceed () {
262
+    //   this.$message({
263
+    //     message: '超过可传的图片上限',
264
+    //     type: 'info',
265
+    //     duration: 1000
266
+    //   })
267
+    // }
268
+    handleAvatarSuccess (res, file) {
269
+      this.postData.ImageUrl = res.result.url
252 270
     },
253
-    exceed () {
254
-      this.$message({
255
-        message: '超过可传的图片上限',
256
-        type: 'info',
257
-        duration: 1000
258
-      })
259
-    }
260 271
   }
261 272
 }
262 273
 </script>

+ 93
- 60
src/pages/system/cmsManager/majorProjects/edit.vue Dosyayı Görüntüle

@@ -44,7 +44,7 @@
44 44
         <li class="flex-h">
45 45
           <span>图片:</span>
46 46
           <div class="flex-item">
47
-            <el-upload
47
+            <!-- <el-upload
48 48
               :action="$api.file.image.url"
49 49
               list-type="picture-card"
50 50
               :limit='limit'
@@ -53,13 +53,22 @@
53 53
               :on-remove="handleRemove"
54 54
               :on-exceed="exceed">
55 55
               <i class="el-icon-plus"></i>
56
+            </el-upload> -->
57
+            <!-- 单选 -->
58
+            <el-upload
59
+              class="avatar-uploader"
60
+              :action='$api.file.image.url'
61
+              :show-file-list="false"
62
+              :on-success="handleImgSuccess">
63
+              <img v-if="imgShow" :src="imgShow" class="avatar">
64
+              <i v-else class="el-icon-plus avatar-uploader-icon"></i>
56 65
             </el-upload>
57 66
           </div>
58 67
         </li>
59 68
         <li class="flex-h">
60 69
           <span>详细图片:</span>
61 70
           <div class="flex-item">
62
-            <el-upload
71
+            <!-- <el-upload
63 72
               :action='$api.file.image.url'
64 73
               list-type="picture-card"
65 74
               :limit='limit'
@@ -68,6 +77,15 @@
68 77
               :on-remove="handleRemoveDetail"
69 78
               :on-exceed="exceed">
70 79
               <i class="el-icon-plus"></i>
80
+            </el-upload> -->
81
+            <!-- 单选 -->
82
+            <el-upload
83
+              class="avatar-uploader"
84
+              :action='$api.file.image.url'
85
+              :show-file-list="false"
86
+              :on-success="handleDetailImgSuccess">
87
+              <img v-if="detailImgShow" :src="detailImgShow" class="avatar">
88
+              <i v-else class="el-icon-plus avatar-uploader-icon"></i>
71 89
             </el-upload>
72 90
           </div>
73 91
         </li>
@@ -200,8 +218,10 @@ export default {
200 218
     return {
201 219
       id: '',
202 220
       limit: 1,
203
-      imgs: null,
204
-      detailimgs: null,
221
+      // imgs: null,
222
+      // detailimgs: null,
223
+      img: '',
224
+      detailimg: '',
205 225
       selCourseVisible: false,
206 226
       selCourseList: [],
207 227
     }
@@ -228,40 +248,46 @@ export default {
228 248
         this.getCourse()
229 249
       }
230 250
     },
231
-    imgsArr: {
232
-      get () {
233
-        return this.imgs || (this.detail.CmsCaseImgs || []).filter(x => x.ImageType === 'cover').map(x => {
234
-          return {
235
-            url: x.CaseImageUrl,
236
-            response: {
237
-              result: {
238
-                url: x.CaseImageUrl
239
-              }
240
-            }
241
-          }
242
-        })
243
-      },
244
-      set (val) {
245
-        this.imgs = val
246
-      }
251
+    imgShow () {
252
+      return this.img || ((this.detail.CmsCaseImgs || []).filter(x => x.ImageType === 'cover')[0] || {}).CaseImageUrl
247 253
     },
248
-    detailimgsArr: {
249
-      get () {
250
-        return this.detailimgs || (this.detail.CmsCaseImgs || []).filter(x => x.ImageType === 'detail').map(x => {
251
-          return {
252
-            url: x.CaseImageUrl,
253
-            response: {
254
-              result: {
255
-                url: x.CaseImageUrl
256
-              }
257
-            }
258
-          }
259
-        })
260
-      },
261
-      set (val) {
262
-        this.detailimgs = val
263
-      }
254
+    detailImgShow () {
255
+      return this.detailimg || ((this.detail.CmsCaseImgs || []).filter(x => x.ImageType === 'detail')[0] || {}).CaseImageUrl
264 256
     },
257
+    // imgsArr: {
258
+    //   get () {
259
+    //     return this.imgs || (this.detail.CmsCaseImgs || []).filter(x => x.ImageType === 'cover').map(x => {
260
+    //       return {
261
+    //         url: x.CaseImageUrl,
262
+    //         response: {
263
+    //           result: {
264
+    //             url: x.CaseImageUrl
265
+    //           }
266
+    //         }
267
+    //       }
268
+    //     })
269
+    //   },
270
+    //   set (val) {
271
+    //     this.imgs = val
272
+    //   }
273
+    // },
274
+    // detailimgsArr: {
275
+    //   get () {
276
+    //     return this.detailimgs || (this.detail.CmsCaseImgs || []).filter(x => x.ImageType === 'detail').map(x => {
277
+    //       return {
278
+    //         url: x.CaseImageUrl,
279
+    //         response: {
280
+    //           result: {
281
+    //             url: x.CaseImageUrl
282
+    //           }
283
+    //         }
284
+    //       }
285
+    //     })
286
+    //   },
287
+    //   set (val) {
288
+    //     this.detailimgs = val
289
+    //   }
290
+    // },
265 291
     coursesList () {
266 292
       return (this.courses.list || []).map(x => {
267 293
         return {
@@ -284,16 +310,17 @@ export default {
284 310
       'GetCourseList',
285 311
     ]),
286 312
     submit () {
287
-      const imgs = this.imgsArr.map(x => x.response.result.url).join(',')
288
-      const detailimgs = this.detailimgsArr.map(x => x.response.result.url).join(',')
313
+      // const imgs = this.imgsArr.map(x => x.response.result.url).join(',')
314
+      // const detailimgs = this.detailimgsArr.map(x => x.response.result.url).join(',')
315
+
289 316
       const courseids = (this.detail.Courses || []).map(x => x.CourseId).join(',')
290 317
       if (this.id === '') {
291 318
         this.detail.OrgId = this.OrgId
292
-        this.AddCaseInfo({...this.detail, OrgId: this.OrgId, imgs, detailimgs, courseids}).then(res => {
319
+        this.AddCaseInfo({...this.detail, OrgId: this.OrgId, imgs: this.img, detailimgs: this.detailimg, courseids}).then(res => {
293 320
           this.afterSave()
294 321
         })
295 322
       } else {
296
-        this.AddCaseInfo({...this.detail, imgs, detailimgs, courseids}).then(res => {
323
+        this.AddCaseInfo({...this.detail, imgs: this.img, detailimgs: this.detailimg, courseids}).then(res => {
297 324
           this.afterSave()
298 325
         })
299 326
       }
@@ -311,18 +338,18 @@ export default {
311 338
     cancel () {
312 339
       this.$router.go(-1)
313 340
     },
314
-    handlePictureCardPreview (res, file, fileList) {
315
-      this.imgsArr = fileList
316
-    },
317
-    handleRemove (file, fileList) {
318
-      this.imgsArr = fileList
319
-    },
320
-    handlePictureCardPreviewDetail (res, file, fileList) {
321
-      this.detailimgsArr = fileList
322
-    },
323
-    handleRemoveDetail (file, fileList) {
324
-      this.detailimgsArr = fileList
325
-    },
341
+    // handlePictureCardPreview (res, file, fileList) {
342
+    //   this.imgsArr = fileList
343
+    // },
344
+    // handleRemove (file, fileList) {
345
+    //   this.imgsArr = fileList
346
+    // },
347
+    // handlePictureCardPreviewDetail (res, file, fileList) {
348
+    //   this.detailimgsArr = fileList
349
+    // },
350
+    // handleRemoveDetail (file, fileList) {
351
+    //   this.detailimgsArr = fileList
352
+    // },
326 353
     getDetail () {
327 354
       this.GetCaseInfo({id: this.id})
328 355
     },
@@ -338,13 +365,13 @@ export default {
338 365
         this.$refs.courseTable.clearSelection()
339 366
       }
340 367
     },
341
-    exceed () {
342
-      this.$message({
343
-        message: '超过可传的图片上限',
344
-        type: 'info',
345
-        duration: 1000
346
-      })
347
-    },
368
+    // exceed () {
369
+    //   this.$message({
370
+    //     message: '超过可传的图片上限',
371
+    //     type: 'info',
372
+    //     duration: 1000
373
+    //   })
374
+    // },
348 375
     addCourse () {
349 376
       this.GetCourseList({caseid: this.CaseId, page: 1, pagesize: 100, callback: this.coursesShow})
350 377
     },
@@ -365,7 +392,13 @@ export default {
365 392
     },
366 393
     deleteItem (row) {
367 394
       this.UpdateInfo({...this.detail, Courses: this.detail.Courses.filter(x => x.CourseId !== row.CourseId)})
368
-    }
395
+    },
396
+    handleImgSuccess (res, file) {
397
+      this.img = res.result.url
398
+    },
399
+    handleDetailImgSuccess (res, file) {
400
+      this.detailimg = res.result.url
401
+    },
369 402
   },
370 403
   mounted () {
371 404
     this.getCourse()

+ 35
- 23
src/pages/system/cmsManager/newsManager/add.vue Dosyayı Görüntüle

@@ -62,7 +62,7 @@
62 62
         <li class="flex-h">
63 63
           <span>图片:</span>
64 64
           <div class="flex-item">
65
-            <el-upload
65
+            <!-- <el-upload
66 66
               :action="$api.file.image.url"
67 67
               :limit='limit'
68 68
               list-type="picture-card"
@@ -74,7 +74,16 @@
74 74
             </el-upload>
75 75
             <el-dialog :visible.sync="dialogVisible">
76 76
               <img width="100%" :src="imgs" alt="">
77
-            </el-dialog>
77
+            </el-dialog> -->
78
+            <!-- 单选 -->
79
+            <el-upload
80
+              class="avatar-uploader"
81
+              :action='$api.file.image.url'
82
+              :show-file-list="false"
83
+              :on-success="handleAvatarSuccess">
84
+              <img v-if="postData.ImageUrl" :src="postData.ImageUrl" class="avatar">
85
+              <i v-else class="el-icon-plus avatar-uploader-icon"></i>
86
+            </el-upload>
78 87
           </div>
79 88
         </li>
80 89
         <li style="text-align:center">
@@ -148,13 +157,13 @@ export default {
148 157
       }
149 158
       this.postData.ForwardType === '1' ? this.postData.ForwardType = 'url' : this.postData.ForwardType = 'course'
150 159
       this.postData.locationids = this.postData.LocationIds.join(',')
151
-      this.postData.ImageUrl = ''
152
-      for (let i = 0; i < this.imgsArr.length; i++) {
153
-        this.postData.ImageUrl += this.imgsArr[i].response.result.url + ','
154
-      }
155
-      if (this.postData.ImageUrl) {
156
-        this.postData.ImageUrl = this.postData.ImageUrl.substr(0, this.postData.ImageUrl.length - 1)
157
-      }
160
+      // this.postData.ImageUrl = ''
161
+      // for (let i = 0; i < this.imgsArr.length; i++) {
162
+      //   this.postData.ImageUrl += this.imgsArr[i].response.result.url + ','
163
+      // }
164
+      // if (this.postData.ImageUrl) {
165
+      //   this.postData.ImageUrl = this.postData.ImageUrl.substr(0, this.postData.ImageUrl.length - 1)
166
+      // }
158 167
       this.$ajax(this.$api.cms.addNews.url, {
159 168
         method: this.$api.cms.addNews.method,
160 169
         data: this.postData
@@ -174,21 +183,24 @@ export default {
174 183
     cancel () {
175 184
       this.$router.go(-1)
176 185
     },
177
-    handlePictureCardPreview (res, file, fileList) {
178
-      this.imgs = res.result.url
179
-      this.dialogVisible = false
180
-      this.imgsArr = fileList
181
-    },
182
-    handleRemove (file, fileList) {
183
-      this.imgsArr = fileList
186
+    // handlePictureCardPreview (res, file, fileList) {
187
+    //   this.imgs = res.result.url
188
+    //   this.dialogVisible = false
189
+    //   this.imgsArr = fileList
190
+    // },
191
+    // handleRemove (file, fileList) {
192
+    //   this.imgsArr = fileList
193
+    // },
194
+    // exceed () {
195
+    //   this.$message({
196
+    //     message: '超过可传的图片上限',
197
+    //     type: 'info',
198
+    //     duration: 1000
199
+    //   })
200
+    // }
201
+    handleAvatarSuccess (res, file) {
202
+      this.postData.ImageUrl = res.result.url
184 203
     },
185
-    exceed () {
186
-      this.$message({
187
-        message: '超过可传的图片上限',
188
-        type: 'info',
189
-        duration: 1000
190
-      })
191
-    }
192 204
   }
193 205
 }
194 206
 </script>

+ 47
- 36
src/pages/system/cmsManager/newsManager/edit.vue Dosyayı Görüntüle

@@ -62,7 +62,7 @@
62 62
         <li class="flex-h">
63 63
           <span>图片:</span>
64 64
           <div class="flex-item">
65
-            <el-upload
65
+            <!-- <el-upload
66 66
               :action="$api.file.image.url"
67 67
               :limit='limit'
68 68
               list-type="picture-card"
@@ -74,7 +74,15 @@
74 74
             </el-upload>
75 75
             <el-dialog :visible.sync="dialogVisible">
76 76
               <img width="100%" :src="imgs" alt="">
77
-            </el-dialog>
77
+            </el-dialog> -->
78
+            <el-upload
79
+              class="avatar-uploader"
80
+              :action='$api.file.image.url'
81
+              :show-file-list="false"
82
+              :on-success="handleAvatarSuccess">
83
+              <img v-if="postData.ImageUrl" :src="postData.ImageUrl" class="avatar">
84
+              <i v-else class="el-icon-plus avatar-uploader-icon"></i>
85
+            </el-upload>
78 86
           </div>
79 87
         </li>
80 88
         <li style="text-align:center">
@@ -144,13 +152,13 @@ export default {
144 152
       }
145 153
       this.postData.ForwardType === '1' ? this.postData.ForwardType = 'url' : this.postData.ForwardType = 'course'
146 154
       this.postData.locationids = this.postData.LocationIds.join(',')
147
-      this.postData.ImageUrl = ''
148
-      for (let i = 0; i < this.imgsArr.length; i++) {
149
-        this.postData.ImageUrl += this.imgsArr[i].response.result.url + ','
150
-      }
151
-      if (this.postData.ImageUrl) {
152
-        this.postData.ImageUrl = this.postData.ImageUrl.substr(0, this.postData.ImageUrl.length - 1)
153
-      }
155
+      // this.postData.ImageUrl = ''
156
+      // for (let i = 0; i < this.imgsArr.length; i++) {
157
+      //   this.postData.ImageUrl += this.imgsArr[i].response.result.url + ','
158
+      // }
159
+      // if (this.postData.ImageUrl) {
160
+      //   this.postData.ImageUrl = this.postData.ImageUrl.substr(0, this.postData.ImageUrl.length - 1)
161
+      // }
154 162
       this.$ajax(this.$api.cms.editNews.url, {
155 163
         method: this.$api.cms.editNews.method,
156 164
         urlData: {
@@ -173,21 +181,21 @@ export default {
173 181
     cancel () {
174 182
       this.$router.go(-1)
175 183
     },
176
-    handlePictureCardPreview (res, file, fileList) {
177
-      this.imgs = res.result.url
178
-      this.dialogVisible = false
179
-      this.imgsArr = fileList
180
-    },
181
-    handleRemove (file, fileList) {
182
-      this.imgsArr = fileList
183
-    },
184
-    exceed () {
185
-      this.$message({
186
-        message: '超过可传的图片上限',
187
-        type: 'info',
188
-        duration: 1000
189
-      })
190
-    },
184
+    // handlePictureCardPreview (res, file, fileList) {
185
+    //   this.imgs = res.result.url
186
+    //   this.dialogVisible = false
187
+    //   this.imgsArr = fileList
188
+    // },
189
+    // handleRemove (file, fileList) {
190
+    //   this.imgsArr = fileList
191
+    // },
192
+    // exceed () {
193
+    //   this.$message({
194
+    //     message: '超过可传的图片上限',
195
+    //     type: 'info',
196
+    //     duration: 1000
197
+    //   })
198
+    // },
191 199
     getDetail () {
192 200
       this.$ajax(this.$api.cms.newsDetail.url, {
193 201
         method: this.$api.cms.newsDetail.method,
@@ -203,22 +211,25 @@ export default {
203 211
           return previousValue
204 212
         }, [])
205 213
         console.log(res.LocationIds)
206
-        let imgsArr = []
207
-        let item = {
208
-          url: res.ImageUrl,
209
-          response: {
210
-            result: {
211
-              url: res.ImageUrl
212
-            }
213
-          }
214
-        }
215
-        imgsArr.push(item)
216
-        this.imgsArr = imgsArr
214
+        // let imgsArr = []
215
+        // let item = {
216
+        //   url: res.ImageUrl,
217
+        //   response: {
218
+        //     result: {
219
+        //       url: res.ImageUrl
220
+        //     }
221
+        //   }
222
+        // }
223
+        // imgsArr.push(item)
224
+        // this.imgsArr = imgsArr
217 225
         this.postData = res
218 226
       }).catch(msg => {
219 227
 
220 228
       })
221
-    }
229
+    },
230
+    handleAvatarSuccess (res, file) {
231
+      this.postData.ImageUrl = res.result.url
232
+    },
222 233
   }
223 234
 }
224 235
 </script>

+ 2
- 3
src/pages/system/courseManager/fiveA/edit.vue Dosyayı Görüntüle

@@ -149,13 +149,12 @@ export default {
149 149
           id: this.$route.query.id
150 150
         }
151 151
       }).then(res => {
152
-        console.log(res)
153 152
         let imgsArr = []
154 153
         let item = {
155
-          url: res.ImageUrl,
154
+          url: res.TypeImg,
156 155
           response: {
157 156
             result: {
158
-              url: res.ImageUrl
157
+              url: res.TypeImg
159 158
             }
160 159
           }
161 160
         }

+ 16
- 24
src/pages/system/dataStatistics/courseOrderList/index.vue Dosyayı Görüntüle

@@ -62,21 +62,29 @@
62 62
         :data="currentList"
63 63
         stripe
64 64
         style="width: 100%">
65
+        <el-table-column
66
+          prop="OrderNo"
67
+          label="订单编号">
68
+        </el-table-column>
69
+        <el-table-column
70
+          prop="Name"
71
+          label="课程名称">
72
+        </el-table-column>
65 73
         <el-table-column
66 74
           prop="CaseName"
67 75
           label="所属案场">
68 76
         </el-table-column>
69 77
         <el-table-column
70
-          prop="Name"
71
-          label="卡券名称">
78
+          prop="Type"
79
+          label="课程类别">
72 80
         </el-table-column>
73 81
         <el-table-column
74
-          prop="GoodsList"
75
-          label="使用商品">
82
+          prop="Date"
83
+          label="课程时间">
76 84
         </el-table-column>
77 85
         <el-table-column
78
-          prop="GetType"
79
-          label="获取方式">
86
+          prop="UserName"
87
+          label="用户姓名">
80 88
         </el-table-column>
81 89
         <el-table-column
82 90
           prop="NickName"
@@ -87,24 +95,8 @@
87 95
           label="手机号">
88 96
         </el-table-column>
89 97
         <el-table-column
90
-          prop="SalerName"
91
-          label="销售">
92
-        </el-table-column>
93
-        <el-table-column
94
-          prop="EndDate"
95
-          label="有效期">
96
-        </el-table-column>
97
-        <el-table-column
98
-          prop="GetDate"
99
-          label="获取时间">
100
-        </el-table-column>
101
-        <el-table-column
102
-          prop="CheckDate"
103
-          label="核销时间">
104
-        </el-table-column>
105
-        <el-table-column
106
-          prop="Status"
107
-          label="状态">
98
+          prop="CreatDate"
99
+          label="下单时间">
108 100
         </el-table-column>
109 101
       </el-table>
110 102
     </div>

+ 125
- 54
src/pages/system/dataStatistics/goodsOrderList/index.vue Dosyayı Görüntüle

@@ -60,57 +60,41 @@
60 60
       </div>
61 61
       <div class="moreFilter"></div>
62 62
     </div>
63
-    <div class="system-table-box">
64
-      <el-table
65
-        :data="currentList"
66
-        stripe
67
-        style="width: 100%">
68
-        <el-table-column
69
-          prop="CaseName"
70
-          label="所属案场">
71
-        </el-table-column>
72
-        <el-table-column
73
-          prop="Name"
74
-          label="卡券名称">
75
-        </el-table-column>
76
-        <el-table-column
77
-          prop="GoodsList"
78
-          label="使用商品">
79
-        </el-table-column>
80
-        <el-table-column
81
-          prop="GetType"
82
-          label="获取方式">
83
-        </el-table-column>
84
-        <el-table-column
85
-          prop="NickName"
86
-          label="微信昵称">
87
-        </el-table-column>
88
-        <el-table-column
89
-          prop="Phone"
90
-          label="手机号">
91
-        </el-table-column>
92
-        <el-table-column
93
-          prop="SalerName"
94
-          label="销售">
95
-        </el-table-column>
96
-        <el-table-column
97
-          prop="EndDate"
98
-          label="有效期">
99
-        </el-table-column>
100
-        <el-table-column
101
-          prop="GetDate"
102
-          label="获取时间">
103
-        </el-table-column>
104
-        <el-table-column
105
-          prop="CheckDate"
106
-          label="核销时间">
107
-        </el-table-column>
108
-        <el-table-column
109
-          prop="Status"
110
-          label="状态">
111
-        </el-table-column>
112
-      </el-table>
113
-    </div>
63
+    <table>
64
+      <tr v-for="(item,index) in currentList.length*2" :key="index">
65
+        <td v-if="index%2 === 0" colspan="16" class="title">
66
+          <div class="flex-h">
67
+            <div class="flex-item" style="text-align:left;">
68
+              <span>订单编号:{{returnListItem(currentList, index).OrderNo}}</span>
69
+              <span>案场:{{returnListItem(currentList, index).CaseName}}</span>
70
+              <span>用户类型:{{returnListItem(currentList, index).UserType}}</span>
71
+              <span>下单时间:{{returnListItem(currentList, index).CreatDate}}</span>
72
+            </div>
73
+            <span>{{returnListItem(currentList, index).Status}}</span>
74
+          </div>
75
+        </td>
76
+        <td v-if="index%2 !== 0" colspan="4" class="noborder">
77
+          <span v-for="(subItem,subIndex) in returnListItem(currentList, index).OrderDetail" :key="subIndex">{{subItem.GoodsName}}({{subItem.SpecName}})</span>
78
+        </td>
79
+        <td v-if="index%2 !== 0" colspan="1" class="noborder">
80
+          <span v-for="(subItem,subIndex) in returnListItem(currentList, index).OrderDetail" :key="subIndex">x{{subItem.Num}}</span>
81
+        </td>
82
+        <td v-if="index%2 !== 0" colspan="1" class="noborder">
83
+          <span v-for="(subItem,subIndex) in returnListItem(currentList, index).OrderDetail" :key="subIndex">¥{{subItem.Price}}</span>
84
+        </td>
85
+        <td v-if="index%2 !== 0" colspan="4">
86
+          <span>{{returnListItem(currentList, index).AreaName}}{{returnListItem(currentList, index).TableNo}}</span>
87
+        </td>
88
+        <td v-if="index%2 !== 0" colspan="4">
89
+          <span>{{returnListItem(currentList, index).OrderPlacer}}/{{returnListItem(currentList, index).OrderPlacerPhone}}</span>
90
+        </td>
91
+        <td v-if="index%2 !== 0" colspan="2">
92
+          <el-button
93
+          size="mini"
94
+          type="success">重打</el-button>
95
+        </td>
96
+      </tr>
97
+    </table>
114 98
     <el-pagination
115 99
       @current-change="handleCurrentChange"
116 100
       :current-page.sync="postData.page"
@@ -141,7 +125,91 @@ export default {
141 125
         page: 1, // 当前页码
142 126
         pagesize: 10, // 请求数据量
143 127
       },
144
-      currentList: [],
128
+      currentList: [{
129
+        OrderNo: '1234567890000',
130
+        OrderId: '123456',
131
+        CaseName: '案场名称',
132
+        CaseId: '123456',
133
+        UserType: 'manager',
134
+        CreatDate: '12345678900000',
135
+        Status: '已完成',
136
+        AreaName: '区域名称',
137
+        TableNo: '桌号',
138
+        OrderPlacer: '下单人',
139
+        OrderPlacerPhone: '18266666666',
140
+        OrderDetail: [{
141
+          GoodsName: '商品名称',
142
+          SpecName: '商品规格',
143
+          Num: '1',
144
+          Price: '30',
145
+        }, {
146
+          GoodsName: '商品名称',
147
+          SpecName: '商品规格',
148
+          Num: '1',
149
+          Price: '30',
150
+        }, {
151
+          GoodsName: '商品名称',
152
+          SpecName: '商品规格',
153
+          Num: '1',
154
+          Price: '30',
155
+        }]
156
+      }, {
157
+        OrderNo: '1234567890000',
158
+        OrderId: '123456',
159
+        CaseName: '案场名称',
160
+        CaseId: '123456',
161
+        UserType: 'manager',
162
+        CreatDate: '12345678900000',
163
+        Status: '已完成',
164
+        AreaName: '区域名称',
165
+        TableNo: '桌号',
166
+        OrderPlacer: '下单人',
167
+        OrderPlacerPhone: '18266666666',
168
+        OrderDetail: [{
169
+          GoodsName: '商品名称',
170
+          SpecName: '商品规格',
171
+          Num: '1',
172
+          Price: '30',
173
+        }, {
174
+          GoodsName: '商品名称',
175
+          SpecName: '商品规格',
176
+          Num: '1',
177
+          Price: '30',
178
+        }, {
179
+          GoodsName: '商品名称',
180
+          SpecName: '商品规格',
181
+          Num: '1',
182
+          Price: '30',
183
+        }]
184
+      }, {
185
+        OrderNo: '1234567890000',
186
+        OrderId: '123456',
187
+        CaseName: '案场名称',
188
+        CaseId: '123456',
189
+        UserType: 'manager',
190
+        CreatDate: '12345678900000',
191
+        Status: '已完成',
192
+        AreaName: '区域名称',
193
+        TableNo: '桌号',
194
+        OrderPlacer: '下单人',
195
+        OrderPlacerPhone: '18266666666',
196
+        OrderDetail: [{
197
+          GoodsName: '商品名称',
198
+          SpecName: '商品规格',
199
+          Num: '1',
200
+          Price: '30',
201
+        }, {
202
+          GoodsName: '商品名称',
203
+          SpecName: '商品规格',
204
+          Num: '1',
205
+          Price: '30',
206
+        }, {
207
+          GoodsName: '商品名称',
208
+          SpecName: '商品规格',
209
+          Num: '1',
210
+          Price: '30',
211
+        }]
212
+      }],
145 213
       typeList: [],
146 214
       statusList: [],
147 215
     }
@@ -168,6 +236,9 @@ export default {
168 236
     })
169 237
   },
170 238
   methods: {
239
+    returnListItem (target, index) {
240
+      return target[Math.ceil((index + 1) / 2) - 1]
241
+    },
171 242
     search () { // 搜索
172 243
       // 1
173 244
     },
@@ -181,8 +252,8 @@ export default {
181 252
 <!-- Add "scoped" attribute to limit CSS to this component only -->
182 253
 <style lang="scss" scoped>
183 254
 @import "page.scss";
184
-.searchFilterLine{
185
-  >li{
255
+.searchFilterLine {
256
+  > li {
186 257
     margin-bottom: 20px;
187 258
   }
188 259
 }

+ 42
- 0
src/pages/system/dataStatistics/goodsOrderList/page.scss Dosyayı Görüntüle

@@ -1,4 +1,46 @@
1 1
 
2
+table{
3
+  width: calc(100% - 40px);
4
+  border: 1px solid #eee;
5
+  margin: 20px auto 0;
6
+  border-collapse: collapse;
7
+  td{
8
+    border: 1px solid #eee;
9
+    text-align: center;
10
+    &.noborder{
11
+      border: none;
12
+    }
13
+    &.title{
14
+      background: #409EFF;
15
+      div{
16
+        font-size: 0;
17
+        white-space: nowrap;
18
+        span{
19
+          color: #fff;
20
+          line-height: 40px;
21
+          margin-left: 20px;
22
+        }
23
+      }
24
+      >div{
25
+        >span{
26
+          font-weight: bolder;
27
+          margin-right: 20px;
28
+        }
29
+      }
30
+    }
31
+    >span{
32
+      width: 100%;
33
+      display: block;
34
+      text-align: center;
35
+      line-height: 40px;
36
+      border-top: 1px solid #eee;
37
+      &:nth-child(1){
38
+        border-top: none;
39
+      }
40
+    }
41
+  }
42
+}
43
+
2 44
 
3 45
 
4 46
 

+ 37
- 21
src/pages/system/goodsManager/goodManager/edit.vue Dosyayı Görüntüle

@@ -33,7 +33,8 @@
33 33
           <span>商品图片:</span>
34 34
           <div class="flex-item">
35 35
             <div style="width:50%">
36
-              <el-upload
36
+              <!-- 多选 -->
37
+              <!-- <el-upload
37 38
                 :action="$api.file.image.url"
38 39
                 :limit='limit'
39 40
                 list-type="picture-card"
@@ -42,6 +43,15 @@
42 43
                 :on-remove="handleRemove"
43 44
                 :on-exceed="exceed">
44 45
                 <i class="el-icon-plus"></i>
46
+              </el-upload> -->
47
+              <!-- 单选 -->
48
+              <el-upload
49
+                class="avatar-uploader"
50
+                :action='$api.file.image.url'
51
+                :show-file-list="false"
52
+                :on-success="handleAvatarSuccess">
53
+                <img v-if="Image" :src="Image" class="avatar">
54
+                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
45 55
               </el-upload>
46 56
             </div>
47 57
           </div>
@@ -105,7 +115,7 @@ export default {
105 115
   name: '',
106 116
   data () {
107 117
     return {
108
-      limit: 2,
118
+      limit: 1,
109 119
       dialogVisible: false,
110 120
       infoSpecs: null,
111 121
     }
@@ -128,23 +138,28 @@ export default {
128 138
       },
129 139
       set (val) {
130 140
         this.UpdateInfo({...this.detail, CaseId: val})
141
+        this.detail.TypeId = ''
131 142
         this.GetGoodTypes({ pagesize: 1000, caseid: this.Case })
132 143
         this.GetGoodSpecs({ pagesize: 1000, caseid: this.Case })
133 144
       }
134 145
     },
135 146
     detailSpecs: {
136 147
       get () {
148
+        console.log(this.infoSpecs || (this.detail.Specs || []).map(x => x.SpecId))
137 149
         return this.infoSpecs || (this.detail.Specs || []).map(x => x.SpecId)
138 150
       },
139 151
       set (val) {
140 152
         this.infoSpecs = val
141 153
       },
142 154
     },
143
-    imgsArr () {
144
-      return (this.detail.Images || []).map(x => {
145
-        return {...x, url: x.url || x.ImgUrl}
146
-      })
147
-    },
155
+    // imgsArr () {
156
+    //   return (this.detail.Images || []).map(x => {
157
+    //     return {...x, url: x.url || x.ImgUrl}
158
+    //   })
159
+    // },
160
+    Image () {
161
+      return ((this.detail.Images || [])[0] || {}).ImgUrl
162
+    }
148 163
   },
149 164
   methods: {
150 165
     ...mapGoodsActions([
@@ -183,19 +198,22 @@ export default {
183 198
     cancel () {
184 199
       this.$router.go(-1)
185 200
     },
186
-    handlePictureCardPreview (res, file, fileList) {
187
-      this.detail.Images = fileList
201
+    // handlePictureCardPreview (res, file, fileList) {
202
+    //   this.detail.Images = fileList
203
+    // },
204
+    // handleRemove (file, fileList) {
205
+    //   this.detail.Images = fileList
206
+    // },
207
+    // exceed () {
208
+    //   this.$message({
209
+    //     message: '超过可传的图片上限',
210
+    //     type: 'info',
211
+    //     duration: 1000
212
+    //   })
213
+    // },
214
+    handleAvatarSuccess (res, file) {
215
+      this.UpdateInfo({...this.detail, Images: [{ImgUrl: res.result.url}]})
188 216
     },
189
-    handleRemove (file, fileList) {
190
-      this.detail.Images = fileList
191
-    },
192
-    exceed () {
193
-      this.$message({
194
-        message: '超过可传的图片上限',
195
-        type: 'info',
196
-        duration: 1000
197
-      })
198
-    }
199 217
   },
200 218
   created () {
201 219
     this.GetGoodTypes({ pagesize: 1000, caseid: this.Case })
@@ -203,8 +221,6 @@ export default {
203 221
     const { id } = this.$route.query
204 222
     if (id && id !== '') {
205 223
       this.GetGoodsByID({ id: id })
206
-    } else {
207
-      this.SetNull()
208 224
     }
209 225
   }
210 226
 }

+ 3
- 0
src/pages/system/goodsManager/goodManager/index.vue Dosyayı Görüntüle

@@ -140,6 +140,7 @@ export default {
140 140
       'GetGoodsList',
141 141
       'GetGoodTypes',
142 142
       'DelGoods',
143
+      'SetNull',
143 144
     ]),
144 145
     getTypeName (typeid) {
145 146
       return (this.types.list.filter(x => x.TypeId === typeid)[0] || {}).TypeName
@@ -167,6 +168,7 @@ export default {
167 168
     },
168 169
     handleEdit (index, row) {
169 170
       // 编辑
171
+      this.SetNull()
170 172
       this.$router.push({ name: 'editGoods', query: { id: row.GoodsId } })
171 173
     },
172 174
     handleDelete (index, row) {
@@ -194,6 +196,7 @@ export default {
194 196
       this.getList()
195 197
     },
196 198
     addRole () {
199
+      this.SetNull()
197 200
       this.$router.push({ name: 'editGoods' })
198 201
     },
199 202
   },

+ 9
- 3
src/pages/system/goodsManager/goodsTypeManager/index.vue Dosyayı Görüntüle

@@ -41,6 +41,9 @@
41 41
         <el-table-column
42 42
           prop="CaseName"
43 43
           label="所属案场">
44
+          <template slot-scope="scope">
45
+            <span>{{getCaseName(scope.row.CaseId)}}</span>
46
+          </template>
44 47
         </el-table-column>
45 48
         <el-table-column label="操作">
46 49
           <template slot-scope="scope">
@@ -107,14 +110,17 @@ export default {
107 110
       this.currentList = []
108 111
       this.getList()
109 112
     },
113
+    getCaseName (caseid) {
114
+      return (this.cases.filter(x => x.CaseId === caseid)[0] || {}).CaseName
115
+    },
110 116
     getList () { // 获取列表
111 117
       this.$ajax(this.$api.goodsManager.getGoodsTypeList.url, {
112 118
         method: this.$api.goodsManager.getGoodsTypeList.method,
113 119
         queryData: { ...this.postData, caseid: this.CaseId }
114 120
       }).then(res => {
115
-        for (var n = 0; n < res.list.length; n++) {
116
-          res.list[n].CaseName = this.cases.filter(x => x.CaseId === res.list[n].CaseId)[0].CaseName
117
-        }
121
+        // for (var n = 0; n < res.list.length; n++) {
122
+        //   res.list[n].CaseName = this.cases.filter(x => x.CaseId === res.list[n].CaseId)[0].CaseName
123
+        // }
118 124
         this.currentList = res.list
119 125
         this.postData.page = res.page
120 126
         this.total = res.pagenum

+ 214
- 0
src/pages/system/marketingActivities/activitiesList/index.vue Dosyayı Görüntüle

@@ -0,0 +1,214 @@
1
+<template>
2
+  <div class="subPage">
3
+    <div class="title">
4
+      活动列表
5
+    </div>
6
+    <div class="head-div">
7
+      每页数量/条
8
+      <template>
9
+        <el-select v-model="postData.pageSize" placeholder="请选择">
10
+          <el-option
11
+            v-for="item in options"
12
+            :key="item.value"
13
+            :label="item.label"
14
+            :value="item.value">
15
+          </el-option>
16
+        </el-select>
17
+      </template>
18
+    </div>
19
+    <!-- 包含 按钮的div -->
20
+    <div class="button-div">
21
+      <el-row>
22
+        <el-button type="warning" style="float: right;">重置</el-button>
23
+        <el-button type="primary" style="float: right; margin-right: 10px;" @click="clickList">查询</el-button>
24
+        <el-button type="success" style="float: right;" @click="redirection('addActivities')">新增</el-button>
25
+      </el-row>
26
+    </div>
27
+    <div class="content">
28
+      <template>
29
+        <el-table
30
+          :data="tableData"
31
+          border
32
+          style="width: 100%">
33
+          <el-table-column
34
+            prop="CaseName"
35
+            label="案场"
36
+            width="180">
37
+          </el-table-column>
38
+          <el-table-column
39
+            prop="ActivityName"
40
+            label="活动名称"
41
+            width="180">
42
+          </el-table-column>
43
+          <el-table-column
44
+            prop="ActivityType"
45
+            label="活动类型">
46
+            <template slot-scope="scope">
47
+              <span>{{getActivitName(scope.row.ActivityType)}}</span>
48
+            </template>
49
+          </el-table-column>
50
+          <el-table-column
51
+            prop="giftLabel"
52
+            label="卡券名称">
53
+            <template slot-scope="scope">
54
+              <span>{{getGiftLabel(scope.row.ResourceDesc)}}</span>
55
+            </template>
56
+          </el-table-column>
57
+          <el-table-column
58
+            prop="address"
59
+            label="赠送数量">
60
+            <template slot-scope="scope">
61
+              <span>{{getNum(scope.row.ResourceDesc)}}</span>
62
+            </template>
63
+          </el-table-column>
64
+          <el-table-column
65
+            prop="Status"
66
+            label="状态">
67
+            <template slot-scope="scope">
68
+              <span>{{scope.row.Status === 0 ? '启用' : '停用'}}</span>
69
+            </template>
70
+          </el-table-column>
71
+          <el-table-column
72
+            prop="address"
73
+            label="操作">
74
+            <template slot-scope="scope">
75
+              <div v-if="scope.row.Status === 0">
76
+                <a href="#" @click="disable(scope.row.ActivityId)">停用</a>&nbsp;&nbsp;<a href="#" @click="delet(scope.row.ActivityId)">删除</a>
77
+              </div>
78
+              <div v-else>
79
+                <a href="#" @click="normal(scope.row.ActivityId)">启用</a>
80
+              </div>
81
+            </template>
82
+          </el-table-column>
83
+        </el-table>
84
+      </template>
85
+    </div>
86
+    <div class="block">
87
+      <el-pagination
88
+        @size-change="handleSizeChange"
89
+        @current-change="handleCurrentChange"
90
+        :current-page.sync="currentPage2"
91
+        :page-size="Number(value)"
92
+        layout="prev, pager, next, jumper"
93
+        :total="total">
94
+      </el-pagination>
95
+    </div>
96
+  </div>
97
+</template>
98
+<script>
99
+export default {
100
+  data () {
101
+    return {
102
+      options: [{ // 下拉框数数据,分页的每页多少
103
+        value: '5',
104
+        label: '5'
105
+      }, {
106
+        value: '10',
107
+        label: '10'
108
+      }, {
109
+        value: '20',
110
+        label: '20'
111
+      }],
112
+      value: '10', // 一页多少数据
113
+      tableData: [],
114
+      postData: { // 表格搜索条件 //caseid: '', // 案场id
115
+        page: 1, // 当前页码
116
+        pageSize: 10, // 请求数据量
117
+      },
118
+      currentPage2: 1,
119
+      total: 0 // 数据条数
120
+    }
121
+  },
122
+  mounted () {
123
+    this.getList()
124
+  },
125
+  methods: {
126
+    getNum (desc) {
127
+      if (desc === '') {
128
+        return 0
129
+      }
130
+      const descjson = JSON.parse(desc)
131
+      return descjson.giftNum
132
+    },
133
+    getActivitName (desc) { // 根据活动类型编号,获取活动名称
134
+      if (desc === '1') {
135
+        return '注册类型'
136
+      }
137
+      return '未知类型'
138
+    },
139
+    getGiftLabel (desc) {
140
+      if (desc === '') {
141
+        return '未知卡券'
142
+      }
143
+      const descjson = JSON.parse(desc)
144
+      return descjson.giftLabel
145
+    },
146
+    handleSizeChange (val) {
147
+      console.log(`每页 ${val} 条`)
148
+    },
149
+    handleCurrentChange (val) {
150
+      console.log(`当前页: ${val}`)
151
+      this.$data.postData.page = val
152
+      this.getList()
153
+    },
154
+    redirection (pathName) { // 重定向
155
+      this.$router.push({ name: pathName })
156
+    },
157
+    getList () { // 获取数据列表
158
+      this.$ajax(this.$api.marketingActivities.getMarketingList.url, {
159
+        method: this.$api.marketingActivities.getMarketingList.method,
160
+        queryData: { ...this.postData }
161
+      }).then(res => {
162
+        this.tableData = res.list
163
+        this.postData.page = res.page
164
+        this.total = res.pagenum
165
+      })
166
+    },
167
+    disable (ActivityId) { // 停用
168
+      this.$ajax(this.$api.marketingActivities.delMarketingDisable.url, {
169
+        method: this.$api.marketingActivities.delMarketingDisable.method,
170
+        urlData: { activityId: ActivityId }
171
+      }).then(res => {
172
+        this.$message({
173
+          type: 'success',
174
+          message: '操作成功'
175
+        })
176
+        this.getList()
177
+      })
178
+    },
179
+    normal (ActivityId) { // 启用
180
+      this.$ajax(this.$api.marketingActivities.delMarketingNormal.url, {
181
+        method: this.$api.marketingActivities.delMarketingNormal.method,
182
+        urlData: { activityId: ActivityId }
183
+      }).then(res => {
184
+        this.$message({
185
+          type: 'success',
186
+          message: '操作成功'
187
+        })
188
+        this.getList()
189
+      })
190
+    },
191
+    delet (ActivityId) { // 删除
192
+      this.$ajax(this.$api.marketingActivities.delMarketing.url, {
193
+        method: this.$api.marketingActivities.delMarketing.method,
194
+        urlData: { activityId: ActivityId }
195
+      }).then(res => {
196
+        this.$message({
197
+          type: 'success',
198
+          message: '操作成功'
199
+        })
200
+        this.getList()
201
+      })
202
+    },
203
+    clickList () { // 点击查询按钮
204
+      this.$data.postData.page = 1
205
+      this.getList()
206
+    }
207
+  },
208
+}
209
+</script>
210
+
211
+<!-- Add "scoped" attribute to limit CSS to this component only -->
212
+<style lang="scss" scoped>
213
+@import "page.scss";
214
+</style>

+ 33
- 0
src/pages/system/marketingActivities/activitiesList/page.scss Dosyayı Görüntüle

@@ -0,0 +1,33 @@
1
+
2
+// 活动列表 标题
3
+.title{
4
+  font-size: 28px;
5
+  color: darkgray;
6
+  width: 100%;
7
+  border-bottom: 1px solid darkgray;
8
+  padding-left: 30px;
9
+  padding-top: 20px;
10
+  padding-bottom: 20px;
11
+}
12
+
13
+// 头部div
14
+.head-div {
15
+  width: 100%;
16
+  margin-left: 30px;
17
+  margin-right: 30px;
18
+  padding-top: 30px;
19
+}
20
+
21
+.button-div {
22
+  width: 100%;
23
+  margin-left: 30px;
24
+  margin-right: 30px;
25
+  margin-bottom: 30px;
26
+  float: right;
27
+}
28
+// 表格 div
29
+.content {
30
+  width: 100%;
31
+  margin-left: 30px;
32
+  margin-right: 30px;
33
+}

+ 200
- 0
src/pages/system/marketingActivities/addActivities/index.vue Dosyayı Görüntüle

@@ -0,0 +1,200 @@
1
+<template>
2
+  <div class="subPage">
3
+    <div class="content">
4
+      <div class="input-div">
5
+        <div style="float: left; font-size: 20px;">
6
+          活动名称:
7
+        </div>
8
+        <div style="float: left; margin-left: 30px;">
9
+          <template>
10
+            <el-input v-model="activityName" placeholder="请输入内容" style="width: 300px;"></el-input>
11
+          </template>
12
+        </div>
13
+      </div>
14
+      <div class="input-div">
15
+        <div style="float: left; font-size: 20px;">
16
+          活动类型:
17
+        </div>
18
+        <div style="float: left; margin-left: 30px;">
19
+          <template>
20
+            <el-select v-model="regValue" placeholder="请选择" style="width: 300px;">
21
+              <el-option
22
+                v-for="item in regOptions"
23
+                :key="item.regValue"
24
+                :label="item.label"
25
+                :value="item.regValue">
26
+              </el-option>
27
+            </el-select>
28
+          </template>
29
+        </div>
30
+      </div>
31
+      <div class="input-div">
32
+        <div style="float: left; font-size: 20px;">
33
+          赠券卡券:
34
+        </div>
35
+        <div style="float: left; margin-left: 30px;">
36
+          <template>
37
+            <el-select v-model="giftValue" placeholder="请选择" style="width: 300px;">
38
+              <el-option
39
+                v-for="item in giftOptions"
40
+                :key="item.giftValue"
41
+                :label="item.label"
42
+                :value="item.giftValue">
43
+              </el-option>
44
+            </el-select>
45
+          </template>
46
+        </div>
47
+      </div>
48
+      <div class="input-div">
49
+        <div style="float: left; font-size: 20px;">
50
+           赠券数量:
51
+        </div>
52
+        <div style="float: left; margin-left: 30px;">
53
+          <template>
54
+            <el-input v-model="giftNum" placeholder="请输入内容" style="width: 300px;"></el-input>
55
+          </template>
56
+        </div>
57
+      </div>
58
+      <div class="input-div">
59
+        <div style="float: left; font-size: 20px;">
60
+          活动描述:
61
+        </div>
62
+        <div style="float: left; margin-left: 30px;">
63
+          <template>
64
+            <el-input
65
+              type="textarea"
66
+              :rows="10"
67
+              placeholder="请输入内容"
68
+              v-model="desc" style="width: 300px; height: 200px;">
69
+            </el-input>
70
+          </template>
71
+        </div>
72
+      </div>
73
+      <div class="input-div">
74
+        <el-row>
75
+          <el-button type="warning" style="float: right;" @click="redirection('activitiesList')">返回</el-button>
76
+          <el-button type="primary" style="float: right; margin-right: 10px;" @click="submitData">提交</el-button>
77
+        </el-row>
78
+      </div>
79
+    </div>
80
+  </div>
81
+</template>
82
+<script>
83
+import { mapState } from 'vuex'
84
+
85
+export default {
86
+  data () {
87
+    return {
88
+      msg: '添加活动',
89
+      postData: {
90
+        TableId: '', // 桌位id
91
+        AreaId: '', // 区域id
92
+        CaseId: '', // 案场id
93
+        OrgId: '', // 机构id
94
+        TableNo: '', // 桌位编号
95
+        Order: '', // 排序
96
+      },
97
+      regOptions: [{
98
+        regValue: '1',
99
+        label: '注册类型'
100
+      }],
101
+      regValue: '',
102
+      giftOptions: [], // [{giftValue: '1',label: '饮品通用券'}, {giftValue: '2',label: '课程通用券'}, {giftValue: '3',label: '小小外交官体验券'}]
103
+      giftValue: '',
104
+      giftLabel: '',
105
+      activityName: '', // 活动名称
106
+      activityType: this.regValue, // 活动类型
107
+      resourceDesc: '', // 存储JSON (赠券类型,赠送数量,活动描述)
108
+      giftNum: 0, // 赠送数量
109
+      desc: '', // 活动描述
110
+      giftList: [] // 赠券卡券数据体
111
+    }
112
+  },
113
+  mounted () {
114
+    this.getCouponList()
115
+  },
116
+  computed: {
117
+    ...mapState({
118
+      defaultCaseId: x => x.app.cases.default,
119
+    }),
120
+    giftData: {
121
+      get () {
122
+        let jsonData = this.$data.giftList
123
+        console.log('请求到的:' + this.$data.giftList)
124
+        let data = []
125
+        for (let i = 0; i < jsonData.length; i++) {
126
+          let tempData = []
127
+          tempData.giftValue = jsonData[i].CouponId
128
+          tempData.label = jsonData[i].CouponName
129
+          console.log('卡券编号:' + tempData.giftValue + ' ' + tempData.label)
130
+          data.push(tempData)
131
+        }
132
+        console.log('giftData 数据:')
133
+        return data
134
+      }
135
+    }
136
+  },
137
+  methods: {
138
+    redirection (pathName) { // 重定向
139
+      this.$router.push({ name: pathName })
140
+    },
141
+    submitData () { // 提交数据
142
+      // 判断是否提交成功
143
+      // 提交成功,跳转页面
144
+      // let subData = []
145
+      // subData.activityName = this.$data.activityName
146
+      // subData.activityType = this.$data.regValue
147
+      // let obj = []
148
+      // obj.giftValue = this.$data.giftValue
149
+      // obj.giftNum = this.$data.giftNum
150
+      // obj.desc = this.$data.desc
151
+      // subData.resourceDesc = obj
152
+
153
+      // console.log(subData)
154
+
155
+      // let obj = []
156
+      // obj.giftValue = this.$data.giftValue
157
+      // obj.giftNum = this.$data.giftNum
158
+      // obj.desc = this.$data.desc
159
+
160
+      let tempGiftOptions = this.$data.giftOptions
161
+      let tempGiftValue = this.$data.giftValue
162
+      for (let i = 0; i < tempGiftOptions.length; i++) {
163
+        if (tempGiftOptions[i].giftValue === tempGiftValue) {
164
+          this.$data.giftLabel = tempGiftOptions[i].label
165
+          break
166
+        }
167
+      }
168
+      let jsonString = '{"giftValue":"' + this.$data.giftValue + '","giftLabel":"' + this.$data.giftLabel + '","giftNum":"' + this.$data.giftNum + '","desc":"' + this.$data.desc + '"}'
169
+
170
+      this.$ajax(this.$api.marketingActivities.addMarketing.url, {
171
+        method: this.$api.marketingActivities.addMarketing.method,
172
+        queryData: {activityName: this.$data.activityName, activityType: this.$data.regValue, resourceDesc: jsonString, CaseId: this.defaultCaseId}
173
+      }).then(res => {
174
+        // console.log(res)
175
+        this.$message({
176
+          type: 'success',
177
+          message: '操作成功'
178
+        })
179
+        // 跳转路由
180
+        this.redirection('activitiesList')
181
+      })
182
+    },
183
+    getCouponList () {
184
+      this.$ajax(this.$api.marketingActivities.getCouponList.url, {
185
+        method: this.$api.marketingActivities.getCouponList.method,
186
+        queryData: {}
187
+      }).then(res => {
188
+        // console.log(res)
189
+        this.giftList = res.list
190
+        this.giftOptions = this.giftData
191
+      })
192
+    },
193
+  }
194
+}
195
+</script>
196
+
197
+<!-- Add "scoped" attribute to limit CSS to this component only -->
198
+<style lang="scss" scoped>
199
+@import "page.scss";
200
+</style>

+ 39
- 0
src/pages/system/marketingActivities/addActivities/page.scss Dosyayı Görüntüle

@@ -0,0 +1,39 @@
1
+
2
+.content {
3
+  margin-left: auto;
4
+  margin-right: auto;
5
+  width: 800px;
6
+  height: 100%;
7
+  position: relative;
8
+}
9
+
10
+.input-div {
11
+  position: absolute;
12
+  margin-top: 20px;
13
+  width: 490px;
14
+}
15
+
16
+.input-div:nth-child(1) {
17
+  margin-top: 20px;
18
+}
19
+
20
+.input-div:nth-child(2) {
21
+  margin-top: 80px;
22
+}
23
+
24
+.input-div:nth-child(3) {
25
+  margin-top: 140px;
26
+}
27
+
28
+.input-div:nth-child(4) {
29
+  margin-top: 200px;
30
+}
31
+
32
+.input-div:nth-child(5) {
33
+  margin-top: 260px;
34
+}
35
+
36
+.input-div:nth-child(6) {
37
+  margin-top: 560px;
38
+  margin-left: -80px;
39
+}

+ 19
- 0
src/pages/system/marketingActivities/index.vue Dosyayı Görüntüle

@@ -0,0 +1,19 @@
1
+<template>
2
+  <div class="mainPage">
3
+    <router-view></router-view>
4
+  </div>
5
+</template>
6
+
7
+<script>
8
+export default {
9
+  name: '',
10
+  data () {
11
+    return {}
12
+  },
13
+  components: {}
14
+}
15
+</script>
16
+
17
+<!-- Add "scoped" attribute to limit CSS to this component only -->
18
+<style lang="scss" scoped>
19
+</style>

+ 31
- 0
src/pages/system/page.js Dosyayı Görüntüle

@@ -92,6 +92,8 @@ import cardList from './cardAndCouponManager/cardManager/index' // 卡列表
92 92
 import editCard from './cardAndCouponManager/cardManager/edit' // 编辑卡
93 93
 import couponList from './cardAndCouponManager/couponManager/index' // 券列表
94 94
 import editCoupon from './cardAndCouponManager/couponManager/edit' // 编辑券
95
+import bodyBuildingCardManager from './cardAndCouponManager/bodyBuildingCardManager/index' // 健身卡列表
96
+import editBodyBuildingCard from './cardAndCouponManager/bodyBuildingCardManager/edit' // 健身卡编辑
95 97
 import givingRecords from './cardAndCouponManager/givingRecords' // 赠送记录
96 98
 import vipList from './cardAndCouponManager/vipManager/index' // vip列表
97 99
 import editVip from './cardAndCouponManager/vipManager/edit' // 编辑vip
@@ -99,6 +101,10 @@ import activateVip from './cardAndCouponManager/vipManager/activateVip' // 激
99 101
 
100 102
 import caseRecord from './newOrder/caseRecord/index' // 月记录
101 103
 
104
+import marketingActivities from './marketingActivities/index' // 营销活动
105
+import activitiesList from './marketingActivities/activitiesList/index' // 活动列表
106
+import addActivities from './marketingActivities/addActivities/index' // 添加活动
107
+
102 108
 export default {
103 109
   router: [
104 110
     {
@@ -514,6 +520,16 @@ export default {
514 520
             component: editCoupon,
515 521
             children: []
516 522
           }]
523
+        }, { // 健身卡列表
524
+          path: 'bodyBuildingCardManager',
525
+          name: 'bodyBuildingCardManager',
526
+          component: bodyBuildingCardManager,
527
+          children: [{ // 编辑健身卡
528
+            path: 'editBodyBuildingCard',
529
+            name: 'editBodyBuildingCard',
530
+            component: editBodyBuildingCard,
531
+            children: []
532
+          }]
517 533
         }, { // 赠送记录
518 534
           path: 'givingRecords',
519 535
           name: 'givingRecords',
@@ -534,6 +550,21 @@ export default {
534 550
             component: activateVip,
535 551
             children: []
536 552
           }]
553
+        }, { // 营销活动
554
+          path: 'marketingActivities',
555
+          name: 'marketingActivities',
556
+          component: marketingActivities,
557
+          children: [{
558
+            path: 'activitiesList',
559
+            name: 'activitiesList',
560
+            component: activitiesList,
561
+            children: [{ // 添加活动
562
+              path: 'addActivities',
563
+              name: 'addActivities',
564
+              component: addActivities,
565
+              children: []
566
+            }]
567
+          }]
537 568
         }]
538 569
       }]
539 570
     },

+ 27
- 0
src/pages/system/systemSet/userManager/add.vue Dosyayı Görüntüle

@@ -14,6 +14,14 @@
14 14
             </div>
15 15
           </div>
16 16
         </li>
17
+        <li class="flex-h" style="padding: 0;margin: 0;">
18
+          <span></span>
19
+          <div class="flex-item">
20
+            <div style="min-height: 0;">
21
+              <span style="font-size:10px;color:#bbb;">默认密码:123456</span>
22
+            </div>
23
+          </div>
24
+        </li>
17 25
         <li class="flex-h">
18 26
           <span>用户头像:</span>
19 27
           <div class="flex-item">
@@ -216,6 +224,25 @@ export default {
216 224
           message: '手机号不能为空'
217 225
         })
218 226
         return false
227
+      } else {
228
+        var myreg = /^[1][3,4,5,6,7,8][0-9]{9}$/
229
+        if (!myreg.test(this.postData.Phone)) {
230
+          this.$message({
231
+            type: 'error',
232
+            message: '请输入正确的手机号!'
233
+          })
234
+          return false
235
+        }
236
+      }
237
+      if (this.postData.Email !== '') {
238
+        var emailreg = new RegExp('^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$')
239
+        if (!emailreg.test(this.postData.Email)) {
240
+          this.$message({
241
+            type: 'error',
242
+            message: '邮箱格式不正确!'
243
+          })
244
+          return false
245
+        }
219 246
       }
220 247
       if (this.postData.BelongCaseId === '') this.postData.BelongCaseId = this.CaseId
221 248
       this.$ajax(this.$api.systemSet.addUser.url, {

+ 27
- 0
src/pages/system/systemSet/userManager/edit.vue Dosyayı Görüntüle

@@ -14,6 +14,14 @@
14 14
             </div>
15 15
           </div>
16 16
         </li>
17
+        <li class="flex-h" style="padding: 0;margin: 0;">
18
+          <span></span>
19
+          <div class="flex-item">
20
+            <div style="min-height: 0;">
21
+              <span style="font-size:10px;color:#bbb;">默认密码:123456</span>
22
+            </div>
23
+          </div>
24
+        </li>
17 25
         <li class="flex-h">
18 26
           <span>用户头像:</span>
19 27
           <div class="flex-item">
@@ -234,6 +242,25 @@ export default {
234 242
           message: '手机号不能为空'
235 243
         })
236 244
         return false
245
+      } else {
246
+        var myreg = /^[1][3,4,5,6,7,8][0-9]{9}$/
247
+        if (!myreg.test(this.postData.Phone)) {
248
+          this.$message({
249
+            type: 'error',
250
+            message: '请输入正确的手机号!'
251
+          })
252
+          return false
253
+        }
254
+      }
255
+      if (this.postData.Email !== '') {
256
+        var emailreg = new RegExp('^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$')
257
+        if (!emailreg.test(this.postData.Email)) {
258
+          this.$message({
259
+            type: 'error',
260
+            message: '邮箱格式不正确!'
261
+          })
262
+          return false
263
+        }
237 264
       }
238 265
       if (this.postData.BelongCaseId === '') this.postData.BelongCaseId = this.BelongCaseId
239 266
       if (this.postData.TagIds === '') this.postData.TagIds = this.TagIds.join(',')

+ 3
- 3
src/pages/system/systemSet/userManager/index.vue Dosyayı Görüntüle

@@ -76,12 +76,12 @@
76 76
         <el-table-column
77 77
           prop="WorkNo"
78 78
           label="工号"
79
-          width="200">
79
+          width="150">
80 80
         </el-table-column>
81 81
         <el-table-column
82 82
           prop="Phone"
83 83
           label="手机号"
84
-          width="150">
84
+          width="200">
85 85
         </el-table-column>
86 86
         <el-table-column
87 87
           prop="UserTypeNames"
@@ -231,7 +231,7 @@ export default {
231 231
       })
232 232
     },
233 233
     resetPasswd (index, row) { // 重置密码
234
-      this.$confirm('确认重置此用户密码?', '提示', {
234
+      this.$confirm('确认重置此用户密码为:123456?', '提示', {
235 235
         confirmButtonText: '确定',
236 236
         cancelButtonText: '取消',
237 237
         type: 'warning'

+ 3
- 2
src/store/app.js Dosyayı Görüntüle

@@ -56,7 +56,8 @@ export default {
56 56
       default: '',
57 57
     },
58 58
     roles: [],
59
-    user: {}
59
+    user: {},
60
+    clientUrl: '',
60 61
   },
61 62
   mutations: {
62 63
     init (state, data) { // 这里的state对应着上面这个state
@@ -64,7 +65,7 @@ export default {
64 65
       state.roles = data.roles
65 66
       state.user = data.user
66 67
       state.menus = packChildren(data.menus)
67
-
68
+      state.clientUrl = data.clienturl
68 69
       let defaultCase = ''
69 70
       for (let i = 0; i < data.cases.length; i++) {
70 71
         if (data.cases[i].IsBelong === 1) {

+ 81
- 0
src/store/card/card.js Dosyayı Görüntüle

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

+ 29
- 0
src/store/channel/channel.js Dosyayı Görüntüle

@@ -0,0 +1,29 @@
1
+import ajax from '../../util/ajax'
2
+import api from '../../util/api'
3
+
4
+export default {
5
+  namespaced: true,
6
+  state: {
7
+    channelList: [],
8
+  },
9
+  mutations: {
10
+    updateList (state, payload) {
11
+      state.channelList = payload || []
12
+    },
13
+  },
14
+  actions: {
15
+    GetChannelListList ({ commit }, payload) {
16
+      return new Promise((resolve, reject) => {
17
+        ajax(api.channelManager.getChannelList.url, {
18
+          method: api.channelManager.getChannelList.method,
19
+          queryData: {
20
+            ...payload,
21
+          }
22
+        }).then(res => {
23
+          commit('updateList', res.list)
24
+          resolve(res)
25
+        }).catch(reject)
26
+      })
27
+    },
28
+  }
29
+}

+ 81
- 0
src/store/coupon/coupon.js Dosyayı Görüntüle

@@ -0,0 +1,81 @@
1
+import ajax from '../../util/ajax'
2
+import api from '../../util/api'
3
+
4
+export default {
5
+  namespaced: true,
6
+  state: {
7
+    couponList: [],
8
+  },
9
+  mutations: {
10
+    updateList (state, payload) {
11
+      state.couponList = payload || []
12
+    },
13
+  },
14
+  actions: {
15
+    GetCouponList ({ commit }, payload) {
16
+      return new Promise((resolve, reject) => {
17
+        ajax(api.couponManager.couponList.url, {
18
+          method: api.couponManager.couponList.method,
19
+          queryData: {
20
+            ...payload,
21
+          }
22
+        }).then(res => {
23
+          commit('updateList', res)
24
+          resolve(res)
25
+        }).catch(reject)
26
+      })
27
+    },
28
+    addCoupon ({ commit }, payload) {
29
+      return new Promise((resolve, reject) => {
30
+        ajax(api.couponManager.addCoupon.url, {
31
+          method: api.couponManager.addCoupon.method,
32
+          data: {
33
+            info: JSON.stringify(payload)
34
+          }
35
+        }).then(res => {
36
+          resolve(res)
37
+        }).catch(reject)
38
+      })
39
+    },
40
+    getCouponById ({ commit }, { id }) {
41
+      return new Promise((resolve, reject) => {
42
+        ajax(api.couponManager.getCouponById.url, {
43
+          method: api.couponManager.getCouponById.method,
44
+          urlData: {
45
+            id,
46
+          }
47
+        }).then(res => {
48
+          resolve(res)
49
+        }).catch(reject)
50
+      })
51
+    },
52
+    editCoupon ({ commit }, payload) {
53
+      return new Promise((resolve, reject) => {
54
+        ajax(api.couponManager.editCoupon.url, {
55
+          method: api.couponManager.editCoupon.method,
56
+          data: {
57
+            info: JSON.stringify(payload)
58
+          },
59
+          urlData: {
60
+            id: payload.CouponId
61
+          },
62
+        }).then(res => {
63
+          resolve(res)
64
+        }).catch(reject)
65
+      })
66
+    },
67
+    GiveCoupon ({ commit }, { id, users }) {
68
+      return new Promise((resolve, reject) => {
69
+        ajax(api.couponManager.giveCoupon.url, {
70
+          method: api.couponManager.giveCoupon.method,
71
+          urlData: {
72
+            id,
73
+            users
74
+          },
75
+        }).then(res => {
76
+          resolve(res)
77
+        }).catch(reject)
78
+      })
79
+    }
80
+  }
81
+}

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

@@ -21,16 +21,19 @@ export default {
21 21
   },
22 22
   actions: {
23 23
     GetCourseList ({ commit }, payload) {
24
-      ajax(api.course.list.url, {
25
-        method: api.course.list.method,
26
-        queryData: {
27
-          ...payload,
28
-        }
29
-      }).then(res => {
30
-        commit('updateList', res)
31
-        if (payload.callback) {
32
-          payload.callback()
33
-        }
24
+      return new Promise((resolve, reject) => {
25
+        ajax(api.course.list.url, {
26
+          method: api.course.list.method,
27
+          queryData: {
28
+            ...payload,
29
+          }
30
+        }).then(res => {
31
+          commit('updateList', res)
32
+          resolve(res)
33
+          if (payload.callback) {
34
+            payload.callback()
35
+          }
36
+        }).catch(reject)
34 37
       })
35 38
     },
36 39
     GetCourseByID ({ commit }, { id }) {

+ 20
- 0
src/store/customer/customer.js Dosyayı Görüntüle

@@ -5,11 +5,15 @@ export default {
5 5
   namespaced: true,
6 6
   state: {
7 7
     customer: {},
8
+    customers: {},
8 9
   },
9 10
   mutations: {
10 11
     updateInfo (state, payload) {
11 12
       state.customer = payload || {}
12 13
     },
14
+    updateList (state, payload) {
15
+      state.customers = payload || {}
16
+    }
13 17
   },
14 18
   actions: {
15 19
     GetCustomerByTel ({ commit }, { tel }) {
@@ -25,6 +29,22 @@ export default {
25 29
         }).catch(reject)
26 30
       })
27 31
     },
32
+    GetCustomerList ({ commit }, payload) {
33
+      return new Promise((resolve, reject) => {
34
+        ajax(api.customerManager.getCustomerList.url, {
35
+          method: api.customerManager.getCustomerList.method,
36
+          queryData: {
37
+            ...payload
38
+          }
39
+        }).then(res => {
40
+          commit('updateList', res)
41
+          resolve(res)
42
+        }).catch(reject)
43
+      })
44
+    },
45
+    SetCustomerListNull ({ commit }) {
46
+      commit('updateList', {})
47
+    },
28 48
     SetCustomerInfoNull ({ commit }) {
29 49
       commit('updateInfo', {})
30 50
     }

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

@@ -25,23 +25,29 @@ export default {
25 25
   },
26 26
   actions: {
27 27
     GetGoodsList ({ commit }, payload) {
28
-      ajax(api.goodsManager.getGoodsList.url, {
29
-        method: api.goodsManager.getGoodsList.method,
30
-        queryData: {
31
-          ...payload,
32
-        }
33
-      }).then(res => {
34
-        commit('updateList', res)
28
+      return new Promise((resolve, reject) => {
29
+        ajax(api.goodsManager.getGoodsList.url, {
30
+          method: api.goodsManager.getGoodsList.method,
31
+          queryData: {
32
+            ...payload,
33
+          }
34
+        }).then(res => {
35
+          commit('updateList', res)
36
+          resolve(res)
37
+        }).catch(reject)
35 38
       })
36 39
     },
37 40
     GetGoodTypes ({ commit }, payload) {
38
-      ajax(api.goodsManager.getGoodsTypeList.url, {
39
-        method: api.goodsManager.getGoodsTypeList.method,
40
-        queryData: {
41
-          ...payload,
42
-        }
43
-      }).then(res => {
44
-        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)
45 51
       })
46 52
     },
47 53
     GetGoodSpecs ({ commit }, payload) {

+ 3
- 0
src/store/index.js Dosyayı Görüntüle

@@ -26,6 +26,9 @@ export const modules = {
26 26
   cmscase: () => require('./cms/case').default,
27 27
   caserecord: () => require('./case/record').default,
28 28
   vip: () => require('./card/vip').default,
29
+  card: () => require('./card/card').default,
30
+  coupon: () => require('./coupon/coupon').default,
31
+  channel: () => require('./channel/channel').default,
29 32
   customer: () => require('./customer/customer').default,
30 33
   user: () => require('./system/user').default,
31 34
 }

+ 73
- 1
src/util/api.js Dosyayı Görüntüle

@@ -588,13 +588,85 @@ const $api = {
588 588
     vipbycode: {
589 589
       method: 'get',
590 590
       url: `${baseUrl}${common}/vipcard/:code`
591
-    }
591
+    },
592
+    cardList: {
593
+      method: 'get',
594
+      url: `${baseUrl}${common}/card`
595
+    },
596
+    addCard: {
597
+      method: 'post',
598
+      url: `${baseUrl}${common}/card`
599
+    },
600
+    editCard: {
601
+      method: 'put',
602
+      url: `${baseUrl}${common}/card/:id`
603
+    },
604
+    getCardById: {
605
+      method: 'get',
606
+      url: `${baseUrl}${common}/card/:id`
607
+    },
608
+    giveCard: {
609
+      method: 'post',
610
+      url: `${baseUrl}${common}/card/:id/to/:users`
611
+    },
612
+  },
613
+  couponManager: {
614
+    couponList: {
615
+      method: 'get',
616
+      url: `${baseUrl}${common}/coupon`
617
+    },
618
+    addCoupon: {
619
+      method: 'post',
620
+      url: `${baseUrl}${common}/coupon`
621
+    },
622
+    editCoupon: {
623
+      method: 'put',
624
+      url: `${baseUrl}${common}/coupon/:id`
625
+    },
626
+    getCouponById: {
627
+      method: 'get',
628
+      url: `${baseUrl}${common}/coupon/:id`
629
+    },
630
+    giveCoupon: {
631
+      method: 'post',
632
+      url: `${baseUrl}${common}/coupon/:id/to/:users`
633
+    },
592 634
   },
593 635
   customerManager: {
594 636
     getByTel: {
595 637
       method: 'get',
596 638
       url: `${baseUrl}${common}/customer/tel/:tel`
639
+    },
640
+    getCustomerList: { // 获取会员列表
641
+      method: 'get',
642
+      url: `${baseUrl}${common}/customer`
597 643
     }
598 644
   },
645
+  marketingActivities: { // 营销活动
646
+    getMarketingList: { // 查询所有
647
+      method: 'get',
648
+      url: `${baseUrl}${common}/marketing/list`
649
+    },
650
+    addMarketing: { // 添加
651
+      method: 'post',
652
+      url: `${baseUrl}${common}/marketing`
653
+    },
654
+    delMarketing: { // 删除
655
+      method: 'delete',
656
+      url: `${baseUrl}${common}/marketing/:activityId`
657
+    },
658
+    delMarketingNormal: { // 启用
659
+      method: 'put',
660
+      url: `${baseUrl}${common}/marketing/normal/:activityId`
661
+    },
662
+    delMarketingDisable: { // 停用
663
+      method: 'put',
664
+      url: `${baseUrl}${common}/marketing/disable/:activityId`
665
+    },
666
+    getCouponList: { // 获取赠券卡券类型
667
+      method: 'get',
668
+      url: `${baseUrl}${common}/coupon`
669
+    }
670
+  }
599 671
 }
600 672
 export default $api