Commit d7dfbfca authored by duxinyuan's avatar duxinyuan

111

parent 9b3b81f7
define(['doT', 'text!temp/refund_template_tpl.html', 'css!style/home.css', 'ckfinder', 'ckfinderStart', 'pagination', 'bootstrapJs'], function(doT, template) {
follow = {
define(['doT', 'text!temp/refund_list_tpl.html', 'css!style/home.css', 'ckfinder', 'ckfinderStart', "datetimepicker",'pagination', 'bootstrapJs','blow-up'], function(doT, template) {
refund = {
pageNo: 1,
/*第几页*/
pageSize: 10,
/*每页显示多少条*/
id: '',
house_id: '',
type: '',
valueCurrent: '',
ajaxObj: '',
stopstatus: true,
boxphoto: '',
house_fatherid: '',
collection_del_id:'',
listData :"",
moneyTotal : "" ,
agent_id_phone : '',
init: function() {
//初始化dot
$(document.body).append(template);
follow.getList(0);
follow.event();
refund.getList(1);
refund.event();
},
event: function() {
$("#search").click(function() {
follow.getList(1);
});
$("#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);
});
var that = refund;
var _doc = $(document);
$ (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 () {//点击分佣提成
follow.Caozuo();
$(document).on('click','#confirm_delete',function(e){
var id = that.deleteId;
that.deleteTableRow(id);
});
//通过
$ (document).delegate ("#confirm_pass", "click", function () {//点击通过
follow.confirmPass();
//搜索
$(document).on('click','#search',function(e){
that.getList(1);
});
$ (document).delegate (".is_pass", "click", function () {//点击通过
follow.house_id = $ (this).attr ("data-id");
});
// 点击新增分佣提成
$ (document).delegate ("#new-commission", "click", function () {//点击分佣提成
follow.newCommission();
follow.Caozuo();
});
//table切换
$ (document).delegate ("#information", "click", function () {//点击操作跟进详情
follow.Information();
});
$ (document).delegate ("#fees", "click", function () {//点击操作跟进详情
follow.Fees();
});
$ (document).delegate ("#records", "click", function () {//点击操作跟进详情
follow.Records();
});
$ (document).delegate (".submit_edit", "click", function () {//提交
follow.Submit_follow();
//重置搜索条件
$(document).on('click','#reset',function(e){
that.resetAll();
});
//导出报表
$(document).on('click','#export',function(e){
that.exportExcel();
});
//操作----时间轴
$(document).on('click','.timeline',function(e){
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).on('click','.add-pic',function(e){
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元" )
// });
//二级联动
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>';
});
//专员审核 总监审核 经理审核 出纳审核
$ (document).delegate ("#commissioner", "click", function () {//点击操作跟进详情
follow.Commissioner();
$('#commit_shop').append(_str)
});
$ (document).delegate ("#manager", "click", function () {//点击操作跟进详情
follow.Manager();
} else {};
});
$ (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()==''){
$(".user-ul2").html('');
}else{
follow.search_phone2();
//分佣方 姓名下拉式
$(document).on("input", "#comit_name", function() { //手机号新增搜索客方
if($("#comit_name").val() == '') {
that.agent_id_phone='';
$(".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_phone2:function(){//手机号
$.ajax ({
search_person: function() { //手机号新增客户
$.ajax({
url: '/index/getBroker_new',
type: 'GET',
async: true,
data: {
"phone":$("#cus_fang").val()
"phone": $("#comit_name").val(),
'all' : 1
},
dataType: 'json',
success: function (data) {
if (data.code == 200) {
var user_ul2 = "";
$.each(data.data, function(i,item) {
user_ul2+='<li class="addphone2" data-id="'+item.id+'">'+item.id+'-'+item.name+'-'+item.phone+'</li>';
});
$(".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"
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 ($('.btn-info').index()==2) {
a_url="/index/overRuleMajordomo/2"
if(item.status == 1){
var status='-长假';
};
if ($('.btn-info').index()==3) {
a_url="/index/overRuleCashier/3"
if(item.status == 2){
var status='-离职';
};
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('获取失败!');
}
if(item.status == 3){
var status='-转勤';
}
user_ul += '<li class="addphone" data-id="' + item.id + '">' + item.id + '-' + item.name + '-' + item.phone + status + '</li>';
});
},
//通过
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);
}
$(".user-ul").html(user_ul);
$(".user-ul").show();
} 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(" ")
}
});
}
} else {
alert('获取失败!');
}
}
});
//将li里的值 赋给input(分佣方姓名)
addphone: function(obj) {//新增客户 input赋值
var that = refund ;
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({
'type': 'POST',
'url' : '/index/addBargain',
data: {"id":follow.house_id,
"role":$("#is_carefully_chosen").val(),
"scale":$("#commission-rate").val(),
"scale_fee":$("#should-commission").val(),
url: '/index/getDistrict',
type: 'GET',
async: true,
data: {
"pageSize": 1000
},
dataType: "json",
success: function(data){
if(data.code == 200){
if (data.data) {
console.log(666);
}
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('获取失败!');
alert(data.msg)
}
}
});
},
// 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();
$(".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() { //提交
getDistrictStoreList: function(id, fn) {
$.ajax({
'type': 'POST',
'url': '/index/pcEditClient',
url: '/index/getDistrictStoreList',
type: 'GET',
async: true,
data: {
"id": follow.house_id,
"user_nick": $("#cus_name").val(),
"user_phone": $("#cus_phone").html(),
"agent_id":follow.agent_id,//客方
"sex": $("#sex").val()
'id': id,
"pageSize": 1000
},
dataType: "json",
dataType: 'json',
success: function(data) {
if(data.code == 200) {
if(data.data) {
}
if(data.code == 200 && data.data != null) {
fn && fn(data.data);
} 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 {
alert(data['msg']);
};
}else{
alert('数据错误');
};
},
error: function() {
alert('error');
},
complete: function(xhr, textStatus){
if(textStatus === 'timeout'){
alert('请求超时');
};
countValue : function(){
var that = refund ;
var data = that.listData ;
var value = 0 ;
for (var i = 0 ; i < data.length ; i++ ){
value = value + (data[i].money - 0);
}
});
$('#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 {
alert(data['msg']);
};
}else{
alert('数据错误');
};
},
error: function() {
alert('error');
},
complete: function(xhr, textStatus){
if(textStatus === 'timeout'){
alert('请求超时');
};
getAdjustmentDetail : function(id){
var that = refund ;
$.get('/index/getAdjustmentDetail',{'id' : id},function(data){
if(data.code == 200) {
that.setValue(data.data);
} else {
alert(data.msg);
}
});
},'json');
},
//经理审核
//总监审核
Director: function(pageNo) {
$("#commissioner").removeClass("btn-info");
$("#commissioner").addClass("btn-default");
$("#manager").removeClass("btn-info");
$("#manager").addClass("btn-default");
$("#director").removeClass("btn-default");
$("#director").addClass("btn-info");
$("#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;
setValue : function(data){
var that = refund ;
$('#change_id').text(data.id);
// $('#change_price').text("");
$('#befor_into_id').text(data.adjustment_old[0].id);
$('#befor_order_id').text(data.adjustment_old[0].order_id);
$('#befor_house_id').text(data.adjustment_old[0].house_id);
$('#befor_house_addr').text(data.adjustment_old[0].internal_address);
$('#befor_into_date').text(data.adjustment_old[0].income_time);
$('#befor_into_type').text(data.adjustment_old[0].type);
$('#after_into_id').text(data.adjustment[0].id);
$('#after_order_id').text(data.adjustment[0].order_id);
$('#after_report_id').text(data.adjustment[0].bargain_id);
$('#after_house_id').text(data.adjustment[0].house_id);
$('#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',
data: params,
timeout: 30000,
dataType: 'json',
beforeSend: function() {},
success: function(data) {
/**
* 获取表格数据
* @param {Object} no
*/
getList : function(no){
var that = refund;
that.pageNo = no;
var params = that.buildSearchParams();
params.pageNo = that.pageNo;
params.pageSize = that.pageSize ;
$.get('/index/refundList',params,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);
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元" )
}else {
/*分页代码*/
add_page(data.data.total, no, that.pageSize, that.getList);
} else {
alert(data['msg']);
};
}else{
} else {
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");
$("#manager").removeClass("btn-info");
$("#manager").addClass("btn-default");
$("#director").removeClass("btn-info");
$("#director").addClass("btn-default");
$("#cashier").removeClass("btn-default");
$("#cashier").addClass("btn-info");
console.log($('.btn-info').index());
follow.pageNo = pageNo;
/**
* 获取查询参数
*/
buildSearchParams : 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 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 = {};
params.pageNo = follow.pageNo;
params.pageSize = follow.pageSize;
$.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 ( 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 ;
},
//出纳审核
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']);
};
}else{
alert('数据错误');
};
},
error: function() {
alert('error');
},
complete: function(xhr, textStatus){
if(textStatus === 'timeout'){
alert('请求超时');
/**
* 删除收款记录
* @param {Object} id
*/
deleteTableRow : function(id){
var that = refund;
var params = {
'id' : id
};
$.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