Commit 198d0526 authored by agping's avatar agping

评价

parent 492ab38d
{layout name="global/frame_tpl" /} {layout name="global/frame_tpl" /}
<input type="hidden" class="page-load" id="visitShop" /> <input type="hidden" class="page-load" id="evaluationList" />
<style> <style>
.modal-body{ .modal-body{
/*height: 600px;*/ /*height: 600px;*/
...@@ -49,24 +49,30 @@ ...@@ -49,24 +49,30 @@
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="start_date" name="start_date1" type="date"> <input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="start_date" name="start_date1" type="date">
<span class="fore-span ld-Marheight">-</span> <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_date1" type="date"> <input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="end_date" name="end_date1" type="date">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="visitors_shop" placeholder="拜访人所属门店名称" type="text" value=""> <span class="fore-span ld-Marheight">进场时间:</span>
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="visitors_phone" placeholder="拜访人手机号" type="text" value=""> <input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="start_date" name="start_date1" type="date">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="visitors_name" placeholder="拜访人姓名" type="text" value=""> <span class="fore-span ld-Marheight">-</span>
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="visiting_shop" placeholder="拜访的门店名称" type="text" value=""> <input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="end_date" name="end_date1" type="date">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="visitors_shop" placeholder="门店名称" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="visitors_phone" placeholder="手机号" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="visitors_name" placeholder="姓名" type="text" value="">
<span class="fore-span ld-Marheight">进场平均分数:</span><span class="fore-span ld-Marheight" id='average_score'></span>
<span class="fore-span ld-Marheight">评价平均分数:</span><span class="fore-span ld-Marheight" id='average_score_evaluation'></span>
<span class="btn btn-info btn3 ld-Marheight" id="search">搜索</span> <span class="btn btn-info btn3 ld-Marheight" id="search">搜索</span>
<span class="btn btn-info btn3 ld-Marheight" id="reset">重置</span> <span class="btn btn-info btn3 ld-Marheight" id="reset">重置</span>
</form> </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">打卡地址</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>
<tbody class="text-center" id="follow_list"> <tbody class="text-center" id="follow_list">
......
define(['doT', 'text!temp/evaluation_list_template_tpl.html', 'css!style/home.css', 'ckfinder', 'ckfinderStart', 'pagination', 'bootstrapJs'], function(doT, template) {
follow = {
pageNo: 1,
/*第几页*/
pageSize: 10,
/*每页显示多少条*/
id: '',
house_id: '',
type: '',
valueCurrent: '',
ajaxObj: '',
stopstatus: true,
boxphoto: '',
init: function() {
//初始化dot
$(document.body).append(template);
follow.getList(0);
follow.event();
},
event: function() {
var _doc = $(document);
$("#search").click(function() {
follow.getList(1);
});
$("#reset").click(function() { //重置
document.getElementById("form_search").reset();
});
$ (document).delegate (".review-images", "click", function () {//提交
console.log($(this).attr ("data-img"));
});
$("#export").click(function() { //导出列表
follow.exportList();
});
$ (document).delegate (".submit_edit2", "click", function () {//提交
follow.house_id2 = $ (this).attr ("data-id");
console.log(follow.house_id2);
$("#real_money").val($(this).attr ("data-money"));
});
$ (document).delegate (".submit_edit", "click", function () {//提交
follow.Submit_follow();
});
$ (document).on ("input","#cus_fang", function () {//手机号搜索客方2
if($("#cus_fang").val()==''){
$(".user-ul2").html('');
}else{
follow.search_phone2();
}
});
$ (document).delegate (".addphone2", "click", function () {//list2消失
follow.addphone2(this);
});
},
addphone2:function(obj){
var user_ht=$(obj).html();
$("#cus_fang").val(user_ht);
$(".user-ul2").html('');
follow.agent_id = $ (obj).attr ("data-id");
},
search_phone2:function(){//手机号
$.ajax ({
url: '/index/select_by_phone',
type: 'POST',
async: true,
data: {
"phone":$("#cus_fang").val()
},
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.realname+'-'+item.phone+'</li>';
});
$(".user-ul2").html(user_ul2);
} else {
alert(data.msg);
}
}
});
},
Submit_follow: function() { //提交
$.ajax({
'type': 'POST',
'url': '/index/addRealMoney',
data: {
"collection_id": follow.house_id2,
"real_money": $("#real_money").val(),
},
dataType: "json",
success: function(data) {
if(data.code == 200) {
follow.getList(0);
} else {
}
}
});
},
// 导出列表
exportList: function(pageNo) {
console.log(2);
follow.pageNo = pageNo;
var params = {};
var excel_two = 1;
var user_name = $.trim($('#customer_name').val());
var start_time = $('#start_date').val();
var end_time = $('#end_date').val();
var internal_title = $('#shop_name').val();
var user_phone = $('#customer_phone').val();
var id = $('#shop_num').val() * 1;
var store_name = $('#store_name').val();
var report_phone = $('#applicant_phone').val();
var report_name = $('#applicant_name').val();
window.open('/index/getCollection?'+
'excel='+ excel_two +'&user_name=' + user_name + '&start_time=' + start_time + '&end_time=' + end_time + '&internal_title=' + internal_title + '&user_phone=' + user_phone + '&id=' + id+ '&store_name=' + store_name+ '&report_phone=' + report_phone+ '&report_name=' + report_name);
},
getList: function(pageNo) {
console.log($('#customer_name').val());
console.log($('#start_date').val());
console.log($('#shop_name').val());
follow.pageNo = pageNo;
var params = {};
params.user_name =$.trim($('#customer_name').val());
params.start_time =$('#start_date').val();
params.end_time =$('#end_date').val();
params.internal_title =$('#shop_name').val();
params.user_phone =$('#customer_phone').val();
params.store_name =$('#store_name').val();
params.report_phone =$('#applicant_phone').val();
params.report_name =$('#applicant_name').val();
params.pageNo = follow.pageNo;
params.pageSize = follow.pageSize;
$.ajax({
type: 'GET',
url: '/index/evaluationList',//拜访列表
data: params,
timeout: 30000,
dataType: 'json',
beforeSend: function() {},
success: function(data) {
if(typeof data === 'object') {
if (data.code == 200) {
var doTtmpl = doT.template(document.getElementById('evaluation_list_tpl').innerHTML);
$("#follow_list").html(doTtmpl(data.data.list));
$("#average_score_evaluation").html(data.data.average_score_evaluation);
$("#average_score").html(data.data.average_score);
/*分页代码*/
add_page(data.data.total,pageNo,follow.pageSize,follow.getList);
}else {
alert(data['msg']);
};
}else{
alert('数据错误');
};
},
error: function() {
alert('error');
},
complete: function(xhr, textStatus){
if(textStatus === 'timeout'){
alert('请求超时');
};
}
});
}
};
return follow;
});
\ No newline at end of file
...@@ -143,7 +143,7 @@ define(['doT', 'text!temp/visit_shop_template_tpl.html', 'css!style/home.css', ' ...@@ -143,7 +143,7 @@ define(['doT', 'text!temp/visit_shop_template_tpl.html', 'css!style/home.css', '
params.pageSize = follow.pageSize; params.pageSize = follow.pageSize;
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
url: '/index/evaluationList',//拜访列表 url: '/index/visitShop',//拜访列表
data: params, data: params,
timeout: 30000, timeout: 30000,
dataType: 'json', dataType: 'json',
......
<script id="evaluation_list_tpl" type="text/template">
[% if(it) { %]
[% for(var item in it){ %]
<tr class="text-center">
<td>[%= it[item]['create_time'] %]</td>
<td>[%= it[item]['user_nick'] %]</td>
<td>[%= it[item]['user_phone'] %]</td>
<td>[%= it[item]['name'] %]</td>
<td>[%= it[item]['phone'] %]</td>
<td class="pay_type">[%= it[item]['evaluate_grade'] %]</td>
<td>[%= it[item]['evaluate_content'] %]</td>
<td>
<a class="btn1 btn-info timeline" href="#modal-time" data-toggle="modal" data-id='[%= it[item]["order_id"] %]'>删除</a>
</td>
</tr>
[% } %]
[% }else{ %]
<tr>
<td colspan="8" style="text-align:center;"> 暂无数据</td>
</tr>
[% } %]
</script>
<!--create_time string 评价时间
user_nick string 评价人姓名
user_phone string 评价人手机号
name string 经纪人姓名
phone string 经纪人手机号
evaluate_grade int 分数
evaluate_content string 评论内容
average_score int 进场平均分数
average_score_evaluation int 评价平均分数
-->
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