Commit e177cc20 authored by agping's avatar agping

修改 后台 跨城市 转勤

parent bee8ce54
......@@ -411,7 +411,7 @@
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭
</button>
<button type="button" class="btn btn-primary submit_user" data-dismiss="modal">
<button type="button" class="btn btn-primary submit_user_turn">
提交
</button>
</div>
......
......@@ -139,7 +139,11 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
e.stopPropagation();
agent.Submit_edit();
});
$(document).delegate(".submit_user_turn", "click", function(e) { //提交 编辑(跨城市 转勤)
e.preventDefault();
e.stopPropagation();
agent.Submit_edit_turn();
});
$(document).delegate("#role", "click", function(e) { //变更角色
var _this = $(this);
var _tempVal = _this.closest('tr').attr('data-groupname');
......@@ -398,7 +402,7 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
yes: function(_index){
layer.close(_index);
agent.confirm_old=1;
agent.Submit_edit();
agent.Submit_add();
}
});
}else{
......@@ -425,7 +429,6 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
params.remarks = $("#remarks").val();
params.status = $("#status").val();
params.password = $("input[name='password']").val();
params.confirm_old = agent.confirm_old;
if(params.phone == '') {
alert('手机号必填!');
return false;
......@@ -459,19 +462,64 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
alert('提交成功');
$("#modal-edit").modal('hide');
}else if(data.code == 101){
if(data.msg == '转勤'){
layer.open({
content: '该账号已经有相同账号,请问是否转勤?(转勤 即人员调配另外一个城市)转勤后,所有商铺和客户也都会转到新建的相同手机号里,请确定是否转勤。',
btn: ['确定转勤', '取消转勤'],
yes: function(_index){
layer.close(_index);
agent.confirm_old=1;
agent.Submit_edit();
}
});
}else{
console.log(555);
alert(data.msg);
} else {
}
}
});
},
Submit_edit_turn: function() {
//提交编辑的信息(跨城市 转勤)
var params = {}
params.id = agent.agent_id;
params.name = $("input[name = name]").val();
params.password = $("#password").val();
params.district_id = $("[name = district_id_business]").val();
params.store_id = $("[name = store_id_business]").val();
params.phone = $("input[name = phone]").val();
params.admin_off = $("#admin_off").val();
params.sex = $("input[name =sex]:checked").val();
params.remarks = $("#remarks").val();
params.status = $("#status").val();
params.password = $("input[name='password']").val();
params.confirm_old = 1;
if(params.phone == '') {
alert('手机号必填!');
return false;
}
if(params.district_id == '') {
alert('所属部门必填');
$("#modal-edit").show();
return false;
}
if(params.store_id == '') {
alert('所属门店必填');
$("#modal-edit").show();
return false;
}
if(params.phone.length != 11) {
alert('手机号码错误!');
$("#modal-edit").show();
return false;
}
$.ajax({
'type': 'POST',
'url': '/index/saveAgent',
data: params,
dataType: "json",
success: function(data) {
if(data.code == 200) {
alert('提交成功');
$("#modal-edit").modal('hide');
}else if(data.code == 101){
alert(data.msg);
}
} else {
}
......
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