Commit 6b153e94 authored by agping's avatar agping

收款记录修改

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