Commit 7924766a authored by agping's avatar agping

1

parent 8b4b7285
......@@ -20,7 +20,7 @@
<div class="panel-heading breadcrumb">
<li>
<span class="manager-title ld-Marheight"></span>
<input class="form-control ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="create_time_start" name="start_date1" type="date" style="width: 150px;float: left;margin-left: 20px;">
<input id="count_time" class="form-control ld-Marheight" type="text" placeholder="请选择" onclick="WdatePicker({el:this,dateFmt:'yyyy-MM',readOnly:'readonly' })" style="width: 150px;float: left;">
<a class="btn btn-info is-print ld-Marheight" style="margin-left: 20px;">打印</a>
<a class="btn btn-info is-close ld-Marheight" style="margin-left: 20px;">导出excel</a>
......
......@@ -305,9 +305,9 @@
<select class="form-control btn2 ld-Marheight" id="commit_home">
<option value="">费用承担所属部门</option>
</select>
<select class="form-control btn2 ld-Marheight" id="commit_shop">
<!--<select class="form-control btn2 ld-Marheight" id="commit_shop">
<option value="">费用承担所属门店</option>
</select>
</select>-->
<span class="btn btn-info btn3 ld-Marheight" id="search" style="float:left">搜索</span>
<span class="btn btn-info btn3 ld-Marheight" id="reset" style="float:left">重置</span>
</form>
......
......@@ -13,15 +13,17 @@ define(['doT','html2canvas','text!temp/accountingTable_list_template_tpl.html',
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);
$('#create_time_start').val(day_end);//店长日报默认当天
var day_end = y + '-' + (m < 10 ? ('0' + m) : m);
$('#count_time').val(day_end);//店长日报默认当天
//初始化dot
$(document.body).append(template);
//区分我的门店成本 全部门店成本
if(getUrlParam('store_id')){//全部门店
$('.manager-title').html(localStorage.getItem('chengben_detail_string_liu'));
bargain.store_id = getUrlParam('store_id');
}else{//我的门店
var str_ = user_info_obj.district_name + user_info_obj.store_name + user_info_obj.name + "成本核算表"
var str_ = user_info_obj.district_name + user_info_obj.store_name + "成本核算表"
$('.manager-title').html(str_);
bargain.store_id = user_info_obj.store_id;//门店id
}
......@@ -56,12 +58,11 @@ define(['doT','html2canvas','text!temp/accountingTable_list_template_tpl.html',
},
//获取门店成本数据
getList: function(pageNo){
console.count('bar');
var params = {
// 'store_id':bargain.store_id,
// 'setting_date': $('#create_time_start').val + '-01',
'setting_date': "2019-06-01",
'store_id':49,
'store_id':bargain.store_id,
'setting_date': $('#count_time').val() + '-01',
// 'setting_date': "2019-06-01",
// 'store_id':49,
};
$.ajax({
type: 'GET',
......@@ -75,7 +76,7 @@ define(['doT','html2canvas','text!temp/accountingTable_list_template_tpl.html',
success: function(data) {
if(typeof data === 'object') {
if(data.code == 200) {
bargain.countTime = $('#count_time').val();
//办公室
var doTtmpl = doT.template(document.getElementById('a_financial_daily_list_tpl').innerHTML);
$("#maintable_list_a").html(doTtmpl(data.data.store_list.info));
......@@ -133,11 +134,5 @@ define(['doT','html2canvas','text!temp/accountingTable_list_template_tpl.html',
return bargain;
});
var sw=function(s){switch(Number(s)){case 10:return"施总支付宝";case 11:return"林老师支付宝";case 12:return"筠姐支付宝";case 13:return"陈志杰支付宝";case 20:return"施总微信";case 21:return"林老师微信";case 22:return"筠姐微信";case 23:return"陈志杰微信";case 30:return"POS机器";case 40:return"地产转账";case 41:return"世家公账";case 42:return"3000账号";case 50:return"现金";case 60:return"其他";case 70:return"银满谷银行卡";case 71:return"筠姐上海银行卡";case 72:return"林老师建行卡";case 73:return"新同联福居银行卡";case 74:return"陈志杰招商银行卡";default:return s}};
var swtype=function(s){switch(Number(s)){case 1:return"意向金转中介费";case 2:return"意向金转案场费";case 3:return"意向金转意向金";case 4:return"保管金转中介费";case 5:return"保管金转案场费";case 6:return"保管金转保管金";case 7:return"意向金转保管金";default:return s}};
var swopen=function(s){switch(Number(s)){case 0:return"未开业";case 1:return"开业";default:return s}};
var swred=function(s){switch(Number(s)){case 0:return"是";case 1:return"否";default:return s}};
var countTime=function(){return bargain.countTime};
......@@ -27,14 +27,19 @@ define(['doT', 'text!temp/store_cost_template_tpl.html', 'css!style/home.css', '
$(document).on('click','#search',function(e){
that.getList(1);
});
//重置搜索条件
$(document).on('click','#reset',function(e){
that.resetAll();
$('#commit_home').val('');
$('#commit_shop').val('');
});
//导出报表
$(document).on('click','#export',function(e){
that.exportExcel();
//点击查看
$(document).on('click','.details',function(e){
//缓存部门 门店
var str_ = $(this).attr("data-district_name") + $(this).attr("data-store_name")
localStorage.setItem('chengben_detail_string_liu',str_);
window.open('/index/accountingTable?store_id=' + $(this).attr('data-id'));
});
//二级联动
......@@ -54,100 +59,8 @@ define(['doT', 'text!temp/store_cost_template_tpl.html', 'css!style/home.css', '
} else {};
});
});
//点击li 列表消失
$(document).delegate(".addphone", "click", function() { //list消失新增客户 点击li事件 获取id ul消失
that.addphone(this);
});
//分佣方 姓名下拉式
$(document).on("input", "#comit_name", function() { //手机号新增搜索客方
if($("#comit_name").val() == '') {
that.agent_id_phone='';
$(".user-ul").html('');
} else {
that.search_person();
}
});
_doc.on('click','.choose_btn',function(e){
var befor = that.check_status
$(this).removeClass('btn-default').addClass('btn-info').siblings().removeClass('btn-info').addClass('btn-default');
if ( befor != e.target.dataset.value) {
that.check_status = e.target.dataset.value;
cost.getList(1);
}
})
},
search_person: function() { //手机号新增客户
$.ajax({
url: '/index/getBroker_new',
type: 'GET',
async: true,
data: {
"phone": $("#comit_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 || item.status == 4){
var status=' ';
};
if(item.status == 1){
var status='-长假';
};
if(item.status == 2){
var status='-离职';
};
if(item.status == 3){
var status='-转勤';
}
user_ul += '<li class="addphone" data-id="' + item.id + '">' + item.id + '-' + item.name + '-' + item.phone + status + '</li>';
});
$(".user-ul").html(user_ul);
$(".user-ul").show();
} else {
alert(data.msg);
}
}
});
},
//删除退款
deleteRefund: function(id) {
$.ajax({
url: '/index/delRefund',
type: 'POST',
async: true,
data: {
"refund_id": id
},
dataType: 'json',
success: function(data) {
if(data.code == 200) {
cost.getList(cost.pageNo);
alert(data.msg);
} else {
alert(data.msg);
}
}
});
},
//将li里的值 赋给input(分佣方姓名)
addphone: function(obj) {//新增客户 input赋值
var that = cost ;
var user_ht = $(obj).html()+'';
var user_ht_str=user_ht.substring(0,user_ht.length-3);
$("#comit_name").val(user_ht_str);
$(".user-ul").html('');
$(".user-ul").hide();
that.agent_id_phone = $(obj).attr("data-id");
},
getDistrict: function(fn) {
$.ajax({
......@@ -195,20 +108,19 @@ define(['doT', 'text!temp/store_cost_template_tpl.html', 'css!style/home.css', '
getList : function(no){
var that = cost;
that.pageNo = no;
var params = that.buildSearchParams(0);
params = {};
params.pageNo = that.pageNo;
params.pageSize = that.pageSize ;
$.get('/index/refundList',params,function(data){
params.pageSize = that.pageSize;
if($('#commit_home').val()){
params.district_id= $('#commit_home').val();
}else{
params.district_id= 1;
}
$.get('/index/getAllStoreCost',params,function(data){
if(typeof data === 'object') {
if(data.code == 200) {
that.listData = data.data.list;
var temp = document.getElementById('store_cost_template_tpl').innerHTML;
var doTtmpl = doT.template(temp);
var doTtmpl = doT.template(document.getElementById('store_cost_template_tpl').innerHTML);
$("#order_list").html(doTtmpl(data.data.list));
$('#money_total').text((data.data.total_money-0 > 0) ? (data.data.total_money+"元"): "0元" )
/*分页代码*/
add_page(data.data.total, no, that.pageSize, that.getList);
} else {
alert(data['msg']);
};
......@@ -217,141 +129,7 @@ define(['doT', 'text!temp/store_cost_template_tpl.html', 'css!style/home.css', '
};
},'json');
},
/**
* 重置查询条件
*/
resetAll : function(){
var that = cost;
$('#comit_time_start').val("");
$('#comit_time_end').val("");
$('#into_time_start').val("");
$('#into_time_end').val("");
$('#changed_type').val("");
$('#changed_id').val("");
$('#back_id').val("");
$('#get_id').val("");
$('#shoped_id').val("");
$('#shoped_addr').val("");
$('#commit_home').val("");
$('#commit_shop').val("");
$('#comit_name').val("");
$('#comit_phone').val("");
$('#is_type').val("");
$('#is_open').val("-1");
$('#back_id_money').val("");
that.agent_id_phone="";
},
//退款 审核
exportExcel: function() {
var _url = '/index/costListExcel?';
window.open(_url + cost.buildSearchParams(1));
},
/**
* 获取查询参数
*/
buildSearchParams : function(is_excel){
var that = cost;
var commite_time_start = $('#comit_time_start').val();
var commite_time_end = $('#comit_time_end').val();
var into_time_start = $('#into_time_start').val();
var into_time_end = $('#into_time_end').val();
var changed_type = $('#changed_type').val();
var changed_id = $('#changed_id').val();
var back_id_money = $('#back_id_money').val();
var shoped_id = $('#shoped_id').val();
var shoped_addr = $('#shoped_addr').val();
var commit_home = $('#commit_home').val();
var commit_shop = $('#commit_shop').val();
var comit_name = that.agent_id_phone;//$('#comit_name').val();
var comit_phone = $('#comit_phone').val();
// var choose_type = $('.btn-group').find('.btn-info').html();
var is_selt = $('#is_type').val();
var get_id = $('#get_id').val();
var is_open = $('#is_open').val();
var params = {};
var paramsStr = "" ;
if ( get_id) {
params.pay_log_id = get_id ;
paramsStr += "pay_log_id=" + get_id +'&';
}
if ( commite_time_start ) {
params.start_time = commite_time_start;
paramsStr += "start_time=" + commite_time_start +'&';
}
if ( commite_time_end ) {
params.end_time = commite_time_end;
paramsStr += "end_time=" + commite_time_end +'&';
}
if ( into_time_start ) {
params.income_start_time = into_time_start;
paramsStr += "income_start_time=" + into_time_start +'&';
}
if ( into_time_end ) {
params.income_end_time = into_time_end;
paramsStr += "income_end_time=" + into_time_end +'&';
}
if ( changed_type ) {
params.type = changed_type;
paramsStr += "type=" + changed_type +'&';
}
if ( changed_id ) {
params.order_id = changed_id;
paramsStr += "order_id=" + changed_id +'&';
}
if ( back_id_money ) {
params.id = back_id_money;
paramsStr += "id=" + back_id_money +'&';
}
if ( shoped_id ) {
params.house_id = shoped_id;
paramsStr += "house_id=" + shoped_id +'&';
}
if ( shoped_addr) {
params.address = shoped_addr;
paramsStr += "address=" + shoped_addr +'&';
}
if ( commit_home ) {
params.district_id = commit_home;
paramsStr += "district_id=" + commit_home +'&';
}
if ( commit_shop ) {
params.store_id = commit_shop;
paramsStr += "store_id=" + commit_shop +'&';
}
if ( comit_name ) {
params.agent_id = comit_name;
paramsStr += "agent_id=" + comit_name +'&';
}
if ( comit_phone ) {
if ( comit_phone[0] == "1" && comit_phone.length == 11) {
params.phone = comit_phone;
paramsStr += "phone=" + comit_phone +'&';
}else {
alert("请输入正确的手机号码")
}
}
if ( is_selt ){
params.is_self = is_selt;
paramsStr += "is_self=" + is_selt +'&';
}
if ( is_open > -1) {
params.is_open = is_open;
paramsStr += "is_open=" + is_open +'&';
}
params.status = that.check_status;
paramsStr += "status=" + that.check_status;
if (is_excel) {
return paramsStr;
} else {
return params;
}
},
};
return cost;
});
\ No newline at end of file
......@@ -3,7 +3,7 @@
[% if(it.length) { %]
[% for(var item in it){ %]
<tr>
<td>[%= it[item]['id'] %]</td>
<td>[%= countTime() %]</td>
<td>[%= it[item]['apply_for_id'] %]</td>
<td>[%= it[item]['cost_id'] %]</td>
<td>[%= it[item]['apply_for_time'] %]</td>
......@@ -29,7 +29,7 @@
[% if(it.length) { %]
[% for(var item in it){ %]
<tr>
<td>[%= it[item]['id'] %]</td>
<td>[%= countTime() %]</td>
<td>[%= it[item]['apply_for_id'] %]</td>
<td></td>
<td>[%= it[item]['apply_for_time'] %]</td>
......@@ -55,7 +55,7 @@
[% if(it && it.length) { %]
[% for(var item in it){ %]
<tr>
<td>[%= it[item]['id'] %]</td>
<td>[%= countTime() %]</td>
<td>[%= it[item]['apply_for_id'] %]</td>
<td></td>
<td>[%= it[item]['apply_for_time'] %]</td>
......@@ -81,7 +81,7 @@
[% if(it.length) { %]
[% for(var item in it){ %]
<tr>
<td>[%= it[item]['id'] %]</td>
<td>[%= countTime() %]</td>
<td>[%= it[item]['apply_for_id'] %]</td>
<td></td>
<td>[%= it[item]['apply_for_time'] %]</td>
......@@ -107,7 +107,7 @@
[% if(it.length) { %]
[% for(var item in it){ %]
<tr>
<td>[%= it[item]['id'] %]</td>
<td>[%= countTime() %]</td>
<td>[%= it[item]['apply_for_id'] %]</td>
<td>[%= it[item]['cost_id'] %]</td>
<td>[%= it[item]['apply_for_time'] %]</td>
......
......@@ -21,7 +21,7 @@
<td>--</td>
[% } %]
[% if(it[item]['type'] == 2) { %]
[% if(it[item]['type'] == 3) { %]
<td>[%= switchFeeSiteId(it[item]['site_id']) %]</td>
[% }else{ %]
<td>[%= switchFeeItem(it[item]['fee_item']) %]</td>
......
<script id="store_cost_template_tpl" type="text/template">
[% if(it) { %]
[% if(it && it.length) { %]
[% for(var item in it){ %]
<tr class="text-center">
<td>[%= it[item]['agent_name'] %]</td>
<td>[%= it[item]['district_name'] %]</td>
<td>[%= it[item]['store_name'] %]</td>
<td>
<a class="btn1 btn-success is_del" href="#modal-del" data-toggle="modal" data-id='[%= it[item]["id"] %]'>查看</a>
<a class="btn1 btn-success details" data-id='[%= it[item]["store_id"] %]' data-district_name='[%= it[item]["district_name"] %]' data-store_name='[%= it[item]["store_name"] %]'>查看</a>
</td>
</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