Commit 06d9282a authored by clone's avatar clone

Merge branch '0703-v3.3.4' of https://gitee.com/zwyjjc/tl_estate into 0703-v3.3.4

parents a8ea05d0 eda976fb
...@@ -67,7 +67,7 @@ class AppointmentTime extends Basic ...@@ -67,7 +67,7 @@ class AppointmentTime extends Basic
//todo 验证楼盘信息 //todo 验证楼盘信息
if (isset($params["house_id"]) && isset($params["house_title"])) { if (isset($params["house_id"]) && isset($params["house_title"])) {
$where_["id"] = $params["house_id"]; $where_["id"] = $params["house_id"];
$houseInfo = $this->houseInfoModel->getHouseDetail("id", $where_); $houseInfo = $this->houseInfoModel->getHouseDetail("id,city", $where_);
if (count($houseInfo) <= 0) { if (count($houseInfo) <= 0) {
return $this->response("101", "楼盘ID或楼盘名错误"); return $this->response("101", "楼盘ID或楼盘名错误");
} }
...@@ -83,10 +83,12 @@ class AppointmentTime extends Basic ...@@ -83,10 +83,12 @@ class AppointmentTime extends Basic
return $this->response("101", "预约时间为空,或者小于当前时间"); return $this->response("101", "预约时间为空,或者小于当前时间");
} }
$m_user = new Users(); $m_user = new Users();
$appoint_agent_id = $m_user->getUserByWhereValue('agent_id', ['id'=>$this->userId]); $appoint_agent_id = $m_user->getAgentBySiteIdCity('c.id', ['a.id'=>$this->userId,'d.city'=>$houseInfo['city']]);
if (empty($appoint_agent_id)) { if (empty($appoint_agent_id['id'])) {
$m_house_agent = new GHousesToAgents(); $m_house_agent = new GHousesToAgents();
$appoint_agent_id = $m_house_agent->getAgentHouseValue('agents_id',['houses_id'=>$params["house_id"],'type'=>2]); $appoint_agent_id = $m_house_agent->getAgentHouseValue('agents_id',['houses_id'=>$params["house_id"],'type'=>2]);
} else {
$appoint_agent_id = $appoint_agent_id['id'];
} }
$addPrams = array( $addPrams = array(
'expect_time' => date("Y-m-d H:i:s", $params["expect_time"] / 1000), 'expect_time' => date("Y-m-d H:i:s", $params["expect_time"] / 1000),
......
...@@ -378,7 +378,38 @@ ...@@ -378,7 +378,38 @@
</div> </div>
<!-- /.modal --> <!-- /.modal -->
</div> </div>
<!--转勤 修改手机号-->
<div class="modal fade" id="modal-editPhone" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
×
</button>
<h4 class="modal-title">
修改手机号
</h4>
</div>
<div class="modal-body">
<form class="form-horizontal">
<div class="form-group">
<label class="col-sm-4 control-label">电话(登录账号):</label>
<input type="number" class="form-control btn6" id="edit-phone" value="" placeholder="填写手机号">
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭
</button>
<button type="button" class="btn btn-primary edit-phone-save">
提交
</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
<!--变更角色--> <!--变更角色-->
<div class="modal fade" id="modal-user" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal fade" id="modal-user" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog"> <div class="modal-dialog">
...@@ -427,6 +458,7 @@ ...@@ -427,6 +458,7 @@
<div class="modal-body"> <div class="modal-body">
<form class="form-horizontal"> <form class="form-horizontal">
<div class="form-group"> <div class="form-group">
<button type="button" class="btn btn-primary del-record" style="margin: 6px;">清空解绑设备记录</button>
<table class="table table-striped table-bordered table-hover table-condensed"> <table class="table table-striped table-bordered table-hover table-condensed">
<thead> <thead>
<tr> <tr>
......
...@@ -270,7 +270,7 @@ ...@@ -270,7 +270,7 @@
<div class="pull-right"> <div class="pull-right">
<ul class="bread_btn"> <ul class="bread_btn">
<li> <li>
<a class="btn btn-default add" href="#modal_add_loupan" data-toggle="modal" >新增楼盘</a> <a class="btn btn-default add" href="#modal_add_loupan" data-toggle="modal" style="display: none;">新增楼盘</a>
</li> </li>
</ul> </ul>
</div> </div>
......
...@@ -1096,5 +1096,22 @@ class Users extends Model ...@@ -1096,5 +1096,22 @@ class Users extends Model
->limit(1) ->limit(1)
->select(); ->select();
} }
/**
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public function getAgentBySiteIdCity($field, $params){
return Db::name($this->table)
->field($field)
->alias("a")
->join("u_user_agent b","a.id = b.user_id","left")
->join("a_agents c", "a.agent_id=b.id", "left")
->join('a_site d', 'c.site_id = d.id', 'left')
->where($params)
->limit(1)
->select();
}
} }
...@@ -5,6 +5,7 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp ...@@ -5,6 +5,7 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
agent_id: 0, agent_id: 0,
idArray: '', idArray: '',
confirm_old:'',//是否转勤 confirm_old:'',//是否转勤
editObj:'',//编辑返回的对象
init: function() { init: function() {
//初始化dot //初始化dot
$("body").append(template + template_binding + pctemplate_binding); $("body").append(template + template_binding + pctemplate_binding);
...@@ -121,10 +122,21 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp ...@@ -121,10 +122,21 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
$(document).on("click", ".black-list", function() { //点击黑名单 $(document).on("click", ".black-list", function() { //点击黑名单
agent.agent_id = $(this).attr("data-id"); agent.agent_id = $(this).attr("data-id");
}); });
$(document).on("click", ".edit-phone-btn", function() { //点击修改手机号
agent.agent_id = $(this).attr("data-id");
agent.Edit();//获取编辑内容
});
$(document).on("click", ".edit-phone-save", function() { //保存修改手机号
agent.Submit_edit_phone();//获取编辑内容
});
$(document).on("click", ".phone-bundling", function() { //点击绑定手机 $(document).on("click", ".phone-bundling", function() { //点击绑定手机
agent.agent_id = $(this).attr("data-id"); agent.agent_id = $(this).attr("data-id");
agent.getPhoneBindingList(browser_version); agent.getPhoneBindingList(browser_version);
}); });
$(document).on("click", ".del-record", function() { //点击绑定电脑(清除绑定)
agent.getPhoneBindingDelList();
});
$(document).on("click", ".pc-bundling", function() { //点击绑定电脑 $(document).on("click", ".pc-bundling", function() { //点击绑定电脑
agent.agent_id = $(this).attr("data-id"); agent.agent_id = $(this).attr("data-id");
agent.getPcBindingList(); agent.getPcBindingList();
...@@ -454,6 +466,8 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp ...@@ -454,6 +466,8 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
if(data.code == 200) { if(data.code == 200) {
if(data.data) { if(data.data) {
agent.editObj = data.data;
$("#edit-phone").val(data.data.phone);
$("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);
...@@ -557,6 +571,46 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp ...@@ -557,6 +571,46 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
} }
}); });
},
Submit_edit_phone: function() {//修改手机号
//提交编辑的信息
var params = {}
params.id = agent.agent_id;
params.name = agent.editObj.name;
params.password = agent.editObj.password;
params.district_id = agent.editObj.district_id;
params.store_id = agent.editObj.store_id;
params.phone = $("#edit-phone").val();
params.admin_off = agent.editObj.admin_off;
params.sex = agent.editObj.sex;
params.remarks = agent.editObj.remarks;
if(params.phone == '') {
alert('手机号必填!');
return false;
}
if(params.phone.length != 11) {
alert('手机号码错误!');
return false;
}
$.ajax({
'type': 'POST',
'url': '/index/saveAgent',
data: params,
dataType: "json",
success: function(data) {
if(data.code == 200) {
alert('提交成功');
$("#modal-editPhone").modal('hide');
}else if(data.code == 101){
alert(data.msg);
} else {
}
}
});
}, },
Submit_edit: function() { Submit_edit: function() {
//提交编辑的信息 //提交编辑的信息
...@@ -832,6 +886,27 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp ...@@ -832,6 +886,27 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
} }
}) })
}, },
//手机绑定权限(清除绑定)
getPhoneBindingDelList: function(pageNo) {
var params = {};
params.agent_id = agent.agent_id;
$.ajax({
url: '/index/deviceList', //电脑绑定权限
type: 'GET',
async: true,
data: params,
dataType: 'json',
success: function(data) {
var temp = document.getElementById('phone_del_binding_tpl').innerHTML;
var doTempl = doT.template(temp);
$("#agent_phone_binding").html(doTempl(data.data));
console.log(555)
/*分页代码*/
add_page(data.data.total, pageNo, agent.pageSize, agent.getList);
$('.J_preview').preview();
}
})
},
//电脑绑定权限 //电脑绑定权限
getPcBindingList: function(pageNo) { getPcBindingList: function(pageNo) {
var params = {}; var params = {};
...@@ -845,13 +920,14 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp ...@@ -845,13 +920,14 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
success: function(data) { success: function(data) {
var temp = document.getElementById('pc_binding_tpl').innerHTML; var temp = document.getElementById('pc_binding_tpl').innerHTML;
var doTempl = doT.template(temp); var doTempl = doT.template(temp);
$("#agent_pc_binding").html(doTempl(data.data)); // $("#agent_pc_binding").html(doTempl(data.data));
/*分页代码*/ /*分页代码*/
add_page(data.data.total, pageNo, agent.pageSize, agent.getList); add_page(data.data.total, pageNo, agent.pageSize, agent.getList);
$('.J_preview').preview(); $('.J_preview').preview();
} }
}) })
}, },
//记录状态 //记录状态
stateRecordList: function(pageNo) { stateRecordList: function(pageNo) {
var params = {}; var params = {};
......
...@@ -38,9 +38,14 @@ define(['doT', 'text!temp/building_dictionary_list_template_tpl.html','css!style ...@@ -38,9 +38,14 @@ define(['doT', 'text!temp/building_dictionary_list_template_tpl.html','css!style
init: function() { init: function() {
//初始化dot //初始化dot
$("body").append(template); $("body").append(template);
//初始化城市 区域筛选 //商铺列表 默认显示求租房源
// 商铺列表 默认显示求租房源
$('#lease_state').val(1); $('#lease_state').val(1);
//新增楼盘字典权限
if(check_auth('office_index/houseDictionaryAdd')){
$(".add").show()
}else{
$(".add").hide()
}
business.getList(1); business.getList(1);
business.event(); business.event();
//显示 隐藏城市 默认显示 当前账号 所在城市 //显示 隐藏城市 默认显示 当前账号 所在城市
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
<td class="number-evaluation text-center" data-id='[%= it[item]["id"] %]'>--</td> <td class="number-evaluation text-center" data-id='[%= it[item]["id"] %]'>--</td>
<td class="score-evaluation text-center" data-id='[%= it[item]["id"] %]'>--</td> <td class="score-evaluation text-center" data-id='[%= it[item]["id"] %]'>--</td>
<td class="text-center"> <td class="text-center">
[% if(it[item]["status"] != 3) { %]
<a class="btn1 btn-success edit" href="#modal-edit" data-toggle="modal" data-id='[%= it[item]["id"] %]'>编辑</a> <a class="btn1 btn-success edit" href="#modal-edit" data-toggle="modal" data-id='[%= it[item]["id"] %]'>编辑</a>
[% if(it[item]["status"] == 2) {%] [% if(it[item]["status"] == 2) {%]
<a class="btn1 btn-warning yetai_checkbox isCheck" data-toggle="modal" data-id='[%= it[item]["id"] %]' data-status='[%= it[item]["status"] %]'>已离职</a> <a class="btn1 btn-warning yetai_checkbox isCheck" data-toggle="modal" data-id='[%= it[item]["id"] %]' data-status='[%= it[item]["status"] %]'>已离职</a>
...@@ -73,6 +74,9 @@ ...@@ -73,6 +74,9 @@
[% } %] [% } %]
<a class="btn1 btn-default btn-default-hide-caozuo btn-default-hide-display"><<<</a> <a class="btn1 btn-default btn-default-hide-caozuo btn-default-hide-display"><<<</a>
[% } else{ %]
<a class="btn1 btn-success edit-phone-btn" href="#modal-editPhone" data-toggle="modal" data-id='[%= it[item]["id"] %]'>修改手机号</a>
[% } %]
</td> </td>
......
...@@ -34,7 +34,11 @@ ...@@ -34,7 +34,11 @@
</td> </td>
<td> <td>
<a class="btn1 btn-success edit" href="#modal_add_loupan" data-toggle="modal" data-id='[%= it[item]["id"] %]'>编辑</a> [% if(check_auth('office_index/houseDictionaryEdit')){%]
<a class="btn1 btn-success edit" href="#modal_add_loupan" data-toggle="modal" data-id='[%= it[item]["id"] %]'>编辑</a>
[% } %]
</td> </td>
</tr> </tr>
[% } %] [% } %]
......
...@@ -31,4 +31,41 @@ ...@@ -31,4 +31,41 @@
<td colspan="8" style="text-align:center;"> 暂无数据</td> <td colspan="8" style="text-align:center;"> 暂无数据</td>
</tr> </tr>
[% } %] [% } %]
</script>
<script id="phone_del_binding_tpl" type="text/template">
[% if(it) { %]
[% for(var item in it){ %]
<tr class="text-center">
[% if(it[item]["is_forbidden"] != 1){ %]
<td>[% if(it[item]["is_pc"] == 1) { %]
电脑端
[% }else if(it[item]["is_pc"] == 0) { %]
手机端
[% }else if(it[item]["is_pc"] == 2){ %]
Windows客户端
[% }else{%]
其他
[%} %]
</td>
<td>[%= it[item]["model"] %]</td>
<td>[%= it[item]["create_time"] %]</td>
<td>
[% if(it[item]["is_forbidden"] == 0) { %]
<a class="btn1 btn-default is_show2" data-toggle="modal" data-id='[%= it[item]["id"] %]'>解绑</a>
[% }else if(it[item]["is_forbidden"] == 1) { %]
<a class="btn1 btn-info is_show2" data-toggle="modal" data-id='[%= it[item]["id"] %]'>允许</a>
[% }else{ %]
<a class="btn1 btn-default" data-toggle="modal" data-id='[%= it[item]["id"] %]'>离职</a>
[% } %]
<!--<a class="btn1 btn-info review-images" href="#modal-time" data-toggle="modal" data-img='[%= it[item]["scene_photo"] %]'>允许</a>-->
</td>
[% } %]
</tr>
[% } %]
[% }else{ %]
<tr>
<td colspan="8" style="text-align:center;"> 暂无数据</td>
</tr>
[% } %]
</script> </script>
\ No newline at end of file
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