dladdaccount.html
10.7 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
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
{template 'public/header'}{template 'public/comhead'}
<link rel="stylesheet" type="text/css" href="../addons/zh_cjdianc/template/public/ygcss.css">
<style type="text/css">
input[type="radio"] + label::before {
content: "\a0"; /*不换行空格*/
display: inline-block;
vertical-align: middle;
font-size: 16px;
width: 1em;
height: 1em;
margin-right: .4em;
border-radius: 50%;
border: 2px solid #ddd;
text-indent: .15em;
line-height: 1;
}
input[type="radio"]:checked + label::before {
background-color: #44ABF7;
background-clip: content-box;
padding: .1em;
border: 2px solid #44ABF7;
}
input[type="radio"] {
position: absolute;
clip: rect(0, 0, 0, 0);
}
.dis_in{
display: inline-block;
vertical-align: middle;
}
</style>
<ul class="nav nav-tabs">
<span class="ygxian"></span>
<div class="ygdangq">当前位置:</div>
<li><a href="{php echo $this->createWebUrl2('dlaccount')}">账号管理</a></li>
<li class="active"><a href="{php echo $this->createWebUrl2('dladdaccount')}">添加/编辑账号</a></li>
</ul>
<div class="main">
<form action="" method="post" class="form-horizontal form" enctype="multipart/form-data">
<div class="panel panel-default ygdefault">
<div class="panel-heading wyheader"> 添加/编辑账号</div>
<div class="panel-body panel">
<div class="form-group">
<label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label">登录账号</label>
<div class="col-sm-10 col-lg-9">
<input id="" name="username" type="text" class="form-control" value="{$users['username']}"/>
<span class="help-block">*请输入用户名,用户名为 3 到 15 个字符组成,包括汉字,大小写字母(不区分大小写)</span>
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label">登录密码</label>
<div class="col-sm-10 col-lg-9">
<input id="password" name="password" type="password" class="form-control" value="" autocomplete="off"/>
<span class="help-block">*请填写密码,最小长度为 8 个字符</span>
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label">确认密码</label>
<div class="col-sm-10 col-lg-9">
<input id="repassword" type="password" class="form-control" value="" autocomplete="off"/>
<span class="help-block">*重复输入密码,确认正确输入</span>
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label">状态{$ccount['authority']}</label>
<div class="col-sm-9">
<label class="radio-inline">
<input type="radio" id="qiyongc" name="status" value="2" {if $users['status']==2 || empty($users)}checked{/if}>
<label for="qiyongc">启用</label>
</label>
<label class="radio-inline">
<input type="radio" id="qiyongc2" name="status" value="1" {if $users['status']== 1}checked{/if}>
<label for="qiyongc2">关闭</label>
</label>
</div>
</div>
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label">权限管理</label>
<div class="add_html dis_in" style="width:75%;" value="{$account['authority']}">
</div>
<input style="opacity: 0" type="text" value="" name="form_array">
</div>
</div>
</div>
<div class="form-group">
<input type="submit" name="submit" value="保存设置" class="btn col-lg-3" style="color: white;background-color: #44ABF7;"/>
<input type="hidden" name="token" value="{$_W['token']}"/>
</div>
<div class="modal fade" id="myModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel" style="font-size: 20px;">提示</h4>
</div>
<div class="modal-body ygsearch" style="font-size: 20px;padding: 15px 30px;">
<input type="text" id="ygsinput" placeholder="请输入酒店名称">
<span class="btn btn-sm ygbtn storeblue">搜索</span>
<div class="searchname" style="margin-top: 8px;"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
</div>
</div>
</div>
</div>
</form>
</div>
<!-- <script type="text/javascript">
$(function(){
// $("#frame-0").addClass("in");
$("#frame-8").show();
$("#yframe-8").addClass("wyactive");
})
</script> -->
<script type="text/javascript">
$(function(){
$("#frame-14").show();
// console.log('')
var authority = "{$account['authority']}".split(',');
console.log(authority)
$("#yframe-14").addClass("wyactive");
$(".searchname").hide();
var mock = [
{
name:'start',
val:'门店设置',
y:'checked'
},
{
name:'dlinorder',
val:'订单管理',
y:'checked'
},
{
name:'dldishes2',
val:'商品管理',
y:'checked'
},
{
name:'dlstoread',
val:'广告管理',
y:'checked'
},
{
name:'dltable2',
val:'餐桌管理',
y:'checked'
},
{
name:'dlcalllog',
val:'呼叫服务',
y:'checked'
},
{
name:'dlygquan',
val:'营销设置',
y:'checked'
},
{
name:'dlzjlist',
val:'资金管理',
y:'checked'
},
{
name:'dlcomment',
val:'评论管理',
y:'checked'
},
{
name:'dlprint',
val:'打印设置',
y:'checked'
}
]
for(var i = 0;i< authority.length;i++){
for(var j = 0;j< mock.length;j++){
if(mock[j].name==authority[i]){
console.log('相等')
mock[j].y=true
}
}
}
console.log(authority)
console.log(mock)
for(let i in mock){
if(mock[i].y==true){
mock[i].info = ''
mock[i].info += '<div class="col-sm-9 dis_in" style="width:20%;margin-bottom:10px;">'+'<label class="radio-inline">'+'<input type="checkbox" class="dis_in"'+'name='+'"'+mock[i].name+'"'+'value='+mock[i].name+' '+'checked='+'"'+mock[i].y+'"'+'>'+'<text style="margin-left:10px;" class="dis_in">'+mock[i].val+'</text>'+'</label>'+'</div>'
$(".add_html").append(mock[i].info)
}else{
mock[i].info = ''
mock[i].info += '<div class="col-sm-9 dis_in" style="width:20%;margin-bottom:10px;">'+'<label class="radio-inline">'+'<input type="checkbox" class="dis_in"'+'name='+'"'+mock[i].name+'"'+'value='+mock[i].name+'>'+'<text style="margin-left:10px;" class="dis_in">'+mock[i].val+'</text>'+'</label>'+'</div>'
$(".add_html").append(mock[i].info)
}
}
check()
$('input[type=checkbox]').click(function(){
check()
})
function check(){
var checkInput = $('input[type=checkbox]:checked')
var check = []
for(let i in checkInput){
if(checkInput[i].defaultValue!=null){
check.push(checkInput[i].defaultValue)
}
}
check = check.join(',')
console.log(check)
$("input[name=form_array]").val(check)
}
$(".ygbtn").on("click",function(){
var ygsinput = $("#ygsinput").val();
console.log(ygsinput)
if(ygsinput.length==''){
$(".searchname").html('');
}else{
$(".searchname").html('')
var keywords = $("#ygsinput").val()
$.ajax({
type:"post",
url:"{$_W['siteroot']}/app/index.php?i={$_W['uniacid']}&c=entry&do=SelectJd&m=zh_jdgjb",
dataType:"text",
data:{keywords:keywords},
success:function(data){
var data = eval('(' + data + ')')
console.log(data);
$(".searchname").show();
for(var i=0;i<data.length;i++){
$(".searchname").append('<div class="shnbox" data-dismiss="modal" id="'+data[i].id+'"><a href="javascript:void(0);"><p>'+data[i].name+'</p></a></div>')
}
$(".shnbox").each(function(){
$(this).click(function(){
// 获取选中的用户id
var thid = $(this).text()
// 获取选中的用户name
var user_id = $(this).attr("id")
// 根据选中的用户新增一个option
$("#username").append("<option value='"+user_id+"'>"+thid+"</option>").attr("selected", true);
// 点击之后让value等于user_id的options显示
$("#username").val(user_id);
})
})
}
})
}
})
})
</script>
{template 'common/footer'}