Commit c6266292 authored by congzhao's avatar congzhao

[建机]电子合同开发 校验调整以及经办人授权文件开发

parent df85701d
<?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>'; }else if (name == 'signer_attachment') { link_function = '${/parameter/@layout_code}_signer_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>'; } }; 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}_signer_attachtment_upload'] = function (ds_id, id, name, query_only) { var record = $(ds_id).findById(id); if (record.get('signer') && record.get('bp_class') == 'ORG' && record.get('sign_type_n') == '电子签约') { var url; url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=HLS_BP_MASTER_SIGNER&header_id=' + record.get('signer'); 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 }); } }; 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
<?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>'; }else if (name == 'signer_attachment') { link_function = '${/parameter/@layout_code}_signer_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>'; } }; 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}_signer_attachtment_upload'] = function (ds_id, id, name, query_only) { var record = $(ds_id).findById(id); if (record.get('signer') && record.get('bp_class') == 'ORG' && record.get('sign_type_n') == '电子签约') { var url; url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=HLS_BP_MASTER_SIGNER&header_id=' + record.get('signer'); 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 }); } }; 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 business_type = record.get('business_type'); var bp_class = record.get('bp_class'); 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(business_type == 'LEASEBACK' && bp_class == 'NP'){ 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
......
......@@ -62,6 +62,7 @@
var revokeFlows = result_ob.revokeFlows;
var all_revoke_flag = 'Y';
var error_message;
var result;
for (var i = 0; i < revokeFlows.length; i++) {
if(revokeFlows[i].result == 0){
revoke_flag_update_bm.update({
......@@ -70,6 +71,7 @@
});
}else{
all_revoke_flag = 'N';
result = revokeFlows[i].result;
error_message = revokeFlows[i].msg;
}
}
......@@ -78,7 +80,11 @@
contract_id:$ctx.parameter.contract_id
});
}else{
$ctx.parameter.message = error_message;
if(result = '1437111'){
$ctx.parameter.message = '签约已完毕,不可取消';
}else{
$ctx.parameter.message = error_message;
}
}
}
]]></s:server-script>
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: zhangxing5129
$Date: 2014-8-4 下午03:12:06
$Revision: 1.0
$Purpose: 商业伙伴维护
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true"
trace="true">
<a:init-procedure>
<a:model-query fetchAll="true" model="prj.PRJ500D.user_agent_description" rootPath="user_agent_description"/>
<a:model-query fetchAll="true" model="hls.HLS214N.hls_bp_master_modify_user" rootPath="modify_user"/>
</a:init-procedure>
<a:view>
<a:link id="bank_account_num_link" model="hls.HLS214.hls_bp_bank_account_num" modelaction="update"/>
<a:link id="bp_agent_modify_link" url="${/request/@context_path}/modules/hls/HLS303/bp_agent_create.lview"/>
<script src="${/request/@context_path}/modules/prj/PRJ500N/javascripts/input_validator.js"
type="text/javascript"/>
<a:link id="${/parameter/@layout_code}_downloadFile_id" url="${/request/@context_path}/uploadFile.lview"/>
<a:link id="hls214N_cdd_uploadFile_id" url="${/request/@context_path}/uploadFile.lview"/>
<a:link id="hls214N_cdd_downloadFile_id" url="${/request/@context_path}/downloadFile.lview"/>
<a:link id="${/parameter/@layout_code}_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code"
modelaction="update"/>
<a:link id="hls214_bp_master_save_link_id" model="hls.HLS214.hls_bp_change_agent" modelaction="update"/>
<a:link id="hls214_bp_master_basic_submit_link_id" model="hls.HLS214N.hls_bp_master_req_submit"
modelaction="execute"/>
<!-- <a:link id="hls214_sap_eai_create_customer_link" url="${/request/@context_path}/modules/interface/INTERFACE_EAI/hls_sap_eai_CrCustomer.lsc"/>-->
<!-- <a:link id="hls214_sap_eai_create_vender_link" url="${/request/@context_path}/modules/interface/INTERFACE_EAI/hls_sap_eai_CrVender.lsc"/>-->
<!-- <script src="${/request/@context_path}/javascripts/identity_card_info_query.js"-->
<!-- type="text/javascript"></script>-->
<script type="text/javascript"><![CDATA[
//保存前调用
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function (ds, record) {
// window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
// var bp_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master_req');
// debugger
// var Pattern = /^[A-Za-z]+$/;
// var record=$(bp_ds_id).getCurrentRecord();
// var record_name=record.get('extra_nam');
// if(record_name=='extra_nam'){
//
// if((!Pattern.test(record_name)||(record_name.length!=3))){
// Leaf.showMessage('${l:HLS.PROMPT}', '简称不合规!');
// window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
// return;
// }
// }
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master_req');
var bp_record = $(ds_id).getCurrentRecord();
if (old_id_card != new_id_card) {
bp_record.set('id_card_no_change_flag', 'Y');
} else {
bp_record.set('id_card_no_change_flag', 'N');
}
if (old_bp_name != new_bp_name) {
bp_record.set('bp_name_change_flag', 'Y');
} else {
record.set('bp_name_change_flag', 'N');
}
if (bp_record.get('marital_status') && (bp_record.get('marital_status') !== '30' && bp_record.get('marital_status') !== '40')) {
bp_record.set('bp_name_sp', null);
bp_record.set('card_type_sp', null);
bp_record.set('card_type_sp_n', null);
bp_record.set('id_no_sp', null);
bp_record.set('date_of_birth_sp', null);
bp_record.set('cell_phone_sp', null);
bp_record.set('work_unit_phone_sp', null);
bp_record.set('work_unit_name_sp', null);
bp_record.set('work_unit_address_sp', null);
return true;
}
return true;
};
function CheckSocialCreditCode(Code) {
var patrn = /^[0-9A-Z]+$/;
//18位校验及大写校验
if ((Code.length != 18) || (patrn.test(Code) == false)) {
return false;
} else {
var Ancode;//统一社会信用代码的每一个值
var Ancodevalue;//统一社会信用代码每一个值的权重
var total = 0;
var weightedfactors = [1, 3, 9, 27, 19, 26, 16, 17, 20, 29, 25, 13, 8, 24, 10, 30, 28];//加权因子
var str = '0123456789ABCDEFGHJKLMNPQRTUWXY';
//不用I、O、S、V、Z
for (var i = 0; i < Code.length - 1; i++) {
Ancode = Code.substring(i, i + 1);
Ancodevalue = str.indexOf(Ancode);
total = total + Ancodevalue * weightedfactors[i];
//权重与加权因子相乘之和
}
var logiccheckcode = 31 - total % 31;
if (logiccheckcode == 31) {
logiccheckcode = 0;
}
var Str = "0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,T,U,W,X,Y";
var Array_Str = Str.split(',');
logiccheckcode = Array_Str[logiccheckcode];
var checkcode = Code.substring(17, 18);
if (logiccheckcode != checkcode) {
return false;
} else {
return true;
}
}
}
//保存submitsuccess调用
window['${/parameter/@layout_code}_on_layout_dynamic_submitsuccess'] = function (ds, record, res, bp_seq) {
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_cdd_item_doc_ref');
var bp_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master_req');
var records = $(ds_id);
if (!(records == 'undefined' || records == null)) {
$(ds_id).query();
}
// 简称校验
//
// var Pattern = /^[A-Za-z]+$/;
//
// if(record.getField('extra_nam')=='extra_nam'){
// if((!Pattern.text(extra_nam)||(extra_nam.length!=3))){
// Leaf.showMessage('${l:HLS.PROMPT}', '简称不合规!');
// return true;
// }
// }
// Leaf.request({
// url: $('hls214_sap_eai_create_customer_link').getUrl(),
// para: {
// bp_id: bp_id
// },
// scope: this,
// success: function () {
// Leaf.request({
// url: $('hls214_sap_eai_create_vender_link').getUrl(),
// para: {
// bp_id: bp_id
// },
// scope: this,
// success: function () {
// $(bp_ds_id).query();
// 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']();
// },
// sync: true
// });
// },
// failure: function () {
// window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
// },
// error: function () {
// window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
// },
// sync: true
// });
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
};
function prj_check_bp_id(record) {
var bp_id;
if (record) {
bp_id = record.get('bp_id');
}
if (!bp_id) {
Leaf.showMessage('${l:PROMPT}', '${l:HLS.EXECUTE_AFTER_SAVE}');
bp_id = '';
}
return bp_id;
}
//财务报表模板导入
window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function () {
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master_req');
var record = $(ds_id).getCurrentRecord();
bp_id = prj_check_bp_id(record);
if (!bp_id) {
return;
}
new Leaf.Window({
id: 'rsc_fin_statement_prj_import_handle_winid',
url: '${/request/@context_path}/modules/rsc/RSC303/rsc_fin_statement_prj_import_handle.lview',
params: {
bp_id: bp_id,
winid: 'rsc_fin_statement_prj_import_handle_winid'
},
title: '${l:STATEMENTS_BUSINESS_DATA_IMPORT}',
width: 950,
height: 200
});
};
//财务报表模板查看
window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function () {
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master_req');
var record = $(ds_id).getCurrentRecord();
var bp_id = prj_check_bp_id(record);
if (!bp_id) {
return;
}
new Leaf.Window({
id: 'rsc_fin_statement_prj_all_query_winid',
url: '${/request/@context_path}/modules/rsc/RSC303/rsc_fin_statement_prj_all_query.lview',
params: {
bp_id: bp_id,
winid: 'rsc_fin_statement_prj_all_query_winid'
},
title: '${l:STATEMENTS_BUSINESS_DATA_IMPORT}',
fullScreen: true,
draggable: true
});
};
// function fin_institution_code_validate(record, name, value) {
// if (!value) {
// return '金融机构代码不能为空';
// } else {
// if (value.length != 11) {
// return '金融机构代码长度必须为11位';
// }
// }
// return true;
// }
// function trade_type_code_validate(record, name, value) {
// var trade_type_code = record.get('trade_type_code');
// if(!trade_type_code){
// if(trade_type_code != trade_type_code.toLowerCase()){
// return '行业分类代码必须为小写字母';
// }}
// return true;
// }
var old_id_card;
var new_id_card;
var old_bp_name;
var new_bp_name;
//新增和加载时调用form
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_form_add_and_load'] = function (ds, record, config_records, bp_seq) {
// if ((ds.id).indexOf('hls_bp_master_credit') != -1 && (ds.id).indexOf('F_ORG_CREDIT') != -1) {
// if (ds.fields.fin_institution_code) {
// ds.fields.fin_institution_code.pro.validator = fin_institution_code_validate;
// }
// if (ds.fields.trade_type_code) {
// ds.fields.trade_type_code.pro.validator = trade_type_code_validate;
// }
// }
// }
if ((ds.id).indexOf('hls_bp_master_req') != -1 && (ds.id).indexOf('F_BASIC') != -1) {
var employee_type_id = '${/model/modify_user/record/@employee_type_id}';
old_bp_name = record.get('bp_name');
new_bp_name = record.get('bp_name');
if (record.get('id_type') == 'ID_CARD') {
old_id_card = record.get('id_card_no');
new_id_card = record.get('id_card_no');
}
if (record.get('bp_category') == 'VENDER') {
record.getField('unit_id_n').setReadOnly(true);
record.getField('unit_id_n').setRequired(false);
} else {
if (employee_type_id == '64') {
record.getField('unit_id_n').setReadOnly(true);
record.getField('unit_id_n').setRequired(false);
} else {
record.getField('unit_id_n').setReadOnly(true);
record.getField('unit_id_n').setRequired(false);
}
}
if (record.get('bp_class') && record.get('bp_class') == 'NP') {
if (record.get('marital_status') && (record.get('marital_status') == '30' || record.get('marital_status') == '40')) {
document.getElementById('${/parameter/@layout_code}_F_SPOUSE_1_component_id').style.display = 'block';
record.getField('bp_name_sp').setRequired(true);
record.getField('card_type_sp').setRequired(true);
record.getField('card_type_sp_n').setRequired(true);
record.getField('id_no_sp').setRequired(true);
} else {
document.getElementById('${/parameter/@layout_code}_F_SPOUSE_1_component_id').style.display = 'none';
}
}
// 发票
if('${/parameter/@bp_name_updated_flag}'){
if('${/parameter/@bp_name_updated_flag}' == 'N'){
record.getField('bp_name').setReadOnly(true);
}
}
}
};
window['${/parameter/@layout_code}_on_layout_dynamic_grid_load'] = function (ds, line_record) {
var dsId = ds.id;
var grid_id = dsId.replace('ds', 'layout_grid_id');
var base_table_temp = 'hls_bp_master_req_role_ds';
if (dsId.substring(dsId.length - base_table_temp.length, dsId.length) == base_table_temp) {
var record = ds.getCurrentRecord();
if (record) {
record.getField('bp_type_n').setReadOnly(true);
record.getField('enabled_flag').setReadOnly(true);
}
}
if (ds.fields.parent_id) {
record.getField('parent_id_n').setReadOnly(true);
}
//var history_record = res.result.record[i];
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master_signer_req');
if (!Ext.isEmpty(line_record)) {
if(line_record.get('added_flag') == 'Y'){
setListInterval(line_record, grid_id);
}
}
};
function setListInterval(record, grid_id) {
var btnListInterval = setTimeout(function() {
var field_color = null;
// clearInterval(btnListInterval);
btnListInterval = null;
// record.getField('description').setRequired(false);
var response_status = record.get('added_flag') ;
if (response_status == 'Y') {
field_color = '#FF9965';
}else{
field_color = '';
}
//ListSetFieldColor(record.id, field_color);
for (var name in record.data) {
record.getField(name.toLowerCase()).setPropertity('tooltip', '<span style="color:#FF9965">新增数据</span>');
}
if (Ext.get(grid_id) ) {
Ext.get(grid_id).select('tr[_row=' + record.id + ']').setStyle({
backgroundColor: field_color
});
}
}, 200);
}
/*function ListSetFieldColor(record_id, field_color) {
var grid_id = '${/parameter/@layout_code}_G_RESULT_hls_bank_interface_logs_layout_grid_id';
var name = 'response_status_n';
if (Ext.get(grid_id) && $(grid_id).findColByName(name)) {
Ext.get(grid_id).select('tr[_row=' + record_id + ']').setStyle({
backgroundColor: field_color
});
}
// if (Ext.get(grid_id) && $(grid_id).findColByName(name)) {
// Ext.get(grid_id).select('tr[_row=' + record_id + '] td[dataindex=' + name + ']').setStyle({
// background: field_color
// });
// }
}*/
//更新时调用 add by liukang
//填写银行账号时 允许银行账号相同 但是给一个提示(提示一下而已)
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_update'] = function (ds, record, name, value, old_value, bp_seq) {
var f_bp_create_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master_req');
var gird_ds_id = 'BP_NP_MODIFY_N_BP_ASSETS01_hls_bp_assets_ds';
var gird_ds_id2 = 'BP_NP_MODIFY_N_BP_ASSETS04_hls_bp_assets_ds';
var gird_ds_id3 = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_bank_flow');
if (gird_ds_id == ds.id || gird_ds_id2 == ds.id) {
if (name == 'relationship_with_bp') {
if (value == 'A7501') {
record.set('owership', $(f_bp_create_ds_id).getAt(0).get('bp_name'));
} else if (value == 'A7502') {
record.set('owership', $(f_bp_create_ds_id).getAt(0).get('bp_name_sp'));
} else {
record.set('owership', '');
}
}
}
if (gird_ds_id3 == ds.id) {
if (name == 'relationship_with_bp') {
if (value == 'A7501') {
record.set('owner_name', $(f_bp_create_ds_id).getAt(0).get('bp_name'));
} else if (value == 'A7502') {
record.set('owner_name', $(f_bp_create_ds_id).getAt(0).get('bp_name_sp'));
} else {
record.set('owner_name', '');
}
}
}
var role_ds = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master_role_req');
if (role_ds == ds.id) {
var primary_flag = record.get('primary_flag');
if (primary_flag == 'Y') {
var bm_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master_req');
var bm_record = $(bm_ds_id).getCurrentRecord();
bm_record.set('bp_type', record.get('bp_type'));
bm_record.set('bp_type_n', record.get('bp_type_n'));
bm_record.set('bp_category', record.get('bp_category'));
bm_record.set('bp_category_n', record.get('bp_category_n'));
}
}
var hls_bp_master_req_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master_req');
var hls_bank_acc_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master_bank_acc_req');
var hls_bp_master_credit_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master_credit');
var bp_record = $(hls_bp_master_req_ds_id).getCurrentRecord();
if ((ds.id).indexOf('hls_bp_master_req') != -1 && (ds.id).indexOf('F_BASIC') != -1) {
if (name == 'bp_name' && value) {
new_bp_name = record.get('bp_name');
}
if (name == 'agent_type') {
if (value == 'AGENT_NO_REBATE' || value == 'AGENT_EE') {
record.getField('parent_id_n').setReadOnly(false);
} else {
record.getField('parent_id_n').setReadOnly(true);
}
}
if (name == 'social_code' && value) {
if (!CheckSocialCreditCode(value)) {
Leaf.showMessage('提示', '统一社会信用代码有误,请重新输入!');
setTimeout(function () {
record.set('social_code', '');
}, 20);
return false;
}
}
}
if (ds.id == hls_bp_master_req_ds_id) {
if ($L.CmpManager.get(hls_bp_master_req_ds_id)) {
if (name == 'province_id') {
record.set('city_sp', '');
record.set('city_sp_n', '');
}
}
}
if (ds.id == hls_bank_acc_ds_id) {
var bank_account_num = record.get('bank_account_num');
if (name == 'bank_account_num') {
Leaf.request({
url: $('bank_account_num_link').getUrl(),
para: {
bank_account_num: bank_account_num
},
success: function (res) {
var number = res.result.num;
//alert(number);
if (number > 0) {
Leaf.showMessage('提示', '该银行账号在系统中已存在!');
}
},
failure: function (res) {
},
error: function () {
},
scope: this
});
}
}
if ((ds.id).indexOf('hls_bp_master_req') != -1) {
// //身份证验证
// if (ds.fields.id_card_no && bp_record.get('bp_class') == 'NP' && bp_record.get('id_type') == 'ID_CARD') {
// ds.fields.id_card_no.pro.validator = id_card_no_validate;
// ds.fields.id_no_sp.pro.validator = id_card_no_validate;
// }
if (name == 'cell_phone' && value) {
if (!checkMobile(value)) {
Leaf.showMessage('提示', '基本信息中,请输入正确格式的手机号码!');
setTimeout(function () {
record.set('cell_phone', '');
}, 20);
return false;
}
}
if (name == 'leader_mobile_number' && value) {
if (!checkMobile(value)) {
Leaf.showMessage('提示', '公司负责人中,请输入正确格式的手机号码!');
setTimeout(function () {
record.set('leader_mobile_number', '');
}, 20);
return false;
}
}
if (name == 'id_card_no' && value) {
if (record.get('id_type') == 'ID_CARD') {
if (!checkCard(value)) {
Leaf.showMessage('提示', '基本信息中,请输入正确格式的身份证!');
setTimeout(function () {
record.set('id_card_no', '');
}, 20);
return false;
} else if (value.length == 18) {
new_id_card = record.get('id_card_no');
//自动带出籍贯
//record.set('resident_addres', get_native_place(value));
record.set('date_of_birth', new Date(value.substr(6, 4) + '/' + value.substr(10, 2) + '/' + value.substr(12, 2)));
record.set('age', new Date().getFullYear() - value.substr(6, 4));
if (value.substr(16, 1) % 2 == 1) {
record.set('gender', 'MALE');
record.set('gender_n', '男');
} else if (value.substr(16, 1) % 2 == 0) {
record.set('gender', 'FEMALE');
record.set('gender_n', '女');
}
}
}
}
if (name == 'id_no_sp' && value) {
//
if (record.get('card_type_sp') == 'ID_CARD') {
if (!checkCard(value)) {
Leaf.showMessage('提示', '配偶信息中,请输入正确格式的身份证!');
setTimeout(function () {
record.set('id_no_sp', '');
}, 20);
return false;
} else if (value.length == 18) {
new_id_card = record.get('id_card_no_leg');
//record.set('resident_addres_sp', get_native_place(value));
record.set('date_of_birth_sp', new Date(value.substr(6, 4) + '/' + value.substr(10, 2) + '/' + value.substr(12, 2)));
// 配偶的信息不能回写
/*record.set('age', new Date().getFullYear() - value.substr(6, 4));
if (value.substr(16, 1) % 2 == 1) {
record.set('gender', 'MALE');
record.set('gender_n', '男');
} else if (value.substr(16, 1) % 2 == 0) {
record.set('gender', 'FEMALE');
record.set('gender_n', '女');
}*/
}
}
}
}
var test_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_BASIC', 'hls_bp_master_req');
var test_ds_id1 = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_SPOUSE_1', 'hls_bp_master_req');
var test_ds_id2 = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_SPOUSE', 'hls_bp_master_req');
if (ds.id == f_bp_create_ds_id) {
var hd_ds = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_BASIC', 'hls_bp_master_req');
record = $(hd_ds).getCurrentRecord();
if (record.get('bp_class') == 'NP') {
if (name == 'marital_status' && value) {
if (value == '30' || value == '40') {
document.getElementById('${/parameter/@layout_code}_F_SPOUSE_1_component_id').style.display = 'block';
record.getField('bp_name_sp').setRequired(true);
record.getField('card_type_sp').setRequired(true);
record.getField('card_type_sp_n').setRequired(true);
record.getField('id_no_sp').setRequired(true);
if (!record.get('card_type_sp')) {
record.set('card_type_sp', 'ID_CARD');
record.set('card_type_sp_n', '身份证');
}
} else {
document.getElementById('${/parameter/@layout_code}_F_SPOUSE_1_component_id').style.display = 'none';
record.getField('bp_name_sp').setRequired(false);
record.getField('card_type_sp').setRequired(false);
record.getField('card_type_sp_n').setRequired(false);
record.getField('id_no_sp').setRequired(false);
// record.set('bp_name_sp', null);
// record.set('card_type_sp', null);
// record.set('card_type_sp_n', null);
// record.set('id_no_sp', null);
// record.set('date_of_birth_sp', null);
// record.set('cell_phone_sp', null);
// record.set('work_unit_phone_sp', null);
// record.set('work_unit_name_sp', null);
// record.set('work_unit_address_sp', null);
}
}
}
}
};
function upload_file(id, name, query_only) {
var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name];
if (record.get('check_id')) {
var url;
if (query_only == 'Y') {
url = $('hls214N_cdd_downloadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id');
} else {
url = $('hls214N_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: 'prj500_cdd_uploadFile_screen_id',
width: 850,
height: 400
});
win.on('close', function () {
record.ds.query();
});
} else {
Leaf.showMessage('${l:HLS.PROMPT}', '请先保存!');
}
}
function upload_signer_file(id, name, query_only) {
var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name];
if (record.get('signer_req_id')) {
var url;
if (query_only == 'Y') {
url = $('hls214N_cdd_downloadFile_id').getUrl() + '?table_name=HLS_BP_MASTER_SIGNER_REQ&header_id=' + record.get('signer_req_id');
} else {
url = $('hls214N_cdd_uploadFile_id').getUrl() + '?table_name=HLS_BP_MASTER_SIGNER_REQ&header_id=' + record.get('signer_req_id');
}
var win = new Leaf.Window({
url: url,
title: '${l:HLS.SUPPORTING_DOCUMENT}',
id: 'prj500_cdd_uploadFile_screen_id',
width: 850,
height: 400
});
} else {
Leaf.showMessage('${l:HLS.PROMPT}', '请先保存!');
}
}
//超链接渲染
window['${/parameter/@layout_code}_dynamic_link_renderer'] = function (value, record, name, config_record) {
window['${/parameter/@layout_code}_hls_link_render_record'][record.id + '---' + name] = record;
if (name == 'attachment') {
link_function = 'upload_file';
if ('${/parameter/@query_only}' == 'Y') {
if (record.get('attach_count') == 0 || !record.get('attach_count')) {
return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\',\'' + '${/parameter/@query_only}' + '\');">' + '附件下载' + '</a>';
} else {
return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\',\'' + '${/parameter/@query_only}' + '\');">' + '附件下载' + '(' + record.get('attach_count') + ')' + '</a>';
}
} else {
if (record.get('attach_count') == 0 || !record.get('attach_count')) {
return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>';
} else {
return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '(' + record.get('attach_count') + ')' + '</a>';
}
}
} else if (name == 'attach_file_name') {
if (value != null) {
var link = '${/request/@context_path}/atm_download.lsc?attachment_id=';
var str = value.split(';;');
var url = '';
for (var i = 0; i < str.length; i++) {
var temp = str[i].split('--');
if (!Leaf.isEmpty(temp[0])) {
var file_name = temp[0].toUpperCase();
var file_suffix = temp[0].substr(temp[0].lastIndexOf('.') + 1).toUpperCase();
if (file_name.indexOf('.PDF') >= 0) {
url = url + '<a href=javascript:view_pdf(\'' + temp[1] + '\')>' + temp[0] + '</a>' + ',';
} else if (file_suffix == 'BMP' || file_suffix == 'JPG' || file_suffix == 'JPEG' || file_suffix == 'PNG' || file_suffix == 'GIF') {
url = url + '<a href=' + link + temp[1] + ' ref="img">' + temp[0] + '</a>' + ',';
} else {
url = url + '<a href=' + link + temp[1] + '>' + temp[0] + '</a>' + ',';
}
}
}
return url;
}
} else if (name == 'description') {
if (record.get('important_flag') == 'Y') {
return '<font color="RED">' + value + '</font>';
}
return value;
} //签约人授权书附件
else if(name == 'signer_attachment') {
var signer_link_function = 'upload_signer_file';
if ('${/parameter/@query_only}' == 'Y') {
return '<a href="javascript:window[\'' + signer_link_function + '\'](\'' + record.id + '\',\'' + name + '\',\'' + '${/parameter/@query_only}' + '\');">' + '附件下载' + '</a>';
}else{
return '<a href="javascript:window[\'' + signer_link_function + '\'](\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>';
}
}
};
//经销商准入
window['${/parameter/@layout_code}_user_button4_layout_dynamic_click'] = function () {
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master_req');
var record = $(ds_id).getCurrentRecord();
var agent_instance_status = record.get('agent_instance_status');
if (agent_instance_status == 'APPROVED') {
Leaf.showMessage('提示', '该商业伙伴已进行过经销商准入流程,不允许再次操作!');
return;
} else if (agent_instance_status == 'APPROVING') {
Leaf.showMessage('提示', '该商业伙伴已经在准入流程中,不允许再次操作!');
return;
} else if (agent_instance_status == 'REJECT') {
Leaf.showMessage('提示', '该商业伙伴准入流程已被拒绝,不允许再次操作!');
return;
}
window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({
url: $('hls214_bp_master_save_link_id').getUrl(),
para: {
'bp_id': record.get('bp_id')
},
success: function (res) {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
var param = {};
param['function_code'] = 'HLS303';
param['function_usage'] = 'MODIFY';
param['maintain_type'] = 'MODIFY';
param['url_title'] = '经销商准入';
param['bp_id'] = record.get('bp_id');
param['bp_class'] = record.get('bp_class');
param['bp_type'] = record.get('bp_type');
param['agent_instance_flag'] = 'Y';
hls_doc_get_layout_code('${/parameter/@layout_code}_get_layout_code_link_id', param, 'bp_agent_modify_link', ds_id, '${/parameter/@layout_code}');
},
failure: function (res) {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
scope: this
});
};
// 提交审批
window['${/parameter/@layout_code}_submit_approval_layout_dynamic_click'] = function () {
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master_req');
var record = $(ds_id).getAt(0);
if (record.dirty) {
Leaf.showMessage('提示', '请先保存!');
return;
}
if ($(ds_id).validate()) {
var record = $(ds_id).getAt(0);
Leaf.showConfirm('${l:HLS.PROMPT}', '确定提交审批吗?', function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({
url: $('hls214_bp_master_basic_submit_link_id').getUrl(),
para: {
change_req_id: record.get('change_req_id')
},
success: function (res) {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@winid}').close();
},
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']();
},
scope: this
});
});
}
};
//add by zhuxianfei 20180103
// function id_card_no_validate(record, name, value) {
// if(name == 'id_card_no' && record.get('id_type') != 'ID_CARD'){
// return true;
// }else if(name == 'id_no_sp' && record.get('card_type_sp') != 'ID_CARD'){
// return true;
// }
// if (!checkCard(value)) {
// Leaf.showMessage('提示', '请输入正确格式的身份证!');
// return '请输入正确格式的身份证';
// }
// if (value.length == 18) {
// record.set('date_of_birth', new Date(value.substr(6, 4) + '/' + value.substr(10, 2) + '/' + value.substr(12, 2)));
// record.set('age', new Date().getFullYear() - value.substr(6, 4));
// if (value.substr(16, 1) % 2 == 1) {
// record.set('gender', 'MALE');
// record.set('gender_n', '男');
// } else if (value.substr(16, 1) % 2 == 0) {
// record.set('gender', 'FEMALE');
// record.set('gender_n', '女');
// }
// }
// return true;
// }
/*Leaf.onReady(init);
function init() {
var bp_class = '${/parameter/@bp_class}';
if (bp_class != 'ORG') {
var user_button4 = document.getElementById('${/parameter/@layout_code}' + '_user_button4');
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
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