modify.vm
26.5 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
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
<link rel="stylesheet" href="/assets/css/map.css" />
<div class="page-content">
<div class="page-header">
<span class="pull-right"><a href="/pick/list.do" class="btn btn-white btn-default">返回</a></span>
<h1>
<small>
<i class="icon-double-angle-right"></i>
修改市场
</small>
</h1>
</div>
<!-- /.page-header -->
<div class="row">
<div class="col-xs-12">
<form class="form-horizontal bv-form" role="form" method="post" action="/pick/update.do" id="addForm" >
<input type="hidden" id="pickId" name="id" value="$!{pickUp.id}">
<input type="hidden" id="isDeaflutMarketId" value="$!{pickUp.isDeaflutMarket}">
<input type="hidden" id="isMarketId" value="$!{pickUp.isMarket}">
<input type="hidden" id="recommend" name="recommend" value="$!{pickUp.recommend}">
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-field-2"> 市场名称: </label>
<div class="col-xs-12 col-sm-4">
<span class="block input-icon input-icon-right">
<input type="text" placeholder="市场名称" name="pickName" value="$!{pickUp.pickName}" required data-bv-message="必须填写!" data-bv-stringlength-message="超出了最大范围!" data-bv-stringlength="" data-bv-stringlength-max="125" maxlength="125" class="width-100" value="" data-bv-field="cfg.configCode">
</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-field-5"> 市场编码: </label>
<div class="col-xs-12 col-sm-4">
<span class="block input-icon input-icon-right">
<input type="text" placeholder="市场编码" readonly="readonly" name="pickCode" value="$!{pickUp.pickCode}" required data-bv-message="必须填写!" data-bv-stringlength-message="超出了最大范围!" data-bv-stringlength="" data-bv-stringlength-max="125" maxlength="125" class="width-100" value="" data-bv-field="cfg.configName">
</span>
</div>
</div>
#if( $!{pickUp.personList.size()}==0)
<div class="form-group" id="add_position">
<label class="col-sm-3 control-label no-padding-right" for="form-field-6"> 联系方式: </label>
<input type="hidden" name="personName" id="contpId">
<input type="hidden" name="personTel" id="contnId">
<div class="col-xs-12 col-sm-4" >
<span class="block input-icon input-icon-right">
<input type="text" placeholder="联系人姓名" pickupname id="personName0" onfocus="submitBtDisab()" class="col-sm-6" required data-bv-message="必须填写!" >
<input type="text" placeholder="联系人姓名" pickuptel id="personTel0" onfocus="submitBtDisab()" class="col-sm-6" required data-bv-message="必须填写!" >
</span>
</div>
<div> <a href="javascript:void(0);"> <i class="fa fa-plus " id="add_contact" style=" line-height: 25px; margin-top: 5px; "></i></a></div>
</div>
#end
#set($idv = 0)
#foreach($per in $!{pickUp.personList})
#if($idv==0)
<div class="form-group" id="add_position">
<label class="col-sm-3 control-label no-padding-right" for="form-field-6"> 联系方式: </label>
<input type="hidden" name="personName" id="contpId">
<input type="hidden" name="personTel" id="contnId">
<div class="col-xs-12 col-sm-4" >
<span class="block input-icon input-icon-right">
<input type="text" placeholder="联系人姓名" pickupname id="personName$idv" onfocus="submitBtDisab()" value="$!{per.contactName}" class="col-sm-6" required data-bv-message="必须填写!" >
<input type="text" placeholder="联系人姓名" pickuptel id="personTel$idv" onfocus="submitBtDisab()" value="$!{per.contactPhone}" class="col-sm-6" required data-bv-message="必须填写!" >
</span>
</div>
<div> <a href="javascript:void(0);"> <i class="fa fa-plus " id="add_contact" style=" line-height: 25px; margin-top: 5px; "></i></a></div>
</div>
#else
<div class="form-group" id="add_position">
<label class="col-sm-3 control-label no-padding-right" for="form-field-6"> </label>
<input type="hidden" name="personName" id="contpId">
<input type="hidden" name="personTel" id="contnId">
<div class="col-xs-12 col-sm-4" >
<span class="block input-icon input-icon-right">
<input type="text" placeholder="联系人姓名" pickupname id="personName$idv" value="$!{per.contactName}" onfocus="submitBtDisab()" class="col-sm-6" required data-bv-message="必须填写!" >
<input type="text" placeholder="联系人姓名" pickuptel id="personTel$idv" value="$!{per.contactPhone}" onfocus="submitBtDisab()" class="col-sm-6" required data-bv-message="必须填写!" >
</span>
</div>
<div> <a href="javascript:void(0);" onclick="removeGrp(this)" > <i class="fa fa-minus " style=" line-height: 25px; margin-top: 5px; "></i></a></div>
</div>
#end
#set($idv = $idv+1)
#end
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-field-6"> 市场地址: </label>
<div class="col-xs-12 col-sm-4">
<div class="begin" id="begin">
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-field-6"> </label>
<div class="col-xs-12 col-sm-4">
<span class="block input-icon input-icon-right">
<input type="text" placeholder="精确到街道和门牌号" name="addressTxt" required data-bv-message="必须填写!" value="$!{pickUp.addressTxt}" class="width-100" >
</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-field-6"> </label>
<div class="col-xs-12 col-sm-4">
<span class="block input-icon input-icon-right" style="color:red;font-size: 14px;">
修改了市场地址请记得修改坐标位置
</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-field-6"> 坐标位置: </label>
<div class="col-xs-12 col-sm-4" >
<div class="input-group">
<input type="hidden" id="longitudeId" name="longitude" value="$!{pickUp.longitude}" >
<input type="hidden" id="latitudeId" name="latitude" value="$!{pickUp.latitude}">
<input type="text" class="form-control" id="positionTxt" value="($!{pickUp.longitude},$!{pickUp.latitude})" placeholder="请选择位置" readonly="readonly" >
<span class="input-group-addon" style="cursor: pointer;" onclick="chosePosition()" >选择位置 </span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-field-6"> 市场描述: </label>
<div class="col-xs-12 col-sm-4">
<span class="block input-icon input-icon-right">
<textarea class="form-control limited" name="remark" style="height:100px" >$!{pickUp.remark}</textarea>
</span>
</div>
</div>
<input type="hidden" name="isMarket" id="markId" value="$!{pickUp.isMarket}">
<!-- <div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-field-6"> 是否是市场: </label>
<div class="col-xs-12 col-sm-4">
#if($!{pickUp.isMarket}==1)
<label style="margin-top: 3px;"> 是
</label>
#elseif($!{pickUp.isMarket}==2)
<label style="margin-top: 3px;">
否
</label>
#end
</div>
</div> -->
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-field-6"> 本公司市场: </label>
<div class="col-xs-12 col-sm-4">
<label>
<input id="unlock-inputtype" class="ace" #if($!{pickUp.myself}==1) checked
#end name="myself" type="radio" attrtype="attr_desc" name="form-field-radio" value="1" >
<span class="lbl">是</span>
</label>
<label>
<input id="lock-inputtype" class="ace" #if($!{pickUp.myself}==2) checked
#end name="myself" type="radio" attrtype="attr_desc" name="form-field-radio" value="2" >
<span class="lbl">否</span>
</label>
</div>
</div>
<div id="isPickup" #if($!{pickUp.isMarket}==1) style="display:none;" #end>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-field-6"> 市场简称: </label>
<div class="col-xs-12 col-sm-4">
<span class="block input-icon input-icon-right">
<select id="glsc" style="width:100%;" name="parentPickId">
<option value="-1"> --- 请选择关联市场 --- </option>
#foreach($market in $marketList)
<option value="$market.id" #if(${assetsUtils.equal($pickUp.parentPickId,$market.id)}) selected #end>$market.pickName</option>
#end
</select>
</span>
</div>
</div>
</div>
<div id="notMarketId" #if($!{pickUp.isMarket}==2) disabled style="display:none;" #end>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-field-6"> 市场简称: </label>
<div class="col-xs-12 col-sm-4">
<span class="block input-icon input-icon-right">
<input type="text" placeholder="市场简称" id="thdjc" name="abbreviation" value="$!{pickUp.abbreviation}" required data-bv-message="必须填写!" data-bv-stringlength-message="超出了最大范围!" data-bv-stringlength="" data-bv-stringlength-max="125" maxlength="125" class="width-100" value="" data-bv-field="cfg.configCode">
</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-field-6"> </label>
<div class="col-xs-12 col-sm-4">
<span class="block input-icon input-icon-right">
用于分站运营切换城市时显示
</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for="form-field-6"> 关联城市: </label>
<input type="hidden" id="cityDetail" name="cityDetail">
<div class="col-xs-12 col-sm-4">
<div style="height:250px; width:413px; border:#CCC solid 1px;">
<div style="height:250px; width:174px; border-right:#CCC solid 1px; float:left">
<div class="che_tit">选择省份</div>
<div class="che_box">
<ul id="procityId">
#foreach($cty in $city)
#foreach($procty in $!{pickUp.cityList})
#if($procty.cityId==$cty.regionId)
#set($checkP =1)
#break
#else
#set($checkP =2)
#end
#end
#if($checkP==1)
<li><label class="position-relative"><input type="checkbox" onclick="getcity($!{cty.regionId},this)" checked="checked" class="ace" value="$!{cty.regionId}" ><span class="lbl" id="regId$!{cty.regionId}"> $cty.regionName</span></label> </li>
#else
<li><label class="position-relative"><input type="checkbox" onclick="getcity($!{cty.regionId},this)" class="ace" value="$!{cty.regionId}" ><span class="lbl" id="regId$!{cty.regionId}"> $cty.regionName</span></label> </li>
#end
#end
</ul>
</div>
</div>
<div style="height:250px; width:236px;float:right">
<div class="che_tit"><label class="position-relative"><input type="checkbox" class="ace" id="checkAllId" onclick="checkAll()"><span class="lbl"></span></label> 城市全选</div>
<div class="che_box">
<ul id="newLevlcityId">
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="clearfix form-actions">
<div class="col-md-offset-3 col-md-9">
<button class="btn btn-info" type="submit" id="submitBuId" >
<i class="icon-ok bigger-110"></i>
提交
</button>
<a href="/pick/list.do" class="btn">
<i class="icon-undo bigger-110"></i>
返回
</a>
</div>
</div>
</form>
</div>
</div>
</div>
<!-- PAGE CONTENT ENDS -->
</div><!-- /.col -->
</div><!-- /.row -->
</div><!-- /.page-content -->
</div><!-- /.main-content -->
<!-- basic scripts -->
<div id="modal-form" class="modal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">选择位置
<button type="button" class="close" data-dismiss="modal" style="font-size: 20px">×</button>
<h4 id="xzml" class="blue bigger"></h4>
</div>
<div class="modal-body overflow-visible">
<div id="preview">
<div id="float_search_bar">
<label>区域:</label>
<input type="text" id="keyword" />
<button id="search_button">查找</button>
<span>点击地图获取坐标</span>
</div>
<div id="map_container"></div>
</div>
<div id="result" style="margin-top: 4px;"></div>
</div>
<div class="modal-footer">
<button class="btn btn-sm" data-dismiss="modal">
<i class="icon-remove"></i>
取消
</button>
<button id="qd" class="btn btn-sm btn-primary" type="button" onclick="sure()" >
<i class="icon-ok"></i>
确定
</button>
</div>
</div>
</div>
</div>
<script src="/assets/js/selectCity/selectCity.js"></script>
<link rel="stylesheet" href="$!{webUtils.getAssetsPath("/css/validator/bootstrapValidator.min.css")}" />
<script type="text/javascript" src="$!{webUtils.getAssetsPath("/js/validator/bootstrapValidator.min.js")}"></script>
<!-- <script type="text/javascript" src="/assets/js/bootstrapvalidator.js"></script> -->
<!-- <script type="text/javascript" src="$!{webUtils.getAssetsPath("js/diliCascade.js")}"></script> -->
<script type="text/javascript" src="/assets/js/riotjs.js"></script>
<script type="text/javascript" src="/assets/js/header_top.js"></script>
<script type="text/javascript" src="/assets/js/diliCascade.js"></script>
<script type="text/javascript">
$(function (){
var pcfg = {
name: "addressId", validate: {
required: true
}
, val: "$!{pickUp.addressId}"
, leafHandle: function(){
}
};
$("#begin").diliCity(pcfg);
})
function changeMark(val){
if(val==2){
$("#notMarketId input").attr("disabled",true);
$("#notMarketId").css('display','none');
}if(val==1){
$("#notMarketId input").attr("disabled",false);
$("#notMarketId").css('display','block');
var bootstrapValidator = $('#addForm').data('bootstrapValidator');
}
$("#markId").val(val);
}
function chosePosition(){
$("#submitBuId").attr("disabled",false);
var address = $(".categoryItemVal").attr("data-cate-txt");
// var pro = $(".address_province").find("option:selected").text();
$("select[name=addressId1]").text();
var pro = $("select[name=addressId1]").find("option:selected").text();
var city = $("select[name=addressId2]").find("option:selected").text();
var area = $("select[name=addressId3]").find("option:selected").text()
if(pro=="请选择"||city=="请选择"){
address="北京";
alert("请先选择市场地址!");
return;
}else{
address = pro+city+area;
if(city=="其他城市"){
address = pro;
}if(area=="请选择"){
address = pro+city;
}
$("#keyword").val(address);
local.search(address);
}
$("#modal-form").modal();
}
//posiotion
</script>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=1.2"></script>
<script type="text/javascript">
function getUrlParas(){
var hash = location.hash,
para = {},
tParas = hash.substr(1).split("&");
for(var p in tParas){
if(tParas.hasOwnProperty(p)){
var obj = tParas[p].split("=");
para[obj[0]] = obj[1];
}
}
return para;
}
var para = getUrlParas(),
center = para.address?decodeURIComponent(para.address) : "北京",
city = para.city?decodeURIComponent(para.city) : "北京";
// document.getElementById("keyword").value = center;
var marker_trick = false;
var map = new BMap.Map("map_container");
map.enableScrollWheelZoom();
var marker = new BMap.Marker(new BMap.Point(116.404, 39.915), {
enableMassClear: false,
raiseOnDrag: true
});
marker.enableDragging();
map.addOverlay(marker);
map.addEventListener("click", function(e){
if(!(e.overlay)){
map.clearOverlays();
marker.show();
marker.setPosition(e.point);
setResult(e.point.lng, e.point.lat);
}
});
marker.addEventListener("dragend", function(e){
setResult(e.point.lng, e.point.lat);
});
var local = new BMap.LocalSearch(map, {
renderOptions:{map: map},
pageCapacity: 1
});
local.setSearchCompleteCallback(function(results) {
if(local.getStatus() !== BMAP_STATUS_SUCCESS) {
var pro = $("select[name=addressId1]").find("option:selected").text();
var city = $("select[name=addressId2]").find("option:selected").text();
var address = pro+city;
$("#keyword").val(address);
local.search(address);
// alert("无结果");
} else {
marker.hide();
}
});
local.setMarkersSetCallback(function(pois) {
for(var i=pois.length; i--; ) {
var marker = pois[i].marker;
marker.addEventListener("click", function(e) {
marker_trick = true;
var pos = this.getPosition();
setResult(pos.lng, pos.lat);
});
}
});
window.onload = function() {
document.getElementById("search_button").onclick = function() {
local.search(document.getElementById("keyword").value);
};
document.getElementById("keyword").onkeyup = function(e) {
var me = this;
e = e || window.event;
var keycode = e.keyCode;
if(keycode === 13){
local.search(document.getElementById("keyword").value);
}
};
};
/*
* setResult : 定义得到标注经纬度后的操作
* 请修改此函数以满足您的需求
* lng: 标注的经度
* lat: 标注的纬度
*/
function setResult(lng, lat){
// document.getElementById("result").innerHTML = lng + ", " + lat;
$("#longitudeId").val(lng);
$("#latitudeId").val(lat);
}
function sure(){
if($("#longitudeId").val()==""){
alert("请在地图上将市场的地址定位到具体的地点!");
}else{
$('#modal-form').modal('hide');
$("#positionTxt").val("("+$("#longitudeId").val()+","+ $("#latitudeId").val()+")");
}
}
function getcity(cityId,e){
var pickId = $("#pickId").val();
$("#submitBuId").attr("disabled",false);
if(e.checked){
$.ajax({
type : 'post',
url : "/city/getCityInfo.do?parentId="+cityId,
success : function(data) {
var html="";
for(key in data){
## #foreach($selectCity in $selectCity)
## if($selectCity.pickId!=pickId&&$selectCity.cityId==data[key].regionId){
## continue;
## }
## #end
html+="<li id=licity"+cityId+"><label class='position-relative' style='width:236px;'><input type='checkbox' value="+data[key].regionId+" class='ace'><span class='lbl'>"+data[key].regionName+"("+$("#regId"+cityId).text()+")"+"</span></label> </li>"
}
$("#newLevlcityId").append(html);
},
error : function() {
alert("网络超时!");
}
});
}else{
$("#newLevlcityId li").remove("li[id=licity"+cityId+"]");
}
}
function checkAll(){
var check = $("#newLevlcityId li label input[type=checkbox]");
for(var i=0;i<check.length;i++){
if($("#checkAllId").is(':checked')){
if(!check[i].disabled){
check[i].checked=true;
}
} else{
check[i].checked=false;
}
}
}
</script>
<script type="text/javascript">
var tag="$!{pickUp.personList.size()}";
if(tag==0){
tag=1;
};
$(function(){
$("#add_contact").on("click",function(){
var contact_con = '<div class="form-group"><label class="col-sm-3 control-label no-padding-right" for="form-field-6"> </label><div class="col-xs-12 col-sm-4"> <span class="block input-icon input-icon-right">'
+'<input type="text" placeholder="联系人姓名" pickupname id=personName'+tag+' name=lxrxm'+tag+' required data-bv-message="必须填写!" onfocus="submitBtDisab()" data-bv-stringlength-message="超出了最大范围!" data-bv-stringlength="" data-bv-stringlength-max="125" maxlength="125" class="col-sm-6" value="" >'
+'<input type="text" placeholder="联系电话" pickuptel id=personTel'+tag+' name=lxrdh'+tag+'required data-bv-message="必须填写!" onfocus="submitBtDisab()" data-bv-stringlength-message="超出了最大范围!" data-bv-stringlength="" data-bv-stringlength-max="125" maxlength="125" class="col-sm-6" value="" >'
+'</span> '
+'</div><div> <a href="javascript:void(0);" class="remove_contact"> <i class="fa fa-minus " style=" line-height: 25px; margin-top: 5px; "></i></a></div></div>';
var html = $(contact_con);
tag = parseInt(tag)+1;
$("#add_position").after(html);
$(html).find(".remove_contact").on("click",function(){
tag = tag-1;
$(this).parents(".form-group").remove();
});
});
});
$(document).ready(function() {
var proId="";
var ss = "$!{pickUp.cityList}";
var procheck = $("#procityId li label input[type=checkbox]");
for(var i=0;i<procheck.length;i++){
if(procheck[i].checked==true){
proId=procheck[i].value;
$.ajax({
type : 'post',
url : "/city/getCityInfo.do?parentId="+proId,
async:false,
success : function(data) {
var html="";
var cityName = $("#regId"+proId).text();
for(key in data){
#foreach($cit in $!{pickUp.cityList})
if(data[key].regionId==$cit.cityId){
html+="<li id=licity"+data[key].parentId+" ><label class='position-relative'><input type='checkbox' checked='checked' value="+data[key].regionId+" class='ace'><span class='lbl'>"+data[key].regionName+"("+cityName+")"+"</span></label> </li>";
continue;
}
#end
## #foreach($selectCity in $selectCity)
## if($selectCity.cityId==data[key].regionId){
## continue;
## }
## #end
html+="<li id=licity"+proId+" ><label class='position-relative'><input type='checkbox' value="+data[key].regionId+" class='ace'><span class='lbl'>"+data[key].regionName+"("+cityName+")"+"</span></label> </li>";
}
$("#newLevlcityId").append(html);
},
error : function() {
alert("网络超时!");
}
});
}
}
$('#addForm').bootstrapValidator({submitHandler: function(validator, form, submitButton) {
if( $("#longitudeId").val()==""||$("#latitudeId").val()==""){
alert("请选择位置");
submitBtDisab();
return;
}
var name="";
var tele="";
var put = $("input[pickupname]");
var tel = $("input[pickuptel]");
for(var i=0;i<put.length;i++){
var mobile = /^1[3-8]\d{9}$/ ;
var rtel = /^(\d{3,4}-)\d{7,9}$/g;
if(put[i].value==""||tel[i].value==""){
alert("请填写联系人的联系方式");
submitBtDisab();
return;
}
if(rtel.test(tel[i].value)||(tel[i].value.length==11 && mobile.test(tel[i].value))){
name+=put[i].value+",";
tele+=tel[i].value+",";
}else{
alert("请填写正确联系方式");
submitBtDisab();
return;
}
}
var pro1 = $("select[name=addressId1]").find("option:selected").text();
var city1 = $("select[name=addressId2]").find("option:selected").text()
if(pro1=="请选择"||city1=="请选择"){
alert("请选择市场地址");
submitBtDisab();
return;
}
$("#contpId").val(name);
$("#contnId").val(tele);
var id="";
var proId="";
var procheck = $("#procityId li label input[type=checkbox]");
for(var i=0;i<procheck.length;i++){
if(procheck[i].checked==true){
proId+=procheck[i].value+',';
}
}
var check = $("#newLevlcityId li label input[type=checkbox]");
for(var i=0;i<check.length;i++){
if(check[i].checked==true){
id+=check[i].value+',';
}
}
$("#cityDetail").val(proId+id);
var ismk = $("#markId").val();
if(ismk=='2' && $('#glsc').val() == '-1'){
alert("请选择关联提货点");
submitBtDisab();
return;
}
if(ismk=="1"&&$.trim($("#thdjc").val())==""){
alert("请填写提货点简称");
submitBtDisab();
return;
}
if(ismk=="1"&&id==""){
alert("请选择关联城市");
submitBtDisab();
return ;
}
var data = $('#addForm').serializeArray();
$.ajax({
url: "/pick/update.do",
type : "post",
data : data,
success : function (data){
if(data.code==1){
window.location = "$!{webUtils.getLocalPath("pick/list.do")}";
}else{
alert(data.msg);
submitBtDisab();
}
}
});
}});
});
function removeGrp(e){
tag = tag-1;
$(e).parents(".form-group").remove();
}
function submitBtDisab(){
$("#submitBuId").attr("disabled",false);
}
</script>
</div>