Commit 9ae6f5e5 authored by agping's avatar agping

收款记录修改

parent 2de557c0
...@@ -308,7 +308,7 @@ ...@@ -308,7 +308,7 @@
<!--input上传图片--> <!--input上传图片-->
<div id="container_body"> <div id="container_body">
<label>请选择一个图像文件:</label> <label>请选择一个图像文件:</label>
<input type="file" id="file_input" multiple/> <input type="file" id="file_input"/>
</div> </div>
</div> </div>
<ul class="img-pre-ul" id="xiangqing_pic_ul"> <ul class="img-pre-ul" id="xiangqing_pic_ul">
......
define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css', 'ckfinder', 'ckfinderStart', 'pagination', 'bootstrapJs'], function(doT, template) { define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css', 'ckfinder', 'ckfinderStart', 'pagination', 'bootstrapJs'], function(doT, template) {
follow = { follow = {
pageNo: 1, pageNo: 1,
...@@ -12,66 +11,68 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css ...@@ -12,66 +11,68 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
ajaxObj: '', ajaxObj: '',
stopstatus: true, stopstatus: true,
boxphoto: '', boxphoto: '',
image_file: '',
init: function() { init: function() {
//初始化dot //初始化dot
$(document.body).append(template); $(document.body).append(template);
follow.getList(0); follow.getList(0);
follow.event(); follow.event();
}, },
event: function() { event: function() {
var _doc = $(document); var _doc = $(document);
// 收款图片上传多张图片 // 收款图片上传多张图片
// window.onload = function(){ // window.onload = function(){
// var input = document.getElementById("file_input"); // var input = document.getElementById("file_input");
// var result,div; // var result,div;
// //
// if(typeof FileReader==='undefined'){ // if(typeof FileReader==='undefined'){
// result.innerHTML = "抱歉,你的浏览器不支持 FileReader"; // result.innerHTML = "抱歉,你的浏览器不支持 FileReader";
// input.setAttribute('disabled','disabled'); // input.setAttribute('disabled','disabled');
// }else{ // }else{
// input.addEventListener('change',readFile,false); // input.addEventListener('change',readFile,false);
// } // }
// function readFile(){ // function readFile(){
// for(var i=0;i<this.files.length;i++){ // for(var i=0;i<this.files.length;i++){
// if (!input['value'].match(/.jpg|.gif|.png|.bmp/i)){  //判断上传文件格式 // if (!input['value'].match(/.jpg|.gif|.png|.bmp/i)){  //判断上传文件格式
// return alert("上传的图片格式不正确,请重新选择") // return alert("上传的图片格式不正确,请重新选择")
//     } //     }
// var reader = new FileReader(); // var reader = new FileReader();
// reader.readAsDataURL(this.files[i]); // reader.readAsDataURL(this.files[i]);
// reader.onload = function(e){ // reader.onload = function(e){
// result = '<div id="result"><img src="'+this.result+'" alt=""/></div>'; // result = '<div id="result"><img src="'+this.result+'" alt=""/></div>';
// div = document.createElement('div'); // div = document.createElement('div');
// div.innerHTML = result; // div.innerHTML = result;
// document.getElementById('body').appendChild(div);   //插入dom树 <br>          } // document.getElementById('body').appendChild(div);   //插入dom树 <br>          }
// } // }
// } // }
// }; // };
// $('.span-del').click(function(){ // $('.span-del').click(function(){
// console.log(55); // console.log(55);
// $(this).parent().remove(); // $(this).parent().remove();
// }); // });
_doc.on('click', '.span-del', function(e){ _doc.on('click', '.span-del', function(e) {
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
$(this).parent().remove(); $(this).parent().remove();
}); });
_doc.on('click', 'a[href="#modal-time"]', function(e){ _doc.on('click', 'a[href="#modal-time"]', function(e) {
follow.house_id = $ (this).attr ("data-id"); follow.house_id = $(this).attr("data-id");
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
// console.log('follow.house_id'); // console.log('follow.house_id');
$('.iframe-time-line').attr('src', '/app_broker/timeline_pc?order_id='+follow.house_id); $('.iframe-time-line').attr('src', '/app_broker/timeline_pc?order_id=' + follow.house_id);
}); });
$("#search").click(function() { $("#search").click(function() {
follow.getList(1); follow.getList(1);
}); });
//点击收款图片 2.2版本 //点击收款图片 2.2版本
// $(".add-pic").click(function() { // $(".add-pic").click(function() {
// //监听图片上传 // //监听图片上传
// follow.getaddPicList(); // follow.getaddPicList();
// }); // });
_doc.on('click', '.add-pic', function(){ _doc.on('click', '.add-pic', function() {
follow.getaddPicList(); follow.getaddPicList();
}); });
...@@ -81,99 +82,89 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css ...@@ -81,99 +82,89 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
$("#export").click(function() { //导出列表 $("#export").click(function() { //导出列表
follow.exportList(); follow.exportList();
}); });
$ (document).delegate (".submit_edit2", "click", function () {//提交 $(document).delegate(".submit_edit2", "click", function() { //提交
follow.house_id2 = $ (this).attr ("data-id"); follow.house_id2 = $(this).attr("data-id");
console.log(follow.house_id2); console.log(follow.house_id2);
$("#real_money").val($(this).attr ("data-money")); $("#real_money").val($(this).attr("data-money"));
}); });
$ (document).delegate (".submit_edit", "click", function () {//提交 $(document).delegate(".submit_edit", "click", function() { //提交
follow.Submit_follow(); follow.Submit_follow();
}); });
$ (document).on ("input","#cus_fang", function () {//手机号搜索客方2 $(document).on("input", "#cus_fang", function() { //手机号搜索客方2
if($("#cus_fang").val()==''){ if($("#cus_fang").val() == '') {
$(".user-ul2").html(''); $(".user-ul2").html('');
}else{ } else {
follow.search_phone2(); follow.search_phone2();
} }
}); });
$ (document).delegate (".addphone2", "click", function () {//list2消失 $(document).delegate(".addphone2", "click", function() { //list2消失
follow.addphone2(this); follow.addphone2(this);
}); });
//图片预览点击放大事件 //图片预览点击放大事件
_doc.on('click', '.img-pre-ul>li>img', function(e) {
_imgMaskObj.show().find('img').attr('src', this.src);
});
_imgMaskObj.click(function(e) {
this.style.display = 'none';
});
//保存上传的图片 //保存上传的图片
_doc.on('click', '#saveBtn', function(e) { _doc.on('click', '#saveBtn', function(e) {
console.log(555);
var _this = $(this); var _this = $(this);
var _data={ var _data = {
id:3104, type: 1,
image1: follow.image_file
}; };
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
var _imgUploadLunbo = $('#xiangqing_pic_ul'); //详情页轮播图ul // $.ajax({
var _xiangqingPicObj = _imgUploadLunbo.find('li>img'); // type: 'GET',
var _urlCut = location.origin + '/resource/lib/Attachments/images/';//要截取的部分url // url: '/index/uploadImg',
$.each(_xiangqingPicObj, function(i, item) { // data: _data,
_data['slide_show[' + i + ']'] = item.src.replace(_urlCut, ''); //// timeout: 30000,
}); // dataType: 'json',
var _imgId = _this.parent().attr('data-imgid'); // beforeSend: function() {},
$.ajax({ // success: function(_data) {
type: 'POST', // if(typeof _data === 'object') {
url: '/index/houseEdit', //
data: _data, // } else {
// timeout: 30000, // alert('数据错误');
dataType: 'json', // };
beforeSend: function() {}, // },
success: function(_data) { // error: function() {
if(typeof _data === 'object') { // alert('enter error');
// },
} else { // complete: function(xhr, textStatus){
alert('数据错误'); // if(textStatus === 'timeout') {
}; // //处理超时的逻辑
}, // alert('请求超时,请重试');
error: function() { // };
alert('enter error'); // }
}, // });
complete: function(xhr, textStatus){
if(textStatus === 'timeout') {
//处理超时的逻辑
alert('请求超时,请重试');
};
}
});
}); });
//图片上传 2.2版本 //图片上传 2.2版本
}, },
addphone2:function(obj){ addphone2: function(obj) {
var user_ht=$(obj).html(); var user_ht = $(obj).html();
$("#cus_fang").val(user_ht); $("#cus_fang").val(user_ht);
$(".user-ul2").html(''); $(".user-ul2").html('');
follow.agent_id = $ (obj).attr ("data-id"); follow.agent_id = $(obj).attr("data-id");
}, },
search_phone2:function(){//手机号 search_phone2: function() { //手机号
$.ajax ({ $.ajax({
url: '/index/select_by_phone', url: '/index/select_by_phone',
type: 'POST', type: 'POST',
async: true, async: true,
data: { data: {
"phone":$("#cus_fang").val() "phone": $("#cus_fang").val()
}, },
dataType: 'json', dataType: 'json',
success: function (data) { success: function(data) {
if (data.code == 200) { if(data.code == 200) {
var user_ul2 = ""; var user_ul2 = "";
$.each(data.data, function(i,item) { $.each(data.data, function(i, item) {
user_ul2+='<li class="addphone2" data-id="'+item.id+'">'+item.id+'-'+item.realname+'-'+item.phone+'</li>'; user_ul2 += '<li class="addphone2" data-id="' + item.id + '">' + item.id + '-' + item.realname + '-' + item.phone + '</li>';
}); });
$(".user-ul2").html(user_ul2); $(".user-ul2").html(user_ul2);
...@@ -197,47 +188,77 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css ...@@ -197,47 +188,77 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
success: function(data) { success: function(data) {
if(data.code == 200) { if(data.code == 200) {
follow.getList(0); follow.getList(0);
} else { } else {}
}
} }
}); });
}, },
//点击收款图片 调用的接口 //点击收款图片 调用的接口
getaddPicList: function() { getaddPicList: function() {
var image_file;
var input = document.getElementById("file_input"); var input = document.getElementById("file_input");
var result,div; var result, div;
if(typeof FileReader==='undefined'){ if(typeof FileReader === 'undefined') {
result.innerHTML = "抱歉,你的浏览器不支持 FileReader"; result.innerHTML = "抱歉,你的浏览器不支持 FileReader";
input.setAttribute('disabled','disabled'); input.setAttribute('disabled', 'disabled');
}else{ } else {
input.addEventListener('change',readFile,false); input.addEventListener('change', readFile, false);
}; };
function readFile(){
function readFile() {
console.log(this.files); console.log(this.files);
image_file=this.files // var _this=$(this);
for(var i=0;i<this.files.length;i++){ for(var i = 0; i < this.files.length; i++) {
if (!input['value'].match(/.jpg|.gif|.png|.bmp/i)){  //判断上传文件格式 if(!input['value'].match(/.jpg|.gif|.png|.bmp/i)) {   //判断上传文件格式
return alert("上传的图片格式不正确,请重新选择") return alert("上传的图片格式不正确,请重新选择")    
    } }
var reader = new FileReader(); var reader = new FileReader();
reader.readAsDataURL(this.files[i]); reader.readAsDataURL(this.files[i]);
reader.onload = function(e){ reader.onload = function(e) {
result = '<div class="result"><img src="'+this.result+'" alt=""/> <span class="span-del">删除</span></div>'; result = '<div class="result"><img src="' + this.result + '" alt=""/> <span class="span-del">删除</span></div>';
div = document.createElement('div'); div = document.createElement('div');
div.innerHTML = result; div.innerHTML = result;
document.getElementById('container_body').appendChild(div);   document.getElementById('container_body').appendChild(div);   
 }
} }
}; };
console.log(image_file);
var formData = new FormData();
formData.append('type',1);
formData.append('image',this.files[0]);
console.log(this.files[0]);
console.log(formData);
$.ajax({
type: 'post',
url: '/index/uploadImg',
data: formData,
dataType: 'json',
contentType: false,
cache: false,
processData:false,
beforeSend: function() {},
success: function(_data) {
if(typeof _data === 'object') {
} else {
alert('数据错误');
};
},
error: function() {
alert('enter error');
},
complete: function(xhr, textStatus) {
if(textStatus === 'timeout') {
//处理超时的逻辑
alert('请求超时,请重试');
};
}
});
};
}, },
//删除图片 //删除图片
// 导出列表 // 导出列表
exportList: function(pageNo) { exportList: function(pageNo) {
console.log(2); console.log(2);
follow.pageNo = pageNo; follow.pageNo = pageNo;
...@@ -253,8 +274,8 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css ...@@ -253,8 +274,8 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
var store_name = $('#store_name').val(); var store_name = $('#store_name').val();
var report_phone = $('#applicant_phone').val(); var report_phone = $('#applicant_phone').val();
var report_name = $('#applicant_name').val(); var report_name = $('#applicant_name').val();
window.open('/index/getCollection?'+ window.open('/index/getCollection?' +
'excel='+ excel_two +'&user_name=' + user_name + '&start_time=' + start_time + '&end_time=' + end_time + '&internal_title=' + internal_title + '&user_phone=' + user_phone + '&id=' + id+ '&store_name=' + store_name+ '&report_phone=' + report_phone+ '&report_name=' + report_name); 'excel=' + excel_two + '&user_name=' + user_name + '&start_time=' + start_time + '&end_time=' + end_time + '&internal_title=' + internal_title + '&user_phone=' + user_phone + '&id=' + id + '&store_name=' + store_name + '&report_phone=' + report_phone + '&report_name=' + report_name);
}, },
getList: function(pageNo) { getList: function(pageNo) {
...@@ -263,15 +284,15 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css ...@@ -263,15 +284,15 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
console.log($('#shop_name').val()); console.log($('#shop_name').val());
follow.pageNo = pageNo; follow.pageNo = pageNo;
var params = {}; var params = {};
params.user_name =$.trim($('#customer_name').val()); params.user_name = $.trim($('#customer_name').val());
params.start_time =$('#start_date').val(); params.start_time = $('#start_date').val();
params.end_time =$('#end_date').val(); params.end_time = $('#end_date').val();
params.internal_title =$('#shop_name').val(); params.internal_title = $('#shop_name').val();
params.user_phone =$('#customer_phone').val(); params.user_phone = $('#customer_phone').val();
params.id =$('#shop_num').val()*1; params.id = $('#shop_num').val() * 1;
params.store_name =$('#store_name').val(); params.store_name = $('#store_name').val();
params.report_phone =$('#applicant_phone').val(); params.report_phone = $('#applicant_phone').val();
params.report_name =$('#applicant_name').val(); params.report_name = $('#applicant_name').val();
params.pageNo = follow.pageNo; params.pageNo = follow.pageNo;
params.pageSize = follow.pageSize; params.pageSize = follow.pageSize;
...@@ -284,67 +305,66 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css ...@@ -284,67 +305,66 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
beforeSend: function() {}, beforeSend: function() {},
success: function(data) { success: function(data) {
if(typeof data === 'object') { if(typeof data === 'object') {
if (data.code == 200) { if(data.code == 200) {
var doTtmpl = doT.template(document.getElementById('get_collection_tpl').innerHTML); var doTtmpl = doT.template(document.getElementById('get_collection_tpl').innerHTML);
$("#follow_list").html(doTtmpl(data.data.list)); $("#follow_list").html(doTtmpl(data.data.list));
// 支付方式 10支付宝 20 微信 30pos机器 40转账 50现金 60其他 // 支付方式 10支付宝 20 微信 30pos机器 40转账 50现金 60其他
$("#follow_list tr").each(function (e) { $("#follow_list tr").each(function(e) {
//e代表索引 从0开始 eq(0)就是第一行 //e代表索引 从0开始 eq(0)就是第一行
var temp = $("#follow_list").find("tr").eq(e).find("td").eq(5).html(); //获取一列的值 var temp = $("#follow_list").find("tr").eq(e).find("td").eq(5).html(); //获取一列的值
var temp_two = $("#follow_list").find("tr").eq(e).find("td").eq(6).html(); var temp_two = $("#follow_list").find("tr").eq(e).find("td").eq(6).html();
// null // null
var temp_one = $("#follow_list").find("tr").eq(e).find("td").eq(1).html(); var temp_one = $("#follow_list").find("tr").eq(e).find("td").eq(1).html();
if(temp_two*1==10){ if(temp_two * 1 == 10) {
$("#follow_list").find("tr").eq(e).find("td").eq(6).html("支付宝") $("#follow_list").find("tr").eq(e).find("td").eq(6).html("支付宝")
} }
if(temp_two*1==20){ if(temp_two * 1 == 20) {
$("#follow_list").find("tr").eq(e).find("td").eq(6).html("微信") $("#follow_list").find("tr").eq(e).find("td").eq(6).html("微信")
} }
if(temp_two*1==30){ if(temp_two * 1 == 30) {
$("#follow_list").find("tr").eq(e).find("td").eq(6).html("pos机器") $("#follow_list").find("tr").eq(e).find("td").eq(6).html("pos机器")
} }
if(temp_two*1==40){ if(temp_two * 1 == 40) {
$("#follow_list").find("tr").eq(e).find("td").eq(6).html("转账") $("#follow_list").find("tr").eq(e).find("td").eq(6).html("转账")
} }
if(temp_two*1==50){ if(temp_two * 1 == 50) {
$("#follow_list").find("tr").eq(e).find("td").eq(6).html("现金") $("#follow_list").find("tr").eq(e).find("td").eq(6).html("现金")
} }
if(temp_two*1==60){ if(temp_two * 1 == 60) {
$("#follow_list").find("tr").eq(e).find("td").eq(6).html("其他") $("#follow_list").find("tr").eq(e).find("td").eq(6).html("其他")
} }
// 付款类型 10意向金 20定金 30保管金 40押金 50 租金 60 进场费 70转让费 80其他 // 付款类型 10意向金 20定金 30保管金 40押金 50 租金 60 进场费 70转让费 80其他
if(temp*1==10){ if(temp * 1 == 10) {
$("#follow_list").find("tr").eq(e).find("td").eq(5).html("意向金") $("#follow_list").find("tr").eq(e).find("td").eq(5).html("意向金")
} }
if(temp*1==20){ if(temp * 1 == 20) {
$("#follow_list").find("tr").eq(e).find("td").eq(5).html("定金") $("#follow_list").find("tr").eq(e).find("td").eq(5).html("定金")
} }
if(temp*1==30){ if(temp * 1 == 30) {
$("#follow_list").find("tr").eq(e).find("td").eq(5).html("保管金") $("#follow_list").find("tr").eq(e).find("td").eq(5).html("保管金")
} }
if(temp*1==40){ if(temp * 1 == 40) {
$("#follow_list").find("tr").eq(e).find("td").eq(5).html("押金") $("#follow_list").find("tr").eq(e).find("td").eq(5).html("押金")
} }
if(temp*1==50){ if(temp * 1 == 50) {
$("#follow_list").find("tr").eq(e).find("td").eq(5).html("租金") $("#follow_list").find("tr").eq(e).find("td").eq(5).html("租金")
} }
if(temp*1==60){ if(temp * 1 == 60) {
$("#follow_list").find("tr").eq(e).find("td").eq(5).html("进场费") $("#follow_list").find("tr").eq(e).find("td").eq(5).html("进场费")
} }
if(temp*1==70){ if(temp * 1 == 70) {
$("#follow_list").find("tr").eq(e).find("td").eq(5).html("转让费") $("#follow_list").find("tr").eq(e).find("td").eq(5).html("转让费")
} }
if(temp*1==80){ if(temp * 1 == 80) {
$("#follow_list").find("tr").eq(e).find("td").eq(5).html("其他") $("#follow_list").find("tr").eq(e).find("td").eq(5).html("其他")
} }
if(temp*1==90){ if(temp * 1 == 90) {
$("#follow_list").find("tr").eq(e).find("td").eq(5).html("佣金") $("#follow_list").find("tr").eq(e).find("td").eq(5).html("佣金")
} }
// null 佣金 // null 佣金
if(temp_one=='null'){ if(temp_one == 'null') {
$("#follow_list").find("tr").eq(e).find("td").eq(1).html(" ") $("#follow_list").find("tr").eq(e).find("td").eq(1).html(" ")
} }
}); });
...@@ -352,7 +372,7 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css ...@@ -352,7 +372,7 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
$("#money_total").html(data.data.money_total) $("#money_total").html(data.data.money_total)
/*分页代码*/ /*分页代码*/
add_page(data.data.total,pageNo,follow.pageSize,follow.getList); add_page(data.data.total, pageNo, follow.pageSize, follow.getList);
/* $("#pagediv").pagination({ /* $("#pagediv").pagination({
length:data.data.total, length:data.data.total,
current: pageNo, current: pageNo,
...@@ -361,18 +381,18 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css ...@@ -361,18 +381,18 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
follow.getList(el.num.current); follow.getList(el.num.current);
} }
});*/ });*/
}else { } else {
alert(data['msg']); alert(data['msg']);
}; };
}else{ } else {
alert('数据错误'); alert('数据错误');
}; };
}, },
error: function() { error: function() {
alert('error'); alert('error');
}, },
complete: function(xhr, textStatus){ complete: function(xhr, textStatus) {
if(textStatus === 'timeout'){ if(textStatus === 'timeout') {
alert('请求超时'); alert('请求超时');
}; };
} }
......
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