Commit ee8acf06 authored by duxinyuan's avatar duxinyuan

commite

parent 0e643432
...@@ -259,6 +259,17 @@ ...@@ -259,6 +259,17 @@
height:41px !important; height:41px !important;
width : 102px !important; width : 102px !important;
} }
.active {
color:dodgerblue;
}
#file_input_pic {
opacity: 0;
position: absolute;
top: 0;
left: 145px;
height: 35px;
width: 80px;
}
</style> </style>
<div id="page-content-wrapper"> <div id="page-content-wrapper">
<div class="container"> <div class="container">
...@@ -511,9 +522,33 @@ ...@@ -511,9 +522,33 @@
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"> × </button> <button type="button" class="close" data-dismiss="modal" aria-hidden="true"> × </button>
<h4 class="modal-title"> 收款详情 </h4> <h4 class="modal-title tit_con active shoukuanxiangqing" style="width:auto!important;float:left">收款详情</h4>
<h4 class="modal-title tit_con" style="width:auto!important;float:left;margin-left:20px;">收款图片</h4>
</div> </div>
<div class="modal-body modal-body-height"> <div class="modal-body modal-body-height pic-con1">
<ul class="list-group ">
<li class="list-group-item">
<div class="form-group full-width-100 full-pic-area">
<!--input上传图片-->
<div id="container_body">
<label>请选择一个图像文件:</label>
<button type="button btn2" class="btn btn-default">上传图片</button>
<input type="file" id="file_input_pic"/>
<div id="container_body_img_area"></div>
</div>
</div>
<ul class="img-pre-ul" id="xiangqing_pic_ul">
</ul>
</li>
</ul>
</div>
<div class="modal-footer pic-con1">
<button type="button btn2" class="btn btn-primary" id="saveBtn" data-dismiss="modal">
保存
</button>
</div>
<div class="modal-body modal-body-height pic-con2">
<form class=""> <form class="">
<div class="col-xs-12"> <div class="col-xs-12">
<div class="col-xs-3"> <div class="col-xs-3">
...@@ -729,7 +764,7 @@ ...@@ -729,7 +764,7 @@
</div> </div>
</form> </form>
</div> </div>
<div class="modal-footer"> <div class="modal-footer pic-con2">
<button type="button btn2" class="btn btn-primary" id="savePayBtn" data-dismiss="modal"> <button type="button btn2" class="btn btn-primary" id="savePayBtn" data-dismiss="modal">
保存 保存
</button> </button>
......
...@@ -5,6 +5,7 @@ define(['doT', 'text!temp/receivables_template_tpl.html', 'css!style/home.css', ...@@ -5,6 +5,7 @@ define(['doT', 'text!temp/receivables_template_tpl.html', 'css!style/home.css',
pageSize: 10, pageSize: 10,
/*每页显示多少条*/ /*每页显示多少条*/
id: '', id: '',
house_fatherid :'',
house_id: '', house_id: '',
house_fatherid: '', house_fatherid: '',
collection_del_id:'', collection_del_id:'',
...@@ -26,6 +27,123 @@ define(['doT', 'text!temp/receivables_template_tpl.html', 'css!style/home.css', ...@@ -26,6 +27,123 @@ define(['doT', 'text!temp/receivables_template_tpl.html', 'css!style/home.css',
event: function() { event: function() {
var that = receiv; var that = receiv;
var _doc = $(document); var _doc = $(document);
$('.pic-con2').show();
$('.pic-con1').hide();
$('.tit_con').unbind('click').bind('click',function(e){
$(this).parent('div').find('h4.active').removeClass("active");
$(this).addClass("active");
if (e.currentTarget.innerHTML == "收款图片"){
$('.pic-con1').show();
$('.pic-con2').hide();
} else {
$('.pic-con2').show();
$('.pic-con1').hide();
}
});
$('#file_input_pic').on('change', function(){
var _this = $(this);
var formData = new FormData();
formData.append('type', 'chat');
formData.append('image', _this[0].files[0]);
$.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) {
$('#container_body_img_area').append('<div class="result"><img data-imgname="{0}" src="{1}" alt=""/> <span class="span-del">删除</span></div>'.stringFormatObj({
'0': _data.data.img_path,
'1': _data.data.internet_img_name?urlDeal(_data.data.internet_img_name):_data.data.internet_img_name
}));
} else {
alert(_data.msg);
};
},
error: function() {
alert('enter error');
},
complete: function(xhr, textStatus) {
if(textStatus === 'timeout') {
//处理超时的逻辑
alert('请求超时,请重试');
};
}
});
});
//图片删除事件
_doc.on('click', '.span-del', function(e) {
e.preventDefault();
e.stopPropagation();
$(this).parent().remove();
});
//图片删除,已有的则调用接口删除
_doc.on('click', '.span-del2', function(e) {
var _this = $(this);
e.preventDefault();
e.stopPropagation();
if(confirm('确认删除吗?')){
_this.parent().remove();
that.spandelList(_this.prev().attr('data-imgid'));
};
});
//保存上传的图片
_doc.on('click', '#saveBtn', function(e) {
var _this = $(this);
e.preventDefault();
e.stopPropagation();
var imgname = [];
for(var i = 0; i < $('.result').length; i++) {
imgname[i] = $('.result>img').eq(i).attr('data-imgname');
};
console.log(imgname.join(','));
var id_pic = that.house_fatherid > 0?that.house_fatherid:that.house_id;
var _data = {
img_id: id_pic
};
//无新的图片上传 不调用接口
if(imgname.join(',')) {
_data['img_name'] = imgname.join(',');
} else {
return
};
$.ajax({
type: 'GET',
url: '/index/addReceiptImg',
data: _data,
dataType: 'json',
beforeSend: function() {},
success: function(_data) {
if(typeof _data === 'object') {
alert('保存成功');
$('#container_body_img_area').html("");
$('.pic-con2').show();
$('.pic-con1').hide();
$('.active').removeClass("active");
$('.shoukuanxiangqing').addClass("active");
that.getList(0);
} else {
alert('数据错误');
};
},
error: function() {
alert('enter error');
},
complete: function(xhr, textStatus) {
if(textStatus === 'timeout') {
//处理超时的逻辑
alert('请求超时,请重试');
};
}
});
});
//操作----时间轴 //操作----时间轴
$(document).on('click','.timeline',function(e){ $(document).on('click','.timeline',function(e){
...@@ -38,6 +156,7 @@ define(['doT', 'text!temp/receivables_template_tpl.html', 'css!style/home.css', ...@@ -38,6 +156,7 @@ define(['doT', 'text!temp/receivables_template_tpl.html', 'css!style/home.css',
$(document).on('click','.add-pic',function(e){ $(document).on('click','.add-pic',function(e){
var id = e.target.dataset.id; var id = e.target.dataset.id;
that.getMoneyDetail(id); that.getMoneyDetail(id);
that.house_fatherid = id;
console.log(id) console.log(id)
}); });
//操作---调整 //操作---调整
...@@ -94,6 +213,8 @@ define(['doT', 'text!temp/receivables_template_tpl.html', 'css!style/home.css', ...@@ -94,6 +213,8 @@ define(['doT', 'text!temp/receivables_template_tpl.html', 'css!style/home.css',
}); });
//调整 //调整
$("#modal-linetime").on("shown.bs.modal", function(event){ $("#modal-linetime").on("shown.bs.modal", function(event){
//初始化...
//initMoadalData //initMoadalData
that.change_show_hide($('#change_type option:selected').text()); that.change_show_hide($('#change_type option:selected').text());
...@@ -172,6 +293,23 @@ define(['doT', 'text!temp/receivables_template_tpl.html', 'css!style/home.css', ...@@ -172,6 +293,23 @@ define(['doT', 'text!temp/receivables_template_tpl.html', 'css!style/home.css',
}); });
}, },
spandelList: function(n) { //删除已经保存的图片都调用
$.ajax({
'type': 'POST',
'url': '/index/deleteReceiptImg',
data: {
id: n
},
dataType: "json",
success: function(data) {
if(data.code == 200) {
} else {}
}
});
},
//将li里的值 赋给input(分佣方姓名) //将li里的值 赋给input(分佣方姓名)
reportIdBuild: function(obj) {//新增客户 input赋值 reportIdBuild: function(obj) {//新增客户 input赋值
var that = receiv ; var that = receiv ;
......
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