Commit 121b63c5 authored by taoruidan18083's avatar taoruidan18083

I-21941 【建机】系统合同结束工作流优化

parent 165bc313
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: trd
$Date: 2025-07-22 下午5:06:06
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="delete">
<bm:update-sql><![CDATA[
begin
con_contract_content_pkg.delete_cashflow_download_temp(p_session_id => ${/session/@session_id});
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="insert">
<bm:update-sql><![CDATA[
begin
con_contract_content_pkg.cashflow_download_create(
p_session_id =>${/session/@session_id},
p_contract_id =>${@contract_id}
);
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT m.table_name,
m.table_pk_value,
m.record_id,
fa.attachment_id,
fa.file_name,
fa.file_path
FROM fnd_atm_attachment fa,
fnd_atm_attachment_multi m,
CUX_CONTRACT_PRINT t,
con_contract_rent_temp tp
WHERE m.attachment_id = fa.attachment_id
AND fa.source_type_code = 'fnd_atm_attachment_multi'
AND fa.source_pk_value = m.record_id
AND m.table_name = 'CUX_CONTRACT_PRINT'
AND m.table_pk_value = t.print_id
and t.print_id = tp.print_id
and tp.session_id = ${/session/@session_id}
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="table_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TABLE_NAME" required="true"/>
<bm:field name="table_pk_value" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TABLE_PK_VALUE" required="true"/>
<bm:field name="record_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="RECORD_ID" required="true"/>
<bm:field name="attachment_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="ATTACHMENT_ID" required="true"/>
<bm:field name="file_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FILE_NAME"/>
<bm:field name="file_path" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FILE_PATH"/>
</bm:fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: gaoyang
$Date: 2015-6-10 下午03:17:55
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT faa.file_name,
faa.file_path,
faa.file_type_code,
cc.document_id contract_id,
(SELECT c.contract_status
FROM con_contract c
WHERE c.contract_id = cc.document_id) contract_status,
(SELECT hbm.bp_name
FROM con_contract c,hls_bp_master hbm
WHERE c.bp_id_tenant = hbm.bp_id
and c.contract_id = cc.document_id) bp_id_tenant_n,
'所有权转移通知书(' ||
(SELECT c.contract_number
FROM con_contract c
WHERE c.contract_id = cc.document_id) || '_' ||
(SELECT hbm.bp_name
FROM con_contract c,hls_bp_master hbm
WHERE c.bp_id_tenant = hbm.bp_id
and c.contract_id = cc.document_id) || ')' down_file_name,
faa.file_name to_file_name,
(SELECT 'Y'
FROM fnd_atm_attachment_multi m1
WHERE m1.table_name = 'HLS_DOC_FILE_CONTENT'
AND m1.table_pk_value = cc.content_id) file_exists_flag,
cc.content_id,
(SELECT cct.templet_code
FROM con_clause_templet cct
WHERE cct.templet_id = cc.templet_id) templet_code,
faa.attachment_id
FROM fnd_atm_attachment faa,
fnd_atm_attachment_multi m,
hls_doc_file_templet lt,
con_clause_templet t,
hls_doc_file_content cc,
contract_cashflow_load_temp clt
WHERE faa.attachment_id = m.attachment_id
AND m.table_name = 'HLS_DOC_FILE_TEMPLET'
AND m.table_pk_value = lt.templet_id
AND lt.templet_id = t.doc_template_id
AND t.doc_plugin_flag = 'Y'
AND t.templet_id = cc.templet_id
and clt.contract_id = cc.document_id
and (((SELECT c.contract_status
FROM con_contract c
WHERE c.contract_id = cc.document_id) in
('TERMINATE', 'ET', 'INCEPT', 'ETING', 'TERMINATING') and
cc.document_table = 'CON_CONTRACT_FINISH_LEASE') or
((SELECT c.contract_status
FROM con_contract c
WHERE c.contract_id = cc.document_id) in ('REPUR', 'REPURING') and
cc.document_table = 'CON_CONTRACT_FINISH_REPUR'))
and clt.session_id=${/session/@session_id}
]]></bm:query-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
hls_doc_file_templet_pkg.init_hls_doc_file_content(
p_document_id =>${@document_id},
p_document_table =>${@document_table},
p_user_id =>nvl(${/session/@user_id},${/parameter/@user_id}));
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="file_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FILE_NAME"/>
<bm:field name="down_file_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOWN_FILE_NAME"/>
<bm:field name="file_path" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FILE_PATH"/>
<bm:field name="file_type_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FILE_TYPE_CODE"/>
<bm:field name="file_exists_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FILE_EXISTS_FLAG"/>
<bm:field name="to_file_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TO_FILE_NAME"/>
<bm:field name="content_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONTENT_ID"/>
<bm:field name="attachment_id" databaseType="NUMBER" datatype="java.lang.Long"/>
<bm:field name="bp_id_tenant_n" databaseType="VARCHAR2" datatype="java.lang.String"/>
<bm:field name="contract_status" databaseType="VARCHAR2" datatype="java.lang.String"/>
<bm:field name="contract_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONTRACT_ID"/>
</bm:fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select t.contract_id,
cc.contract_number,
cc.contract_status,
(select hbm.bp_name
from hls_bp_master hbm
where hbm.bp_id = cc.bp_id_tenant) tenant_name
from contract_cashflow_load_temp t, con_contract cc
where t.contract_id = cc.contract_id
and t.session_id = ${/session/@session_id}
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="tenant_name"/>
<bm:field name="contract_number"/>
<bm:field name="contract_status"/>
<bm:field name="contract_id"/>
</bm:fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: gzj
$Date: 2022年12月8日 17:13:08
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select t.file_name,
to_char(t.print_date,'yyyy-mm-dd hh24:mi:ss') print_date,
t.print_id,
(SELECT su.description FROM sys_user su WHERE su.user_id = t.created_by) print_user
from cux_contract_print t
where (((SELECT e.role_code
FROM sys_role_vl e
WHERE e.role_id = ${/session/@role_id}) in ('0018', '0019')
and t.created_by = ${/session/@user_id})
or (SELECT e.role_code
FROM sys_role_vl e
WHERE e.role_id = ${/session/@role_id}) not in
('0018', '0019'))
and t.contract_id = ${@contract_id}
and t.lease_type = '10'
order by t.print_date desc
]]></bm:query-sql>
</bm:operation>
</bm:operations>
</bm:model>
......@@ -37,7 +37,7 @@
<!--<bm:field name="bp_vender" expression="(select bp_name from hls_bp_master where bp_id=t1.bp_id_vender and enabled_flag=&apos;Y&apos;)" forInsert="false" forUpdate="false"/>-->
<bm:field name="lease_organization_desc" expression="(select description from hls_lease_organization where lease_organization = t1.lease_organization)" forInsert="false" forUpdate="false"/>
<!--<bm:field name="owner_user_id_n" expression="(select description from sys_user where user_id = t1.created_by)" forInsert="false" forUpdate="false"/>-->
<bm:field name="is_terminate" expression="(CASE WHEN ((select sum(ccc.due_amount) from con_contract_cashflow ccc where ccc.contract_id = t1.contract_id AND ccc.cf_status&lt;&gt;&apos;BLOCK&apos; and ccc.cf_item not in(0,40,911)) - (select sum(ccc.received_amount) from con_contract_cashflow ccc where ccc.contract_id = t1.contract_id AND ccc.cf_status&lt;&gt;&apos;BLOCK&apos; and ccc.cf_item not in(0,40,911))) = 0 THEN &apos;是&apos; ELSE &apos;否&apos; END)" forInsert="false" forUpdate="false"/>
<bm:field name="is_terminate" expression="(CASE WHEN ((select sum(ccc.due_amount) from con_contract_cashflow ccc where ccc.contract_id = t1.contract_id AND ccc.cf_status&lt;&gt;&apos;BLOCK&apos; and ccc.cf_item not in(0,40,911,9)) - (select sum(ccc.received_amount) from con_contract_cashflow ccc where ccc.contract_id = t1.contract_id AND ccc.cf_status&lt;&gt;&apos;BLOCK&apos; and ccc.cf_item not in(0,40,911,9))) = 0 THEN &apos;是&apos; ELSE &apos;否&apos; END)" forInsert="false" forUpdate="false"/>
<bm:field name="amount_total" expression="(select sum(ccc.due_amount) from con_contract_cashflow ccc where ccc.contract_id=t1.contract_id and ccc.cf_status&lt;&gt;&apos;BLOCK&apos; and ccc.cf_item=1)" forInsert="false" forUpdate="false"/>
<bm:field name="amount_principal" expression="(select sum(nvl(ccc.principal,0)) from con_contract_cashflow ccc where ccc.contract_id=t1.contract_id and ccc.cf_status&lt;&gt;&apos;BLOCK&apos;)" forInsert="false" forUpdate="false"/>
<bm:field name="amount_interest" expression="(select sum(nvl(ccc.interest,0)) from con_contract_cashflow ccc where ccc.contract_id=t1.contract_id and ccc.cf_status&lt;&gt;&apos;BLOCK&apos; and cf_item=1)" forInsert="false" forUpdate="false"/>
......@@ -46,6 +46,9 @@
<bm:field name="bp_id_agent_desc"/>
<bm:field name="business_type_n"/>
<bm:field name="division_n"/>
<bm:field name="is_sbo_zero" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="IS_SBO_ZERO" prompt="CON_CONTRACT.IS_SBO_ZERO"/>
<bm:field name="is_sbo_zero_desc"/>
<bm:field name="amount_unreceived_penalty" forInsert="false" forUpdate="false"/>
</bm:fields>
<bm:features>
<f:standard-who/>
......@@ -77,6 +80,9 @@
<!-- <bm:query-field field="lease_organization" queryOperator="="/>-->
<bm:query-field field="contract_status" queryOperator="="/>
<bm:query-field field="bp_id_agent_desc" queryExpression="bp_id_agent_desc like upper(&apos;%&apos;||${@bp_id_agent_desc}||&apos;%&apos;)"/>
<bm:query-field name="amount_unreceived_penalty_from" queryExpression="t1.amount_unreceived_penalty &gt;= ${@amount_unreceived_penalty_from}"/>
<bm:query-field name="amount_unreceived_penalty_to" queryExpression="t1.amount_unreceived_penalty &lt;= ${@amount_unreceived_penalty_to}"/>
<bm:query-field field="is_sbo_zero" queryOperator="="/>
</bm:query-fields>
<bm:data-filters>
<bm:field name="is_terminate" expression="((t1.contract_status not in('REPURING') and (SELECT ccc.write_off_flag from con_contract_cashflow ccc WHERE ccc.contract_id=t1.contract_id AND ccc.cf_item=8 AND ccc.cf_status=&apos;RELEASE&apos;)=&apos;FULL&apos;)or(t1.contract_status='REPURING'))"/>
......
......@@ -36,7 +36,7 @@
<!--<bm:field name="bp_vender" expression="(select bp_name from hls_bp_master where bp_id=t1.bp_id_vender and enabled_flag=&apos;Y&apos;)" forInsert="false" forUpdate="false"/>-->
<bm:field name="lease_organization_desc" expression="(select description from hls_lease_organization where lease_organization = t1.lease_organization)" forInsert="false" forUpdate="false"/>
<!--<bm:field name="owner_user_id_n" expression="(select description from sys_user where user_id = t1.created_by)" forInsert="false" forUpdate="false"/>-->
<bm:field name="is_terminate" expression="(CASE WHEN ((select sum(ccc.due_amount) from con_contract_cashflow ccc where ccc.contract_id = t1.contract_id AND ccc.cf_status&lt;&gt;&apos;BLOCK&apos; and ccc.cf_item&lt;&gt;0) - (select sum(ccc.received_amount) from con_contract_cashflow ccc where ccc.contract_id = t1.contract_id AND ccc.cf_status&lt;&gt;&apos;BLOCK&apos; and ccc.cf_item&lt;&gt;0)) = 0 THEN &apos;是&apos; ELSE &apos;否&apos; END)" forInsert="false" forUpdate="false"/>
<bm:field name="is_terminate" expression="(CASE WHEN ((select sum(ccc.due_amount) from con_contract_cashflow ccc where ccc.contract_id = t1.contract_id AND ccc.cf_status&lt;&gt;&apos;BLOCK&apos; and ccc.cf_item not in(0,40,911,9)) - (select sum(ccc.received_amount) from con_contract_cashflow ccc where ccc.contract_id = t1.contract_id AND ccc.cf_status&lt;&gt;&apos;BLOCK&apos; and ccc.cf_item not in(0,40,911,9))) = 0 THEN &apos;是&apos; ELSE &apos;否&apos; END)" forInsert="false" forUpdate="false"/>
<bm:field name="bp_id_agent_desc"/>
<bm:field name="business_type_n"/>
<bm:field name="division_n"/>
......@@ -45,6 +45,12 @@
<bm:field name="amount_interest" expression="(select sum(nvl(ccc.interest,0)) from con_contract_cashflow ccc where ccc.contract_id=t1.contract_id and ccc.cf_status&lt;&gt;&apos;BLOCK&apos; and cf_item=1)" forInsert="false" forUpdate="false"/>
<bm:field name="amount_received_interest" expression="(select sum(nvl(ccc.received_interest,0)) from con_contract_cashflow ccc where ccc.contract_id=t1.contract_id and ccc.cf_status&lt;&gt;&apos;BLOCK&apos; and cf_item=1)" forInsert="false" forUpdate="false"/>
<bm:field name="amount_received_penalty" expression="(nvl((select sum(nvl(ccc.received_amount,0)) from con_contract_cashflow ccc where ccc.contract_id=t1.contract_id and ccc.cf_status&lt;&gt;&apos;BLOCK&apos; and ccc.cf_item=9),0))" forInsert="false" forUpdate="false"/>
<bm:field name="is_sbo_zero" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="IS_SBO_ZERO" prompt="CON_CONTRACT.IS_SBO_ZERO"/>
<bm:field name="is_sbo_zero_desc"/>
<bm:field name="sum_unreceived_penalty" databaseType="NUMBER" datatype="java.lang.Long" physicalName="SUM_UNRECEIVED_PENALTY" prompt="CON_CONTRACT.SUM_UNRECEIVED_PENALTY"/>
<bm:field name="breach_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BREACH_TYPE" prompt="CON_CONTRACT.BREACH_TYPE"/>
<bm:field name="breach_type_desc"/>
<bm:field name="backgroud_description"/>
</bm:fields>
<bm:features>
<f:standard-who/>
......@@ -53,6 +59,19 @@
<!--Packages.leaf.plugin.script.engine.ScriptImportor.defineExternScript(cx, this, $ctx.getData(), "aut_authority_bm_validate.js");-->
<!--]]></s:bm-script>-->
</bm:features>
<bm:operations>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
con_contract_closed_pkg.change_breach_type(p_contract_id =>${@contract_id} ,
p_breach_type =>${@breach_type},
p_backgroud_description =>${@backgroud_description},
p_user_id => ${session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
<bm:primary-key>
<bm:pk-field name="contract_id"/>
</bm:primary-key>
......
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="execute">
<bm:update-sql><![CDATA[
begin
con_contract_closed_pkg.update_contract_finish_zero(p_header_id =>${@header_id},
p_user_id =>${/session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
......@@ -59,6 +59,7 @@
update con_contract cc
set
cc.con_finish_batch_id = ${/parameter/@con_finish_batch_id},
cc.sum_unreceived_penalty=${@amount_unreceived_penalty},
cc.last_updated_by = ${/session/@user_id},
cc.last_update_date = sysdate
where cc.contract_id = ${@contract_id}
......
......@@ -13,7 +13,7 @@
p_table_pk_value =>${@content_id},
p_file_name =>${@file_name},
p_file_path =>${@file_path},
p_user_id =>${/session/@user_id},
p_user_id =>nvl(${/session/@user_id},${/parameter/@user_id}),
p_source_type =>nvl(${@source_type},'COMMON')
);
END;
......
function set_parameter_file_path(name) {
$ctx.parameter.file_path = '/u01/hls_file/excel/';
$ctx.parameter.file_path = 'D:/u01/hls_file/excel/';
};
function set_pdf_parameter_file_path(name) {
$ctx.parameter.file_path = 'D:/u01/hls_file/excel/';
......
<?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>
<s:server-script import="contract_print_path.js"><![CDATA[
importPackage(java.io);
importPackage(Packages.hls.plugin.docx4j);
importPackage(Packages.leaf.plugin.word2pdf);
importPackage(Packages.org.apache.commons.io);
importPackage(Packages.com.hand.kinggrid);
importPackage(Packages.com.hand.hl);
//删除文件
function deleteFile(filePath) {
var file = new File(filePath);
if (file.exists()) {
file.delete();
}
}
//生成pdf
function wordToPdf(word_file_path,pdf_file_path) {
// word转pdf
var pdf_file_path_new = pdf_file_path + '.pdf';
var wordToPdf = new WordToPdf($instance('uncertain.ocm.IObjectRegistry'), "jacob-1.19-x64.dll");
wordToPdf.word2pdf(word_file_path, pdf_file_path_new);
//删除word文件
//deleteFile(word_file_path);
return pdf_file_path_new;
}
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 write_os_to_file(file, os) {
var fis = new FileInputStream(file);
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 getDatePath() {
set_parameter_file_path();
var file_path = $ctx.parameter.pdf_path; //file_path = u01/hls_file/content_pdf/
var now = new Date()
y = now.getFullYear()
m = now.getMonth() + 1
m = m < 10 ? "0" + m : m
var datePath = file_path + y + "/" + m + "/";
return datePath; //datePath = u01/hls_file/content_pdf/2025/07/
}
//加盖金格章
function pdf_sign(pdf_file_path,datePath){
importPackage(Packages.com.hl.signatures);
importPackage(Packages.java.io);
importPackage(Packages.java.util);
var param = new ArrayList();
var paramdetail;
var con_signature_info = $bm('cont.CON620.get_con_signature_info').queryAsMap();
var con_signature_data = con_signature_info.getChildren();
var con_signature_record;
for (var i = 0;i < con_signature_data.length;i++) {
con_signature_record = con_signature_data[i];
if (con_signature_record.signature_code == 'gz_flag'){
paramdetail = '[{ "code":"' + con_signature_record.code +
'", "seal_code":"' + con_signature_record.seal_code +
'", "seal_width":' + con_signature_record.seal_width +
', "fontname":"' + con_signature_record.fontname +
'", "fontsize":"' + con_signature_record.fontsize +
'", "fontcolor":"' + con_signature_record.fontcolor +
'", "pageno":"' + con_signature_record.pageno +
'", "text":"' + con_signature_record.word_code + '"}]';
}
param.add(paramdetail);
}
var con_signature_info = $bm('cont.CON620.get_kinggrid_info').queryAsMap();
var con_kinggrid_data = con_signature_info.getChildren()[0];
var server_url = con_kinggrid_data.server_url;
var app_id = con_kinggrid_data.app_id;
var app_security = con_kinggrid_data.app_security;
var status = new com.hand.kinggrid.ContractSignaturesNew.hl_contract_signatures(pdf_file_path, 1,param.toArray(),server_url,app_id,app_security,datePath);
}
function collection_create_content() {
try {
var datePath = getDatePath();
FileUtils.forceMkdir(new File(datePath)); //根据日期创建目录
//清除批次打印表数据
$bm('cont.CON620.con_contract_rent_temp').execute();
var attachment_batch_dl = $bm('cont.CON301N.con_contract_file_templet_get_atm');
//根据批次表中数据循环生成
var con_contract_bm=$bm('cont.CON301N.con_contract_get_batch');
var con_contract_bm_query=con_contract_bm.queryAsMap();
var con_contract_records = con_contract_bm_query.getChildren();
for (var i = 0; i < con_contract_records.length; i++) {
var p_contract_id = con_contract_records[i].contract_id;
var p_contract_status = con_contract_records[i].contract_status;
var p_document_table;
if(p_contract_status=='TERMINATE'|| p_contract_status=='ET'||p_contract_status=='INCEPT'||p_contract_status=='ETING'||p_contract_status=='TERMINATING'){
p_document_table = 'CON_CONTRACT_FINISH_LEASE';
}else if(p_contract_status=='REPUR'||p_contract_status=='REPURING'){
p_document_table = 'CON_CONTRACT_FINISH_REPUR';
}
attachment_batch_dl.update({
document_id: p_contract_id,
document_table: p_document_table
});
}
var result = attachment_batch_dl.queryAsMap();
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];
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 = datePath + guid_file_name_tables[0].guid_file_name + 'doc' + record_data.content_id;
copyFile(from_file_path, to_file_path);
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');
} catch (e) {
raise_app_error(e);
}
// word转pdf
var pdf_file_path=to_file_path;
var outputfilepath = wordToPdf(to_file_path,pdf_file_path,datePath);
var now = new Date();
y = now.getFullYear();
m = now.getMonth() + 1;
m = m < 10 ? "0" + m : m;
d = now.getDate();
d = d < 10 ? "0" + d : d;
h = now.getHours();
h = h < 10 ? "0" + h : h;
mi = now.getMinutes();
mi = mi < 10 ? "0" + mi : mi;
var filename_str = record_data.down_file_name + y + m + d + h + mi + ".pdf";
var outputfilename= filename_str;
//合同状态为正常结清、提前结清、解约回购完成时加盖公章
if(record_data.contract_status=='TERMINATE'|| record_data.contract_status=='ET'||record_data.contract_status=='REPUR'){
pdf_sign(outputfilepath,datePath);
}
var pdf_file = new File(outputfilepath);
var file_size = 0;
if (pdf_file.exists()) {
file_size = pdf_file.length();
}
$bm('cont.CON301N.insert_into_attachment_bmp').update({
p_file_path :outputfilepath.toString(),
p_file_name :outputfilename.toString(),
p_file_size :file_size,
p_user_id :$ctx.session.user_id,
p_contract_id :record_data.contract_id,
p_file_type :'PDF',
p_lease_type :'10'
});
}
$ctx.parameter.return_status = 'S';
$ctx.parameter.return_message = '执行成功';
} catch (e) {
$ctx.success = "true";
$ctx.parameter.return_status = 'E';
$ctx.parameter.return_message = $ctx.get('/error/@message') || String(e);
raise_app_error(e);
}
var result = {
result: $ctx.parameter.return_status,
message: $ctx.parameter.return_message
};
$ctx.parameter.json = JSON.stringify(result);
}
if ($ctx.parameter.return_status != 'E' && $ctx.parameter.return_status != 'TIMEOUT') {
collection_create_content();
}
]]></s:server-script>
</a:init-procedure>
<a:service-output/>
</a:service>
<?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>
<s:server-script import="contract_print_path.js"><![CDATA[
importPackage(java.io);
importPackage(Packages.hls.plugin.docx4j);
importPackage(Packages.leaf.plugin.word2pdf);
importPackage(Packages.org.apache.commons.io);
importPackage(Packages.com.hand.kinggrid);
importPackage(Packages.com.hand.hl);
//删除文件
function deleteFile(filePath) {
var file = new File(filePath);
if (file.exists()) {
file.delete();
}
}
//生成pdf
function wordToPdf(word_file_path,pdf_file_path) {
// word转pdf
var pdf_file_path_new = pdf_file_path + '.pdf';
var wordToPdf = new WordToPdf($instance('uncertain.ocm.IObjectRegistry'), "jacob-1.19-x64.dll");
wordToPdf.word2pdf(word_file_path, pdf_file_path_new);
//删除word文件
//deleteFile(word_file_path);
return pdf_file_path_new;
}
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 write_os_to_file(file, os) {
var fis = new FileInputStream(file);
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 getDatePath() {
set_parameter_file_path();
var file_path = $ctx.parameter.pdf_path; //file_path = u01/hls_file/content_pdf/
var now = new Date()
y = now.getFullYear()
m = now.getMonth() + 1
m = m < 10 ? "0" + m : m
var datePath = file_path + y + "/" + m + "/";
return datePath; //datePath = u01/hls_file/content_pdf/2025/07/
}
function collection_create_content() {
try {
var datePath = getDatePath();
FileUtils.forceMkdir(new File(datePath)); //根据日期创建目录
//清除批次表数据
$bm('cont.CON620.con_contract_rent_temp').execute();
var attachment_batch_dl = $bm('cont.CON301N.con_contract_file_templet_get_atm');
//根据批次表中数据循环生成
var con_contract_bm=$bm('cont.CON301N.con_contract_get_batch');
var con_contract_bm_query=con_contract_bm.queryAsMap();
var con_contract_records = con_contract_bm_query.getChildren();
for (var i = 0; i < con_contract_records.length; i++) {
var p_contract_id = con_contract_records[i].contract_id;
var p_file_name = '所有权转移通知书('+ con_contract_records[i].tenant_name + '_'+con_contract_records[i].contract_number+')';
var p_contract_status = con_contract_records[i].contract_status;
var p_document_table;
if(p_contract_status=='TERMINATE'|| p_contract_status=='ET'||p_contract_status=='INCEPT'||p_contract_status=='ETING'||p_contract_status=='TERMINATING'){
p_document_table = 'CON_CONTRACT_FINISH_LEASE';
}else if(p_contract_status=='REPUR'||p_contract_status=='REPURING'){
p_document_table = 'CON_CONTRACT_FINISH_REPUR';
}
attachment_batch_dl.update({
document_id: p_contract_id,
document_table: p_document_table
});
}
var result = attachment_batch_dl.queryAsMap();
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];
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 = datePath + guid_file_name_tables[0].guid_file_name + 'doc' + record_data.content_id;
copyFile(from_file_path, to_file_path);
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');
} catch (e) {
raise_app_error(e);
}
// word转pdf
var pdf_file_path=to_file_path;
var outputfilepath = wordToPdf(to_file_path,pdf_file_path);
//文件名称
var now = new Date();
y = now.getFullYear();
m = now.getMonth() + 1;
m = m < 10 ? "0" + m : m;
d = now.getDate();
d = d < 10 ? "0" + d : d;
h = now.getHours();
h = h < 10 ? "0" + h : h;
mi = now.getMinutes();
mi = mi < 10 ? "0" + mi : mi;
var filename_str = record_data.down_file_name + y + m + d + h + mi + ".pdf";
var outputfilename= filename_str;
var pdf_file = new File(outputfilepath);
var file_size = 0;
if (pdf_file.exists()) {
file_size = pdf_file.length();
}
$bm('cont.CON301N.insert_into_attachment_bmp').update({
p_file_path :outputfilepath.toString(),
p_file_name :outputfilename.toString(),
p_file_size :file_size,
p_user_id :$ctx.session.user_id,
p_contract_id :record_data.contract_id,
p_file_type :'PDF',
p_lease_type :'10'
});
}
$ctx.parameter.return_status = 'S';
$ctx.parameter.return_message = '执行成功';
} catch (e) {
$ctx.success = "true";
$ctx.parameter.return_status = 'E';
$ctx.parameter.return_message = $ctx.get('/error/@message') || String(e);
raise_app_error(e);
}
var result = {
result: $ctx.parameter.return_status,
message: $ctx.parameter.return_message
};
$ctx.parameter.json = JSON.stringify(result);
}
if ($ctx.parameter.return_status != 'E' && $ctx.parameter.return_status != 'TIMEOUT') {
collection_create_content();
}
]]></s:server-script>
</a:init-procedure>
<a:service-output/>
</a:service>
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:ns1="leaf.application.action" xmlns:p="uncertain.proc" xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" trace="true">
<a:init-procedure>
<s:server-script import="con_print_path.js"><![CDATA[
importPackage(Packages.java.util);
importPackage(Packages.java.lang);
importPackage(Packages.com.hand.hl);
importPackage(Packages.java.io);
importPackage(java.io);
try{
var sys_url_bm=$bm('cont.CON4000.get_sys_url');
var parameter_code='HLS_SYSTEM_URL';
var SysurlQuery = sys_url_bm.queryAsMap({
parameter_code: parameter_code
});
var sys_url = SysurlQuery.getChildren()[0].parameter_value;
//清除批次表数据
$bm('cont.CON620.con_contract_rent_temp').execute();
var con_contract_bm=$bm('cont.CON301N.con_contract_get_batch');
var con_contract_bm_query=con_contract_bm.queryAsMap();
var con_contract_records = con_contract_bm_query.getChildren();
for (var i = 0; i < con_contract_records.length; i++) {
var down_url =sys_url+'con/contract/conExportExcel?contractId=' +con_contract_records[i].contract_id;
println(down_url);
var now = new Date();
y = now.getFullYear();
m = now.getMonth() + 1;
m = m < 10 ? "0" + m : m;
d = now.getDate();
d = d < 10 ? "0" + d : d;
h = now.getHours();
h = h < 10 ? "0" + h : h;
mi = now.getMinutes();
mi = mi < 10 ? "0" + mi : mi;
if (!$ctx.parameter.file_path) {
set_parameter_file_path();
}
var f_fileDir = $ctx.parameter.file_path;
var filePath = (f_fileDir + y + "//" + m + "//").toString();
var tranfer_dir= new File(String(filePath));
if(!tranfer_dir.exists()){//如果文件夹不存在,创建文件夹
tranfer_dir.mkdirs();//创建文件夹
}
var contract_number = con_contract_records[i].contract_number;
var tenant_name = con_contract_records[i].tenant_name;
var file_name = '对账单('+ tenant_name + '_'+contract_number+')' + y + m + d + h + mi + ".xlsx";
var f_fileName = file_name.toString();
var result_flag=DoloadFileByUrl.downloadFile(down_url, filePath, f_fileName);
file_size=get_file_length(filePath+f_fileName);
if(result_flag=true){
var business_daily_email=$bm('cont.CON301N.insert_into_attachment_bmp').update({
p_file_path :(filePath+f_fileName).toString(),
p_file_name :f_fileName,
p_file_size :file_size,
p_user_id :$ctx.session.user_id,
p_contract_id :con_contract_records[i].contract_id,
p_file_type :'EXCEL',
p_lease_type :'01'
});
}
}
}catch(e){
raise_app_error(e.message);
}
function get_file_length(path){
var file=new File(String(path));
if(file.exists() && file.isFile()){
length=file.length();
return length;
}else{
return 0 ;
}
}
]]></s:server-script>
</a:init-procedure>
<a:service-output output="/parameter"/>
</a:service>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:ns1="leaf.application.action" xmlns:p="uncertain.proc" xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" trace="true">
<a:init-procedure>
<s:server-script ><![CDATA[
importPackage(Packages.java.util);
importPackage(Packages.java.lang);
importPackage(Packages.com.hand.kinggrid);
importPackage(Packages.com.hand.hl);
importPackage(Packages.leaf.plugin.word2pdf);
importPackage(Packages.java.io);
importPackage(java.io);
//获取日期目录
var datePath = getDate();
var tranfer_dir= new File(String(datePath));
if(!tranfer_dir.exists()){//如果文件夹不存在,创建文件夹
tranfer_dir.mkdirs();//创建文件夹
}
try{
var sys_url_bm=$bm('cont.CON4000.get_sys_url');
var parameter_code='HLS_SYSTEM_URL';
var SysurlQuery = sys_url_bm.queryAsMap({
parameter_code: parameter_code
});
var sys_url = SysurlQuery.getChildren()[0].parameter_value;
//清除批次表数据
$bm('cont.CON620.con_contract_rent_temp').execute();
//批量表中进行循环下载
var con_contract_bm=$bm('cont.CON301N.con_contract_get_batch');
var con_contract_bm_query=con_contract_bm.queryAsMap();
var con_contract_records = con_contract_bm_query.getChildren();
for (var i = 0; i < con_contract_records.length; i++) {
var p_contract_id = con_contract_records[i].contract_id;
var p_file_name = '对账单('+ con_contract_records[i].tenant_name + '_'+con_contract_records[i].contract_number+')';
var down_url =sys_url+'con/contract/conExportExcel?contractId=' +p_contract_id;
var now = new Date();
y = now.getFullYear();
m = now.getMonth() + 1;
m = m < 10 ? "0" + m : m;
d = now.getDate();
d = d < 10 ? "0" + d : d;
h = now.getHours();
h = h < 10 ? "0" + h : h;
mi = now.getMinutes();
mi = mi < 10 ? "0" + mi : mi;
var sys_file_path_bm=$bm('cont.CON4000.get_sys_url');
var parameter_code='TEMPORARY_FILES';
var SysurlQuery = sys_url_bm.queryAsMap({
parameter_code: parameter_code
});
var sys_file_path = SysurlQuery.getChildren()[0].parameter_value;
var f_fileDir = sys_file_path;
var filePath = (f_fileDir + y + "\/" + m + "\/").toString();
var tranfer_dir= new File(String(filePath));
if(!tranfer_dir.exists()){//如果文件夹不存在,创建文件夹
tranfer_dir.mkdirs();//创建文件夹
}
var file_name = p_file_name+ y + m + d + h + mi + ".xlsx";
var f_fileName = file_name.toString();
var result_flag=DoloadFileByUrl.downloadFile(down_url, filePath, f_fileName);
//excel 转pdf
var to_file_path = filePath + file_name;
var pdf_file_path= filePath + p_file_name + y + m + d + h + mi + ".pdf";
var outputfilepath = wordToPdf(to_file_path,pdf_file_path);
file_size=get_file_length(outputfilepath);
pdf_path =(pdf_file_path).toString()
word_to_pdf_sign(p_contract_id,pdf_file_path,p_file_name);
if(result_flag=true){
var business_daily_email=$bm('cont.CON301N.insert_into_attachment_bmp').update({
p_file_path :(datePath + p_file_name + y + m + d + h + mi + ".pdf").toString(),
p_file_name :(p_file_name + y + m + d + h + mi + ".pdf").toString(),
p_file_size :file_size,
p_user_id :$ctx.session.user_id,
p_contract_id :p_contract_id,
p_file_type :'PDF',
p_lease_type :'01'
});
}
}
}catch(e){
raise_app_error(e.message);
}
function get_file_length(path){
var file=new File(String(path));
if(file.exists() && file.isFile()){
length=file.length();
return length;
}else{
return 0 ;
}
}
function wordToPdf(word_file_path,pdf_file_path) {
// excel转pdf
//var pdf_file_path_new = pdf_file_path + '.pdf';
var pdf_file_path_new = pdf_file_path;
var wordToPdf = new WordToPdf($instance('uncertain.ocm.IObjectRegistry'), "jacob-1.19-x64.dll");
wordToPdf.exceltopdf(word_file_path, pdf_file_path_new);
//删除word文件
//deleteFile(word_file_path);
return pdf_file_path_new;
}
function getDate() {
var file_path = $ctx.parameter.file_path;
var now = new Date()
y = now.getFullYear()
m = now.getMonth() + 1
m = m < 10 ? "0" + m : m
var path = file_path + y + "/" + m + "/";
return path;
}
function word_to_pdf_sign(content_id,pdf_file_path,file_name) {
importPackage(Packages.com.hl.signatures);
importPackage(Packages.java.io);
importPackage(Packages.java.util);
var org_flag = '';
var qf_flag = '';
var param = new ArrayList();
var paramdetail;
var attachment_update = $bm('cont.CON620.con_contract_save_pdf_atm');
var file_name = file_name;
var file_path = pdf_file_path;
if (file_name.substring(file_name.length - 4) == '.doc') {
file_name = file_name.substring(0, file_name.length - 4);
} else if (file_name.substring(file_name.length - 5) == '.docx') {
file_name = file_name.substring(0, file_name.length - 5);
}
var outputfilepath = pdf_file_path;// 由于wordToPdf转换后pdf文件已经带有.pdf
var wordToPdf = new WordToPdf($instance('uncertain.ocm.IObjectRegistry'), "jacob-1.19-x64.dll");
//wordToPdf.word2pdf(file_path, outputfilepath);
var con_signature_info = $bm('cont.CON620.get_con_signature_info').queryAsMap();
var con_signature_data = con_signature_info.getChildren();
var con_signature_record;
for (var i = 0;i < con_signature_data.length;i++) {
con_signature_record = con_signature_data[i];
if (con_signature_record.signature_code == 'gz_flag'){
paramdetail = '[{ "code":"' + con_signature_record.code +
'", "seal_code":"' + con_signature_record.seal_code +
'", "seal_width":' + con_signature_record.seal_width +
', "fontname":"' + con_signature_record.fontname +
'", "fontsize":"' + con_signature_record.fontsize +
'", "fontcolor":"' + con_signature_record.fontcolor +
'", "pageno":"' + con_signature_record.pageno +
'", "text":"' + con_signature_record.word_code + '"}]';
}
param.add(paramdetail);
}
var con_signature_info = $bm('cont.CON620.get_kinggrid_info').queryAsMap();
var con_kinggrid_data = con_signature_info.getChildren()[0];
var server_url = con_kinggrid_data.server_url;
var app_id = con_kinggrid_data.app_id;
var app_security = con_kinggrid_data.app_security;
var status = new com.hand.kinggrid.ContractSignaturesNew.hl_contract_signatures(outputfilepath, 1,param.toArray(),server_url,app_id,app_security,datePath);
}
]]></s:server-script>
</a:init-procedure>
<a:service-output output="/parameter"/>
</a:service>
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:a="http://www.leaf-framework.org/application" xmlns:p="uncertain.proc" trace="true">
<a:init-procedure>
<a:model-delete model="cont.CON301N.con_contract_cashflow_download_temp"/>
<batch-apply sourcepath="/parameter">
<a:model-insert model="cont.CON301N.con_contract_cashflow_download_temp"/>
</batch-apply>
</a:init-procedure>
<a:service-output output="/parameter"/>
</a:service>
<?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>
<s:server-script><![CDATA[
importPackage(java.util.zip);
importPackage(java.io);
function getdate() {
var now = new Date()
y = now.getFullYear()
m = now.getMonth() + 1
d = now.getDate()
m = m < 10 ? "0" + m : m
d = d < 10 ? "0" + d : d
return y + "" + m + "" + d
}
function writeFile(zos, fn, fp) {
var ze = new ZipEntry(fn);
//zos.setEncoding("UTF-8");//如果是org.apache.tools.zip需要追加字符集
zos.putNextEntry(ze);
var fis = new FileInputStream(fp);
var b = new java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 1024 * 64);
var len = -1;
while ((len = fis.read(b)) != -1) {
zos.write(b, 0, len);
}
fis.close();
}
$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");
var date = new Date();
var date_str = getdate();
var doc_code = $ctx.parameter.doc_code;
var filename = doc_code + '-' + date_str + ".zip"
resp.setHeader("Content-disposition", "attachment; filename=" + encodeURI(filename, 'utf-8'));
resp.setDateHeader("Expires", 0);
resp.setContentType("application/x-msdownload");
var zos = new ZipOutputStream(resp.getOutputStream());
try {
var attachment_batch_dl = $bm('cont.CON301N.con_contract_download_batch');
var result = attachment_batch_dl.queryAsMap();
var arr = result.getChildren();
var file_exist_list = {};
for (var i = 0;i < arr.length;i++) {
var f = arr[i];
if (f.file_path && !file_exist_list[f.file_name]) {
writeFile(zos, f.file_name, f.file_path);
file_exist_list[f.file_name] = 1;
} else {
file_exist_list[f.file_name] = file_exist_list[f.file_name] * 1 + 1;
var last_index = f.file_name.lastIndexOf(".");
var temp_exists_file_name = f.file_name.substr(0, last_index);
var temp_exists_file_type = f.file_name.substr(last_index, f.file_name.length);
temp_exists_file_name = temp_exists_file_name + '-' + file_exist_list[f.file_name] + temp_exists_file_type;
writeFile(zos, temp_exists_file_name, f.file_path);
}
}
} catch (e) {
var logger = $logger("server-script");
logger.severe(e.message)
}
zos.close();
]]></s:server-script>
</a:init-procedure>
</a:service>
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" customizationEnabled="true"
trace="true">
<a:screen xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" customizationEnabled="true" trace="true">
<a:init-procedure>
<s:server-script import="con_print_path.js"><![CDATA[
set_parameter_file_path();
]]></s:server-script>
<a:model-query model="cont.CON620.get_sys_role" rootPath="role_info"/>
<a:model-query model="cont.CON3200.get_user_employee_type" rootPath="employee_info"/>
</a:init-procedure>
<a:view>
<!-- <a:link id="con301n_downloadFile_id" url="${/request/@context_path}/downloadFile.lview"/>-->
<a:link id="con301n_downloadFile_id" url="${/request/@context_path}/modules/cont/CON301N/con_downfile.lsc"/>
<a:link id="con301n_print_excel_link"
url="${/request/@context_path}/modules/cont/CON301N/con_contract_print_atm.lsc"/>
<a:link id="con301n_print_pdf_link"
url="${/request/@context_path}/modules/cont/CON301N/con_contract_print_pdf.lsc"/>
<a:link id="con_cashflow_print_link"
url="${/request/@context_path}/modules/cont/CON620/create_content_for_collection_n.lsc"/>
<a:link id="con_cashflow_print_signatures_link"
url="${/request/@context_path}/modules/cont/CON620/create_content_for_collection_signatures.lsc"/>
<a:link id="con_contract_owner_ship_link_id" url="${/request/@context_path}/modules/csh/CSH501/csh_payment_req_history_pdf_print.lsc"/>
<a:link id="con_contract_owner_ship_jg_link_id" url="${/request/@context_path}/modules/csh/CSH501/csh_payment_req_history_pdf_jg_print.lsc"/>
<a:link id="con_contract_owner_ship_pdf_jg_link_id" url="${/request/@context_path}/modules/cont/CON301N/con_contract_owner_pdf_jg_print.lsc"/>
<a:link id="con_contract_owner_ship_pdf_link_id" url="${/request/@context_path}/modules/cont/CON301N/con_contract_owner_pdf_print.lsc"/>
<script type="text/javascript"><![CDATA[
function lock_current_window() {
Leaf.Masker.mask($('${/parameter/@winid}').wrap, '${l:HLS.EXECUTING}');
function detail_download_window(record_id) {
var url = $('con301n_downloadFile_id').getUrl() + '?record_id=' + record_id + '&table_name=CUX_CONTRACT_PRINT';
window.open(url, '_self');
}
function unlock_current_window() {
Leaf.Masker.unmask($('${/parameter/@winid}').wrap);
function attachment_download(val,rec,name) {
return '<a href=javascript:detail_download_window('+rec.get('print_id')+')>下载</a>';
}
function con_owner_ship_create() {
debugger;
Leaf.Masker.mask(Ext.getBody(), '请稍等......');
var contract_id = '${/parameter/@contract_id}';
var contract_number = '${/parameter/@contract_number}';
var con_status = '${/parameter/@con_status}';
if (con_status =='TERMINATE'||con_status=='ET'||con_status=='REPUR'){
var url_l = $('con_contract_owner_ship_jg_link_id').getUrl() + '?document_id=' + contract_id + '&document_table=CON_CONTRACT_FINISH_LEASE&batch_flag=Y&source_type=COMMON';
window.open(href = url_l, target = "_blank");
var tenant_name = '${/parameter/@tenant_name}';
var file_name = '所有权转移通知书('+ tenant_name + '_'+contract_number+')';
var document_table;
var url;
if("${/model/employee_info/record/@employee_type_code}" == 'STAFF'){
if(con_status=='TERMINATE'||con_status=='ET'){
document_table = 'CON_CONTRACT_FINISH_LEASE';
url =$('con_contract_owner_ship_pdf_jg_link_id').getUrl();
}else if(con_status=='INCEPT'||con_status=='ETING'||con_status=='TERMINATING'){
document_table = 'CON_CONTRACT_FINISH_LEASE';
url =$('con_contract_owner_ship_pdf_link_id').getUrl();
}else if(con_status=='REPUR'){
document_table = 'CON_CONTRACT_FINISH_REPUR';
url =$('con_contract_owner_ship_pdf_jg_link_id').getUrl();
}else if(con_status=='REPURING'){
document_table = 'CON_CONTRACT_FINISH_REPUR';
url =$('con_contract_owner_ship_pdf_link_id').getUrl();
}
}else{
if(con_status=='TERMINATE'||con_status=='ET'||con_status=='INCEPT'||con_status=='ETING'||con_status=='TERMINATING'){
document_table = 'CON_CONTRACT_FINISH_LEASE';
url =$('con_contract_owner_ship_pdf_link_id').getUrl();
}else if(con_status=='REPUR'||con_status=='REPURING'){
document_table = 'CON_CONTRACT_FINISH_REPUR';
url =$('con_contract_owner_ship_pdf_link_id').getUrl();
}
if(con_status=='INCEPT'||con_status=='ETING'||con_status=='TERMINATING'||con_status=='REPURING'){
var url_l = $('con_contract_owner_ship_link_id').getUrl() + '?document_id=' + contract_id + '&document_table=CON_CONTRACT_FINISH_LEASE&batch_flag=Y&source_type=COMMON';
window.open(href = url_l, target = "_blank");
}
Leaf.request({
url: url,
para: {
document_id : contract_id,
contract_id:contract_id,
document_table :document_table,
batch_flag :'Y',
source_type:'COMMON',
con_status : con_status,
file_name : file_name
},
success: function(res) {
Leaf.Masker.unmask(Ext.getBody());
$('con_contract_print_detail_line_ds').query();
},
failure: function() {
Leaf.Masker.unmask(Ext.getBody());
$('con_contract_print_detail_line_ds').query();
},
error: function() {
Leaf.Masker.unmask(Ext.getBody());
$('con_contract_print_detail_line_ds').query();
}
window.close(
$('con_contract_print_detail_line_ds').query()
);
});
};
]]></script>
<a:dataSets>
......@@ -55,13 +88,13 @@
<a:fields>
<a:field name="contract_number" defaultValue="${/parameter/@contract_number}" readOnly="true"/>
<a:field name="contract_name" defaultValue="${/parameter/@contract_name}" readOnly="true"/>
<a:field name="bp_name" defaultValue="${/parameter/@bp_name}" readOnly="true"></a:field>
<a:field name="bp_name" defaultValue="${/parameter/@tenant_name}" readOnly="true"></a:field>
<a:field name="contract_status" defaultValue="${/parameter/@contract_status}" readOnly="true"/>
</a:fields>
</a:dataSet>
<a:dataSet id="con_contract_print_detail_line_ds" autoQuery="true" fetchAll="true" pageSize="100"
queryUrl="${/request/@context_path}/autocrud/cont.CON620.con_contract_owner_print/query?contract_id=${/parameter/@contract_id}">
queryUrl="${/request/@context_path}/autocrud/cont.CON301N.con_contract_owner_print/query?contract_id=${/parameter/@contract_id}">
<a:fields>
<a:field name="contract_id"/>
<a:field name="content_number" readOnly="true"/>
......@@ -71,7 +104,6 @@
<a:screenBody>
<div id="screenTopToolbardiv">
<a:screenTopToolbar style="width:700px">
<!-- <a:gridButton id="con_print_id" click="con_print_word_create" text="生成催收函Word"/>-->
<a:gridButton id="con_owner_ship_id" click="con_owner_ship_create" text="生成结清证明PDF"/>
</a:screenTopToolbar>
<a:form column="2" width="750" labelWidth="200" >
......@@ -91,20 +123,12 @@
<a:button prompt="PROMPT.EXPORT_EXCEL" type="excel"/>
</a:toolBar>
<a:columns>
<a:column name="file_name" prompt="文本名称" width="260"/>
<a:column name="file_name" prompt="文本名称" width="300"/>
<a:column name="print_user" prompt="打印人" width="160"/>
<a:column name="print_date" prompt="生成日期" width="180"/>
<a:column name="download" align="center" prompt="下载" renderer="attachment_download" width="50"/>
</a:columns>
</a:grid>
</a:screenBody>
<script type="text/javascript"><![CDATA[
Leaf.onReady(function() {
// if("${/model/role_info/record/@role_code}"!="0018"&&"${/model/role_info/record/@role_code}"!="0019") {
// document.getElementById("con_print_signatures_id").style.display = "";
// } else {
// document.getElementById("con_print_signatures_id").style.display = "none";
// }
});
]]></script>
</a:view>
</a:screen>
<?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="contract_print_path.js"><![CDATA[
importPackage(java.io);
importPackage(Packages.hls.plugin.docx4j);
importPackage(Packages.leaf.plugin.word2pdf);
importPackage(Packages.org.apache.commons.io);
importPackage(Packages.com.hand.kinggrid);
importPackage(Packages.com.hand.hl);
//删除文件
function deleteFile(filePath) {
var file = new File(filePath);
if (file.exists()) {
file.delete();
}
}
//生成pdf
function wordToPdf(word_file_path,pdf_file_path) {
// word转pdf
var pdf_file_path_new = pdf_file_path + '.pdf';
var wordToPdf = new WordToPdf($instance('uncertain.ocm.IObjectRegistry'), "jacob-1.19-x64.dll");
wordToPdf.word2pdf(word_file_path, pdf_file_path_new);
//删除word文件
//deleteFile(word_file_path);
return pdf_file_path_new;
}
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 write_os_to_file(file, os) {
var fis = new FileInputStream(file);
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 getDatePath() {
set_parameter_file_path();
var file_path = $ctx.parameter.pdf_path; //file_path = u01/hls_file/content_pdf/
var now = new Date()
y = now.getFullYear()
m = now.getMonth() + 1
m = m < 10 ? "0" + m : m
var datePath = file_path + y + "/" + m + "/";
return datePath; //datePath = u01/hls_file/content_pdf/2025/07/
}
function collection_create_content() {
try {
var datePath = getDatePath();
FileUtils.forceMkdir(new File(datePath)); //根据日期创建目录
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];
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 = datePath + guid_file_name_tables[0].guid_file_name + 'doc' + record_data.content_id;
copyFile(from_file_path, to_file_path);
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');
} catch (e) {
raise_app_error(e);
}
// word转pdf
var pdf_file_path=to_file_path;
var outputfilepath = wordToPdf(to_file_path,pdf_file_path);
var now = new Date();
y = now.getFullYear();
m = now.getMonth() + 1;
m = m < 10 ? "0" + m : m;
d = now.getDate();
d = d < 10 ? "0" + d : d;
h = now.getHours();
h = h < 10 ? "0" + h : h;
mi = now.getMinutes();
mi = mi < 10 ? "0" + mi : mi;
var filename_str = $ctx.parameter.file_name + y + m + d + h + mi + ".pdf";
var outputfilename= filename_str;
//金格盖章 start
var param = new ArrayList();
var paramdetail;
var con_signature_info = $bm('cont.CON620.get_con_signature_info').queryAsMap();
var con_signature_data = con_signature_info.getChildren();
var con_signature_record;
for (var i = 0;i < con_signature_data.length;i++) {
con_signature_record = con_signature_data[i];
println(con_signature_record.signature_code);
if (con_signature_record.signature_code == 'gz_flag'){
paramdetail = '[{ "code":"' + con_signature_record.code +
'", "seal_code":"' + con_signature_record.seal_code +
'", "seal_width":' + con_signature_record.seal_width +
', "fontname":"' + con_signature_record.fontname +
'", "fontsize":"' + con_signature_record.fontsize +
'", "fontcolor":"' + con_signature_record.fontcolor +
'", "pageno":"' + con_signature_record.pageno +
'", "text":"' + con_signature_record.word_code + '"}]';
}
param.add(paramdetail);
}
var con_signature_info = $bm('cont.CON620.get_kinggrid_info').queryAsMap();
var con_kinggrid_data = con_signature_info.getChildren()[0];
var server_url = con_kinggrid_data.server_url;
var app_id = con_kinggrid_data.app_id;
var app_security = con_kinggrid_data.app_security;
var status = new com.hand.kinggrid.ContractSignaturesNew.hl_contract_signatures(outputfilepath, 1,param.toArray(),server_url,app_id,app_security,datePath);
//金格盖章 end
var pdf_file = new File(outputfilepath);
var file_size = 0;
if (pdf_file.exists()) {
file_size = pdf_file.length();
}
$bm('cont.CON301N.insert_into_attachment_bmp').update({
p_file_path :outputfilepath.toString(),
p_file_name :outputfilename.toString(),
p_file_size :file_size,
p_user_id :$ctx.session.user_id,
p_contract_id :$ctx.parameter.contract_id,
p_file_type :'PDF',
p_lease_type :'10'
});
}
$ctx.parameter.return_status = 'S';
$ctx.parameter.return_message = '执行成功';
} catch (e) {
$ctx.success = "true";
$ctx.parameter.return_status = 'E';
$ctx.parameter.return_message = $ctx.get('/error/@message') || String(e);
raise_app_error(e);
}
var result = {
result: $ctx.parameter.return_status,
message: $ctx.parameter.return_message
};
$ctx.parameter.json = JSON.stringify(result);
}
if ($ctx.parameter.return_status != 'E' && $ctx.parameter.return_status != 'TIMEOUT') {
collection_create_content();
}
]]></s:server-script>
</a:init-procedure>
<a:service-output/>
</a:service>
<?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="contract_print_path.js"><![CDATA[
importPackage(java.io);
importPackage(Packages.hls.plugin.docx4j);
importPackage(Packages.leaf.plugin.word2pdf);
importPackage(Packages.org.apache.commons.io);
importPackage(Packages.com.hand.kinggrid);
importPackage(Packages.com.hand.hl);
//删除文件
function deleteFile(filePath) {
var file = new File(filePath);
if (file.exists()) {
file.delete();
}
}
//生成pdf
function wordToPdf(word_file_path,pdf_file_path) {
// word转pdf
var pdf_file_path_new = pdf_file_path + '.pdf';
var wordToPdf = new WordToPdf($instance('uncertain.ocm.IObjectRegistry'), "jacob-1.19-x64.dll");
wordToPdf.word2pdf(word_file_path, pdf_file_path_new);
//删除word文件
//deleteFile(word_file_path);
return pdf_file_path_new;
}
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 write_os_to_file(file, os) {
var fis = new FileInputStream(file);
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 getDatePath() {
set_parameter_file_path();
var file_path = $ctx.parameter.pdf_path; //file_path = u01/hls_file/content_pdf/
var now = new Date()
y = now.getFullYear()
m = now.getMonth() + 1
m = m < 10 ? "0" + m : m
var datePath = file_path + y + "/" + m + "/";
return datePath; //datePath = u01/hls_file/content_pdf/2025/07/
}
function collection_create_content() {
try {
var datePath = getDatePath();
FileUtils.forceMkdir(new File(datePath)); //根据日期创建目录
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];
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 = datePath + guid_file_name_tables[0].guid_file_name + 'doc' + record_data.content_id;
copyFile(from_file_path, to_file_path);
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');
} catch (e) {
raise_app_error(e);
}
// word转pdf
var pdf_file_path=to_file_path;
var outputfilepath = wordToPdf(to_file_path,pdf_file_path);
//文件名称
var now = new Date();
y = now.getFullYear();
m = now.getMonth() + 1;
m = m < 10 ? "0" + m : m;
d = now.getDate();
d = d < 10 ? "0" + d : d;
h = now.getHours();
h = h < 10 ? "0" + h : h;
mi = now.getMinutes();
mi = mi < 10 ? "0" + mi : mi;
var filename_str = $ctx.parameter.file_name + y + m + d + h + mi + ".pdf";
var outputfilename= filename_str;
var pdf_file = new File(outputfilepath);
var file_size = 0;
if (pdf_file.exists()) {
file_size = pdf_file.length();
}
$bm('cont.CON301N.insert_into_attachment_bmp').update({
p_file_path :outputfilepath.toString(),
p_file_name :outputfilename.toString(),
p_file_size :file_size,
p_user_id :$ctx.session.user_id,
p_contract_id :$ctx.parameter.contract_id,
p_file_type :'PDF',
p_lease_type :'10'
});
}
$ctx.parameter.return_status = 'S';
$ctx.parameter.return_message = '执行成功';
} catch (e) {
$ctx.success = "true";
$ctx.parameter.return_status = 'E';
$ctx.parameter.return_message = $ctx.get('/error/@message') || String(e);
raise_app_error(e);
}
var result = {
result: $ctx.parameter.return_status,
message: $ctx.parameter.return_message
};
$ctx.parameter.json = JSON.stringify(result);
}
if ($ctx.parameter.return_status != 'E' && $ctx.parameter.return_status != 'TIMEOUT') {
collection_create_content();
}
]]></s:server-script>
</a:init-procedure>
<a:service-output/>
</a:service>
......@@ -30,22 +30,30 @@
<a:link id="car_modify_link_readonly" url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_maintain.lview"/>
<a:link id="car_modify_special_link"
url="${/request/@context_path}/modules/prj/PRJ500N/prj_project_create.lview"/>
<a:link id="${/parameter/@layout_code}con_contract_op_query_link"
url="${/request/@context_path}/modules/cont/CON3200/con_re_incept_op_modify.lview"/>
<a:link id="${/parameter/@layout_code}_contract_print_link_id"
url="${/request/@context_path}/modules/cont/CON301N/con_contract_print.lview"/>
<a:link id="${/parameter/@layout_code}con_contract_query_link"
url="${/request/@context_path}/modules/cont/CON3200/con_re_incept_modify.lview"/>
<a:link id="${/parameter/@layout_code}con_contract_op_query_link"
url="${/request/@context_path}/modules/cont/CON3200/con_re_incept_op_modify.lview"/>
<a:link id="${/parameter/@layout_code}_contract_seal_link_id" url="${/request/@context_path}/modules/cont/CON301N/con_contract_finish_seal_info.lview"/>
<a:link id="con_contract_finish_print_link_id" url="${/request/@context_path}/modules/csh/CSH501/csh_payment_req_history_pdf_print.lsc"/>
<!-- <script src="${/request/@context_path}/javascripts/hap/dynamicStopAutoQuery.js" type="text/javascript"/>-->
<a:link id="${/parameter/@layout_code}_contract_print_signatures_link_id"
url="${/request/@context_path}/modules/cont/CON301N/con_contract_print_signatures.lview"/>
<script src="${/request/@context_path}/javascripts/hap/dynamicStopAutoQuery.js" type="text/javascript"/>
<a:link id="rl_notice_print_link"
url="${/request/@context_path}/modules/cont/CON301N/rl_notice_print.lsc"/>
<a:link id="${/parameter/@layout_code}_contract_print_signatures_link_id"
url="${/request/@context_path}/modules/cont/CON301N/con_contract_print_signatures.lview"/>
<a:link id="car_modify_link_readonly_c" url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_maintain_constru.lview"/>
<a:link id="operate_readonly_link" url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_maintain_opreat.lview"/>
<a:link id="prj2000_pur_deteail_link_id" url="${/request/@context_path}/modules/prj/PRJ2000/purchase_order_deteail.lview"></a:link>
<a:link id="owner_ship_link_id"
url="${/request/@context_path}/modules/cont/CON301N/con_contract_owner.lview"/>
<a:link id="cashflow_down_temp_link_id" url="${/request/@context_path}/modules/cont/CON301N/con_contract_cashflow_download_temp.lsc"/>
<a:link id="cashflow_down_excel_link" url="${/request/@context_path}/modules/cont/CON301N/con_contract_batch_print_atm.lsc"/>
<a:link id="cashflow_down_pdf_link" url="${/request/@context_path}/modules/cont/CON301N/con_contract_batch_print_pdf.lsc"/>
<a:link id="cashflow_down_zip_link_id" url="${/request/@context_path}/modules/cont/CON301N/con_contract_download_batch.lsc"/>
<a:link id="con_contract_batch_owner_jg_link" url="${/request/@context_path}/modules/cont/CON301N/con_contract_batch_owner_pdf_jg_print.lsc"/>
<a:link id="con_contract_batch_owner_link" url="${/request/@context_path}/modules/cont/CON301N/con_contract_batch_owner_pdf_print.lsc"/>
<script type="text/javascript"><![CDATA[
// stopDymanicAutoQuery('${/parameter/@layout_code}', 'G_CONTRACT_RESULT', 'con_contract');
......@@ -61,7 +69,7 @@
}
//只要经租代理店或者管理人员才可能看到采购单编号
if("${/model/role_info/record/@role_code}"=="0018"||"${/model/role_info/record/@role_code}"=="0019"){
if('${/model/user_type_code/record/@unit_id}'!="2224"){
if('${/model/user_type_code/record/@unit_id}'!="2244"){
if(document.getElementById('CONTRACT_QUERY_ENTRANCE_F_QUERY_NULL_PRJ_NUMBER')){
document.getElementById('CONTRACT_QUERY_ENTRANCE_F_QUERY_NULL_PRJ_NUMBER_prompt').style.display = 'none';
document.getElementById('CONTRACT_QUERY_ENTRANCE_F_QUERY_NULL_PRJ_NUMBER').style.display = 'none';
......@@ -73,11 +81,17 @@
document.getElementById("CONTRACT_QUERY_ENTRANCE_F_QUERY_NULL_AGENT_EXTRA_NAM").style.display = "";
document.getElementById("CONTRACT_QUERY_ENTRANCE_F_QUERY_NULL_BP_ID_AGENT_LEVEL1_prompt").style.display = "";
document.getElementById("CONTRACT_QUERY_ENTRANCE_F_QUERY_NULL_BP_ID_AGENT_LEVEL1").style.display = "";
if(document.getElementById('${/parameter/@layout_code}_user_button7')){
document.getElementById('${/parameter/@layout_code}_user_button7').style.display = "";
}
} else {
document.getElementById("CONTRACT_QUERY_ENTRANCE_F_QUERY_NULL_AGENT_EXTRA_NAM_prompt").style.display = "none";
document.getElementById("CONTRACT_QUERY_ENTRANCE_F_QUERY_NULL_AGENT_EXTRA_NAM").style.display = "none";
document.getElementById("CONTRACT_QUERY_ENTRANCE_F_QUERY_NULL_BP_ID_AGENT_LEVEL1_prompt").style.display = "none";
document.getElementById("CONTRACT_QUERY_ENTRANCE_F_QUERY_NULL_BP_ID_AGENT_LEVEL1").style.display = "none";
if(document.getElementById('${/parameter/@layout_code}_user_button7')){
document.getElementById('${/parameter/@layout_code}_user_button7').style.display = "none";
}
}
//深圳美鹏和hcs显示分公司,其他隐藏
var bp_code = '${/model/user_agent_description/record/@bp_code}';
......@@ -116,9 +130,15 @@
}
}
var role_code = '${/model/role_info/record/@role_code}';
if(role_code!="0008"&&role_code!="0017"&&role_code!="HAND") {
document.getElementById("CONTRACT_QUERY_ENTRANCE_user_button9").style.display = "none";
} else {
document.getElementById("CONTRACT_QUERY_ENTRANCE_user_button9").style.display = "";
}
});
function open_contract_win(ds_id, record_id) {
debugger;
var record = $(ds_id).findById(record_id);
var param = record.data;
var division=param.division;
......@@ -166,14 +186,11 @@
param['function_code'] = 'PRJ501_OPERAT_WFL';
url = 'operate_readonly_link';
}
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, url, ds_id);
}
function open_pur_Window(record_id, ds_id) {
debugger;
var record = $(ds_id).findById(record_id);
var param = record.data;
param['function_code'] = 'PRJ2000D_WFL';
......@@ -227,10 +244,31 @@
}
function download_ownership(record_id, ds_id){
// var url_l = $('con_contract_finish_print_link_id').getUrl() + '?document_id=' + contract_id + '&document_table=CON_CONTRACT_FINISH_LEASE&batch_flag=Y&source_type=COMMON';
// window.open(href = url_l, target = "_blank");
var record = $(ds_id).findById(record_id);
var contract_id = record.get('contract_id');
var url_l = $('con_contract_finish_print_link_id').getUrl() + '?document_id=' + contract_id + '&document_table=CON_CONTRACT_FINISH_LEASE&batch_flag=Y&source_type=COMMON';
window.open(href = url_l, target = "_blank");
var contract_number = record.get('contract_number');
var contract_name = record.get('contract_name');
var contract_status = record.get('contract_status_n');
var con_status = record.get('contract_status');
var tenant_name = record.get('bp_id_tenant_n');
var win = new Leaf.Window({
id: 'owner_ship_id',
url: $('owner_ship_link_id').getUrl(),
params: {
contract_id: contract_id,
contract_number: contract_number,
contract_name: contract_name,
contract_status: contract_status,
con_status: con_status,
tenant_name: tenant_name,
winid : 'owner_ship_winid'
},
title: '所有权转移通知书',
height: 550,
width: 800
});
}
window['${/parameter/@layout_code}_dynamic_link_renderer'] = function (value, record, name, config_record) {
......@@ -329,7 +367,6 @@
};
window['${/parameter/@layout_code}_user_button4_layout_dynamic_click'] = function () {
debugger;
//modify by 18938 I-7158
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
var record = $(ds_id).getSelected()[0];
......@@ -337,13 +374,19 @@
url ='${/request/@context_path}/con/contract/conExportExcel?contractId=' + record.get('contract_id');
window.open(href = url);
//window.location.href='${/request/@context_path}/con/contract/conExportExcel?contractId='+record.get('contract_id');
};
//返还金通知打印
window['${/parameter/@layout_code}_user_button9_layout_dynamic_click'] = function () {
debugger;
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
if ($(ds_id).getSelected().length == 0) {
$L.showInfoMessage('提示', '请勾选需下载的合同!');
return;
}
if ($(ds_id).getSelected().length > 1) {
$L.showInfoMessage('提示', '返还金通知仅可选择一个合同进行下载,请重新选择!');
return;
}
var cur_record = $(ds_id).getSelected()[0];
var rl_flag = cur_record.get("rl_flag");
var et_date = cur_record.get("et_date");
......@@ -401,6 +444,178 @@
});
};
//批量下载对账单excel
window['${/parameter/@layout_code}_user_button6_layout_dynamic_click'] = function () {
var ds = $('CONTRACT_QUERY_ENTRANCE_G_CONTRACT_RESULT_con_contract_ds');
var records = ds.getSelected();
if (records.length == 0) {
$L.showInfoMessage('提示', '请勾选需下载的合同!');
return;
}
if (records.length > 10) {
$L.showInfoMessage('提示', '一次最多可勾选10个合同,请重新选择!');
return;
}
var datas = [];
for (var i = 0;i < records.length;i++) {
var obj = {};
obj['contract_id'] = records[i].get('contract_id');
datas[i] = obj;
}
// 清除临时表数据并插入新数据,删除再生成文本
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
Leaf.request({
url: $('cashflow_down_temp_link_id').getUrl(),
para: datas,
success: function() {
// 打印
Leaf.request({
url: $('cashflow_down_excel_link').getUrl(),
para: {},
success: function() {
// 下载
var doc_code = '对账单-';
var url_l = $('cashflow_down_zip_link_id').getUrl() + '?&doc_code=' + encodeURI(doc_code);
window.open(href = url_l, target = "_self");
Leaf.Masker.unmask(Ext.getBody());
},
error: function() {
Leaf.Masker.unmask(Ext.getBody());
},
failure: function() {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
},
error: function() {
Leaf.Masker.unmask(Ext.getBody());
},
failure: function() {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
}
//批量下载对账单pdf
window['${/parameter/@layout_code}_user_button7_layout_dynamic_click'] = function () {
var ds = $('CONTRACT_QUERY_ENTRANCE_G_CONTRACT_RESULT_con_contract_ds');
var records = ds.getSelected();
if (records.length == 0) {
$L.showInfoMessage('提示', '请勾选需下载的合同!');
return;
}
if (records.length > 10) {
$L.showInfoMessage('提示', '一次最多可勾选10个合同,请重新选择!');
return;
}
var datas = [];
for (var i = 0;i < records.length;i++) {
var obj = {};
obj['contract_id'] = records[i].get('contract_id');
datas[i] = obj;
}
// 清除临时表数据并插入新数据,删除再生成文本
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
Leaf.request({
url: $('cashflow_down_temp_link_id').getUrl(),
para: datas,
success: function() {
// 打印
Leaf.request({
url: $('cashflow_down_pdf_link').getUrl(),
para: {},
success: function() {
// 下载
var doc_code = '对账单-';
var url_l = $('cashflow_down_zip_link_id').getUrl() + '?&doc_code=' + encodeURI(doc_code);
window.open(href = url_l, target = "_self");
Leaf.Masker.unmask(Ext.getBody());
},
error: function() {
Leaf.Masker.unmask(Ext.getBody());
},
failure: function() {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
},
error: function() {
Leaf.Masker.unmask(Ext.getBody());
},
failure: function() {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
}
//批量下载结清证明
window['${/parameter/@layout_code}_user_button8_layout_dynamic_click'] = function () {
var ds = $('CONTRACT_QUERY_ENTRANCE_G_CONTRACT_RESULT_con_contract_ds');
var records = ds.getSelected();
if (records.length == 0) {
$L.showInfoMessage('提示', '请勾选需下载的合同!');
return;
}
if (records.length > 10) {
$L.showInfoMessage('提示', '一次最多可勾选10个合同,请重新选择!');
return;
}
var datas = [];
for (var i = 0;i < records.length;i++) {
if(records[i].get('contract_status') !='TERMINATE'&&records[i].get('contract_status') !='INCEPT'&&records[i].get('contract_status') !='TERMINATING'&&records[i].get('contract_status') !='ET'
&&records[i].get('contract_status') !='ETING'&&records[i].get('contract_status')!='REPURING'&&records[i].get('contract_status') !='REPUR'){
Leaf.showInfoMessage('提示','仅起租/提前结清中/解约回购中/结束中/正常结清/提前结清完成/解约回购完成的合同允许下载结清证明,请重新选择!',null,500,100);
return;
}
var obj = {};
obj['contract_id'] = records[i].get('contract_id');
datas[i] = obj;
}
// 清除临时表数据并插入新数据,删除再生成文本
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
Leaf.request({
url: $('cashflow_down_temp_link_id').getUrl(),
para: datas,
success: function() {
var link_url;
if("${/model/employee_info/record/@employee_type_code}" == 'STAFF'){
link_url = $('con_contract_batch_owner_jg_link').getUrl();
}else{
link_url = $('con_contract_batch_owner_link').getUrl();
}
// 打印
Leaf.request({
url:link_url,
para: {},
success: function() {
// 下载
var doc_code = '结清证明-';
var url_l = $('cashflow_down_zip_link_id').getUrl() + '?&doc_code=' + encodeURI(doc_code);
window.open(href = url_l, target = "_self");
Leaf.Masker.unmask(Ext.getBody());
},
error: function() {
Leaf.Masker.unmask(Ext.getBody());
},
failure: function() {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
},
error: function() {
Leaf.Masker.unmask(Ext.getBody());
},
failure: function() {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
}
]]></script>
<a:screen-include
screen="modules/cont/CON500/con_contract_authority_list_validate.lview?document_category=CONTRACT&amp;function_code=CON501"/>
......
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application">
<a:init-procedure>
<a:model-query defaultWhereClause="t1.code = &apos;HLCM_CONTRACT_ZERO&apos;" model="sys.SYS120.hls_attachment_module" rootPath="template_path"/>
</a:init-procedure>
<a:view>
<a:link id="downloadFile_id" url="${/request/@context_path}/downloadFile.lview"/>
<script><![CDATA[
function downloadFile(){
new Leaf.Window({
url: $('downloadFile_id').getUrl(),
title: '${l:HLS.SUPPORTING_DOCUMENT}',
params: {
'table_name': 'HLS_ATTACHMENT_MODULE',
'header_id': '${/model/template_path/record/@attachment_module_id}'
},
width: 850,
height: 400
});
}
function saveClick() {
if (document.getElementById('importFile').value) {
var fileName = document.getElementById('importFile').value;
var fileType = fileName.substr(fileName.lastIndexOf("."));
fileType = fileType.toLowerCase();
if (fileType != '.xls' && fileType != '.xlsx') {
alert('${l:SELECT_CORRECT_IMPORT_FILE}');
} else {
doSubmit();
}
} else {
Leaf.showMessage('${l:PROMPT}', '未上传数据导入文件!');
}
}
function doSubmit() {
var form = document.getElementById('importForm');
var url = '${/request/@context_path}/modules/cont/CON560/con_contract_finish_import_upload_info.lview?_csrf=${/session/@_csrf.token}';
form.action = url;
form.submit();
}
]]></script>
<a:dataSets>
<a:dataSet id="label_ds" autoCreate="true">
<a:fields>
<a:field name="label2" defaultValue="${l:STRICT_IMPORTED_TEMPLATE_DATA}"/>
<a:field name="label3" defaultValue="${l:PRODUCT_MASTER_DATA_IMPORT}"/>
<a:field name="label4" defaultValue="${l:IMPORTER_ONLY_SUPPORTS}"/>
<a:field name="label5" defaultValue="${l:READ_THE_ABOVE_CAREFULLY}"/>
<a:field name="label6" defaultValue="${l:THE_IMPORT_IS_COMPLETE}"/>
</a:fields>
</a:dataSet>
</a:dataSets>
<a:fieldSet style="margin-left:10px;margin-top:10px;" title="IMPORT_CONSIDERATIONS" width="400">
<a:label name="label2" bindTarget="label_ds" style="margin-left:10px;" width="380"/>
<a:label name="label3" bindTarget="label_ds" style="margin-left:10px;" width="380"/>
<a:label name="label4" bindTarget="label_ds" style="margin-left:10px;" width="380"/>
<a:label name="label5" bindTarget="label_ds" style="color:#055A78;font-weight:bold;margin-left:10px;"
width="380"/>
<a:box column="2" row="1" style="margin-left:-3px;">
<a:label name="label6" bindTarget="label_ds" style="color:#055A78;font-weight:bold;margin-left:10px;"
width="266"/>
</a:box>
</a:fieldSet>
<a:fieldSet style="margin-left:10px;margin-top:10px;" title="TMPLT_IMPORT_FILE" width="400">
<form name="upload" id="importForm"
action="${/request/@context_path}/modules/cont/CON560/con_contract_finish_import_upload_info.lview?session_id=${/parameter/@session_id}&amp;_csrf=${/session/@_csrf.token}"
enctype="multipart/form-data" method="post">
<label style="margin-left:10px;margin-top:10px;font-size:13px"><![CDATA[${l:PLEASE_SELECT_A_FILE}]]></label>
<input name="CONTENT" id="importFile" style="font-size:15px" type="file"/>
<input onclick="downloadFile()" style="margin-left:10px;margin-top:10px;width:60px;height:23px" type="button" value="模板下载"/>
<input id="con560_upload_id" onclick="saveClick()" style="margin-left:50px;margin-top:10px;width:60px;"
type="button" value="导入"/>
</form>
</a:fieldSet>
</a:view>
</a:screen>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: trd
$Date: 2025-05-06 下午3:48:04
$Revision: 1.0
$Purpose:
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true" xmlns:p="uncertain.proc">
<a:init-procedure>
<p:echo></p:echo>
<a:model-query model="basic.hls_fnd_attribute_sequence" rootPath="header"/>
<a:import-excel header_id="${/model/header/record/@header_id}" separator="," status_field="/parameter/@ImportSuccess" template_code="HLCM_CONTRACT_ZERO" user_id="${/session/@user_id}"/>
<a:model-query defaultWhereClause="header_id=${/model/header/record/@header_id} and TEMPLATE_CODE = &apos;HLCM_CONTRACT_ZERO&apos;" model="basic.hls_fnd_attribute_status" rootPath="status"/>
</a:init-procedure>
<a:view>
<a:link id="contract_finish_save_data_link" model="cont.CON560.con_contract_finish_zero_import" modelaction="execute"/>
<a:link id="con_contract_finish_query_link" url="${/request/@context_path}/modules/cont/CON560/con_contract_finish_maintain.lview"/>
<script><![CDATA[
function success() {
Leaf.showInfoMessage('${l:HLS.PROMPT}', '导入成功', function callback() {
window.location.href =$('con_contract_finish_query_link').getUrl();
});
}
function loadComplete() {
Leaf.Masker.mask(Ext.get(document.documentElement), '正在更新数据。。。');
var param = {};
param['header_id'] = '${/model/header/record/@header_id}';
param['user_id'] = '${/session/@user_id}';
Leaf.request({
url: $('contract_finish_save_data_link').getUrl(),
para: param,
success: function() {
Leaf.Masker.unmask(Ext.get(document.documentElement));
success();
},
error: function() {
Leaf.Masker.unmask(Ext.get(document.documentElement));
},
failure: function() {
Leaf.Masker.unmask(Ext.get(document.documentElement));
},
scope: this
});
}
loadComplete();
]]></script>
</a:view>
</a:screen>
......@@ -6,8 +6,8 @@
$Purpose:
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true">
<a:init-procedure><![CDATA[
]]>
<a:init-procedure>
<a:model-query model="cont.CON620.get_sys_role" rootPath="role_info"/>
</a:init-procedure>
<a:view>
<a:link id="change_et_date_link" model="cont.CON560.con_contract_finish_for_query" modelaction="batch_update"/>
......@@ -22,6 +22,7 @@
url="${/request/@context_path}/modules/cont/CON500/con_contract_update.lview"/>
<a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code"
modelaction="update"/>
<a:link id="con560_con_contract_zero_link" url="${/request/@context_path}/modules/cont/CON560/con_contract_finish_import_upload.lview"/>
<script type="text/javascript"><![CDATA[
function save_et_date_btn(){
var datas=$('con560_contract_result_ds').getJsonData();
......@@ -156,12 +157,24 @@
return;
}
}
//批量提交追加结零合同与非结零合同不能同时提交
for (var k = 0; k < records.length; k++) {
for (var m = k + 1; m < records.length; m++) {
if (records[k].get('is_sbo_zero') != records[m].get('is_sbo_zero')) {
Leaf.showMessage('${l:PROMPT}', "您勾选的合同对应的SBO是否结零标志不一致,请重新勾选!");
return;
}
}
}
var TerminateData = [];
for (var i = 0; i < records.length; i++) {
if(records[i].data.is_terminate=='否'){
$L.showInfoMessage("提示",'未收金额如果不为0不可进行合同结束');
return;
}
jQuery.each(seal_record.data, function(j, v){
records[i].set( j , v );
});
......@@ -289,6 +302,33 @@
}
//只针对非经租合同
function con560_con_contract_zero() {
var win = new Leaf.Window({
id: 'con560_con_contract_zero_window',
params: {
winid:'con560_con_contract_zero_window'
},
url: $('con560_con_contract_zero_link').getUrl(),
title: '导入结零客户',
width: 430,
height: 300
});
win.on('close', function() {
$('con560_contract_result_ds').query();
});
}
//商业伙伴结零按钮仅展示给会计担当
Leaf.onReady(function() {
if ('${/model/role_info/record/@role_code}'!='0014'&&'${/model/role_info/record/@role_code}'!='HAND') {
$('con560_con_contract_zero_id').hide();
}
if ('${/model/role_info/record/@role_code}'=='0014') {
$('con560_con_contract_detail_id').hide();
}
});
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
<a:screen-include
......@@ -300,6 +340,7 @@
<a:dataSet id="con560_lease_organization_name_ds" loadData="true"
model="basic.hls_lease_organization_for_lov"/>
<a:dataSet id="con560_contract_status_grid_ds" lookupCode="CON500_CONTRACT_STATUS"/>
<a:dataSet id="con560_is_sbo_zero_ds" lookupCode="YES_OR_NO"/>
<a:dataSet id="seal_number_ds" lookupCode="SEAL_NUMBER_FINISH"/>
<a:dataSet id="con560_contract_query_ds" autoCreate="true">
<a:fields>
......@@ -330,6 +371,11 @@
<a:map from="description" to="owner_user_id_n"/>
</a:mapping>
</a:field>
<a:field name="is_sbo_zero_desc" displayField="code_value_name"
options="con560_is_sbo_zero_ds" returnField="is_sbo_zero"
valueField="code_value"/>
<a:field name="amount_unreceived_penalty_from"/>
<a:field name="amount_unreceived_penalty_to"/>
<a:field name="contract_status_n" displayField="code_value_name"
options="con560_contract_status_ds" returnField="contract_status"
valueField="code_value"/>
......@@ -378,7 +424,8 @@
<a:screenTitle/>
<a:gridButton click="con560_con_contract_query" text="HLS.QUERY"/>
<a:gridButton click="con560_con_contract_reset" text="HLS.RESET"/>
<a:gridButton click="con560_con_contract_detail" text="合同结束"/>
<a:gridButton id="con560_con_contract_detail_id" click="con560_con_contract_detail" text="合同结束"/>
<a:gridButton id="con560_con_contract_zero_id" click="con560_con_contract_zero" text="结零商业伙伴导入"/>
</a:screenTopToolbar>
<a:form column="5" labelWidth="100" marginWidth="30" title="CON301.CONTRACT_QUERY">
<a:textField name="contract_number" bindTarget="con560_contract_query_ds" prompt="HLS.CONTRACT_NUMBER"/>
......@@ -388,6 +435,9 @@
<!--<a:lov name="owner_user_id_n" bindTarget="con560_contract_query_ds" prompt="出单人"/>-->
<!-- <a:comboBox name="lease_organization_name" bindTarget="con560_contract_query_ds" prompt="事业部"/>-->
<a:comboBox name="contract_status_n" bindTarget="con560_contract_query_ds" prompt="合同状态"/>
<a:numberField name="amount_unreceived_penalty_from" bindTarget="con560_contract_query_ds" prompt="未核销违约金从" align="right"/>
<a:numberField name="amount_unreceived_penalty_to" bindTarget="con560_contract_query_ds" prompt="未核销违约金到" align="right"/>
<a:comboBox name="is_sbo_zero_desc" bindTarget="con560_contract_query_ds" prompt="SBO是否结零"/>
</a:form>
<a:tabPanel id="con560_con_contract_id" marginHeight="100" marginWidth="5">
<a:tabs>
......@@ -420,7 +470,9 @@
<a:column name="amount_interest" prompt="应收利息总额" width="80" renderer="Leaf.formatMoney"/>
<a:column name="amount_received_interest" prompt="已收利息总额" width="80" renderer="Leaf.formatMoney"/>
<a:column name="amount_received_penalty" prompt="已收违约金" width="80" renderer="Leaf.formatMoney"/>
<a:column name="amount_unreceived_penalty" prompt="未收违约金" width="80" renderer="Leaf.formatMoney"/>
<a:column name="et_date" prompt="合同结束日" width="80" editorFunction="date_editor_func" renderer="Leaf.formatDate"/>
<a:column name="is_sbo_zero_desc" prompt="SBO是否结零" width="100"/>
</a:columns>
<a:editors>
<a:datePicker id="date_editor"/>
......
......@@ -21,12 +21,104 @@
url="${/request/@context_path}/modules/cont/CON500/con_contract_update.lview"/>
<a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code"
modelaction="update"/>
<a:link id="change_breach_type_link" model="cont.CON560.con_contract_finish_for_query_wfl" modelaction="batch_update"/>
<script type="text/javascript"><![CDATA[
Leaf.onReady(function(){
console.log('${/parameter/@custom_code}');
console.log('1111');
if('${/parameter/@is_edit}'!='Y'){
if($('con_contract_finish_grid_save_id')){
$('con_contract_finish_grid_save_id').setVisible(false);
}
}
})
function con560_con_contract_detail() {debugger;
function on_grid_load(ds){
records = ds.getAll();
if('${/parameter/@is_edit}'=='Y'){
for (var i = 0;i < records.length;i++) {
if(records[i].get('sum_unreceived_penalty')>0){
records[i].getField('breach_type').setRequired(true);
records[i].getField('breach_type').setReadOnly(false);
records[i].getField('breach_type_desc').setRequired(true);
records[i].getField('breach_type_desc').setReadOnly(false);
records[i].getField('backgroud_description').setReadOnly(false);
}else{
records[i].getField('breach_type').setRequired(false);
records[i].getField('breach_type').setReadOnly(true);
records[i].getField('breach_type_desc').setRequired(false);
records[i].getField('breach_type_desc').setReadOnly(true);
records[i].getField('backgroud_description').setReadOnly(false);
}
}
}else{
for (var i = 0;i < records.length;i++) {
records[i].getField('breach_type').setRequired(false);
records[i].getField('breach_type').setReadOnly(true);
records[i].getField('breach_type_desc').setRequired(false);
records[i].getField('breach_type_desc').setReadOnly(true);
records[i].getField('backgroud_description').setReadOnly(true);
}
}
}
function con_contract_finish_btn(){
var datas=$('con560_contract_result_ds').getJsonData();
if(datas.length==0){
$L.showInfoMessage("提示",'未修改任何数据!');
return;
}else{
var arry=[];
for(var i=0;i<datas.length;i++){
var obj={};
obj.contract_id=datas[i].contract_id;
obj.breach_type=datas[i].breach_type;
obj.backgroud_description=datas[i].backgroud_description;
obj._status=datas[i]._status;
arry.push(obj);
}
//保存数据
var detail_mask=Ext.getBody();
Leaf.Masker.mask(detail_mask);
Leaf.request({
url: $('change_breach_type_link').getUrl(),
para: arry,
success: function() {
Leaf.SideBar.show({
msg: '操作成功',
duration: 2000
});
Leaf.Masker.unmask(detail_mask);
$('con560_contract_result_ds').query();
},
failure: function() {
Leaf.Masker.unmask(detail_mask);
},
error: function() {
Leaf.Masker.unmask(detail_mask);
},
scope: this
});
}
}
//流程提交时校验是否存在未保存数据
if ('${/parameter/@is_edit}' == 'Y') {
zjwfl5110_ApproveChecker_add('zjwfl5110_submit', function (type) {
if (type == 'agree') {
if ($('con560_contract_result_ds').validate()) {
if ($('con560_contract_result_ds').isModified()) {
Leaf.showMessage('${HLS.PROMPT}', '请先保存再提交');
return false;
}
//提交先保存
return true;
} else {
return false;
}
} else return true;
});
}
function con560_con_contract_detail() {
var records = $('con560_contract_result_ds').getSelected();
if (!records.length) {
Leaf.showMessage('${l:PROMPT}', '请至少选择一条记录');
......@@ -89,7 +181,7 @@
}
}
function con560_param_set_value(param) {debugger;
function con560_param_set_value(param) {
param['document_category'] = 'CONTRACT';
param['function_code'] = 'CON301';
param['function_usage'] = 'QUERY';
......@@ -165,6 +257,7 @@
<a:dataSet id="con560_lease_organization_name_ds" loadData="true"
model="basic.hls_lease_organization_for_lov"/>
<a:dataSet id="con560_contract_status_grid_ds" lookupCode="CON500_CONTRACT_STATUS"/>
<a:dataSet id="breachTypeDs" lookupCode="BREACH_TYPE"/>
<a:dataSet id="con560_contract_query_ds" autoCreate="true">
<a:fields>
<a:field name="bp_name" autoComplete="true" lovGridHeight="350" lovHeight="500" lovLabelWidth="100"
......@@ -202,10 +295,15 @@
<a:field name="contract_status_n" displayField="code_value_name"
options="con560_contract_status_grid_ds" returnField="contract_status"
valueField="code_value"/>
<a:field name="breach_type_desc" displayField="code_value_name"
options="breachTypeDs" returnField="breach_type"
valueField="code_value"/>
<a:field name="backgroud_description"/>
</a:fields>
<a:events>
<a:event name="indexChange" handler="onIndexChange"/>
<a:event name="query" handler="aut_authority_list_validate_query"/>
<a:event name="load" handler="on_grid_load"/>
</a:events>
</a:dataSet>
<a:dataSet id="con560_contract_op_result_ds" autoPageSize="true" autoQuery="true"
......@@ -240,6 +338,9 @@
<a:case value="N">
<a:grid id="con560_con_contract_grid_ds" bindTarget="con560_contract_result_ds" marginHeight="365"
marginWidth="30" navBar="true">
<a:toolBar>
<a:button id="con_contract_finish_grid_save_id" click='con_contract_finish_btn' icon="${/request/@context_path}/images/save.png" text="保存"/>
</a:toolBar>
<a:columns>
<a:column name="contract_number" lock="true" prompt="HLS.CONTRACT_NUMBER"
renderer="con560_render_contractMaintainDs_grid" width="150"/>
......@@ -263,9 +364,17 @@
<a:column name="amount_interest" prompt="应收利息总额" width="80" renderer="Leaf.formatMoney"/>
<a:column name="amount_received_interest" prompt="已收利息总额" width="80" renderer="Leaf.formatMoney"/>
<a:column name="amount_received_penalty" prompt="已收违约金" width="80" renderer="Leaf.formatMoney"/>
<a:column name="sum_unreceived_penalty" prompt="未收违约金" width="80" renderer="Leaf.formatMoney"/>
<a:column name="et_date" prompt="合同结束日" width="80" renderer="Leaf.formatDate"/>
<a:column name="is_sbo_zero_desc" prompt="SBO是否结零" width="100"/>
<a:column name="breach_type_desc" prompt="违约金减免原因" editor="breachTypeDs_grid_editor_comb" width="100"/>
<a:column name="backgroud_description" prompt="备注" editor="description_grid_editor_tf" width="200"/>
</a:columns>
<a:editors>
<a:comboBox id="breachTypeDs_grid_editor_comb"/>
<!--<a:textField id="description_grid_editor_tf"/>-->
<a:textArea id="description_grid_editor_tf"/>
</a:editors>
</a:grid>
<a:tabPanel marginHeight="420" marginWidth="30">
<a:tabs>
......
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