list.vue
9.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
<template xmlns:v-on="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/html">
<div class="container-fluid">
<div class="page page-order-time">
<div class="page-breadcrumb">
<ol class="breadcrumb">
<li><a>消费管理</a> > <a>包场订单</a></li>
</ol>
</div>
<div class="page-body">
<div class="main">
<div class="tab-content">
<!--商品库存-->
<div role="tabpanel" class="tab-pane active pt-4 pb-4" id="tab-mem-record">
<el-form ref="form" :model="form" label-width="50">
<el-select v-model="form.storeId" filterable placeholder="选择商家" :maxlength="10"
style="margin-left: 40px;">
<el-option v-for="item in storeList" :key="item.id" :label="item.name"
:value="item.id">
</el-option>
</el-select>
<el-select v-model="form.tradeStatus" filterable placeholder="订单状态" :maxlength="10"
>
<el-option v-for="item in tradeStatusList" :key="item.value" :label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-select v-model="form.sportType" filterable placeholder="运动项目" :maxlength="10"
>
<el-option v-for="item in sportsTypeList" :key="item.value" :label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-date-picker v-model="form.createTime"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期" placeholder="时间范围筛选">
</el-date-picker>
<el-select v-model="form.addedTime" filterable placeholder="加时情况" :maxlength="10"
>
<el-option v-for="item in hasAirConditioningList" :key="item.value" :label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-select v-model="form.airConditioning" filterable placeholder="空调状态" :maxlength="10"
>
<el-option v-for="item in hasAirConditioningList" :key="item.value" :label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-input v-model="form.keyword" placeholder="输入用户编号/姓名/手机号" :maxlength="10"
style="width: 300px;"></el-input>
<span class="mem-form">
<button class="btn btn-default" @click.prevent="submitForm('form')">查询</button>
<button @click.prevent="resetForm()" class="btn btn-default">重置</button>
</span>
</el-form>
<table class="table table-striped table-hover table-record mb-77" align="center" border="0">
<thead>
<tr>
<th>订单号</th>
<th>用户编号</th>
<th>昵称</th>
<th>手机号</th>
<th>运动项目</th>
<th>场地编号</th>
<th>包场时段</th>
<th>是否加时</th>
<th>是否开空调</th>
<th>订单金额</th>
<th>支付金额</th>
<th>订单状态</th>
<th>支付单号</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr v-for="item in pageList.list">
<td>{{item.orderId}}</td>
<td>{{item.userId}}</td>
<td>{{item.userName}}</td>
<td>{{item.userPhone}}</td>
<td>{{item.sportType | getSportsType}}</td>
<td>{{item.groundNo}}</td>
<td>{{item.startTime | formatDate('YYYY-MM-DD hh:mm')}}</td>
<td>{{item.addedTime | getType}}</td>
<td>{{item.airConditioning | getType}}</td>
<td>{{item.totalAmount}}</td>
<td>{{item.payAmount}}</td>
<td>{{item.tradeStatus | getTradeStatus}}</td>
<td>{{item.dpayNo}}</td>
<td>
<router-link v-bind:to="'/order/block/get/'+ item.orderId" class="js-do">查看详情</router-link>
</td>
</tr>
</tbody>
</table>
<pagination size="md"
:total-rows="pageList.totalRecord"
:per-page="pageList.pageSize"
v-model="currentIndex">
</pagination>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import pagination from "@/components/bootstrap/pagination"
import breadcrumb from "@/components/bootstrap/breadcrumb"
export default {
data() {
return {
form: {
storeId:'',
createTime:"",
keyword: '',
tradeStatus: '',
sportType: '',
addedTime:'',
airConditioning:''
},
pageList: {
pageSize: 1,
pageIndex: 1,
totalRecord: 0,
totalPage: 1,
list: [],
},
storeList:[],
currentIndex: 1,
tradeStatusList: tradeStatusList,
statusList: statusList,
sportsTypeList: sportsTypeList,
hasAirConditioningList:hasAirConditioningList,
}
},
components: {
pagination: pagination,
breadcrumb: breadcrumb,
},
created: function () {
this.getList();
this.getStoreList();
},
mounted: function () {
},
updated: function () {
},
destroyed: function () {
},
filters: {
getTradeStatus: function (value) {
var type;
switch (value) {
case 1:
type = "待支付"
break;
case 2:
type = "已支付"
break;
default:
type = "异常"
break;
}
return type;
},
getType: function (value) {
var type;
switch (value) {
case true:
type = "是"
break;
case false:
type = "否"
break;
}
return type;
},
getSportsType: function (value) {
var type;
switch (value) {
case 1:
type = "篮球"
break;
case 2:
type = "足球"
break;
case 3:
type = "羽毛球"
break;
case 4:
type = "网球"
break;
default:
type = "乒乓球"
break;
}
return type;
},
},
methods: {
getStoreList(data) {
var self = this;
self.ajax({
type: 'GET',
url: api.storeManage.list.url,
data: data,
success: function (res) {
self.storeList = res.data.list;
}
});
},
getList(data) {
var self = this;
self.ajax({
type: 'GET',
url: api.order.block.list.url,
data: data,
success: function (res) {
self.pageList = res.data;
self.currentIndex = res.data.pageIndex;
}
});
},
//改变状态
startVenues(id) {
var self = this;
self.ajax({
type: 'POST',
url: api.venues.start.url + "/" + id,
success: function (res) {
self.$message({
type: 'success',
message: res.message
});
self.getList();
}
});
},
//搜索
submitForm(data) {
var self = this;
console.log(self.form.createTime)
var data ={
storeId:self.form.storeId,
keyword: self.form.keyword,
tradeStatus: self.form.tradeStatus,
sportType: self.form.sportType,
airConditioning:self.form.airConditioning,
addedTime:self.form.addedTime,
startCreateTime:self.turnDate(self.form.createTime[0]),
endCreateTime:self.turnDate(self.form.createTime[1]),
};
console.log(data);
self.getList(data);
},
//重置
resetForm() {
var self = this;
self.form.storeId='';
self.form.addedTime="";
self.form.airConditioning="";
self.form.keyword = "";
self.form.tradeStatus = "";
self.form.sportType = "";
self.form.createTime = null;
self.form.startTime='';
}
},
watch: {
currentPage: function (newData) {
var self = this;
var query = {
pageIndex: newData,
}
self.submitForm(query);
},
}
}
</script>