Commit f1b87ad7 authored by agping's avatar agping

身份

parent 5b5cfdad
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
<input type="hidden" class="page-load" id="agent" /> <input type="hidden" class="page-load" id="agent" />
<!--关联经纪人列表liudanjs文件--> <!--关联经纪人列表liudanjs文件-->
<style> <style>
.form-group{
margin-bottom: 6px;
}
.J_preview { .J_preview {
width: 30px; width: 30px;
height: 30px; height: 30px;
...@@ -12,7 +15,7 @@ ...@@ -12,7 +15,7 @@
overflow-y: auto; overflow-y: auto;
height: 432px; height: 432px;
} }
#container_body_img_area>div{ #container_body_img_area>div,#container_body_img_area_add>div{
float: left; float: left;
width: 216px; width: 216px;
} }
...@@ -82,11 +85,16 @@ ...@@ -82,11 +85,16 @@
height: 120px; height: 120px;
margin-top: 8px; margin-top: 8px;
} }
.result-reverse>img,.result-positive>img,.result-reverse-edit>img,.result-positive-edit>img{
width: 80px;
height: 80px;
margin-top: 3px;
}
#container_body{ #container_body{
position: relative; position: relative;
overflow: hidden; overflow: hidden;
} }
#file_input { #file_input,#file_input_positive,#file_input_reverse,#file_input_positive_edit,#file_input_reverse_edit{
opacity: 0; opacity: 0;
position: absolute; position: absolute;
top: 0; top: 0;
...@@ -95,10 +103,13 @@ ...@@ -95,10 +103,13 @@
width: 80px; width: 80px;
cursor: pointer; cursor: pointer;
} }
#file_input_positive,#file_input_reverse,#file_input_positive_edit,#file_input_reverse_edit{
left: 0px;
}
.modal-body-width{ .modal-body-width{
width: 800px; width: 800px;
} }
.span-del2,.span-del{ .span-del2,.span-del,.span-del-reverse,.span-del-positive{
color: red; color: red;
cursor: pointer; cursor: pointer;
} }
...@@ -281,7 +292,29 @@ ...@@ -281,7 +292,29 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label">个人说明:</label> <label class="col-sm-4 control-label">个人说明:</label>
<textarea name="remarks" id="remarks_add" class="form-control btn6" length="120" rows="5" placeholder="请填写个人说明"></textarea> <textarea name="remarks" id="remarks_add" class="form-control btn6" length="120" rows="2" placeholder="请填写个人说明"></textarea>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">身份证<span class="text-danger">正面</span>1张图片:(选填):</label>
<div class="form-group full-width-100 full-pic-area">
<div id="container_body">
<!--<label>请选择一个图像文件:</label>-->
<button type="button btn2" class="btn btn-default">上传图片</button>
<input type="file" id="file_input_positive">
<div id="container_body_img_area_positive"></div>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">身份证<span class="text-danger">反面</span>1张图片:(选填):</label>
<div class="form-group full-width-100 full-pic-area">
<div id="container_body">
<!--<label>请选择一个图像文件:</label>-->
<button type="button btn2" class="btn btn-default">上传图片</button>
<input type="file" id="file_input_reverse">
<div id="container_body_img_area_reverse"></div>
</div>
</div>
</div> </div>
</form> </form>
</div> </div>
...@@ -323,10 +356,6 @@ ...@@ -323,10 +356,6 @@
<label class="col-sm-4 control-label">身份证号:</label> <label class="col-sm-4 control-label">身份证号:</label>
<input type="number" class="form-control btn6" name="identity" value="" placeholder="填写身份证号"> <input type="number" class="form-control btn6" name="identity" value="" placeholder="填写身份证号">
</div> </div>
<div class="form-group">
<label class="col-sm-4 control-label">身份证号:</label>
<input type="number" class="form-control btn6" name="identity" value="" placeholder="填写身份证号">
</div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label">密码:</label> <label class="col-sm-4 control-label">密码:</label>
<input type="text" class="form-control btn6" name="password" id="password" value="44444" placeholder="填写密码"> <input type="text" class="form-control btn6" name="password" id="password" value="44444" placeholder="填写密码">
...@@ -380,6 +409,29 @@ ...@@ -380,6 +409,29 @@
<label class="col-sm-4 control-label">个人说明:</label> <label class="col-sm-4 control-label">个人说明:</label>
<textarea name="remarks" id="remarks" class="form-control btn6" length="120" rows="2" placeholder="请填写个人说明"></textarea> <textarea name="remarks" id="remarks" class="form-control btn6" length="120" rows="2" placeholder="请填写个人说明"></textarea>
</div> </div>
<!--编辑 上传身份证图片-->
<div class="form-group">
<label class="col-sm-5 control-label">身份证<span class="text-danger">正面</span>1张图片:(选填):</label>
<div class="form-group full-width-100 full-pic-area">
<div id="container_body">
<!--<label>请选择一个图像文件:</label>-->
<button type="button btn2" class="btn btn-default">上传图片</button>
<input type="file" id="file_input_positive_edit">
<div id="container_body_img_area_positive_edit"></div>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-5 control-label">身份证<span class="text-danger">反面</span>1张图片:(选填):</label>
<div class="form-group full-width-100 full-pic-area">
<div id="container_body">
<!--<label>请选择一个图像文件:</label>-->
<button type="button btn2" class="btn btn-default">上传图片</button>
<input type="file" id="file_input_reverse_edit">
<div id="container_body_img_area_reverse_edit"></div>
</div>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label">建设银行工资卡:</label> <label class="col-sm-4 control-label">建设银行工资卡:</label>
<div style="float: left;"> <div style="float: left;">
......
...@@ -115,10 +115,17 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp ...@@ -115,10 +115,17 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
$(document).delegate(".agent_add", "click", function() { //点击新增 $(document).delegate(".agent_add", "click", function() { //点击新增
$(".form-horizontal-add")[0].reset(); //重置表单 $(".form-horizontal-add")[0].reset(); //重置表单
agent.confirm_old=''//是否转勤 置空 agent.confirm_old=''//是否转勤 置空
//置空图片
$('#container_body_img_area_positive').html('');
$('#container_body_img_area_reverse').html('');
}); });
$(document).delegate(".edit", "click", function() { //点击编辑 $(document).delegate(".edit", "click", function() { //点击编辑
$(".form-horizontal-edit")[0].reset(); //重置表单 $(".form-horizontal-edit")[0].reset(); //重置表单
agent.agent_id = $(this).attr("data-id"); agent.agent_id = $(this).attr("data-id");
//置空图片
$('#container_body_img_area_positive_edit').html('');
$('#container_body_img_area_reverse_edit').html('');
agent.Edit(); agent.Edit();
}); });
$(document).delegate("#password", "click", function() { $(document).delegate("#password", "click", function() {
...@@ -373,7 +380,7 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp ...@@ -373,7 +380,7 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
}); });
//图片删除事件 //图片删除事件
_doc.on('click', '.span-del', function(e) { _doc.on('click', '.span-del,span-del-positive,span-del-reverse', function(e) {
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
$(this).parent().remove(); $(this).parent().remove();
...@@ -441,7 +448,157 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp ...@@ -441,7 +448,157 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
} }
}); });
}); });
//新增经纪人 上传身份证反面图片
$('#file_input_reverse').on('change', function(){
var _this = $(this);
var formData = new FormData();
formData.append('type', 'user_id_card');
formData.append('image', _this[0].files[0]);
$.ajax({
type: 'post',
url: ServerHostImageLiu + '/index/uploadImg',
data: formData,
dataType: 'json',
contentType: false,
cache: false,
processData: false,
beforeSend: function() {},
success: function(_data) {
if(_data.code == 200) {
$('#container_body_img_area_reverse').append('<div class="result-reverse"><img data-imgname="{0}" src="{1}" alt=""/> <span class="span-del-reverse">删除</span></div>'.stringFormatObj({
'0': _data.data.img_path,
'1':ServerHostImageLiu + '/static/user_id_card/' + _data.data.internet_img_name
}));
} else {
alert(_data.msg);
};
},
error: function() {
alert('enter error');
},
complete: function(xhr, textStatus) {
if(textStatus === 'timeout') {
//处理超时的逻辑
alert('请求超时,请重试');
};
}
});
});
//新增经纪人 上传身份证正面图片
$('#file_input_positive').on('change', function(){
var _this = $(this);
var formData = new FormData();
formData.append('type', 'user_id_card');
formData.append('image', _this[0].files[0]);
$.ajax({
type: 'post',
url: ServerHostImageLiu + '/index/uploadImg',
data: formData,
dataType: 'json',
contentType: false,
cache: false,
processData: false,
beforeSend: function() {},
success: function(_data) {
if(_data.code == 200) {
$('#container_body_img_area_positive').append('<div class="result-positive"><img data-imgname="{0}" src="{1}" alt=""/> <span class="span-del-positive">删除</span></div>'.stringFormatObj({
'0': _data.data.img_path,
'1':ServerHostImageLiu + '/static/user_id_card/' + _data.data.internet_img_name
}));
} else {
alert(_data.msg);
};
},
error: function() {
alert('enter error');
},
complete: function(xhr, textStatus) {
if(textStatus === 'timeout') {
//处理超时的逻辑
alert('请求超时,请重试');
};
}
});
});
//编辑经纪人 上传身份证反面图片
$('#file_input_reverse_edit').on('change', function(){
var _this = $(this);
var formData = new FormData();
formData.append('type', 'user_id_card');
formData.append('image', _this[0].files[0]);
$.ajax({
type: 'post',
url: ServerHostImageLiu + '/index/uploadImg',
data: formData,
dataType: 'json',
contentType: false,
cache: false,
processData: false,
beforeSend: function() {},
success: function(_data) {
if(_data.code == 200) {
$('#container_body_img_area_reverse_edit').append('<div class="result-reverse-edit"><img data-imgname="{0}" src="{1}" alt=""/> <span class="span-del-reverse">删除</span></div>'.stringFormatObj({
'0': _data.data.img_path,
'1':ServerHostImageLiu + '/static/user_id_card/' + _data.data.internet_img_name
}));
} else {
alert(_data.msg);
};
},
error: function() {
alert('enter error');
},
complete: function(xhr, textStatus) {
if(textStatus === 'timeout') {
//处理超时的逻辑
alert('请求超时,请重试');
};
}
});
});
//编辑经纪人 上传身份证正面图片
$('#file_input_positive_edit').on('change', function(){
var _this = $(this);
var formData = new FormData();
formData.append('type', 'user_id_card');
formData.append('image', _this[0].files[0]);
$.ajax({
type: 'post',
url: ServerHostImageLiu + '/index/uploadImg',
data: formData,
dataType: 'json',
contentType: false,
cache: false,
processData: false,
beforeSend: function() {},
success: function(_data) {
if(_data.code == 200) {
$('#container_body_img_area_positive_edit').append('<div class="result-positive-edit"><img data-imgname="{0}" src="{1}" alt=""/> <span class="span-del-positive">删除</span></div>'.stringFormatObj({
'0': _data.data.img_path,
'1':ServerHostImageLiu + '/static/user_id_card/' + _data.data.internet_img_name
}));
} else {
alert(_data.msg);
};
},
error: function() {
alert('enter error');
},
complete: function(xhr, textStatus) {
if(textStatus === 'timeout') {
//处理超时的逻辑
alert('请求超时,请重试');
};
}
});
});
}, },
Submit_user: function() { //提交变更的信息 Submit_user: function() { //提交变更的信息
var group_id = $("#edit_role").val(); var group_id = $("#edit_role").val();
$.ajax({ $.ajax({
...@@ -476,6 +633,10 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp ...@@ -476,6 +633,10 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
$("input[name = id]").val(data.data.id); $("input[name = id]").val(data.data.id);
$("input[name = phone]").val(data.data.phone); $("input[name = phone]").val(data.data.phone);
$("input[name = name]").val(data.data.name); $("input[name = name]").val(data.data.name);
$("input[name = identity]").val(data.data.id_card);//身份证号
$(".card-name").val(data.data.account);
$(".card-num").val(data.data.card_no);
$(".card-account").val(data.data.bank);
$("[name = district_id]").val(data.data.district_id); $("[name = district_id]").val(data.data.district_id);
if(data.data.district_id) { if(data.data.district_id) {
agent.getDistrictStoreList(data.data.district_id, function(_data) { agent.getDistrictStoreList(data.data.district_id, function(_data) {
...@@ -502,6 +663,21 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp ...@@ -502,6 +663,21 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
} else { } else {
$("#sex2").attr('checked', true); $("#sex2").attr('checked', true);
} }
//获取正面图片
if(data.data.id_card_image_front){
$('#container_body_img_area_positive_edit').append('<div class="result-positive-edit"><img data-imgname="{0}" src="{1}" alt=""/> <span class="span-del-edit-positive">删除</span></div>'.stringFormatObj({
'0': data.data.id_card_image_front,
'1':ServerHostImageLiu + '/static/user_id_card/' + data.data.id_card_image_front
}));
}
//获取反面图片
if(data.data.id_card_image_back){
$('#container_body_img_area_reverse_edit').append('<div class="result-reverse-edit"><img data-imgname="{0}" src="{1}" alt=""/> <span class="span-del-edit-reverse">删除</span></div>'.stringFormatObj({
'0': data.data.id_card_image_front,
'1':ServerHostImageLiu + '/static/user_id_card/' + data.data.id_card_image_back
}));
}
} }
} else { } else {
...@@ -526,6 +702,13 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp ...@@ -526,6 +702,13 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
params.status = $("#status_add").val(); params.status = $("#status_add").val();
params.password = $("input[name='password_add']").val(); params.password = $("input[name='password_add']").val();
params.confirm_old = agent.confirm_old; params.confirm_old = agent.confirm_old;
//新增经纪人 正反面图片
params.id_card_image_front = $('.result-positive>img').attr('data-imgname');
params.id_card_image_back = $('.result-reverse>img').attr('data-imgname');
params.id_card = $("input[name = identity_add]").val();
if(params.phone == '') { if(params.phone == '') {
alert('手机号必填!'); alert('手机号必填!');
return false; return false;
...@@ -624,6 +807,9 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp ...@@ -624,6 +807,9 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
params.remarks = $("#remarks").val(); params.remarks = $("#remarks").val();
params.status = $("#status").val(); params.status = $("#status").val();
params.password = $("input[name='password']").val(); params.password = $("input[name='password']").val();
params.id_card = $("input[name = identity]").val();//身份证号
if(params.phone == '') { if(params.phone == '') {
alert('手机号必填!'); alert('手机号必填!');
return false; return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment