23
23
<td >联系电话</td >
24
24
<td >联系地址</td >
25
25
<td >绑定用户</td >
26
+ <td >服务开通状态</td >
27
+ <td >截止时间</td >
28
+ <td >最大使用人数</td >
26
29
<td >操作</td >
27
30
</tr >
28
31
</thead >
33
36
<td >{{client.phone}}</td >
34
37
<td >{{client.address}}</td >
35
38
<td >{{client.username}}</td >
39
+ <td >{{client.status?'已开通':'未开通'}}</td >
40
+ <td >{{changeTime(client.endtime)}}</td >
41
+ <td >{{client.max}}</td >
36
42
<td >
37
43
<Button type =" info" @click.stop =" doedit(client._id)" >编辑</Button >
38
44
<Button type =" error" @click.stop =" remove(client._id)" >删除</Button >
42
48
</table >
43
49
<p class =" notip" v-show =" clients.length==0" >没有找到您搜索的客户~</p >
44
50
</div >
51
+ <Spin fix v-show =" loading" >
52
+ <Icon type =" load-c" size =36 class =" demo-spin-icon-load" ></Icon >
53
+ </Spin >
45
54
<div class =" paginator" >
46
55
<Page
47
56
:total =" clients.length"
75
84
<Option v-for =" item in users" :value =" item._id" :key =" item" >{{ item.name }}</Option >
76
85
</Select >
77
86
</p >
87
+
88
+ <p >
89
+ <span class =" input-label" >服务开通状态</span >
90
+ <Select v-model =" selectStatus" style =" width :250px " filterable >
91
+ <Option v-for =" item in status" :value =" item.value" :key =" item" >{{ item.label }}</Option >
92
+ </Select >
93
+ </p >
94
+ <p >
95
+ <span class =" input-label" >截止时间</span >
96
+ <!-- <Input v-model="endtime" placeholder="请选择截止时间" style="width: 250px"></Input> -->
97
+ <Date-picker v-model =" endtime" type =" date" placeholder =" 选择日期" style =" width : 200px " ></Date-picker >
98
+ </p >
99
+ <p >
100
+ <span class =" input-label" >使用人数上限</span >
101
+
102
+ <Input-number :min =" 1" v-model =" max" placeholder =" 请输入使用人数上限" style =" width : 250px " ></Input-number >
103
+ </p >
78
104
<div slot =" footer" >
79
105
<Button @click =" cancel()" >取消</Button >
80
106
<Button type =" success" @click =" submit()" >确认</Button >
@@ -88,12 +114,15 @@ export default {
88
114
name: ' client' ,
89
115
data (){
90
116
return {
117
+ loading: true ,
91
118
newClient: false ,
92
119
modalTitle: " 新增客户" ,
93
120
name: ' ' ,
94
121
phone: ' ' ,
95
122
address: ' ' ,
96
123
selectUser: ' ' ,
124
+ endtime: ' ' ,
125
+ max: null ,
97
126
users: [],
98
127
clients: [],
99
128
clientArr: [],
@@ -106,6 +135,14 @@ export default {
106
135
label: ' 所属用户' ,
107
136
value: ' user'
108
137
}],
138
+ selectStatus: 0 ,
139
+ status: [{
140
+ label: ' 开通' ,
141
+ value: 1
142
+ },{
143
+ label: ' 未开通' ,
144
+ value: 0
145
+ }],
109
146
search: ' ' ,
110
147
pageSize: 10 ,
111
148
pageCurrent: 1
@@ -133,10 +170,11 @@ export default {
133
170
this .clients = res .data
134
171
this .clientArr = res .data
135
172
}
173
+ this .loading = false
136
174
})
137
175
},
138
176
submit (){
139
- if ( ! this .name || ! this .phone || ! this .address || ! this .selectUser ){
177
+ if ( ! this .name || ! this .phone || ! this .address || ! this .selectUser || ! this . endtime || ! this . max ){
140
178
this .$Message .warning ({content: ' 请填写完整信息' , duration: 3 , closable: true });
141
179
return ;
142
180
}
@@ -146,7 +184,10 @@ export default {
146
184
name: this .name ,
147
185
phone: this .phone ,
148
186
address: this .address ,
149
- user: this .selectUser })
187
+ user: this .selectUser ,
188
+ endtime: this .endtime ,
189
+ max: this .max ,
190
+ status: this .selectStatus })
150
191
.then ( response => response .data )
151
192
.then ( res => {
152
193
if (! this .checkLogin (res))return ;
@@ -165,7 +206,10 @@ export default {
165
206
name: this .name ,
166
207
phone: this .phone ,
167
208
address: this .address ,
168
- user: this .selectUser })
209
+ user: this .selectUser ,
210
+ endtime: this .endtime ,
211
+ max: this .max ,
212
+ status: this .selectStatus })
169
213
.then ( response => response .data )
170
214
.then ( res => {
171
215
if (! this .checkLogin (res))return ;
@@ -216,6 +260,9 @@ export default {
216
260
this .name = this .clients [i].name
217
261
this .phone = this .clients [i].phone
218
262
this .address = this .clients [i].address
263
+ this .endtime = this .clients [i].endtime
264
+ this .max = this .clients [i].max
265
+ this .selectStatus = this .clients [i].status
219
266
this .edit = this .clients [i]
220
267
// 遍历users,找出当前编辑的用户拥有的角色
221
268
for ( let j= 0 ;j< this .users .length ;j++ ){
@@ -235,6 +282,9 @@ export default {
235
282
this .name = ' '
236
283
this .phone = ' '
237
284
this .address = ' '
285
+ this .endtime = ' '
286
+ this .max = null
287
+ this .selectStatus = ' '
238
288
this .modalTitle = " 新增客户"
239
289
this .selectUser = []
240
290
this .edit = null
@@ -284,10 +334,15 @@ export default {
284
334
},
285
335
},
286
336
mounted (){
287
- this .getclients ()
288
337
this .getusers ()
338
+ this .getclients ()
289
339
}
290
340
}
291
341
</script >
292
342
293
- <style scoped></style >
343
+ <style scoped>
344
+ .ivu-date-picker {
345
+ display : inline-block ;
346
+ width : 250px !important ;
347
+ }
348
+ </style >
0 commit comments