Commit 234ed1e1 authored by hujun's avatar hujun

修改新增门店和编辑门店

parent e670e360
...@@ -83,7 +83,7 @@ class Broker extends Basic ...@@ -83,7 +83,7 @@ class Broker extends Basic
if ($where) { if ($where) {
$agent = new AAgents(); $agent = new AAgents();
$field = 'id,name,phone'; $field = 'id,name,phone';
$data['data'] = $agent->getList($pageNo, $pageSize, 'id DESC', $field, $where); $data['data'] = $agent->getList($pageNo, $pageSize, 'id DESC', $field, '', $where);
} else { } else {
$data['msg'] = '没有经纪人信息'; $data['msg'] = '没有经纪人信息';
} }
...@@ -113,7 +113,7 @@ class Broker extends Basic ...@@ -113,7 +113,7 @@ class Broker extends Basic
if ($this->params['store_id']) { if ($this->params['store_id']) {
$agent = new AAgents(); $agent = new AAgents();
$field = 'id,name,phone,level,create_time'; $field = 'id,name,phone,level,create_time';
$data['data'] = $agent->getList($pageNo, $pageSize, 'id DESC', $field, $where); $data['data'] = $agent->getList($pageNo, $pageSize, 'id DESC', $field, '', $where);
} else { } else {
$data['msg'] = 'store_id is null'; $data['msg'] = 'store_id is null';
} }
......
...@@ -282,6 +282,7 @@ ...@@ -282,6 +282,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">店长:</label> <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="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 class="user-ul">
</ul> </ul>
......
...@@ -6,7 +6,7 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin ...@@ -6,7 +6,7 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin
store = { store = {
pageNo: 1, pageNo: 1,
/*第几页*/ /*第几页*/
pageSize: 10, pageSize: 15,
/*每页显示多少条*/ /*每页显示多少条*/
id: '', id: '',
house_id: '', house_id: '',
...@@ -223,6 +223,7 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin ...@@ -223,6 +223,7 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin
dataType: "json", dataType: "json",
success: function(data){ success: function(data){
if (data.data) { if (data.data) {
document.getElementById('form_id').reset();
$("input[name = address]").val(data.data.address);//公司的详细地址 $("input[name = address]").val(data.data.address);//公司的详细地址
$("input[name = name]").val(data.data.store_name);//门店名 $("input[name = name]").val(data.data.store_name);//门店名
$("#pid-select").val(data.data.scale)//规模 $("#pid-select").val(data.data.scale)//规模
...@@ -235,7 +236,6 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin ...@@ -235,7 +236,6 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin
$("#latitude").val(data.data.latitude)//经纬度 $("#latitude").val(data.data.latitude)//经纬度
store.agents_id=data.data.agents_id;//经纪人id store.agents_id=data.data.agents_id;//经纪人id
store.district_id=data.data.district_id;//部门id store.district_id=data.data.district_id;//部门id
store.getDistrict(data.data.district_name); store.getDistrict(data.data.district_name);
} }
else { else {
...@@ -245,18 +245,19 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin ...@@ -245,18 +245,19 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin
}); });
}, },
Submit_edit:function(){//提交编辑的信息 Submit_edit:function(){//提交编辑的信息
var par={}; var par = {};
par.id= store.house_id;//门店id par.id = store.house_id;//门店id
par.agents_id=store.agents_id;//经纪人id par.agents_id = $("#shop_id").val();//经纪人id
par.province=$("#province_internal").val();//省 par.province = $("#province_internal").val();//省
par.city=$("#city_internal").val();//城市 par.city = $("#city_internal").val();//城市
par.district=$("#disc_internal").val();//区 par.district = $("#disc_internal").val();//区
par.address=$("input[name =address]").val();//详细地址 par.address = $("input[name =address]").val();//详细地址
par.longitude=$("input[name =longitude]").val();//经度 par.longitude = $("input[name =longitude]").val();//经度
par.latitude=$("input[name =latitude]").val();//纬度 par.latitude = $("input[name =latitude]").val();//纬度
par.store_name=$("input[name =name]").val();//门店名 par.store_name = $("input[name =name]").val();//门店名
par.scale=$("#pid-select option:selected").val();//规模 par.scale = $("#pid-select option:selected").val();//规模
par.district_id=store.district_id;//部门id par.district_id= $("#ss-store option:selected").val();//部门id
console.log(par);
$.ajax({ $.ajax({
'type': 'POST', 'type': 'POST',
'url' : '/index/addStore', 'url' : '/index/addStore',
...@@ -283,7 +284,7 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin ...@@ -283,7 +284,7 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin
if (data.data) { if (data.data) {
$.each(data.data,function(i,item){ $.each(data.data,function(i,item){
mend_table+='<tr><td>'+item.create_time+'</td> <td>'+item.id+'</td> <td>'+item.name+'</td><td>'+item.phone+'</td> </tr>' mend_table+='<tr><td>'+item.create_time+'</td> <td>'+item.id+'</td> <td>'+item.name+'</td><td>'+item.phone+'</td> </tr>'
}) });
$("#mend_table").html(mend_table); $("#mend_table").html(mend_table);
} }
} else { } else {
...@@ -329,22 +330,23 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin ...@@ -329,22 +330,23 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin
var user_ht=$(obj).html(); var user_ht=$(obj).html();
$("#set_father_id3").val(user_ht); $("#set_father_id3").val(user_ht);
$(".user-ul").html(''); $(".user-ul").html('');
store.agent_id = $ (obj).attr ("data-id"); $("#shop_id").val($ (obj).attr ("data-id"));
}, },
search_phone:function(){//手机号 search_phone:function(){//手机号
$.ajax ({ $.ajax ({
url: '/index/select_by_phone', url: '/index/getBroker_new',
type: 'POST', type: 'GET',
async: true, async: true,
data: { data: {
"phone":$("#set_father_id3").val() "phone":$("#set_father_id3").val(),
"level": 10
}, },
dataType: 'json', dataType: 'json',
success: function (data) { success: function (data) {
if (data.code == 200) { if (data.code == 200) {
var user_ul = ""; var user_ul = "";
$.each(data.data, function(i,item) { $.each(data.data, function(i,item) {
user_ul+='<li class="addphone" data-id="'+item.id+'">'+item.id+'-'+item.realname+'-'+item.phone+'</li>'; user_ul+='<li class="addphone" data-id="'+item.id+'">'+item.id+'-'+item.name+'-'+item.phone+'</li>';
}); });
$(".user-ul").html(user_ul); $(".user-ul").html(user_ul);
...@@ -357,18 +359,19 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin ...@@ -357,18 +359,19 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin
}, },
search_phone2:function(){//手机号 search_phone2:function(){//手机号
$.ajax ({ $.ajax ({
url: '/index/select_by_phone', url: '/index/getBroker_new',
type: 'POST', type: 'GET',
async: true, async: true,
data: { data: {
"phone":$("#cus_fang").val() "phone":$("#cus_fang").val(),
"level": 10
}, },
dataType: 'json', dataType: 'json',
success: function (data) { success: function (data) {
if (data.code == 200) { if (data.code == 200) {
var user_ul2 = ""; var user_ul2 = "";
$.each(data.data, function(i,item) { $.each(data.data, function(i,item) {
user_ul2+='<li class="addphone2" data-id="'+item.id+'">'+item.id+'-'+item.realname+'-'+item.phone+'</li>'; user_ul2+='<li class="addphone2" data-id="'+item.id+'">'+item.id+'-'+item.name+'-'+item.phone+'</li>';
}); });
$(".user-ul2").html(user_ul2); $(".user-ul2").html(user_ul2);
......
...@@ -2,7 +2,11 @@ ...@@ -2,7 +2,11 @@
[% if(it) { %] [% if(it) { %]
[% for(var item in it){ %] [% for(var item in it){ %]
<tr class="text-center"> <tr class="text-center">
<td>[%= it[item]['district_name'] %]</td> <td>
[% if(it[item]['district_name']) { %]
[%= it[item]['district_name'] %]
[% } %]
</td>
<td>[%= it[item]['create_time'] %]</td> <td>[%= it[item]['create_time'] %]</td>
<td>[%= it[item]['id'] %]</td> <td>[%= it[item]['id'] %]</td>
<td>[%= it[item]['store_name'] %]</td> <td>[%= it[item]['store_name'] %]</td>
......
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