|
@@ -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>
|