Commit 11bc26af authored by agping's avatar agping

收款日志 财务日报未提交

parent f7d11d2c
......@@ -95,5 +95,19 @@ class RealTimePerformance extends Basic
return view('cost/accountingTable');
}
}
//收款日志
public function receivingLog()
{
if (!$this->request->isAjax()) {
return view('finance/receivingLog');
}
}
//财务日报未提交
public function forgetSubmitFinancial()
{
if (!$this->request->isAjax()) {
return view('finance/forgetSubmitFinancial');
}
}
}
\ No newline at end of file
{layout name="global/frame_two_tpl" /}
<input type="hidden" class="page-load" id="forgetSubmitFinancial" />
<style>
#note_text{
width: 80%;
margin-left: 48px;
margin-top: -20px;
}
#note_text_re{
width: 80%;
margin-left: 48px;
margin-top: -20px;
}
.Tswitch_one{
display: none;
}
.Tswitch_two{
display: none;
}
.left{
float: left;
width: 340px;
line-height: 36px;
}
.right{
line-height: 36px;
}
.btn_2{
width: 60px;
display: inline-block;
height: 26px;
padding: 3px 6px
}
.edit_new{
float: right;
margin-bottom: 5px;
margin-top: -10px;
}
.form-control-one{
display: inline-block;
width: 40%;
}
#form_search{
line-height: 48px;
}
.modal-body-two{
height: 500px;
overflow-y: scroll;
}
.clear{
clear: both;
}
.font-size-16{
font-size: 16px;
font-weight: 600;
}
/*分佣方 姓名 下拉式列表*/
.user-ul{
height: auto;
float: left;
position: absolute;
width: 290px;
background: #fff;
border: 1px solid #ccc;
border-top:0;
left: 3px;
}
.user-ul li{
list-style: none;
line-height: 30px;
margin-left: -20px;
}
.left-phone{
width: 300px;
float: left;
margin-top: 7px;
margin-left: 10px;
position: relative;
}
</style>
<div id="page-content-wrapper">
<div class="container">
<div class="row">
<div class="">
<div class="panel panel-default">
<div class="panel-heading breadcrumb">
<li><a href="#">实收明细</a></li>
</div>
<div class="panel-body">
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover table-condensed">
<thead>
<tr>
<td colspan="14" class="maintable-top-sub-tr">
<a class="btn btn-info liudan_pic_btn">商铺</a>
<a class="btn btn-default liudan_pic_btn">公楼</a>
</td>
</tr>
<tr>
<td colspan="12">
<form id="form_search">
<span class="fore-span ld-Marheight">财务日报未提交 收佣日期:</span>
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="create_time" 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_time" name="end_date" type="date">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="internal_address" placeholder="房源地址" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="internal_num" placeholder="房源号" type="text" value="">
<select name="district_id" class="form-control btn4 ld-Marheight">
<option value="">分佣方所属部门</option>
</select>
<select name="store_id" class="form-control btn4 ld-Marheight">
<option value="">分佣方所属门店</option>
</select>
<div class="left-phone">
<input class="form-control" data-rule-phoneus="false" data-rule-required="false" id="partical_name" placeholder="分佣方姓名" type="text" value="">
<ul class="user-ul"></ul>
</div>
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="bargain_id" placeholder="成交报告id" type="text" value="">
<div class="clear"></div>
<span class="btn btn-info btn3" id="search">搜索</span>
<span class="btn btn-info btn3" id="reset">重置</span>
<span class="btn btn-info btn3" id="export">导出excel</span>
<span class="ld-Marheight font-size-16">实收总计:</span><span id="money_total" class="ld-Marheight font-size-16"></span>
</form>
</td>
</tr>
<tr>
<th class="text-center">成交报告ID</th>
<th class="text-center">分佣ID</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>
</thead>
<tbody class="text-center" id="business_list">
</table>
</div>
<div class="text-right" id="pagediv">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- 弹出框 详情 -->
<div class="modal fade" id="modal_detail" 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>
</div>
<div class="modal-body detail-modal-body">
<iframe class="iframe-bargaininfo-static" name="iframe_bargaininfo_static"></iframe>
<a class="btn1 bargain-detail-shop btn-info" href="#modal_shop_detail" data-toggle="modal" style="display: none;">商铺</a>
<a class="btn1 caozuo genj_ure btn-info" href="#modal_user_detail" data-toggle="modal" style="display: none;">客户</a>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
</div>
<!-- 弹出框 时间轴 -->
<div class="modal fade" id="modal-time" 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" class="iframe-div-parent">
<iframe class="iframe-time-line"></iframe>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>
{layout name="global/frame_two_tpl" /}
<input type="hidden" class="page-load" id="receivingLog" />
<style>
#note_text{
width: 80%;
margin-left: 48px;
margin-top: -20px;
}
#note_text_re{
width: 80%;
margin-left: 48px;
margin-top: -20px;
}
.Tswitch_one{
display: none;
}
.Tswitch_two{
display: none;
}
.left{
float: left;
width: 340px;
line-height: 36px;
}
.right{
line-height: 36px;
}
.btn_2{
width: 60px;
display: inline-block;
height: 26px;
padding: 3px 6px
}
.edit_new{
float: right;
margin-bottom: 5px;
margin-top: -10px;
}
.form-control-one{
display: inline-block;
width: 40%;
}
#form_search{
line-height: 48px;
}
.modal-body-two{
height: 500px;
overflow-y: scroll;
}
.clear{
clear: both;
}
.font-size-16{
font-size: 16px;
font-weight: 600;
}
/*分佣方 姓名 下拉式列表*/
.user-ul{
height: auto;
float: left;
position: absolute;
width: 290px;
background: #fff;
border: 1px solid #ccc;
border-top:0;
left: 3px;
}
.user-ul li{
list-style: none;
line-height: 30px;
margin-left: -20px;
}
.left-phone{
width: 300px;
float: left;
margin-top: 7px;
margin-left: 10px;
position: relative;
}
</style>
<div id="page-content-wrapper">
<div class="container">
<div class="row">
<div class="">
<div class="panel panel-default">
<div class="panel-heading breadcrumb">
<li><a href="#">实收明细</a></li>
</div>
<div class="panel-body">
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover table-condensed">
<thead>
<tr>
<td colspan="14" class="maintable-top-sub-tr">
<a class="btn btn-info liudan_pic_btn">商铺</a>
<a class="btn btn-default liudan_pic_btn">公楼</a>
</td>
</tr>
<tr>
<td colspan="12">
<form id="form_search">
<span class="fore-span ld-Marheight">收款日志 收佣日期:</span>
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="create_time" 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_time" name="end_date" type="date">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="internal_address" placeholder="房源地址" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="internal_num" placeholder="房源号" type="text" value="">
<select name="district_id" class="form-control btn4 ld-Marheight">
<option value="">分佣方所属部门</option>
</select>
<select name="store_id" class="form-control btn4 ld-Marheight">
<option value="">分佣方所属门店</option>
</select>
<div class="left-phone">
<input class="form-control" data-rule-phoneus="false" data-rule-required="false" id="partical_name" placeholder="分佣方姓名" type="text" value="">
<ul class="user-ul"></ul>
</div>
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="bargain_id" placeholder="成交报告id" type="text" value="">
<div class="clear"></div>
<span class="btn btn-info btn3" id="search">搜索</span>
<span class="btn btn-info btn3" id="reset">重置</span>
<span class="btn btn-info btn3" id="export">导出excel</span>
<span class="ld-Marheight font-size-16">实收总计:</span><span id="money_total" class="ld-Marheight font-size-16"></span>
</form>
</td>
</tr>
<tr>
<th class="text-center">成交报告ID</th>
<th class="text-center">分佣ID</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>
</thead>
<tbody class="text-center" id="business_list">
</table>
</div>
<div class="text-right" id="pagediv">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- 弹出框 详情 -->
<div class="modal fade" id="modal_detail" 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>
</div>
<div class="modal-body detail-modal-body">
<iframe class="iframe-bargaininfo-static" name="iframe_bargaininfo_static"></iframe>
<a class="btn1 bargain-detail-shop btn-info" href="#modal_shop_detail" data-toggle="modal" style="display: none;">商铺</a>
<a class="btn1 caozuo genj_ure btn-info" href="#modal_user_detail" data-toggle="modal" style="display: none;">客户</a>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
</div>
<!-- 弹出框 时间轴 -->
<div class="modal fade" id="modal-time" 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" class="iframe-div-parent">
<iframe class="iframe-time-line"></iframe>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>
......@@ -370,6 +370,9 @@ Route::group('index', [
'publicCostDetails' => ['index/RealTimePerformance/publicCostDetails', ['method' => 'GET']],//费用报销详情 liu
'publicCostDetailsStore' => ['index/RealTimePerformance/publicCostDetailsStore', ['method' => 'GET']],//成本明细详情 liu
'accountingTable' => ['index/RealTimePerformance/accountingTable', ['method' => 'GET']],//成本核算表 liu
'receivingLog' => ['index/RealTimePerformance/receivingLog', ['method' => 'GET']],//收款日志 liu
'forgetSubmitFinancial' => ['index/RealTimePerformance/forgetSubmitFinancial', ['method' => 'GET']],//财务日报未提交 liu
'shopinspectionLog' => ['index/ShopInspectionLog/shopinspectionLogList', ['method' => 'POST|GET']],//商铺查看日志liu
'opensquareLog' => ['index/OpenSquareLog/opensquarelogList', ['method' => 'POST|GET']],//开盘广场liu
......
define(['doT', 'text!temp/forgetSubmitFinancial_template_tpl.html', 'css!style/home.css', 'css!style/report_list.css', 'ckfinder', 'ckfinderStart', 'pagination', 'bootstrapJs'], function(doT, template) {
bargain = {
pageNo: 1,
/*第几页*/
pageSize: 10,
/*每页显示多少条*/
mainTabIndex: 0,
listUrl:'/index/partialCommissionList',//业绩明细url
bargain_id: '',
father_id:'',
order_id: 0,//订单id
agent_id_phone:'',//分佣方 姓名搜索
init: function() {
//初始化dot
$(document.body).append(template);
//初始化收佣日期
function  getPreMonth(date)  {            
var  arr  =  date.split('-');            
var  year  =  arr[0];             
var  month  =  arr[1];             
var  day  =  arr[2];             
var  days  =  new  Date(year,  month,  0);            
days  =  days.getDate();             
var  year2  =  year;            
var  month2  =  parseInt(month)  -  1;            
if (month2  ==  0)  {                
year2  =  parseInt(year2)  -  1;                
month2  =  12;            
}            
var  day2  =  day;            
var  days2  =  new  Date(year2,  month2,  0);            
days2  =  days2.getDate();            
if (day2  >  days2)  {                
day2  =  days2;            
}            
if (month2  <  10)  {                
month2  =  '0'  +  month2;            
}            
var  t2  =  year2  +  '-'  +  month2  +  '-'  +  day2;            
return  t2;        
}
//初始化时间
var myDate = new Date();
var y = myDate.getFullYear();
var m = myDate.getMonth() + 1;
var d = myDate.getDate();
var day_end = y + '-' + (m < 10 ? ('0' + m) : m) + '-' + (d < 10 ? ('0' + d) : d);
var day_start = getPreMonth(day_end);
$('#create_time').val(day_start);
$('#end_time').val(day_end);
bargain.getList(1);
bargain.event();
},
event: function() {
var _doc = $(document);
//商铺 办公楼切换
_doc.on('click', '.maintable-top-sub-tr>a', function(e){
e.preventDefault();
e.stopPropagation();
var _this = $(this);
bargain.mainTabIndex = $(this).index();
_this.removeClass('btn-default').addClass('btn-info').siblings().removeClass('btn-info').addClass('btn-default');
if($(this).index() == 0){//商铺
bargain.listUrl = '/index/partialCommissionList';
}else if($(this).index() == 1){//办公楼
bargain.listUrl = '/office_index/partialCommissionList';
}
console.log(555)
bargain.getList(1);
});
$("#search").click(function() {
bargain.getList(1);
});
$("#reset").click(function() { //重置
document.getElementById("form_search").reset();
bargain.agent_id_phone='';
});
$("#export").click(function() { //导出列表
bargain.exportList();
});
//分佣方 所属部门 门店 筛选
bargain.getDistrict(function() {
_doc.on('input', '[name=district_id],#district_id2', function() {
var _this = $(this);
var _id = _this.val();
_this.next().html(''); //先清空
//新增 编辑
var _objTemp = _this.parent().next().find('select');
_objTemp.html(''); //先清空
if(_id && _id != '0') {
bargain.getDistrictStoreList(_id, function(_data) {
var _str = '<option value="">全部</option>';
$.each(_data, function(i, item) {
_str += '<option value="' + item.id + '">' + item.store_name + '</option>';
});
_objTemp.html(_str);
_this.next().html(_str);
});
} else {};
});
});
//分佣方 姓名下拉式
$(document).on("input", "#partical_name", function() { //手机号新增搜索客方
if($("#partical_name").val() == '') {
bargain.agent_id_phone='';
$(".user-ul").html('');
} else {
bargain.search_phone();
}
});
//点击li 列表消失
$(document).delegate(".addphone", "click", function() { //list消失新增客户 点击li事件 获取id ul消失
bargain.addphone(this);
});
//搜索按钮的事件
_doc.on('click', '#maintable_search', function(e) {
e.preventDefault();
e.stopPropagation();
bargain.getList(1); //一级审核搜索
});
//搜索的重置
$("#maintable_reset").click(function() {
document.getElementById("maintable_form_search").reset();
});
//点击详情按钮事件,获取报告详情
_doc.on('click', '.details-btn', function() {
var _id = $(this).attr("data-id");
bargain.bargain_id = _id;
bargain.father_id = $(this).closest('tr').attr("data-fatherid");
if(bargain.mainTabIndex == 0){//商铺
$('.iframe-bargaininfo-static').attr('src', '/app_broker/bargaininfo_detail_static_pc?otherbtn=no&orderid='+_id).load;
}else{//办公楼
$('.iframe-bargaininfo-static').attr('src', '/app_broker/bargaininfo_detail_static_pc_office?orderid='+_id+'&otherbtn=no').load;
}
});
//时间轴点击事件
_doc.on('click', 'a[href="#modal-time"]', function(e){
e.preventDefault();
e.stopPropagation();
var _this = $(this);
var _id = _this.closest('tr').data('orderid');
if(bargain.mainTabIndex == 0){//商铺
$('.iframe-time-line').attr('src', '/app_broker/timeline_pc?order_id='+_id);
}else{//办公楼
$('.iframe-time-line').attr('src', '/app_broker/timeline_pc_financial?order_id='+_id);
}
});
},
getDepart: function(s, fn){
$.ajax({
type: 'GET',
url: '/index/getAgentDistrictStore',
data: {
'id': s
},
timeout: 30000,
dataType: 'json',
beforeSend: function() {},
success: function(_data) {
if(typeof _data === 'object') {
if(_data['code'] == '200') {
fn && fn(_data.data);
} else {
layerTipsX(_data['msg']);
}
} else {
layerTipsX('数据错误');
};
},
error: function() {
layerTipsX('enter error');
},
complete: function(xhr, textStatus){
if(textStatus === 'timeout') {
//处理超时的逻辑
layerTipsX('请求超时,请重试');
};
}
});
},
//分佣方 姓名搜索
search_phone: function() { //手机号新增客户
$.ajax({
url: '/index/getBroker_new',
type: 'GET',
async: true,
data: {
"district_id": $("select[name='district_id'] option:selected").val(),//部门
"store_id": $("select[name='store_id'] option:selected").val(),//门店
"phone": $("#partical_name").val(),
"all" : 1
},
dataType: 'json',
success: function(data) {
if(data.code == 200) {
var user_ul = "";
$.each(data.data, function(i, item) {
if(item.status == 0){
var status=' ';
};
if(item.status == 1){
var status='-长假';
};
if(item.status == 2){
var status='-离职';
};
if(item.status == 3){
var status='-转勤';
};
if(item.status == 4){
var status='-黑名单';
}
user_ul += '<li class="addphone" data-id="' + item.id + '">' + item.id + '-' + item.name + '-' + item.phone + status +'</li>';
});
$(".user-ul").html(user_ul);
} else {
alert(data.msg);
}
}
});
},
//将li里的值 赋给input(分佣方姓名)
addphone: function(obj) {//新增客户 input赋值
var user_ht = $(obj).html();
var user_ht_str=user_ht.substring(0,user_ht.length-3);//输入框里 不显示职称
$("#partical_name").val(user_ht_str);
$(".user-ul").html('');
bargain.agent_id_phone = $(obj).attr("data-id");
},
getList: function(pageNo) {
bargain.pageNo = pageNo;
var params = {};
params.pageNo = bargain.pageNo;
params.pageSize = bargain.pageSize;
params.create_time = $('#create_time') .val();
params.end_time = $('#end_time') .val();
params.internal_address = $('#internal_address').val();
// params.phone = $('#user_phone').val();
params.house_number = $('#internal_num').val();
params.bargain_id = $('#bargain_id').val();
params.partial_id = bargain.agent_id_phone;//分佣方姓名 下拉式 搜索
params.district_id = $("select[name='district_id'] option:selected").val();//部门
params.store_id = $("select[name='store_id'] option:selected").val();//门店
$.ajax({
url: bargain.listUrl, //获取列表
type: 'GET',
async: true,
data: params,
dataType: 'json',
success: function(data) {
if (data.code == 200) {
var temp = document.getElementById('forgetSubmitFinancial_list_tpl').innerHTML;
var doTtmpl = doT.template(temp);
$("#business_list").html(doTtmpl(data.data.data.list));
$("#money_total").html(data.data.data.total_money);//实收总计
/*分页代码*/
add_page(data.data.data.total, pageNo, bargain.pageSize, bargain.getList);
} else {
alert(data.msg);
}
}
});
},
exportList: function(pageNo) {
//导出分佣提成列表
bargain.pageNo = pageNo;
var create_time = $('#create_time').val();
var end_time = $('#end_time').val();
var internal_address = $('#internal_address').val();
var partial_id = bargain.agent_id_phone;
var district_id = $("select[name='district_id'] option:selected").val();
var store_id = $("select[name='store_id'] option:selected").val();
var house_number = $('#internal_num').val();
var bargain_id = $('#bargain_id').val();
window.open('/index/exportExcel?create_time=' + create_time + '&end_time=' + end_time + '&internal_address=' + internal_address + '&partial_id=' + partial_id + '&district_id=' + district_id + '&house_number=' + house_number + '&bargain_id=' + bargain_id + '&store_id=' + store_id);
},
getDistrict: function(fn) {
$.ajax({
url: '/index/getDistrict',
type: 'GET',
async: true,
data: {
"pageSize": 1000
},
dataType: 'json',
success: function(data) {
if(data.code == 200 && data.data != null) {
var str = '';
$.each(data.data, function(i, item) {
str += '<option value="' + item.id + '">' + item.district_name + '</option>';
});
$('[name=district_id]').append(str);
$('#district_id2').append(str);
fn && fn();
}
}
});
},
getDistrictStoreList: function(id, fn) {
$.ajax({
url: '/index/getDistrictStoreList',
type: 'GET',
async: true,
data: {
'id': id,
"pageSize": 1000
},
dataType: 'json',
success: function(data) {
if(data.code == 200 && data.data != null) {
fn && fn(data.data);
}
}
});
},
};
return bargain;
});
\ No newline at end of file
define(['doT', 'text!temp/receiving_log_template_tpl.html', 'css!style/home.css', 'css!style/report_list.css', 'ckfinder', 'ckfinderStart', 'pagination', 'bootstrapJs'], function(doT, template) {
bargain = {
pageNo: 1,
/*第几页*/
pageSize: 10,
/*每页显示多少条*/
mainTabIndex: 0,
listUrl:'/index/partialCommissionList',//业绩明细url
bargain_id: '',
father_id:'',
order_id: 0,//订单id
agent_id_phone:'',//分佣方 姓名搜索
init: function() {
//初始化dot
$(document.body).append(template);
//初始化收佣日期
function  getPreMonth(date)  {            
var  arr  =  date.split('-');            
var  year  =  arr[0];             
var  month  =  arr[1];             
var  day  =  arr[2];             
var  days  =  new  Date(year,  month,  0);            
days  =  days.getDate();             
var  year2  =  year;            
var  month2  =  parseInt(month)  -  1;            
if (month2  ==  0)  {                
year2  =  parseInt(year2)  -  1;                
month2  =  12;            
}            
var  day2  =  day;            
var  days2  =  new  Date(year2,  month2,  0);            
days2  =  days2.getDate();            
if (day2  >  days2)  {                
day2  =  days2;            
}            
if (month2  <  10)  {                
month2  =  '0'  +  month2;            
}            
var  t2  =  year2  +  '-'  +  month2  +  '-'  +  day2;            
return  t2;        
}
//初始化时间
var myDate = new Date();
var y = myDate.getFullYear();
var m = myDate.getMonth() + 1;
var d = myDate.getDate();
var day_end = y + '-' + (m < 10 ? ('0' + m) : m) + '-' + (d < 10 ? ('0' + d) : d);
var day_start = getPreMonth(day_end);
$('#create_time').val(day_start);
$('#end_time').val(day_end);
bargain.getList(1);
bargain.event();
},
event: function() {
var _doc = $(document);
//商铺 办公楼切换
_doc.on('click', '.maintable-top-sub-tr>a', function(e){
e.preventDefault();
e.stopPropagation();
var _this = $(this);
bargain.mainTabIndex = $(this).index();
_this.removeClass('btn-default').addClass('btn-info').siblings().removeClass('btn-info').addClass('btn-default');
if($(this).index() == 0){//商铺
bargain.listUrl = '/index/partialCommissionList';
}else if($(this).index() == 1){//办公楼
bargain.listUrl = '/office_index/partialCommissionList';
}
console.log(555)
bargain.getList(1);
});
$("#search").click(function() {
bargain.getList(1);
});
$("#reset").click(function() { //重置
document.getElementById("form_search").reset();
bargain.agent_id_phone='';
});
$("#export").click(function() { //导出列表
bargain.exportList();
});
//分佣方 所属部门 门店 筛选
bargain.getDistrict(function() {
_doc.on('input', '[name=district_id],#district_id2', function() {
var _this = $(this);
var _id = _this.val();
_this.next().html(''); //先清空
//新增 编辑
var _objTemp = _this.parent().next().find('select');
_objTemp.html(''); //先清空
if(_id && _id != '0') {
bargain.getDistrictStoreList(_id, function(_data) {
var _str = '<option value="">全部</option>';
$.each(_data, function(i, item) {
_str += '<option value="' + item.id + '">' + item.store_name + '</option>';
});
_objTemp.html(_str);
_this.next().html(_str);
});
} else {};
});
});
//分佣方 姓名下拉式
$(document).on("input", "#partical_name", function() { //手机号新增搜索客方
if($("#partical_name").val() == '') {
bargain.agent_id_phone='';
$(".user-ul").html('');
} else {
bargain.search_phone();
}
});
//点击li 列表消失
$(document).delegate(".addphone", "click", function() { //list消失新增客户 点击li事件 获取id ul消失
bargain.addphone(this);
});
//搜索按钮的事件
_doc.on('click', '#maintable_search', function(e) {
e.preventDefault();
e.stopPropagation();
bargain.getList(1); //一级审核搜索
});
//搜索的重置
$("#maintable_reset").click(function() {
document.getElementById("maintable_form_search").reset();
});
//点击详情按钮事件,获取报告详情
_doc.on('click', '.details-btn', function() {
var _id = $(this).attr("data-id");
bargain.bargain_id = _id;
bargain.father_id = $(this).closest('tr').attr("data-fatherid");
if(bargain.mainTabIndex == 0){//商铺
$('.iframe-bargaininfo-static').attr('src', '/app_broker/bargaininfo_detail_static_pc?otherbtn=no&orderid='+_id).load;
}else{//办公楼
$('.iframe-bargaininfo-static').attr('src', '/app_broker/bargaininfo_detail_static_pc_office?orderid='+_id+'&otherbtn=no').load;
}
});
//时间轴点击事件
_doc.on('click', 'a[href="#modal-time"]', function(e){
e.preventDefault();
e.stopPropagation();
var _this = $(this);
var _id = _this.closest('tr').data('orderid');
if(bargain.mainTabIndex == 0){//商铺
$('.iframe-time-line').attr('src', '/app_broker/timeline_pc?order_id='+_id);
}else{//办公楼
$('.iframe-time-line').attr('src', '/app_broker/timeline_pc_financial?order_id='+_id);
}
});
},
getDepart: function(s, fn){
$.ajax({
type: 'GET',
url: '/index/getAgentDistrictStore',
data: {
'id': s
},
timeout: 30000,
dataType: 'json',
beforeSend: function() {},
success: function(_data) {
if(typeof _data === 'object') {
if(_data['code'] == '200') {
fn && fn(_data.data);
} else {
layerTipsX(_data['msg']);
}
} else {
layerTipsX('数据错误');
};
},
error: function() {
layerTipsX('enter error');
},
complete: function(xhr, textStatus){
if(textStatus === 'timeout') {
//处理超时的逻辑
layerTipsX('请求超时,请重试');
};
}
});
},
//分佣方 姓名搜索
search_phone: function() { //手机号新增客户
$.ajax({
url: '/index/getBroker_new',
type: 'GET',
async: true,
data: {
"district_id": $("select[name='district_id'] option:selected").val(),//部门
"store_id": $("select[name='store_id'] option:selected").val(),//门店
"phone": $("#partical_name").val(),
"all" : 1
},
dataType: 'json',
success: function(data) {
if(data.code == 200) {
var user_ul = "";
$.each(data.data, function(i, item) {
if(item.status == 0){
var status=' ';
};
if(item.status == 1){
var status='-长假';
};
if(item.status == 2){
var status='-离职';
};
if(item.status == 3){
var status='-转勤';
};
if(item.status == 4){
var status='-黑名单';
}
user_ul += '<li class="addphone" data-id="' + item.id + '">' + item.id + '-' + item.name + '-' + item.phone + status +'</li>';
});
$(".user-ul").html(user_ul);
} else {
alert(data.msg);
}
}
});
},
//将li里的值 赋给input(分佣方姓名)
addphone: function(obj) {//新增客户 input赋值
var user_ht = $(obj).html();
var user_ht_str=user_ht.substring(0,user_ht.length-3);//输入框里 不显示职称
$("#partical_name").val(user_ht_str);
$(".user-ul").html('');
bargain.agent_id_phone = $(obj).attr("data-id");
},
getList: function(pageNo) {
bargain.pageNo = pageNo;
var params = {};
params.pageNo = bargain.pageNo;
params.pageSize = bargain.pageSize;
params.create_time = $('#create_time') .val();
params.end_time = $('#end_time') .val();
params.internal_address = $('#internal_address').val();
// params.phone = $('#user_phone').val();
params.house_number = $('#internal_num').val();
params.bargain_id = $('#bargain_id').val();
params.partial_id = bargain.agent_id_phone;//分佣方姓名 下拉式 搜索
params.district_id = $("select[name='district_id'] option:selected").val();//部门
params.store_id = $("select[name='store_id'] option:selected").val();//门店
$.ajax({
url: bargain.listUrl, //获取列表
type: 'GET',
async: true,
data: params,
dataType: 'json',
success: function(data) {
if (data.code == 200) {
var temp = document.getElementById('receiving_log_list_tpl').innerHTML;
var doTtmpl = doT.template(temp);
$("#business_list").html(doTtmpl(data.data.data.list));
$("#money_total").html(data.data.data.total_money);//实收总计
/*分页代码*/
add_page(data.data.data.total, pageNo, bargain.pageSize, bargain.getList);
} else {
alert(data.msg);
}
}
});
},
exportList: function(pageNo) {
//导出分佣提成列表
bargain.pageNo = pageNo;
var create_time = $('#create_time').val();
var end_time = $('#end_time').val();
var internal_address = $('#internal_address').val();
var partial_id = bargain.agent_id_phone;
var district_id = $("select[name='district_id'] option:selected").val();
var store_id = $("select[name='store_id'] option:selected").val();
var house_number = $('#internal_num').val();
var bargain_id = $('#bargain_id').val();
window.open('/index/exportExcel?create_time=' + create_time + '&end_time=' + end_time + '&internal_address=' + internal_address + '&partial_id=' + partial_id + '&district_id=' + district_id + '&house_number=' + house_number + '&bargain_id=' + bargain_id + '&store_id=' + store_id);
},
getDistrict: function(fn) {
$.ajax({
url: '/index/getDistrict',
type: 'GET',
async: true,
data: {
"pageSize": 1000
},
dataType: 'json',
success: function(data) {
if(data.code == 200 && data.data != null) {
var str = '';
$.each(data.data, function(i, item) {
str += '<option value="' + item.id + '">' + item.district_name + '</option>';
});
$('[name=district_id]').append(str);
$('#district_id2').append(str);
fn && fn();
}
}
});
},
getDistrictStoreList: function(id, fn) {
$.ajax({
url: '/index/getDistrictStoreList',
type: 'GET',
async: true,
data: {
'id': id,
"pageSize": 1000
},
dataType: 'json',
success: function(data) {
if(data.code == 200 && data.data != null) {
fn && fn(data.data);
}
}
});
},
};
return bargain;
});
\ No newline at end of file
<script id="forgetSubmitFinancial_list_tpl" type="text/template">
[% if(it&&it[0]) { %]
[% for(var item in it){ %]
<tr class="text-center" data-id="[%= it[item]['bargain_id'] %]" data-orderid="[%= it[item]['order_id'] %]" data-fatherid="[%= it[item]['father_id'] %]">
[% var getInfoType=function(r){switch(Number(r)){case 1:return"盘方";case 2:return"客方";case 3:return"反签";case 4:return"独家";case 5:return"合作方";case 6:return"APP盘下载方";case 7:return"APP客下载方";default:return"未定义"}}; %]
<td>[%= it[item]['bargain_id'] %]</td>
<td>[%= it[item]['commission_id'] %]</td>
<td>
[% if(it[item]['income_time']) { %]
[%= it[item]['income_time'] %]
[% } %]
</td>
<td>[%= it[item]['district_store'] %]</td>
<td>[%= it[item]['agent'] %]</td>
<td>[%= it[item]['internal_address'] %]</td>
<td>[%= getInfoType(it[item]['role']) %]</td>
<td>[%= it[item]['house_number'] %]</td>
<td>[%= it[item]['scale'] %]</td>
<td>[%= it[item]['scale_fee'] %]</td>
<td>[%= it[item]['practical_fee'] %]</td>
<td>
<a class="btn1 btn-info details-btn" href="#modal_detail" data-toggle="modal" data-id='[%= it[item]["bargain_id"] %]'>详情</a>
<a class="btn1 btn-info timeline" href="#modal-time" data-toggle="modal" data-id='[%= it[item]["bargain_id"] %]'>时间轴</a>
</td>
</tr>
[% } %]
[% }else{ %]
<tr>
<td colspan="9" style="text-align:center;"> 暂无数据</td>
</tr>
[% } %]
</script>
<script id="receiving_log_list_tpl" type="text/template">
[% if(it&&it[0]) { %]
[% for(var item in it){ %]
<tr class="text-center" data-id="[%= it[item]['bargain_id'] %]" data-orderid="[%= it[item]['order_id'] %]" data-fatherid="[%= it[item]['father_id'] %]">
[% var getInfoType=function(r){switch(Number(r)){case 1:return"盘方";case 2:return"客方";case 3:return"反签";case 4:return"独家";case 5:return"合作方";case 6:return"APP盘下载方";case 7:return"APP客下载方";default:return"未定义"}}; %]
<td>[%= it[item]['bargain_id'] %]</td>
<td>[%= it[item]['commission_id'] %]</td>
<td>
[% if(it[item]['income_time']) { %]
[%= it[item]['income_time'] %]
[% } %]
</td>
<td>[%= it[item]['district_store'] %]</td>
<td>[%= it[item]['agent'] %]</td>
<td>[%= it[item]['internal_address'] %]</td>
<td>[%= getInfoType(it[item]['role']) %]</td>
<td>[%= it[item]['house_number'] %]</td>
<td>[%= it[item]['scale'] %]</td>
<td>[%= it[item]['scale_fee'] %]</td>
<td>[%= it[item]['practical_fee'] %]</td>
<td>
<a class="btn1 btn-info details-btn" href="#modal_detail" data-toggle="modal" data-id='[%= it[item]["bargain_id"] %]'>详情</a>
<a class="btn1 btn-info timeline" href="#modal-time" data-toggle="modal" data-id='[%= it[item]["bargain_id"] %]'>时间轴</a>
</td>
</tr>
[% } %]
[% }else{ %]
<tr>
<td colspan="9" style="text-align:center;"> 暂无数据</td>
</tr>
[% } %]
</script>
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