联系人
Showing
2 changed files
with
39 additions
and
8 deletions
| ... | @@ -312,7 +312,7 @@ | ... | @@ -312,7 +312,7 @@ |
| 312 | <div class="form-group col-sm-3 col-md-2"> | 312 | <div class="form-group col-sm-3 col-md-2"> |
| 313 | <label>是您的</label> | 313 | <label>是您的</label> |
| 314 | <span class="form-control select-box"> | 314 | <span class="form-control select-box"> |
| 315 | <select class="select" size="1" name="clientContactInputVOS.<?=$k?>.contactRelation"> | 315 | <select class="select" size="1" name="clientContactInputVOS.<?=$k?>.contactRelation" onchange="relation(this)" data-num="<?=$k?>"> |
| 316 | <?php foreach ($this->session->relationEnum as $kk => $vv): ?> | 316 | <?php foreach ($this->session->relationEnum as $kk => $vv): ?> |
| 317 | <option <?= $vv && $v->contactRelation == $kk ? 'selected' : '' ?> | 317 | <option <?= $vv && $v->contactRelation == $kk ? 'selected' : '' ?> |
| 318 | value="<?= $kk ?>"><?= $vv ?></option> | 318 | value="<?= $kk ?>"><?= $vv ?></option> |
| ... | @@ -322,7 +322,7 @@ | ... | @@ -322,7 +322,7 @@ |
| 322 | </div> | 322 | </div> |
| 323 | <div class="form-group col-sm-3 col-md-2"> | 323 | <div class="form-group col-sm-3 col-md-2"> |
| 324 | <label>手机号</label> | 324 | <label>手机号</label> |
| 325 | <input type="text" name="clientContactInputVOS.<?=$k?>.contactPhone" class="form-control input-text" value="<?=$v ? $v->contactPhone : ''?>"> | 325 | <input type="text" name="clientContactInputVOS.<?=$k?>.contactPhone" class="form-control input-text" value="<?=$v ? $v->contactPhone : ''?>" onchange="phone(this)" phone> |
| 326 | </div> | 326 | </div> |
| 327 | <div class="form-group col-sm-3 col-md-2"> | 327 | <div class="form-group col-sm-3 col-md-2"> |
| 328 | <label>工作单位</label> | 328 | <label>工作单位</label> |
| ... | @@ -344,7 +344,7 @@ | ... | @@ -344,7 +344,7 @@ |
| 344 | <div class="form-group col-sm-3 col-md-2"> | 344 | <div class="form-group col-sm-3 col-md-2"> |
| 345 | <label>是您的</label> | 345 | <label>是您的</label> |
| 346 | <span class="form-control select-box"> | 346 | <span class="form-control select-box"> |
| 347 | <select class="select" size="1" name="clientContactInputVOS.{k}.contactRelation" disabled> | 347 | <select class="select" size="1" name="clientContactInputVOS.{k}.contactRelation" disabled onchange="relation(this)" data-num="{k}"> |
| 348 | <?php foreach ($this->session->relationEnum as $k => $v): ?> | 348 | <?php foreach ($this->session->relationEnum as $k => $v): ?> |
| 349 | <option value="<?= $k ?>"><?= $v ?></option> | 349 | <option value="<?= $k ?>"><?= $v ?></option> |
| 350 | <?php endforeach; ?> | 350 | <?php endforeach; ?> |
| ... | @@ -353,7 +353,7 @@ | ... | @@ -353,7 +353,7 @@ |
| 353 | </div> | 353 | </div> |
| 354 | <div class="form-group col-sm-3 col-md-2"> | 354 | <div class="form-group col-sm-3 col-md-2"> |
| 355 | <label>手机号</label> | 355 | <label>手机号</label> |
| 356 | <input type="text" class="form-control input-text" name="clientContactInputVOS.{k}.contactPhone" value="" disabled> | 356 | <input type="text" class="form-control input-text" name="clientContactInputVOS.{k}.contactPhone" value="" disabled onchange="phone(this)" phone> |
| 357 | </div> | 357 | </div> |
| 358 | <div class="form-group col-sm-3 col-md-2"> | 358 | <div class="form-group col-sm-3 col-md-2"> |
| 359 | <label>工作单位</label> | 359 | <label>工作单位</label> |
| ... | @@ -401,7 +401,7 @@ | ... | @@ -401,7 +401,7 @@ |
| 401 | </div> | 401 | </div> |
| 402 | <div class="form-group col-sm-3 col-md-2"> | 402 | <div class="form-group col-sm-3 col-md-2"> |
| 403 | <label>贷款用途</label> | 403 | <label>贷款用途</label> |
| 404 | <input type="number" class="form-control input-text" name="applyOrderVO.use" value="<?= $applyOrderVO ? $applyOrderVO->use : '' ?>"> | 404 | <input type="text" class="form-control input-text" name="applyOrderVO.use" value="<?= $applyOrderVO ? $applyOrderVO->use : '' ?>"> |
| 405 | </div> | 405 | </div> |
| 406 | </div> | 406 | </div> |
| 407 | </div> | 407 | </div> |
| ... | @@ -469,9 +469,9 @@ | ... | @@ -469,9 +469,9 @@ |
| 469 | var dwellDetail = $('[name=clientInfoInputVO\\.dwellState]:checked').parent().find('input[type=text]').val(); | 469 | var dwellDetail = $('[name=clientInfoInputVO\\.dwellState]:checked').parent().find('input[type=text]').val(); |
| 470 | data.clientInfoInputVO.dwellDetail = dwellDetail; | 470 | data.clientInfoInputVO.dwellDetail = dwellDetail; |
| 471 | 471 | ||
| 472 | if(checkContacts(data.clientContactInputVOS)) { | 472 | if(!checkContacts(data.clientContactInputVOS)) { |
| 473 | return; | ||
| 473 | } | 474 | } |
| 474 | return 1; | ||
| 475 | 475 | ||
| 476 | ajax('client/collection', 'post', data, '操作成功', function () { | 476 | ajax('client/collection', 'post', data, '操作成功', function () { |
| 477 | window.parent.reload(); | 477 | window.parent.reload(); |
| ... | @@ -507,6 +507,10 @@ | ... | @@ -507,6 +507,10 @@ |
| 507 | } | 507 | } |
| 508 | }); | 508 | }); |
| 509 | 509 | ||
| 510 | $("form").validate({ | ||
| 511 | rules: {} | ||
| 512 | }); | ||
| 513 | |||
| 510 | uploadList(); | 514 | uploadList(); |
| 511 | </script> | 515 | </script> |
| 512 | </body> | 516 | </body> | ... | ... |
| ... | @@ -12,4 +12,31 @@ function addContacts () { | ... | @@ -12,4 +12,31 @@ function addContacts () { |
| 12 | 12 | ||
| 13 | $('.btn.btn-primary.pannel-sh').on('click', function () { | 13 | $('.btn.btn-primary.pannel-sh').on('click', function () { |
| 14 | $(this).parent().parent().siblings('.panel-body').toggle(); | 14 | $(this).parent().parent().siblings('.panel-body').toggle(); |
| 15 | }) | 15 | }); |
| 16 | |||
| 17 | function relation (e) { | ||
| 18 | if($(e).data('num') < 3) { | ||
| 19 | const val = $(e).val(); | ||
| 20 | if ( $.inArray($(e).val(), ["0", "1"]) === -1) { | ||
| 21 | layer.alert('头2个必须是直系亲属', function (index) { | ||
| 22 | $(e).val(0); | ||
| 23 | layer.close(index); | ||
| 24 | }); | ||
| 25 | } | ||
| 26 | } | ||
| 27 | } | ||
| 28 | |||
| 29 | function phone (e) { | ||
| 30 | var phone = []; | ||
| 31 | |||
| 32 | $('input[phone]').each(function () { | ||
| 33 | if(e != this) { | ||
| 34 | phone.push($(this).val()); | ||
| 35 | } | ||
| 36 | }); | ||
| 37 | |||
| 38 | if( $.inArray($(e).val(), phone) !== -1) { | ||
| 39 | layer.alert('联系方式不能相同'); | ||
| 40 | $(e).val('').focus(); | ||
| 41 | } | ||
| 42 | } | ... | ... |
-
Please register or sign in to post a comment