Commit d0fe90e5 authored by 刘丹's avatar 刘丹 Committed by hujun

报告页面

parent 7c95becf
...@@ -16,65 +16,21 @@ ...@@ -16,65 +16,21 @@
<thead> <thead>
<tr> <tr>
<td colspan="9"> <td colspan="9">
<form id="form_search"> <a class="btn btn-info liudan_pic_btn">专员审核</a>
<select class="form-control btn2" id="is_carefully_chosen"> <a class="btn btn-default liudan_pic_btn">经理审核</a>
<option value="" class="successModel">是否显示在首页</option> <a class="btn btn-default liudan_pic_btn">总监审核</a>
<option value="0"></option> <a class="btn btn-default liudan_pic_btn">出纳审核</a>
<option value="1"></option>
</select>
<select class="form-control btn2" id="is_show">
<option value="" class="successModel">C端是否显示</option>
<option value="0"></option>
<option value="1"></option>
</select>
<select class="form-control btn2" id="shop_type">
<option value="" class="successModel">商铺类型</option>
<option value="0">商场</option>
<option value="1">街铺</option>
</select>
<select class="form-control btn2" id="leased">
<option value="" class="successModel">商铺状态</option>
<option value="0">已租</option>
<option value="1">待租</option>
</select>
<select class="form-control btn2" id="rent_price">
<option value="" class="successModel">月租金</option>
<option value="2">10000以下</option>
<option value="1" >10000-30000</option>
<option value="0">30000以上</option>
</select>
<select class="form-control btn2" id="is_exclusive_type">
<option value="" class="successModel">是否独家</option>
<option value="1"></option>
<option value="0"></option>
</select>
<input class="form-control btn2" data-rule-phoneus="false" data-rule-required="false" id="internal_title" placeholder="商铺名称" type="text" value="">
<div class="row">
</div>
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="industry_type" placeholder="业态" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="dish" placeholder="盘方" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="id" placeholder="店铺编号" type="text" value="">
<span class="fore-span ld-Marheight">上传时间:</span>
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="start_date" name="start_date" type="date">
<span class="fore-span ld-Marheight">-</span>
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="end_date" name="end_date" type="date">
<span class="btn btn-default btn3 ld-Marheight" id="search">搜索</span>
<span class="btn btn-default btn3 ld-Marheight" id="reset">重置</span>
</form>
</td> </td>
</tr> </tr>
<tr> <tr>
<th class="text-center">编号</th> <th class="text-center">提交时间</th>
<th class="text-center">类型</th> <th class="text-center">商铺地址</th>
<th class="text-center">名称</th> <th class="text-center">商铺名称</th>
<th class="text-center">月租金</th> <th class="text-center">成交客户</th>
<th class="text-center">C端是否显示</th> <th class="text-center">客户电话</th>
<th class="text-center">上传时间</th> <th class="text-center">应收佣金</th>
<th class="text-center">状态</th> <th class="text-center">实收佣金</th>
<th class="text-center">盘方</th>
<th class="text-center">操作</th> <th class="text-center">操作</th>
</tr> </tr>
</thead> </thead>
......
...@@ -19,381 +19,24 @@ define (['doT', 'text!temp/reportList_template_tpl.html', 'css!style/home.css',' ...@@ -19,381 +19,24 @@ define (['doT', 'text!temp/reportList_template_tpl.html', 'css!style/home.css','
$ ("body").append (template); $ ("body").append (template);
reportList.getList (); reportList.getList ();
reportList.event (); reportList.event ();
reportList.resetLoad();
}, },
event: function () { event: function () {
$("#search").click(function () {
reportList.getList(1);
});
$("#reset").click(function () {//重置
document.getElementById("form_search").reset();
});
$ (document).delegate (".del_modal", "click", function () {
reportList.id = $ (this).attr ("data-id");
});
$ (document).delegate (".anch", "click", function () {//点击设置案场权限人
reportList.house_id = $ (this).attr ("data-id");
reportList.type="1";
reportList.Anch();//获取手机号名字的
});
$ (document).delegate (".add_applies", "click", function () {//点击设置案场权限人
reportList.house_id = $ (this).attr ("data-id");
reportList.type="2";
reportList.Anch();
});
$ (document).delegate (".dujia", "click", function () {//点击独家
reportList.house_id = $ (this).attr ("data-id");
reportList.type="3";
reportList.Dujia();
});
$ (document).delegate (".caozuo", "click", function () {//点击操作记录
reportList.house_id = $ (this).attr ("data-id");
reportList.Caozuo();
});
$ (document).delegate (".submit_follow2", "click", function () {//提交独家
reportList.Dujianew();
});
$ (document).delegate (".submit_follow", "click", function () {//提交按钮设置案场权限人
reportList.Submit_follow();
});
$ (document).delegate ("#confirm_delete", "click", function () {
reportList.delreportList();
});
$ (document).delegate (".jia", "click", function () {//加号
reportList.jiabox();
});
$ (document).delegate (".addphone", "click", function () {//加号
reportList.addphone(this);
});
$ (document).delegate (".jian", "click", function () {//叉号
reportList.jianbox();
});
$(document).on('input','.phone_jia,.phone_add', function(e) {//搜索手机号码/加号搜索
e.preventDefault();
e.stopPropagation();
var _this = $(this);
_this.next().css("display","block");
valueCurrent = _this.val();
if(valueCurrent != ''){
reportList.resetLoad(1);
reportList.loadMain(valueCurrent,_this.next());
console.log(_this.next());
}else{
reportList.ldHtml.html('');
return false;
}
});
$ (document).delegate (".is_show", "click", function () {//推荐至首页
if (!confirm('是否继续?')) {
return ;
}
reportList.id = $ (this).attr ("data-id");
var params ={
};
params.id = $ (this).attr ("data-id");
var str = $.trim($(this).html());
if (str === "推荐至首页") {
params.type = 1;
$(this).html('已推荐');
} else {
params.type = 0;
$(this).html('推荐至首页');
}
$.ajax({//推荐至首页
'type': 'POST',
'url' : '/index/carefullyChosen',
data: {"houses_id":reportList.id,"is_carefully_chosen":params.type},
dataType: "json",
success: function(data){
if(data.code == 200){
if (data.data) {
}
} else {
alert("推荐失败!")
}
}
});
});
$ (document).delegate ("#liudan_pic_btn", "click", function () {//上传图片
var img_url="";
BrowseServer ('liudan_pic_btn',function(url){
var alt_img=$("#liudan_pic_btn").val();
img_url+=' <img src="'+url+'" class="jai_dujia" data-img="'+alt_img+'">';
$("#liudan_pic_pre").append(img_url);
});
});
},
Anch:function(){//获取手机号名字的
$.ajax({
'type': 'GET',
'url' : '/index/getAgentsTohouses',
data: {"houses_id":reportList.house_id,"type":reportList.type},
dataType: "json",
success: function(data){
if(data.code == 200){
if (data.data) {
$(".jian_class").html('');//写入
$.each(data.data, function(i,data) {
reportList.jiabox_data(data['id'],data['name'],data['phone']);
});
reportList.jiabox();
}
} else {
alert('请登录!');
}
}
});
},
Dujia:function(){//获取独家的信息
$.ajax({
'type': 'GET',
'url' : '/index/getExclusive',
data: {"houses_id":reportList.house_id},
dataType: "json",
success: function(data){
if(data.code == 200){
if (data.data) {
$("#sel_dujia").val(data.data.is_exclusive_type);//是否独家
$("#start_date_dujia").val(data.data.agent_start_time);//上传时间
$("#end_date_dujia").val(data.data.agent_end_time);
$("#exclusive").val(data.data.name);
exclusive_id=data.data.id;
var img_url="";
$.each(data['data']['exclusive_img'], function(i, item) {
var local_img=location.origin+'/resource/lib/Attachments/'+item.img_name;
img_url +='<img src="'+local_img+'" class="jai_dujia" data-img="'+item.img_name+'" >';
});
$("#liudan_pic_pre").html(img_url);
}
} else {
alert('获取失败!');
}
}
});
}, },
Dujianew:function(){//提交独家的信息
var images=[];//图片
var imgs =$(".jai_dujia");
for(var j=0;j<imgs.length;j++){
images.push(imgs[j].getAttribute("data-img"))
}
$.ajax({
'type': 'POST',
'url' : '/index/editExclusive',
data: {"houses_id":reportList.house_id,//楼盘Id
"is_exclusive_type":$("#sel_dujia").val(),//是否独家
"exclusive_id":exclusive_id,//经纪人id
"agent_start_time":$("#start_date_dujia").val(),//开始时间
"agent_end_time":$("#end_date_dujia").val(),//结束时间
"exclusive_img":images//图片
},
dataType: "json",
success: function(data){
if(data.code == 200){
} else {
alert('获取失败!');
}
}
});
},
Caozuo:function(){//获取独家的信息
var caozuo_table="";
$.ajax({
'type': 'GET',
'url' : '/index/getRecords',//获取操作记录
data: {"houses_id":reportList.house_id},
dataType: "json",
success: function(data){
if(data.code == 200){
if (data.data) {
$.each(data.data,function(i,item){
caozuo_table+='<tr><td>'+item.remark+'</td> <td>'+item.name+'</td> <td>'+item.create_time+'</td></tr>'
});
$("#caozuo_table").html(caozuo_table);
}
} else {
alert('获取失败!');
}
}
});
},
Submit_follow:function(){//提交案场权限人数据
var agents_id="";
var _agents_id="";
$("input[name='ues_id']").each(function() {//拼接经纪人id
var s =$(this).val();
var m = s.match(/[^-]+(?=[-])/g);
if(m === null){
return false;
}else{
agents_id += ","+ m[0];
_agents_id=agents_id.substring(1);
}
});
$.ajax({
'type': 'POST',
'url' : '/index/addHousesAgents',
data: {"houses_id":reportList.house_id,"type":reportList.type,"agents_id":_agents_id},
dataType: "json",
success: function(data){
if(data.code == 200){
if (data.data) {
$("#modal-anch").hide;
}
} else {
$("#modal-anch").hide;
}
}
});
},
resetLoad:function (){//手机号
if(reportList.ajaxObj){
reportList.ajaxObj.abort();
}
reportList.ldHtml.html('');
reportList.stopstatus = true;
},
loadMain:function(phone, obj) {//手机号
reportList.ajaxObj=$.ajax({
type: "GET",
url: '/index/getBroker_new' ,
data: {
'phone': phone
},
timeout: 10000,
dataType: "json",
beforeSend: function() {
},
success: function(data) {
if(data.code === 200){
var _html = '';
$.each(data.data, function(i,data) {
_html += '<li class="addphone"><span class="id">'+data['id']+'-</span><span class="phone_name">'+data['name']+'</span><span class="phone_span">-</span><span class="phone-phone">'+data['phone']+'</span> </li>';
});
obj.html(_html);
}
},
error: function() {
},
complete: function(xhr, textStatus) {
if(textStatus === "timeout") {
//处理超时的逻辑
alert("请求超时");
}
}
});
},
addphone:function (obj){//list消失
var phone_name=$(obj).find(".phone_name").html();
console.log(phone_name);
var phone_phone=$(obj).find(".phone-phone").html();
var phone_span=$(obj).find(".phone_span").html();
var id= $(obj).find(".id").html();
$(obj).parent().prev().val(id+phone_name+phone_span+phone_phone);
$(obj).parent().hide();
reportList.ldHtml.html('');
return false;
},
jiabox:function () {//加输入框
reportList.boxphoto = '<input name="ues_id" placeholder="请输入" type="tel" style="margin-left: 10px;float: left" class="phone_add">' +
'<ul class="phone_list1"></ul>'+
'<img src="/resource/image/qdao-sha.png" class="jian">';
$(".jian_class").append(reportList.boxphoto);//写入
reportList.jianbox();
},
jiabox_data:function (id,name,phone) {//显示已经获取的数据
reportList.boxphoto = '<input name="ues_id" placeholder="请输入" value='+id+'-'+name+'-'+phone+' type="tel" style="margin-left: 10px;float: left" class="phone_add">' +
'<ul class="phone_list1"></ul>'+
'<img src="/resource/image/qdao-sha.png" class="jian"><input type="hidden" value="'+id+'">';
$(".jian_class").append(reportList.boxphoto);//写入
},
jianbox: function () {
$(".jian").click(function () {//删除经纪人数据
var ss =$(this).prev().prev().val();
var mm = ss.match(/[^-]+(?=[-])/g);
if(mm === null){
$(this).prev().prev().remove();
$(this).prev().remove();
$(this).remove();
return false;
}else{
var mm_id=mm[0];
}
var r=confirm("确定删除吗!");
if (r==true)
{
$(this).prev().prev().remove();
$(this).prev().remove();
$(this).remove();
$.ajax({
'type': 'POST',
'url' : '/index/delTohouses',
data: {"id":mm_id,"houses_id":reportList.house_id},
dataType: "json",
success: function(data){
if(data.code == 200){
} else {
alert("删除失败");
}
}
});
}
else
{
}
});
},
getList: function (pageNo) { getList: function (pageNo) {
reportList.pageNo = pageNo; reportList.pageNo = pageNo;
var params = {}; var params = {};
params.pageNo = reportList.pageNo; params.pageNo = reportList.pageNo;
params.pageSize = reportList.pageSize; params.pageSize = reportList.pageSize;
params.is_carefully_chosen = $('#is_carefully_chosen option:selected') .val();//首页显示
params.is_show = $('#is_show option:selected') .val();//c端显示
params.shop_type = $('#shop_type option:selected') .val();//商铺类型
params.leased = $('#leased option:selected') .val();//商铺状态
params.rent_price = $('#rent_price option:selected') .val();//月租金
params.is_exclusive_type = $('#is_exclusive_type option:selected') .val();//是否独家
params.internal_title = $('#internal_title') .val();//商铺名称
params.industry_type = $('#industry_type') .val();//业态
params.dish = $('#dish') .val();//盘方
params.id = $('#id') .val();//店铺编号
params.start_date = $('#start_date') .val();//时间1
params.end_date = $('#end_date') .val();//时间2
$.ajax ({ $.ajax ({
url: '/index/getHouseList.html',//获取列表 url: '/index/reportListAttache/0',//获取列表
type: 'GET', type: 'GET',
async: true, async: true,
data: params, data: params,
dataType: 'json', dataType: 'json',
success: function (data) { success: function (data) {
var temp = document.getElementById ('house_list_tpl').innerHTML; var temp = document.getElementById ('reportList_list_tpl').innerHTML;
var doTtmpl = doT.template (temp); var doTtmpl = doT.template (temp);
$ ("#reportList_list").html (doTtmpl (data.data.list)); $ ("#reportList_list").html (doTtmpl (data.data.list));
...@@ -408,24 +51,8 @@ define (['doT', 'text!temp/reportList_template_tpl.html', 'css!style/home.css',' ...@@ -408,24 +51,8 @@ define (['doT', 'text!temp/reportList_template_tpl.html', 'css!style/home.css','
}); });
} }
}); });
},
delreportList : function () {
$.ajax({
url : '/index/houseDel',
type : 'POST',
async: true,
data: {"id":reportList.id},
dataType: 'json',
success : function (data) {
if (data.code == 200) {
reportList.getList(1);
$("#modal-delete").modal ('hide');
} else {
$("#del_msg").html('<span style="color: red">删除失败!</span>');
}
}
});
} }
}; };
return reportList; return reportList;
}); });
\ No newline at end of file
...@@ -2,58 +2,18 @@ ...@@ -2,58 +2,18 @@
[% 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]['id'] %]</td>
<td>
[% if(it[item]["shop_type"] == 0) { %]
商场
[% }else{ %]
街铺
[% } %]
</td>
<td>[%= it[item]['internal_title'] %]</td>
<td>
[% if(it[item]["rent_price"] == 0) { %]
30000以上
[% }else if(it[item]["rent_price"] == 1) { %]
10000-30000
[% }else{ %]
10000以下
[% } %]
</td>
<td>
[% if(it[item]["is_show"] == 0) { %]
[% }else{ %]
[% } %]
</td>
<td>[%= it[item]['create_time'] %]</td> <td>[%= it[item]['create_time'] %]</td>
<td> <td>[%= it[item]['internal_address'] %]</td>
[% if(it[item]["leased"] == 0) { %] <td>[%= it[item]['internal_title'] %]</td>
已租 <td>[%= it[item]['user_name'] %]</td>
[% }else{ %] <td>[%= it[item]['user_phone'] %]</td>
待租 <td>[%= it[item]['commission'] %]</td>
[% } %] <td>[%= it[item]['practical_fee'] %]</td>
</td>
<td>
[% if(it[item]["dish_name"] == "") { %]
<a data-toggle="modal" data-id='[%= it[item]["id"] %]' href="#modal-anch" class="btn1 btn-danger add_applies">修改</a>
[% }else{ %]
[%= it[item]['dish_name'] %]
<a data-toggle="modal" data-id='[%= it[item]["id"] %]' href="#modal-anch" class="btn1 btn-danger add_applies">修改</a>
[% } %]
</td>
<td> <td>
<a class="btn1 btn-success " href="/admin.php/index/houseEdit?id=[%= it[item]['id']%]" data-toggle="modal" >编辑</a> <a class="btn1 btn-success " href="/admin.php/index/houseEdit?id=[%= it[item]['id']%]" data-toggle="modal" >编辑</a>
<a class="btn1 btn-success is_show" data-toggle="modal" data-id='[%= it[item]["id"] %]'>推荐至首页</a> <a class="btn1 btn-success is_show" data-toggle="modal" data-id='[%= it[item]["id"] %]'>通过</a>
<a class="btn1 btn-success anch" data-target="#modal-anch" data-toggle="modal" data-id='[%= it[item]["id"] %]'>设置案场权限人</a> <a class="btn1 btn-success dujia" href="#modal-dujia" data-toggle="modal" data-id='[%= it[item]["id"] %]' >跟进</a>
<a class="btn1 btn-success dujia" href="#modal-dujia" data-toggle="modal" data-id='[%= it[item]["id"] %]' >是否独家</a> <a class="btn1 btn-success caozuo" href="#modal-record" data-toggle="modal" data-id='[%= it[item]["id"] %]'>时间轴</a>
<a class="btn1 btn-success caozuo" href="#modal-record" data-toggle="modal" data-id='[%= it[item]["id"] %]'>操作记录</a>
<a data-toggle="modal" data-id='[%= it[item]["id"] %]' href="#modal-delete" class="btn1 btn-danger add_applies del_modal">删除</a>
</td> </td>
</tr> </tr>
[% } %] [% } %]
......
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