Commit a077b4ba authored by agping's avatar agping

1

parent 13124ab3
......@@ -74,5 +74,12 @@ class RealTimePerformance extends Basic
return view('cost/costParameters');
}
}
//费用详情
public function publicCostDetails()
{
if (!$this->request->isAjax()) {
return view('cost/publicCostDetails');
}
}
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
......@@ -366,6 +366,7 @@ Route::group('index', [
'costOffice' => ['index/RealTimePerformance/costOffice', ['method' => 'GET']],//办公室列表 liu
'attendanceList' => ['index/RealTimePerformance/attendanceList', ['method' => 'GET']],//门店考勤 liu
'costParameters' => ['index/RealTimePerformance/costParameters', ['method' => 'GET']],//成本参数 liu
'publicCostDetails' => ['index/RealTimePerformance/publicCostDetails', ['method' => 'GET']],//费用报销详情 liu
'shopinspectionLog' => ['index/ShopInspectionLog/shopinspectionLogList', ['method' => 'POST|GET']],//商铺查看日志liu
......
......@@ -22,7 +22,9 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
event: function() {
var that = cost;
var _doc = $(document);
//初始化
$('.pic-con2').show();
$('.pic-con1').hide();
//搜索
$(document).on('click','#search',function(e){
that.getList(1);
......@@ -36,40 +38,93 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
$(document).on('click','#export',function(e){
that.exportExcel();
});
//二级联动
that.getDistrict(function() {
_doc.on('input', '#commit_home', function() {
var _this = $(this);
var _id = $('#commit_home').val();
$('#commit_shop').html(''); //先清空
if(_id && _id != '0') {
that.getDistrictStoreList(_id, function(_data) {
var _str = '<option value="0">全部</option>';
$.each(_data, function(i, item) {
_str += '<option value="' + item.id + '">' + item.store_name + '</option>';
});
$('#commit_shop').append(_str)
});
} else {};
});
});
//点击li 列表消失
$(document).delegate(".addphone", "click", function() { //list消失新增客户 点击li事件 获取id ul消失
that.addphone(this);
//新增报销 上传图片
$('#file_input_pic').on('change', function(){
var _this = $(this);
var formData = new FormData();
formData.append('type', 'chat');
formData.append('image', _this[0].files[0]);
$.ajax({
type: 'post',
url: ServerHostImageLiu + '/index/uploadImg',
data: formData,
dataType: 'json',
contentType: false,
cache: false,
processData: false,
beforeSend: function() {},
success: function(_data) {
if(_data.code == 200) {
$('#container_body_img_area').append('<div class="result"><img data-imgname="{0}" src="{1}" alt=""/> <span class="span-del">删除</span></div>'.stringFormatObj({
'0': _data.data.img_path,
'1': _data.data.internet_img_name?urlDeal(_data.data.internet_img_name):_data.data.internet_img_name
}));
} else {
alert(_data.msg);
};
},
error: function() {
alert('enter error');
},
complete: function(xhr, textStatus) {
if(textStatus === 'timeout') {
//处理超时的逻辑
alert('请求超时,请重试');
};
}
});
});
//新增报销 上传图片
$('#file_input_pic2').on('change', function(){
var _this = $(this);
var formData = new FormData();
formData.append('type', 'chat');
formData.append('image', _this[0].files[0]);
$.ajax({
type: 'post',
url: ServerHostImageLiu + '/index/uploadImg',
data: formData,
dataType: 'json',
contentType: false,
cache: false,
processData: false,
beforeSend: function() {},
success: function(_data) {
if(_data.code == 200) {
$('#container_body_img_area2').append('<div class="result"><img data-imgname="{0}" src="{1}" alt=""/> <span class="span-del">删除</span></div>'.stringFormatObj({
'0': _data.data.img_path,
'1': _data.data.internet_img_name?urlDeal(_data.data.internet_img_name):_data.data.internet_img_name
}));
} else {
alert(_data.msg);
};
},
error: function() {
alert('enter error');
},
complete: function(xhr, textStatus) {
if(textStatus === 'timeout') {
//处理超时的逻辑
alert('请求超时,请重试');
};
}
});
});
//分佣方 姓名下拉式
$(document).on("input", "#comit_name", function() { //手机号新增搜索客方
if($("#comit_name").val() == '') {
that.agent_id_phone='';
$(".user-ul").html('');
$('.tit_con').unbind('click').bind('click',function(e){
$(this).parent('div').find('h4.active').removeClass("active");
$(this).addClass("active");
if (e.currentTarget.innerHTML == "费用图片"){
$('.pic-con1').show();
$('.pic-con2').hide();
} else {
that.search_person();
$('.pic-con2').show();
$('.pic-con1').hide();
}
});
$(document).on('click','.add-pic',function(e){
var id = e.target.dataset.id;
$(".publicCostDetails").attr('src','/index/publicCostDetails')
});
_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');
......@@ -81,43 +136,6 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
},
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({
......@@ -139,58 +157,6 @@ define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', '
}
});
},
//将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({
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>';
});
$('#commit_home').append(str);
fn && fn();
} else {
alert(data.msg)
}
}
});
},
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);
} else {
alert(data.msg)
}
}
});
},
//获取列表
getList : function(no){
var that = cost;
......
define(['doT', 'text!temp/cost_check_template_tpl.html', 'css!style/home.css', 'ckfinder', 'ckfinderStart', "datetimepicker",'pagination', 'bootstrapJs','blow-up'], function(doT, template) {
cost = {
pageNo: 1,
/*第几页*/
pageSize: 10,
/*每页显示多少条*/
id: '',
house_id: '',
house_fatherid: '',
collection_del_id:'',
listData :"",
moneyTotal : "" ,
agent_id_phone : '',
check_status : 1 ,
deleteRefundId:'',
init: function() {
//初始化dot
$(document.body).append(template);
cost.getList(1);
cost.event();
},
event: function() {
var that = cost;
var _doc = $(document);
//初始化
$('.pic-con2').show();
$('.pic-con1').hide();
//搜索
$(document).on('click','#search',function(e){
that.getList(1);
});
//重置搜索条件
$(document).on('click','#reset',function(e){
that.resetAll();
});
//导出报表
$(document).on('click','#export',function(e){
that.exportExcel();
});
//新增报销 上传图片
$('#file_input_pic').on('change', function(){
var _this = $(this);
var formData = new FormData();
formData.append('type', 'chat');
formData.append('image', _this[0].files[0]);
$.ajax({
type: 'post',
url: ServerHostImageLiu + '/index/uploadImg',
data: formData,
dataType: 'json',
contentType: false,
cache: false,
processData: false,
beforeSend: function() {},
success: function(_data) {
if(_data.code == 200) {
$('#container_body_img_area').append('<div class="result"><img data-imgname="{0}" src="{1}" alt=""/> <span class="span-del">删除</span></div>'.stringFormatObj({
'0': _data.data.img_path,
'1': _data.data.internet_img_name?urlDeal(_data.data.internet_img_name):_data.data.internet_img_name
}));
} else {
alert(_data.msg);
};
},
error: function() {
alert('enter error');
},
complete: function(xhr, textStatus) {
if(textStatus === 'timeout') {
//处理超时的逻辑
alert('请求超时,请重试');
};
}
});
});
//新增报销 上传图片
$('#file_input_pic2').on('change', function(){
var _this = $(this);
var formData = new FormData();
formData.append('type', 'chat');
formData.append('image', _this[0].files[0]);
$.ajax({
type: 'post',
url: ServerHostImageLiu + '/index/uploadImg',
data: formData,
dataType: 'json',
contentType: false,
cache: false,
processData: false,
beforeSend: function() {},
success: function(_data) {
if(_data.code == 200) {
$('#container_body_img_area2').append('<div class="result"><img data-imgname="{0}" src="{1}" alt=""/> <span class="span-del">删除</span></div>'.stringFormatObj({
'0': _data.data.img_path,
'1': _data.data.internet_img_name?urlDeal(_data.data.internet_img_name):_data.data.internet_img_name
}));
} else {
alert(_data.msg);
};
},
error: function() {
alert('enter error');
},
complete: function(xhr, textStatus) {
if(textStatus === 'timeout') {
//处理超时的逻辑
alert('请求超时,请重试');
};
}
});
});
$('.tit_con').unbind('click').bind('click',function(e){
$(this).parent('div').find('h4.active').removeClass("active");
$(this).addClass("active");
if (e.currentTarget.innerHTML == "费用图片"){
$('.pic-con1').show();
$('.pic-con2').hide();
} else {
$('.pic-con2').show();
$('.pic-con1').hide();
}
});
$(document).on('click','.add-pic',function(e){
var id = e.target.dataset.id;
});
_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);
}
})
},
//删除退款
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);
}
}
});
},
//获取列表
getList : function(no){
var that = cost;
that.pageNo = no;
var params = that.buildSearchParams(0);
params.pageNo = that.pageNo;
params.pageSize = that.pageSize ;
$.get('/index/refundList',params,function(data){
if(typeof data === 'object') {
if(data.code == 200) {
that.listData = data.data.list;
var temp = document.getElementById('cost_check_template_tpl').innerHTML;
var doTtmpl = doT.template(temp);
$("#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']);
};
} else {
alert('数据错误');
};
},'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
......@@ -40,7 +40,7 @@
<td>[%= it[item]['agent_name'] %]</td>
<td>[%= it[item]['store_name'] %]</td>
<td>
<a class="btn1 btn-success rejected" href="#modal-check" data-toggle="modal" data-id='[%= it[item]["id"] %]'>审核</a>
<a class="btn1 btn-success add-pic" href="#modal-addPic" data-toggle="modal" data-id='[%= it[item]["id"] %]'>审核</a>
<a class="btn1 btn-success is_del" href="#modal-del" data-toggle="modal" data-id='[%= it[item]["id"] %]'>删除</a>
</td>
......
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