Commit d039b176 authored by 18083's avatar 18083

凭证流程附件配置及调整

parent aa27bb8d
......@@ -11,6 +11,8 @@
</a:init-procedure>
<a:view>
<a:link id="save_detail_link" model="inv.inv100.payment_detail_save" modelaction="update"/>
<a:link id="journal_uploadFile_id" url="${/request/@context_path}/uploadFile.lview"/>
<a:link id="journal_downloadFile_id" url="${/request/@context_path}/downloadFile.lview"/>
<script type="text/javascript"><![CDATA[
//自定义保存
window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
......@@ -41,6 +43,62 @@
scope: this
});
};
function upload_voucher_file(id,name,record_id,item_code) {
var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name];
if (item_code=='INVOICE') {
var url = $('journal_uploadFile_id').getUrl() + '?table_name=INVOICE&header_id=' + record_id;
}else if(item_code=='PAYMENT_REQUEST_LETTER'){
var url = $('journal_uploadFile_id').getUrl() + '?table_name=PAYMENT_REQUEST_LETTER&header_id=' + record_id;
}else if(item_code=='OTHERS'){
var url = $('journal_uploadFile_id').getUrl() + '?table_name=OTHERS&header_id=' + record_id;
}else if(item_code=='PAYMENT_APPROVAL_PROCESS'){
var url = $('journal_uploadFile_id').getUrl() + '?table_name=PAYMENT_APPROVAL_PROCESS&header_id=' + record_id;
}else if(item_code=='SBO_JOURNAL_PDF'){
var url = $('journal_uploadFile_id').getUrl() + '?table_name=SBO_JOURNAL_PDF&header_id=' + record_id;
}
var win = new Leaf.Window({
url: url,
title: '${l:HLS.SUPPORTING_DOCUMENT}',
id: 'csh_attachment_uploadFile_id',
width: 850,
height: 400
});
win.on('close', function () {
record.ds.query();
});
}
window['${/parameter/@layout_code}_dynamic_link_renderer'] = function (value, record, name, config_record, bp_seq) {
window['${/parameter/@layout_code}_hls_link_render_record'][record.id + '---' + name] = record;
if (name == 'attachment'){
return '<a href=javascript:upload_voucher_file(\''+record.id+'\',\''+ name + '\',\'' +record.get('journal_header_id')+'\',\'' + record.get('item_code')+'\')>附件上传</a>';
} else if (name == 'attach_file_name') {
if (value != null) {
var link = '${/request/@context_path}/atm_download.lsc?attachment_id=';
var str = value.split(';;');
var url = '';
for (var i = 0; i < str.length; i++) {
var temp = str[i].split('--');
if (!Leaf.isEmpty(temp[0])) {
var file_name = temp[0].toUpperCase();
var file_suffix = temp[0].substr(temp[0].lastIndexOf('.') + 1).toUpperCase();
if (file_name.indexOf('.PDF') >= 0) {
url = url + '<a href=javascript:view_pdf(\'' + temp[1] + '\')>' + temp[0] + '</a>' + ',';
} else if (file_suffix == 'BMP' || file_suffix == 'JPG' || file_suffix == 'JPEG' || file_suffix == 'PNG' || file_suffix == 'GIF') {
url = url + '<a href=' + link + temp[1] + ' ref="img">' + temp[0] + '</a>' + ',';
} else {
url = url + '<a href=' + link + temp[1] + '>' + temp[0] + '</a>' + ',';
}
}
}
return url;
}
}
};
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
</a:view>
......
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