Browse Source

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

wangfei 6 years ago
parent
commit
2742f598b5
31 changed files with 5898 additions and 5428 deletions
  1. 1
    1
      config/index.js
  2. 1
    1
      dist/index.html
  3. 5332
    5190
      package-lock.json
  4. 2
    0
      package.json
  5. 1
    1
      src/pages/system/cardAndCouponManager/cardManager/index.vue
  6. 1
    1
      src/pages/system/cardAndCouponManager/couponManager/index.vue
  7. 24
    17
      src/pages/system/cardAndCouponManager/vipManager/activateVip.vue
  8. 1
    1
      src/pages/system/cardAndCouponManager/vipManager/edit.vue
  9. 0
    1
      src/pages/system/courseManager/courseList/add.vue
  10. 1
    0
      src/pages/system/courseManager/courseList/index.vue
  11. 23
    23
      src/pages/system/dashboard/index.vue
  12. 7
    1
      src/pages/system/dataStatistics/goodsOrderList/index.vue
  13. 4
    3
      src/pages/system/marketingActivities/activitiesList/index.vue
  14. 28
    4
      src/pages/system/marketingActivities/addActivities/index.vue
  15. 132
    18
      src/pages/system/marketingActivities/listOfLotteryActivities/edit.vue
  16. 1
    1
      src/pages/system/marketingActivities/listOfLotteryActivities/page.scss
  17. 39
    5
      src/pages/system/marketingActivities/snapUpList/edit.vue
  18. 1
    1
      src/pages/system/marketingActivities/snapUpList/index.vue
  19. 1
    1
      src/pages/system/marketingActivities/snapUpList/page.scss
  20. 94
    138
      src/pages/system/newOrder/newOrderList/index.vue
  21. 60
    0
      src/pages/system/newOrder/newOrderList/print.vue
  22. 1
    1
      src/pages/system/systemSet/userManager/add.vue
  23. 1
    1
      src/pages/system/systemSet/userManager/edit.vue
  24. 6
    0
      src/pages/system/systemSet/userManager/index.vue
  25. 12
    2
      src/pages/system/verificationManager/drawVerification/verificationList/index.vue
  26. 12
    1
      src/pages/system/verificationManager/flashbuyVerification/verificationList/index.vue
  27. 15
    13
      src/store/goods/order.js
  28. 3
    1
      src/style/main.css
  29. 1
    1
      src/util/ajax.js
  30. 1
    0
      src/util/upload.js
  31. 92
    0
      src/util/websocket.js

+ 1
- 1
config/index.js View File

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

+ 1
- 1
dist/index.html View File

1
-<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel=stylesheet href=//at.alicdn.com/t/font_775069_dwqa9wy3lkh.css><link rel="shortcut icon" href=favorite.ico><title>城的空间后台管理系统</title><link href=./static/css/app.ee89fb0019a07dfb9399a5a73bab0752.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.3c9a16350e1e47228e4f.js></script><script type=text/javascript src=./static/js/app.bb25f2ba0fa9270e8761.js></script></body></html>
1
+<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel=stylesheet href=//at.alicdn.com/t/font_775069_dwqa9wy3lkh.css><link rel="shortcut icon" href=favorite.ico><title>城的空间后台管理系统</title><link href=./static/css/app.2b6862742e5b7ddbd4c73a63f85dc175.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.d824a66773bc281133c0.js></script><script type=text/javascript src=./static/js/vendor.d93cccd3231f9f669168.js></script><script type=text/javascript src=./static/js/app.3be0be8da89125188ad1.js></script></body></html>

+ 5332
- 5190
package-lock.json
File diff suppressed because it is too large
View File


+ 2
- 0
package.json View File

22
     "g2-vue": "^1.0.1",
22
     "g2-vue": "^1.0.1",
23
     "js-base64": "^2.4.8",
23
     "js-base64": "^2.4.8",
24
     "js-md5": "^0.7.3",
24
     "js-md5": "^0.7.3",
25
+    "quill-plugin-image": "0.0.6",
25
     "vue": "^2.5.2",
26
     "vue": "^2.5.2",
26
     "vue-amap": "^0.5.8",
27
     "vue-amap": "^0.5.8",
27
     "vue-cookie": "^1.1.4",
28
     "vue-cookie": "^1.1.4",
80
     "postcss-import": "^11.0.0",
81
     "postcss-import": "^11.0.0",
81
     "postcss-loader": "^2.0.8",
82
     "postcss-loader": "^2.0.8",
82
     "postcss-url": "^7.2.1",
83
     "postcss-url": "^7.2.1",
84
+    "quill-image-extend-module": "^1.1.2",
83
     "rimraf": "^2.6.0",
85
     "rimraf": "^2.6.0",
84
     "sass-loader": "^7.1.0",
86
     "sass-loader": "^7.1.0",
85
     "sass-resources-loader": "^1.3.3",
87
     "sass-resources-loader": "^1.3.3",

+ 1
- 1
src/pages/system/cardAndCouponManager/cardManager/index.vue View File

92
               size="mini"
92
               size="mini"
93
               type="success"
93
               type="success"
94
               v-if="scope.row.SendType === 'channel'"
94
               v-if="scope.row.SendType === 'channel'"
95
-              v-clipboard:copy="clientUrl + 'user.html#/receiveChannelShared/' + scope.row.CardId + '/card/receive'"
95
+              v-clipboard:copy="clientUrl + '/wechat/user.html#/receiveChannelShared/' + scope.row.CardId + '/card/receive'"
96
               v-clipboard:success="onCopy"
96
               v-clipboard:success="onCopy"
97
               v-clipboard:error="onError"
97
               v-clipboard:error="onError"
98
               >点击复制链接</el-button>
98
               >点击复制链接</el-button>

+ 1
- 1
src/pages/system/cardAndCouponManager/couponManager/index.vue View File

87
               size="mini"
87
               size="mini"
88
               type="success"
88
               type="success"
89
               v-if="scope.row.SendType === 'channel'"
89
               v-if="scope.row.SendType === 'channel'"
90
-              v-clipboard:copy="clientUrl + 'user.html#/receiveChannelShared/' + scope.row.CouponId + '/coupon/receive'"
90
+              v-clipboard:copy="clientUrl + '/wechat/user.html#/receiveChannelShared/' + scope.row.CouponId + '/coupon/receive'"
91
               v-clipboard:success="onCopy"
91
               v-clipboard:success="onCopy"
92
               v-clipboard:error="onError"
92
               v-clipboard:error="onError"
93
               >点击复制链接</el-button>
93
               >点击复制链接</el-button>

+ 24
- 17
src/pages/system/cardAndCouponManager/vipManager/activateVip.vue View File

81
       </div>
81
       </div>
82
       <span slot="footer" class="dialog-footer">
82
       <span slot="footer" class="dialog-footer">
83
         <el-button @click="centerDialogVisible = false">取 消</el-button>
83
         <el-button @click="centerDialogVisible = false">取 消</el-button>
84
-        <el-button type="primary" @click="vipCharge">激 活</el-button>
84
+        <el-button type="primary" @click="vipCharger">激 活</el-button>
85
       </span>
85
       </span>
86
     </el-dialog>
86
     </el-dialog>
87
   </div>
87
   </div>
97
   name: '',
97
   name: '',
98
   data () {
98
   data () {
99
     return {
99
     return {
100
+      ajaxOff: true,
100
       centerDialogVisible: false,
101
       centerDialogVisible: false,
101
       CardNo: '',
102
       CardNo: '',
102
       salesPhone: '',
103
       salesPhone: '',
194
         })
195
         })
195
       }
196
       }
196
     },
197
     },
197
-    vipCharge () {
198
+    vipCharger () {
198
       if (this.vip.VipCardChildCode === '') {
199
       if (this.vip.VipCardChildCode === '') {
199
         this.$message({
200
         this.$message({
200
           type: 'error',
201
           type: 'error',
209
         })
210
         })
210
         return
211
         return
211
       }
212
       }
212
-      var that = this
213
-      this.VipCharge({
214
-        code: this.vip.VipCardChildCode,
215
-        tel: this.customer.Phone,
216
-        salesid: this.sales.UserId || '',
217
-        salesname: this.sales.RealName || '',
218
-      }).then(() => {
219
-        this.$message({
220
-          type: 'success',
221
-          message: '激活成功!',
213
+      if (this.ajaxOff) {
214
+        this.ajaxOff = false
215
+        this.VipCharge({
216
+          code: this.vip.VipCardChildCode,
217
+          tel: this.customer.Phone,
218
+          salesid: this.sales.UserId || '',
219
+          salesname: this.sales.RealName || '',
220
+        }).then(() => {
221
+          this.ajaxOff = true
222
+          this.$message({
223
+            type: 'success',
224
+            message: '激活成功!',
225
+          })
226
+          // setTimeout(() => {
227
+          //   that.setNull()
228
+          //   that.centerDialogVisible = false
229
+          // }, 1000)
230
+          this.$router.push({name: 'vipList'})
231
+        }).catch(() => {
232
+          this.ajaxOff = true
222
         })
233
         })
223
-        setTimeout(() => {
224
-          that.setNull()
225
-          that.centerDialogVisible = false
226
-        }, 1000)
227
-      })
234
+      }
228
     },
235
     },
229
   },
236
   },
230
   mounted () { }
237
   mounted () { }

+ 1
- 1
src/pages/system/cardAndCouponManager/vipManager/edit.vue View File

53
               </el-date-picker>
53
               </el-date-picker>
54
               <span style="line-height:40px;">至</span>
54
               <span style="line-height:40px;">至</span>
55
               <el-date-picker
55
               <el-date-picker
56
-                value-format="yyyy-MM-ddT00:00:00+08:00"
56
+                value-format="yyyy-MM-ddT23:59:59+08:00"
57
                 v-model="postData.EndDate"
57
                 v-model="postData.EndDate"
58
                 type="date"
58
                 type="date"
59
                 placeholder="选择截止日期">
59
                 placeholder="选择截止日期">

+ 0
- 1
src/pages/system/courseManager/courseList/add.vue View File

5
         <li class="flex-h">
5
         <li class="flex-h">
6
           <span>课程主图:<em>*</em></span>
6
           <span>课程主图:<em>*</em></span>
7
           <div class="flex-item">
7
           <div class="flex-item">
8
-            <div class="red-hint">建议上传750*960尺寸的图片</div>
9
             <div>
8
             <div>
10
               <el-upload
9
               <el-upload
11
                 class="avatar-uploader"
10
                 class="avatar-uploader"

+ 1
- 0
src/pages/system/courseManager/courseList/index.vue View File

163
         <li class="flex-h" style="align-items: flex-start;">
163
         <li class="flex-h" style="align-items: flex-start;">
164
           <span>课程详情图片:</span>
164
           <span>课程详情图片:</span>
165
           <div class="flex-item">
165
           <div class="flex-item">
166
+            <div class="red-hint">建议上传750*960尺寸的图片</div>
166
             <div>
167
             <div>
167
               <el-upload
168
               <el-upload
168
                 class="avatar-uploader"
169
                 class="avatar-uploader"

+ 23
- 23
src/pages/system/dashboard/index.vue View File

35
         </div>
35
         </div>
36
       </div>
36
       </div>
37
     </div>
37
     </div>
38
-    <div class="bottomData">
38
+    <div class="bottomData" :hidden="!bottomData.length">
39
       <div class="flex-h">
39
       <div class="flex-h">
40
         <div class="flex-item">
40
         <div class="flex-item">
41
           <h1>数据统计</h1>
41
           <h1>数据统计</h1>
92
       bottomNav: ['推荐会员新增', '排课数', '课程预约量', '饮品下单量', '到场人次'],
92
       bottomNav: ['推荐会员新增', '排课数', '课程预约量', '饮品下单量', '到场人次'],
93
       bottomData: [],
93
       bottomData: [],
94
       pageData: [
94
       pageData: [
95
-        [
96
-          { type: 'dashboardList', remark: '列表面板', data: { title: '', list: [{ name: '会员总数', value: '1000', }, { name: '课程预约总量', value: '1000', }, { name: '饮品下单总量', value: '1000', }] } }
97
-        ],
98
-        [
99
-          { type: 'histogram', remark: '柱状图', data: { title: '今日数据', list: [{ x: '推荐会员新增', y: 38 }, { x: '课程数', y: 52 }, { x: '预约数', y: 61 }, { x: '到场人次', y: 145 }] } },
100
-          { type: 'pieDiagram', remark: '扇形图', data: { title: '明日课程预约数据', list: [{ item: '小小体验官', count: 40, percent: 0.4 }, { item: '哈他瑜伽', count: 52, percent: 0.52 }, { item: '小小飞行家', count: 8, percent: 0.08 }] } }
101
-        ],
102
-        [
103
-          { type: 'brokenLineGraph', remark: '折线图', data: { title: '下单饮品数据', list: [{ x: '09/05', y: 3 }, { x: '09/06', y: 4 }, { x: '09/07', y: 3.5 }, { x: '09/08', y: 5 }, { x: '09/09', y: 4.9 }, { x: '09/10', y: 6 }, { x: '09/11', y: 7 }, { x: '09/12', y: 9 }, { x: '09/13', y: 13 }] } },
104
-          { type: 'ringChart', remark: '环形图', data: { title: '本月课程预约', list: [{ item: '健身课程', count: 40, percent: 0.4 }, { item: '社交课程', count: 21, percent: 0.21 }, { item: '教育课程', count: 17, percent: 0.17 }, { item: '健康课程', count: 13, percent: 0.13 }, { item: '艺术课程', count: 9, percent: 0.09 }] } },
105
-        ],
106
-        [
107
-          { type: 'dashboard', remark: '仪表盘', data: { title: '参与率', list: [{ value: 5.6 }] } },
108
-          { type: 'dashboard', remark: '仪表盘', data: { title: '参与率', list: [{ value: 3.1 }] } },
109
-        ],
110
-        [
111
-          { type: 'brokenLineGraphGroup', remark: '折线图组合', data: { title: '下单饮品数据', list: [{ month: 'Jan', city: 'Tokyo', temperature: 7 }, { month: 'Jan', city: 'London', temperature: 3.9 }, { month: 'Feb', city: 'Tokyo', temperature: 6.9 }, { month: 'Feb', city: 'London', temperature: 4.2 }, { month: 'Mar', city: 'Tokyo', temperature: 9.5 }, { month: 'Mar', city: 'London', temperature: 5.7 }, { month: 'Apr', city: 'Tokyo', temperature: 14.5 }, { month: 'Apr', city: 'London', temperature: 8.5 }, { month: 'May', city: 'Tokyo', temperature: 18.4 }, { month: 'May', city: 'London', temperature: 11.9 }, { month: 'Jun', city: 'Tokyo', temperature: 21.5 }, { month: 'Jun', city: 'London', temperature: 15.2 }, { month: 'Jul', city: 'Tokyo', temperature: 25.2 }, { month: 'Jul', city: 'London', temperature: 17 }, { month: 'Aug', city: 'Tokyo', temperature: 26.5 }, { month: 'Aug', city: 'London', temperature: 16.6 }, { month: 'Sep', city: 'Tokyo', temperature: 23.3 }, { month: 'Sep', city: 'London', temperature: 14.2 }, { month: 'Oct', city: 'Tokyo', temperature: 18.3 }, { month: 'Oct', city: 'London', temperature: 10.3 }, { month: 'Nov', city: 'Tokyo', temperature: 13.9 }, { month: 'Nov', city: 'London', temperature: 6.6 }, { month: 'Dec', city: 'Tokyo', temperature: 9.6 }, { month: 'Dec', city: 'London', temperature: 4.8 }] } },
112
-        ],
95
+        // [
96
+        //   { type: 'dashboardList', remark: '列表面板', data: { title: '', list: [{ name: '会员总数', value: '1000', }, { name: '课程预约总量', value: '1000', }, { name: '饮品下单总量', value: '1000', }] } }
97
+        // ],
98
+        // [
99
+        //   { type: 'histogram', remark: '柱状图', data: { title: '今日数据', list: [{ x: '推荐会员新增', y: 38 }, { x: '课程数', y: 52 }, { x: '预约数', y: 61 }, { x: '到场人次', y: 145 }] } },
100
+        //   { type: 'pieDiagram', remark: '扇形图', data: { title: '明日课程预约数据', list: [{ item: '小小体验官', count: 40, percent: 0.4 }, { item: '哈他瑜伽', count: 52, percent: 0.52 }, { item: '小小飞行家', count: 8, percent: 0.08 }] } }
101
+        // ],
102
+        // [
103
+        //   { type: 'brokenLineGraph', remark: '折线图', data: { title: '下单饮品数据', list: [{ x: '09/05', y: 3 }, { x: '09/06', y: 4 }, { x: '09/07', y: 3.5 }, { x: '09/08', y: 5 }, { x: '09/09', y: 4.9 }, { x: '09/10', y: 6 }, { x: '09/11', y: 7 }, { x: '09/12', y: 9 }, { x: '09/13', y: 13 }] } },
104
+        //   { type: 'ringChart', remark: '环形图', data: { title: '本月课程预约', list: [{ item: '健身课程', count: 40, percent: 0.4 }, { item: '社交课程', count: 21, percent: 0.21 }, { item: '教育课程', count: 17, percent: 0.17 }, { item: '健康课程', count: 13, percent: 0.13 }, { item: '艺术课程', count: 9, percent: 0.09 }] } },
105
+        // ],
106
+        // [
107
+        //   { type: 'dashboard', remark: '仪表盘', data: { title: '参与率', list: [{ value: 5.6 }] } },
108
+        //   { type: 'dashboard', remark: '仪表盘', data: { title: '参与率', list: [{ value: 3.1 }] } },
109
+        // ],
110
+        // [
111
+        //   { type: 'brokenLineGraphGroup', remark: '折线图组合', data: { title: '下单饮品数据', list: [{ month: 'Jan', city: 'Tokyo', temperature: 7 }, { month: 'Jan', city: 'London', temperature: 3.9 }, { month: 'Feb', city: 'Tokyo', temperature: 6.9 }, { month: 'Feb', city: 'London', temperature: 4.2 }, { month: 'Mar', city: 'Tokyo', temperature: 9.5 }, { month: 'Mar', city: 'London', temperature: 5.7 }, { month: 'Apr', city: 'Tokyo', temperature: 14.5 }, { month: 'Apr', city: 'London', temperature: 8.5 }, { month: 'May', city: 'Tokyo', temperature: 18.4 }, { month: 'May', city: 'London', temperature: 11.9 }, { month: 'Jun', city: 'Tokyo', temperature: 21.5 }, { month: 'Jun', city: 'London', temperature: 15.2 }, { month: 'Jul', city: 'Tokyo', temperature: 25.2 }, { month: 'Jul', city: 'London', temperature: 17 }, { month: 'Aug', city: 'Tokyo', temperature: 26.5 }, { month: 'Aug', city: 'London', temperature: 16.6 }, { month: 'Sep', city: 'Tokyo', temperature: 23.3 }, { month: 'Sep', city: 'London', temperature: 14.2 }, { month: 'Oct', city: 'Tokyo', temperature: 18.3 }, { month: 'Oct', city: 'London', temperature: 10.3 }, { month: 'Nov', city: 'Tokyo', temperature: 13.9 }, { month: 'Nov', city: 'London', temperature: 6.6 }, { month: 'Dec', city: 'Tokyo', temperature: 9.6 }, { month: 'Dec', city: 'London', temperature: 4.8 }] } },
112
+        // ],
113
       ],
113
       ],
114
     }
114
     }
115
   },
115
   },
148
   },
148
   },
149
   mounted () {
149
   mounted () {
150
     this.$nextTick(function () {
150
     this.$nextTick(function () {
151
-      if (this.defaultCaseId !== null) {
152
-        this.getData(this.defaultCaseId)
153
-        this.getBottomData(this.defaultCaseId, this.bottomSelectValue)
154
-      }
151
+      // if (this.defaultCaseId !== null) {
152
+      //   this.getData(this.defaultCaseId)
153
+      //   this.getBottomData(this.defaultCaseId, this.bottomSelectValue)
154
+      // }
155
     })
155
     })
156
   },
156
   },
157
   methods: {
157
   methods: {

+ 7
- 1
src/pages/system/dataStatistics/goodsOrderList/index.vue View File

81
               <span>案场:{{returnListItem(goodsOrderList, index).CaseName}}</span>
81
               <span>案场:{{returnListItem(goodsOrderList, index).CaseName}}</span>
82
               <span>用户类型:{{returnListItem(goodsOrderList, index).UserType === 'sales' ? '销售' : returnListItem(goodsOrderList, index).UserType === 'manager' ? '主管' : '用户'}}</span>
82
               <span>用户类型:{{returnListItem(goodsOrderList, index).UserType === 'sales' ? '销售' : returnListItem(goodsOrderList, index).UserType === 'manager' ? '主管' : '用户'}}</span>
83
               <span>下单时间:{{toolClass.dateFormat(returnListItem(goodsOrderList, index).CreateDate)}}</span>
83
               <span>下单时间:{{toolClass.dateFormat(returnListItem(goodsOrderList, index).CreateDate)}}</span>
84
-              <span>支付方式:{{returnListItem(goodsOrderList, index).PayTypeStr}}</span>
84
+              <span>支付方式:{{returnStr(returnListItem(goodsOrderList, index).PayType)}}</span>
85
             </div>
85
             </div>
86
             <span>{{returnStatus(returnListItem(goodsOrderList, index).MakeStatus)}}</span>
86
             <span>{{returnStatus(returnListItem(goodsOrderList, index).MakeStatus)}}</span>
87
           </div>
87
           </div>
189
       }, {
189
       }, {
190
         value: '积分',
190
         value: '积分',
191
         id: 'points'
191
         id: 'points'
192
+      }, {
193
+        value: '城币+优惠券',
194
+        id: 'coupon-coin'
192
       }],
195
       }],
193
       statusList: [{
196
       statusList: [{
194
         value: '',
197
         value: '',
249
           return '已取消'
252
           return '已取消'
250
       }
253
       }
251
     },
254
     },
255
+    returnStr (val) {
256
+      return (this.paytype.filter(x => x.id === val)[0] || {}).value || ''
257
+    },
252
     returnListItem (target, index) {
258
     returnListItem (target, index) {
253
       return target[Math.ceil((index + 1) / 2) - 1]
259
       return target[Math.ceil((index + 1) / 2) - 1]
254
     },
260
     },

+ 4
- 3
src/pages/system/marketingActivities/activitiesList/index.vue View File

152
       if (desc === '') {
152
       if (desc === '') {
153
         return 0
153
         return 0
154
       }
154
       }
155
+      desc = desc.replace(/\n/g, '')
155
       const descjson = JSON.parse(desc)
156
       const descjson = JSON.parse(desc)
156
       return descjson.giftNum
157
       return descjson.giftNum
157
     },
158
     },
162
       return '未知'
163
       return '未知'
163
     },
164
     },
164
     getGiftLabel (desc) {
165
     getGiftLabel (desc) {
165
-      if (desc === '') {
166
+      if (desc === '' || desc === null) {
166
         return '未知卡券'
167
         return '未知卡券'
167
       }
168
       }
168
-      const descjson = JSON.parse(desc)
169
-      return descjson.giftLabel
169
+      desc = desc.replace(/\n/g, '')
170
+      return JSON.parse(desc).giftLabel
170
     },
171
     },
171
     handleSizeChange (val) {
172
     handleSizeChange (val) {
172
       // console.log(`每页 ${val} 条`)
173
       // console.log(`每页 ${val} 条`)

+ 28
- 4
src/pages/system/marketingActivities/addActivities/index.vue View File

110
 <script>
110
 <script>
111
 import { mapState, createNamespacedHelpers } from 'vuex'
111
 import { mapState, createNamespacedHelpers } from 'vuex'
112
 const { mapActions: mapActivityFlashbuyActions } = createNamespacedHelpers('activityFlashbuy')
112
 const { mapActions: mapActivityFlashbuyActions } = createNamespacedHelpers('activityFlashbuy')
113
+const { mapActions: mapCardActions } = createNamespacedHelpers('card')
114
+const { mapActions: mapCouponActions } = createNamespacedHelpers('coupon')
113
 
115
 
114
 export default {
116
 export default {
115
   data () {
117
   data () {
184
       'getCardListByCaseId',
186
       'getCardListByCaseId',
185
       'getCouponListByCaseId',
187
       'getCouponListByCaseId',
186
     ]),
188
     ]),
189
+    ...mapCardActions([
190
+      'GetCardList',
191
+    ]),
192
+    ...mapCouponActions([
193
+      'GetCouponList',
194
+    ]),
187
     caseChange () { // 更换案场请求卡券列表
195
     caseChange () { // 更换案场请求卡券列表
188
-      this.getCardListByCaseId(this.CaseId).then((res) => {
196
+      this.GetCardList({
197
+        page: 1,
198
+        pagesize: 100000,
199
+        sendtype: 'system',
200
+        usetype: 'luckdraw',
201
+        usedid: this.$route.query.id || '',
202
+        caseid: this.CaseId,
203
+      }).then((res) => {
189
         // console.log(JSON.stringify(res))
204
         // console.log(JSON.stringify(res))
190
-        this.cardList = res
205
+        this.cardList = res.list || []
206
+        // console.log(JSON.stringify(this.cardList))
191
       })
207
       })
192
-      this.getCouponListByCaseId(this.CaseId).then((res) => {
208
+      this.GetCouponList({
209
+        page: 1,
210
+        pagesize: 100000,
211
+        sendtype: 'system',
212
+        usetype: 'luckdraw',
213
+        usedid: this.$route.query.id || '',
214
+        caseid: this.CaseId,
215
+      }).then((res) => {
193
         // console.log(JSON.stringify(res))
216
         // console.log(JSON.stringify(res))
194
-        this.couponList = res
217
+        this.couponList = res.list || []
218
+        // console.log(JSON.stringify(this.couponList))
195
       })
219
       })
196
     },
220
     },
197
     redirection (pathName) { // 重定向
221
     redirection (pathName) { // 重定向

+ 132
- 18
src/pages/system/marketingActivities/listOfLotteryActivities/edit.vue View File

28
                 <span>案场:<em>*</em></span>
28
                 <span>案场:<em>*</em></span>
29
                 <div class="flex-item">
29
                 <div class="flex-item">
30
                   <div style="width:50%">
30
                   <div style="width:50%">
31
-                    <el-select :disabled="!editAll || isread" v-model="CaseId" placeholder="请选择案场">
31
+                    <el-select :disabled="!editAll || isread" v-model="CaseId" @change="selectCase" placeholder="请选择案场">
32
                       <el-option
32
                       <el-option
33
                         v-for="item in cases"
33
                         v-for="item in cases"
34
                         :key="item.CaseId"
34
                         :key="item.CaseId"
79
                 <div class="flex-item">
79
                 <div class="flex-item">
80
                   <div>
80
                   <div>
81
                     <div class="drawTemplateItem" v-for="(item,index) in templateList" :key="index">
81
                     <div class="drawTemplateItem" v-for="(item,index) in templateList" :key="index">
82
-                      <a :class="{'active': templateActiveIndex === index}" @click="cutTemplate(index)" @dblclick="dbTemplateClick(index)">
82
+                      <a :class="{'active': templateActiveIndex === index}" @click="cutTemplate(index)">
83
                         <input type="file" :ref="'templateImg' + index" hidden @change="templateImgChange(item, $event)">
83
                         <input type="file" :ref="'templateImg' + index" hidden @change="templateImgChange(item, $event)">
84
                         <img :src="item.MiniPic" style="width:100%;height:100%;object-fit: contain;">
84
                         <img :src="item.MiniPic" style="width:100%;height:100%;object-fit: contain;">
85
                       </a>
85
                       </a>
86
-                      <span style="width:100%;display:block;text-align:center;font-size:11px;color:#ccc;margin-bottom:5px;">(双击更换背景图)</span>
87
-                      <el-button
86
+                      <!-- <span style="width:100%;display:block;text-align:center;font-size:11px;color:#ccc;margin-bottom:5px;">(双击更换背景图)</span> -->
87
+                      <!-- <el-button
88
                         v-if="item.currentImg !== ''"
88
                         v-if="item.currentImg !== ''"
89
                         size="mini"
89
                         size="mini"
90
                         @click="resetCurrentImg(item, index)"
90
                         @click="resetCurrentImg(item, index)"
91
-                        type="success">重置</el-button>
91
+                        type="success">重置</el-button> -->
92
                     </div>
92
                     </div>
93
                   </div>
93
                   </div>
94
                 </div>
94
                 </div>
96
               <li class="flex-h">
96
               <li class="flex-h">
97
                 <span>模板背景图:</span>
97
                 <span>模板背景图:</span>
98
                 <div class="flex-item">
98
                 <div class="flex-item">
99
-                  <div style="width:300px;" :style="{height: this.postData.Imgs.length ? '300px' : '40px'}">
100
-                    <img v-if="this.postData.Imgs.length" class="contain" :src="this.postData.Imgs[0].ImgUrl" alt="">
101
-                    <span v-else style="line-height:40px;font-size:11px;color:#ccc;">默认背景图</span>
99
+                  <div style="width:300px;text-align:center" v-for="(item,index) in templateList" :key="index" v-if="index === templateActiveIndex">
100
+                    <div :style="{height: item.currentImg ? '300px' : '40px'}">
101
+                      <img v-if="item.currentImg" class="contain currentImg" :src="item.currentImg" alt="" @dblclick="dbTemplateClick(index)">
102
+                      <!-- <span v-else style="width:100%;line-height:40px;font-size:11px;color:#ccc;text-align:left;display:block;">默认背景图</span> -->
103
+                      <el-button
104
+                        v-else
105
+                        style="float:left;margin-top:5px;"
106
+                        size="mini"
107
+                        @click="dbTemplateClick(index)"
108
+                        type="success">更换背景图</el-button>
109
+                    </div>
110
+                    <span v-if="item.currentImg" style="width:100%;display:block;text-align:center;font-size:11px;color:#ccc;margin-bottom:5px;">(双击更换背景图)</span>
111
+                    <el-button
112
+                      v-if="item.currentImg"
113
+                      size="mini"
114
+                      @click="resetCurrentImg(item, index)"
115
+                      type="success">重置</el-button>
102
                   </div>
116
                   </div>
103
                 </div>
117
                 </div>
104
               </li>
118
               </li>
378
             <div class="flex-item">
392
             <div class="flex-item">
379
               <el-select :disabled="!editAll || isread" v-if="addPrizeInfo.CouponCardType === 'card'" @change="cardChange" v-model="addPrizeInfo.CouponCardId" placeholder="请选择">
393
               <el-select :disabled="!editAll || isread" v-if="addPrizeInfo.CouponCardType === 'card'" @change="cardChange" v-model="addPrizeInfo.CouponCardId" placeholder="请选择">
380
                 <el-option
394
                 <el-option
395
+                  :disabled="!item.select"
381
                   v-for="item in cardList"
396
                   v-for="item in cardList"
382
                   :key="item.CardId"
397
                   :key="item.CardId"
383
                   :label="item.CardName"
398
                   :label="item.CardName"
386
               </el-select>
401
               </el-select>
387
               <el-select :disabled="!editAll || isread" v-if="addPrizeInfo.CouponCardType === 'coupon'" @change="couponChange" v-model="addPrizeInfo.CouponCardId" placeholder="请选择">
402
               <el-select :disabled="!editAll || isread" v-if="addPrizeInfo.CouponCardType === 'coupon'" @change="couponChange" v-model="addPrizeInfo.CouponCardId" placeholder="请选择">
388
                 <el-option
403
                 <el-option
404
+                  :disabled="!item.select"
389
                   v-for="item in couponList"
405
                   v-for="item in couponList"
390
                   :key="item.CouponId"
406
                   :key="item.CouponId"
391
                   :label="item.CouponName"
407
                   :label="item.CouponName"
453
                 <div style="display: inline-block;">
469
                 <div style="display: inline-block;">
454
                   <el-date-picker
470
                   <el-date-picker
455
                     :disabled="!editAll || isread"
471
                     :disabled="!editAll || isread"
456
-                    value-format="yyyy-MM-ddT00:00:00+08:00"
472
+                    value-format="yyyy-MM-ddT23:59:59+08:00"
457
                     v-model="addPrizeInfo.VerificationEnd"
473
                     v-model="addPrizeInfo.VerificationEnd"
458
                     type="date"
474
                     type="date"
459
                     placeholder="选择截止日期">
475
                     placeholder="选择截止日期">
548
       <div style="text-align:center;padding-bottom:20px;">
564
       <div style="text-align:center;padding-bottom:20px;">
549
       </div>
565
       </div>
550
     </el-dialog>
566
     </el-dialog>
567
+    <div id="hiddenRule" style="display:none;"></div>
551
   </div>
568
   </div>
552
 </template>
569
 </template>
553
 <script>
570
 <script>
554
 import { mapState, createNamespacedHelpers } from 'vuex'
571
 import { mapState, createNamespacedHelpers } from 'vuex'
555
 import { quillEditor } from 'vue-quill-editor'
572
 import { quillEditor } from 'vue-quill-editor'
573
+import uploadImage from 'quill-plugin-image'
556
 const { mapState: mapActivityLuckDrawState, mapActions: mapActivityLuckDrawActions } = createNamespacedHelpers('activityLuckDraw')
574
 const { mapState: mapActivityLuckDrawState, mapActions: mapActivityLuckDrawActions } = createNamespacedHelpers('activityLuckDraw')
557
 const { mapActions: mapCardActions } = createNamespacedHelpers('card')
575
 const { mapActions: mapCardActions } = createNamespacedHelpers('card')
558
 const { mapActions: mapCouponActions } = createNamespacedHelpers('coupon')
576
 const { mapActions: mapCouponActions } = createNamespacedHelpers('coupon')
655
   components: {
673
   components: {
656
     quillEditor,
674
     quillEditor,
657
   },
675
   },
676
+  mounted () {
677
+    uploadImage(this.$refs.myQuillEditor.quill, file => {
678
+      return this.toolClass.upload({ file }).then(data => {
679
+        const url = data.result.url
680
+        return { src: url, alt: '' }
681
+      })
682
+    })
683
+  },
658
   created () {
684
   created () {
659
     if (this.$route.query.isread) {
685
     if (this.$route.query.isread) {
660
       this.isread = true
686
       this.isread = true
663
       page: 1,
689
       page: 1,
664
       pagesize: 100000,
690
       pagesize: 100000,
665
       sendtype: 'system',
691
       sendtype: 'system',
666
-      usetype: 'luckdraw'
692
+      usetype: 'luckdraw',
693
+      usedid: this.$route.query.id || '',
694
+      caseid: this.CaseId,
667
     }).then((res) => {
695
     }).then((res) => {
696
+      res.list = res.list || []
697
+      for (var n = 0; n < res.list.length; n++) {
698
+        res.list[n].select = true
699
+      }
668
       this.cardList = res.list
700
       this.cardList = res.list
669
     })
701
     })
670
     this.GetCouponList({ // 获取券列表
702
     this.GetCouponList({ // 获取券列表
671
       page: 1,
703
       page: 1,
672
       pagesize: 100000,
704
       pagesize: 100000,
673
       sendtype: 'system',
705
       sendtype: 'system',
674
-      usetype: 'luckdraw'
706
+      usetype: 'luckdraw',
707
+      usedid: this.$route.query.id || '',
708
+      caseid: this.CaseId,
675
     }).then((res) => {
709
     }).then((res) => {
710
+      res.list = res.list || []
711
+      for (var n = 0; n < res.list.length; n++) {
712
+        res.list[n].select = true
713
+      }
676
       this.couponList = res.list
714
       this.couponList = res.list
677
     })
715
     })
678
     this.getDrawTemplateList().then((res) => { // 获取活动模板列表
716
     this.getDrawTemplateList().then((res) => { // 获取活动模板列表
704
             if (this.postData.Prizes[a].ValidDays === 0) {
742
             if (this.postData.Prizes[a].ValidDays === 0) {
705
               this.postData.Prizes[a].ValidDays = ''
743
               this.postData.Prizes[a].ValidDays = ''
706
             }
744
             }
745
+            this.postData.Prizes[a].Defaults = this.postData.Prizes[a].Defaults || []
707
           }
746
           }
708
         })
747
         })
709
       }
748
       }
722
     ...mapCouponActions([
761
     ...mapCouponActions([
723
       'GetCouponList',
762
       'GetCouponList',
724
     ]),
763
     ]),
764
+    selectCase () {
765
+      this.GetCardList({ // 获取卡列表
766
+        page: 1,
767
+        pagesize: 100000,
768
+        sendtype: 'system',
769
+        usetype: 'luckdraw',
770
+        usedid: this.$route.query.id || '',
771
+        caseid: this.CaseId,
772
+      }).then((res) => {
773
+        res.list = res.list || []
774
+        for (var n = 0; n < res.list.length; n++) {
775
+          res.list[n].select = true
776
+        }
777
+        this.cardList = res.list
778
+      })
779
+      this.GetCouponList({ // 获取券列表
780
+        page: 1,
781
+        pagesize: 100000,
782
+        sendtype: 'system',
783
+        usetype: 'luckdraw',
784
+        usedid: this.$route.query.id || '',
785
+        caseid: this.CaseId,
786
+      }).then((res) => {
787
+        res.list = res.list || []
788
+        for (var n = 0; n < res.list.length; n++) {
789
+          res.list[n].select = true
790
+        }
791
+        this.couponList = res.list
792
+      })
793
+    },
725
     checkPhone (val) {
794
     checkPhone (val) {
726
-      return !!(/^1[34578]\d{9}$/.test(val))
795
+      return !!(/^1[345789]\d{9}$/.test(val))
727
     },
796
     },
728
     cardChange () {
797
     cardChange () {
729
       for (var n = 0; n < this.cardList.length; n++) {
798
       for (var n = 0; n < this.cardList.length; n++) {
848
       this.$router.push({ name: 'listOfLotteryActivities' })
917
       this.$router.push({ name: 'listOfLotteryActivities' })
849
     },
918
     },
850
     submitLuckdrawData () { // 提交活动信息
919
     submitLuckdrawData () { // 提交活动信息
920
+      if (this.postData.CaseId === '' && this.defaultCaseId !== '') {
921
+        this.postData.CaseId = this.defaultCaseId
922
+      }
851
       if (!this.checkData()) {
923
       if (!this.checkData()) {
852
         return false
924
         return false
853
       }
925
       }
861
           }
933
           }
862
         }
934
         }
863
         for (var a = 0; a < this.postData.Prizes.length; a++) {
935
         for (var a = 0; a < this.postData.Prizes.length; a++) {
936
+          this.postData.Prizes[a].Remainder = 0
937
+          this.postData.Prizes[a].Status = 1
864
           if (this.postData.Prizes[a].IsReality) {
938
           if (this.postData.Prizes[a].IsReality) {
865
-            if (this.postData.Prizes[a].VerificationStart === '') {
939
+            if (this.postData.Prizes[a].ValidDays === '') {
940
+              delete this.postData.Prizes[a].ValidDays
941
+            }
942
+            if (this.postData.Prizes[a].VerificationStart === '' || this.postData.Prizes[a].VerificationEnd === '') {
866
               delete this.postData.Prizes[a].VerificationStart
943
               delete this.postData.Prizes[a].VerificationStart
867
               delete this.postData.Prizes[a].VerificationEnd
944
               delete this.postData.Prizes[a].VerificationEnd
868
               this.postData.Prizes[a].ValidDays = this.postData.Prizes[a].ValidDays - 0
945
               this.postData.Prizes[a].ValidDays = this.postData.Prizes[a].ValidDays - 0
869
-            } else {
870
-              delete this.postData.Prizes[a].ValidDays
871
             }
946
             }
872
           } else {
947
           } else {
873
             delete this.postData.Prizes[a].VerificationStart
948
             delete this.postData.Prizes[a].VerificationStart
908
       this.addPhoneTableData.splice(index, 1)
983
       this.addPhoneTableData.splice(index, 1)
909
       this.postData.Prizes[this.editPrizePhoneIndex].Defaults.splice(index, 1)
984
       this.postData.Prizes[this.editPrizePhoneIndex].Defaults.splice(index, 1)
910
     },
985
     },
986
+    findSamePhone (num) { // 验重手机号
987
+      for (var n = 0; n < this.addPhoneTableData.length; n++) {
988
+        if (this.addPhoneTableData[n].Tel === num) {
989
+          return false
990
+        }
991
+      }
992
+      return true
993
+    },
911
     addPhoneInPrize () { // 添加内定奖品手机号
994
     addPhoneInPrize () { // 添加内定奖品手机号
912
-      if (this.checkPhone(this.addPhoneNum) && this.addPhoneNum !== '') {
995
+      if (this.checkPhone(this.addPhoneNum) && this.addPhoneNum !== '' && this.findSamePhone(this.addPhoneNum)) {
913
         this.addPhoneTableData.push({
996
         this.addPhoneTableData.push({
914
           Tel: this.addPhoneNum,
997
           Tel: this.addPhoneNum,
915
         })
998
         })
917
           Tel: this.addPhoneNum,
1000
           Tel: this.addPhoneNum,
918
         })
1001
         })
919
         this.addPhoneNum = ''
1002
         this.addPhoneNum = ''
1003
+      } else if (!this.findSamePhone(this.addPhoneNum)) {
1004
+        this.$message({
1005
+          type: 'error',
1006
+          message: '请勿填写重复手机号'
1007
+        })
920
       } else {
1008
       } else {
921
         this.$message({
1009
         this.$message({
922
           type: 'error',
1010
           type: 'error',
941
         cancelButtonText: '取消',
1029
         cancelButtonText: '取消',
942
         type: 'warning'
1030
         type: 'warning'
943
       }).then(() => {
1031
       }).then(() => {
1032
+        if (this.postData.Prizes[index].CouponCardType === 'card') {
1033
+          for (var n = 0; n < this.cardList.length; n++) {
1034
+            if (this.cardList[n].CardId === this.postData.Prizes[index].CouponCardId) {
1035
+              this.cardList[n].select = true
1036
+            }
1037
+          }
1038
+        } else {
1039
+          for (var a = 0; a < this.couponList.length; a++) {
1040
+            if (this.couponList[a].CouponId === this.postData.Prizes[index].CouponCardId) {
1041
+              this.couponList[a].select = true
1042
+            }
1043
+          }
1044
+        }
944
         this.postData.Prizes.splice(index, 1)
1045
         this.postData.Prizes.splice(index, 1)
945
         this.$message({
1046
         this.$message({
946
           type: 'success',
1047
           type: 'success',
1002
           for (var n = 0; n < this.cardList.length; n++) {
1103
           for (var n = 0; n < this.cardList.length; n++) {
1003
             if (this.cardList[n].CardId === this.addPrizeInfo.CouponCardId) {
1104
             if (this.cardList[n].CardId === this.addPrizeInfo.CouponCardId) {
1004
               this.addPrizeInfo.PrizeName = this.cardList[n].CardName
1105
               this.addPrizeInfo.PrizeName = this.cardList[n].CardName
1106
+              this.cardList[n].select = false
1005
             }
1107
             }
1006
           }
1108
           }
1007
         } else {
1109
         } else {
1008
           for (var a = 0; a < this.couponList.length; a++) {
1110
           for (var a = 0; a < this.couponList.length; a++) {
1009
             if (this.couponList[a].CouponId === this.addPrizeInfo.CouponCardId) {
1111
             if (this.couponList[a].CouponId === this.addPrizeInfo.CouponCardId) {
1010
               this.addPrizeInfo.PrizeName = this.couponList[a].CouponName
1112
               this.addPrizeInfo.PrizeName = this.couponList[a].CouponName
1113
+              this.couponList[a].select = false
1011
             }
1114
             }
1012
           }
1115
           }
1013
         }
1116
         }
1014
       } else if (this.addPrizeInfo.PrizeType === 'third') { // 第三方
1117
       } else if (this.addPrizeInfo.PrizeType === 'third') { // 第三方
1015
-        if (this.addPrizeInfo.PrizeName === '' && this.addPrizeInfo.IsReality) {
1118
+        if (this.addPrizeInfo.PrizeName === '') {
1016
           this.$message({
1119
           this.$message({
1017
             type: 'error',
1120
             type: 'error',
1018
             message: '奖品名称不能为空'
1121
             message: '奖品名称不能为空'
1034
           return false
1137
           return false
1035
         }
1138
         }
1036
         if (this.verificationType === 1 && this.addPrizeInfo.IsReality) {
1139
         if (this.verificationType === 1 && this.addPrizeInfo.IsReality) {
1037
-          if (this.addPrizeInfo.ValidDays === '' || (this.addPrizeInfo.ValidDays - 0) % 1 !== 0 || (this.addPrizeInfo.ValidDays - 0) <= 0) {
1140
+          if (!this.addPrizeInfo.ValidDays || (this.addPrizeInfo.ValidDays - 0) % 1 !== 0 || (this.addPrizeInfo.ValidDays - 0) <= 0) {
1038
             this.$message({
1141
             this.$message({
1039
               type: 'error',
1142
               type: 'error',
1040
               message: '有效期须为大于0正整数'
1143
               message: '有效期须为大于0正整数'
1058
             })
1161
             })
1059
             return false
1162
             return false
1060
           }
1163
           }
1164
+          if (new Date(this.addPrizeInfo.VerificationStart).getTime() > new Date(this.addPrizeInfo.VerificationEnd).getTime()) {
1165
+            this.$message({
1166
+              type: 'error',
1167
+              message: '有效期开始时间不能大于截止时间'
1168
+            })
1169
+            return false
1170
+          }
1061
           this.addPrizeInfo.ValidDays = ''
1171
           this.addPrizeInfo.ValidDays = ''
1062
         }
1172
         }
1063
         if (this.addPrizeInfo.PrizeImg === '') {
1173
         if (this.addPrizeInfo.PrizeImg === '') {
1114
       if (!this.isread) {
1224
       if (!this.isread) {
1115
         item.currentImg = ''
1225
         item.currentImg = ''
1116
         if (this.templateActiveIndex === index) this.postData.Imgs = []
1226
         if (this.templateActiveIndex === index) this.postData.Imgs = []
1227
+        this.$refs['templateImg' + index][0].value = ''
1117
       }
1228
       }
1118
     },
1229
     },
1119
     addPrize () { // 新增奖品
1230
     addPrize () { // 新增奖品
1159
     border: 1px solid #eee;
1270
     border: 1px solid #eee;
1160
     border-bottom: none;
1271
     border-bottom: none;
1161
   }
1272
   }
1273
+  .currentImg:hover{
1274
+    cursor: pointer;
1275
+  }
1162
 }
1276
 }
1163
 </style>
1277
 </style>

+ 1
- 1
src/pages/system/marketingActivities/listOfLotteryActivities/page.scss View File

2
   .img{
2
   .img{
3
     width: 300px;
3
     width: 300px;
4
     position: relative;
4
     position: relative;
5
-    overflow: hidden;
5
+    overflow: auto;
6
     margin: 20px;
6
     margin: 20px;
7
     margin-right: 0;
7
     margin-right: 0;
8
     img{
8
     img{

+ 39
- 5
src/pages/system/marketingActivities/snapUpList/edit.vue View File

67
                   <div>
67
                   <div>
68
                     <el-date-picker
68
                     <el-date-picker
69
                       :disabled="editOff || isread"
69
                       :disabled="editOff || isread"
70
-                      value-format="yyyy-MM-ddT00:00:00+08:00"
70
+                      value-format="yyyy-MM-ddTHH:mm:ss+08:00"
71
                       v-model="postData.StartDate"
71
                       v-model="postData.StartDate"
72
-                      type="date"
72
+                      type="datetime"
73
                       placeholder="选择开始日期">
73
                       placeholder="选择开始日期">
74
                     </el-date-picker>
74
                     </el-date-picker>
75
                     <span>至</span>
75
                     <span>至</span>
76
                     <el-date-picker
76
                     <el-date-picker
77
                       :disabled="editOff || isread"
77
                       :disabled="editOff || isread"
78
-                      value-format="yyyy-MM-ddT23:59:59+08:00"
78
+                      value-format="yyyy-MM-ddTHH:mm:ss+08:00"
79
                       v-model="postData.EndDate"
79
                       v-model="postData.EndDate"
80
-                      type="date"
80
+                      type="datetime"
81
                       placeholder="选择截止日期">
81
                       placeholder="选择截止日期">
82
                     </el-date-picker>
82
                     </el-date-picker>
83
                   </div>
83
                   </div>
162
 </template>
162
 </template>
163
 <script>
163
 <script>
164
 import { quillEditor } from 'vue-quill-editor'
164
 import { quillEditor } from 'vue-quill-editor'
165
+import uploadImage from 'quill-plugin-image'
165
 import { mapState, createNamespacedHelpers } from 'vuex'
166
 import { mapState, createNamespacedHelpers } from 'vuex'
166
 const { mapActions: mapActivityFlashbuyActions } = createNamespacedHelpers('activityFlashbuy')
167
 const { mapActions: mapActivityFlashbuyActions } = createNamespacedHelpers('activityFlashbuy')
167
 export default {
168
 export default {
207
       }
208
       }
208
     }
209
     }
209
   },
210
   },
211
+  mounted () {
212
+    uploadImage(this.$refs.myQuillEditor.quill, file => {
213
+      return this.toolClass.upload({ file }).then(data => {
214
+        const url = data.result.url
215
+        return { src: url, alt: '' }
216
+      })
217
+    })
218
+  },
210
   created () {
219
   created () {
211
     if (this.$route.query.isread) {
220
     if (this.$route.query.isread) {
212
       this.isread = true
221
       this.isread = true
248
       'editFlashbuy',
257
       'editFlashbuy',
249
     ]),
258
     ]),
250
     submitFlashbuy () { // 提交抢购数据
259
     submitFlashbuy () { // 提交抢购数据
260
+      if (this.postData.CaseId === '' && this.defaultCaseId !== '') {
261
+        this.postData.CaseId = this.defaultCaseId
262
+      }
251
       if (!this.checkData()) {
263
       if (!this.checkData()) {
252
         return false
264
         return false
253
       }
265
       }
272
       }
284
       }
273
     },
285
     },
274
     checkData () { // 校验数据格式
286
     checkData () { // 校验数据格式
287
+      // console.log(this.postData.FlashBuyName)
275
       if (this.postData.CaseId === '') {
288
       if (this.postData.CaseId === '') {
276
         this.$message({
289
         this.$message({
277
           type: 'error',
290
           type: 'error',
282
       if (this.postData.FlashBuyName === '') {
295
       if (this.postData.FlashBuyName === '') {
283
         this.$message({
296
         this.$message({
284
           type: 'error',
297
           type: 'error',
285
-          message: '活动说明不能为空'
298
+          message: '活动名称不能为空'
286
         })
299
         })
287
         return false
300
         return false
288
       }
301
       }
307
         })
320
         })
308
         return false
321
         return false
309
       }
322
       }
323
+      if (new Date(this.postData.StartDate).getTime() > new Date(this.postData.EndDate).getTime()) {
324
+        this.$message({
325
+          type: 'error',
326
+          message: '活动开始时间不能大于截止时间'
327
+        })
328
+        return false
329
+      }
330
+      if (this.postData.FlashBuyInfo === '') {
331
+        this.$message({
332
+          type: 'error',
333
+          message: '活动说明不能为空'
334
+        })
335
+        return false
336
+      }
310
       if (this.postData.ValidateType === 'days') {
337
       if (this.postData.ValidateType === 'days') {
311
         if (this.postData.ValidateDays - 0 <= 0 || (this.postData.ValidateDays - 0) % 1 !== 0) {
338
         if (this.postData.ValidateDays - 0 <= 0 || (this.postData.ValidateDays - 0) % 1 !== 0) {
312
           this.$message({
339
           this.$message({
333
           })
360
           })
334
           return false
361
           return false
335
         }
362
         }
363
+        if (new Date(this.postData.ValidateStart).getTime() > new Date(this.postData.ValidateEnd).getTime()) {
364
+          this.$message({
365
+            type: 'error',
366
+            message: '有效期开始时间不能大于截止时间'
367
+          })
368
+          return false
369
+        }
336
         delete this.postData.ValidateDays
370
         delete this.postData.ValidateDays
337
       }
371
       }
338
       return true
372
       return true

+ 1
- 1
src/pages/system/marketingActivities/snapUpList/index.vue View File

169
             prop="VerifyStatus"
169
             prop="VerifyStatus"
170
             label="核销状态">
170
             label="核销状态">
171
             <template slot-scope="scope">
171
             <template slot-scope="scope">
172
-              {{scope.row.Status === 'useable' ? '未核销' : '已核销'}}
172
+              {{scope.row.VerifyStatus === 'useable' ? '未核销' : '已核销'}}
173
             </template>
173
             </template>
174
           </el-table-column>
174
           </el-table-column>
175
         </el-table>
175
         </el-table>

+ 1
- 1
src/pages/system/marketingActivities/snapUpList/page.scss View File

2
   .img{
2
   .img{
3
     width: 300px;
3
     width: 300px;
4
     position: relative;
4
     position: relative;
5
-    overflow: hidden;
5
+    overflow: auto;
6
     margin: 20px;
6
     margin: 20px;
7
     margin-right: 0;
7
     margin-right: 0;
8
     img{
8
     img{

+ 94
- 138
src/pages/system/newOrder/newOrderList/index.vue View File

25
       <div class="moreFilter"></div>
25
       <div class="moreFilter"></div>
26
     </div>
26
     </div>
27
     <div class="order-list-box">
27
     <div class="order-list-box">
28
-      <div style='position:relative;' v-for="(item,index) in list" :key="index">
28
+      <div style='position:relative;' v-for="(item,index) in ordersList" :key="index">
29
         <div>
29
         <div>
30
           <div style="padding:25px 20px 5px;border-bottom:2px solid #cccccc;display:flex;align-items: center;">
30
           <div style="padding:25px 20px 5px;border-bottom:2px solid #cccccc;display:flex;align-items: center;">
31
             <!-- <i class="iconfont icon-yinchenglogo" style="font-size:70px;color:red;position: relative;bottom: 20px;margin-right:10px;"></i> -->
31
             <!-- <i class="iconfont icon-yinchenglogo" style="font-size:70px;color:red;position: relative;bottom: 20px;margin-right:10px;"></i> -->
44
             </div>
44
             </div>
45
           </div>
45
           </div>
46
           <div style="padding:10px 20px;border-bottom:1px solid #cccccc;white-space: normal;">备注:{{item.Remark}}</div>
46
           <div style="padding:10px 20px;border-bottom:1px solid #cccccc;white-space: normal;">备注:{{item.Remark}}</div>
47
-          <div style="padding:10px 20px;" @click="printPdf(`item${index}`)">下单人:{{item.UserName}}</div>
48
-        </div>
49
-        <div class="print-area" :class="'item_' + item.OrdersId" style="width:180px;">
50
-          <div style="padding:0px 10px 5px;border-bottom:2px solid #cccccc;">
51
-            <div style="display:inline-block;">
52
-              <img class="topIcon" style="display:block;width:60%;margin:0 0 20px 0px;" src="http://jingcheng-resourceplat.oss-cn-shanghai.aliyuncs.com/upload/111101940020.png" alt="">
53
-              <span style="display:block;font-size:20px;font-weight:700;text-align: center;"> <img width='30px' :src='item.AreaIconWhite' alt=""> {{item.AreaName + item.TableNo}}</span>
54
-            </div>
55
-          </div>
56
-          <div style="padding:10px 10px 5px;border-bottom:1px solid #cccccc;" v-for='(item1,index1) in item.Goods' :key='index1'>
57
-            <div style="font-size:12px;"><span style="display:inline-block;width:75%;text-align:left;">{{item1.GoodsName}}</span><span style="display:inline-block;width:22%;text-align:right;font-size:12px;" v-if='!item1.SpecName'>× {{item1.Number}}</span></div>
58
-            <div style="margin-top:8px;" v-if='item1.SpecName'>
59
-              <span style="display:inline-block;width:75%;text-align:left;color:#cccccc;font-size:12px;">{{item1.SpecName}}</span>
60
-              <span style="display:inline-block;width:20%;text-align:right;font-size:12px;">× {{item1.Number}}</span>
61
-            </div>
62
-          </div>
63
-          <div style="padding:10px 10px 5px;border-bottom:1px solid #cccccc;">
64
-            <div style="font-size:12px;">下单人:{{item.UserName}}</div>
65
-            <span style="display:block;margin-top:10px;font-size:12px;">下单时间:{{toolClass.dateFormat(item.CreateDate)}}</span>
66
-          </div>
67
-          <div style="padding:10px 10px;font-size:12px;">备注:{{item.Remark}}</div>
68
-          <div style="text-align: right;font-size: 12px;">城的空间.城咖啡</div>
69
-          <div style="height:10px"></div>
47
+          <div style="padding:10px 20px;">下单人:{{item.UserName}}</div>
70
         </div>
48
         </div>
49
+        <print-list :print-list="printList" :lodop="lodop" @printed="clearPrintList" />
71
         <div class="btns">
50
         <div class="btns">
72
           <span @click="cancel(item.OrdersId,index)">取消</span>
51
           <span @click="cancel(item.OrdersId,index)">取消</span>
73
           <span @click="submit(item.OrdersId,index)">确定</span>
52
           <span @click="submit(item.OrdersId,index)">确定</span>
82
 import { getLodop } from '@/util/LodopFuncs'
61
 import { getLodop } from '@/util/LodopFuncs'
83
 import { formatTimeBySeconds } from '@/util/util'
62
 import { formatTimeBySeconds } from '@/util/util'
84
 import { replaceURLParams } from '@/util/ajax'
63
 import { replaceURLParams } from '@/util/ajax'
64
+import XWebSocket from '@/util/websocket'
85
 
65
 
86
 // const WebSocket = require('ws')
66
 // const WebSocket = require('ws')
87
 const { mapState: mapOrderState, mapActions: mapOrderActions } = createNamespacedHelpers('goodsorder')
67
 const { mapState: mapOrderState, mapActions: mapOrderActions } = createNamespacedHelpers('goodsorder')
88
 
68
 
89
-var LODOP
90
 export default {
69
 export default {
91
   name: '',
70
   name: '',
71
+  components: {
72
+    'print-list': () => import('./print'),
73
+  },
92
   data () {
74
   data () {
93
     return {
75
     return {
76
+      lodop: null,
77
+      ws: null,
78
+      wsID: '',
79
+      printList: [],
80
+
94
       total: 0,
81
       total: 0,
95
       postData: { // 表格搜索条件
82
       postData: { // 表格搜索条件
96
         phone: '', // 手机号
83
         phone: '', // 手机号
97
         page: 1, // 当前页码
84
         page: 1, // 当前页码
98
         pagesize: 10, // 请求数据量
85
         pagesize: 10, // 请求数据量
99
       },
86
       },
100
-      currentList: [],
101
       leftTimes: {},
87
       leftTimes: {},
102
       business: false,
88
       business: false,
103
       caseid: '',
89
       caseid: '',
108
   },
94
   },
109
   computed: {
95
   computed: {
110
     ...mapOrderState({
96
     ...mapOrderState({
111
-      list: x => (x.ordersList || {}).list || [],
112
-      businessStatus: x => x.businessStatus
97
+      ordersList: x => x.ordersList,
98
+    }),
99
+    ...mapOrderState({
100
+      businessStatus (state) {
101
+        if (!state.businessStatus) {
102
+          this.ws.close()
103
+        }
104
+
105
+        if (state.businessStatus && (this.wsID !== this.CaseId) && this.CaseId) {
106
+          this.ws.close()
107
+          this.initWebSocket()
108
+        }
109
+
110
+        this.wsID = this.CaseId
111
+
112
+        return state.businessStatus
113
+      }
113
     }),
114
     }),
114
     ...mapState({
115
     ...mapState({
115
       cases: x => x.app.cases.list,
116
       cases: x => x.app.cases.list,
123
       set (val) {
124
       set (val) {
124
         this.caseid = val
125
         this.caseid = val
125
       }
126
       }
126
-    }
127
+    },
127
   },
128
   },
128
   created () {
129
   created () {
130
+    this.lodop = getLodop()
131
+    this.lodop.PRINT_INIT('城咖啡订单')
132
+    this.lodop.SET_PRINT_PAGESIZE(3, 480, 40, '')
133
+
129
     this.updateSystemInfo().then(() => {
134
     this.updateSystemInfo().then(() => {
130
       console.log(this.CaseId)
135
       console.log(this.CaseId)
131
       if (this.CaseId) {
136
       if (this.CaseId) {
132
         this.init()
137
         this.init()
133
       }
138
       }
134
     })
139
     })
135
-  },
136
-  mounted () {
137
-    // setTimeout(window.location.reload, 600 * 1000)
138
-  },
139
-  beforeRouteLeave (to, from, next) {
140
-    // 导航离开该组件的对应路由时调用
141
-    // 可以访问组件实例 `this`
142
-    console.log(this.websockets)
143
-    this.needReload = false
144
-    Object.keys(this.websockets).forEach((key) => {
145
-      console.log(key, this.websockets[key])
146
-      this.websockets[key].close()
147
-      clearInterval(this.websockets[key].interval)
140
+
141
+    this.ws = new XWebSocket({
142
+      message: this.receviedNewOrders.bind(this),
143
+      delay: 10,
144
+      autoConnect: true,
148
     })
145
     })
149
-    this.websockets = {}
150
-    next()
146
+  },
147
+  beforeDestroyed () {
148
+    this.ws.close()
151
   },
149
   },
152
   methods: {
150
   methods: {
153
     init () {
151
     init () {
154
-      if (this.needReload) {
155
-        this.needReload = false
156
-        Object.keys(this.websockets).forEach((key) => {
157
-          // console.log(key, this.websockets[key])
158
-          this.websockets[key].close()
152
+      // 必须选案场
153
+      if (!this.CaseId) {
154
+        this.$message({
155
+          type: 'info',
156
+          message: '请先选择案场'
159
         })
157
         })
160
-        this.websockets = {}
161
-        // console.log('init')
162
-        var param = []
163
-        if (!this.CaseId) {
164
-          this.$message({
165
-            type: 'info',
166
-            message: '请先选择案场'
167
-          })
168
-          return
158
+        return
159
+      }
160
+
161
+      // 获取新单
162
+      this.GetOrdersList({ caseid: this.CaseId }).then(list => {
163
+        // 打印新单
164
+        if (list) {
165
+          this.printList = list.map(x => x.IsIntimidate === 0)
169
         }
166
         }
170
-        clearInterval(this.interval)
171
-        // console.log(this.CaseId)
172
-        this.GetOrdersList({ caseid: this.CaseId }).then((res) => {
173
-          for (var n = 0; n < (res.list || []).length; n++) {
174
-            if (res.list[n].IsIntimidate === 0) {
175
-              param.push(res.list[n].OrdersId)
176
-            }
177
-          }
178
-          var bool = true
179
-          var timer = setInterval(() => {
180
-            if (param.length && bool) {
181
-              bool = false
182
-              this.printPdf(`item_${param[0]}`)
183
-              this.putPrintGoodsOrder({
184
-                id: param[0]
185
-              }).then(() => {
186
-                param.splice(0, 1)
187
-                bool = true
188
-              })
189
-            } else {
190
-              this.needReload = true
191
-              clearInterval(timer)
192
-            }
193
-          }, 300)
194
-          this.getBusinessStatus(this.CaseId).then(() => {
195
-            if (this.businessStatus) {
196
-              this.initWebSocket()
197
-            }
198
-          })
167
+
168
+        // 开张, 则实时监控新单
169
+        this.getBusinessStatus(this.CaseId).then(() => {
170
+
199
         })
171
         })
172
+
173
+        // 页面倒计时
174
+        clearInterval(this.interval)
200
         this.refreshList()
175
         this.refreshList()
201
-      }
176
+      })
202
     },
177
     },
203
     refreshList () {
178
     refreshList () {
204
       this.interval = setInterval(() => {
179
       this.interval = setInterval(() => {
205
         const now = (new Date()).valueOf()
180
         const now = (new Date()).valueOf()
206
-        this.leftTimes = this.list.reduce((acc, it) => {
181
+        this.leftTimes = (this.ordersList || []).reduce((acc, it) => {
207
           const showDT = now - ((new Date(it.CreateDate)).valueOf())
182
           const showDT = now - ((new Date(it.CreateDate)).valueOf())
208
           return { ...acc, [`${it.OrdersId}`]: formatTimeBySeconds(showDT) }
183
           return { ...acc, [`${it.OrdersId}`]: formatTimeBySeconds(showDT) }
209
         }, {})
184
         }, {})
210
       }, 1000)
185
       }, 1000)
211
     },
186
     },
187
+    clearPrintList () {
188
+      this.printList = []
189
+    },
212
     timeOut (c) {
190
     timeOut (c) {
213
       let cTime = new Date(c).valueOf()
191
       let cTime = new Date(c).valueOf()
214
       let time = new Date().valueOf()
192
       let time = new Date().valueOf()
243
             type: 'success',
221
             type: 'success',
244
             message: '确认订单成功'
222
             message: '确认订单成功'
245
           })
223
           })
246
-          this.list.splice(index, 1)
247
-          this.updateList({ list: this.list })
224
+
225
+          this.updateList({ list: this.ordersList.filter(x => x.OrdersId !== id) })
248
         })
226
         })
249
       }).catch((res) => {
227
       }).catch((res) => {
250
         this.$message({
228
         this.$message({
264
             type: 'success',
242
             type: 'success',
265
             message: '取消订单成功'
243
             message: '取消订单成功'
266
           })
244
           })
267
-          this.list.splice(index, 1)
268
-          this.updateList({ list: this.list })
245
+
246
+          this.updateList({ list: this.ordersList.filter(x => x.OrdersId !== id) })
269
         })
247
         })
270
       }).catch((res) => {
248
       }).catch((res) => {
271
         this.$message({
249
         this.$message({
274
         })
252
         })
275
       })
253
       })
276
     },
254
     },
277
-    printPdf (cl) {
278
-      this.CreateOneFormPage(cl)
279
-      LODOP.PRINT()
280
-    },
281
-    CreateOneFormPage (cl) {
282
-      LODOP = getLodop()
283
-      LODOP.PRINT_INIT('订单')
284
-      LODOP.SET_PRINT_PAGESIZE(3, 480, 40, '')
285
-      LODOP.ADD_PRINT_HTM(0, 0, document.getElementsByClassName(cl)[0].offsetWidth, document.getElementsByClassName(cl)[0].offsetHeight, document.getElementsByClassName(cl)[0].innerHTML)
286
-    },
287
     initWebSocket () {
255
     initWebSocket () {
288
       console.log('initWebSocket')
256
       console.log('initWebSocket')
289
-      // console.log(this.user)
290
       let caseid = this.CaseId
257
       let caseid = this.CaseId
291
       let id = this.userInfo.UserId
258
       let id = this.userInfo.UserId
292
       const wsPath = this.$api.system.notify.newGoodsOrders.url
259
       const wsPath = this.$api.system.notify.newGoodsOrders.url
293
       const wsRealPath = replaceURLParams(wsPath, { grps: caseid, id })
260
       const wsRealPath = replaceURLParams(wsPath, { grps: caseid, id })
294
-      this.newWebsocket(wsRealPath)
261
+      const wsURL = `${window.location.origin.replace('http', 'ws')}${wsRealPath}?token=${localStorage.getItem('JWT')}`
262
+      this.ws.connect(wsURL)
295
     },
263
     },
296
-    websocketonmessage (e) {
297
-      // let oldList = this.list
298
-      let newList = JSON.parse(e.data).data.refreshOnlineGoodsOrders
299
-      // let newinfo = newList.filter(x => this.list.filter(item => item.OrdersId === x.OrdersId).length === 0)
300
-      this.updateList({ list: this.list.concat(newList) }).then(() => {
301
-        newList.forEach((it) => {
302
-          // console.log('it:', it)
303
-          this.printPdf(`item_${it.OrdersId}`)
304
-          this.putPrintGoodsOrder({
305
-            id: it.OrdersId
306
-          })
264
+    receviedNewOrders (e) {
265
+      const newOrders = JSON.parse(e.data).data.refreshOnlineGoodsOrders
266
+      if (!newOrders || !newOrders.length) return
267
+
268
+      // 放入待制作队列
269
+      this.updateList({ list: this.list.concat(newOrders) })
270
+
271
+      // 放入待打队列
272
+      const ps = newOrders.filter(x => x.IsIntimidate === 0).map((orders) => {
273
+        return new Promise((resolve, reject) => {
274
+          if (orders.IsIntimidate === 0) {
275
+            // 先远程更新掉打单状态字段
276
+            this.putPrintGoodsOrder({id: orders.OrdersId}).then(() => {
277
+              resolve(orders)
278
+            })
279
+          } else {
280
+            resolve()
281
+          }
307
         })
282
         })
308
       })
283
       })
309
-    },
310
-    newWebsocket (wsRealPath) {
311
-      const ws = this.websockets[wsRealPath]
312
-      if (!ws) {
313
-        const url = `${window.location.origin.replace('http', 'ws')}${wsRealPath}?token=${localStorage.getItem('JWT')}`
314
-        this.websockets[wsRealPath] = new WebSocket(url)
315
-        this.websockets[wsRealPath].onopen = console.log
316
-        this.websockets[wsRealPath].onmessage = this.websocketonmessage
317
-        this.websockets[wsRealPath].onclose = this.reloadWebSocket
318
-        this.websockets[wsRealPath].onerror = this.reloadWebSocket
319
-        this.websockets[wsRealPath].interval = setInterval(() => this.websockets[wsRealPath].send(10), 120000)
320
-      }
321
-    },
322
-    reloadWebSocket (e) {
323
-      console.log(e.currentTarget.url)
324
-      Object.keys(this.websockets).forEach((key) => {
325
-        clearInterval(this.websockets[key].interval)
326
-      })
327
-      if (this.needReload) { // 此变量判断是否需要重连
328
-        this.websockets = {}
329
-        this.initWebSocket()
330
-      }
284
+
285
+      Promise.all(ps).then((its = []) => this.printList.concat(its.filter(x => x)))
331
     },
286
     },
332
     open () {
287
     open () {
333
       if (!this.CaseId) {
288
       if (!this.CaseId) {
349
         })
304
         })
350
         return
305
         return
351
       }
306
       }
307
+      this.ws.close()
352
       this.closeBusiness(this.CaseId)
308
       this.closeBusiness(this.CaseId)
353
     }
309
     }
354
   }
310
   }

+ 60
- 0
src/pages/system/newOrder/newOrderList/print.vue View File

1
+<template>
2
+  <div>
3
+    <div refs="printPages" v-for="(item, inx) in printList" :key="inx" class="print-area" :class="'item_' + item.OrdersId" style="width:180px;">
4
+      <div style="padding:0px 10px 5px;border-bottom:2px solid #cccccc;">
5
+        <div style="display:inline-block;">
6
+          <img class="topIcon" style="display:block;width:60%;margin:0 0 20px 0px;" src="http://jingcheng-resourceplat.oss-cn-shanghai.aliyuncs.com/upload/111101940020.png" alt="">
7
+          <span style="display:block;font-size:20px;font-weight:700;text-align: center;"> <img width='30px' :src='item.AreaIconWhite' alt=""> {{item.AreaName + item.TableNo}}</span>
8
+        </div>
9
+      </div>
10
+      <div style="padding:10px 10px 5px;border-bottom:1px solid #cccccc;" v-for='(item1,index1) in item.Goods' :key='index1'>
11
+        <div style="font-size:12px;"><span style="display:inline-block;width:75%;text-align:left;">{{item1.GoodsName}}</span><span style="display:inline-block;width:22%;text-align:right;font-size:12px;" v-if='!item1.SpecName'>× {{item1.Number}}</span></div>
12
+        <div style="margin-top:8px;" v-if='item1.SpecName'>
13
+          <span style="display:inline-block;width:75%;text-align:left;color:#cccccc;font-size:12px;">{{item1.SpecName}}</span>
14
+          <span style="display:inline-block;width:20%;text-align:right;font-size:12px;">× {{item1.Number}}</span>
15
+        </div>
16
+      </div>
17
+      <div style="padding:10px 10px 5px;border-bottom:1px solid #cccccc;">
18
+        <div style="font-size:12px;">下单人:{{item.UserName}}</div>
19
+        <span style="display:block;margin-top:10px;font-size:12px;">下单时间:{{toolClass.dateFormat(item.CreateDate)}}</span>
20
+      </div>
21
+      <div style="padding:10px 10px;font-size:12px;">备注:{{item.Remark}}</div>
22
+      <div style="text-align: right;font-size: 12px;">城的空间.城咖啡</div>
23
+      <div style="height:10px"></div>
24
+    </div>
25
+  </div>
26
+</template>
27
+
28
+<script>
29
+export default {
30
+  name: 'orderPrintList',
31
+  props: [
32
+    'lodop',
33
+    'printList',
34
+  ],
35
+  data () {
36
+    return {}
37
+  },
38
+  updated () {
39
+    this.print()
40
+  },
41
+  methods: {
42
+    print () {
43
+      if (this.$refs.printPages && this.$refs.printPages.length > 0) {
44
+        this.$refs.printPages.forEach(($el) => {
45
+          this.lodop.ADD_PRINT_HTM(0, 0, $el.offsetWidth, $el.offsetHeight, $el.innerHTML)
46
+        })
47
+
48
+        this.lodop.PRINT()
49
+
50
+        this.$emit('printed')
51
+      }
52
+    }
53
+  }
54
+}
55
+</script>
56
+
57
+<!-- Add "scoped" attribute to limit CSS to this component only -->
58
+<style lang="scss" scoped>
59
+@import "page.scss";
60
+</style>

+ 1
- 1
src/pages/system/systemSet/userManager/add.vue View File

233
         })
233
         })
234
         return false
234
         return false
235
       }
235
       }
236
-      var myreg = /^[1][3,4,5,6,7,8][0-9]{9}$/
236
+      var myreg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/
237
       if (!myreg.test(this.postData.Phone)) {
237
       if (!myreg.test(this.postData.Phone)) {
238
         this.$message({
238
         this.$message({
239
           type: 'error',
239
           type: 'error',

+ 1
- 1
src/pages/system/systemSet/userManager/edit.vue View File

258
         })
258
         })
259
         return false
259
         return false
260
       }
260
       }
261
-      var myreg = /^[1][3,4,5,6,7,8][0-9]{9}$/
261
+      var myreg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/
262
       if (!myreg.test(this.postData.Phone)) {
262
       if (!myreg.test(this.postData.Phone)) {
263
         this.$message({
263
         this.$message({
264
           type: 'error',
264
           type: 'error',

+ 6
- 0
src/pages/system/systemSet/userManager/index.vue View File

57
         :data="currentList"
57
         :data="currentList"
58
         stripe
58
         stripe
59
         style="width: 100%">
59
         style="width: 100%">
60
+        <el-table-column
61
+          fixed
62
+          prop="CaseName"
63
+          label="案场"
64
+          width="150">
65
+        </el-table-column>
60
         <el-table-column
66
         <el-table-column
61
           fixed
67
           fixed
62
           prop="UserName"
68
           prop="UserName"

+ 12
- 2
src/pages/system/verificationManager/drawVerification/verificationList/index.vue View File

60
                     type="success"
60
                     type="success"
61
                     v-if="scope.row.Status === 0"
61
                     v-if="scope.row.Status === 0"
62
                     @click="check(scope.row)">核销</el-button>
62
                     @click="check(scope.row)">核销</el-button>
63
-                  <span v-else>已核销</span>
63
+                  <span v-else>-</span>
64
                 </template>
64
                 </template>
65
               </el-table-column>
65
               </el-table-column>
66
             </el-table>
66
             </el-table>
117
             type: 'success',
117
             type: 'success',
118
             message: '操作成功!'
118
             message: '操作成功!'
119
           })
119
           })
120
-          this.$router.push({ name: 'drawVerification' })
120
+          this.drawVerifyList({
121
+            id: this.$route.query.code
122
+          }).then((res) => {
123
+            // console.log(JSON.stringify(res))
124
+            if (res !== null) {
125
+              this.info = []
126
+              this.info.push(res)
127
+            }
128
+            this.ajaxOff = true
129
+          })
130
+          // this.$router.push({ name: 'drawVerification' })
121
         })
131
         })
122
       })
132
       })
123
     },
133
     },

+ 12
- 1
src/pages/system/verificationManager/flashbuyVerification/verificationList/index.vue View File

110
             type: 'success',
110
             type: 'success',
111
             message: '操作成功!'
111
             message: '操作成功!'
112
           })
112
           })
113
-          this.$router.push({ name: 'flashbuyVerification' })
113
+          this.flashbuyVerifyList({
114
+            code: this.$route.query.code,
115
+            caseid: this.$route.query.caseid
116
+          }).then((res) => {
117
+            // console.log(JSON.stringify(res))
118
+            if (res !== null) {
119
+              this.info = []
120
+              this.info.push(res)
121
+            }
122
+            this.ajaxOff = true
123
+          })
124
+          // this.$router.push({ name: 'flashbuyVerification' })
114
         })
125
         })
115
       })
126
       })
116
     },
127
     },

+ 15
- 13
src/store/goods/order.js View File

22
   },
22
   },
23
   actions: {
23
   actions: {
24
     putPrintGoodsOrder ({ commit }, payload) {
24
     putPrintGoodsOrder ({ commit }, payload) {
25
-      return new Promise((resolve) => {
25
+      return new Promise(resolve => {
26
         ajax(api.goodsOrder.putPrintGoodsOrder.url, {
26
         ajax(api.goodsOrder.putPrintGoodsOrder.url, {
27
           method: api.goodsOrder.putPrintGoodsOrder.method,
27
           method: api.goodsOrder.putPrintGoodsOrder.method,
28
           urlData: {
28
           urlData: {
29
-            ...payload,
29
+            ...payload
30
           }
30
           }
31
         }).then(res => {
31
         }).then(res => {
32
           resolve(res)
32
           resolve(res)
34
       })
34
       })
35
     },
35
     },
36
     GetOrdersList ({ commit }, payload) {
36
     GetOrdersList ({ commit }, payload) {
37
-      return new Promise((resolve) => {
37
+      return new Promise(resolve => {
38
         ajax(api.goodsOrder.getOnlineOrder.url, {
38
         ajax(api.goodsOrder.getOnlineOrder.url, {
39
           method: api.goodsOrder.getOnlineOrder.method,
39
           method: api.goodsOrder.getOnlineOrder.method,
40
           queryData: {
40
           queryData: {
41
-            ...payload,
41
+            ...payload
42
           }
42
           }
43
         }).then(res => {
43
         }).then(res => {
44
-          commit('updateList', res)
45
-          resolve(res)
44
+          const list = (res || {}).list || []
45
+
46
+          commit('updateList', list)
47
+          resolve(list)
46
         })
48
         })
47
       })
49
       })
48
     },
50
     },
60
       })
62
       })
61
     },
63
     },
62
     updateList ({ commit }, data) {
64
     updateList ({ commit }, data) {
63
-      return new Promise((resolve) => {
65
+      return new Promise(resolve => {
64
         commit('updateList', data)
66
         commit('updateList', data)
65
         resolve(data)
67
         resolve(data)
66
       })
68
       })
67
     },
69
     },
68
     openBusiness ({ commit }, caseid) {
70
     openBusiness ({ commit }, caseid) {
69
-      return new Promise((resolve) => {
71
+      return new Promise(resolve => {
70
         ajax(api.goodsOrder.openBusiness.url, {
72
         ajax(api.goodsOrder.openBusiness.url, {
71
           method: api.goodsOrder.openBusiness.method,
73
           method: api.goodsOrder.openBusiness.method,
72
           urlData: {
74
           urlData: {
79
       })
81
       })
80
     },
82
     },
81
     closeBusiness ({ commit }, caseid) {
83
     closeBusiness ({ commit }, caseid) {
82
-      return new Promise((resolve) => {
84
+      return new Promise(resolve => {
83
         ajax(api.goodsOrder.closeBusiness.url, {
85
         ajax(api.goodsOrder.closeBusiness.url, {
84
           method: api.goodsOrder.closeBusiness.method,
86
           method: api.goodsOrder.closeBusiness.method,
85
           urlData: {
87
           urlData: {
92
       })
94
       })
93
     },
95
     },
94
     getBusinessStatus ({ commit }, caseid) {
96
     getBusinessStatus ({ commit }, caseid) {
95
-      return new Promise((resolve) => {
97
+      return new Promise(resolve => {
96
         ajax(api.goodsOrder.getBusinessStatus.url, {
98
         ajax(api.goodsOrder.getBusinessStatus.url, {
97
           method: api.goodsOrder.getBusinessStatus.method,
99
           method: api.goodsOrder.getBusinessStatus.method,
98
           urlData: {
100
           urlData: {
106
             status = false
108
             status = false
107
           }
109
           }
108
           commit('updateBusiness', status)
110
           commit('updateBusiness', status)
109
-          resolve(res)
111
+          resolve(status)
110
         })
112
         })
111
       })
113
       })
112
     },
114
     },
113
     checkOrder ({ commit }, data) {
115
     checkOrder ({ commit }, data) {
114
-      return new Promise((resolve) => {
116
+      return new Promise(resolve => {
115
         ajax(api.goodsOrder.checkOrder.url, {
117
         ajax(api.goodsOrder.checkOrder.url, {
116
           method: api.goodsOrder.checkOrder.method,
118
           method: api.goodsOrder.checkOrder.method,
117
           urlData: {
119
           urlData: {
123
       })
125
       })
124
     },
126
     },
125
     cancelOrder ({ commit }, data) {
127
     cancelOrder ({ commit }, data) {
126
-      return new Promise((resolve) => {
128
+      return new Promise(resolve => {
127
         ajax(api.goodsOrder.cancelOrder.url, {
129
         ajax(api.goodsOrder.cancelOrder.url, {
128
           method: api.goodsOrder.cancelOrder.method,
130
           method: api.goodsOrder.cancelOrder.method,
129
           urlData: {
131
           urlData: {

+ 3
- 1
src/style/main.css View File

414
   color: red;
414
   color: red;
415
 }
415
 }
416
 
416
 
417
-
417
+.ql-editor{
418
+  min-height: 200px;
419
+}
418
 
420
 
419
 
421
 
420
 
422
 

+ 1
- 1
src/util/ajax.js View File

3
 import router from '../router'
3
 import router from '../router'
4
 import { Message } from 'element-ui'
4
 import { Message } from 'element-ui'
5
 
5
 
6
-const token = function (headers) {
6
+export function token (headers) {
7
   let JWT
7
   let JWT
8
   if (headers) {
8
   if (headers) {
9
     localStorage.setItem('JWT', headers.authorization)
9
     localStorage.setItem('JWT', headers.authorization)

+ 1
- 0
src/util/upload.js View File

2
 import ajax from './ajax'
2
 import ajax from './ajax'
3
 
3
 
4
 export default function upload (file) {
4
 export default function upload (file) {
5
+  console.log(file)
5
   return new Promise((resolve, reject) => {
6
   return new Promise((resolve, reject) => {
6
     ajax({
7
     ajax({
7
       ...api.file.image,
8
       ...api.file.image,

+ 92
- 0
src/util/websocket.js View File

1
+// const WsConnecting = 0
2
+const WsOpen = 1
3
+// const WsClosing = 2
4
+// const WsClosed = 3
5
+
6
+export default class XWebSocket {
7
+  addr = ''
8
+  client = null
9
+  autoConnect = false
10
+  interval = undefined
11
+  delay = 60
12
+  on = { open: null, message: null, error: null, close: null }
13
+
14
+  // constructor
15
+  constructor ({ open, message, error, close, delay, autoConnect }) {
16
+    this.on = { open, message, error, close }
17
+
18
+    if (delay >= 0) {
19
+      this.delay = delay
20
+    }
21
+
22
+    this.autoConnect = autoConnect
23
+  }
24
+
25
+  // 连接
26
+  connect (addr) {
27
+    this.addr = addr
28
+    this._wsInit()
29
+  }
30
+
31
+  // 发送
32
+  send (data) {
33
+    if (this.client && this.client.readyState === WsOpen) {
34
+      this.client.send(data)
35
+    }
36
+  }
37
+
38
+  // 关闭
39
+  close () {
40
+    if (!this.client) return
41
+
42
+    this._breforeClose(false)
43
+
44
+    this.client.close()
45
+    this.client = null
46
+  }
47
+
48
+  _breforeClose (autoConnect) {
49
+    this._wsClearHeartbeat()
50
+
51
+    if (this.client) {
52
+      if (!autoConnect) {
53
+        // 防止 onclose 中实现 断线重连
54
+        this.client.onclose = undefined
55
+      }
56
+    }
57
+  }
58
+
59
+  _wsInit () {
60
+    const _self = this
61
+
62
+    this.client = new window.WebSocket(this.addr)
63
+    this.client.onopen = this.on.open
64
+    this.client.onmessage = this.on.message
65
+    this.client.onerror = this.on.error
66
+    this.client.onclose = e => {
67
+      _self.on.close(e)
68
+      _self._breforeClose(_self.autoConnect)
69
+      _self.client = null
70
+
71
+      if (_self.autoConnect) {
72
+        window.setTimeout(() => _self._wsInit(), _self.delay * 1000)
73
+      }
74
+    }
75
+
76
+    this._wsHeartbeat()
77
+  }
78
+
79
+  _wsHeartbeat () {
80
+    this.interval = window.setInterval(() => {
81
+      if (this.client && this.client.readyState === WsOpen) {
82
+        this.client.send(10)
83
+      }
84
+    }, 60 * 1000)
85
+  }
86
+
87
+  _wsClearHeartbeat () {
88
+    if (this.interval !== undefined) {
89
+      window.clearInterval(this.interval)
90
+    }
91
+  }
92
+}