Commit 6940e98b authored by zw's avatar zw

Merge branch 'test'

parents f8417fc7 c8d260b1
......@@ -284,8 +284,13 @@ class Broker extends Basic
if ($is) {
$m_agents = new AAgents();
$agents_data = $m_agents->getAgentInfo('id,update_time,call_number', $this->params['agent_id']);
if (empty($this->params['phone'])) {
$agents_data = $m_agents->getAgentInfo('id,update_time,call_number', $this->params['agent_id']);
} else {
$agents_data = $m_agents->getAgentInfo('id,update_time,call_number', '', ['agent_id', $this->params['agent_id']]);
}
$insert_data['update_time'] = $agents_data['update_time'];
$insert_data['call_number'] = $agents_data['call_number'] + 1;
$data['data'] = $m_agents->editData($insert_data, $agents_data['id']);
......
......@@ -262,6 +262,7 @@
<script src="/app/js/app_jump.js"></script>
<script src="/app/js/common.js" charset="utf-8"></script>
<script src="/app/js/detaila_tl.js?new1"></script>
<script src="/app/js/jquery.cookie.js"></script>
<script src="/app/js/Tab_min.js" charset="utf-8"></script>
</body>
......
......@@ -11,6 +11,7 @@ namespace app\index\controller;
use app\api_broker\service\CallPhoneService;
use app\api_broker\service\ClientService;
use app\api_broker\service\UserExpiredTimeService;
use app\extra\RedisExt;
use app\index\extend\Basic;
use app\index\service\UserService;
use app\model\AAgents;
......@@ -118,11 +119,10 @@ class Remark extends Basic
}
$field = 'id,user_id,create_time,content,user_status,labels_id,agent_id as f_agent_id';
$data['data']['list'] = $u_phone_follow->getFollowList($pageNo, $pageSize, $order_ = 'id desc', $field, $where);
$redis = RedisExt::getRedis();
foreach ($data['data']['list'] as $k => $v) {
// dump($v);
//dump($v);
//查询客户是否在保护期内
//判断客户是否超过24小时保护期间 0:保护器内 1:超过保护期
$user_service = new UserService();
......@@ -138,11 +138,21 @@ class Remark extends Basic
}
$model = new AAgents();
$result = $model->searchAgentsByKeyword("id,name,phone", [ "id" => $this->params["agent_id"]]);
$call = new CallPhoneService();
$result = $call->getBindNum($v['user_phone'],$result[0]['phone']);
if($result != 0){
$is_outpace_call_num = 0;
}
//$call = new CallPhoneService();
//$result = $call->getBindNum($v['user_phone'],$result[0]['phone']);
//if($result != 0){
// $is_outpace_call_num = 0;
//}
$is_privacy = $redis->get('s_is_privacy');//判断是否当前经纪人跟当前客户是否有电话绑定 从redis查询
if(!empty($is_privacy)) {
$call_key = 'call_'.$this->userId.'_'.$result[0]['phone'].'_'.$v['user_phone'].'_'.$is_privacy;
$redis_res = $redis->get($call_key);
if(!empty($redis_res)){
$is_outpace_call_num = 0;
}
}//判断是否当前经纪人跟当前客户是否有电话绑定 从redis查询
$data['data']['list'][$k]['is_outpace_call_num'] = $is_outpace_call_num;
/* 判断当天被拨打是否超过5次,同时判断是否当前经纪人跟当前客户是否有电话绑定 end*/
......
......@@ -270,7 +270,26 @@
}else{
$(".head-img-agent").attr("src", "/app/images/ic_default_headpic.png");
}
//点击拨打 记录拨打次数
$("#fix_tel").click(function() {
if($.cookie("isCallShop") != 'yes'){
$.ajax({
url: '/api/recordCallNumShare',
type: 'POST',
async: true,
data: {
'phone': _tel
},
dataType: 'json',
success: function(data) {
$.cookie("isCallShop",'yes',{ expires: 1});
}
});
}
});
$("#fix_area_bottom_btn").click(function() {
_fix_bottom.hide();
});
......
/*!
* jQuery Cookie Plugin v1.4.0
* https://github.com/carhartl/jquery-cookie
*
* Copyright 2013 Klaus Hartl
* Released under the MIT license
*/
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as anonymous module.
define(['jquery'], factory);
} else {
// Browser globals.
factory(jQuery);
}
}(function ($) {
var pluses = /\+/g;
function encode(s) {
return config.raw ? s : encodeURIComponent(s);
}
function decode(s) {
return config.raw ? s : decodeURIComponent(s);
}
function stringifyCookieValue(value) {
return encode(config.json ? JSON.stringify(value) : String(value));
}
function parseCookieValue(s) {
if (s.indexOf('"') === 0) {
// This is a quoted cookie as according to RFC2068, unescape...
s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
}
try {
// Replace server-side written pluses with spaces.
// If we can't decode the cookie, ignore it, it's unusable.
s = decodeURIComponent(s.replace(pluses, ' '));
} catch(e) {
return;
}
try {
// If we can't parse the cookie, ignore it, it's unusable.
return config.json ? JSON.parse(s) : s;
} catch(e) {}
}
function read(s, converter) {
var value = config.raw ? s : parseCookieValue(s);
return $.isFunction(converter) ? converter(value) : value;
}
var config = $.cookie = function (key, value, options) {
// Write
if (value !== undefined && !$.isFunction(value)) {
options = $.extend({}, config.defaults, options);
if (typeof options.expires === 'number') {
var days = options.expires, t = options.expires = new Date();
t.setDate(t.getDate() + days);
}
return (document.cookie = [
encode(key), '=', stringifyCookieValue(value),
options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
options.path ? '; path=' + options.path : '',
options.domain ? '; domain=' + options.domain : '',
options.secure ? '; secure' : ''
].join(''));
}
// Read
var result = key ? undefined : {};
// To prevent the for loop in the first place assign an empty array
// in case there are no cookies at all. Also prevents odd result when
// calling $.cookie().
var cookies = document.cookie ? document.cookie.split('; ') : [];
for (var i = 0, l = cookies.length; i < l; i++) {
var parts = cookies[i].split('=');
var name = decode(parts.shift());
var cookie = parts.join('=');
if (key && key === name) {
// If second argument (value) is a function it's a converter...
result = read(cookie, value);
break;
}
// Prevent storing a cookie that we couldn't decode.
if (!key && (cookie = read(cookie)) !== undefined) {
result[name] = cookie;
}
}
return result;
};
config.defaults = {};
$.removeCookie = function (key, options) {
if ($.cookie(key) !== undefined) {
// Must not alter options, thus extending a fresh object...
$.cookie(key, '', $.extend({}, options, { expires: -1 }));
return true;
}
return false;
};
}));
......@@ -13,6 +13,7 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'css!style/home.css', '
agent_id_phone:'',//分佣方 姓名搜索
detail_user_id:'',//用户id
detail_shop_id:'',//商铺id
isBargaininfoSaveIngFlag: false,//成交信息保存是否正在保存
shouyong_date_active_sapn: null,
init: function() {
//初始化dot
......@@ -712,42 +713,48 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'css!style/home.css', '
});
},
bargaininfoSave: function() { //修改报告详情
var _data = {
'id': bargain.bargain_id,
'commission': $.trim($('#bargaininfo_total_commission').val()),
'content': $.trim($('#bargaininfo_beizhu').val()),
'is_open': $('#bargaininfo_is_open').val(),
'trade_type': $('#bargaininfo_type').val(),
'industry_type': $.trim($('#bargaininfo_yetai').val()),
'price': $('#bargaininfo_chengjiao_price').val(),
'estimated_receipt_date': $('#bargaininfo_expect_payback_time').val(),
'step': bargain.mainTabIndex,
'house_number': $.trim($('#bargaininfo_shop_num').val())
};
$.each($('.detail-modal-bargaininfo-commission-sec'), function(i, v) {
_data['practical_fee['+i+']'] = {
'fee_id': v.getAttribute('data-id')?v.getAttribute('data-id'):0,
'fee': $.trim($(v).find('input').eq(0).val()),
'operation_date': $.trim($(v).find('input').eq(1).val())
if(!bargain.isBargaininfoSaveIngFlag){
bargain.isBargaininfoSaveIngFlag = true;
var _data = {
'id': bargain.bargain_id,
'commission': $.trim($('#bargaininfo_total_commission').val()),
'content': $.trim($('#bargaininfo_beizhu').val()),
'is_open': $('#bargaininfo_is_open').val(),
'trade_type': $('#bargaininfo_type').val(),
'industry_type': $.trim($('#bargaininfo_yetai').val()),
'price': $('#bargaininfo_chengjiao_price').val(),
'estimated_receipt_date': $('#bargaininfo_expect_payback_time').val(),
'step': bargain.mainTabIndex,
'house_number': $.trim($('#bargaininfo_shop_num').val())
};
});
$.ajax({
'type': 'POST',
'url': '/index/editBargainInfo',
data: _data,
dataType: "json",
success: function(data) {
if(data.code == 200) {
alert('修改成功');
bargain.bargaininfoShow();
//bargain.getList(0);
} else {
alert(data.msg);
}
}
});
$.each($('.detail-modal-bargaininfo-commission-sec'), function(i, v) {
_data['practical_fee['+i+']'] = {
'fee_id': v.getAttribute('data-id')?v.getAttribute('data-id'):0,
'fee': $.trim($(v).find('input').eq(0).val()),
'operation_date': $.trim($(v).find('input').eq(1).val())
};
});
$.ajax({
'type': 'POST',
'url': '/index/editBargainInfo',
data: _data,
dataType: "json",
success: function(data) {
if(data.code == 200) {
alert('修改成功');
bargain.bargaininfoShow();
//bargain.getList(0);
} else {
alert(data.msg);
}
},
complete: function(xhr, textStatus){
bargain.isBargaininfoSaveIngFlag = false;
}
});
}
},
maidShow: function() {
$('#maid_new_btn').hide();//默认隐藏新增按钮
......
......@@ -369,7 +369,7 @@
<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>
[% for(var item in it){ %]
......@@ -380,9 +380,9 @@
<td class="text-center">[%= it[item]['report_agent_name'] %]</td>
<td class="text-center">[%= hideStr(it[item]['house_title']) %]</td>
<td class="text-center">[%= it[item]['predict_see_time'] %]</td>
<td class="text-center">
<!--<td class="text-center">
<a class="btn1 btn-success timeline" href="#modal-time" data-toggle="modal" data-id='[%= it[item]["order_id"] %]'>时间轴</a>
</td>
</td>-->
</tr>
[% } %]
[% }else{ %]
......@@ -404,7 +404,7 @@
<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>
[% for(var item in it){ %]
......@@ -415,9 +415,9 @@
<td class="text-center">[%= it[item]['report_agent_name'] %]</td>
<td class="text-center">[%= hideStr(it[item]['house_title']) %]</td>
<td class="text-center">[%= it[item]['predict_see_time'] %]</td>
<td class="text-center">
<!--<td class="text-center">
<a class="btn1 btn-success timeline" href="#modal-time" data-toggle="modal" data-id='[%= it[item]["order_id"] %]'>时间轴</a>
</td>
</td>-->
</tr>
[% } %]
[% }else{ %]
......
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