Commit 4a010f4d authored by agping's avatar agping

独家附件 上传

parent 2140ccdb
...@@ -36,6 +36,8 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin ...@@ -36,6 +36,8 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin
is_exclusive_type : 0 , //0非独家 1:独家 is_exclusive_type : 0 , //0非独家 1:独家
auth_edit_exclusive : 0 ,//0:无独家权限 1:有独家权限 auth_edit_exclusive : 0 ,//0:无独家权限 1:有独家权限
main_select : false , // true : 开启高级搜索 ,false :关闭高级搜索 main_select : false , // true : 开启高级搜索 ,false :关闭高级搜索
file_id_str:'',
file_id_arr:[],
init: function() { init: function() {
//初始化dot //初始化dot
...@@ -477,7 +479,21 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin ...@@ -477,7 +479,21 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin
checkLogin(); checkLogin();
business.getFollowupList(); business.getFollowupList();
}); });
//独家 附件上传删除键事件
_doc.on('click', '.delet-pic-btn', function(e) {
var _this = $(this);
e.preventDefault();
e.stopPropagation();
if(confirm('确定删除该文件吗?')) {
var file_id= $(this).parent('li').attr('id')*1;
if(file_id){
business.file_id_arr.push(file_id);
business.file_id_str = business.file_id_arr.join(',');
}
_this.parent().remove();
};
});
//点击商铺跟进保存按钮,保存数据的接口 //点击商铺跟进保存按钮,保存数据的接口
_doc.on('click', '#modal_followup_submit_btn', function(e){ _doc.on('click', '#modal_followup_submit_btn', function(e){
e.preventDefault(); e.preventDefault();
...@@ -581,6 +597,8 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin ...@@ -581,6 +597,8 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin
}); });
}, },
Dujia: function() { //获取独家的信息 Dujia: function() { //获取独家的信息
business.file_id_arr=[];//置空删除附件id
business.file_id_str='';//置空删除的id
$("#modal-dujia").removeClass("yz"); $("#modal-dujia").removeClass("yz");
$.ajax({ $.ajax({
'type': 'GET', 'type': 'GET',
...@@ -623,14 +641,15 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin ...@@ -623,14 +641,15 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin
$('.is_dujia').find('input').removeAttr("readonly"); $('.is_dujia').find('input').removeAttr("readonly");
} }
}; };
var _data={}; var _data=data.data;
$('#fujian_ul').html('');
//获取附件 对接口 //获取附件 对接口
var file_paths = _data['exclusive_file']; var file_paths = _data['exclusive_file'];
if(file_paths){ if(file_paths){
for ( var i = 0 ; i < file_paths.length ; i++ ){ for ( var i = 0 ; i < file_paths.length ; i++ ){
console.log(file_paths[i]['file_name']) console.log(file_paths[i]['file_name'])
var _tempArr = file_paths[i]['file_name'].split('/'); var _tempArr = file_paths[i]['file_name'].split('/');
file_paths[i]['file_name'] && $('#fujian_ul').append('<li class="pdf-pre-li" id='+file_paths[i]['file_id'] +'><a class="pdf-pre-a" download="{1}" href="{0}" title="点击可下载">{1}</a><a href="javascript:;" class="delet-pic-btn">删除</a></li>'.stringFormatObj({ file_paths[i]['file_name'] && $('#fujian_ul').append('<li class="pdf-pre-li" id='+file_paths[i]['id'] +'><a class="pdf-pre-a" download="{1}" href="{0}" title="点击可下载">{1}</a><a href="javascript:;" class="delet-pic-btn">删除</a></li>'.stringFormatObj({
'0': '/' + file_paths[i]['show_file'], '0': '/' + file_paths[i]['show_file'],
'1': dealFileName(decodeURI(_tempArr[_tempArr.length-1])) '1': dealFileName(decodeURI(_tempArr[_tempArr.length-1]))
})); }));
...@@ -668,11 +687,14 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin ...@@ -668,11 +687,14 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin
var _fujianObj = $('#fujian_ul').find('li>a.pdf-pre-a'); //附件看的是删除按钮的个数 var _fujianObj = $('#fujian_ul').find('li>a.pdf-pre-a'); //附件看的是删除按钮的个数
if ( _fujianObj.length > 0 ){ //判断附件存在,同时,附件可能存在0到5个 if ( _fujianObj.length > 0 ){ //判断附件存在,同时,附件可能存在0到5个
for ( var i= 0 ; i < _fujianObj.length ; i++ ){ for ( var i= 0 ; i < _fujianObj.length ; i++ ){
var one_name = _fujianObj[i].getAttribute('data-filename'); //附件取得是data-filename var one_name = _fujianObj[i].getAttribute('data-filename');
//附件取得是data-filename
if(one_name){
_data[i] = one_name; _data[i] = one_name;
} }
}
}
}
var exclusive_file_str= _data.join(','); var exclusive_file_str= _data.join(',');
console.log($("#sel_dujia").val()); console.log($("#sel_dujia").val());
...@@ -721,7 +743,8 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin ...@@ -721,7 +743,8 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin
"agent_start_time": $("#start_date_dujia").val(), //开始时间 "agent_start_time": $("#start_date_dujia").val(), //开始时间
"agent_end_time": $("#end_date_dujia").val(), //结束时间 "agent_end_time": $("#end_date_dujia").val(), //结束时间
"exclusive_img": images ,//独家图片 "exclusive_img": images ,//独家图片
"exclusive_file": exclusive_file_str //独家附件 "exclusive_file": exclusive_file_str, //独家附件
"del_file_id": business.file_id_str //独家附件
}, },
dataType: "json", dataType: "json",
......
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