许成详 6 vuotta sitten
vanhempi
commit
7f61b514a2

+ 1
- 1
src/pages/system/marketingActivities/listOfLotteryActivities/page.scss Näytä tiedosto

@@ -11,7 +11,7 @@
11 11
     &+.flex-item{
12 12
       margin: 20px;
13 13
       position: relative;
14
-      overflow: hidden;
14
+      overflow-y: auto;
15 15
     }
16 16
   }
17 17
   nav{

+ 19
- 7
src/pages/system/marketingActivities/snapUpList/edit.vue Näytä tiedosto

@@ -12,7 +12,7 @@
12 12
                 <span>案场:<em>*</em></span>
13 13
                 <div class="flex-item">
14 14
                   <div style="width:50%">
15
-                    <el-select v-model="CaseId" placeholder="请选择案场">
15
+                    <el-select :disabled="editOff" v-model="CaseId" placeholder="请选择案场">
16 16
                       <el-option
17 17
                         v-for="item in cases"
18 18
                         :key="item.CaseId"
@@ -40,6 +40,7 @@
40 40
                 <div class="flex-item">
41 41
                   <div style="width:50%">
42 42
                     <el-input
43
+                      :disabled="editOff"
43 44
                       placeholder="请输入活动名额"
44 45
                       v-model="postData.FlashBuyMaxAttendant"
45 46
                       clearable>
@@ -64,6 +65,7 @@
64 65
                 <div class="flex-item">
65 66
                   <div>
66 67
                     <el-date-picker
68
+                      :disabled="editOff"
67 69
                       value-format="yyyy-MM-ddT00:00:00+08:00"
68 70
                       v-model="postData.StartDate"
69 71
                       type="date"
@@ -71,6 +73,7 @@
71 73
                     </el-date-picker>
72 74
                     <span>至</span>
73 75
                     <el-date-picker
76
+                      :disabled="editOff"
74 77
                       value-format="yyyy-MM-ddT00:00:00+08:00"
75 78
                       v-model="postData.EndDate"
76 79
                       type="date"
@@ -94,8 +97,8 @@
94 97
                 <span>参与类型:<em>*</em></span>
95 98
                 <div class="flex-item">
96 99
                   <div>
97
-                    <el-radio v-model="postData.AttendantType" label="no">不限</el-radio>
98
-                    <el-radio v-model="postData.AttendantType" label="newuser">新用户</el-radio>
100
+                    <el-radio :disabled="editOff" v-model="postData.AttendantType" label="no">不限</el-radio>
101
+                    <el-radio :disabled="editOff" v-model="postData.AttendantType" label="newuser">新用户</el-radio>
99 102
                   </div>
100 103
                 </div>
101 104
               </li>
@@ -103,10 +106,11 @@
103 106
                 <span>核销时间:<em>*</em></span>
104 107
                 <div class="flex-item">
105 108
                   <div class="flex-h" style="width: 100%;align-item: center;">
106
-                    <el-radio v-model="postData.ValidateType" label="days" style="margin-right: 5px;"><em style="color: transparent;display:none;">1</em></el-radio>
109
+                    <el-radio :disabled="editOff" v-model="postData.ValidateType" label="days" style="margin-right: 5px;"><em style="color: transparent;display:none;">1</em></el-radio>
107 110
                     <span>领取后</span>
108 111
                     <div style="width: 100px;display: inline-block;">
109 112
                       <el-input
113
+                        :disabled="editOff"
110 114
                         placeholder=""
111 115
                         v-model="postData.ValidateDays"
112 116
                         clearable>
@@ -115,10 +119,11 @@
115 119
                     <span>天内有效</span>
116 120
                   </div>
117 121
                   <div class="flex-h" style="width: 100%;align-item: center;margin-top: 10px;">
118
-                    <el-radio v-model="postData.ValidateType" label="date" style="margin-right: 5px;"><em style="color: transparent;display:none;">2</em></el-radio>
122
+                    <el-radio :disabled="editOff" v-model="postData.ValidateType" label="date" style="margin-right: 5px;"><em style="color: transparent;display:none;">2</em></el-radio>
119 123
                     <span>有效期</span>
120 124
                     <div style="display: inline-block;">
121 125
                       <el-date-picker
126
+                        :disabled="editOff"
122 127
                         value-format="yyyy-MM-ddT00:00:00+08:00"
123 128
                         v-model="postData.ValidateStart"
124 129
                         type="date"
@@ -126,6 +131,7 @@
126 131
                       </el-date-picker>
127 132
                       <span>至</span>
128 133
                       <el-date-picker
134
+                        :disabled="editOff"
129 135
                         value-format="yyyy-MM-ddT00:00:00+08:00"
130 136
                         v-model="postData.ValidateEnd"
131 137
                         type="date"
@@ -157,6 +163,7 @@ const { mapActions: mapActivityFlashbuyActions } = createNamespacedHelpers('acti
157 163
 export default {
158 164
   data () {
159 165
     return {
166
+      editOff: false,
160 167
       templateActiveIndex: 0, // 当前选择模板索引值
161 168
       templateList: [], // 模板列表
162 169
       postData: {
@@ -196,6 +203,9 @@ export default {
196 203
     }
197 204
   },
198 205
   created () {
206
+    if (this.$route.query.id) {
207
+      this.editOff = true
208
+    }
199 209
     this.getFlashbuyTemplateList().then((res) => {
200 210
       // console.log(JSON.stringify(res))
201 211
       for (var n = 0; n < res.length; n++) {
@@ -319,8 +329,10 @@ export default {
319 329
       return true
320 330
     },
321 331
     cutTemplate (index) { // 切换模板
322
-      this.templateActiveIndex = index
323
-      this.postData.ModelId = this.templateList[index].ModelId
332
+      if (!this.editOff) {
333
+        this.templateActiveIndex = index
334
+        this.postData.ModelId = this.templateList[index].ModelId
335
+      }
324 336
     },
325 337
     reback () {
326 338
       this.$router.push({ name: 'snapUpList' })

+ 169
- 7
src/pages/system/marketingActivities/snapUpList/index.vue Näytä tiedosto

@@ -34,7 +34,7 @@
34 34
           <li>
35 35
             <el-input
36 36
               placeholder="请输入活动名称"
37
-              v-model="postData.name"
37
+              v-model="postData.flashbuyname"
38 38
               clearable>
39 39
             </el-input>
40 40
           </li>
@@ -74,11 +74,13 @@
74 74
               <el-button
75 75
                 v-if="scope.row.FlashBuyStatus !== 'active'"
76 76
                 size="mini"
77
-                type="danger">删除</el-button>
77
+                type="danger"
78
+                @click="deleteFlashbuyItem(scope.row.FlashBuyId)">删除</el-button>
78 79
               <el-button
79 80
                 v-if="scope.row.FlashBuyStatus === 'active'"
80 81
                 size="mini"
81
-                type="warning">停用</el-button>
82
+                type="warning"
83
+                @click="stopFlashBuy(scope.row.FlashBuyId)">停用</el-button>
82 84
               <el-button
83 85
                 size="mini"
84 86
                 type="success"
@@ -86,10 +88,12 @@
86 88
               <el-button
87 89
                 v-if="scope.row.FlashBuyStatus === 'inactive'"
88 90
                 size="mini"
89
-                type="success">启用</el-button>
91
+                type="success"
92
+                @click="openFlashBuy(scope.row.FlashBuyId)">启用</el-button>
90 93
               <el-button
91 94
                 size="mini"
92
-                type="success">获取记录</el-button>
95
+                type="success"
96
+                @click="getRecords(scope.row.FlashBuyId)">抢购记录</el-button>
93 97
             </template>
94 98
           </el-table-column>
95 99
         </el-table>
@@ -101,6 +105,75 @@
101 105
       layout="prev, pager, next, jumper"
102 106
       :total="total">
103 107
     </el-pagination>
108
+    <el-dialog
109
+      title="抢购记录"
110
+      :visible.sync="showFlashbuyRecordsList"
111
+      width="1000px"
112
+      @closed="emptyFlashbuyRecordsList"
113
+      center>
114
+      <div class="popupSearch">
115
+        <div style="width:200px;">
116
+          <el-input
117
+            placeholder="请输入手机号"
118
+            v-model="flashbuyPostData.phone"
119
+            clearable>
120
+          </el-input>
121
+        </div>
122
+        <el-button
123
+          type="primary"
124
+          @click="searchRecordList">搜索</el-button>
125
+      </div>
126
+      <div style="border:1px solid #eee;border-bottom:none;margin-top:20px;">
127
+        <el-table
128
+          :data="flashbuyRecordsList"
129
+          style="width: 100%">
130
+          <el-table-column
131
+            prop="CaseName"
132
+            label="案场">
133
+          </el-table-column>
134
+          <el-table-column
135
+            prop="CustomerName"
136
+            label="姓名">
137
+          </el-table-column>
138
+          <el-table-column
139
+            prop="Phone"
140
+            label="手机号">
141
+          </el-table-column>
142
+          <el-table-column
143
+            prop="CreateDate"
144
+            label="获取时间">
145
+            <template slot-scope="scope">
146
+              <span v-if="scope.row.CreateDate !== '0001-01-01T00:00:00Z'">{{toolClass.dateFormat(scope.row.CreateDate, 'yyyy-MM-dd')}}</span>
147
+              <span v-else>-</span>
148
+            </template>
149
+          </el-table-column>
150
+          <el-table-column
151
+            prop="VerifyDate"
152
+            label="核销时间">
153
+            <template slot-scope="scope">
154
+              <span v-if="scope.row.VerifyDate !== '0001-01-01T00:00:00Z'">{{toolClass.dateFormat(scope.row.VerifyDate, 'yyyy-MM-dd')}}</span>
155
+              <span v-else>-</span>
156
+            </template>
157
+          </el-table-column>
158
+          <el-table-column
159
+            prop="VerifyStatus"
160
+            label="核销状态">
161
+            <template slot-scope="scope">
162
+              {{scope.row.Status === 'useable' ? '未核销' : '已核销'}}
163
+            </template>
164
+          </el-table-column>
165
+        </el-table>
166
+      </div>
167
+      <div style="padding-bottom:20px;">
168
+        <el-pagination
169
+          @current-change="cutFlashbuyPage"
170
+          :current-page.sync="flashbuyPostData.page"
171
+          :page-size="flashbuyPostData.pagesize"
172
+          layout="prev, pager, next, jumper"
173
+          :total="flashbuyTotal">
174
+        </el-pagination>
175
+      </div>
176
+    </el-dialog>
104 177
   </div>
105 178
 </template>
106 179
 <script>
@@ -109,6 +182,8 @@ const { mapActions: mapActivityFlashbuyActions } = createNamespacedHelpers('acti
109 182
 export default {
110 183
   data () {
111 184
     return {
185
+      currentFlashbuyId: '',
186
+      showFlashbuyRecordsList: false,
112 187
       statusList: [{ // 状态列表
113 188
         id: '',
114 189
         value: '不限状态'
@@ -127,10 +202,17 @@ export default {
127 202
         caseid: '', // 案场id
128 203
         page: 1, // 当前页码
129 204
         pagesize: 10, // 请求数据量
130
-        name: '', // 活动名称
205
+        flashbuyname: '', // 活动名称
131 206
         flashbuystatus: '', // 状态
132 207
       },
133
-      total: 0 // 数据条数
208
+      total: 0, // 数据条数
209
+      flashbuyPostData: {
210
+        page: 1, // 当前页码
211
+        pagesize: 5, // 请求数据量
212
+        phone: '', // 手机号
213
+      },
214
+      flashbuyTotal: 0,
215
+      flashbuyRecordsList: [], // 抢购记录列表
134 216
     }
135 217
   },
136 218
   computed: {
@@ -153,7 +235,78 @@ export default {
153 235
   methods: {
154 236
     ...mapActivityFlashbuyActions([
155 237
       'getFlashbuyList',
238
+      'getFlashbuyRecordsById',
239
+      'deleteFlashbuy',
240
+      'updateFlashbuyStatus',
156 241
     ]),
242
+    openFlashBuy (id) { // 启用
243
+      this.updateFlashbuyStatus({
244
+        id,
245
+        status: 'active'
246
+      }).then(() => {
247
+        this.getList()
248
+      })
249
+    },
250
+    stopFlashBuy (id) { // 停用
251
+      this.updateFlashbuyStatus({
252
+        id,
253
+        status: 'inactive'
254
+      }).then(() => {
255
+        this.getList()
256
+      })
257
+    },
258
+    deleteFlashbuyItem (id) { // 删除抢购活动
259
+      this.$confirm('确认删除此活动?', '提示', {
260
+        confirmButtonText: '确定',
261
+        cancelButtonText: '取消',
262
+        type: 'warning'
263
+      }).then(() => {
264
+        this.deleteFlashbuy(id).then(() => {
265
+          this.getList()
266
+          this.$message({
267
+            type: 'success',
268
+            message: '删除成功!'
269
+          })
270
+        })
271
+      }).catch(() => {
272
+        this.$message({
273
+          type: 'info',
274
+          message: '已取消删除'
275
+        })
276
+      })
277
+    },
278
+    getRecords (id) { // 获取记录
279
+      this.currentFlashbuyId = id
280
+      this.showFlashbuyRecordsList = true
281
+      this.toGetFlashbuyRecordsList()
282
+    },
283
+    cutFlashbuyPage (val) {
284
+      this.$data.flashbuyPostData.page = val
285
+      this.toGetFlashbuyRecordsList()
286
+    },
287
+    emptyFlashbuyRecordsList () { // 清空搜索数据
288
+      this.flashbuyPostData.page = 1
289
+      this.flashbuyPostData.phone = ''
290
+      this.flashbuyTotal = 1
291
+      this.flashbuyRecordsList = []
292
+    },
293
+    toGetFlashbuyRecordsList () { // 获取抢购记录列表
294
+      this.getFlashbuyRecordsById({
295
+        id: this.currentFlashbuyId,
296
+        info: this.flashbuyPostData
297
+      }).then((res) => {
298
+        // console.log(JSON.stringify(res))
299
+        res.list = res.list || []
300
+        this.flashbuyRecordsList = res.list
301
+        this.flashbuyPostData.page = res.page
302
+        this.flashbuyTotal = res.pagenum
303
+      })
304
+    },
305
+    searchRecordList () { // 搜索抢购记录
306
+      this.flashbuyPostData.page = 1
307
+      this.flashbuyTotal = 1
308
+      this.toGetFlashbuyRecordsList()
309
+    },
157 310
     editFlashbuy (id) {
158 311
       this.$router.push({ name: 'editSnapUpList', query: { id } })
159 312
     },
@@ -192,4 +345,13 @@ table {
192 345
     margin-bottom: 10px;
193 346
   }
194 347
 }
348
+.popupSearch {
349
+  width: 100%;
350
+  text-align: right;
351
+  font-size: 0;
352
+  & > * {
353
+    display: inline-block;
354
+    margin-left: 10px;
355
+  }
356
+}
195 357
 </style>

+ 1
- 1
src/pages/system/marketingActivities/snapUpList/page.scss Näytä tiedosto

@@ -11,7 +11,7 @@
11 11
     &+.flex-item{
12 12
       margin: 20px;
13 13
       position: relative;
14
-      overflow: hidden;
14
+      overflow-y: auto;
15 15
     }
16 16
   }
17 17
 }

+ 23
- 0
src/store/activityManager/flashbuy.js Näytä tiedosto

@@ -70,5 +70,28 @@ export default {
70 70
         }).catch(reject)
71 71
       })
72 72
     },
73
+    getFlashbuyRecordsById ({ commit }, payload) { // 获取抢购活动记录列表
74
+      return new Promise((resolve, reject) => {
75
+        ajax(api.activityManager.getFlashbuyRecordsById.url, {
76
+          method: api.activityManager.getFlashbuyRecordsById.method,
77
+          urlData: {
78
+            id: payload.id
79
+          },
80
+          queryData: { ...payload.info }
81
+        }).then(res => {
82
+          resolve(res)
83
+        }).catch(reject)
84
+      })
85
+    },
86
+    updateFlashbuyStatus ({ commit }, payload) { // 更新抢购活动状态
87
+      return new Promise((resolve, reject) => {
88
+        ajax(api.activityManager.updateFlashbuyStatus.url, {
89
+          method: api.activityManager.updateFlashbuyStatus.method,
90
+          urlData: {...payload},
91
+        }).then(res => {
92
+          resolve(res)
93
+        }).catch(reject)
94
+      })
95
+    },
73 96
   }
74 97
 }

+ 8
- 0
src/util/api.js Näytä tiedosto

@@ -893,6 +893,14 @@ const $api = {
893 893
       method: 'delete',
894 894
       url: `${baseUrl}${common}/flashbuy/:id`
895 895
     },
896
+    getFlashbuyRecordsById: { // 营销活动-获取抢购活动记录
897
+      method: 'get',
898
+      url: `${baseUrl}${common}/flashbuy/customer/:id`
899
+    },
900
+    updateFlashbuyStatus: { // 营销活动-更新抢购活动状态
901
+      method: 'put',
902
+      url: `${baseUrl}${common}/flashbuy/:id/:status`
903
+    },
896 904
   },
897 905
   record: {
898 906
     getRecordList: {