Commit bf2c6bef authored by stone's avatar stone

[feat]付款申请履历打印

parent fd49f28f
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true" trace="true">
<a:init-procedure>
<a:model-query model="cont.CON620.get_sys_role" rootPath="role_info"/>
</a:init-procedure>
<a:view>
<a:link id="csh_payment_req_create_link" url="${/request/@context_path}/modules/csh/CSH501/csh_payment_req_selected.lview"/>
<a:link id="csh_payment_req_history_print_link_id" url="${/request/@context_path}/modules/csh/CSH501/csh_payment_req_history_print.lsc"/>
<a:link id="get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<a:link id="tre_loan_contact_cancel_change_link_id" model="lon.LON120.tre_loan_change_cancel" modelaction="update"/>
<a:link id="csh501_csh_payment_req_link1_id" url="${/request/@context_path}/modules/csh/CSH501/csh_payment_req.lview"/>
<a:link id="delete_payment_req_link_id" model="csh.CSH501.delete_payment_req" modelaction="batch_update"/>
<script type="text/javascript"><![CDATA[
//新增
Leaf.onReady(function(){
//付款打印按钮只有会计担当和会计部长可见
if("${/model/role_info/record/@role_code}"!="0013"&&"${/model/role_info/record/@role_code}"!="0014"&&"${/model/role_info/record/@role_code}"!="HAND") {
//$('${/parameter/@layout_code}_user_button5').style.display='none';
Ext.fly('${/parameter/@layout_code}_user_button5').dom.style.display="none";
}else{
//$('${/parameter/@layout_code}_user_button1').style.display='none';
Ext.fly('${/parameter/@layout_code}_user_button1').dom.style.display="none";
}
})
window['${/parameter/@layout_code}_user_button5_layout_dynamic_click'] = function() {
var ds_id = '${/parameter/@layout_code}_G_CSH_REQ_2_csh_payment_req_hd_ds';
var records = $(ds_id).getSelected();
if(records.length !=1){
$L.showInfoMessage("提示",'只有审批通过的付款申请才能打印,且一次只能打印一个付款申请!');
return;
}
//获取该付款申请的头id
var payment_req_id=records[0].get('payment_req_id');
var payment_status=records[0].get('approval_status');
if(payment_status!="APPROVED"){
$L.showInfoMessage("提示",'只有审批通过的付款申请才能打印,且一次只能打印一个付款申请!');
return;
}
var url_l = $('csh_payment_req_history_print_link_id').getUrl() + '?document_id=' + payment_req_id + '&document_table=CSH_PAYMENT_APPROVE&file_path=${/parameter/@file_path}&batch_flag=Y&source_type=COMMON';
window.open(href = url_l, target = "_self");
}
//新增
window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd');
var url = $('csh_payment_req_create_link').getUrl();
......
......@@ -453,7 +453,6 @@
var templet_code = 'CSH_PAYMENT_REQ';
// 根据不同的厂商调用不用的模板
console.log(hd_record.get('vender_name').indexOf('永立'));
if(hd_record.get('vender_name').indexOf('永立')>=0){
var url_l = $('csh_payment_req_word_print_link_id').getUrl() + '?document_id=' + hd_record.get('payment_req_id') + '&document_table=CSH_PAYMENT_REQ_YL&file_path=${/parameter/@file_path}&batch_flag=Y&source_type=COMMON';
}else{
......
......@@ -4,6 +4,7 @@
<a:model-update model="hls.HLS811.hls_doc_file_templet_get_atm"/>
<s:server-script import="con_print_path.js"><![CDATA[
importPackage(Packages.hls.plugin.docx4j);
importPackage(Packages.com.hand.hls.hlcm.util);
importPackage(java.io);
function copyFile(fOld, fNew) {
......@@ -76,10 +77,16 @@
});
try {
$bm('csh.CSH501.csh_transaction_return_print').update({
document_id: $ctx.parameter.document_id,
document_table: $ctx.parameter.document_table
});
var brwt = new BookmarksReplaceWithText($instance('leaf.database.service.IDatabaseServiceFactory'), $instance('uncertain.ocm.IObjectRegistry'), $ctx.getData());
brwt.replaceBookmarkFromContent(to_file_path.toString(), record_data.content_id.toString(), 'COMMON');
download_file(to_file_name, to_file_path);
var resp = $ctx['_instance.javax.servlet.http.HttpServletResponse'];
HlsFileUtil.downloadFile(encodeURI(to_file_path,'utf-8'),encodeURI(to_file_name,'utf-8'),resp);
// download_file(encodeURI(to_file_name,'utf-8'), to_file_path);
// print(to_file_name);
} catch (e) {
raise_app_error(e);
}
......
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