Commit d7dfbfca authored by duxinyuan's avatar duxinyuan

111

parent 9b3b81f7
define(['doT', 'text!temp/refund_list_tpl.html', 'css!style/home.css', 'ckfinder', 'ckfinderStart', "datetimepicker",'pagination', 'bootstrapJs','blow-up'], function(doT, template) {
define(['doT', 'text!temp/refund_template_tpl.html', 'css!style/home.css', 'ckfinder', 'ckfinderStart', 'pagination', 'bootstrapJs'], function(doT, template) { refund = {
follow = {
pageNo: 1, pageNo: 1,
/*第几页*/ /*第几页*/
pageSize: 10, pageSize: 10,
/*每页显示多少条*/ /*每页显示多少条*/
id: '', id: '',
house_id: '', house_id: '',
type: '', house_fatherid: '',
valueCurrent: '', collection_del_id:'',
ajaxObj: '', listData :"",
stopstatus: true, moneyTotal : "" ,
boxphoto: '', agent_id_phone : '',
init: function() { init: function() {
//初始化dot //初始化dot
$(document.body).append(template); $(document.body).append(template);
follow.getList(0); refund.getList(1);
follow.event(); refund.event();
}, },
event: function() { event: function() {
$("#search").click(function() { var that = refund;
follow.getList(1); var _doc = $(document);
//操作----删除
$(document).on('click','.list_delete',function(e){
var id = e.target.dataset.id;
that.deleteId = id ;
}); });
$("#reset").click(function() { //重置 $(document).on('click','#confirm_delete',function(e){
document.getElementById("form_search").reset(); var id = that.deleteId;
that.deleteTableRow(id);
});
//搜索
$(document).on('click','#search',function(e){
that.getList(1);
}); });
// 时间轴
$ (document).delegate (".timeline", "click", function () {//时间轴 //重置搜索条件
follow.Timeline(); $(document).on('click','#reset',function(e){
that.resetAll();
}); });
// 编辑 //导出报表
$ (document).delegate (".edit", "click", function () {//点击操作跟进详情 $(document).on('click','#export',function(e){
follow.house_id = $ (this).attr ("data-id"); that.exportExcel();
follow.Edit();
}); });
$ (document).delegate (".is_pass", "click", function () {//点击编辑 //操作----时间轴
follow.house_id = $ (this).attr ("data-id"); $(document).on('click','.timeline',function(e){
console.log(follow.house_id); var house_id = e.target.dataset.id;;
e.preventDefault();
e.stopPropagation();
$('.iframe-time-line').attr('src', '/app_broker/timeline_pc?order_id=' + house_id);
}); });
$ (document).delegate (".rejected", "click", function () {//点击驳回 //操作----收款详情
follow.house_id = $ (this).attr ("data-id"); $(document).on('click','.add-pic',function(e){
console.log(follow.house_id); var id = e.target.dataset.id;
that.getAdjustmentDetail(id);
}); });
//统计
// $(document).on('click','#count',function(e){
// that.countValue();
// $('#money_total').text((that.moneyTotal-0 > 0) ? (that.moneyTotal+"元"): "0元" )
// });
$ (document).delegate ("#confirm_rejected", "click", function () {//点击驳回确定 //二级联动
follow.confirmRejected(); that.getDistrict(function() {
}); _doc.on('input', '#commit_home', function() {
$ (document).delegate (".caozuo", "click", function () {//点击分佣提成 var _this = $(this);
follow.Caozuo(); var _id = $('#commit_home').val();
}); $('#commit_shop').html(''); //先清空
//通过 if(_id && _id != '0') {
$ (document).delegate ("#confirm_pass", "click", function () {//点击通过 that.getDistrictStoreList(_id, function(_data) {
follow.confirmPass(); var _str = '<option value="0">全部</option>';
}); $.each(_data, function(i, item) {
$ (document).delegate (".is_pass", "click", function () {//点击通过 _str += '<option value="' + item.id + '">' + item.store_name + '</option>';
follow.house_id = $ (this).attr ("data-id"); });
}); $('#commit_shop').append(_str)
// 点击新增分佣提成 });
$ (document).delegate ("#new-commission", "click", function () {//点击分佣提成 } else {};
follow.newCommission(); });
follow.Caozuo();
}); });
//table切换
$ (document).delegate ("#information", "click", function () {//点击操作跟进详情 //点击li 列表消失
follow.Information(); $(document).delegate(".addphone", "click", function() { //list消失新增客户 点击li事件 获取id ul消失
}); that.addphone(this);
$ (document).delegate ("#fees", "click", function () {//点击操作跟进详情
follow.Fees();
});
$ (document).delegate ("#records", "click", function () {//点击操作跟进详情
follow.Records();
});
$ (document).delegate (".submit_edit", "click", function () {//提交
follow.Submit_follow();
});
//专员审核 总监审核 经理审核 出纳审核
$ (document).delegate ("#commissioner", "click", function () {//点击操作跟进详情
follow.Commissioner();
});
$ (document).delegate ("#manager", "click", function () {//点击操作跟进详情
follow.Manager();
});
$ (document).delegate ("#director", "click", function () {//点击操作跟进详情
follow.Director();
});
$ (document).delegate ("#cashier", "click", function () {//出纳审核
follow.Cashier();
}); });
//专员审核 总监审核 经理审核 出纳审核
//分佣方 姓名下拉式
$ (document).on ("input","#cus_fang", function () {//手机号搜索客方2 $(document).on("input", "#comit_name", function() { //手机号新增搜索客方
if($("#cus_fang").val()==''){ if($("#comit_name").val() == '') {
$(".user-ul2").html(''); that.agent_id_phone='';
}else{ $(".user-ul").html('');
follow.search_phone2(); } else {
that.search_person();
} }
}); });
$ (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 ({ search_person: function() { //手机号新增客户
$.ajax({
url: '/index/getBroker_new', url: '/index/getBroker_new',
type: 'GET', type: 'GET',
async: true, async: true,
data: { data: {
"phone":$("#cus_fang").val() "phone": $("#comit_name").val(),
'all' : 1
}, },
dataType: 'json', dataType: 'json',
success: function (data) { success: function(data) {
if (data.code == 200) { if(data.code == 200) {
var user_ul2 = ""; var user_ul = "";
$.each(data.data, function(i,item) { $.each(data.data, function(i, item) {
user_ul2+='<li class="addphone2" data-id="'+item.id+'">'+item.id+'-'+item.name+'-'+item.phone+'</li>'; 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-ul2").html(user_ul2); $(".user-ul").html(user_ul);
$(".user-ul").show();
} else { } else {
alert(data.msg); alert(data.msg);
} }
...@@ -132,547 +132,251 @@ define(['doT', 'text!temp/refund_template_tpl.html', 'css!style/home.css', 'ckfi ...@@ -132,547 +132,251 @@ define(['doT', 'text!temp/refund_template_tpl.html', 'css!style/home.css', 'ckfi
} }
}); });
}, },
Timeline:function(){//获取时间轴
$.ajax({ //将li里的值 赋给input(分佣方姓名)
'type': 'GET', addphone: function(obj) {//新增客户 input赋值
'url' : '/index/selectReportAll', var that = refund ;
data: {"order_id":follow.house_id}, var user_ht = $(obj).html()+'';
dataType: "json", var user_ht_str=user_ht.substring(0,user_ht.length-3);
success: function(data){ $("#comit_name").val(user_ht_str);
if(data.code == 200){ $(".user-ul").html('');
if (data.data) { $(".user-ul").hide();
console.log(data.data); that.agent_id_phone = $(obj).attr("data-id");
}
} else {
alert('获取失败!');
}
}
});
},
Edit:function(){//报告详情
$(".Tswitch").eq(0).show();
$(".Tswitch").eq(1).hide();
$(".Tswitch").eq(2).hide();
$("#information").removeClass("btn-default");
$("#information").addClass("btn-info");
$("#fees").removeClass("btn-info");
$("#fees").addClass("btn-default");
$("#records").removeClass("btn-info");
$("#records").addClass("btn-default");
$.ajax({
'type': 'GET',
'url' : '/index/bargainInfo',
data: {"id":follow.house_id},
dataType: "json",
success: function(data){
if(data.code == 200){
if (data.data) {
$(".create_time").html(data.data.create_time);
$(".user_phone").html(data.data.user_phone);
$(".user_name").html(data.data.user_name);
$(".internal_address").html(data.data.internal_address);
$(".internal_title").html(data.data.internal_title);
$(".commission").val(data.data.commission);
$(".practical_fee").val(data.data.practical_fee);
}
} else {
alert('获取失败!');
}
}
});
},
confirmRejected:function(){//驳回提交
console.log($('.btn-info').index());
var a_url;
if($('.btn-info').index()==0){
a_url="/index/overRuleAttache/0"
};
if ($('.btn-info').index()==1) {
a_url="/index/overRuleManager/1"
};
if ($('.btn-info').index()==2) {
a_url="/index/overRuleMajordomo/2"
};
if ($('.btn-info').index()==3) {
a_url="/index/overRuleCashier/3"
};
console.log(follow.house_id);
$.ajax({
'type': 'POST',
'url' : a_url,
data: {"id":follow.house_id,
"remark":$("#rejected_text").val(),
},
dataType: "json",
success: function(data){
if(data.code == 200){
if (data.data) {
}
} else {
alert('获取失败!');
}
}
});
}, },
//通过
confirmPass:function(){//点击通过
console.log($('.btn-info').index());
var a_url;
if($('.btn-info').index()==0){
a_url="/index/checkReportAttache/0"
};
if ($('.btn-info').index()==1) {
a_url="/index/checkReportManager/1"
};
if ($('.btn-info').index()==2) {
a_url="/index/checkReportMajordomo/2"
};
if ($('.btn-info').index()==3) {
a_url="/index/checkReportCashier/3"
};
// console.log($('.btn-info').index());
console.log(follow.house_id);
$.ajax({
'type': 'POST',
'url' : a_url,
data: {"id":follow.house_id,
"source":1,
"status":10,
"remark":$("#note_text").val(),
},
dataType: "json",
success: function(data){
if(data.code == 200){
if (data.data) {
console.log(666);
}
} else {
alert('获取失败!');
}
}
});
},
Caozuo:function(){//分佣提成获取跟进详情的数据 getDistrict: function(fn) {
$.ajax({ $.ajax({
'type': 'GET', url: '/index/getDistrict',
'url' : '/index/commissionList', type: 'GET',
data: {"id":follow.house_id}, async: true,
dataType: "json", data: {
success: function(data){ "pageSize": 1000
if(data.code == 200){ },
if (data.data) { dataType: 'json',
var caozuo_table=""; success: function(data) {
$.each(data['data'], function(i, item) { if(data.code == 200 && data.data != null) {
caozuo_table +='<tr><td>'+item.role+'</td><td>'+item.agent_name+'</td><td>'+item.store_name var str = '';
+'</td><td>'+item.scale+'</td><td>'+item.scale_fee+'</td><td>'+item.practical_fee+'</td><td>'+item.content+'</td></tr>'; $.each(data.data, function(i, item) {
}); str += '<option value="' + item.id + '">' + item.district_name + '</option>';
$("#caozuo_table").html(caozuo_table); });
$("#caozuo_table tr").each(function (e) { //不能为空 $('#commit_home').append(str);
var temp = $("#caozuo_table").find("tr").eq(e).find("td").eq(6).html(); //获取一列的值 fn && fn();
if(temp=='null'){ } else {
$("#caozuo_table").find("tr").eq(e).find("td").eq(6).html(" ") alert(data.msg)
} }
}); }
} });
} else {
alert('获取失败!');
}
}
});
},
Records:function(){//分佣提成数据
$(".Tswitch").eq(0).hide();
$(".Tswitch").eq(1).hide();
$(".Tswitch").eq(2).show();
$("#information").removeClass("btn-info");
$("#information").addClass("btn-default");
$("#fees").removeClass("btn-info");
$("#fees").addClass("btn-default");
$("#records").removeClass("btn-default");
$("#records").addClass("btn-info");
$.ajax({
'type': 'GET',
'url' : '/index/payLogList',
data: {"id":follow.house_id},
dataType: "json",
success: function(data){
if(data.code == 200){
if (data.data) {
var caozuo_table="";
$.each(data['data'], function(i, item) {
caozuo_table +='<tr><td>'+item.create_time+'</td><td>'+item.money+'</td><td>'+item.type
+'</td><td>'+item.pay_type+'</td><td>'+item.agent_name+'</td></tr>';
});
$("#tcaozuo_table").html(caozuo_table);
$("#tcaozuo_table tr").each(function (e) { //不能为空
var temp_one = $("#tcaozuo_table").find("tr").eq(e).find("td").eq(4).html();
var temp = $("#tcaozuo_table").find("tr").eq(e).find("td").eq(3).html(); //获取一列的值
var temp_two = $("#tcaozuo_table").find("tr").eq(e).find("td").eq(2).html();
// 支付方式 10支付宝 20 微信 30pos机器 40转账 50现金 60其他
if(temp*1==10){
$("#tcaozuo_table").find("tr").eq(e).find("td").eq(3).html("支付宝")
}
if(temp*1==20){
$("#tcaozuo_table").find("tr").eq(e).find("td").eq(3).html("微信")
}
if(temp*1==30){
$("#tcaozuo_table").find("tr").eq(e).find("td").eq(3).html("pos机器")
}
if(temp*1==40){
$("#tcaozuo_table").find("tr").eq(e).find("td").eq(3).html("转账")
}
if(temp*1==50){
$("#tcaozuo_table").find("tr").eq(e).find("td").eq(3).html("现金")
}
if(temp*1==60){
$("#tcaozuo_table").find("tr").eq(e).find("td").eq(3).html("其他")
}
// 付款类型 10意向金 20定金 30保管金 40押金 50 租金 60 进场费 70转让费 80其他
if(temp_two*1==10){
$("#tcaozuo_table").find("tr").eq(e).find("td").eq(2).html("意向金")
}
if(temp_two*1==20){
$("#tcaozuo_table").find("tr").eq(e).find("td").eq(2).html("定金")
}
if(temp_two*1==30){
$("#tcaozuo_table").find("tr").eq(e).find("td").eq(2).html("保管金")
}
if(temp_two*1==40){
$("#tcaozuo_table").find("tr").eq(e).find("td").eq(2).html("押金")
}
if(temp_two*1==50){
$("#tcaozuo_table").find("tr").eq(e).find("td").eq(2).html("租金")
}
if(temp_two*1==60){
$("#tcaozuo_table").find("tr").eq(e).find("td").eq(2).html("进场费")
}
if(temp_two*1==70){
$("#tcaozuo_table").find("tr").eq(e).find("td").eq(2).html("转让费")
}
if(temp_two*1==80){
$("#tcaozuo_table").find("tr").eq(e).find("td").eq(2).html("其他")
};
if(temp_one=='null'){
$("#tcaozuo_table").find("tr").eq(e).find("td").eq(4).html(" ")
}
});
}
} else {
alert('获取失败!');
}
}
});
},
newCommission:function(){//新增分佣提成
$.ajax({
'type': 'POST',
'url' : '/index/addBargain',
data: {"id":follow.house_id,
"role":$("#is_carefully_chosen").val(),
"scale":$("#commission-rate").val(),
"scale_fee":$("#should-commission").val(),
},
dataType: "json",
success: function(data){
if(data.code == 200){
if (data.data) {
console.log(666);
}
} else {
alert('获取失败!');
}
}
});
},
// table切换
Information:function(){
$(".Tswitch").eq(0).show();
$(".Tswitch").eq(1).hide();
$(".Tswitch").eq(2).hide();
$("#information").removeClass("btn-default");
$("#information").addClass("btn-info");
$("#fees").removeClass("btn-info");
$("#fees").addClass("btn-default");
$("#records").removeClass("btn-info");
$("#records").addClass("btn-default");
}, },
Fees:function(){
$(".Tswitch").eq(0).hide(); getDistrictStoreList: function(id, fn) {
$(".Tswitch").eq(1).show(); $.ajax({
$(".Tswitch").eq(2).hide(); url: '/index/getDistrictStoreList',
$("#information").removeClass("btn-info"); type: 'GET',
$("#information").addClass("btn-default"); async: true,
$("#fees").removeClass("btn-default"); data: {
$("#fees").addClass("btn-info"); 'id': id,
$("#records").removeClass("btn-info"); "pageSize": 1000
$("#records").addClass("btn-default"); },
dataType: 'json',
success: function(data) {
if(data.code == 200 && data.data != null) {
fn && fn(data.data);
} else {
alert(data.msg)
}
}
});
}, },
Submit_follow: function() { //提交
$.ajax({
'type': 'POST',
'url': '/index/pcEditClient',
data: {
"id": follow.house_id,
"user_nick": $("#cus_name").val(),
"user_phone": $("#cus_phone").html(),
"agent_id":follow.agent_id,//客方
"sex": $("#sex").val()
},
dataType: "json",
success: function(data) {
if(data.code == 200) {
if(data.data) {
}
} else {
}
}
});
},
//专员审核
Commissioner: function(pageNo) {
$("#commissioner").removeClass("btn-default");
$("#commissioner").addClass("btn-info");
$("#manager").removeClass("btn-info");
$("#manager").addClass("btn-default");
$("#director").removeClass("btn-info");
$("#director").addClass("btn-default");
$("#cashier").removeClass("btn-info");
$("#cashier").addClass("btn-default");
console.log($('.btn-info').index());
follow.pageNo = pageNo;
var params = {};
params.pageNo = follow.pageNo;
params.pageSize = follow.pageSize;
$.ajax({
type: 'GET',
url: '/index/refundList',
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('refund_list_tpl').innerHTML);
$("#follow_list").html(doTtmpl(data.data.list));
/*分页代码*/
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('请求超时');
};
}
});
},
//专员审核
//经理审核 countValue : function(){
Manager: function(pageNo) { var that = refund ;
$("#commissioner").removeClass("btn-info"); var data = that.listData ;
$("#commissioner").addClass("btn-default"); var value = 0 ;
$("#manager").removeClass("btn-default"); for (var i = 0 ; i < data.length ; i++ ){
$("#manager").addClass("btn-info"); value = value + (data[i].money - 0);
$("#director").removeClass("btn-info"); }
$("#director").addClass("btn-default"); $('#money_total').text(value+"元");
$("#cashier").removeClass("btn-info"); },
$("#cashier").addClass("btn-default");
console.log($('.btn-info').index());
follow.pageNo = pageNo;
var params = {};
params.pageNo = follow.pageNo;
params.pageSize = follow.pageSize;
$.ajax({
type: 'GET',
url: '/index/refundListManager/1',
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('refund_list_tpl').innerHTML);
$("#follow_list").html(doTtmpl(data.data.list));
/*分页代码*/
add_page(data.data.total,pageNo,follow.pageSize,follow.getList);
}else { getAdjustmentDetail : function(id){
alert(data['msg']); var that = refund ;
}; $.get('/index/getAdjustmentDetail',{'id' : id},function(data){
}else{ if(data.code == 200) {
alert('数据错误'); that.setValue(data.data);
}; } else {
}, alert(data.msg);
error: function() { }
alert('error'); },'json');
},
complete: function(xhr, textStatus){
if(textStatus === 'timeout'){
alert('请求超时');
};
}
});
}, },
//经理审核
setValue : function(data){
//总监审核 var that = refund ;
Director: function(pageNo) { $('#change_id').text(data.id);
$("#commissioner").removeClass("btn-info"); // $('#change_price').text("");
$("#commissioner").addClass("btn-default"); $('#befor_into_id').text(data.adjustment_old[0].id);
$("#manager").removeClass("btn-info"); $('#befor_order_id').text(data.adjustment_old[0].order_id);
$("#manager").addClass("btn-default"); $('#befor_house_id').text(data.adjustment_old[0].house_id);
$("#director").removeClass("btn-default"); $('#befor_house_addr').text(data.adjustment_old[0].internal_address);
$("#director").addClass("btn-info"); $('#befor_into_date').text(data.adjustment_old[0].income_time);
$("#cashier").removeClass("btn-info"); $('#befor_into_type').text(data.adjustment_old[0].type);
$("#cashier").addClass("btn-default"); $('#after_into_id').text(data.adjustment[0].id);
console.log($('.btn-info').index()); $('#after_order_id').text(data.adjustment[0].order_id);
follow.pageNo = pageNo; $('#after_report_id').text(data.adjustment[0].bargain_id);
var params = {}; $('#after_house_id').text(data.adjustment[0].house_id);
params.pageNo = follow.pageNo; $('#after_house_addr').text(data.adjustment[0].internal_address);
params.pageSize = follow.pageSize; $('#after_into_date').text(data.adjustment[0].income_time);
$('#after_into_type').text(data.adjustment[0].type);
$.ajax({ $('#after_into_price').text(data.money);
type: 'GET', },
url: '/index/refundListMajordomo/2',
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('refund_list_tpl').innerHTML);
$("#follow_list").html(doTtmpl(data.data.list));
/*分页代码*/
add_page(data.data.total,pageNo,follow.pageSize,follow.getList);
}else { /**
alert(data['msg']); * 获取表格数据
}; * @param {Object} no
}else{ */
alert('数据错误'); getList : function(no){
}; var that = refund;
}, that.pageNo = no;
error: function() { var params = that.buildSearchParams();
alert('error'); params.pageNo = that.pageNo;
}, params.pageSize = that.pageSize ;
complete: function(xhr, textStatus){ $.get('/index/refundList',params,function(data){
if(textStatus === 'timeout'){ if(typeof data === 'object') {
alert('请求超时'); if(data.code == 200) {
}; that.listData = data.data.list;
} var temp = document.getElementById('adjustment_template_tpl').innerHTML;
}); var doTtmpl = doT.template(temp);
$("#order_list").html(doTtmpl(data.data.list));
// that.moneyTotal = data.data.money_total;
$('#money_total').text((data.data.money_total-0 > 0) ? (data.data.money_total+"元"): "0元" )
/*分页代码*/
add_page(data.data.total, no, that.pageSize, that.getList);
} else {
alert(data['msg']);
};
} else {
alert('数据错误');
};
},'json');
}, },
//总监审核
/**
//出纳审核 * 重置查询条件
Cashier: function(pageNo) { */
$("#commissioner").addClass("btn-default"); resetAll : function(){
$("#manager").removeClass("btn-info"); var that = refund;
$("#manager").addClass("btn-default"); var commite_time_start = $('#comit_time_start').val("");
$("#director").removeClass("btn-info"); var commite_time_end = $('#comit_time_end').val("");
$("#director").addClass("btn-default"); var into_time_start = $('#into_time_start').val("");
$("#cashier").removeClass("btn-default"); var into_time_end = $('#into_time_end').val("");
$("#cashier").addClass("btn-info"); var changed_type = $('#changed_type').val("");
console.log($('.btn-info').index()); var changed_id = $('#changed_id').val("");
follow.pageNo = pageNo; var looked_id = $('#looked_id').val("");
var params = {}; var shoped_id = $('#shoped_id').val("");
params.pageNo = follow.pageNo; var shoped_addr = $('#shoped_addr').val("");
params.pageSize = follow.pageSize; var commit_home = $('#commit_home').val("");
var commit_shop = $('#commit_shop').val("");
$.ajax({ var comit_name = $('#comit_name').val("");
type: 'GET', var comit_phone = $('#comit_phone').val("");
url: '/index/refundListCashier/3', that.agent_id_phone="";
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('refund_list_tpl').innerHTML);
$("#follow_list").html(doTtmpl(data.data.list));
/*分页代码*/
add_page(data.data.total,pageNo,follow.pageSize,follow.getList);
}else { /**
alert(data['msg']); * 导出报表
}; */
}else{ exportExcel : function(){
alert('数据错误'); var that = refund;
}; var params = that.buildSearchParams();
}, $.post('',params, function(data){
error: function() { if(data.code == 200) {
alert('error'); } else {
}, alert(data.msg);
complete: function(xhr, textStatus){ }
if(textStatus === 'timeout'){ })
alert('请求超时');
};
}
});
}, },
//出纳审核
getList: function(pageNo) { /**
follow.pageNo = pageNo; * 获取查询参数
var params = {}; */
params.pageNo = follow.pageNo; buildSearchParams : function(){
params.pageSize = follow.pageSize; var that = refund;
var commite_time_start = $('#comit_time_start').val();
$.ajax({ var commite_time_end = $('#comit_time_end').val();
type: 'GET', var into_time_start = $('#into_time_start').val();
url: '/index/refundList', var into_time_end = $('#into_time_end').val();
data: params, var changed_type = $('#changed_type').val();
timeout: 30000, var changed_id = $('#changed_id').val();
dataType: 'json', var back_id = $('#back_id').val();
beforeSend: function() {}, var shoped_id = $('#shoped_id').val();
success: function(data) { var shoped_addr = $('#shoped_addr').val();
if(typeof data === 'object') { var commit_home = $('#commit_home').val();
if (data.code == 200) { var commit_shop = $('#commit_shop').val();
var doTtmpl = doT.template(document.getElementById('refund_list_tpl').innerHTML); var comit_name = that.agent_id_phone;//$('#comit_name').val();
$("#follow_list").html(doTtmpl(data.data.list)); var comit_phone = $('#comit_phone').val();
/*分页代码*/ var choose_type = $('.btn-group').find('.btn-info').html();
add_page(data.data.total,pageNo,follow.pageSize,follow.getList); var params = {};
if ( choose_type ) {
params.choose_type = choose_type;
}
if ( commite_time_start ) {
params.start_time = commite_time_start;
}
if ( commite_time_end ) {
params.end_time = commite_time_end;
}
if ( into_time_start ) {
params.income_start_time = into_time_start;
}
if ( into_time_end ) {
params.income_end_time = into_time_end;
}
if ( changed_type ) {
params.type = changed_type;
}
if ( changed_id ) {
params.order_id = changed_id;
}
if ( back_id ) {
params.id = back_id;
}
if ( shoped_id ) {
params.house_id = shoped_id;
}
if ( shoped_addr) {
params.address = shoped_addr;
}
if ( commit_home ) {
params.district_id = commit_home;
}
if ( commit_shop ) {
params.store_id = commit_shop;
}
if ( comit_name ) {
params.agent_id = comit_name;
}
if ( comit_phone ) {
params.phone = comit_phone;
}
return params ;
},
}else { /**
alert(data['msg']); * 删除收款记录
}; * @param {Object} id
}else{ */
alert('数据错误'); deleteTableRow : function(id){
}; var that = refund;
}, var params = {
error: function() { 'id' : id
alert('error'); };
}, $.post('/index/delAdjustment',params , function(data){
complete: function(xhr, textStatus){ if(data.code == 200) {
if(textStatus === 'timeout'){ that.getList(1);
alert('请求超时'); } else {
}; alert(data.msg);
} }
}); },'json')
} }
}; };
return follow; return refund;
}); });
\ No newline at end of file
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