Commit 1d93ef9d authored by congzhao's avatar congzhao

[建机]电子合同开发 配偶是否签署以及签署校验调整,下载文件调整

parent f053a568
......@@ -63,6 +63,7 @@
<bm:field name="finance_type"/>
<bm:field name="secondary_lease"/>
<bm:field name="marital_status_flag"/>
<bm:field name="sp_sign_flag"/>
<bm:field name="vender_id"/>
<bm:field name="vender_id_n" expression="(decode(vender_id,-100,'买断机',(select scv.bp_name from hls_bp_master scv where scv.enabled_flag=&apos;Y&apos; and scv.bp_id = t1.vender_id)))" forInsert="false" forUpdate="false"/>
......
......@@ -19,10 +19,17 @@
</bm:operation>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select * from (select cf.ele_flow_id,cf.contract_id
select *
from (select cf.ele_flow_id, cf.contract_id
FROM CON_CONTRACT_ELE_FLOW cf
where cf.ele_flow_type in ('CE','AE')
and cf.revoke_flag is null) t
where cf.ele_flow_type in ('CE', 'AE')
and cf.revoke_flag is null
union all
select ce.ele_flow_id, ce.contract_id
from con_contract_ele_flow ce
where ce.ele_flow_type = 'ET'
and ce.revoke_flag is null
and ce.flow_status is null) t
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
......@@ -37,7 +44,7 @@
where c.contract_id = ${@contract_id};
delete from con_contract_ele_signer cs where cs.contract_id = ${@contract_id};
delete from CON_CONTRACT_ELE_FLOW t where t.ele_flow_type in ('CE','AE') and t.contract_id = ${@contract_id};
delete from CON_CONTRACT_ELE_FLOW t where t.ele_flow_type in ('CE','AE','ET') and t.contract_id = ${@contract_id};
commit;
end;
]]></bm:update-sql>
......
......@@ -92,7 +92,7 @@ select *
and ccb.contract_id = t1.contract_id
and ccb.bp_category in ('TENANT', 'GUARANTOR')
and (ccb.id_card_no = ${@id_no} or
ccb.id_no_sp = ${@id_no}))) or
(ccb.id_no_sp = ${@id_no} and ccb.sp_sign_flag = 'Y')))) or
(${@account_type} = 'AG' and exists
(select 1
from hls_bp_master_signer hs
......@@ -110,6 +110,9 @@ select *
where hs.hls_bp_signer_id = cr.signer
and cr.change_req_id = t1.contract_id
and hs.id_card = ${@id_no})
and exists (select 1 from hls_bp_master hbm
where hbm.bp_id = t1.bp_id_tenant
and hbm.social_code = ${@organization_id})
and exists (select 1 from con_contract_ele_signer cs
where cs.id_no = ${@id_no}
and cs.contract_id = t1.contract_id)
......
......@@ -32,24 +32,30 @@
cs.mobile,
hs.signer_category,
cs.esign_type,
(select hm.legal_person
(select nvl(hm.bp_name_leg,hm.legal_person)
from con_contract_bp cb, hls_bp_master hm
where cb.bp_id = hm.bp_id
and cb.contract_id = cs.contract_id
and cb.bp_category = 'TENANT'
and hm.social_code = cs.id_no
and cb.bp_class = 'ORG') legal_person,
(select hm.id_card_no_leg
from con_contract_bp cb, hls_bp_master hm
where cb.bp_id = hm.bp_id
and cb.contract_id = cs.contract_id
and cb.bp_category = 'TENANT'
and hm.social_code = cs.id_no
and cb.bp_class = 'ORG') id_card_no_leg
from con_contract_ele_signer cs, hls_doc_file_templet_signer hs,con_contract_content cc,con_clause_templet ct
where cs.templet_signer_id = hs.templet_signer_id
and ct.doc_template_id = hs.templet_id
and ct.templet_id = cc.templet_id
and cs.contract_id = cc.contract_id
and cc.clause_usage = 'AGENT_CONTRACT') t
and cc.clause_usage = 'AGENT_CONTRACT'
and not exists (select 1
from con_contract_bp cb
where cb.contract_id = cc.contract_id
and hs.signer_category = (cb.bp_category || '_SP')
and cb.sp_sign_flag = 'N'
and cb.id_no_sp = cs.id_no)) t
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
......@@ -58,5 +64,6 @@
<bm:query-field name="contract_id" queryExpression="t.contract_id= ${@contract_id}"/>
<bm:query-field name="signer_category" queryExpression="t.signer_category= ${@signer_category}"/>
<bm:query-field name="esign_type" queryExpression="t.esign_type= ${@esign_type}"/>
<bm:query-field name="id_no" queryExpression="t.id_no= ${@id_no}"/>
</bm:query-fields>
</bm:model>
......@@ -32,24 +32,30 @@
cs.mobile,
hs.signer_category,
cs.esign_type,
(select hm.legal_person
(select nvl(hm.bp_name_leg,hm.legal_person)
from con_contract_bp cb, hls_bp_master hm
where cb.bp_id = hm.bp_id
and cb.contract_id = cs.contract_id
and cb.bp_category = 'TENANT'
and hm.social_code = cs.id_no
and cb.bp_class = 'ORG') legal_person,
(select hm.id_card_no_leg
from con_contract_bp cb, hls_bp_master hm
where cb.bp_id = hm.bp_id
and cb.contract_id = cs.contract_id
and cb.bp_category = 'TENANT'
and hm.social_code = cs.id_no
and cb.bp_class = 'ORG') id_card_no_leg
from con_contract_ele_signer cs, hls_doc_file_templet_signer hs,con_contract_content cc,con_clause_templet ct
where cs.templet_signer_id = hs.templet_signer_id
and ct.doc_template_id = hs.templet_id
and ct.templet_id = cc.templet_id
and cs.contract_id = cc.contract_id
and cc.clause_usage != 'AGENT_CONTRACT') t
and cc.clause_usage != 'AGENT_CONTRACT'
and not exists (select 1
from con_contract_bp cb
where cb.contract_id = cc.contract_id
and hs.signer_category = (cb.bp_category || '_SP')
and cb.sp_sign_flag = 'N'
and cb.id_no_sp = cs.id_no)) t
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
......@@ -58,5 +64,6 @@
<bm:query-field name="contract_id" queryExpression="t.contract_id= ${@contract_id}"/>
<bm:query-field name="signer_category" queryExpression="t.signer_category= ${@signer_category}"/>
<bm:query-field name="esign_type" queryExpression="t.esign_type= ${@esign_type}"/>
<bm:query-field name="id_no" queryExpression="t.id_no= ${@id_no}"/>
</bm:query-fields>
</bm:model>
......@@ -49,7 +49,13 @@ select *
hs.signer_category
from con_contract_ele_signer cs, hls_doc_file_templet_signer hs
where cs.templet_signer_id = hs.templet_signer_id
and cs.esign_type = 'CE') t
and cs.esign_type = 'CE'
and not exists (select 1
from con_contract_bp cb
where cb.contract_id = cs.contract_id
and cb.sp_sign_flag = 'N'
and hs.signer_category = (cb.bp_category || '_SP')
and cb.id_no_sp = cs.id_no)) t
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
......
......@@ -17,7 +17,7 @@
select c.contract_id, c.ele_flow_id
from con_contract_ele_flow c
where nvl(c.ele_file_dl_flag,'N') = 'N'
and c.flow_status = 2) t1
and (c.flow_status = 2 or c.flow_status is null)) t1
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
......@@ -39,8 +39,7 @@
update con_contract_ele_flow cr
set cr.ele_file_dl_flag = 'Y',
cr.last_update_date = sysdate
where cr.ele_flow_id =${@flow_id}
and cr.contract_id =${@contract_id};
where cr.ele_flow_id =${@flow_id};
COMMIT;
END;
]]></bm:update-sql>
......
......@@ -47,7 +47,13 @@
hs.signer_category
from con_contract_ele_signer cs, hls_doc_file_templet_signer hs
where cs.templet_signer_id = hs.templet_signer_id
and cs.esign_type = 'ET') t
and cs.esign_type = 'ET'
and not exists (select 1
from con_contract_bp cb
where cb.contract_id = cs.contract_id
and cb.sp_sign_flag = 'N'
and hs.signer_category = (cb.bp_category || '_SP')
and cb.id_no_sp = cs.id_no)) t
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
......
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="update">
<bm:update-sql><![CDATA[
BEGIN
update con_contract cc
set cc.ec_sign_type = 'SIGNED',
cc.sign_contract_status = 'SIGN',
cc.last_update_date = sysdate
where cc.contract_id =
(select cf.contract_id
from con_contract_ele_flow cf
where cf.ele_flow_id = ${@flow_id}
and cf.ele_flow_type in ('CE', 'ET'));
update con_contract_ele_flow cf
set cf.flow_status = ${@flow_status},
cf.last_update_date = sysdate
where cf.ele_flow_id = ${@flow_id};
update con_contract_ele_signer cs
set cs.ec_sign_status = 'Y',
cs.last_update_date = sysdate
where cs.contract_id =
(select cf.contract_id
from con_contract_ele_flow cf
where cf.ele_flow_id = ${@flow_id});
END;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="execute">
<bm:update-sql><![CDATA[
begin
update con_contract c
set c.ec_sign_type = 'NEW',
c.sign_contract_status = 'NEW',
c.last_update_date = sysdate,
c.last_updated_by = nvl(${/session/@user_id},'1')
where c.contract_id = (select cf.contract_id
from con_contract_ele_flow cf
where cf.ele_flow_id = ${@flow_id}
and cf.ele_flow_type in ('CE', 'ET'));
delete from con_contract_ele_signer cs where cs.contract_id =
(select cf.contract_id
from con_contract_ele_flow cf
where cf.ele_flow_id = ${@flow_id}
and cf.ele_flow_type in ('CE', 'ET'));
delete from CON_CONTRACT_ELE_FLOW t where t.ele_flow_id = ${@flow_id};
commit;
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
......@@ -24,6 +24,7 @@
<a:dataSet id="other_tmpt_clause_ds" lookupCode="CON202_CON_PRINT_OTHER_CONDITON"/>
<a:dataSet id="district_ds" lookupCode="PRJ500N_DISTRICT_AREAS"/>
<a:dataSet id="marital_status_flag_ds" lookupCode="EXIST_OR_NOT"/>
<a:dataSet id="sp_sign_flag_ds" lookupCode="YES_NO"/>
<a:dataSet id="clause_basinfo" autoCreate="true">
<a:fields>
<a:field name="template_code" defaultValue="${/parameter/@tmpt_code}" readOnly="true"/>
......@@ -36,6 +37,7 @@
<a:field name="pay_method_n" displayField="code_value_name" options="pay_methods_ds" returnField="pay_method" valueField="code_value"/>
<a:field name="secondary_lease_n" displayField="code_value_name" options="secondary_lease_ds" returnField="secondary_lease" valueField="code_value"/>
<a:field name="marital_status_flag_n" displayField="code_value_name" options="marital_status_flag_ds" returnField="marital_status_flag" valueField="code_value"/>
<a:field name="sp_sign_flag_n" displayField="code_value_name" options="sp_sign_flag_ds" returnField="sp_sign_flag" valueField="code_value"/>
<a:field name="finance_type"/>
<a:field name="finance_type_n" displayField="code_value_name" options="con202_finance_type" returnField="finance_type" valueField="code_value"/>
<a:field name="contract_number" lovGridHeight="360" lovHeight="540" lovService="basic.con_contract_for_lov" lovWidth="680">
......@@ -137,6 +139,7 @@
<a:column name="first_contract_flag" editor="check" prompt="首个支付表标志" width="120"/>
<!--add by 24976-->
<a:column name="marital_status_flag_n" editor="cb" prompt="有无配偶" width="100"/>
<a:column name="sp_sign_flag_n" editor="cb" prompt="配偶是否签署" width="100"/>
<a:column name="other_tmpt_clause_n" editor="cb" prompt="其他" width="100"/>
</a:columns>
......
<?xml version="1.0" encoding="UTF-8"?><!-- $Author: zlf $Date: 2014-11-10 下午5:42:24 $Revision: 1.0 $Purpose: --><a:screen xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" customizationEnabled="true" dynamiccreateenabled="true" trace="true"> <a:init-procedure> <a:model-query fetchAll="true" model="cont.CON500.con_contract_get_guid_file_name" rootPath="file_name_path"/> <s:server-script import="contract_print_path.js"><![CDATA[ $ctx.parameter.file_path = con_print_path['con_print_path']; $ctx.parameter.tomcat_source = con_print_path['tomcat_source']; ]]> </s:server-script> <s:server-script import="con_print_path.js"><![CDATA[ set_parameter_file_path(); ]]> </s:server-script> </a:init-procedure> <a:view> <a:link id="wfl_readonly_pageLink_projectQueryScreen_update_project" url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_maintain_readonly.lview"/> <a:link id="${/parameter/@layout_code}_con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/> <a:link id="${/parameter/@layout_code}_con_contract_content_confirm_link_id" url="${/request/@context_path}/modules/cont/CON501N/con_contract_content_confirm.lview"/> <a:link id="contract_lease_item_query_link" url="${/request/@context_path}/modules/cont/CON505/con_lease_item_query.lview"/> <a:link id="contract_history_window_link" url="${/request/@context_path}/modules/cont/CON501N/con_document_history_query.lview"/> <a:link id="con505_hls_bp_master_query_link" url="${/request/@context_path}/modules/cont/CON505/hls_bp_master_query.lview"/> <a:link id="${/parameter/@layout_code}_prj500_cdd_uploadFile_id" url="${/request/@context_path}/uploadFile.lview"/> <a:link id="${/parameter/@layout_code}_prj500_cdd_downloadFile_id" url="${/request/@context_path}/downloadFile.lview"/> <!--打印使用--> <a:link id="${/parameter/@layout_code}_con505_contract_content_id" model="cont.CON505.con505_contract_content" modelaction="update"/> <a:link id="${/parameter/@layout_code}_creat_con_contract_content_link_id" model="cont.CON505.con505_contract_content" modelaction="execute"/> <a:link id="${/parameter/@layout_code}_file_copy_from_template_link_id" url="${/request/@context_path}/modules/cont/CON505/file_copy_from_template.lsc"/> <a:link id="${/parameter/@layout_code}_con_batch_dl_link_id" url="${/request/@context_path}/modules/cont/CON505/con_atm_batch_dl.lsc"/> <a:link id="${/parameter/@layout_code}_con_cashflow_wirte_off_detail_link" url="${/request/@context_path}/modules/cont/CON302N/con_cashflow_wirte_off_detail.lview"/> <a:link id="con_approval_link_id" model="cont.CON505.contract_approval" modelaction="update"/> <a:link id="con_sign_cancel_link_id" model="cont.CON505.contract_sign_cancel" modelaction="update"/> <a:link id="${/parameter/@layout_code}_con_ele_content_create_link_id" url="${/request/@context_path}/modules/wx/WX100/con_ele_content_create.lsc"/> <a:link id="${/parameter/@layout_code}_con_ele_agent_link_id" url="${/request/@context_path}/modules/wx/WX100/con_ele_agent_content_create.lsc"/> <a:link id="${/parameter/@layout_code}_con_ele_sign_cancel_link_id" url="${/request/@context_path}/modules/cont/CON505/con_ele_sign_cancel.lsc"/> <a:link id="${/parameter/@layout_code}_ele_operator_verify_link_id" url="${/request/@context_path}/modules/wx/WX100/wx_ele_verify_operator.lsc"/> <link href="${/request/@context_path}/css/lightbox.css" rel="stylesheet" type="text/css"/> <script src="${/request/@context_path}/javascripts/lightbox.js" type="text/javascript"/> <script type="text/javascript"><![CDATA[ Ext.ux.Lightbox.register('a[ref=img]', true); function lock_current_window() { Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}'); } function unlock_current_window() { Leaf.Masker.unmask(Ext.getBody()); } window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function () { var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); var contract_id = $(ds_id).getCurrentRecord().get('contract_id'); new Leaf.Window({ id: 'contract_history_window', url: $('contract_history_window_link').getUrl(), params: { contract_id: contract_id }, fullScreen: true }); }; // window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record) { // if (name == 'car_detail') { // return '<a href="javascript:open_contract_window(\'' + record.id + '\',\'' + record.ds.id + '\')">' + config_record.get('prompt') + '</a>'; // } // return value; // }; window['${/parameter/@layout_code}_received_amount_detail'] = function (ds_id, id, name, query_only) { var url = $('${/parameter/@layout_code}_con_cashflow_wirte_off_detail_link').getUrl(); var record = $(ds_id).findById(id); if (record) { var win = new Leaf.Window({ id: 'con_cashflow_wirte_off_detail_window', url: url, params: { cashflow_id: record.get('cashflow_id'), winid: 'con_cashflow_wirte_off_detail_window' }, draggable: true, fullScreen: true }); } }; window['${/parameter/@layout_code}_dynamic_link_renderer'] = function (value, record, name, config_record, bp_seq) { var link_function = ''; window['${/parameter/@layout_code}_hls_link_render_record'][record.id + '---' + name] = record; if (name == 'project_number') { return '<a href="javascript:wfl_prj501_grid_update(\'' + record.id + '\',\'' + record.ds.id + '\')">' + value + '</a>'; } else if (name == 'gps_attch') { link_function = '${/parameter/@layout_code}_ast_con_cdd4_attachtment_upload'; if (record.get('atm_num3') > 0) { return '<a style="color:red" href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>'; } else { return '<a style="font-weight:bolder;font-size:1.2em" href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>'; } } else if (name == 'description') { if (record.get('important_flag') == 'Y') { return '<font color="RED">' + value + '</font>'; } return value; } else if (name == 'bp_link' && record.get('bp_id') && record.get('record_id')) { link_function = '${/parameter/@layout_code}_open_bp_detail_window'; return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\');">' + config_record.get('prompt') + '</a>'; } else if (name == 'car_detail' && record.get('contract_lease_item_id')) { link_function = '${/parameter/@layout_code}_open_lease_item_detail_window'; return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\');">' + config_record.get('prompt') + '</a>'; } else if (name == 'attachment') { link_function = '${/parameter/@layout_code}_prj500_cdd_attachtment_upload'; return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>'; } else if (name == 'attach_file_name' || name == 'attach_file_name_print' || name == 'attachment_new') { var content_type = record.get('content_type'); var content_id = record.get('content_id'); //电子合同 // if(content_type == '01'){ // var link = '${/request/@context_path}/modules/xxx/pdf_download.lsc?type=SIN&content_id=' + content_id; // var url = ''; // url = url + '<a href=' + link + '>' + '下载' + '</a>' + ','; // return url; // }else { if (value != null) { var link = '${/request/@context_path}/atm_download.lsc?attachment_id='; var str = value.split(';;'); var url = ''; for (var i = 0; i < str.length; i++) { var temp = str[i].split('--'); if (!Leaf.isEmpty(temp[0])) { var file_name = temp[0].toUpperCase(); var file_suffix = temp[0].substr(temp[0].lastIndexOf('.') + 1).toUpperCase(); if (file_name.indexOf('.PDF') >= 0) { url = url + '<a href=javascript:view_pdf(\'' + temp[1] + '\')>' + temp[0] + '</a>' + ','; } else if (file_suffix == 'BMP' || file_suffix == 'JPG' || file_suffix == 'JPEG' || file_suffix == 'PNG' || file_suffix == 'GIF') { url = url + '<a href=' + link + temp[1] + ' ref="img">' + temp[0] + '</a>' + ','; } else { url = url + '<a href=' + link + temp[1] + '>' + temp[0] + '</a>' + ','; } } } return url; } //} } else if (name == 'received_amount') { link_function = '${/parameter/@layout_code}_received_amount_detail'; if (value) { return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + Leaf.formatMoney(value) + '</a>'; } return ''; } else if (name == 'attach_file_name_new') { link_function = '${/parameter/@layout_code}_prj500_cdd_attachtment_new_upload'; return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>'; } }; function wfl_prj501_grid_update(record_id, ds_id) { var record = $(ds_id).findById(record_id); var param = {}; param['bp_class'] = record.get('bp_class'); param['project_id'] = record.get('project_id'); param['function_code'] = 'PRJ502D'; param['function_usage'] = 'QUERY'; param['url_title'] = '租赁申请查询'; hls_doc_get_layout_code('${/parameter/@layout_code}_con_contract_get_layout_code_link_id', param, 'wfl_readonly_pageLink_projectQueryScreen_update_project', record.ds.id, '${/parameter/@layout_code}'); } window['${/parameter/@layout_code}_ast_con_cdd4_attachtment_upload'] = function (ds_id, id, name, query_only) { var record = $(ds_id).findById(id); // if (record.get('con_contract_id')) { var url; if (query_only == 'Y') { url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=CON_CONTRACT&header_id=' + record.get('contract_id'); } else { url = $('${/parameter/@layout_code}_prj500_cdd_uploadFile_id').getUrl() + '?table_name=CON_CONTRACT&header_id=' + record.get('contract_id'); } var win = new Leaf.Window({ url: url, title: 'gps附件上传', id: '${/parameter/@layout_code}${/parameter/@tree_code}_ast_con_cdd4_attachtment_upload_id', width: 850, height: 400 }); // win.on('close', function(){ // $(ds_id).query(); // }); // } else { // Leaf.showMessage('${l:HLS.PROMPT}', '请先保存!'); // } }; window['${/parameter/@layout_code}_open_lease_item_detail_window'] = function (id, name) { var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name]; var param = record.data; var contract_lease_item_id = record.get('contract_lease_item_id'); new Leaf.Window({ id: 'contract_lease_item_maintain_window', url: $('contract_lease_item_query_link').getUrl(), params: { contract_lease_item_id: contract_lease_item_id, winid: 'contract_lease_item_maintain_window' }, draggable: true, fullScreen: true }); }; window['${/parameter/@layout_code}_open_bp_detail_window'] = function (id, name) { var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name]; var param = {};//record.data; param['bp_id'] = record.get('bp_id'); param['cdd_list_id'] = record.get('cdd_list_id'); param['company_id'] = '${/session/company_id}'; param['document_id'] = record.get('bp_id'); param['document_category'] = 'BP'; param['bp_class'] = record.get('bp_class'); param['bp_category'] = record.get('bp_category'); if (record.get('bp_category') == 'AGENT') { param['function_code'] = 'HLS303_Q'; param['function_usage'] = 'QUERY'; } else { param['function_code'] = 'CON505H'; param['function_usage'] = 'QUERY'; } param['bp_type'] = record.get('bp_type'); param['download'] = 'Y'; param['url_title'] = '${l:HLS212.BP_MASTER_QUERY}'; hls_doc_get_layout_code('${/parameter/@layout_code}_con_contract_get_layout_code_link_id', param, 'con505_hls_bp_master_query_link', record.ds.id, '${/parameter/@layout_code}'); }; // function open_contract_window(record_id, ds_id) { // var record = $(ds_id).findById(record_id); // var param = record.data; // var contract_lease_item_id = record.get('contract_lease_item_id'); // new Leaf.Window({ // id: 'contract_lease_item_maintain_window', // url: $('contract_lease_item_maintain_link').getUrl(), // params: { // contract_lease_item_id: contract_lease_item_id // }, // fullScreen: true // }); // // param['function_code'] = 'CON501D'; // // param['function_usage'] = 'MODIFY'; // // param['maintain_type'] = 'UPDATE'; // // param['url_title'] = '${l:CON301.CONTRACT_DETAIL}'; // // hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'con_contract_modify_link',ds_id); // } window['${/parameter/@layout_code}_prj500_cdd_attachtment_upload'] = function (ds_id, id, name, query_only) { var record = $(ds_id).findById(id); if (record.get('check_id')) { var url; //add by lijingjing 2019-11-15 if (record.get('attachment_tab_group') == 'CREDIT_CHECK' && '${/parameter/@query_only}' == 'Y') { url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id'); } else if (record.get('attachment_tab_group') == 'SIGN' && '${/parameter/@con_query_only}' == 'N') { url = $('${/parameter/@layout_code}_prj500_cdd_uploadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id'); } else if (record.get('attachment_tab_group') == 'SIGN' && '${/parameter/@con_query_only}' == 'Y') { url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id'); } else if (query_only == 'Y' || '${/parameter/@download}' == 'Y') { url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id'); } else { url = $('${/parameter/@layout_code}_prj500_cdd_uploadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id'); } var win = new Leaf.Window({ url: url, title: '${l:HLS.SUPPORTING_DOCUMENT}', id: '${/parameter/@layout_code}${/parameter/@tree_code}_prj500_cdd_uploadFile_screen_id', width: 850, height: 400 }); win.on('close', function () { record.ds.query(); }); } else { Leaf.showMessage('${l:HLS.PROMPT}', '请先保存!'); } }; window['${/parameter/@layout_code}_prj500_cdd_attachtment_new_upload'] = function (ds_id, id, name, query_only) { var record = $(ds_id).findById(id); if (record.get('check_id')) { var url; //add by lijingjing 2019-11-15 if (query_only == 'Y' || '${/parameter/@download}' == 'Y') { url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=CON_CONTRACT&header_id=' + record.get('check_id'); } else { url = $('${/parameter/@layout_code}_prj500_cdd_uploadFile_id').getUrl() + '?table_name=CON_CONTRACT&header_id=' + record.get('check_id'); } var win = new Leaf.Window({ url: url, title: '${l:HLS.SUPPORTING_DOCUMENT}', id: '${/parameter/@layout_code}${/parameter/@tree_code}_prj500_cdd_uploadFile_screen_id', width: 850, height: 400 }); win.on('close', function () { record.ds.query(); }); } else { Leaf.showMessage('${l:HLS.PROMPT}', '请先保存!'); } }; window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function () { // var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); var record = $(ds_id).getCurrentRecord(); var content_id; //alert($('${/parameter/@layout_code}_con505_contract_content_id').getUrl); Leaf.request({ url: $('${/parameter/@layout_code}_con505_contract_content_id').getUrl(), para: { content_id: content_id, contract_id: record.get('contract_id'), contract_bp_id: record.get('content_bp_pk'), clause_usage: 'GH_WITHHOLD_AGREE' }, success: function (rsc) { // //alert(rsc.result.content_id); Leaf.request({ url: $('${/parameter/@layout_code}_creat_con_contract_content_link_id').getUrl(), para: { content_id: rsc.result.content_id, file_path: '${/parameter/@file_path}' }, success: function () { Leaf.request({ url: $('${/parameter/@layout_code}_file_copy_from_template_link_id').getUrl(), para: { contract_id: record.get('contract_id'), content_id: rsc.result.content_id, file_path: '${/parameter/@file_path}', batch_flag: 'Y' }, success: function () { var url = $('${/parameter/@layout_code}_con_batch_dl_link_id').getUrl() + '?contract_id=' + record.get('contract_id') + '&content_id=' + rsc.result.content_id; window.open(url, '_self'); unlock_current_window(); } }); unlock_current_window(); }, error: function () { unlock_current_window(); }, failure: function () { unlock_current_window(); }, scope: this }); }, error: function () { unlock_current_window(); }, failure: function () { unlock_current_window(); }, scope: this }); }; window['${/parameter/@layout_code}_user_button3_layout_dynamic_click'] = function () { var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); var record = $(ds_id).getCurrentRecord(); var direct_debit_bank_id = record.get('direct_debit_bank_id'); var dd_bank_account_name = record.get('dd_bank_account_name'); var dd_bank_account_num = record.get('dd_bank_account_num'); if (!Ext.isEmpty(record.get('contract_number'))) { new Leaf.Window({ id: '${/parameter/@layout_code}_con_contract_content_confirm_win_id', params: { action: 'VIEW', contract_id: record.get('contract_id'), company_id: record.get('company_id'), document_category: record.get('document_category'), business_type: record.get('business_type'), winid: '${/parameter/@layout_code}_con_contract_content_confirm_win_id' }, url: $('${/parameter/@layout_code}_con_contract_content_confirm_link_id').getUrl(), title: '合同查看', width: 1300, height: 550 }); } else { Leaf.showErrorMessage('错误', '请先点击保存生成合同编号!'); } }; var change_flag = 'N'; //工作流中合同文本生成按钮 //基本信息tab页 新增必输字段的校验 add by liukang 20160328 window['${/parameter/@layout_code}_print_layout_dynamic_click'] = function () { var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); var con_lease_item_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_lease_item'); var record = $(ds_id).getCurrentRecord(); var con_lease_record = $(con_lease_item_id).getCurrentRecord(); var direct_debit_bank_id = record.get('direct_debit_bank_id'); var dd_bank_account_name = record.get('dd_bank_account_name'); var dd_bank_account_num = record.get('dd_bank_account_num'); var color_of_apprearance = con_lease_record.get('color_of_apprearance'); var item_frame_number = con_lease_record.get('item_frame_number'); var item_engine_number = con_lease_record.get('item_engine_number'); var license_number = con_lease_record.get('license_number'); /* if (Ext.isEmpty(direct_debit_bank_id)) { Leaf.showMessage('${l:HLS.PROMPT}', '请先填写数据并保存!'); } else */ if (!Ext.isEmpty(record.get('contract_number'))) { var win = new Leaf.Window({ id: '${/parameter/@layout_code}_con_contract_content_confirm_win_id', params: { contract_id: record.get('contract_id'), company_id: record.get('company_id'), document_category: record.get('document_category'), business_type: record.get('business_type'), winid: '${/parameter/@layout_code}_con_contract_content_confirm_win_id', change_flag: change_flag, contract_name: record.get('contract_name'), contract_number: record.get('contract_number') }, url: $('${/parameter/@layout_code}_con_contract_content_confirm_link_id').getUrl(), title: '合同文本生成', width: 1300, height: 550 }); //在关闭页面之后,刷新一下ds win.on('close', function () { if (ds_id) { $(ds_id).query(); } }); } else { Leaf.showErrorMessage('错误', '请先点击保存生成合同编号!'); } }; //add by zhuxianfei 20180207 function view_pdf(attachment_id) { Leaf.request({ url: '${/request/@context_path}/autocrud/fnd.fnd_atm_attachment/query', para: { attachment_id: attachment_id }, success: function (res) { var path = res.result.record.file_path; path = path.substr(path.indexOf('hls_attachment')); var tomcat_source = '${/parameter/@tomcat_source}'; var source_path = 'http://' + window.location.host + '/' + tomcat_source + '/' + path + '?type=pdf'; var oWin = window.open(source_path); }, scope: this }); } window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_query'] = function (ds, qpara, bp_seq) { var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_bs_score'); if (ds.id == ds_id) { qpara.contract_id = '${/parameter/@contract_id}'; //$(ds_id).setQueryParameter('contract_id', '${/parameter/@contract_id}'); } }; window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_form_add_and_load'] = function (ds, record, config_records, bp_seq) { debugger; var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); if (ds_id == ds.id && ds_id) { //业务类型回租时,默认只读“首付款抵扣”选项 if (record.get('business_type') == 'LEASEBACK' && '${/parameter/@function_usage}' == 'MODIFY') { //document.getElementById('${/parameter/@layout_code}_F_BASIC_1_CON_CONTRACT_ENTRUSTED_AMOUNT_prompt').style.display = 'block'; // document.getElementById('${/parameter/@layout_code}_F_BASIC_1_CON_CONTRACT_ENTRUSTED_AMOUNT').style.display = 'block'; record.getField('entrusted_amount').setRequired(true); } else if (record.get('business_type') == 'LEASE') { document.getElementById('${/parameter/@layout_code}_F_BASIC_1_CON_CONTRACT_ENTRUSTED_AMOUNT_prompt').style.display = 'none'; document.getElementById('${/parameter/@layout_code}_F_BASIC_1_CON_CONTRACT_ENTRUSTED_AMOUNT').style.display = 'none'; } if(record.get('bp_class') == 'NP' || record.get('sign_type_n') == '纸质签约'){ record.getField('signer_n').setReadOnly(true); record.getField('signer_n').setRequired(false); record.set('signer_n',''); }else if ('${/parameter/@function_usage}' == 'MODIFY' && record.get('sign_type_n') == '电子签约' && record.get('bp_class') == 'ORG'){ record.getField('signer_n').setReadOnly(false); record.getField('signer_n').setRequired(true); } } }; //更新时调用 window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_update'] = function(ds, record, name, value, old_value, bp_seq) { var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); if (ds_id == ds.id && ds_id) { var record = $(ds_id).getCurrentRecord(); var bp_tenant_class = record.get('bp_class'); if (name == 'sign_type_n') { if(value == '纸质签约'){ record.getField('signer_n').setReadOnly(true); record.getField('signer_n').setRequired(false); record.set('signer_n',''); }else if (value == '电子签约' && bp_tenant_class == 'ORG'){ record.getField('signer_n').setReadOnly(false); record.getField('signer_n').setRequired(true); record.set('ec_sign_type','NEW'); record.set('sign_contract_status','NEW'); }else if(value == '电子签约' && bp_tenant_class == 'NP'){ record.getField('signer_n').setReadOnly(true); record.set('ec_sign_type','NEW'); record.set('sign_contract_status','NEW'); } } } }; /*保存前调用校验*/ window['${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function (ds, record) { debugger; var check_flag = true; var contract_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); var con_record = $(contract_ds_id).getAt(0); if (contract_ds_id == ds.id&&$(contract_ds_id).validate()) { if (con_record.get('business_type') == 'LEASEBACK') { //“保存”按钮增加校验:若所填写小于0或大于设备款价格,点击按钮校验提示:“委托付款金额有误,请重新填写!” if (con_record.get('entrusted_amount') < 0 || con_record.get('entrusted_amount') > minus(con_record.get('lease_item_amount'),con_record.get('down_payment'))) { Leaf.showMessage('${HLS.PROMPT}', '委托付款金额有误,请重新填写!'); return false; } } } else { check_flag = false; } return check_flag; }; //取消签约按钮 add by 24976 window['${/parameter/@layout_code}_user_button4_layout_dynamic_click'] = function () { var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); var record = $(ds_id).getCurrentRecord(); var contract_id = record.get('contract_id'); var sign_contract_status = record.get('sign_contract_status'); var sign_type = record.get('sign_type') || 'PAPER_SIGN'; if (sign_contract_status != 'SIGNING') { Leaf.showMessage('${l:PROMPT}', '只有签约中的合同可以取消签约'); return; } if (sign_contract_status == 'SIGNING' && sign_type == 'PAPER_SIGN'){ Leaf.showConfirm('${HLS.PROMPT}', '确认要取消签约吗?', function () { window['${/parameter/@layout_code}_lock_layout_dynamic_window'](); Leaf.request({ url: $('con_sign_cancel_link_id').getUrl(), para: { contract_id: contract_id }, scope: this, success: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); $('${/parameter/@winid}').close(); }, failure: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); }, error: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); } }); }); }else if(sign_type == 'ELE_SIGN' && sign_contract_status == 'SIGNING'){ Leaf.showConfirm('${HLS.PROMPT}', '确认取消电子签约吗?', function () { window['${/parameter/@layout_code}_lock_layout_dynamic_window'](); Leaf.request({ url: $('${/parameter/@layout_code}_con_ele_sign_cancel_link_id').getUrl(), para: { contract_id: contract_id }, scope: this, success: function (res) { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); if (res.result.message != null){ Leaf.showMessage('${l:HLS.PROMPT}', res.result.message) }else{ $('${/parameter/@winid}').close(); } }, failure: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); }, error: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); } }); }); } }; window['${/parameter/@layout_code}_submit_approval_layout_dynamic_click'] = function () { var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); var record = $(ds_id).getCurrentRecord(); var contract_id = record.get('contract_id'); //add by 24976 var sign_type = record.get('sign_type'); var contract_inception_date = record.get('contract_inception_date'); var con_lease_item_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_lease_item'); var con_lease_record = $(con_lease_item_id).getCurrentRecord(); var machine_number = con_lease_record.get('machine_number'); if (record.dirty == true) { Leaf.showMessage('${l:PROMPT}', '${l:HLS.EXECUTE_AFTER_SAVE}'); return; } // if(record.get('contract_status')!='NEW'){ // $L.showErrorMessage("错误",'只能新建状态的合同才能发起签约!'); // return; // } if ($(ds_id).validate()) { if (sign_type == 'ELE_SIGN'){ Leaf.showConfirm('${HLS.PROMPT}', '确认要发起电子签约吗?', function () { window['${/parameter/@layout_code}_lock_layout_dynamic_window'](); //校验起租日 var date = new Date(); date.setTime(date.getTime()); if (contract_inception_date < date) { Leaf.showMessage('${l:PROMPT}', '起租日小于当前时间,不允许发起电子签约!'); window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); return; } if (Ext.isEmpty(machine_number)) { Leaf.showMessage('${l:HLS.PROMPT}', '请先填写机号并保存!'); window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); return; } Leaf.request({ url:$('${/parameter/@layout_code}_ele_operator_verify_link_id').getUrl(), para:{ contract_id:contract_id, esign_type:'CE' }, scope:this, success: function (res) { if(res.result.check_flag == 'Y'){ Leaf.showConfirm('${HLS.PROMPT}', '该企业下已存在其他经办人,如果发起签约,原账户将失效,请确认是否继续!', function () { Leaf.request({ url: $('${/parameter/@layout_code}_con_ele_content_create_link_id').getUrl(), para: { contract_id: contract_id }, scope: this, success: function () { Leaf.request({ url: $('${/parameter/@layout_code}_con_ele_agent_link_id').getUrl(), para: { contract_id: contract_id }, scope: this, success: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); $('${/parameter/@winid}').close(); }, failure: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); }, error: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); } }); }, failure: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); }, error: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); } }); }); window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); }else{ Leaf.request({ url: $('${/parameter/@layout_code}_con_ele_content_create_link_id').getUrl(), para: { contract_id: contract_id }, scope: this, success: function () { Leaf.request({ url: $('${/parameter/@layout_code}_con_ele_agent_link_id').getUrl(), para: { contract_id: contract_id }, scope: this, success: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); $('${/parameter/@winid}').close(); }, failure: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); }, error: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); } }); }, failure: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); }, error: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); } }); } }, error: function() { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); }, failure: function() { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); } }); }); } else if (sign_type == 'PAPER_SIGN'){ Leaf.showConfirm('${HLS.PROMPT}', '确认要提交工作流吗?', function () { window['${/parameter/@layout_code}_lock_layout_dynamic_window'](); Leaf.request({ url: $('con_approval_link_id').getUrl(), para: { contract_id: contract_id }, scope: this, success: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); $('${/parameter/@winid}').close(); }, failure: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); }, error: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); } }); }); } } }; if ('${/parameter/@source_type}' == 'WFL') { zjwfl5110_ApproveChecker_add('zjwfl5110_submit', function (type) { var con_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); if (type == 'agree') { if ($(con_ds_id).validate()) { if ($(con_ds_id).isModified()) { Leaf.showMessage('${HLS.PROMPT}', '请先保存'); return false; } //提交先保存 return true; } else { return false; } } else return true; }); } Leaf.onReady(function () { var ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'T_INVOICE_INFO', 'con_contract_bp'); if (ds_id) { $(ds_id).setQueryUrl('${/request/@context_path}/autocrud/prj.PRJ501N.con_contract_bp/query'); $(ds_id).setQueryParameter('contract_id', '${/parameter/@contract_id}'); $(ds_id).query(); } //add by 24976 if("${/parameter/@sign_contract_status}" == 'SIGNING'){ document.getElementById("${/parameter/@layout_code}_user_button4").style.display = ""; }else if("${/parameter/@sign_contract_status}" == 'SIGN'){ document.getElementById("${/parameter/@layout_code}_user_button4").style.display = "none"; } }) ]]></script> <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/> </a:view></a:screen>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?><!-- $Author: zlf $Date: 2014-11-10 下午5:42:24 $Revision: 1.0 $Purpose: --><a:screen xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" customizationEnabled="true" dynamiccreateenabled="true" trace="true"> <a:init-procedure> <a:model-query fetchAll="true" model="cont.CON500.con_contract_get_guid_file_name" rootPath="file_name_path"/> <s:server-script import="contract_print_path.js"><![CDATA[ $ctx.parameter.file_path = con_print_path['con_print_path']; $ctx.parameter.tomcat_source = con_print_path['tomcat_source']; ]]> </s:server-script> <s:server-script import="con_print_path.js"><![CDATA[ set_parameter_file_path(); ]]> </s:server-script> </a:init-procedure> <a:view> <a:link id="wfl_readonly_pageLink_projectQueryScreen_update_project" url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_maintain_readonly.lview"/> <a:link id="${/parameter/@layout_code}_con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/> <a:link id="${/parameter/@layout_code}_con_contract_content_confirm_link_id" url="${/request/@context_path}/modules/cont/CON501N/con_contract_content_confirm.lview"/> <a:link id="contract_lease_item_query_link" url="${/request/@context_path}/modules/cont/CON505/con_lease_item_query.lview"/> <a:link id="contract_history_window_link" url="${/request/@context_path}/modules/cont/CON501N/con_document_history_query.lview"/> <a:link id="con505_hls_bp_master_query_link" url="${/request/@context_path}/modules/cont/CON505/hls_bp_master_query.lview"/> <a:link id="${/parameter/@layout_code}_prj500_cdd_uploadFile_id" url="${/request/@context_path}/uploadFile.lview"/> <a:link id="${/parameter/@layout_code}_prj500_cdd_downloadFile_id" url="${/request/@context_path}/downloadFile.lview"/> <!--打印使用--> <a:link id="${/parameter/@layout_code}_con505_contract_content_id" model="cont.CON505.con505_contract_content" modelaction="update"/> <a:link id="${/parameter/@layout_code}_creat_con_contract_content_link_id" model="cont.CON505.con505_contract_content" modelaction="execute"/> <a:link id="${/parameter/@layout_code}_file_copy_from_template_link_id" url="${/request/@context_path}/modules/cont/CON505/file_copy_from_template.lsc"/> <a:link id="${/parameter/@layout_code}_con_batch_dl_link_id" url="${/request/@context_path}/modules/cont/CON505/con_atm_batch_dl.lsc"/> <a:link id="${/parameter/@layout_code}_con_cashflow_wirte_off_detail_link" url="${/request/@context_path}/modules/cont/CON302N/con_cashflow_wirte_off_detail.lview"/> <a:link id="con_approval_link_id" model="cont.CON505.contract_approval" modelaction="update"/> <a:link id="con_sign_cancel_link_id" model="cont.CON505.contract_sign_cancel" modelaction="update"/> <a:link id="${/parameter/@layout_code}_con_ele_content_create_link_id" url="${/request/@context_path}/modules/wx/WX100/con_ele_content_create.lsc"/> <a:link id="${/parameter/@layout_code}_con_ele_agent_link_id" url="${/request/@context_path}/modules/wx/WX100/con_ele_agent_content_create.lsc"/> <a:link id="${/parameter/@layout_code}_con_ele_sign_cancel_link_id" url="${/request/@context_path}/modules/cont/CON505/con_ele_sign_cancel.lsc"/> <a:link id="${/parameter/@layout_code}_ele_operator_verify_link_id" url="${/request/@context_path}/modules/wx/WX100/wx_ele_verify_operator.lsc"/> <link href="${/request/@context_path}/css/lightbox.css" rel="stylesheet" type="text/css"/> <script src="${/request/@context_path}/javascripts/lightbox.js" type="text/javascript"/> <script type="text/javascript"><![CDATA[ Ext.ux.Lightbox.register('a[ref=img]', true); function lock_current_window() { Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}'); } function unlock_current_window() { Leaf.Masker.unmask(Ext.getBody()); } window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function () { var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); var contract_id = $(ds_id).getCurrentRecord().get('contract_id'); new Leaf.Window({ id: 'contract_history_window', url: $('contract_history_window_link').getUrl(), params: { contract_id: contract_id }, fullScreen: true }); }; // window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record) { // if (name == 'car_detail') { // return '<a href="javascript:open_contract_window(\'' + record.id + '\',\'' + record.ds.id + '\')">' + config_record.get('prompt') + '</a>'; // } // return value; // }; window['${/parameter/@layout_code}_received_amount_detail'] = function (ds_id, id, name, query_only) { var url = $('${/parameter/@layout_code}_con_cashflow_wirte_off_detail_link').getUrl(); var record = $(ds_id).findById(id); if (record) { var win = new Leaf.Window({ id: 'con_cashflow_wirte_off_detail_window', url: url, params: { cashflow_id: record.get('cashflow_id'), winid: 'con_cashflow_wirte_off_detail_window' }, draggable: true, fullScreen: true }); } }; window['${/parameter/@layout_code}_dynamic_link_renderer'] = function (value, record, name, config_record, bp_seq) { var link_function = ''; window['${/parameter/@layout_code}_hls_link_render_record'][record.id + '---' + name] = record; if (name == 'project_number') { return '<a href="javascript:wfl_prj501_grid_update(\'' + record.id + '\',\'' + record.ds.id + '\')">' + value + '</a>'; } else if (name == 'gps_attch') { link_function = '${/parameter/@layout_code}_ast_con_cdd4_attachtment_upload'; if (record.get('atm_num3') > 0) { return '<a style="color:red" href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>'; } else { return '<a style="font-weight:bolder;font-size:1.2em" href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>'; } } else if (name == 'description') { if (record.get('important_flag') == 'Y') { return '<font color="RED">' + value + '</font>'; } return value; } else if (name == 'bp_link' && record.get('bp_id') && record.get('record_id')) { link_function = '${/parameter/@layout_code}_open_bp_detail_window'; return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\');">' + config_record.get('prompt') + '</a>'; } else if (name == 'car_detail' && record.get('contract_lease_item_id')) { link_function = '${/parameter/@layout_code}_open_lease_item_detail_window'; return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\');">' + config_record.get('prompt') + '</a>'; } else if (name == 'attachment') { link_function = '${/parameter/@layout_code}_prj500_cdd_attachtment_upload'; return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>'; } else if (name == 'attach_file_name' || name == 'attach_file_name_print' || name == 'attachment_new') { var content_type = record.get('content_type'); var content_id = record.get('content_id'); //电子合同 // if(content_type == '01'){ // var link = '${/request/@context_path}/modules/xxx/pdf_download.lsc?type=SIN&content_id=' + content_id; // var url = ''; // url = url + '<a href=' + link + '>' + '下载' + '</a>' + ','; // return url; // }else { if (value != null) { var link = '${/request/@context_path}/atm_download.lsc?attachment_id='; var str = value.split(';;'); var url = ''; for (var i = 0; i < str.length; i++) { var temp = str[i].split('--'); if (!Leaf.isEmpty(temp[0])) { var file_name = temp[0].toUpperCase(); var file_suffix = temp[0].substr(temp[0].lastIndexOf('.') + 1).toUpperCase(); if (file_name.indexOf('.PDF') >= 0) { url = url + '<a href=javascript:view_pdf(\'' + temp[1] + '\')>' + temp[0] + '</a>' + ','; } else if (file_suffix == 'BMP' || file_suffix == 'JPG' || file_suffix == 'JPEG' || file_suffix == 'PNG' || file_suffix == 'GIF') { url = url + '<a href=' + link + temp[1] + ' ref="img">' + temp[0] + '</a>' + ','; } else { url = url + '<a href=' + link + temp[1] + '>' + temp[0] + '</a>' + ','; } } } return url; } //} } else if (name == 'received_amount') { link_function = '${/parameter/@layout_code}_received_amount_detail'; if (value) { return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + Leaf.formatMoney(value) + '</a>'; } return ''; } else if (name == 'attach_file_name_new') { link_function = '${/parameter/@layout_code}_prj500_cdd_attachtment_new_upload'; return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>'; } }; function wfl_prj501_grid_update(record_id, ds_id) { var record = $(ds_id).findById(record_id); var param = {}; param['bp_class'] = record.get('bp_class'); param['project_id'] = record.get('project_id'); param['function_code'] = 'PRJ502D'; param['function_usage'] = 'QUERY'; param['url_title'] = '租赁申请查询'; hls_doc_get_layout_code('${/parameter/@layout_code}_con_contract_get_layout_code_link_id', param, 'wfl_readonly_pageLink_projectQueryScreen_update_project', record.ds.id, '${/parameter/@layout_code}'); } window['${/parameter/@layout_code}_ast_con_cdd4_attachtment_upload'] = function (ds_id, id, name, query_only) { var record = $(ds_id).findById(id); // if (record.get('con_contract_id')) { var url; if (query_only == 'Y') { url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=CON_CONTRACT&header_id=' + record.get('contract_id'); } else { url = $('${/parameter/@layout_code}_prj500_cdd_uploadFile_id').getUrl() + '?table_name=CON_CONTRACT&header_id=' + record.get('contract_id'); } var win = new Leaf.Window({ url: url, title: 'gps附件上传', id: '${/parameter/@layout_code}${/parameter/@tree_code}_ast_con_cdd4_attachtment_upload_id', width: 850, height: 400 }); // win.on('close', function(){ // $(ds_id).query(); // }); // } else { // Leaf.showMessage('${l:HLS.PROMPT}', '请先保存!'); // } }; window['${/parameter/@layout_code}_open_lease_item_detail_window'] = function (id, name) { var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name]; var param = record.data; var contract_lease_item_id = record.get('contract_lease_item_id'); new Leaf.Window({ id: 'contract_lease_item_maintain_window', url: $('contract_lease_item_query_link').getUrl(), params: { contract_lease_item_id: contract_lease_item_id, winid: 'contract_lease_item_maintain_window' }, draggable: true, fullScreen: true }); }; window['${/parameter/@layout_code}_open_bp_detail_window'] = function (id, name) { var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name]; var param = {};//record.data; param['bp_id'] = record.get('bp_id'); param['cdd_list_id'] = record.get('cdd_list_id'); param['company_id'] = '${/session/company_id}'; param['document_id'] = record.get('bp_id'); param['document_category'] = 'BP'; param['bp_class'] = record.get('bp_class'); param['bp_category'] = record.get('bp_category'); if (record.get('bp_category') == 'AGENT') { param['function_code'] = 'HLS303_Q'; param['function_usage'] = 'QUERY'; } else { param['function_code'] = 'CON505H'; param['function_usage'] = 'QUERY'; } param['bp_type'] = record.get('bp_type'); param['download'] = 'Y'; param['url_title'] = '${l:HLS212.BP_MASTER_QUERY}'; hls_doc_get_layout_code('${/parameter/@layout_code}_con_contract_get_layout_code_link_id', param, 'con505_hls_bp_master_query_link', record.ds.id, '${/parameter/@layout_code}'); }; // function open_contract_window(record_id, ds_id) { // var record = $(ds_id).findById(record_id); // var param = record.data; // var contract_lease_item_id = record.get('contract_lease_item_id'); // new Leaf.Window({ // id: 'contract_lease_item_maintain_window', // url: $('contract_lease_item_maintain_link').getUrl(), // params: { // contract_lease_item_id: contract_lease_item_id // }, // fullScreen: true // }); // // param['function_code'] = 'CON501D'; // // param['function_usage'] = 'MODIFY'; // // param['maintain_type'] = 'UPDATE'; // // param['url_title'] = '${l:CON301.CONTRACT_DETAIL}'; // // hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'con_contract_modify_link',ds_id); // } window['${/parameter/@layout_code}_prj500_cdd_attachtment_upload'] = function (ds_id, id, name, query_only) { var record = $(ds_id).findById(id); if (record.get('check_id')) { var url; //add by lijingjing 2019-11-15 if (record.get('attachment_tab_group') == 'CREDIT_CHECK' && '${/parameter/@query_only}' == 'Y') { url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id'); } else if (record.get('attachment_tab_group') == 'SIGN' && '${/parameter/@con_query_only}' == 'N') { url = $('${/parameter/@layout_code}_prj500_cdd_uploadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id'); } else if (record.get('attachment_tab_group') == 'SIGN' && '${/parameter/@con_query_only}' == 'Y') { url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id'); } else if (query_only == 'Y' || '${/parameter/@download}' == 'Y') { url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id'); } else { url = $('${/parameter/@layout_code}_prj500_cdd_uploadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id'); } var win = new Leaf.Window({ url: url, title: '${l:HLS.SUPPORTING_DOCUMENT}', id: '${/parameter/@layout_code}${/parameter/@tree_code}_prj500_cdd_uploadFile_screen_id', width: 850, height: 400 }); win.on('close', function () { record.ds.query(); }); } else { Leaf.showMessage('${l:HLS.PROMPT}', '请先保存!'); } }; window['${/parameter/@layout_code}_prj500_cdd_attachtment_new_upload'] = function (ds_id, id, name, query_only) { var record = $(ds_id).findById(id); if (record.get('check_id')) { var url; //add by lijingjing 2019-11-15 if (query_only == 'Y' || '${/parameter/@download}' == 'Y') { url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=CON_CONTRACT&header_id=' + record.get('check_id'); } else { url = $('${/parameter/@layout_code}_prj500_cdd_uploadFile_id').getUrl() + '?table_name=CON_CONTRACT&header_id=' + record.get('check_id'); } var win = new Leaf.Window({ url: url, title: '${l:HLS.SUPPORTING_DOCUMENT}', id: '${/parameter/@layout_code}${/parameter/@tree_code}_prj500_cdd_uploadFile_screen_id', width: 850, height: 400 }); win.on('close', function () { record.ds.query(); }); } else { Leaf.showMessage('${l:HLS.PROMPT}', '请先保存!'); } }; window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function () { // var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); var record = $(ds_id).getCurrentRecord(); var content_id; //alert($('${/parameter/@layout_code}_con505_contract_content_id').getUrl); Leaf.request({ url: $('${/parameter/@layout_code}_con505_contract_content_id').getUrl(), para: { content_id: content_id, contract_id: record.get('contract_id'), contract_bp_id: record.get('content_bp_pk'), clause_usage: 'GH_WITHHOLD_AGREE' }, success: function (rsc) { // //alert(rsc.result.content_id); Leaf.request({ url: $('${/parameter/@layout_code}_creat_con_contract_content_link_id').getUrl(), para: { content_id: rsc.result.content_id, file_path: '${/parameter/@file_path}' }, success: function () { Leaf.request({ url: $('${/parameter/@layout_code}_file_copy_from_template_link_id').getUrl(), para: { contract_id: record.get('contract_id'), content_id: rsc.result.content_id, file_path: '${/parameter/@file_path}', batch_flag: 'Y' }, success: function () { var url = $('${/parameter/@layout_code}_con_batch_dl_link_id').getUrl() + '?contract_id=' + record.get('contract_id') + '&content_id=' + rsc.result.content_id; window.open(url, '_self'); unlock_current_window(); } }); unlock_current_window(); }, error: function () { unlock_current_window(); }, failure: function () { unlock_current_window(); }, scope: this }); }, error: function () { unlock_current_window(); }, failure: function () { unlock_current_window(); }, scope: this }); }; window['${/parameter/@layout_code}_user_button3_layout_dynamic_click'] = function () { var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); var record = $(ds_id).getCurrentRecord(); var direct_debit_bank_id = record.get('direct_debit_bank_id'); var dd_bank_account_name = record.get('dd_bank_account_name'); var dd_bank_account_num = record.get('dd_bank_account_num'); if (!Ext.isEmpty(record.get('contract_number'))) { new Leaf.Window({ id: '${/parameter/@layout_code}_con_contract_content_confirm_win_id', params: { action: 'VIEW', contract_id: record.get('contract_id'), company_id: record.get('company_id'), document_category: record.get('document_category'), business_type: record.get('business_type'), winid: '${/parameter/@layout_code}_con_contract_content_confirm_win_id' }, url: $('${/parameter/@layout_code}_con_contract_content_confirm_link_id').getUrl(), title: '合同查看', width: 1300, height: 550 }); } else { Leaf.showErrorMessage('错误', '请先点击保存生成合同编号!'); } }; var change_flag = 'N'; //工作流中合同文本生成按钮 //基本信息tab页 新增必输字段的校验 add by liukang 20160328 window['${/parameter/@layout_code}_print_layout_dynamic_click'] = function () { var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); var con_lease_item_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_lease_item'); var record = $(ds_id).getCurrentRecord(); var con_lease_record = $(con_lease_item_id).getCurrentRecord(); var direct_debit_bank_id = record.get('direct_debit_bank_id'); var dd_bank_account_name = record.get('dd_bank_account_name'); var dd_bank_account_num = record.get('dd_bank_account_num'); var color_of_apprearance = con_lease_record.get('color_of_apprearance'); var item_frame_number = con_lease_record.get('item_frame_number'); var item_engine_number = con_lease_record.get('item_engine_number'); var license_number = con_lease_record.get('license_number'); /* if (Ext.isEmpty(direct_debit_bank_id)) { Leaf.showMessage('${l:HLS.PROMPT}', '请先填写数据并保存!'); } else */ if (!Ext.isEmpty(record.get('contract_number'))) { var win = new Leaf.Window({ id: '${/parameter/@layout_code}_con_contract_content_confirm_win_id', params: { contract_id: record.get('contract_id'), company_id: record.get('company_id'), document_category: record.get('document_category'), business_type: record.get('business_type'), winid: '${/parameter/@layout_code}_con_contract_content_confirm_win_id', change_flag: change_flag, contract_name: record.get('contract_name'), contract_number: record.get('contract_number') }, url: $('${/parameter/@layout_code}_con_contract_content_confirm_link_id').getUrl(), title: '合同文本生成', width: 1300, height: 550 }); //在关闭页面之后,刷新一下ds win.on('close', function () { if (ds_id) { $(ds_id).query(); } }); } else { Leaf.showErrorMessage('错误', '请先点击保存生成合同编号!'); } }; //add by zhuxianfei 20180207 function view_pdf(attachment_id) { Leaf.request({ url: '${/request/@context_path}/autocrud/fnd.fnd_atm_attachment/query', para: { attachment_id: attachment_id }, success: function (res) { var path = res.result.record.file_path; path = path.substr(path.indexOf('hls_attachment')); var tomcat_source = '${/parameter/@tomcat_source}'; var source_path = 'http://' + window.location.host + '/' + tomcat_source + '/' + path + '?type=pdf'; var oWin = window.open(source_path); }, scope: this }); } //加载时调用(grid,table,gridBox) add by 24976 window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_load'] = function (ds, record, config_records, bp_seq) { var bp_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_BP_1', 'con_contract_bp'); if (ds.id == bp_ds_id) { //var bp_class = record.get('bp_class'); var marital_status = record.get('marital_status'); var sp_sign_flag_n = record.get('sp_sign_flag_n'); if (marital_status != 30 && marital_status != 40 && sp_sign_flag_n === undefined) { record.getField('sp_sign_flag').setReadOnly(true); record.getField('sp_sign_flag_n').setReadOnly(true); record.set('sp_sign_flag', '-'); record.set('sp_sign_flag_n', '-'); } if(sp_sign_flag_n == '-'){ record.getField('sp_sign_flag').setReadOnly(true); record.getField('sp_sign_flag_n').setReadOnly(true); } } }; window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_query'] = function (ds, qpara, bp_seq) { var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_bs_score'); if (ds.id == ds_id) { qpara.contract_id = '${/parameter/@contract_id}'; //$(ds_id).setQueryParameter('contract_id', '${/parameter/@contract_id}'); } }; window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_form_add_and_load'] = function (ds, record, config_records, bp_seq) { debugger; var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); if (ds_id == ds.id && ds_id) { //业务类型回租时,默认只读“首付款抵扣”选项 if (record.get('business_type') == 'LEASEBACK' && '${/parameter/@function_usage}' == 'MODIFY') { //document.getElementById('${/parameter/@layout_code}_F_BASIC_1_CON_CONTRACT_ENTRUSTED_AMOUNT_prompt').style.display = 'block'; // document.getElementById('${/parameter/@layout_code}_F_BASIC_1_CON_CONTRACT_ENTRUSTED_AMOUNT').style.display = 'block'; record.getField('entrusted_amount').setRequired(true); } else if (record.get('business_type') == 'LEASE') { document.getElementById('${/parameter/@layout_code}_F_BASIC_1_CON_CONTRACT_ENTRUSTED_AMOUNT_prompt').style.display = 'none'; document.getElementById('${/parameter/@layout_code}_F_BASIC_1_CON_CONTRACT_ENTRUSTED_AMOUNT').style.display = 'none'; } if(record.get('bp_class') == 'NP' || record.get('sign_type_n') == '纸质签约'){ record.getField('signer_n').setReadOnly(true); record.getField('signer_n').setRequired(false); record.set('signer_n',''); }else if ('${/parameter/@function_usage}' == 'MODIFY' && record.get('sign_type_n') == '电子签约' && record.get('bp_class') == 'ORG'){ record.getField('signer_n').setReadOnly(false); record.getField('signer_n').setRequired(true); } } }; //更新时调用 window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_update'] = function(ds, record, name, value, old_value, bp_seq) { var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); if (ds_id == ds.id && ds_id) { var record = $(ds_id).getCurrentRecord(); var bp_tenant_class = record.get('bp_class'); if (name == 'sign_type_n') { if(value == '纸质签约'){ record.getField('signer_n').setReadOnly(true); record.getField('signer_n').setRequired(false); record.set('signer_n',''); }else if (value == '电子签约' && bp_tenant_class == 'ORG'){ record.getField('signer_n').setReadOnly(false); record.getField('signer_n').setRequired(true); record.set('ec_sign_type','NEW'); record.set('sign_contract_status','NEW'); }else if(value == '电子签约' && bp_tenant_class == 'NP'){ record.getField('signer_n').setReadOnly(true); record.set('ec_sign_type','NEW'); record.set('sign_contract_status','NEW'); } } } }; /*保存前调用校验*/ window['${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function (ds, record) { debugger; var check_flag = true; var contract_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); var con_record = $(contract_ds_id).getAt(0); if (contract_ds_id == ds.id&&$(contract_ds_id).validate()) { if (con_record.get('business_type') == 'LEASEBACK') { //“保存”按钮增加校验:若所填写小于0或大于设备款价格,点击按钮校验提示:“委托付款金额有误,请重新填写!” if (con_record.get('entrusted_amount') < 0 || con_record.get('entrusted_amount') > minus(con_record.get('lease_item_amount'),con_record.get('down_payment'))) { Leaf.showMessage('${HLS.PROMPT}', '委托付款金额有误,请重新填写!'); return false; } } } else { check_flag = false; } return check_flag; }; //取消签约按钮 add by 24976 window['${/parameter/@layout_code}_user_button4_layout_dynamic_click'] = function () { var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); var record = $(ds_id).getCurrentRecord(); var contract_id = record.get('contract_id'); var sign_contract_status = record.get('sign_contract_status'); var sign_type = record.get('sign_type') || 'PAPER_SIGN'; if (sign_contract_status != 'SIGNING') { Leaf.showMessage('${l:PROMPT}', '只有签约中的合同可以取消签约'); return; } if (sign_contract_status == 'SIGNING' && sign_type == 'PAPER_SIGN'){ Leaf.showConfirm('${HLS.PROMPT}', '确认要取消签约吗?', function () { window['${/parameter/@layout_code}_lock_layout_dynamic_window'](); Leaf.request({ url: $('con_sign_cancel_link_id').getUrl(), para: { contract_id: contract_id }, scope: this, success: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); $('${/parameter/@winid}').close(); }, failure: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); }, error: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); } }); }); }else if(sign_type == 'ELE_SIGN' && sign_contract_status == 'SIGNING'){ Leaf.showConfirm('${HLS.PROMPT}', '确认取消电子签约吗?', function () { window['${/parameter/@layout_code}_lock_layout_dynamic_window'](); Leaf.request({ url: $('${/parameter/@layout_code}_con_ele_sign_cancel_link_id').getUrl(), para: { contract_id: contract_id }, scope: this, success: function (res) { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); if (res.result.message != null){ Leaf.showMessage('${l:HLS.PROMPT}', res.result.message) }else{ $('${/parameter/@winid}').close(); } }, failure: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); }, error: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); } }); }); } }; window['${/parameter/@layout_code}_submit_approval_layout_dynamic_click'] = function () { var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); var record = $(ds_id).getCurrentRecord(); var contract_id = record.get('contract_id'); //add by 24976 var sign_type = record.get('sign_type'); var lease_start_date = record.get('lease_start_date'); var con_lease_item_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_lease_item'); var con_lease_record = $(con_lease_item_id).getCurrentRecord(); var bp_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_BP_1', 'con_contract_bp'); var machine_number = con_lease_record.get('machine_number'); var con_bp_record = $(bp_ds_id).getCurrentRecord(); if (record.dirty == true || con_lease_record.dirty == true || con_bp_record.dirty == true) { Leaf.showMessage('${l:PROMPT}', '${l:HLS.EXECUTE_AFTER_SAVE}'); return; } // if(record.get('contract_status')!='NEW'){ // $L.showErrorMessage("错误",'只能新建状态的合同才能发起签约!'); // return; // } if ($(ds_id).validate()) { if (sign_type == 'ELE_SIGN'){ Leaf.showConfirm('${HLS.PROMPT}', '确认要发起电子签约吗?', function () { window['${/parameter/@layout_code}_lock_layout_dynamic_window'](); //校验起租日 var date = new Date().format('yyyy-mm-dd'); //获取当前日期 var v_lease_start_date = lease_start_date.format('yyyy-mm-dd'); //页面中选择的时间日期 //date.setTime(date.getTime()); if (v_lease_start_date < date) { Leaf.showMessage('${l:PROMPT}', '起租日小于当前时间,不允许发起电子签约!'); window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); return; } if (Ext.isEmpty(machine_number)) { Leaf.showMessage('${l:HLS.PROMPT}', '请先填写机号并保存!'); window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); return; } var con_bp_records = $(bp_ds_id).getAll(); for (var i = 0;i < con_bp_records.length;i++) { var sp_sign_flag = con_bp_records[i].get('sp_sign_flag'); var sp_sign_flag_n = con_bp_records[i].get('sp_sign_flag_n'); if (Ext.isEmpty(sp_sign_flag) || Ext.isEmpty(sp_sign_flag_n)) { Leaf.showMessage('${l:HLS.PROMPT}', '请先选择配偶是否签署并保存!'); window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); return; } } Leaf.request({ url:$('${/parameter/@layout_code}_ele_operator_verify_link_id').getUrl(), para:{ contract_id:contract_id, esign_type:'CE' }, scope:this, success: function (res) { if(res.result.check_flag == 'N'){ Leaf.showConfirm('${HLS.PROMPT}', res.result.result_message, function () { window['${/parameter/@layout_code}_lock_layout_dynamic_window'](); Leaf.request({ url: $('${/parameter/@layout_code}_con_ele_content_create_link_id').getUrl(), para: { contract_id: contract_id }, scope: this, success: function () { Leaf.request({ url: $('${/parameter/@layout_code}_con_ele_agent_link_id').getUrl(), para: { contract_id: contract_id }, scope: this, success: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); $('${/parameter/@winid}').close(); }, failure: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); }, error: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); } }); }, failure: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); }, error: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); } }); }); window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); }else{ window['${/parameter/@layout_code}_lock_layout_dynamic_window'](); Leaf.request({ url: $('${/parameter/@layout_code}_con_ele_content_create_link_id').getUrl(), para: { contract_id: contract_id }, scope: this, success: function () { Leaf.request({ url: $('${/parameter/@layout_code}_con_ele_agent_link_id').getUrl(), para: { contract_id: contract_id }, scope: this, success: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); $('${/parameter/@winid}').close(); }, failure: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); }, error: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); } }); }, failure: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); }, error: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); } }); } }, error: function() { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); }, failure: function() { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); } }); }); } else if (sign_type == 'PAPER_SIGN'){ Leaf.showConfirm('${HLS.PROMPT}', '确认要提交工作流吗?', function () { window['${/parameter/@layout_code}_lock_layout_dynamic_window'](); Leaf.request({ url: $('con_approval_link_id').getUrl(), para: { contract_id: contract_id }, scope: this, success: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); $('${/parameter/@winid}').close(); }, failure: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); }, error: function () { window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); } }); }); } } }; if ('${/parameter/@source_type}' == 'WFL') { zjwfl5110_ApproveChecker_add('zjwfl5110_submit', function (type) { var con_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); if (type == 'agree') { if ($(con_ds_id).validate()) { if ($(con_ds_id).isModified()) { Leaf.showMessage('${HLS.PROMPT}', '请先保存'); return false; } //提交先保存 return true; } else { return false; } } else return true; }); } Leaf.onReady(function () { var ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'T_INVOICE_INFO', 'con_contract_bp'); if (ds_id) { $(ds_id).setQueryUrl('${/request/@context_path}/autocrud/prj.PRJ501N.con_contract_bp/query'); $(ds_id).setQueryParameter('contract_id', '${/parameter/@contract_id}'); $(ds_id).query(); } //add by 24976 if("${/parameter/@sign_contract_status}" == 'SIGNING'){ document.getElementById("${/parameter/@layout_code}_user_button4").style.display = ""; }else if("${/parameter/@sign_contract_status}" == 'SIGN'){ document.getElementById("${/parameter/@layout_code}_user_button4").style.display = "none"; } }) ]]></script> <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/> </a:view></a:screen>
\ No newline at end of file
......
......@@ -61,6 +61,7 @@
}else if(result_ob.code == 0){
var revokeFlows = result_ob.revokeFlows;
var all_revoke_flag = 'Y';
var error_message;
for (var i = 0; i < revokeFlows.length; i++) {
if(revokeFlows[i].result == 0){
revoke_flag_update_bm.update({
......@@ -69,6 +70,7 @@
});
}else{
all_revoke_flag = 'N';
error_message = revokeFlows[i].msg;
}
}
if(all_revoke_flag == 'Y'){
......@@ -76,7 +78,7 @@
contract_id:$ctx.parameter.contract_id
});
}else{
$ctx.parameter.message = '取消签约未完成,请再次发起取消签约!';
$ctx.parameter.message = error_message;
}
}
]]></s:server-script>
......
......@@ -20,6 +20,8 @@
url="${/request/@context_path}/modules/wx/WX100/con_ele_terminate_create.lsc"/>
<a:link id="${/parameter/@layout_code}_ele_operator_verify_link_id"
url="${/request/@context_path}/modules/wx/WX100/wx_ele_verify_operator.lsc"/>
<a:link id="${/parameter/@layout_code}_con_ele_sign_cancel_link_id"
url="${/request/@context_path}/modules/cont/CON505/con_ele_sign_cancel.lsc"/>
<script src="${/request/@context_path}/javascripts/lightbox.js" type="text/javascript"/>
<link href="${/request/@context_path}/css/lightbox.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript"><![CDATA[
......@@ -34,7 +36,14 @@
var calc_flag='N';
//新增和加载时调用form
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_form_add_and_load'] = function(ds, record, config_records, bp_seq) {
var ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'F_BASE_01', 'con_contract_change_req');
if (ds_id == ds.id && ds_id) {
if(record.get('bp_class') == 'NP'){
record.getField('signer_n').setReadOnly(true);
record.getField('signer_n').setRequired(false);
record.set('signer_n','');
}
}
};
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_update'] = function(ds, record, name, value, old_value, bp_seq) {
......@@ -168,7 +177,78 @@
// $('${/parameter/@layout_code}_user_button3').disable();
var req_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_BASE_01', 'con_contract_change_req');
var req_record = $(req_ds_id).getAt(0);
var sign_type = req_record.get('sign_type');
var flow_count = req_record.get('flow_count');
// window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
if (sign_type == 'ELE_SIGN' && flow_count > 0){
Leaf.showConfirm('${l:HLS.PROMPT}', '您发起的电子签署还未完成,如此时提交,将会转为纸质签署,请确认。', function (){
Leaf.request({
url: $('${/parameter/@layout_code}_con_ele_sign_cancel_link_id').getUrl(),
para: {
contract_id: ${/parameter/@change_req_id}
},
scope: this,
success: function (res) {
if (res.result.message != null){
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_submit_approval').enable();
$('${/parameter/@layout_code}_save').enable();
$('${/parameter/@layout_code}_user_button1').enable();
$('${/parameter/@layout_code}_user_button3').enable();
Leaf.showMessage('${l:HLS.PROMPT}', res.result.message);
}else{
Leaf.request({
url: $('con_et002_submit_link').getUrl(),
para: {
change_req_id: ${/parameter/@change_req_id},
layout_code: '${/parameter/@layout_code}'
},
success: function(res) {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_submit_approval').enable();
$('${/parameter/@layout_code}_save').enable();
$('${/parameter/@layout_code}_user_button1').enable();
$('${/parameter/@layout_code}_user_button3').enable();
$('${/parameter/@winid}').close();
},
failure: function() {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_submit_approval').enable();
$('${/parameter/@layout_code}_save').enable();
$('${/parameter/@layout_code}_user_button1').enable();
$('${/parameter/@layout_code}_user_button3').enable();
},
error: function() {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_submit_approval').enable();
$('${/parameter/@layout_code}_save').enable();
$('${/parameter/@layout_code}_user_button1').enable();
$('${/parameter/@layout_code}_user_button3').enable();
},
scope: this
});
}
},
failure: function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_submit_approval').enable();
$('${/parameter/@layout_code}_save').enable();
$('${/parameter/@layout_code}_user_button1').enable();
$('${/parameter/@layout_code}_user_button3').enable();
},
error: function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_submit_approval').enable();
$('${/parameter/@layout_code}_save').enable();
$('${/parameter/@layout_code}_user_button1').enable();
$('${/parameter/@layout_code}_user_button3').enable();
}
});
});
}else{
Leaf.request({
url: $('con_et002_submit_link').getUrl(),
para: {
......@@ -202,6 +282,7 @@
},
scope: this
});
}
}, null, 300, 150);
}
......@@ -275,6 +356,18 @@
Leaf.showConfirm('${l:HLS.PROMPT}', '是否确认取消变更?', function() {
$('${/parameter/@layout_code}_user_button3').disable(); //按钮不可用
window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({
url: $('${/parameter/@layout_code}_con_ele_sign_cancel_link_id').getUrl(),
para: {
contract_id: ${/parameter/@change_req_id}
},
scope: this,
success: function (res) {
if (res.result.message != null){
$('${/parameter/@layout_code}_user_button3').enable(); //按钮启用
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
Leaf.showMessage('${l:HLS.PROMPT}', res.result.message)
}else{
Leaf.request({
url: $('con_et002_cancel_link').getUrl(),
para: {
......@@ -295,6 +388,17 @@
},
scope: this
});
}
},
failure: function () {
$('${/parameter/@layout_code}_user_button3').enable(); //按钮启用
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function () {
$('${/parameter/@layout_code}_user_button3').enable(); //按钮启用
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
}
});
});
};
//提前结清发起电子签署 add by 24976
......@@ -305,12 +409,16 @@
var contract_id = req_record.get('contract_id');
var change_req_id = req_record.get('change_req_id');
var signer = req_record.get('signer');
var bussiness_type = req_record.get('business_type');
var bp_tenant_class = req_record.get('bp_class');
/* if (req_status != 'NEW') {
Leaf.showMessage('${l:PROMPT}', '只有新建状态的才能发起电子签约');
return;
}*/
if(bussiness_type == 'LEASEBACK' && bp_tenant_class == 'NP'){
Leaf.showMessage('${l:PROMPT}', '业务类型为售后回租且是个人承租人的合同,不能发起电子签约');
return;
}
Leaf.showConfirm('${l:HLS.PROMPT}', '是否确认发起电子签约?', function () {
if (req_record.dirty == true) {
Leaf.showMessage('${l:PROMPT}', '${l:HLS.EXECUTE_AFTER_SAVE}');
......@@ -332,9 +440,20 @@
},
scope:this,
success: function (res) {
if(res.result.check_flag == 'Y'){
if(res.result.check_flag == 'N'){
Leaf.showConfirm('${HLS.PROMPT}', '该企业下已存在其他经办人,如果发起签约,原账户将失效,请确认是否继续!', function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({
url: $('${/parameter/@layout_code}_con_ele_sign_cancel_link_id').getUrl(),
para: {
contract_id: change_req_id
},
scope: this,
success: function (res) {
if (res.result.message != null){
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
Leaf.showMessage('${l:HLS.PROMPT}', res.result.message)
}else{
Leaf.request({
url: $('${/parameter/@layout_code}_con_ele_terminate_create_link_id').getUrl(),
para: {
......@@ -352,10 +471,30 @@
},
scope: this
});
}
},
failure: function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
}
});
});
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
}else{
window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({
url: $('${/parameter/@layout_code}_con_ele_sign_cancel_link_id').getUrl(),
para: {
contract_id: change_req_id
},
scope: this,
success: function (res) {
if (res.result.message != null){
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
Leaf.showMessage('${l:HLS.PROMPT}', res.result.message)
}else{
Leaf.request({
url: $('${/parameter/@layout_code}_con_ele_terminate_create_link_id').getUrl(),
para: {
......@@ -375,6 +514,15 @@
});
}
},
failure: function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
}
});
}
},
error: function() {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
......
......@@ -90,78 +90,12 @@
if(flow_count_data[0].ce_num == 0) {
//依据合同文本签署人定义存储签署人信息
var ele_contract_signer_bm = $bm('wx.WX100.con_ele_contract_signer_save');
//第一步生成合同文本
/* //第一步生成合同文本
$bm('cont.CON505.con_ele_contract_create_content').update({
contract_id: $ctx.parameter.contract_id,
content_type: 'NORMAL'
});
var datePath = getDatePath();
FileUtils.forceMkdir(new File(datePath)); //根据日期创建目录
$ctx.parameter.batch_flag = 'Y';
var from_file_data_map = $bm('cont.CON500.con_doc_file_templet_get_atm').queryAsMap({
contract_id: $ctx.parameter.contract_id,
batch_flag: $ctx.parameter.batch_flag
});
var from_file_data = from_file_data_map.getChildren();
//所有文件
var conFileList = [];
//签署人
var signer = [];
for (var i = 0; i < from_file_data.length; i++) {
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 + '.' + record_data.file_type_code || 'doc';
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 + 'con' + record_data.content_id + '.' + record_data.file_type_code || 'doc';
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);
} catch (e) {
raise_app_error(e);
}
// word转pdf
var pdf_file_path = datePath + guid_file_name_tables[0].guid_file_name + 'con_' + record_data.content_id;
var outputfilepath = wordToPdf(to_file_path, pdf_file_path);
var outputfilename = record_data.to_file_name + '.pdf';
var pdf_file = new File(outputfilepath);
var file_size = 0;
if (pdf_file.exists()) {
file_size = pdf_file.length();
}
//保存文本名及路径
$bm('cont.CON500.con_file_content_copy_update').execute({
table_name: 'CON_CONTRACT_CONTENT',
content_id: record_data.content_id,
file_name: outputfilename.toString(),
file_path: outputfilepath.toString(),
file_size: file_size,
file_type_code: 'pdf',
mime_type: 'application/pdf',
user_id: $ctx.parameter.user_id
});
}
}
//文件列表
var con_ele_unsigned_file_bm = $bm('wx.WX100.con_ele_unsigned_file_query');
var con_ele_unsigned_file_map = con_ele_unsigned_file_bm.queryAsMap({
contract_id: $ctx.parameter.contract_id
});
var con_ele_unsigned_file_data = con_ele_unsigned_file_map.getChildren();
for (var n = 0; n < con_ele_unsigned_file_data.length; n++) {
conFileList.push({
"fileUrl": con_ele_unsigned_file_data[n].file_path.replace('X:','/mnt'),
"fileName": con_ele_unsigned_file_data[n].file_name,
"fileSize": con_ele_unsigned_file_data[n].file_size
});
}
//合同签署人信息
});*/
//组装合同签署人信息报文
var ele_signer_bm = $bm('wx.WX100.con_ele_contract_signer_query');
var ele_signer_map = ele_signer_bm.queryAsMap({
contract_id: $ctx.parameter.contract_id,
......@@ -216,7 +150,8 @@
} else if (signer_record_data.signer_category == 'GUARANTOR_ORG_SEAL') {
var ele_org_signer_map = ele_signer_bm.queryAsMap({
contract_id: $ctx.parameter.contract_id,
signer_category: 'GUARANTOR_ORG_SIGN'
signer_category: 'GUARANTOR_ORG_SIGN',
id_no:signer_record_data.id_card_no_leg
});
var ele_org_signer_data = ele_org_signer_map.getChildren();
var agentName = ele_org_signer_data[0].bp_name;
......@@ -253,6 +188,103 @@
});
}
}
//获取token信息
var logs_bm = $bm('wx.WX100.con_ele_savelogs');
try {
var token_sign_result = EleFileUpHttpPost.post(up_file_token_url, null, null);
} catch (e) {
raise_app_error('上传文件获取token失败,请联系技术人员检查!');
}
var token_sign_result_ob = JSON.parse(token_sign_result);
var access_sign_token = token_sign_result_ob.access_token;
//校验签署人
var info = info_query('HL_ELE_ACCOUNT_CREATE_PATH');
var httpUrl = info.code_value;
var Param = {
userInfo: userInfoList
}
var result = EleFileUpHttpPost.post(httpUrl, JSON.stringify(Param), access_sign_token);
//var result = new HttpRequest().sendPost(httpUrl, JSON.stringify(signParam));
logs_bm.insert({
contract_id: $ctx.parameter.contract_id,
httpurl: httpUrl,
jsonPut: JSON.stringify(Param),
jsonResult: result,
tokenResult: token_sign_result
});
var result_ob = JSON.parse(result); //根据返回参数形式再定
if (result_ob.code != 0) {
//rollback
$bm('wx.WX100.rollback').update();
raise_app_error(result_ob.message.toString());
}
//生成合同文本
var datePath = getDatePath();
FileUtils.forceMkdir(new File(datePath)); //根据日期创建目录
$ctx.parameter.batch_flag = 'Y';
var from_file_data_map = $bm('cont.CON500.con_doc_file_templet_get_atm').queryAsMap({
contract_id: $ctx.parameter.contract_id,
batch_flag: $ctx.parameter.batch_flag
});
var from_file_data = from_file_data_map.getChildren();
//所有文件
var conFileList = [];
//签署人
var signer = [];
for (var i = 0; i < from_file_data.length; i++) {
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 + '.' + record_data.file_type_code || 'doc';
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 + 'con' + record_data.content_id + '.' + record_data.file_type_code || 'doc';
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);
} catch (e) {
raise_app_error(e);
}
// word转pdf
var pdf_file_path = datePath + guid_file_name_tables[0].guid_file_name + 'con_' + record_data.content_id;
var outputfilepath = wordToPdf(to_file_path, pdf_file_path);
var outputfilename = record_data.to_file_name + '.pdf';
var pdf_file = new File(outputfilepath);
var file_size = 0;
if (pdf_file.exists()) {
file_size = pdf_file.length();
}
//保存文本名及路径
$bm('cont.CON500.con_file_content_copy_update').execute({
table_name: 'CON_CONTRACT_CONTENT',
content_id: record_data.content_id,
file_name: outputfilename.toString(),
file_path: outputfilepath.toString(),
file_size: file_size,
file_type_code: 'pdf',
mime_type: 'application/pdf',
user_id: $ctx.parameter.user_id
});
}
}
//文件列表
var con_ele_unsigned_file_bm = $bm('wx.WX100.con_ele_unsigned_file_query');
var con_ele_unsigned_file_map = con_ele_unsigned_file_bm.queryAsMap({
contract_id: $ctx.parameter.contract_id
});
var con_ele_unsigned_file_data = con_ele_unsigned_file_map.getChildren();
for (var n = 0; n < con_ele_unsigned_file_data.length; n++) {
conFileList.push({
"fileUrl": con_ele_unsigned_file_data[n].file_path.replace('X:','/mnt'),
"fileName": con_ele_unsigned_file_data[n].file_name,
"fileSize": con_ele_unsigned_file_data[n].file_size
});
}
var ele_contract_signer_map = ele_contract_signer_bm.queryAsMap({
contract_id: $ctx.parameter.contract_id
});
......@@ -298,14 +330,6 @@
conFileList: conFileList,
signer: signer
}
var logs_bm = $bm('wx.WX100.con_ele_savelogs');
try {
var token_sign_result = EleFileUpHttpPost.post(up_file_token_url, null, null);
} catch (e) {
raise_app_error('上传文件获取token失败,请联系技术人员检查!');
}
var token_sign_result_ob = JSON.parse(token_sign_result);
var access_sign_token = token_sign_result_ob.access_token;
var result = EleFileUpHttpPost.post(httpUrl, JSON.stringify(signParam), access_sign_token);
//var result = new HttpRequest().sendPost(httpUrl, JSON.stringify(signParam));
logs_bm.insert({
......@@ -322,18 +346,6 @@
//raise_app_error('发起签约失败,请联系技术人员检查!');
raise_app_error(result_ob.message.toString());
} else if (result_ob.code == 0) {
/* var hls_system_url = info_query('HLS_SYSTEM_URL').code_value;
var url = hls_system_url + 'modules/wx/WX100/con_ele_agent_content_create.lsc';
Leaf.request({
url: url,
para: {
contract_id:$ctx.parameter.contract_id
},
success: function(res) {},
failure: function(res) {
raise_app_error( res.error.message );
}
});*/
var flow_id = result_ob.flowId;
var flow_update_bm = $bm('wx.WX100.con_ele_flow_update');
flow_update_bm.update({
......
......@@ -32,13 +32,18 @@
con_ele_file_dl_map = con_ele_file_dl_bm.queryAsMap();
}
var con_ele_file_dl_data = con_ele_file_dl_map.getChildren();
var flows_list = [];
for (var i = 0; i < con_ele_file_dl_data.length; i++) {
var flow_id = con_ele_file_dl_data[i].ele_flow_id;
flows_list.push({
flowId:flow_id
})
}
//调用中台下载文件接口
var info = info_query('HL_SIGN_FILE_DOWNLOAD');
var httpUrl = info.code_value;
var Param = {
flowId: flow_id
flows: flows_list
}
var logs_bm = $bm('wx.WX100.con_ele_savelogs');
try {
......@@ -50,7 +55,7 @@
var access_sign_token = token_sign_result_ob.access_token;
var result = EleFileUpHttpPost.post(httpUrl, JSON.stringify(Param), access_sign_token);
logs_bm.insert({
contract_id: con_ele_file_dl_data[i].contract_id,
contract_id: $ctx.parameter.p_contract_id || '',
httpurl: httpUrl,
jsonPut: JSON.stringify(Param),
jsonResult: result,
......@@ -58,19 +63,38 @@
});
var result_ob = JSON.parse(result); //根据返回参数形式再定
if (result_ob.code == 0) {
var docs_list = result_ob.docsList;
var status_update_bm = $bm('wx.WX100.job_ele_sign_status_update');
var query_flows = result_ob.queryFlows;
for (var n = 0; n < query_flows.length; n++){
var flow_id = query_flows[n].flowId;
var flow_status = query_flows[n].flowStatus;
if(flow_status == 2){
var docs_list = query_flows[n].docsList;
status_update_bm.update({
flow_id:flow_id,
flow_status:flow_status
})
var con_num_map = con_ele_file_dl_bm.queryAsMap({
ele_flow_id: flow_id
});
var data = con_num_map.getChildren();
var v_con_id = data[0].contract_id;
for (var j = 0; j < docs_list.length; j++) {
con_ele_file_dl_bm.update({
contract_id: con_ele_file_dl_data[i].contract_id,
contract_id: v_con_id,
file_name: docs_list[j].fileName,
file_url: docs_list[j].fileUrl.replace('/mnt','X:'),
file_size:docs_list[j].fileSize
})
}
con_ele_file_dl_bm.execute({
contract_id: con_ele_file_dl_data[i].contract_id,
flow_id:flow_id
})
}else if(flow_status == 3 || flow_status == 7){
status_update_bm.execute({
flow_id:flow_id
})
}
}
}
$ctx.parameter.return_status = '0';
......
......@@ -10,7 +10,8 @@
/* var data = $ctx.parameter.requestData;
var data_ob=JSON.parse(data);*/
var contract_no= $ctx.parameter.contractNo;
var data = "action:" + $ctx.parameter.action + ",flowId:" + $ctx.parameter.flowId + ",signResult:" + $ctx.parameter.signResult + ",flowStatus:" + $ctx.parameter.flowStatus;
var data = "action:" + $ctx.parameter.action + ",flowId:" + $ctx.parameter.flowId + ",signResult:" + $ctx.parameter.signResult + ",flowStatus:" + $ctx.parameter.flowStatus
+ ",signTime:" + $ctx.parameter.signTime + ",esignType:" + $ctx.parameter.esignType;
var logs_bm = $bm('wx.WX100.con_ele_savelogs');
logs_bm.insert({
contract_id:contract_no,
......
......@@ -85,15 +85,99 @@
//依据合同文本签署人定义存储签署人信息
var ele_contract_signer_bm = $bm('wx.WX100.con_et_contract_signer_save');
/* ele_contract_signer_bm.update({
ele_contract_signer_bm.update({
contract_id: $ctx.parameter.contract_id
});*/
//第一步生成提前结清文本
});
/* //第一步生成提前结清文本
$bm('cont.CON732.con_et_content_create').update({
contract_id: $ctx.parameter.contract_id,
ccr_document_type: 'ET',
content_type:'NORMAL'
});*/
//组装签署人校验报文
var ele_signer_bm = $bm('wx.WX100.con_ele_contract_signer_query');
var ele_signer_map = ele_signer_bm.queryAsMap({
contract_id: $ctx.parameter.contract_id,
esign_type:'ET'
});
var ele_signer_data = ele_signer_map.getChildren();
var userInfoList = [];
for (var k = 0 ; k < ele_signer_data.length;k++){
var signer_record_data = ele_signer_data[k];
if(signer_record_data.signer_category == 'TENANT_NP' || signer_record_data.signer_category == 'TENANT_SP'){
userInfoList.push({
"idNo":signer_record_data.id_no,
"name":signer_record_data.bp_name,
"mobile":signer_record_data.mobile
});
}else if (signer_record_data.signer_category == 'TENANT_ORG_SEAL'){
var ele_org_signer_map = ele_signer_bm.queryAsMap({
contract_id: $ctx.parameter.contract_id,
signer_category:'TENANT_ORG_SIGN'
});
var ele_org_signer_data = ele_org_signer_map.getChildren();
//经办人
var agentName = ele_org_signer_data[0].bp_name;
var agentIdNo = ele_org_signer_data[0].id_no;
var mobile = ele_org_signer_data[0].mobile;
//法人
var legalName = ele_org_signer_data[0].legal_person;
var legalIdNo = ele_org_signer_data[0].id_card_no_leg;
if (agentIdNo == legalIdNo){
userInfoList.push({
"idNo":signer_record_data.id_no,
"name":signer_record_data.bp_name,
"agentIdNo":agentIdNo,
"agentName":agentName,
"mobile":mobile,
"legalName":legalName,
"legalIdNo":legalIdNo,
"agentType":"1"
});
}else{
userInfoList.push({
"idNo":signer_record_data.id_no,
"name":signer_record_data.bp_name,
"agentIdNo":agentIdNo,
"agentName":agentName,
"mobile":mobile,
"legalName":legalName,
"legalIdNo":legalIdNo,
"agentType":"2"
});
}
}
}
//获取中台token
var logs_bm = $bm('wx.WX100.con_ele_savelogs');
try {
var token_sign_result = EleFileUpHttpPost.post(up_file_token_url, null, null);
} catch (e) {
raise_app_error('上传文件获取token失败,请联系技术人员检查!');
}
var token_sign_result_ob = JSON.parse(token_sign_result);
var access_sign_token = token_sign_result_ob.access_token;
//校验签署人
var info = info_query('HL_ELE_ACCOUNT_CREATE_PATH');
var httpUrl = info.code_value;
var Param = {
userInfo:userInfoList
}
var result = EleFileUpHttpPost.post(httpUrl, JSON.stringify(Param), access_sign_token);
logs_bm.insert({
contract_id: $ctx.parameter.contract_id,
httpurl: httpUrl,
jsonPut: JSON.stringify(Param),
jsonResult: result,
tokenResult: token_sign_result
});
var result_ob = JSON.parse(result); //根据返回参数形式再定
if (result_ob.code != 0) {
//rollback
$bm('wx.WX100.rollback').update();
raise_app_error(result_ob.message.toString());
}
//生成合同文本
var datePath = getDatePath();
FileUtils.forceMkdir(new File(datePath)); //根据日期创建目录
$ctx.parameter.batch_flag = 'Y';
......@@ -161,60 +245,6 @@
"fileSize": con_ele_unsigned_file_data[n].file_size
});
}
//合同签署人信息
var ele_signer_bm = $bm('wx.WX100.con_ele_contract_signer_query');
var ele_signer_map = ele_signer_bm.queryAsMap({
contract_id: $ctx.parameter.contract_id,
esign_type:'ET'
});
var ele_signer_data = ele_signer_map.getChildren();
var userInfoList = [];
for (var k = 0 ; k < ele_signer_data.length;k++){
var signer_record_data = ele_signer_data[k];
if(signer_record_data.signer_category == 'TENANT_NP' || signer_record_data.signer_category == 'TENANT_SP'){
userInfoList.push({
"idNo":signer_record_data.id_no,
"name":signer_record_data.bp_name,
"mobile":signer_record_data.mobile
});
}else if (signer_record_data.signer_category == 'TENANT_ORG_SEAL'){
var ele_org_signer_map = ele_signer_bm.queryAsMap({
contract_id: $ctx.parameter.contract_id,
signer_category:'TENANT_ORG_SIGN'
});
var ele_org_signer_data = ele_org_signer_map.getChildren();
//经办人
var agentName = ele_org_signer_data[0].bp_name;
var agentIdNo = ele_org_signer_data[0].id_no;
var mobile = ele_org_signer_data[0].mobile;
//法人
var legalName = ele_org_signer_data[0].legal_person;
var legalIdNo = ele_org_signer_data[0].id_card_no_leg;
if (agentIdNo == legalIdNo){
userInfoList.push({
"idNo":signer_record_data.id_no,
"name":signer_record_data.bp_name,
"agentIdNo":agentIdNo,
"agentName":agentName,
"mobile":mobile,
"legalName":legalName,
"legalIdNo":legalIdNo,
"agentType":"1"
});
}else{
userInfoList.push({
"idNo":signer_record_data.id_no,
"name":signer_record_data.bp_name,
"agentIdNo":agentIdNo,
"agentName":agentName,
"mobile":mobile,
"legalName":legalName,
"legalIdNo":legalIdNo,
"agentType":"2"
});
}
}
}
var ele_contract_signer_map = ele_contract_signer_bm.queryAsMap({
contract_id: $ctx.parameter.contract_id
});
......@@ -260,14 +290,6 @@
conFileList:conFileList,
signer:signer
}
var logs_bm = $bm('wx.WX100.con_ele_savelogs');
try {
var token_sign_result = EleFileUpHttpPost.post(up_file_token_url, null, null);
} catch (e) {
raise_app_error('上传文件获取token失败,请联系技术人员检查!');
}
var token_sign_result_ob = JSON.parse(token_sign_result);
var access_sign_token = token_sign_result_ob.access_token;
var result = EleFileUpHttpPost.post(httpUrl, JSON.stringify(signParam), access_sign_token);
logs_bm.insert({
contract_id:$ctx.parameter.contract_id,
......
......@@ -32,20 +32,31 @@
ele_contract_signer_bm.update({
contract_id: $ctx.parameter.contract_id
});
//第一步生成合同文本
$bm('cont.CON505.con_ele_contract_create_content').update({
contract_id: $ctx.parameter.contract_id,
content_type: 'NORMAL'
});
}else if($ctx.parameter.esign_type == 'ET'){
//依据提前结清合同文本签署人定义存储签署人信息
var ele_contract_signer_bm = $bm('wx.WX100.con_et_contract_signer_save');
ele_contract_signer_bm.update({
contract_id: $ctx.parameter.contract_id
});
//第一步生成提前结清文本
$bm('cont.CON732.con_et_content_create').update({
contract_id: $ctx.parameter.contract_id,
ccr_document_type: 'ET',
content_type:'NORMAL'
});
}
//合同经办人信息
var ele_signer_bm = $bm('wx.WX100.con_ele_contract_signer_query');
var ele_signer_map = ele_signer_bm.queryAsMap({
contract_id: $ctx.parameter.contract_id,
esign_type:$ctx.parameter.esign_type
});
var ele_signer_data = ele_signer_map.getChildren();
//合同经办人信息
var userInfoList = [];
for (var k = 0 ; k < ele_signer_data.length;k++){
var signer_record_data = ele_signer_data[k];
......@@ -64,7 +75,8 @@
}else if(signer_record_data.signer_category == 'GUARANTOR_ORG_SEAL'){
var ele_org_signer_map = ele_signer_bm.queryAsMap({
contract_id: $ctx.parameter.contract_id,
signer_category:'GUARANTOR_ORG_SIGN'
signer_category:'GUARANTOR_ORG_SIGN',
id_no:signer_record_data.id_card_no_leg
});
var ele_org_signer_data = ele_org_signer_map.getChildren();
var agentIdNo = ele_org_signer_data[0].id_no;
......@@ -112,11 +124,9 @@
var result_ob = JSON.parse(post_result); //根据返回参数形式再定
if (result_ob.code != 0) {
//rollback
$bm('wx.WX100.rollback').update();
raise_app_error(result_ob.message.toString());
}else if(result_ob.code == 0){
var verify_result = result_ob.result;
$ctx.parameter.check_flag = verify_result;
var result_message = result_ob.message;
$ctx.parameter.check_flag = 'N';
$ctx.parameter.result_message = result_message;
}
]]></s:server-script>
</a:init-procedure>
......
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