Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
leaf-hlcm
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hlcm
leaf-hlcm
Commits
8a5a33bc
Commit
8a5a33bc
authored
Jan 09, 2020
by
stone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fix]修改付款申请书为文本打印
parent
1766ff4f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
109 additions
and
14 deletions
+109
-14
contract_print_entrance_g_contract_result_queryfields.js
.../contract_print_entrance_g_contract_result_queryfields.js
+4
-4
csh_payment_req.lview
src/main/webapp/modules/csh/CSH501/csh_payment_req.lview
+15
-10
csh_payment_req_word_print.lsc
.../webapp/modules/csh/CSH501/csh_payment_req_word_print.lsc
+90
-0
No files found.
src/main/webapp/WEB-INF/server-script/layoutconfig/contract_print_entrance_g_contract_result_queryfields.js
View file @
8a5a33bc
...
...
@@ -4,10 +4,10 @@ var add_datafilters = [
name
:
'document_type'
,
expression
:
"t1.document_type = 'CARCON'"
},
//
{
//
name:'contract_status',
// expression:"t1.contract_status ='NEW'
"
//
},
{
name
:
'contract_status'
,
expression
:
"t1.contract_status not in ('CLOSED','CANCEL')
"
},
{
name
:
'sign_contract_status'
,
expression
:
"t1.sign_contract_status in ('NEW','SIGNING','SIGN','SIGN_RETURN')"
...
...
src/main/webapp/modules/csh/CSH501/csh_payment_req.lview
View file @
8a5a33bc
...
...
@@ -25,6 +25,8 @@
<a:model-query
fetchAll=
"true"
model=
"csh.CSH501.get_loan_flag"
rootPath=
"loan_flag_path"
/>
</a:init-procedure>
<a:view>
<a:link
id=
"csh_payment_req_word_print_link_id"
url=
"${/request/@context_path}/modules/csh/CSH501/csh_payment_req_word_print.lsc"
/>
<a:link
id=
"cont811_con_sale_contract_info_print_link"
url=
"${/request/@context_path}/modules/csh/CSH501/payment_req_apply_print.lview"
/>
<a:link
id=
"csh_req_ddct_link"
...
...
@@ -96,6 +98,7 @@
return false;
}
}
return true;
} else return true;
// }
});
...
...
@@ -448,16 +451,18 @@
/* url = $('tre_loan_con_print_excel_link_id').getUrl() + '?payment_req_id=' +hd_record.get('payment_req_id');
window.open(href = url);*/
var template_name = 'payment_apply_content.xml';
var file_name = '付款请求书打印.doc';
var url = $('cont811_con_sale_contract_info_print_link').getUrl() + '?template_name=' + template_name + '&payment_req_id=' + hd_record.get('payment_req_id') + '&file_name=' + encodeURI(file_name);
window.location.href =url;
/* var templet_code = 'CSH_PAYMENT_REQ_TEST';
var url = $('assignment_agreement_print_link').getUrl() + '?payment_req_id=' + hd_record.get('payment_req_id') + '&templet_code=' + templet_code;
window.open(url, '_self');*/
/* var templet_code = 'CSH_PAYMENT_REQ';
url = $('assignment_agreement_print_link').getUrl() + '?payment_req_id=' + hd_record.get('payment_req_id') + '&templet_code=' + templet_code;
window.open(url, '_self');*/
var templet_code = 'CSH_PAYMENT_REQ';
// var document_id = record.get('ast_car_insurance_records_id');
console.log("${/parameter/@file_path}");
var url_l = $('csh_payment_req_word_print_link_id').getUrl() + '?document_id=' + hd_record.get('payment_req_id') + '&document_table=CSH_PAYMENT_REQ&file_path=${/parameter/@file_path}&batch_flag=Y&source_type=COMMON';
window.open(href = url_l, target = "_self");
// var template_name = 'payment_apply_content.xml';
// var file_name = '付款请求书打印.doc';
// var url = $('cont811_con_sale_contract_info_print_link').getUrl() + '?template_name=' + template_name + '&payment_req_id=' + hd_record.get('payment_req_id') + '&file_name=' + encodeURI(file_name);
// window.location.href =url;
}
...
...
src/main/webapp/modules/csh/CSH501/csh_payment_req_word_print.lsc
0 → 100644
View file @
8a5a33bc
<?xml version="1.0" encoding="UTF-8"?>
<a:service
xmlns:a=
"http://www.leaf-framework.org/application"
xmlns:s=
"leaf.plugin.script"
trace=
"true"
>
<a:init-procedure>
<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(java.io);
function copyFile(fOld, fNew) {
var fis = new java.io.FileInputStream(fOld);
var fos = new java.io.FileOutputStream(fNew);
var b = new java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 1024 * 4);
var len = -1;
while ((len = fis.read(b)) != -1) {
fos.write(b, 0, len);
}
fis.close();
fos.close();
}
function transfer(file_path, os) {
println(file_path);
var fis = new FileInputStream(file_path);
var b = new java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 1024 * 64);
var len = -1;
while ((len = fis.read(b)) != -1) {
os.write(b, 0, len);
}
fis.close();
}
function download_file(file_name, file_path) {
$ctx["__request_type__"] = 'file'; //to indicate this request is not a JSON_REQUEST
var resp = $ctx['_instance.javax.servlet.http.HttpServletResponse'];
resp.setHeader("Pragma", "No-cache");
resp.setHeader("Cache-Control", "no-cache, must-revalidate");
resp.setDateHeader("Expires", 0);
resp.setContentType("application/x-msdownload");
resp.setHeader("Content-disposition", "attachment; filename=" + encodeURI(file_name, 'UTF-8'));
var os = resp.getOutputStream();
transfer(file_path, os);
os.flush();
}
var attachment_batch_dl = $bm('hls.HLS811.hls_doc_file_templet_get_atm');
var result = attachment_batch_dl.queryAsMap({
document_id: $ctx.parameter.document_id,
document_table: $ctx.parameter.document_table,
batch_flag: $ctx.parameter.batch_flag,
content_id: $ctx.parameter.content_id
});
var from_file_data = result.getChildren();
for (var i = 0;i < from_file_data.length;i++) {
if (!$ctx.parameter.file_path) {
set_parameter_file_path();
}
var to_file_path = $ctx.parameter.file_path;
var record_data = from_file_data[i];
// if (record_data.file_exists_flag != 'Y') {
var to_file_name = record_data.to_file_name;
var from_file_path = record_data.file_path;
var guid_file_name_path = $bm('cont.CON500.con_contract_get_guid_file_name').queryAsMap();
var guid_file_name_tables = guid_file_name_path.getChildren();
to_file_path = to_file_path + guid_file_name_tables[0].guid_file_name + 'doc' + record_data.content_id;
copyFile(from_file_path, to_file_path);
$bm('hls.HLS811.hls_file_content_copy_update').update({
table_name: 'HLS_DOC_FILE_CONTENT',
content_id: record_data.content_id,
file_name: to_file_name.toString(),
file_path: to_file_path.toString(),
source_type: $ctx.parameter.source_type
});
try {
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);
} catch (e) {
raise_app_error(e);
}
}
]]>
</s:server-script>
</a:init-procedure>
</a:service>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment