Commit 901ef20f authored by hujun's avatar hujun

更换店长修改

parent 4b1f3575
......@@ -282,7 +282,6 @@
<div class="form-group">
<label class="col-sm-3 control-label">店长:</label>
<input type="text" value="" name="store-name" class="form-control btn6" placeholder="请输入店长" id="set_father_id3">
<input type="hidden" id="shop_id">
<ul class="user-ul">
</ul>
......
......@@ -52,9 +52,10 @@ class AStore extends BaseModel
])->column('id,level');
if ($agents_info) {
$agents_data = [];
foreach ($agents_info as $k=>$v) {
if ($agents_id != $k) {
//店长降级为业务员
//40等级和店长降级为业务员
$agents_data[$k]['id'] = $k;
$agents_data[$k]['level'] = 10;
$agents_data[$k]['store_id'] = $data['id'];
......@@ -62,9 +63,9 @@ class AStore extends BaseModel
}
$agents->saveAll($agents_data);
}
$agents_data['level'] = 20;
$agents_data['store_id'] = $data['id'];
$agents->editData($agents_data,$agents_id,'id');
$agents_store['level'] = 20;
$agents_store['store_id'] = $data['id'];
$agents->editData($agents_store,$agents_id,'id');
return $resutlt;
}
......
......@@ -10,6 +10,7 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin
/*每页显示多少条*/
id: '',
house_id: '',
agents_id:'',
type: '',
valueCurrent: '',
ajaxObj: '',
......@@ -51,13 +52,6 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin
store.house_id = $ (this).attr ("data-id");
store.Mend();
});
$ (document).on ("input","#cus_fang", function () {//手机号搜索客方2
if($("#cus_fang").val()==''){
$(".user-ul2").html('');
}else{
store.search_phone2();
}
});
$ (document).on ("input","#set_father_id3", function () {//手机号搜索客方
if($("#set_father_id3").val()==''){
$(".user-ul").html('');
......@@ -247,7 +241,7 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin
Submit_edit:function(){//提交编辑的信息
var par = {};
par.id = store.house_id;//门店id
par.agents_id = $("#shop_id").val();//经纪人id
par.agents_id = store.agents_id;//经纪人id
par.province = $("#province_internal").val();//省
par.city = $("#city_internal").val();//城市
par.district = $("#disc_internal").val();//区
......@@ -331,7 +325,7 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin
var user_ht=$(obj).html();
$("#set_father_id3").val(user_ht);
$(".user-ul").html('');
$("#shop_id").val($ (obj).attr ("data-id"));
store.agents_id = $ (obj).attr ("data-id");
},
search_phone:function(){//手机号
$.ajax ({
......@@ -340,7 +334,7 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin
async: true,
data: {
"phone":$("#set_father_id3").val(),
"level": 10
"level": "10,30"
},
dataType: 'json',
success: function (data) {
......@@ -358,31 +352,6 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin
}
});
},
search_phone2:function(){//手机号
$.ajax ({
url: '/index/getBroker_new',
type: 'GET',
async: true,
data: {
"phone":$("#cus_fang").val(),
"level": 10
},
dataType: 'json',
success: function (data) {
if (data.code == 200) {
var user_ul2 = "";
$.each(data.data, function(i,item) {
user_ul2+='<li class="addphone2" data-id="'+item.id+'">'+item.id+'-'+item.name+'-'+item.phone+'</li>';
});
$(".user-ul2").html(user_ul2);
} else {
alert(data.msg);
}
}
});
},
getDistrict: function(name) {
$.ajax({
url: '/index/getDistrictListByName',
......
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