Commit 6b153e94 authored by agping's avatar agping

收款记录修改

parent 12f7b043
...@@ -169,11 +169,11 @@ ...@@ -169,11 +169,11 @@
display: none !important; display: none !important;
} }
.result { .result,.result2 {
width: 600px; width: 600px;
} }
.result>img { .result>img,.result2>img{
width: 200px; width: 200px;
height: 200px; height: 200px;
} }
......
...@@ -48,8 +48,8 @@ ...@@ -48,8 +48,8 @@
<li class="main-sec-li"> <li class="main-sec-li">
<div>应收佣金<span class="left">{{commission}}</span></div> <div>应收佣金<span class="left">{{commission}}</span></div>
</li> </li>
<li class="main-sec-li"> <li class="main-sec-li" v-if="!(estimated_receipt_date==''||estimated_receipt_date==null)">
<div>预计收款时间<span class="left">{{commission}}</span></div> <div>预计收款时间<span class="left">{{estimated_receipt_date}}</span></div>
</li> </li>
</ul> </ul>
<ul v-for="(item, index) in list"> <ul v-for="(item, index) in list">
...@@ -182,6 +182,7 @@ ...@@ -182,6 +182,7 @@
house_number: '', house_number: '',
price: '', price: '',
commission: '', commission: '',
estimated_receipt_date:'',
is_open: '', is_open: '',
trade_type: '', trade_type: '',
token: '', token: '',
...@@ -230,7 +231,14 @@ ...@@ -230,7 +231,14 @@
} }
if(e =='5') { if(e =='5') {
return '合作方' return '合作方'
}else{ }if(e =='6') {
return 'APP盘下载方'
}
if(e =='7') {
return 'APP客下载方'
}
else{
layer.tipsX('分佣方类型判断错误'); layer.tipsX('分佣方类型判断错误');
} }
}, },
...@@ -260,6 +268,7 @@ ...@@ -260,6 +268,7 @@
_this.house_number = response.data.data.bargainInfo.house_number; _this.house_number = response.data.data.bargainInfo.house_number;
_this.commission = response.data.data.bargainInfo.commission; _this.commission = response.data.data.bargainInfo.commission;
_this.price = response.data.data.bargainInfo.price; _this.price = response.data.data.bargainInfo.price;
_this.estimated_receipt_date=response.data.data.bargainInfo.estimated_receipt_date;
_this.list = response.data.data.bargainInfo.realIncome; _this.list = response.data.data.bargainInfo.realIncome;
_this.Datas = response.data.data.cent_commission; _this.Datas = response.data.data.cent_commission;
_this.taxDatas = response.data.data.taxes; _this.taxDatas = response.data.data.taxes;
......
...@@ -17,6 +17,7 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css ...@@ -17,6 +17,7 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
$(document.body).append(template); $(document.body).append(template);
follow.getList(0); follow.getList(0);
follow.event(); follow.event();
follow.getaddPicList2();
}, },
event: function() { event: function() {
...@@ -56,6 +57,15 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css ...@@ -56,6 +57,15 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
e.stopPropagation(); e.stopPropagation();
$(this).parent().remove(); $(this).parent().remove();
}); });
_doc.on('click', '.span-del2', function(e) {
e.preventDefault();
e.stopPropagation();
$(this).parent().remove();
$(this).prev().attr('class');
console.log($(this).prev().attr('class'));
follow.spandelList($(this).prev().attr('class'));
});
_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();
...@@ -73,7 +83,9 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css ...@@ -73,7 +83,9 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
// follow.getaddPicList(); // follow.getaddPicList();
// }); // });
_doc.on('click', '.add-pic', function() { _doc.on('click', '.add-pic', function() {
follow.house_id = $(this).attr("data-id");
follow.getaddPicList(); follow.getaddPicList();
}); });
$("#reset").click(function() { //重置 $("#reset").click(function() { //重置
...@@ -108,37 +120,42 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css ...@@ -108,37 +120,42 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
_doc.on('click', '#saveBtn', function(e) { _doc.on('click', '#saveBtn', function(e) {
console.log(555); console.log(555);
var _this = $(this); var _this = $(this);
var _data = {
type: 1,
image1: follow.image_file
};
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
// $.ajax({ var imgname=[];
// type: 'GET', for(var i=0;i<$('.result').length;i++){
// url: '/index/uploadImg', imgname[i]=$('.result>img').get(i).getAttribute("class");
// data: _data, }
//// timeout: 30000, console.log(imgname.join(','));
// dataType: 'json', var _data = {
// beforeSend: function() {}, img_id: follow.house_id,
// success: function(_data) { img_name: imgname.join(',')
// if(typeof _data === 'object') {
// };
// } else { $.ajax({
// alert('数据错误'); type: 'GET',
// }; url: '/index/addReceiptImg',
// }, data: _data,
// error: function() { dataType: 'json',
// alert('enter error'); beforeSend: function() {},
// }, success: function(_data) {
// complete: function(xhr, textStatus){ if(typeof _data === 'object') {
// if(textStatus === 'timeout') {
// //处理超时的逻辑 } else {
// alert('请求超时,请重试'); alert('数据错误');
// }; };
// } },
// }); error: function() {
alert('enter error');
},
complete: function(xhr, textStatus){
if(textStatus === 'timeout') {
//处理超时的逻辑
alert('请求超时,请重试');
};
}
});
}); });
//图片上传 2.2版本 //图片上传 2.2版本
...@@ -192,9 +209,50 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css ...@@ -192,9 +209,50 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
} }
}); });
}, },
//点击收款图片 调用的接口 spandelList: function(n) { //提交
getaddPicList: function() { $.ajax({
'type': 'POST',
'url': '/index/deleteReceiptImg',
data: {
id:n
},
dataType: "json",
success: function(data) {
if(data.code == 200) {
} else {}
}
});
},
getaddPicList: function() {//获取收款图片
$('.result2').remove();
$.ajax({
'type': 'GET',
'url': '/index/receiptImgList',
data: {
"id": follow.house_id,
},
dataType: "json",
success: function(data) {
if(data.code == 200) {
//渲染已经有的列表
console.log(data.data.id);
for(i=0;i<data.data.length;i++){
var result = '<div class="result2"><img class="' + data.data[i].id + '" src="' + data.data[i].img_name + '" alt=""/> <span class="span-del2">删除</span></div>';
div = document.createElement('div');
div.innerHTML = result;
document.getElementById('container_body').appendChild(div);
}
 
} else {}
}
});
},
//点击收款图片 调用的接口 上传图片
getaddPicList2: function() {
console.log(55);
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') {
...@@ -206,19 +264,24 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css ...@@ -206,19 +264,24 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
function readFile() { function readFile() {
console.log(this.files); console.log(this.files);
// var _this=$(this); // 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]);
//赋值 console.log(this.result);
var formData = new FormData(); var formData = new FormData();
formData.append('type','chat'); formData.append('type', 'chat');
formData.append('image',this.files[0]); formData.append('image', this.files[0]);
console.log(this.files[0]); console.log(this.files[0]);
console.log(formData); console.log(formData);
reader.onload = function(e) {
console.log(this.result);
var result2 = this.result;
console.log(result2);
$.ajax({ $.ajax({
type: 'post', type: 'post',
url: '/index/uploadImg', url: '/index/uploadImg',
...@@ -226,16 +289,17 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css ...@@ -226,16 +289,17 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
dataType: 'json', dataType: 'json',
contentType: false, contentType: false,
cache: false, cache: false,
processData:false, processData: false,
beforeSend: function() {}, beforeSend: function() {},
success: function(_data) { success: function(_data) {
if(typeof _data === 'object') { if(_data.code == 200) {
result = '<div class="result"><img calss="'+_data.+'" src="' + this.result + '" alt=""/> <span class="span-del">删除</span></div>'; result = '<div class="result"><img class="' + _data.data.img_path + '" src="' + result2 + '" 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); 
} else { } else {
alert('数据错误'); alert(_data.msg);
}; };
}, },
error: function() { error: function() {
...@@ -248,10 +312,9 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css ...@@ -248,10 +312,9 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
}; };
} }
}); });
    
}
}; };
}; };
}, },
......
...@@ -13,12 +13,9 @@ ...@@ -13,12 +13,9 @@
<td>[%= it[item]['house_number'] %]</td> <td>[%= it[item]['house_number'] %]</td>
<td> <td>
<!--增加收款图片 2.2版本--> <!--增加收款图片 2.2版本-->
<a class="btn1 btn-info add-pic" href="#modal-addPic" data-toggle="modal" <a class="btn1 btn-info add-pic" href="#modal-addPic" data-toggle="modal" data-id='[%= it[item]["id"] %]'>收款图片</a>
data-id='[%= it[item]["order_id"] %]'>收款图片</a> <a class="btn1 btn-info timeline" href="#modal-time" data-toggle="modal" data-id='[%= it[item]["order_id"] %]'>时间轴</a>
<a class="btn1 btn-info timeline" href="#modal-time" data-toggle="modal" <a class="btn1 btn-info submit_edit2" href="#modal-linetime" data-toggle="modal" data-id='[%= it[item]["id"]%]' data-money='[%= it[item]["real_money"] %]'>编辑</a>
data-id='[%= it[item]["order_id"] %]'>时间轴</a>
<a class="btn1 btn-info submit_edit2" href="#modal-linetime" data-toggle="modal"
data-id='[%= it[item]["id"]%]' data-money='[%= it[item]["real_money"] %]'>编辑</a>
</td> </td>
</tr> </tr>
[% } %] [% } %]
......
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