6b478bfc by Zelig

联系人

1 parent f7eac9c1
......@@ -312,7 +312,7 @@
<div class="form-group col-sm-3 col-md-2">
<label>是您的</label>
<span class="form-control select-box">
<select class="select" size="1" name="clientContactInputVOS.<?=$k?>.contactRelation">
<select class="select" size="1" name="clientContactInputVOS.<?=$k?>.contactRelation" onchange="relation(this)" data-num="<?=$k?>">
<?php foreach ($this->session->relationEnum as $kk => $vv): ?>
<option <?= $vv && $v->contactRelation == $kk ? 'selected' : '' ?>
value="<?= $kk ?>"><?= $vv ?></option>
......@@ -322,7 +322,7 @@
</div>
<div class="form-group col-sm-3 col-md-2">
<label>手机号</label>
<input type="text" name="clientContactInputVOS.<?=$k?>.contactPhone" class="form-control input-text" value="<?=$v ? $v->contactPhone : ''?>">
<input type="text" name="clientContactInputVOS.<?=$k?>.contactPhone" class="form-control input-text" value="<?=$v ? $v->contactPhone : ''?>" onchange="phone(this)" phone>
</div>
<div class="form-group col-sm-3 col-md-2">
<label>工作单位</label>
......@@ -344,7 +344,7 @@
<div class="form-group col-sm-3 col-md-2">
<label>是您的</label>
<span class="form-control select-box">
<select class="select" size="1" name="clientContactInputVOS.{k}.contactRelation" disabled>
<select class="select" size="1" name="clientContactInputVOS.{k}.contactRelation" disabled onchange="relation(this)" data-num="{k}">
<?php foreach ($this->session->relationEnum as $k => $v): ?>
<option value="<?= $k ?>"><?= $v ?></option>
<?php endforeach; ?>
......@@ -353,7 +353,7 @@
</div>
<div class="form-group col-sm-3 col-md-2">
<label>手机号</label>
<input type="text" class="form-control input-text" name="clientContactInputVOS.{k}.contactPhone" value="" disabled>
<input type="text" class="form-control input-text" name="clientContactInputVOS.{k}.contactPhone" value="" disabled onchange="phone(this)" phone>
</div>
<div class="form-group col-sm-3 col-md-2">
<label>工作单位</label>
......@@ -401,7 +401,7 @@
</div>
<div class="form-group col-sm-3 col-md-2">
<label>贷款用途</label>
<input type="number" class="form-control input-text" name="applyOrderVO.use" value="<?= $applyOrderVO ? $applyOrderVO->use : '' ?>">
<input type="text" class="form-control input-text" name="applyOrderVO.use" value="<?= $applyOrderVO ? $applyOrderVO->use : '' ?>">
</div>
</div>
</div>
......@@ -469,9 +469,9 @@
var dwellDetail = $('[name=clientInfoInputVO\\.dwellState]:checked').parent().find('input[type=text]').val();
data.clientInfoInputVO.dwellDetail = dwellDetail;
if(checkContacts(data.clientContactInputVOS)) {
if(!checkContacts(data.clientContactInputVOS)) {
return;
}
return 1;
ajax('client/collection', 'post', data, '操作成功', function () {
window.parent.reload();
......@@ -507,6 +507,10 @@
}
});
$("form").validate({
rules: {}
});
uploadList();
</script>
</body>
......
......@@ -12,4 +12,31 @@ function addContacts () {
$('.btn.btn-primary.pannel-sh').on('click', function () {
$(this).parent().parent().siblings('.panel-body').toggle();
})
});
function relation (e) {
if($(e).data('num') < 3) {
const val = $(e).val();
if ( $.inArray($(e).val(), ["0", "1"]) === -1) {
layer.alert('头2个必须是直系亲属', function (index) {
$(e).val(0);
layer.close(index);
});
}
}
}
function phone (e) {
var phone = [];
$('input[phone]').each(function () {
if(e != this) {
phone.push($(this).val());
}
});
if( $.inArray($(e).val(), phone) !== -1) {
layer.alert('联系方式不能相同');
$(e).val('').focus();
}
}
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!