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);
});
$("#reset").click(function() { //重置
document.getElementById("form_search").reset();
});
// 时间轴
$ (document).delegate (".timeline", "click", function () {//时间轴
follow.Timeline();
});
// 编辑
$ (document).delegate (".edit", "click", function () {//点击操作跟进详情
follow.house_id = $ (this).attr ("data-id");
follow.Edit();
});
$ (document).delegate (".is_pass", "click", function () {//点击编辑
follow.house_id = $ (this).attr ("data-id");
console.log(follow.house_id);
});
$ (document).delegate (".rejected", "click", function () {//点击驳回
follow.house_id = $ (this).attr ("data-id");
console.log(follow.house_id);
});
$ (document).delegate ("#confirm_rejected", "click", function () {//点击驳回确定 //操作----删除
follow.confirmRejected(); $(document).on('click','.list_delete',function(e){
var id = e.target.dataset.id;
that.deleteId = id ;
}); });
$ (document).delegate (".caozuo", "click", function () {//点击分佣提成 $(document).on('click','#confirm_delete',function(e){
follow.Caozuo(); var id = that.deleteId;
that.deleteTableRow(id);
}); });
//通过 //搜索
$ (document).delegate ("#confirm_pass", "click", function () {//点击通过 $(document).on('click','#search',function(e){
follow.confirmPass(); that.getList(1);
}); });
$ (document).delegate (".is_pass", "click", function () {//点击通过
follow.house_id = $ (this).attr ("data-id"); //重置搜索条件
}); $(document).on('click','#reset',function(e){
// 点击新增分佣提成 that.resetAll();
$ (document).delegate ("#new-commission", "click", function () {//点击分佣提成 });
follow.newCommission(); //导出报表
follow.Caozuo(); $(document).on('click','#export',function(e){
}); that.exportExcel();
//table切换 });
$ (document).delegate ("#information", "click", function () {//点击操作跟进详情 //操作----时间轴
follow.Information(); $(document).on('click','.timeline',function(e){
}); var house_id = e.target.dataset.id;;
$ (document).delegate ("#fees", "click", function () {//点击操作跟进详情 e.preventDefault();
follow.Fees(); e.stopPropagation();
}); $('.iframe-time-line').attr('src', '/app_broker/timeline_pc?order_id=' + house_id);
$ (document).delegate ("#records", "click", function () {//点击操作跟进详情 });
follow.Records(); //操作----收款详情
}); $(document).on('click','.add-pic',function(e){
$ (document).delegate (".submit_edit", "click", function () {//提交 var id = e.target.dataset.id;
follow.Submit_follow(); that.getAdjustmentDetail(id);
});
//统计
// $(document).on('click','#count',function(e){
// that.countValue();
// $('#money_total').text((that.moneyTotal-0 > 0) ? (that.moneyTotal+"元"): "0元" )
// });
//二级联动
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)
$ (document).delegate ("#commissioner", "click", function () {//点击操作跟进详情
follow.Commissioner();
}); });
$ (document).delegate ("#manager", "click", function () {//点击操作跟进详情 } else {};
follow.Manager();
}); });
$ (document).delegate ("#director", "click", function () {//点击操作跟进详情
follow.Director();
}); });
$ (document).delegate ("#cashier", "click", function () {//出纳审核
follow.Cashier(); //点击li 列表消失
$(document).delegate(".addphone", "click", function() { //list消失新增客户 点击li事件 获取id ul消失
that.addphone(this);
}); });
//专员审核 总监审核 经理审核 出纳审核
$ (document).on ("input","#cus_fang", function () {//手机号搜索客方2 //分佣方 姓名下拉式
if($("#cus_fang").val()==''){ $(document).on("input", "#comit_name", function() { //手机号新增搜索客方
$(".user-ul2").html(''); if($("#comit_name").val() == '') {
}else{ that.agent_id_phone='';
follow.search_phone2(); $(".user-ul").html('');
} 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_person: function() { //手机号新增客户
search_phone2:function(){//手机号 $.ajax({
$.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=' ';
$(".user-ul2").html(user_ul2);
} else {
alert(data.msg);
}
}
});
},
Timeline:function(){//获取时间轴
$.ajax({
'type': 'GET',
'url' : '/index/selectReportAll',
data: {"order_id":follow.house_id},
dataType: "json",
success: function(data){
if(data.code == 200){
if (data.data) {
console.log(data.data);
}
} 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) { if(item.status == 1){
a_url="/index/overRuleMajordomo/2" var status='-长假';
}; };
if ($('.btn-info').index()==3) { if(item.status == 2){
a_url="/index/overRuleCashier/3" var status='-离职';
}; };
if(item.status == 3){
console.log(follow.house_id); var status='-转勤';
$.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('获取失败!');
}
} }
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();
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 { } else {
alert('获取失败!'); alert(data.msg);
}
} }
});
},
Caozuo:function(){//分佣提成获取跟进详情的数据
$.ajax({
'type': 'GET',
'url' : '/index/commissionList',
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.role+'</td><td>'+item.agent_name+'</td><td>'+item.store_name
+'</td><td>'+item.scale+'</td><td>'+item.scale_fee+'</td><td>'+item.practical_fee+'</td><td>'+item.content+'</td></tr>';
});
$("#caozuo_table").html(caozuo_table);
$("#caozuo_table tr").each(function (e) { //不能为空
var temp = $("#caozuo_table").find("tr").eq(e).find("td").eq(6).html(); //获取一列的值
if(temp=='null'){
$("#caozuo_table").find("tr").eq(e).find("td").eq(6).html(" ")
}
});
}
} 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(" ")
}
}); //将li里的值 赋给input(分佣方姓名)
} addphone: function(obj) {//新增客户 input赋值
} else { var that = refund ;
alert('获取失败!'); 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");
}, },
newCommission:function(){//新增分佣提成
getDistrict: function(fn) {
$.ajax({ $.ajax({
'type': 'POST', url: '/index/getDistrict',
'url' : '/index/addBargain', type: 'GET',
data: {"id":follow.house_id, async: true,
"role":$("#is_carefully_chosen").val(), data: {
"scale":$("#commission-rate").val(), "pageSize": 1000
"scale_fee":$("#should-commission").val(),
}, },
dataType: "json", dataType: 'json',
success: function(data){ success: function(data) {
if(data.code == 200){ if(data.code == 200 && data.data != null) {
if (data.data) { var str = '';
console.log(666); $.each(data.data, function(i, item) {
} str += '<option value="' + item.id + '">' + item.district_name + '</option>';
});
$('#commit_home').append(str);
fn && fn();
} else { } else {
alert('获取失败!'); alert(data.msg)
} }
} }
}); });
}, },
// table切换 getDistrictStoreList: function(id, fn) {
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();
$(".Tswitch").eq(1).show();
$(".Tswitch").eq(2).hide();
$("#information").removeClass("btn-info");
$("#information").addClass("btn-default");
$("#fees").removeClass("btn-default");
$("#fees").addClass("btn-info");
$("#records").removeClass("btn-info");
$("#records").addClass("btn-default");
},
Submit_follow: function() { //提交
$.ajax({ $.ajax({
'type': 'POST', url: '/index/getDistrictStoreList',
'url': '/index/pcEditClient', type: 'GET',
async: true,
data: { data: {
"id": follow.house_id, 'id': id,
"user_nick": $("#cus_name").val(), "pageSize": 1000
"user_phone": $("#cus_phone").html(),
"agent_id":follow.agent_id,//客方
"sex": $("#sex").val()
}, },
dataType: "json", dataType: 'json',
success: function(data) { success: function(data) {
if(data.code == 200) { if(data.code == 200 && data.data != null) {
if(data.data) { fn && fn(data.data);
}
} else { } else {
alert(data.msg)
} }
} }
}); });
}, },
//专员审核
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 { countValue : function(){
alert(data['msg']); var that = refund ;
}; var data = that.listData ;
}else{ var value = 0 ;
alert('数据错误'); for (var i = 0 ; i < data.length ; i++ ){
}; value = value + (data[i].money - 0);
},
error: function() {
alert('error');
},
complete: function(xhr, textStatus){
if(textStatus === 'timeout'){
alert('请求超时');
};
} }
}); $('#money_total').text(value+"元");
}, },
//专员审核
//经理审核
Manager: function(pageNo) {
$("#commissioner").removeClass("btn-info");
$("#commissioner").addClass("btn-default");
$("#manager").removeClass("btn-default");
$("#manager").addClass("btn-info");
$("#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/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');
},
complete: function(xhr, textStatus){
if(textStatus === 'timeout'){
alert('请求超时');
};
} }
}); },'json');
}, },
//经理审核
//总监审核 setValue : function(data){
Director: function(pageNo) { var that = refund ;
$("#commissioner").removeClass("btn-info"); $('#change_id').text(data.id);
$("#commissioner").addClass("btn-default"); // $('#change_price').text("");
$("#manager").removeClass("btn-info"); $('#befor_into_id').text(data.adjustment_old[0].id);
$("#manager").addClass("btn-default"); $('#befor_order_id').text(data.adjustment_old[0].order_id);
$("#director").removeClass("btn-default"); $('#befor_house_id').text(data.adjustment_old[0].house_id);
$("#director").addClass("btn-info"); $('#befor_house_addr').text(data.adjustment_old[0].internal_address);
$("#cashier").removeClass("btn-info"); $('#befor_into_date').text(data.adjustment_old[0].income_time);
$("#cashier").addClass("btn-default"); $('#befor_into_type').text(data.adjustment_old[0].type);
console.log($('.btn-info').index()); $('#after_into_id').text(data.adjustment[0].id);
follow.pageNo = pageNo; $('#after_order_id').text(data.adjustment[0].order_id);
var params = {}; $('#after_report_id').text(data.adjustment[0].bargain_id);
params.pageNo = follow.pageNo; $('#after_house_id').text(data.adjustment[0].house_id);
params.pageSize = follow.pageSize; $('#after_house_addr').text(data.adjustment[0].internal_address);
$('#after_into_date').text(data.adjustment[0].income_time);
$('#after_into_type').text(data.adjustment[0].type);
$('#after_into_price').text(data.money);
},
$.ajax({ /**
type: 'GET', * 获取表格数据
url: '/index/refundListMajordomo/2', * @param {Object} no
data: params, */
timeout: 30000, getList : function(no){
dataType: 'json', var that = refund;
beforeSend: function() {}, that.pageNo = no;
success: function(data) { var params = that.buildSearchParams();
params.pageNo = that.pageNo;
params.pageSize = that.pageSize ;
$.get('/index/refundList',params,function(data){
if(typeof data === 'object') { if(typeof data === 'object') {
if (data.code == 200) { if(data.code == 200) {
var doTtmpl = doT.template(document.getElementById('refund_list_tpl').innerHTML); that.listData = data.data.list;
$("#follow_list").html(doTtmpl(data.data.list)); var temp = document.getElementById('adjustment_template_tpl').innerHTML;
/*分页代码*/ var doTtmpl = doT.template(temp);
add_page(data.data.total,pageNo,follow.pageSize,follow.getList); $("#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元" )
}else { /*分页代码*/
add_page(data.data.total, no, that.pageSize, that.getList);
} else {
alert(data['msg']); alert(data['msg']);
}; };
}else{ } else {
alert('数据错误'); alert('数据错误');
}; };
},'json');
}, },
error: function() {
alert('error'); /**
* 重置查询条件
*/
resetAll : function(){
var that = refund;
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 looked_id = $('#looked_id').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 = $('#comit_name').val("");
var comit_phone = $('#comit_phone').val("");
that.agent_id_phone="";
}, },
complete: function(xhr, textStatus){
if(textStatus === 'timeout'){ /**
alert('请求超时'); * 导出报表
}; */
exportExcel : function(){
var that = refund;
var params = that.buildSearchParams();
$.post('',params, function(data){
if(data.code == 200) {
} else {
alert(data.msg);
} }
}); })
}, },
//总监审核
/**
//出纳审核 * 获取查询参数
Cashier: function(pageNo) { */
$("#commissioner").addClass("btn-default"); buildSearchParams : 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 back_id = $('#back_id').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 params = {}; var params = {};
params.pageNo = follow.pageNo; if ( choose_type ) {
params.pageSize = follow.pageSize; params.choose_type = choose_type;
$.ajax({
type: 'GET',
url: '/index/refundListCashier/3',
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('请求超时');
};
} }
}); 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 ;
}, },
//出纳审核
getList: function(pageNo) {
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']); * 删除收款记录
}; * @param {Object} id
}else{ */
alert('数据错误'); deleteTableRow : function(id){
}; var that = refund;
}, var params = {
error: function() { 'id' : id
alert('error');
},
complete: function(xhr, textStatus){
if(textStatus === 'timeout'){
alert('请求超时');
}; };
$.post('/index/delAdjustment',params , function(data){
if(data.code == 200) {
that.getList(1);
} 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