Commit 934213d2 authored by niminmin's avatar niminmin

Merge branch 'feature/回租/二次租赁开发' into develop

# Conflicts:
#	src/main/webapp/modules/csh/CSH501/csh_payment_create_entrance.lview
parents 1ce3db97 39372c51
......@@ -15,6 +15,7 @@
from con_contract c
where c.data_class = 'NORMAL'
and c.contract_status IN ('REPURING','ETING','INCEPT','PENDING')
and c.business_type <>'LEASEBACK'
and not exists (select 1 from acp_invoice_ln an where an.contract_id=c.contract_id and an.confirmation_status in('APPROVING','APPROVED'))
) V
#WHERE_CLAUSE#
......
......@@ -78,10 +78,12 @@
<bm:query-field field="bp_id_agent_desc" queryExpression="bp_id_agent_desc like upper(&apos;%&apos;||${@bp_id_agent_desc}||&apos;%&apos;)"/>
</bm:query-fields>
<bm:data-filters>
<bm:field name="is_terminate" expression="(SELECT ccc.write_off_flag from con_contract_cashflow ccc WHERE ccc.contract_id=t1.contract_id AND ccc.cf_item=8 AND ccc.cf_status=&apos;RELEASE&apos;)=&apos;FULL&apos;"/>
<bm:field name="is_terminate" expression="((t1.contract_status not in('REPURING') and (SELECT ccc.write_off_flag from con_contract_cashflow ccc WHERE ccc.contract_id=t1.contract_id AND ccc.cf_item=8 AND ccc.cf_status=&apos;RELEASE&apos;)=&apos;FULL&apos;)or(t1.contract_status='REPURING'))"/>
<bm:data-filter enforceOperations="query" expression="t1.contract_status in (&apos;INCEPT&apos;,&apos;ETING&apos;,&apos;REPURING&apos;,&apos;TERMINATING&apos;) "/>
<!-- <bm:data-filter enforceOperations="query" expression="t1.lease_end_date &lt;= sysdate"/> -->
<bm:data-filter enforceOperations="query" expression="t1.data_class = &apos;NORMAL&apos;"/>
<!-- <bm:data-filter enforceOperations="query" expression=" not exists (select 1 from con_contract_cashflow ccw where ccw.contract_id = t1.contract_id and ccw.cf_item=1 and ccw.cf_status=&apos;RELEASE&apos; and nvl(ccw.output_tax_create_je_flag,'N')='N')"/>-->
<bm:data-filter enforceOperations="query" expression=" not exists (select 1 from con_contract_cashflow ccw , con_unearned_finance_income cf where ccw.contract_id = t1.contract_id and ccw.cf_item=1 and cf.cashflow_id(+)=ccw.cashflow_id and ccw.cf_status=&apos;RELEASE&apos; and nvl(cf.create_je_flag,'N')='N' and nvl(ccw.output_tax_create_je_flag,'N')='N')"/>
<!-- <bm:data-filter enforceOperations="query" expression="t1.contract_id = ${@contract_id}"/>-->
<!--<bm:data-filter enforceOperations="query" expression=" NOT EXISTS (SELECT 1 FROM con_contract_cashflow WHERE contract_id = t1.contract_id AND cf_item IN (1,8,52) AND (write_off_flag IN (&apos;PARTIAL&apos;, &apos;NOT&apos;) OR received_amount != due_amount))"/>-->
<!--<bm:data-filter enforceOperations="query" expression="exists (select 1 from con_contract where contract_id = t1.contract_id and created_by = ${/session/@user_id})"/>-->
......
......@@ -26,6 +26,7 @@
v.contract_name,
v.project_name,
v.tenant_bp_id,
v.tenant_bp_id bp_id_tenant,
v.bp_id_tenant_n,
v.cf_description,
v.due_amount,
......@@ -46,8 +47,6 @@
v.search_term_1,
'' bank_full_name, --宏菱需要置为空 bank_key
v.irr,
v.application_type_n,
v.application_result_n,
v.price,
v.factory_price,
--代理店账户
......@@ -83,7 +82,9 @@
v.pattern,
v.machine_number,
v.repur_con_amt,
v.repur_con_ddct_amt
v.repur_con_ddct_amt,
v.entrusted_amount,
v.amount_tenant
FROM (SELECT t.contract_id,
(SELECT hbbc.bank_account_id
FROM hls_bp_master_bank_account hbbc
......@@ -100,14 +101,6 @@
(SELECT DECODE(COUNT(1), 0, 'N', 'Y')
FROM acp_invoice_ln ai
WHERE ai.contract_id = t.contract_id)) invoice_uploaded_flag_n,
(SELECT TO_CHAR(SUBSTR(wm_concat(cccr.interface_name), 1, 1000))
FROM con_contract_case_record cccr
WHERE cccr.document_id = t.contract_id
AND cccr.document_table = 'CON_CONTRACT') application_type_n,
(SELECT TO_CHAR(SUBSTR(wm_concat(cccr.status_n), 1, 1000))
FROM con_contract_case_record_lv cccr
WHERE cccr.document_id = t.contract_id
AND cccr.document_table = 'CON_CONTRACT') application_result_n,
f.times,
f.cashflow_id,
t.contract_number,
......@@ -120,35 +113,7 @@
h.description cf_description,
f.due_amount,
t.currency currency_code,
(CASE
WHEN f.cf_item IN (5, 6, 993, 998) THEN
(SELECT t.bank_account_name
FROM hls_bp_master_bank_account_v t
WHERE t.bp_id =
NVL(${@payment_bp_id},
csh_payment_req_pkg.get_bp_id(t.contract_id))
AND t.enabled_flag = 'Y'
AND t.sap_bvtyp = DECODE(t.division,
'10',
'CNYA',
'00',
'CNYA',
'01',
'CNYB')
AND rownum = 1)
WHEN f.cf_item IN (992, 994, 995, 997) THEN
(SELECT t.bank_account_name
FROM hls_bp_master_bank_account_v t
WHERE t.bp_id =
NVL(${@payment_bp_id},
csh_payment_req_pkg.get_bp_id(t.contract_id))
AND t.enabled_flag = 'Y'
AND t.sap_bvtyp = 'CNYC'
AND rownum = 1)
ELSE
NULL
END) bp_bank_account_id_n,
'' bp_bank_account_id_n,
(SELECT t.bank_branch_name
FROM hls_bp_master_bank_account_v t
WHERE t.bp_id =
......@@ -217,20 +182,6 @@
AND h.approval_status = 'APPROVING'),
0)) applied_pay_amount,
t.irr,
-- (SELECT
-- vl.price
-- FROM
-- hls_lease_products_vl vl
-- WHERE
-- vl.lease_products_code =
-- (SELECT
-- l.item_frame_number
-- FROM
-- con_contract_lease_item l
-- WHERE
-- l.contract_id= t.contract_id
-- )
-- )price
i.price,
i.factory_price,
--获得厂商的相关信息
......@@ -250,24 +201,12 @@
from con_contract cc
where cc.contract_id =f.contract_id)
and pq.document_category = 'PROJECT')) other_payment2,
DECODE(t.division, '10', 'CNYA', '00', 'CNYA', '01', 'CNYB') sap_bvtyp,
(SELECT v.code_value_name
FROM sys_code_values_v v
WHERE v.code = 'HLS_SAP_BVTYP'
AND v.code_enabled_flag = 'Y'
AND v.code_value_enabled_flag = 'Y'
AND v.code_value = DECODE(t.division,
'10',
'CNYA',
'00',
'CNYA',
'01',
'CNYB')) sap_bvtyp_n,
i.pattern,
i.machine_number,
nvl((select due_amount from con_contract_cashflow where contract_id=t.repur_contract_id and cf_item=250),0)repur_con_amt,
nvl((select due_amount from con_contract_cashflow where contract_id=t.repur_contract_id and cf_item=250),0)repur_con_ddct_amt
nvl((select due_amount-nvl(received_amount,0) from con_contract_cashflow where contract_id=t.repur_contract_id and cf_item=250),0)repur_con_amt,
nvl((select due_amount-nvl(received_amount,0) from con_contract_cashflow where contract_id=t.repur_contract_id and cf_item=250),0)repur_con_ddct_amt,
nvl(t.entrusted_amount,0) entrusted_amount,
decode(t.business_type,'LEASEBACK',(f.due_amount-nvl(t.down_payment,0)-nvl(t.entrusted_amount,0)),'LEASE',0) amount_tenant
FROM con_contract_cashflow f
join con_contract t
on t.contract_id = f.contract_id
......@@ -278,24 +217,7 @@
on t.project_id = p.project_id
left outer join con_contract_lease_item i
on i.contract_id = t.contract_id
and i.equipment_type = decode(f.cf_item,
5,
'MAIN',
6,
'MAIN',
992,
'MAIN',
997,
'MAIN',
993,
'ACCESSORY',
998,
'ACCESSORY',
994,
'ACCESSORY',
995,
'ACCESSORY',
'')
and i.equipment_type ='MAIN'
where EXISTS (SELECT 1
FROM CSH_PAYMENT_CASHFLOW_ID_TEMP tmp
WHERE tmp.session_id = ${/session/@session_id}
......
......@@ -14,6 +14,7 @@
c.contract_name,
c.contract_id,
c.bp_id_agent_level1,
c.bp_id_tenant,
ccli.pattern pattern,
ccli.machine_number machine_number,
ccli.modelcd,
......@@ -118,7 +119,12 @@
cpr.ref_doc_line_id,
cpr.ref_doc_category,
nvl(cpr.repur_con_amt,0)repur_con_amt,
nvl(cpr.repur_con_ddct_amt,0)repur_con_ddct_amt
nvl(cpr.repur_con_ddct_amt,0)repur_con_ddct_amt,
nvl(cpr.amount_tenant,0)amount_tenant,
cpr.tenant_bank_account_name,
cpr.tenant_bank_account_number,
cpr.tenant_bank_account_number tenant_bank_account_number_n,
nvl(c.entrusted_amount,0) entrusted_amount
from csh_payment_req_ln cpr,
con_contract c,
......
......@@ -160,7 +160,12 @@
where hls_bp_master.bp_id = t.bp_id_agent_level1) bp_id_agent_n,
--查找厂商
(SELECT bp_name FROM hls_bp_master h WHERE h.bp_id=hli.vender_id) vender_name_n,
hli.vender_name
hli.vender_name,
t.business_type,
(SELECT h.description
FROM hls_business_type h
WHERE h.business_type = t.business_type) AS business_type_n,
f.due_amount-nvl(t.down_payment,0)-nvl(t.entrusted_amount,0) amount_tenant
FROM con_contract_cashflow f,
hls_cashflow_item h,
con_contract_lease_item i,
......@@ -180,9 +185,11 @@
AND f.cf_direction = 'OUTFLOW'
AND NOT EXISTS (
SELECT 1
FROM csh_payment_req_ln l
FROM csh_payment_req_ln l,csh_payment_req_hd hd
WHERE l.ref_doc_line_id=f.cashflow_id
AND l.ref_doc_category='CONTRACT'
and l.payment_req_id=hd.payment_req_id
and hd.approval_status in ('NEW','REJECT','APPROVED','APPROVING','RETURN')
)
AND t.data_class = 'NORMAL'
AND ('Y' = 'Y' AND EXISTS
......@@ -248,10 +255,13 @@
<bm:field name="con_business_type_n"/>
<bm:field name="cdd_list_id"/>
<bm:field name="bp_id_agent_n"/>
<bm:field name="bp_id_tenant"/>
<!-- <bm:field name="vender_name"/>-->
<bm:field name="vender_name_n"/>
<bm:field name="division"/>
<bm:field name="division_n"/>
<bm:field name="business_type"/>
<bm:field name="business_type_n"/>
<bm:field name="first_contract_day"/>
<bm:field name="invoice_uploaded_flag_n"/>
<bm:field name="pattern"/>
......@@ -269,6 +279,7 @@
<bm:field name="cf_61_write_off_flag_n"/>
<bm:field name="billing_status_n"/>
<bm:field name="invoice_status_n"/>
<bm:field name="amount_tenant"/>
<!-- <bm:field name="bp_bank_account_id"/>-->
<!-- <bm:field name="vender_bank_account_id"/>-->
<!-- <bm:field name="vender_name"/>-->
......@@ -336,5 +347,6 @@
<bm:query-field name="cf_61_write_off_flag" queryExpression="t1.cf_61_write_off_flag = ${@cf_61_write_off_flag}"/>
<bm:query-field name="vender_name" queryExpression="t1.vender_name=${@vender_name}"/>
<bm:query-field name="vender_name_n" queryExpression="t1.vender_name_n=${@vender_name_n}"/>
<bm:query-field name="business_type" queryExpression="t1.business_type=${@business_type}"/>
</bm:query-fields>
</bm:model>
......@@ -10,9 +10,12 @@
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
DELETE FROM csh_payment_req_hd t where t.payment_req_id = ${@payment_req_id};
DELETE FROM csh_payment_req_ln l where l.payment_req_id = ${@payment_req_id};
update csh_payment_req_hd t
set t.approval_status='CANCEL',
t.closed_flag='Y',
t.last_updated_by=${/session/@user_id},
t.last_update_date=sysdate
where t.payment_req_id = ${@payment_req_id};
end;
]]></bm:update-sql>
</bm:operation>
......
......@@ -9,20 +9,15 @@
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT
'Y' loan_flag
FROM
dual
WHERE
EXISTS
(SELECT
1
FROM
csh_payment_req_debt_ln_lv t
WHERE
t.payment_req_id =${/parameter/@payment_req_id} AND
t.cf_item = 5
)
Select cc.business_type
From csh_payment_req_ln t, con_contract cc
Where t.payment_req_id = ${/parameter/@payment_req_id}
And t.ref_doc_category = 'CONTRACT'
and t.ref_doc_id = cc.contract_id
and rownum = 1
]]></bm:query-sql>
</bm:operation>
</bm:operations>
......
......@@ -23,7 +23,7 @@ var override_queryfields = [
var add_datafilters = [
{
name : 'approval_status',
expression : "(t1.approval_status NOT in ('NEW','RETURN','REJECT'))"
expression : "(t1.approval_status NOT in ('NEW','RETURN','REJECT','CANCEL'))"
} ];
add_datafilter();
......
......@@ -12,90 +12,90 @@
<a:view>
<a:link id="sys_service_welcome_link" url="${/request/@context_path}/welcome.lview"/>
<script type="text/javascript"><![CDATA[
function aut_105_query() {
$('aut_owner_user_authorize_result_ds').query();
function aut_105_query() {
$('aut_owner_user_authorize_result_ds').query();
}
function aut_105_reset() {
$('aut_owner_user_authorize_query_ds').reset();
}
function aut_105_back() {
history.go(-1);
}
function aut_105_next() {
history.go(1);
}
function aut_105_quit() {
location.href = $('sys_service_welcome_link').getUrl();
parent.shMenu('show');
}
function aut_105_grid_add() {
var record = $('aut_owner_user_authorize_result_ds').getCurrentRecord();
if (!record) {
index = 0;
} else {
index = $('aut_owner_user_authorize_result_ds').indexOf(record);
}
function aut_105_reset() {
$('aut_owner_user_authorize_query_ds').reset();
var grid = $('aut_owner_user_authorize_result_ds_grid');
$('aut_owner_user_authorize_result_ds_grid').showEditorByRecord($('aut_owner_user_authorize_result_ds').create(index));
}
function aut_105_grid_clear() {
$('aut_owner_user_authorize_result_ds_grid').clear();
}
function aut_105_grid_delete() {
$('aut_owner_user_authorize_result_ds_grid').remove();
}
function aut_105_grid_submit() {
$('aut_owner_user_authorize_result_ds').submit();
}
function compareDate(start, end) {
if (start > end) {
return false;
}
function aut_105_back() {
history.go(-1);
}
function aut_105_next() {
history.go(1);
}
function aut_105_quit() {
location.href = $('sys_service_welcome_link').getUrl();
parent.shMenu('show');
}
function aut_105_grid_add() {
var record = $('aut_owner_user_authorize_result_ds').getCurrentRecord();
if (!record) {
index = 0;
} else {
index = $('aut_owner_user_authorize_result_ds').indexOf(record);
}
var grid = $('aut_owner_user_authorize_result_ds_grid');
$('aut_owner_user_authorize_result_ds_grid').showEditorByRecord($('aut_owner_user_authorize_result_ds').create(index));
}
function aut_105_grid_clear() {
$('aut_owner_user_authorize_result_ds_grid').clear();
}
function aut_105_grid_delete() {
$('aut_owner_user_authorize_result_ds_grid').remove();
}
function aut_105_grid_submit() {
$('aut_owner_user_authorize_result_ds').submit();
}
function compareDate(start, end) {
if (start > end) {
return false;
}
return true;
}
function dateValidator(record, name, value) {
if (name == 'start_date' || name == 'end_date') {
var start_date = record.get('start_date');
var end_date = record.get('end_date');
if (typeof(end_date) != 'undefined' && !Ext.isEmpty(end_date)) {
if (!compareDate(start_date, end_date)) {
return '${l:START_GREATER_THAN_END}';
}
return true;
}
function dateValidator(record, name, value) {
if (name == 'start_date' || name == 'end_date') {
var start_date = record.get('start_date');
var end_date = record.get('end_date');
if (typeof(end_date) != 'undefined' && !Ext.isEmpty(end_date)) {
if (!compareDate(start_date, end_date)) {
return '${l:START_GREATER_THAN_END}';
}
return true;
}
}
function aut105trxCategoryFunction(record, name) {
if (record.isNew) {
return 'aut105_grid_comb';
} else {
return '';
}
return true;
}
function aut105lovFunction(record, name) {
if (record.isNew) {
return 'aut105_grid_lov';
} else {
return '';
}
}
function aut105trxCategoryFunction(record, name) {
if (record.isNew) {
return 'aut105_grid_comb';
} else {
return '';
}
function aut_105_submitsuccess() {
$('aut_owner_user_authorize_result_ds').query();
}
function aut105lovFunction(record, name) {
if (record.isNew) {
return 'aut105_grid_lov';
} else {
return '';
}
}
function aut_105_submitsuccess() {
$('aut_owner_user_authorize_result_ds').query();
}
]]></script>
<a:dataSets>
<a:dataSet id="document_category_ds" loadData="true" model="aut.AUT103.aut_trx_category_v"/>
......@@ -153,7 +153,7 @@
<a:gridButton click="aut_105_query" text="HLS.QUERY"/>
<a:gridButton click="aut_105_reset" text="HLS.RESET"/>
<a:gridButton click="aut_105_grid_add" text="HLS.NEW"/>
<!-- <a:gridButton click="aut_105_grid_delete" text="HLS.REMOVE"/> -->
<a:gridButton click="aut_105_grid_delete" text="HLS.REMOVE"/>
<a:gridButton click="aut_105_grid_clear" text="HLS.CLEAR"/>
<a:gridButton click="aut_105_grid_submit" text="HLS.SAVE"/>
</a:screenTopToolbar>
......
......@@ -30,7 +30,7 @@ $Purpose:
<a:columns>
<a:column name="write_off_type_desc" prompt="核销类型" width="120"/>
<!-- <a:column name="write_off_classification_desc" prompt="核销分类" width="120"/>-->
<a:column name="journal_date" prompt="核销日期" renderer="Leaf.formatDate" width="120"/>
<a:column name="write_off_date" prompt="核销日期" renderer="Leaf.formatDate" width="120"/>
<a:column name="write_off_due_amount" prompt="核销金额" renderer="Leaf.formatMoney" width="120"/>
<a:column name="transaction_num" prompt="收款编号" width="120"/>
<a:column name="transaction_type" prompt="收款类型" align="center" width="120"/>
......
......@@ -66,12 +66,22 @@
if (ds_id == ds.id && ds_id) {
if (record.get('business_type') == 'LEASEBACK'&&'${/parameter/@function_usage}'=='MODIFY') {
record.set('submit_date',null);
record.set('guarantee_letter_f','NO');
record.set('guarantee_letter_f','N');
record.set('guarantee_letter_f_n','否');
record.getField('submit_date').setReadOnly(true);
record.getField('guarantee_letter_f').setReadOnly(true);
record.getField('guarantee_letter_f_n').setReadOnly(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('secondary_lease') == 'YES') {
document.getElementById('${/parameter/@layout_code}_F_BASIC_1_CON_CONTRACT_REPUR_CONTRACT_ID_prompt').style.display = 'block';
document.getElementById('${/parameter/@layout_code}_F_BASIC_1_CON_CONTRACT_REPUR_CONTRACT_ID').style.display = 'block';
} else if (record.get('secondary_lease') == 'NO') {
document.getElementById('${/parameter/@layout_code}_F_BASIC_1_CON_CONTRACT_REPUR_CONTRACT_ID_prompt').style.display = 'none';
document.getElementById('${/parameter/@layout_code}_F_BASIC_1_CON_CONTRACT_REPUR_CONTRACT_ID').style.display = 'none';
}
}
};
......
<?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"/> <link href="${/request/@context_path}/css/lightbox.css" rel="stylesheet" type="text/css"/> <script src="${/request/@context_path}/javascripts/lightbox.js" type="text/javascript"/> <script type="text/javascript"><![CDATA[ Ext.ux.Lightbox.register('a[ref=img]', true); function lock_current_window() { Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}'); } function unlock_current_window() { Leaf.Masker.unmask(Ext.getBody()); } window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function () { var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); var contract_id = $(ds_id).getCurrentRecord().get('contract_id'); new Leaf.Window({ id: 'contract_history_window', url: $('contract_history_window_link').getUrl(), params: { contract_id: contract_id }, fullScreen: true }); }; // window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record) { // if (name == 'car_detail') { // return '<a href="javascript:open_contract_window(\'' + record.id + '\',\'' + record.ds.id + '\')">' + config_record.get('prompt') + '</a>'; // } // return value; // }; window['${/parameter/@layout_code}_received_amount_detail'] = function (ds_id, id, name, query_only) { var url = $('${/parameter/@layout_code}_con_cashflow_wirte_off_detail_link').getUrl(); var record = $(ds_id).findById(id); if (record) { var win = new Leaf.Window({ id: 'con_cashflow_wirte_off_detail_window', url: url, params: { cashflow_id: record.get('cashflow_id'), winid: 'con_cashflow_wirte_off_detail_window' }, draggable: true, fullScreen: true }); } }; window['${/parameter/@layout_code}_dynamic_link_renderer'] = function (value, record, name, config_record, bp_seq) { var link_function = ''; window['${/parameter/@layout_code}_hls_link_render_record'][record.id + '---' + name] = record; if (name == 'project_number') { return '<a href="javascript:wfl_prj501_grid_update(\'' + record.id + '\',\'' + record.ds.id + '\')">' + value + '</a>'; } else if (name == 'gps_attch') { link_function = '${/parameter/@layout_code}_ast_con_cdd4_attachtment_upload'; if (record.get('atm_num3') > 0) { return '<a style="color:red" href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>'; } else { return '<a style="font-weight:bolder;font-size:1.2em" href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>'; } } else if (name == 'description') { if (record.get('important_flag') == 'Y') { return '<font color="RED">' + value + '</font>'; } return value; } else if (name == 'bp_link' && record.get('bp_id') && record.get('record_id')) { link_function = '${/parameter/@layout_code}_open_bp_detail_window'; return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\');">' + config_record.get('prompt') + '</a>'; } else if (name == 'car_detail' && record.get('contract_lease_item_id')) { link_function = '${/parameter/@layout_code}_open_lease_item_detail_window'; return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\');">' + config_record.get('prompt') + '</a>'; } else if (name == 'attachment') { link_function = '${/parameter/@layout_code}_prj500_cdd_attachtment_upload'; return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>'; } else if (name == 'attach_file_name' || name == 'attach_file_name_print' || name=='attachment_new') { var content_type = record.get('content_type'); var content_id = record.get('content_id'); //电子合同 // if(content_type == '01'){ // var link = '${/request/@context_path}/modules/xxx/pdf_download.lsc?type=SIN&content_id=' + content_id; // var url = ''; // url = url + '<a href=' + link + '>' + '下载' + '</a>' + ','; // return url; // }else { if (value != null) { var link = '${/request/@context_path}/atm_download.lsc?attachment_id='; var str = value.split(';;'); var url = ''; for (var i = 0; i < str.length; i++) { var temp = str[i].split('--'); if (!Leaf.isEmpty(temp[0])) { var file_name = temp[0].toUpperCase(); var file_suffix = temp[0].substr(temp[0].lastIndexOf('.') + 1).toUpperCase(); if (file_name.indexOf('.PDF') >= 0) { url = url + '<a href=javascript:view_pdf(\'' + temp[1] + '\')>' + temp[0] + '</a>' + ','; } else if (file_suffix == 'BMP' || file_suffix == 'JPG' || file_suffix == 'JPEG' || file_suffix == 'PNG' || file_suffix == 'GIF') { url = url + '<a href=' + link + temp[1] + ' ref="img">' + temp[0] + '</a>' + ','; } else { url = url + '<a href=' + link + temp[1] + '>' + temp[0] + '</a>' + ','; } } } return url; } //} } else if (name == 'received_amount') { link_function = '${/parameter/@layout_code}_received_amount_detail'; if (value) { return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + Leaf.formatMoney(value) + '</a>'; } return ''; }else if(name == 'attach_file_name_new'){ link_function = '${/parameter/@layout_code}_prj500_cdd_attachtment_new_upload'; return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>'; } }; function wfl_prj501_grid_update(record_id, ds_id) { var record = $(ds_id).findById(record_id); var param = {}; param['bp_class'] = record.get('bp_class'); param['project_id'] = record.get('project_id'); param['function_code'] = 'PRJ502D'; param['function_usage'] = 'QUERY'; param['url_title'] = '租赁申请查询'; hls_doc_get_layout_code('${/parameter/@layout_code}_con_contract_get_layout_code_link_id', param, 'wfl_readonly_pageLink_projectQueryScreen_update_project', record.ds.id, '${/parameter/@layout_code}'); } window['${/parameter/@layout_code}_ast_con_cdd4_attachtment_upload'] = function (ds_id, id, name, query_only) { var record = $(ds_id).findById(id); // if (record.get('con_contract_id')) { var url; if (query_only == 'Y') { url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=CON_CONTRACT&header_id=' + record.get('contract_id'); } else { url = $('${/parameter/@layout_code}_prj500_cdd_uploadFile_id').getUrl() + '?table_name=CON_CONTRACT&header_id=' + record.get('contract_id'); } var win = new Leaf.Window({ url: url, title: 'gps附件上传', id: '${/parameter/@layout_code}${/parameter/@tree_code}_ast_con_cdd4_attachtment_upload_id', width: 850, height: 400 }); // win.on('close', function(){ // $(ds_id).query(); // }); // } else { // Leaf.showMessage('${l:HLS.PROMPT}', '请先保存!'); // } }; window['${/parameter/@layout_code}_open_lease_item_detail_window'] = function (id, name) { var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name]; var param = record.data; var contract_lease_item_id = record.get('contract_lease_item_id'); new Leaf.Window({ id: 'contract_lease_item_maintain_window', url: $('contract_lease_item_query_link').getUrl(), params: { contract_lease_item_id: contract_lease_item_id, winid: 'contract_lease_item_maintain_window' }, draggable: true, fullScreen: true }); }; window['${/parameter/@layout_code}_open_bp_detail_window'] = function (id, name) { var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name]; var param = {};//record.data; param['bp_id'] = record.get('bp_id'); param['cdd_list_id'] = record.get('cdd_list_id'); param['company_id'] = '${/session/company_id}'; param['document_id'] = record.get('bp_id'); param['document_category'] = 'BP'; param['bp_class'] = record.get('bp_class'); param['bp_category'] = record.get('bp_category'); if(record.get('bp_category') =='AGENT'){ param['function_code'] = 'HLS303_Q'; param['function_usage'] = 'QUERY'; }else{ param['function_code'] = 'CON505H'; param['function_usage'] = 'QUERY'; } param['bp_type'] = record.get('bp_type'); param['download'] = 'Y'; param['url_title'] = '${l:HLS212.BP_MASTER_QUERY}'; hls_doc_get_layout_code('${/parameter/@layout_code}_con_contract_get_layout_code_link_id', param, 'con505_hls_bp_master_query_link', record.ds.id, '${/parameter/@layout_code}'); }; // function open_contract_window(record_id, ds_id) { // var record = $(ds_id).findById(record_id); // var param = record.data; // var contract_lease_item_id = record.get('contract_lease_item_id'); // new Leaf.Window({ // id: 'contract_lease_item_maintain_window', // url: $('contract_lease_item_maintain_link').getUrl(), // params: { // contract_lease_item_id: contract_lease_item_id // }, // fullScreen: true // }); // // param['function_code'] = 'CON501D'; // // param['function_usage'] = 'MODIFY'; // // param['maintain_type'] = 'UPDATE'; // // param['url_title'] = '${l:CON301.CONTRACT_DETAIL}'; // // hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'con_contract_modify_link',ds_id); // } window['${/parameter/@layout_code}_prj500_cdd_attachtment_upload'] = function (ds_id, id, name, query_only) { var record = $(ds_id).findById(id); if (record.get('check_id')) { var url; //add by lijingjing 2019-11-15 if(record.get('attachment_tab_group')=='CREDIT_CHECK' && '${/parameter/@query_only}'=='Y'){ url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id'); }else if(record.get('attachment_tab_group')=='SIGN' && '${/parameter/@con_query_only}'=='N'){ url = $('${/parameter/@layout_code}_prj500_cdd_uploadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id'); }else if(record.get('attachment_tab_group')=='SIGN' && '${/parameter/@con_query_only}'=='Y'){ url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id'); } else if (query_only == 'Y'||'${/parameter/@download}'=='Y') { url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id'); } else { url = $('${/parameter/@layout_code}_prj500_cdd_uploadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id'); } var win = new Leaf.Window({ url: url, title: '${l:HLS.SUPPORTING_DOCUMENT}', id: '${/parameter/@layout_code}${/parameter/@tree_code}_prj500_cdd_uploadFile_screen_id', width: 850, height: 400 }); win.on('close', function () { record.ds.query(); }); } else { Leaf.showMessage('${l:HLS.PROMPT}', '请先保存!'); } }; window['${/parameter/@layout_code}_prj500_cdd_attachtment_new_upload'] = function (ds_id, id, name, query_only) { var record = $(ds_id).findById(id); if (record.get('check_id')) { var url //add by lijingjing 2019-11-15 if (query_only == 'Y'||'${/parameter/@download}'=='Y') { url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=CON_CONTRACT&header_id=' + record.get('check_id'); } else { url = $('${/parameter/@layout_code}_prj500_cdd_uploadFile_id').getUrl() + '?table_name=CON_CONTRACT&header_id=' + record.get('check_id'); } var win = new Leaf.Window({ url: url, title: '${l:HLS.SUPPORTING_DOCUMENT}', id: '${/parameter/@layout_code}${/parameter/@tree_code}_prj500_cdd_uploadFile_screen_id', width: 850, height: 400 }); win.on('close', function () { record.ds.query(); }); } else { Leaf.showMessage('${l:HLS.PROMPT}', '请先保存!'); } }; window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function () { // var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); var record = $(ds_id).getCurrentRecord(); var content_id; //alert($('${/parameter/@layout_code}_con505_contract_content_id').getUrl); Leaf.request({ url: $('${/parameter/@layout_code}_con505_contract_content_id').getUrl(), para: { content_id: content_id, contract_id: record.get('contract_id'), contract_bp_id: record.get('content_bp_pk'), clause_usage: 'GH_WITHHOLD_AGREE' }, success: function (rsc) { // //alert(rsc.result.content_id); Leaf.request({ url: $('${/parameter/@layout_code}_creat_con_contract_content_link_id').getUrl(), para: { content_id: rsc.result.content_id, file_path: '${/parameter/@file_path}' }, success: function () { Leaf.request({ url: $('${/parameter/@layout_code}_file_copy_from_template_link_id').getUrl(), para: { contract_id: record.get('contract_id'), content_id: rsc.result.content_id, file_path: '${/parameter/@file_path}', batch_flag: 'Y' }, success: function () { var url = $('${/parameter/@layout_code}_con_batch_dl_link_id').getUrl() + '?contract_id=' + record.get('contract_id') + '&content_id=' + rsc.result.content_id; window.open(url, '_self'); unlock_current_window(); } }); unlock_current_window(); }, error: function () { unlock_current_window(); }, failure: function () { unlock_current_window(); }, scope: this }); }, error: function () { unlock_current_window(); }, failure: function () { unlock_current_window(); }, scope: this }); }; window['${/parameter/@layout_code}_user_button3_layout_dynamic_click'] = function () { var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); var record = $(ds_id).getCurrentRecord(); var direct_debit_bank_id = record.get('direct_debit_bank_id'); var dd_bank_account_name = record.get('dd_bank_account_name'); var dd_bank_account_num = record.get('dd_bank_account_num'); if (!Ext.isEmpty(record.get('contract_number'))) { new Leaf.Window({ id: '${/parameter/@layout_code}_con_contract_content_confirm_win_id', params: { action: 'VIEW', contract_id: record.get('contract_id'), company_id: record.get('company_id'), document_category: record.get('document_category'), business_type: record.get('business_type'), winid: '${/parameter/@layout_code}_con_contract_content_confirm_win_id' }, url: $('${/parameter/@layout_code}_con_contract_content_confirm_link_id').getUrl(), title: '合同查看', width: 1300, height: 550 }); } else { Leaf.showErrorMessage('错误', '请先点击保存生成合同编号!'); } }; var change_flag = 'N'; //工作流中合同文本生成按钮 //基本信息tab页 新增必输字段的校验 add by liukang 20160328 window['${/parameter/@layout_code}_print_layout_dynamic_click'] = function () { var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); var con_lease_item_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_lease_item'); var record = $(ds_id).getCurrentRecord(); var con_lease_record = $(con_lease_item_id).getCurrentRecord(); var direct_debit_bank_id = record.get('direct_debit_bank_id'); var dd_bank_account_name = record.get('dd_bank_account_name'); var dd_bank_account_num = record.get('dd_bank_account_num'); var color_of_apprearance = con_lease_record.get('color_of_apprearance'); var item_frame_number = con_lease_record.get('item_frame_number'); var item_engine_number = con_lease_record.get('item_engine_number'); var license_number = con_lease_record.get('license_number'); /* if (Ext.isEmpty(direct_debit_bank_id)) { Leaf.showMessage('${l:HLS.PROMPT}', '请先填写数据并保存!'); } else */ if (!Ext.isEmpty(record.get('contract_number'))) { var win = new Leaf.Window({ id: '${/parameter/@layout_code}_con_contract_content_confirm_win_id', params: { contract_id: record.get('contract_id'), company_id: record.get('company_id'), document_category: record.get('document_category'), business_type: record.get('business_type'), winid: '${/parameter/@layout_code}_con_contract_content_confirm_win_id', change_flag: change_flag, contract_name: record.get('contract_name'), contract_number: record.get('contract_number') }, url: $('${/parameter/@layout_code}_con_contract_content_confirm_link_id').getUrl(), title: '合同文本生成', width: 1300, height: 550 }); //在关闭页面之后,刷新一下ds win.on('close', function () { if (ds_id) { $(ds_id).query(); } }); } else { Leaf.showErrorMessage('错误', '请先点击保存生成合同编号!'); } }; //add by zhuxianfei 20180207 function view_pdf(attachment_id) { Leaf.request({ url: '${/request/@context_path}/autocrud/fnd.fnd_atm_attachment/query', para: { attachment_id: attachment_id }, success: function (res) { var path = res.result.record.file_path; path = path.substr(path.indexOf('hls_attachment')); var tomcat_source = '${/parameter/@tomcat_source}'; var source_path = 'http://' + window.location.host + '/' + tomcat_source + '/' + path+'?type=pdf'; var oWin = window.open(source_path); }, scope: this }); } window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_query'] = function(ds, qpara, bp_seq) { var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_bs_score'); if (ds.id == ds_id) { qpara.contract_id = '${/parameter/@contract_id}'; //$(ds_id).setQueryParameter('contract_id', '${/parameter/@contract_id}'); } }; window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_form_add_and_load'] = function (ds, record, config_records, bp_seq) { 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') { 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'; } } }; // /*保存前调用,生成项目编号*/ // window['${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function (ds, record) { // var check_flag = true; // var prj_project_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project'); // var prj_record = $(prj_project_ds_id).getAt(0); // // var project_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project'); // // var lease_item_ds_id = '${/parameter/@layout_code}' + '_G_CAR_INFO_prj_project_lease_item_ds'; // var lease_item_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project_lease_item'); // var project_record = $(project_ds_id).getCurrentRecord(); // // var score_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_TENANT_SCORE_INFO', 'bp_tenant_rate_detail'); // var bp_tenant_detail_r = $(score_ds_id).getCurrentRecord(); // // if (bp_tenant_detail_r && ds.id == prj_project_ds_id) { // for (var key in bp_tenant_detail_r.data) { // if (key != 'bp_detail_id' && key != 'score_name' && key != 'bp_age' && key != 'project_id' && key != 'third_party_credibility' && key != 'third_party_credibility_n') { // if(!bp_tenant_detail_r.get(key)){ // Leaf.showInfoMessage("提示","承租人评分信息区域的所有字段,除\"第三方信用度\"外,其他都为必输字段,请填写!"); // bp_rate_flag = false; // break; // }else{ // bp_rate_flag = true; // } // } // } // } // if(!bp_rate_flag){ // return false; // } // if (prj_record.get('project_number')) { // return true; // } // window['${/parameter/@layout_code}_lock_layout_dynamic_window'](); // // return check_flag; // // }; 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'); if (record.dirty == true) { Leaf.showMessage('${l:PROMPT}', '${l:HLS.EXECUTE_AFTER_SAVE}'); return; } // if(record.get('contract_status')!='NEW'){ // $L.showErrorMessage("错误",'只能新建状态的合同才能发起签约!'); // return; // } if($(ds_id).validate()){ 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(); } }) ]]></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"/> <link href="${/request/@context_path}/css/lightbox.css" rel="stylesheet" type="text/css"/> <script src="${/request/@context_path}/javascripts/lightbox.js" type="text/javascript"/> <script type="text/javascript"><![CDATA[ Ext.ux.Lightbox.register('a[ref=img]', true); function lock_current_window() { Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}'); } function unlock_current_window() { Leaf.Masker.unmask(Ext.getBody()); } window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function () { var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); var contract_id = $(ds_id).getCurrentRecord().get('contract_id'); new Leaf.Window({ id: 'contract_history_window', url: $('contract_history_window_link').getUrl(), params: { contract_id: contract_id }, fullScreen: true }); }; // window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record) { // if (name == 'car_detail') { // return '<a href="javascript:open_contract_window(\'' + record.id + '\',\'' + record.ds.id + '\')">' + config_record.get('prompt') + '</a>'; // } // return value; // }; window['${/parameter/@layout_code}_received_amount_detail'] = function (ds_id, id, name, query_only) { var url = $('${/parameter/@layout_code}_con_cashflow_wirte_off_detail_link').getUrl(); var record = $(ds_id).findById(id); if (record) { var win = new Leaf.Window({ id: 'con_cashflow_wirte_off_detail_window', url: url, params: { cashflow_id: record.get('cashflow_id'), winid: 'con_cashflow_wirte_off_detail_window' }, draggable: true, fullScreen: true }); } }; window['${/parameter/@layout_code}_dynamic_link_renderer'] = function (value, record, name, config_record, bp_seq) { var link_function = ''; window['${/parameter/@layout_code}_hls_link_render_record'][record.id + '---' + name] = record; if (name == 'project_number') { return '<a href="javascript:wfl_prj501_grid_update(\'' + record.id + '\',\'' + record.ds.id + '\')">' + value + '</a>'; } else if (name == 'gps_attch') { link_function = '${/parameter/@layout_code}_ast_con_cdd4_attachtment_upload'; if (record.get('atm_num3') > 0) { return '<a style="color:red" href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>'; } else { return '<a style="font-weight:bolder;font-size:1.2em" href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>'; } } else if (name == 'description') { if (record.get('important_flag') == 'Y') { return '<font color="RED">' + value + '</font>'; } return value; } else if (name == 'bp_link' && record.get('bp_id') && record.get('record_id')) { link_function = '${/parameter/@layout_code}_open_bp_detail_window'; return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\');">' + config_record.get('prompt') + '</a>'; } else if (name == 'car_detail' && record.get('contract_lease_item_id')) { link_function = '${/parameter/@layout_code}_open_lease_item_detail_window'; return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\');">' + config_record.get('prompt') + '</a>'; } else if (name == 'attachment') { link_function = '${/parameter/@layout_code}_prj500_cdd_attachtment_upload'; return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>'; } else if (name == 'attach_file_name' || name == 'attach_file_name_print' || name == 'attachment_new') { var content_type = record.get('content_type'); var content_id = record.get('content_id'); //电子合同 // if(content_type == '01'){ // var link = '${/request/@context_path}/modules/xxx/pdf_download.lsc?type=SIN&content_id=' + content_id; // var url = ''; // url = url + '<a href=' + link + '>' + '下载' + '</a>' + ','; // return url; // }else { if (value != null) { var link = '${/request/@context_path}/atm_download.lsc?attachment_id='; var str = value.split(';;'); var url = ''; for (var i = 0; i < str.length; i++) { var temp = str[i].split('--'); if (!Leaf.isEmpty(temp[0])) { var file_name = temp[0].toUpperCase(); var file_suffix = temp[0].substr(temp[0].lastIndexOf('.') + 1).toUpperCase(); if (file_name.indexOf('.PDF') >= 0) { url = url + '<a href=javascript:view_pdf(\'' + temp[1] + '\')>' + temp[0] + '</a>' + ','; } else if (file_suffix == 'BMP' || file_suffix == 'JPG' || file_suffix == 'JPEG' || file_suffix == 'PNG' || file_suffix == 'GIF') { url = url + '<a href=' + link + temp[1] + ' ref="img">' + temp[0] + '</a>' + ','; } else { url = url + '<a href=' + link + temp[1] + '>' + temp[0] + '</a>' + ','; } } } return url; } //} } else if (name == 'received_amount') { link_function = '${/parameter/@layout_code}_received_amount_detail'; if (value) { return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + Leaf.formatMoney(value) + '</a>'; } return ''; } else if (name == 'attach_file_name_new') { link_function = '${/parameter/@layout_code}_prj500_cdd_attachtment_new_upload'; return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.ds.id + '\',\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>'; } }; function wfl_prj501_grid_update(record_id, ds_id) { var record = $(ds_id).findById(record_id); var param = {}; param['bp_class'] = record.get('bp_class'); param['project_id'] = record.get('project_id'); param['function_code'] = 'PRJ502D'; param['function_usage'] = 'QUERY'; param['url_title'] = '租赁申请查询'; hls_doc_get_layout_code('${/parameter/@layout_code}_con_contract_get_layout_code_link_id', param, 'wfl_readonly_pageLink_projectQueryScreen_update_project', record.ds.id, '${/parameter/@layout_code}'); } window['${/parameter/@layout_code}_ast_con_cdd4_attachtment_upload'] = function (ds_id, id, name, query_only) { var record = $(ds_id).findById(id); // if (record.get('con_contract_id')) { var url; if (query_only == 'Y') { url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=CON_CONTRACT&header_id=' + record.get('contract_id'); } else { url = $('${/parameter/@layout_code}_prj500_cdd_uploadFile_id').getUrl() + '?table_name=CON_CONTRACT&header_id=' + record.get('contract_id'); } var win = new Leaf.Window({ url: url, title: 'gps附件上传', id: '${/parameter/@layout_code}${/parameter/@tree_code}_ast_con_cdd4_attachtment_upload_id', width: 850, height: 400 }); // win.on('close', function(){ // $(ds_id).query(); // }); // } else { // Leaf.showMessage('${l:HLS.PROMPT}', '请先保存!'); // } }; window['${/parameter/@layout_code}_open_lease_item_detail_window'] = function (id, name) { var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name]; var param = record.data; var contract_lease_item_id = record.get('contract_lease_item_id'); new Leaf.Window({ id: 'contract_lease_item_maintain_window', url: $('contract_lease_item_query_link').getUrl(), params: { contract_lease_item_id: contract_lease_item_id, winid: 'contract_lease_item_maintain_window' }, draggable: true, fullScreen: true }); }; window['${/parameter/@layout_code}_open_bp_detail_window'] = function (id, name) { var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name]; var param = {};//record.data; param['bp_id'] = record.get('bp_id'); param['cdd_list_id'] = record.get('cdd_list_id'); param['company_id'] = '${/session/company_id}'; param['document_id'] = record.get('bp_id'); param['document_category'] = 'BP'; param['bp_class'] = record.get('bp_class'); param['bp_category'] = record.get('bp_category'); if (record.get('bp_category') == 'AGENT') { param['function_code'] = 'HLS303_Q'; param['function_usage'] = 'QUERY'; } else { param['function_code'] = 'CON505H'; param['function_usage'] = 'QUERY'; } param['bp_type'] = record.get('bp_type'); param['download'] = 'Y'; param['url_title'] = '${l:HLS212.BP_MASTER_QUERY}'; hls_doc_get_layout_code('${/parameter/@layout_code}_con_contract_get_layout_code_link_id', param, 'con505_hls_bp_master_query_link', record.ds.id, '${/parameter/@layout_code}'); }; // function open_contract_window(record_id, ds_id) { // var record = $(ds_id).findById(record_id); // var param = record.data; // var contract_lease_item_id = record.get('contract_lease_item_id'); // new Leaf.Window({ // id: 'contract_lease_item_maintain_window', // url: $('contract_lease_item_maintain_link').getUrl(), // params: { // contract_lease_item_id: contract_lease_item_id // }, // fullScreen: true // }); // // param['function_code'] = 'CON501D'; // // param['function_usage'] = 'MODIFY'; // // param['maintain_type'] = 'UPDATE'; // // param['url_title'] = '${l:CON301.CONTRACT_DETAIL}'; // // hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'con_contract_modify_link',ds_id); // } window['${/parameter/@layout_code}_prj500_cdd_attachtment_upload'] = function (ds_id, id, name, query_only) { var record = $(ds_id).findById(id); if (record.get('check_id')) { var url; //add by lijingjing 2019-11-15 if (record.get('attachment_tab_group') == 'CREDIT_CHECK' && '${/parameter/@query_only}' == 'Y') { url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id'); } else if (record.get('attachment_tab_group') == 'SIGN' && '${/parameter/@con_query_only}' == 'N') { url = $('${/parameter/@layout_code}_prj500_cdd_uploadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id'); } else if (record.get('attachment_tab_group') == 'SIGN' && '${/parameter/@con_query_only}' == 'Y') { url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id'); } else if (query_only == 'Y' || '${/parameter/@download}' == 'Y') { url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id'); } else { url = $('${/parameter/@layout_code}_prj500_cdd_uploadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id'); } var win = new Leaf.Window({ url: url, title: '${l:HLS.SUPPORTING_DOCUMENT}', id: '${/parameter/@layout_code}${/parameter/@tree_code}_prj500_cdd_uploadFile_screen_id', width: 850, height: 400 }); win.on('close', function () { record.ds.query(); }); } else { Leaf.showMessage('${l:HLS.PROMPT}', '请先保存!'); } }; window['${/parameter/@layout_code}_prj500_cdd_attachtment_new_upload'] = function (ds_id, id, name, query_only) { var record = $(ds_id).findById(id); if (record.get('check_id')) { var url; //add by lijingjing 2019-11-15 if (query_only == 'Y' || '${/parameter/@download}' == 'Y') { url = $('${/parameter/@layout_code}_prj500_cdd_downloadFile_id').getUrl() + '?table_name=CON_CONTRACT&header_id=' + record.get('check_id'); } else { url = $('${/parameter/@layout_code}_prj500_cdd_uploadFile_id').getUrl() + '?table_name=CON_CONTRACT&header_id=' + record.get('check_id'); } var win = new Leaf.Window({ url: url, title: '${l:HLS.SUPPORTING_DOCUMENT}', id: '${/parameter/@layout_code}${/parameter/@tree_code}_prj500_cdd_uploadFile_screen_id', width: 850, height: 400 }); win.on('close', function () { record.ds.query(); }); } else { Leaf.showMessage('${l:HLS.PROMPT}', '请先保存!'); } }; window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function () { // var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); var record = $(ds_id).getCurrentRecord(); var content_id; //alert($('${/parameter/@layout_code}_con505_contract_content_id').getUrl); Leaf.request({ url: $('${/parameter/@layout_code}_con505_contract_content_id').getUrl(), para: { content_id: content_id, contract_id: record.get('contract_id'), contract_bp_id: record.get('content_bp_pk'), clause_usage: 'GH_WITHHOLD_AGREE' }, success: function (rsc) { // //alert(rsc.result.content_id); Leaf.request({ url: $('${/parameter/@layout_code}_creat_con_contract_content_link_id').getUrl(), para: { content_id: rsc.result.content_id, file_path: '${/parameter/@file_path}' }, success: function () { Leaf.request({ url: $('${/parameter/@layout_code}_file_copy_from_template_link_id').getUrl(), para: { contract_id: record.get('contract_id'), content_id: rsc.result.content_id, file_path: '${/parameter/@file_path}', batch_flag: 'Y' }, success: function () { var url = $('${/parameter/@layout_code}_con_batch_dl_link_id').getUrl() + '?contract_id=' + record.get('contract_id') + '&content_id=' + rsc.result.content_id; window.open(url, '_self'); unlock_current_window(); } }); unlock_current_window(); }, error: function () { unlock_current_window(); }, failure: function () { unlock_current_window(); }, scope: this }); }, error: function () { unlock_current_window(); }, failure: function () { unlock_current_window(); }, scope: this }); }; window['${/parameter/@layout_code}_user_button3_layout_dynamic_click'] = function () { var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); var record = $(ds_id).getCurrentRecord(); var direct_debit_bank_id = record.get('direct_debit_bank_id'); var dd_bank_account_name = record.get('dd_bank_account_name'); var dd_bank_account_num = record.get('dd_bank_account_num'); if (!Ext.isEmpty(record.get('contract_number'))) { new Leaf.Window({ id: '${/parameter/@layout_code}_con_contract_content_confirm_win_id', params: { action: 'VIEW', contract_id: record.get('contract_id'), company_id: record.get('company_id'), document_category: record.get('document_category'), business_type: record.get('business_type'), winid: '${/parameter/@layout_code}_con_contract_content_confirm_win_id' }, url: $('${/parameter/@layout_code}_con_contract_content_confirm_link_id').getUrl(), title: '合同查看', width: 1300, height: 550 }); } else { Leaf.showErrorMessage('错误', '请先点击保存生成合同编号!'); } }; var change_flag = 'N'; //工作流中合同文本生成按钮 //基本信息tab页 新增必输字段的校验 add by liukang 20160328 window['${/parameter/@layout_code}_print_layout_dynamic_click'] = function () { var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); var con_lease_item_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_lease_item'); var record = $(ds_id).getCurrentRecord(); var con_lease_record = $(con_lease_item_id).getCurrentRecord(); var direct_debit_bank_id = record.get('direct_debit_bank_id'); var dd_bank_account_name = record.get('dd_bank_account_name'); var dd_bank_account_num = record.get('dd_bank_account_num'); var color_of_apprearance = con_lease_record.get('color_of_apprearance'); var item_frame_number = con_lease_record.get('item_frame_number'); var item_engine_number = con_lease_record.get('item_engine_number'); var license_number = con_lease_record.get('license_number'); /* if (Ext.isEmpty(direct_debit_bank_id)) { Leaf.showMessage('${l:HLS.PROMPT}', '请先填写数据并保存!'); } else */ if (!Ext.isEmpty(record.get('contract_number'))) { var win = new Leaf.Window({ id: '${/parameter/@layout_code}_con_contract_content_confirm_win_id', params: { contract_id: record.get('contract_id'), company_id: record.get('company_id'), document_category: record.get('document_category'), business_type: record.get('business_type'), winid: '${/parameter/@layout_code}_con_contract_content_confirm_win_id', change_flag: change_flag, contract_name: record.get('contract_name'), contract_number: record.get('contract_number') }, url: $('${/parameter/@layout_code}_con_contract_content_confirm_link_id').getUrl(), title: '合同文本生成', width: 1300, height: 550 }); //在关闭页面之后,刷新一下ds win.on('close', function () { if (ds_id) { $(ds_id).query(); } }); } else { Leaf.showErrorMessage('错误', '请先点击保存生成合同编号!'); } }; //add by zhuxianfei 20180207 function view_pdf(attachment_id) { Leaf.request({ url: '${/request/@context_path}/autocrud/fnd.fnd_atm_attachment/query', para: { attachment_id: attachment_id }, success: function (res) { var path = res.result.record.file_path; path = path.substr(path.indexOf('hls_attachment')); var tomcat_source = '${/parameter/@tomcat_source}'; var source_path = 'http://' + window.location.host + '/' + tomcat_source + '/' + path + '?type=pdf'; var oWin = window.open(source_path); }, scope: this }); } window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_query'] = function (ds, qpara, bp_seq) { var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_bs_score'); if (ds.id == ds_id) { qpara.contract_id = '${/parameter/@contract_id}'; //$(ds_id).setQueryParameter('contract_id', '${/parameter/@contract_id}'); } }; window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_form_add_and_load'] = function (ds, record, config_records, bp_seq) { debugger; var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract'); if (ds_id == ds.id && ds_id) { //业务类型回租时,默认只读“首付款抵扣”选项 if (record.get('business_type') == 'LEASEBACK' && '${/parameter/@function_usage}' == 'MODIFY') { //document.getElementById('${/parameter/@layout_code}_F_BASIC_1_CON_CONTRACT_ENTRUSTED_AMOUNT_prompt').style.display = 'block'; // document.getElementById('${/parameter/@layout_code}_F_BASIC_1_CON_CONTRACT_ENTRUSTED_AMOUNT').style.display = 'block'; record.getField('entrusted_amount').setRequired(true); } else if (record.get('business_type') == 'LEASE') { document.getElementById('${/parameter/@layout_code}_F_BASIC_1_CON_CONTRACT_ENTRUSTED_AMOUNT_prompt').style.display = 'none'; document.getElementById('${/parameter/@layout_code}_F_BASIC_1_CON_CONTRACT_ENTRUSTED_AMOUNT').style.display = 'none'; } } }; /*保存前调用校验*/ 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; }; 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'); if (record.dirty == true) { Leaf.showMessage('${l:PROMPT}', '${l:HLS.EXECUTE_AFTER_SAVE}'); return; } // if(record.get('contract_status')!='NEW'){ // $L.showErrorMessage("错误",'只能新建状态的合同才能发起签约!'); // return; // } if ($(ds_id).validate()) { 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(); } }) ]]></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"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true" trace="true">
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true"
trace="true">
<a:init-procedure>
<a:model-query model="cont.CON620.get_sys_role" rootPath="role_info"/>
</a:init-procedure>
......@@ -7,41 +8,43 @@
<a:link id="csh_payment_req_create_link" url="${/request/@context_path}/modules/csh/CSH501/csh_payment_req_selected.lview"/>
<a:link id="csh_payment_req_history_print_link_id" url="${/request/@context_path}/modules/csh/CSH501/csh_payment_req_history_pdf_print.lsc"/>
<a:link id="get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<a:link id="tre_loan_contact_cancel_change_link_id" model="lon.LON120.tre_loan_change_cancel" modelaction="update"/>
<a:link id="csh501_csh_payment_req_link1_id" url="${/request/@context_path}/modules/csh/CSH501/csh_payment_req.lview"/>
<a:link id="tre_loan_contact_cancel_change_link_id" model="lon.LON120.tre_loan_change_cancel"
modelaction="update"/>
<a:link id="csh501_csh_payment_req_link1_id"
url="${/request/@context_path}/modules/csh/CSH501/csh_payment_req.lview"/>
<a:link id="delete_payment_req_link_id" model="csh.CSH501.delete_payment_req" modelaction="batch_update"/>
<script type="text/javascript"><![CDATA[
Leaf.onReady(function(){
Leaf.onReady(function () {
//付款打印按钮只有会计担当和会计部长可见
if("${/model/role_info/record/@role_code}"!="0013"&&"${/model/role_info/record/@role_code}"!="0014"&&"${/model/role_info/record/@role_code}"!="0010") {
if ("${/model/role_info/record/@role_code}" != "0013" && "${/model/role_info/record/@role_code}" != "0014" && "${/model/role_info/record/@role_code}" != "0010") {
//$('${/parameter/@layout_code}_user_button5').style.display='none';
Ext.fly('${/parameter/@layout_code}_user_button5').dom.style.display="none";
}else{
Ext.fly('${/parameter/@layout_code}_user_button5').dom.style.display = "none";
} else {
//$('${/parameter/@layout_code}_user_button1').style.display='none';
Ext.fly('${/parameter/@layout_code}_user_button1').dom.style.display="none";
Ext.fly('${/parameter/@layout_code}_user_button1').dom.style.display = "none";
}
})
window['${/parameter/@layout_code}_user_button5_layout_dynamic_click'] = function() {
});
window['${/parameter/@layout_code}_user_button5_layout_dynamic_click'] = function () {
var ds_id = '${/parameter/@layout_code}_G_CSH_REQ_2_csh_payment_req_hd_ds';
var records = $(ds_id).getSelected();
if(records.length !=1){
$L.showInfoMessage("提示",'只有审批通过的付款申请才能打印,且一次只能打印一个付款申请!');
if (records.length != 1) {
$L.showInfoMessage("提示", '只有审批通过的付款申请才能打印,且一次只能打印一个付款申请!');
return;
}
//获取该付款申请的头id
var payment_req_id=records[0].get('payment_req_id');
var payment_status=records[0].get('approval_status');
if(payment_status!="APPROVED"){
$L.showInfoMessage("提示",'只有审批通过的付款申请才能打印,且一次只能打印一个付款申请!');
var payment_req_id = records[0].get('payment_req_id');
var payment_status = records[0].get('approval_status');
if (payment_status != "APPROVED") {
$L.showInfoMessage("提示", '只有审批通过的付款申请才能打印,且一次只能打印一个付款申请!');
return;
}
var url_l = $('csh_payment_req_history_print_link_id').getUrl() + '?document_id=' + payment_req_id + '&document_table=CSH_PAYMENT_APPROVE&file_path=${/parameter/@file_path}&batch_flag=Y&source_type=COMMON';
window.open(href = url_l, target = "_self");
}
window.open(href = url_l, target = "_self");
};
//新增
window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
//新增
window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function () {
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd');
var url = $('csh_payment_req_create_link').getUrl();
var win = new Leaf.Window({
......@@ -54,163 +57,158 @@
id: 'csh_payment_req_create_win_id',
fullScreen: true
});
win.on('close', function() {
win.on('close', function () {
$(ds_id).query();
});
};
//待申请清单删除
window['${/parameter/@layout_code}_G_CSH_REQ_1_USER_BUTTON1_layout_dynamic_tab_click'] = function() {
window['${/parameter/@layout_code}_G_CSH_REQ_1_USER_BUTTON1_layout_dynamic_tab_click'] = function () {
var ds_id = '${/parameter/@layout_code}_G_CSH_REQ_1_csh_payment_req_hd_ds';
var records = $(ds_id).getSelected();
var param = {};
var datas = [];
var win = Leaf.showConfirm('${l:HLS.PROMPT}', '是否确认取消该笔申请?', function okFun() {
if (!records.length) {
Leaf.showMessage('提示', '请至少选择一条数据!');
} else {
for (var i = 0;i < records.length;i++) {
if (records[i].get('payment_req_id')) {
if (records[i].get('approval_status') == 'APPROVING' || records[i].get('approval_status') == 'APPROVED') {
Leaf.showWarningMessage('${l:HLS.PROMPT}', '该付款申请状态为审核中或审批通过,不能删除!');
return;
}
data = {};
data['payment_req_id'] = records[i].get('payment_req_id');
data['_status'] = 'update';
datas.push(data);
if (!records.length) {
Leaf.showMessage('提示', '请至少选择一条数据!');
return;
}
Leaf.showConfirm('${l:HLS.PROMPT}', '是否确认取消该笔申请?', function okFun() {
for (var i = 0; i < records.length; i++) {
if (records[i].get('payment_req_id')) {
// if (records[i].get('approval_status') == 'APPROVING' || records[i].get('approval_status') == 'APPROVED') {
// Leaf.showWarningMessage('${l:HLS.PROMPT}', '该付款申请状态为审核中或审批通过,不能删除!');
// return;
// }
data = {};
data['payment_req_id'] = records[i].get('payment_req_id');
data['_status'] = 'update';
datas.push(data);
}
}
param['details'] = datas;
console.log(datas);
debugger
var url_l = $('delete_payment_req_link_id').getUrl();
Leaf.request({
url: url_l,
para: datas,
success: function() {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$(ds_id).query();
},
error: function() {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
failure: function() {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
scope: this
});
}
}, function cancelFun() {
Leaf.SideBar.enable = true;
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
});
win.on('close', function() {
Leaf.SideBar.enable = true;
});
}
//已申请清单删除
window['${/parameter/@layout_code}_G_CSH_REQ_2_USER_BUTTON1_layout_dynamic_tab_click'] = function() {
var ds_id = '${/parameter/@layout_code}_G_CSH_REQ_2_csh_payment_req_hd_ds';
var records = $(ds_id).getSelected();
var param = {};
var datas = [];
var win = Leaf.showConfirm('${l:HLS.PROMPT}', '是否确认取消该笔申请?', function okFun() {
if (!records.length) {
Leaf.showMessage('提示', '请至少选择一条数据!');
} else {
for (var i = 0;i < records.length;i++) {
if (records[i].get('payment_req_id')) {
if (records[i].get('approval_status') == 'APPROVING' || records[i].get('approval_status') == 'APPROVED') {
Leaf.showWarningMessage('${l:HLS.PROMPT}', '该付款申请状态为审核中或审批通过,不能删除!');
return;
}
data = {};
data['payment_req_id'] = records[i].get('payment_req_id');
data['_status'] = 'update';
datas.push(data);
param['details'] = datas;
var url_l = $('delete_payment_req_link_id').getUrl();
Leaf.request({
url: url_l,
para: datas,
success: function () {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$(ds_id).query();
},
error: function () {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
failure: function () {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
scope: this
});
}
}
param['details'] = datas;
var url_l = $('delete_payment_req_link_id').getUrl();
Leaf.request({
url: url_l,
para: datas,
success: function() {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$(ds_id).query();
},
error: function() {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
failure: function() {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
scope: this
});
}
}, function cancelFun() {
Leaf.SideBar.enable = true;
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
});
win.on('close', function() {
Leaf.SideBar.enable = true;
});
}
};
// //已申请清单删除
// window['${/parameter/@layout_code}_G_CSH_REQ_2_USER_BUTTON1_layout_dynamic_tab_click'] = function() {
// var ds_id = '${/parameter/@layout_code}_G_CSH_REQ_2_csh_payment_req_hd_ds';
// var records = $(ds_id).getSelected();
// var param = {};
// var datas = [];
// var win = Leaf.showConfirm('${l:HLS.PROMPT}', '是否确认取消该笔申请?', function okFun() {
// if (!records.length) {
// Leaf.showMessage('提示', '请至少选择一条数据!');
// } else {
// for (var i = 0;i < records.length;i++) {
// if (records[i].get('payment_req_id')) {
// if (records[i].get('approval_status') == 'APPROVING' || records[i].get('approval_status') == 'APPROVED') {
// Leaf.showWarningMessage('${l:HLS.PROMPT}', '该付款申请状态为审核中或审批通过,不能删除!');
// return;
// }
// data = {};
// data['payment_req_id'] = records[i].get('payment_req_id');
// data['_status'] = 'update';
// datas.push(data);
//
// }
// }
// param['details'] = datas;
// var url_l = $('delete_payment_req_link_id').getUrl();
// Leaf.request({
// url: url_l,
// para: datas,
// success: function() {
// window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
// $(ds_id).query();
// },
// error: function() {
// window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
// },
// failure: function() {
// window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
// },
// scope: this
// });
// }
// }, function cancelFun() {
// Leaf.SideBar.enable = true;
// window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
// });
// win.on('close', function() {
// Leaf.SideBar.enable = true;
// });
// }
// //删除
// window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function () {
// var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd');
// var records = $(ds_id).getSelected();
// var param = {};
// var datas = [];
// var win = Leaf.showConfirm('${l:HLS.PROMPT}', '${l:HLS.DELETE_CONFIRM}', function okFun() {
// if (!records.length) {
// Leaf.showMessage('提示', '请至少选择一条数据!');
// } else {
// for (var i = 0; i < records.length; i++) {
// if (records[i].get('payment_req_id')) {
// if (records[i].get('approval_status') != 'NEW'&& records[i].get('approval_status') != 'RETURN') {
// Leaf.showWarningMessage('${l:HLS.PROMPT}', '该付款申请状态不是新建或退回,不能删除!');
// return;
// }
// data = {};
// data['payment_req_id'] = records[i].get('payment_req_id');
// data['_status'] = 'update';
// datas.push(data);
//
// }
// }
// param['details'] = datas;
// var url_l = $('delete_payment_req_link_id').getUrl();
// Leaf.request({
// url: url_l,
// para: datas,
// success: function () {
// window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
// $(ds_id).query();
// },
// error: function () {
// window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
// },
// failure: function () {
// window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
// },
// scope: this
// });
// }
// }, function cancelFun() {
// Leaf.SideBar.enable = true;
// window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
// });
// win.on('close', function () {
// Leaf.SideBar.enable = true;
// });
//
// };
// //删除
// window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function () {
// var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd');
// var records = $(ds_id).getSelected();
// var param = {};
// var datas = [];
// var win = Leaf.showConfirm('${l:HLS.PROMPT}', '${l:HLS.DELETE_CONFIRM}', function okFun() {
// if (!records.length) {
// Leaf.showMessage('提示', '请至少选择一条数据!');
// } else {
// for (var i = 0; i < records.length; i++) {
// if (records[i].get('payment_req_id')) {
// if (records[i].get('approval_status') != 'NEW'&& records[i].get('approval_status') != 'RETURN') {
// Leaf.showWarningMessage('${l:HLS.PROMPT}', '该付款申请状态不是新建或退回,不能删除!');
// return;
// }
// data = {};
// data['payment_req_id'] = records[i].get('payment_req_id');
// data['_status'] = 'update';
// datas.push(data);
//
// }
// }
// param['details'] = datas;
// var url_l = $('delete_payment_req_link_id').getUrl();
// Leaf.request({
// url: url_l,
// para: datas,
// success: function () {
// window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
// $(ds_id).query();
// },
// error: function () {
// window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
// },
// failure: function () {
// window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
// },
// scope: this
// });
// }
// }, function cancelFun() {
// Leaf.SideBar.enable = true;
// window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
// });
// win.on('close', function () {
// Leaf.SideBar.enable = true;
// });
//
// };
function detail_link(id, name, query_only) {
......@@ -229,6 +227,7 @@
param['contract_name'] = record.get('contract_name');
param['division'] = record.get('division');
param['approval_status'] = record.get('approval_status');
param['con_business_type'] = record.get('con_business_type');
if (record.get('business_type') == 'PAYMENT') {
param['function_code'] = 'CSH501D';
} else if (record.get('business_type') == 'PREPAYMENT') {
......@@ -250,10 +249,10 @@
param['cond_para1'] = 'OTHER';
}
hls_doc_get_layout_code('get_layout_code_link_id', param, 'csh501_csh_payment_req_link1_id',ds_id,'${/parameter/@layout_code}');
hls_doc_get_layout_code('get_layout_code_link_id', param, 'csh501_csh_payment_req_link1_id', ds_id, '${/parameter/@layout_code}');
}
window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record) {
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 == 'detail') {
link_function = 'detail_link';
......@@ -264,13 +263,13 @@
}
}
};
window['${/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');
// var ds_id = '${/parameter/@layout_code}_G_CSH_REQ_1_csh_payment_req_hd_ds';
// var ds_id_2= '${/parameter/@layout_code}_G_CSH_REQ_2_csh_payment_req_hd_ds';
//
// if (ds.id == ds_id) {
aut_authority_list_validate_query(ds, qpara);
window['${/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');
// var ds_id = '${/parameter/@layout_code}_G_CSH_REQ_1_csh_payment_req_hd_ds';
// var ds_id_2= '${/parameter/@layout_code}_G_CSH_REQ_2_csh_payment_req_hd_ds';
//
// if (ds.id == ds_id) {
aut_authority_list_validate_query(ds, qpara);
// }
// if (ds.id == ds_id_2) {
// aut_authority_list_validate_query(ds, qpara);
......@@ -278,7 +277,8 @@
};
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
<a:screen-include screen="modules/cont/CON500/con_contract_authority_list_validate.lview?document_category=PAYMENT_REQ&amp;function_code=CSH501"/>
<a:screen-include
screen="modules/cont/CON500/con_contract_authority_list_validate.lview?document_category=PAYMENT_REQ&amp;function_code=CSH501"/>
</a:view>
</a:screen>
......@@ -20,79 +20,31 @@
<a:model-query autoCount="false"
defaultWhereClause=" document_category=&apos;PAYMENT_REQ&apos; and document_type=&apos;STD_PAYMENT_REQ&apos;"
fetchAll="true" model="hls.HLS003.hls_document_type" rootPath="default_payment_document_type"/>
<a:model-query autoCount="false" fetchAll="true" model="basic.current_bp_category"
rootPath="current_bp_category"/>
<a:model-query fetchAll="true" model="csh.CSH501.get_loan_flag" rootPath="loan_flag_path"/>
</a:init-procedure>
<a:view>
<a:link id="csh_payment_req_word_print_link_id"
url="${/request/@context_path}/modules/csh/CSH501/csh_payment_req_word_print.lsc"/>
<a:link id="cont811_con_sale_contract_info_print_link"
url="${/request/@context_path}/modules/csh/CSH501/payment_req_apply_print.lview"/>
<a:link id="csh_req_ddct_link"
url="${/request/@context_path}/modules/csh/CSH504/csh_payment_req_ln_ddct.lview"/>
<a:link id="csh_payment_prepayment_dk"
url="${/request/@context_path}/modules/csh/CSH501/csh_payment_prepayment_dk.lview"/>
<a:link id="csh_payment_req_prepayment_dk_detail_link_id"
url="${/request/@context_path}/modules/csh/CSH501/csh_payment_req_prepayment_dk_detail.lview"/>
<a:link id="csh_payment_req_ln_del_link" model="csh.CSH504.csh_payment_req_ln_del" modelaction="batch_update"/>
<a:link id="csh501d_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code"
modelaction="update"/>
<a:link id="update_csh_payment_hd_info_link" model="csh.CSH501.csh_payment_req_get_num" modelaction="execute"/>
<a:link id="csh_payment_req_pay_win_link"
url="${/request/@context_path}/modules/csh/CSH502/csh_payment_req_pay.lview"/>
<a:link id="csh501_csh_payment_auto_ddct" model="csh.CSH501.auto_allocation_ddct" modelaction="execute"/>
<a:link id="csh_payment_auto_dt_link"
url="${/request/@context_path}/modules/csh/CSH501/csh_payment_req_auto_dk.lsc"/>
<a:link id="csh501_csh_payment_req_hd_del_link" model="csh.CSH504.csh_payment_req_hd_del" modelaction="update"/>
<a:link id="con_rd_wfl_link" url="${/request/@context_path}/modules/cont/CON505/con_contract_modify.lview"/>
<a:link id="csh_payment_req_ln_reject_link" model="csh.CSH504.csh_payment_req_ln_reject"
modelaction="batch_update"/>
<a:link id="csh_payment_req_ln_atm_reject_link" model="csh.CSH504.csh_payment_req_ln_atm_reject"
modelaction="batch_update"/>
<a:link id="csh_payment_post_nc_link" model="csh.CSH501.csh_payment_post_nc" modelaction="update"/>
<a:link id="csh_payment_pay_nc_link" model="csh.CSH501.csh_payment_post_nc" modelaction="execute"/>
<a:link id="csh_payment_bank_link" model="csh.CSH502.csh_pay_send" modelaction="update"/>
<a:link id="csh501d_car_info_link_id"
url="${/request/@context_path}/modules/csh/CSH501/csh501d_car_info.lview"/>
<a:link id="csh501D_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code"
modelaction="update"/>
<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 src="${/request/@context_path}/javascripts/calculate.js" type="text/javascript"/>
<script src="${/request/@context_path}/javascripts/calculate.js" type="text/javascript"/>
<a:link id="${/parameter/@layout_code}${/parameter/@pre_layout}prj500_cdd_uploadFile_id"
url="${/request/@context_path}/uploadFile.lview"/>
<a:link id="assignment_agreement_print_link"
url="${/request/@context_path}/modules/csh/CSH501/csh_payment_req_print.lsc"/>
<a:link id="${/parameter/@layout_code}${/parameter/@pre_layout}prj500_cdd_downloadFile_id"
url="${/request/@context_path}/downloadFile.lview"/>
<script src="${/request/@context_path}/javascripts/jquery-1.6.4.min.js" type="text/javascript"/>
<a:link id="con_contract_houdu_link"
url="${/request/@context_path}/modules/csh/CSH501/contract_houdu_query.lview"/>
<a:link id="con_contract_houdu_readOnly_link"
url="${/request/@context_path}/modules/csh/CSH501/contract_houdu_readOnly.lview"/>
<a:link id="prj_project_approval_link"
url="${/request/@context_path}/modules/prj/PRJ500N/prj_project_query.lview"/>
<a:link id="csh501_confirm_invoice_link_id"
url="${/request/@context_path}/modules/acp/ACP517/acp_invoice_entrance.lview"/>
<a:link id="get_xml" model="cont.CON501.con_change_case_submit" modelaction="execute"/>
<!-- 生成Excel文件-->
<a:link id="tre_loan_con_print_excel_link_id"
url="${/request/@context_path}/modules/csh/CSH501/csh_payment_contract_export.lsc"/>
<script type="text/javascript"><![CDATA[
jQuery.noConflict();
var con_business_type='${/parameter/@con_business_type}'||'${/model/loan_flag_path/record/@business_type}'||'LEASE';
//工作流审批界面校验发票状态
if ('${/parameter/@source_type}' == 'WFL_Y') {
if ('${/parameter/@ }' == 'WFL_Y') {
zjwfl5110_ApproveChecker_add('zjwfl5110_submit', function (type) {
var lnds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln');
// if ('${/parameter/@re_param}' == 'node1') {
if (type == 'agree') {
if (type == 'agree'&&con_business_type == 'LEASE') {
var records = $(lnds_id).getAll();
for (var i = 0; i < records.length; i++) {
if (records[i].get('billing_status_n') != '已开票' || records[i].get('invoice_status_n') != '已确认') {
......@@ -105,8 +57,19 @@
// }
});
}
function get_current_amount(amt) {
if (!Ext.isEmpty(amt)) {
return parseFloat(amt).toFixed(2);
} else {
return 0;
}
}
//如果头id 不为空,就使用自在定义的ds进行查询
Leaf.onReady(function () {
debugger;
if ('${/parameter/@source_type}' == 'WFL') {
document.getElementById('${/parameter/@layout_code}_save').style.display = "none";
}
var lnds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln');
var hdds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd');
var payment_req_id = '${/parameter/@payment_req_id}';
......@@ -116,20 +79,27 @@
$(lnds_id).query();
$(hdds_id).setQueryParameter("payment_req_id", payment_req_id);
$(hdds_id).query();
}
})
Ext.ux.Lightbox.register('a[ref=img]', true);
if (con_business_type == 'LEASE') {
$('CSH501D_PAYMENT_REQ_DETAIL_G_csh_payment_req_ln_layout_grid_id').hideColumn('amount_tenant');
$('CSH501D_PAYMENT_REQ_DETAIL_G_csh_payment_req_ln_layout_grid_id').hideColumn('tenant_bank_account_number');
$('CSH501D_PAYMENT_REQ_DETAIL_G_csh_payment_req_ln_layout_grid_id').hideColumn('tenant_bank_account_number_n');
$('CSH501D_PAYMENT_REQ_DETAIL_G_csh_payment_req_ln_layout_grid_id').hideColumn('tenant_bank_account_name');
//CSH501D_PAYMENT_REQ_HD_CSH_PAYMENT_REQ_HD_AMOUNT_TENANT_TOTAL_prompt
document.getElementById('CSH501D_PAYMENT_REQ_HD_CSH_PAYMENT_REQ_HD_AMOUNT_TENANT_TOTAL_prompt').style.display = 'none';
document.getElementById('CSH501D_PAYMENT_REQ_HD_CSH_PAYMENT_REQ_HD_AMOUNT_TENANT_TOTAL').style.display = 'none';
}
// var elements=document.querySelector('td[title="SBO反馈信息"]');
// elements.remove();
});
if ('${/parameter/@payment_req_id}') {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
}
var dirty_flag = 'N';
window['${/parameter/@layout_code}_on_layout_dynamic_update'] = function (ds, record, name, value, old_value, bp_seq) {
//如果更新数据,将付款日期先置为空
var dirty_flag = 'Y';
dirty_flag = 'Y';
var hdds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd');
var lnds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln');
var hd_ds, ln_ds, lineRecords, currency_code, currency_name;
......@@ -141,87 +111,27 @@
ln_ds = $(lnds_id);
lineRecords = ln_ds.getAll();
}
if (hdds_id && ds.id == hdds_id) {
//
if (name == 'first_payment_date') {
var first_payment_date = hdrecord.get('first_payment_date');
if (first_payment_date.getDate() != '5' && first_payment_date.getDate() != '10' && first_payment_date.getDate() != '15' && first_payment_date.getDate() != '20' && first_payment_date.getDate() != '25' && first_payment_date.getDate() != '30') {
Leaf.showWarningMessage('${l:HLS.PROMPT}', '为统一收款日,请选择末位为5号、10号、15号、20号、25号、30号的日期!');
if (lnds_id && lnds_id == ds.id) {
if (name == 'amount_vender' || name == 'amount_agent') {
var due_amount =get_current_amount(record.get('due_amount'));
if (value < 0) {
Leaf.showMessage('${l:HLS.PROMPT}', '所填金额应大于等于0!');
setTimeout(function () {
record.set(name, null);
}, 5);
return;
}
var first_contract_day = record.get('first_contract_day');
if (!record.get('first_contract_day')) {
first_contract_day = '${/parameter/@first_contract_day}';
}
if (first_contract_day) {
if (first_payment_date.getDate() != first_contract_day) {
Leaf.showWarningMessage('${l:HLS.PROMPT}', '为统一收款日,请选择首次支付表日期末位相同的日期!');
return;
}
}
}
if (name == 'req_date') {
/* for (var i = 0; i < lineRecords.length; i++) {
lineRecords[i].set('apply_pay_date', value);
}*/
} else if (name == 'bp_id' || name == 'bp_id_n' || name == 'bp_bank_account_id' || name == 'bp_bank_account_id_n' || name == 'bp_bank_account_num' || name == 'bp_bank_account_name' || name == 'bp_name' || name == 'bp_category' || name == 'bp_category_desc') {
for (var j = 0; j < lineRecords.length; j++) {
var lineRecord = lineRecords[j];
if (name == 'bp_id' && first_load_flag == 'N') {
lineRecord.set('bp_bank_account_id', null);
lineRecord.set('bp_bank_account_id_n', null);
lineRecord.set('bp_bank_account_num', null);
lineRecord.set('bp_bank_account_name', null);
}
lineRecord.set(name, record.get(name));
}
first_load_flag = 'N';
if (value > due_amount) {
$L.showErrorMessage("提示", '所填金额不能大于应付金额!');
setTimeout(function () {
record.set(name, null);
}, 5);
}
if (name == 'compensatory_flag') {
var compensatory_flag = record.get('compensatory_flag');
if (compensatory_flag == 'Y') {
hdrecord.getField('las_compensatory_amount').setReadOnly(false);
} else {
hdrecord.getField('las_compensatory_amount').setReadOnly(true);
hdrecord.set('las_compensatory_amount', null);
}
}
} else if (lnds_id && lnds_id == ds.id) {
if (name == 'amount') {
var amount = 0;
for (var m = 0; m < lineRecords.length; m++) {
var lineRecord = lineRecords[m];
currency_code = lineRecord.get('currency_code');
currency_name = lineRecord.get('currency_name');
if (hdrecord.get('currency_code') != currency_code) {
hdrecord.set('amount', null);
hdrecord.set('currency_code', null);
return;
} else {
current_amount = lineRecord.get('amount') || 0;
amount = plus(amount, current_amount);
}
}
hdrecord.set('amount', amount);
hdrecord.set('currency_code', currency_code);
hdrecord.set('currency_name', currency_name);
record.set('act_amount', minus(record.get('amount'), record.get('sum_ddct_amount') || 0));
} else if (name == 'amount_vender') {
var due_amount = record.get('due_amount');
var other_payment2 = record.get('other_payment2');
var amount_agent = minus(minus(due_amount, other_payment2), value);
if (amount_agent < 0) {
$L.showErrorMessage("提示", '委托付款金额和首付款抵充金额不能大于应付金额!');
return;
}
record.set('amount_agent', amount_agent);
}
else if (name == 'repur_con_ddct_amt') {
var repur_con_amt = record.get('repur_con_amt');
var other_payment2 = record.get('other_payment2');
var amount_vender=record.get('amount_vender');
} else if (name == 'repur_con_ddct_amt') {
var repur_con_amt = get_current_amount(record.get('repur_con_amt'));
var other_payment2 = get_current_amount(record.get('other_payment2'));
var amount_vender = get_current_amount(record.get('amount_vender'));
if (value < 0 || value == NaN || value == undefined) {
Leaf.showMessage('${l:HLS.PROMPT}', '回购租金抵冲金额应大于等于0!');
setTimeout(function () {
......@@ -230,36 +140,19 @@
return;
}
if (value > repur_con_amt) {
$L.showErrorMessage("提示", '回购租金抵冲金额不能大于回购租金金额!');
setTimeout(function () {
record.set('repur_con_ddct_amt', 0);
}, 5);
return;
}
var amount_agent = minus(minus(minus(due_amount, other_payment2), amount_vender),value);
if (amount_agent < 0) {
$L.showErrorMessage("提示", '委托付款金额,首付款抵充金额和回购租金抵冲金额不能大于应付金额!');
$L.showErrorMessage("提示", '回购租金抵冲金额不能大于回购租金剩余金额!');
setTimeout(function () {
record.set('repur_con_ddct_amt', 0);
}, 5);
return;
}
record.set('amount_agent', amount_agent);
}
else if (name == 'act_amount') {
hdrecord.set('sum_act_amount', plus(minus(hdrecord.get('sum_act_amount') || 0, old_value || 0), value || 0));
}
if (lineRecords.length == 1) {
if (name == 'bp_id' || name == 'bp_id_n' || name == 'bp_name' || name == 'bp_bank_account_id' || name == 'bp_bank_account_id_n' || name == 'bp_category' || name == 'bp_category_desc') {
hdrecord.set(name, record.get(name));
}
}
}
};
window['${/parameter/@layout_code}_on_layout_dynamic_grid_load'] = function (ds, record, config_records, bp_seq) {
debugger;
var hdds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd');
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln');
var hd_ds, lineRecords, currency_code;
if (hdds_id) {
hd_ds = $(hdds_id);
......@@ -270,111 +163,55 @@
record.getField('pay_amount').setReadOnly(false);
}
}
if (con_business_type == 'LEASE') {
if (ds.id == ds_id) {
var records = $(ds_id).getAll();
for (i = 0; i < records.length; i++) {
records[i].getField('amount_tenant').setRequired(false);
records[i].getField('tenant_bank_account_number').setRequired(false);
records[i].getField('tenant_bank_account_number_n').setRequired(false);
records[i].getField('tenant_bank_account_name').setRequired(false);
}
}
}
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
};
var first_load_flag = 'N';
window['${/parameter/@layout_code}_on_layout_dynamic_grid_add'] = function (ds, record, config_records, bp_seq) {
var hdds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd');
if (!'${/parameter/@payment_req_id}' && hdds_id) {
var hd_ds = $(hdds_id);
var hd_record = hd_ds.getCurrentRecord();
var amount = hd_record.get('amount') || 0;
var sum_act_amount = hd_record.get('sum_act_amount') || 0;
hd_record.set('currency_code', record.get('currency_code'));
hd_record.set('currency_name', record.get('currency_name'));
hd_record.set('amount', plus(amount, record.get('amount')));
hd_record.set('sum_act_amount', plus(sum_act_amount, record.get('act_amount')));
if (Ext.isEmpty(hd_record.get('irr')) && record.get('irr')) {
hd_record.set('irr', record.get('irr'));
}
if (Ext.isEmpty(record.get('act_amount'))) {
record.set('act_amount', minus(record.get('amount'), record.get('sum_ddct_amount') || 0));
}
if (ds.getAll().length == 1) {
first_load_flag = 'Y';
//
hdrecord.set('bp_id', record.get('bp_id'));
hdrecord.set('bp_id_n', record.get('bp_code'));
hdrecord.set('bp_name', record.get('bp_name'));
hdrecord.set('bp_bank_account_id', record.get('bp_bank_account_id'));
hdrecord.set('bp_bank_account_id_n', record.get('bp_bank_account_id_n'));
hdrecord.set('bp_bank_account_name', record.get('bp_bank_account_id_n'));
hdrecord.set('bp_bank_account_num', record.get('bp_bank_account_num'));
hdrecord.set('bp_category', record.get('bp_category'));
hdrecord.set('bp_category_desc', record.get('bp_category_desc'));
hdrecord.set('approval_status', 'NEW');
hdrecord.set('approval_status_n', '新建');
hdrecord.set('bank_full_name', record.get('bank_full_name'));
// hdrecord.set('price', record.get('price'));
}
}
};
function on_csh_payment_req_temp_ln_ds_load(ds) {
debugger;
var lnds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln');
var records = ds.getAll();
if (!'${/parameter/@payment_req_id}' && lnds_id && '${/parameter/@business_type}' == 'PAYMENT') {
for (var i = 0; i < records.length; i++) {
var record = records[i];
if (!record.get('apply_pay_date')) {
//添加时间为预定的每月20号
var pre_date = [new Date().getFullYear(), new Date().getMonth() + 1, 20].join('-');
record.set('apply_pay_date', pre_date);
}
$(lnds_id).create(Ext.apply({}, record.data));
if (con_business_type == 'LEASE') {
var ln_record = $(lnds_id).getCurrentRecord();
ln_record.getField('amount_tenant').setRequired(false);
ln_record.getField('tenant_bank_account_number').setRequired(false);
ln_record.getField('tenant_bank_account_number_n').setRequired(false);
ln_record.getField('tenant_bank_account_name').setRequired(false);
}
}
}
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
// var ds_call_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_cdd_item_doc_ref');
// jQuery("div").hover(function() {
// if (ds_call_id) {
// var records = $(ds_call_id).getAll();
// for (var i = 0;i < records.length;i++) {
// var id = "#${/parameter/@layout_code}_ACY_prj_cdd_item_doc_ref_layout_grid_id__" + records[i].id;
// if (1) {
// jQuery(id).removeClass("grid-ckb item-ckb-u").addClass('grid-ckb item-ckb-readonly-u');
// }
// jQuery("div").unbind(); //移除所有
// }
// }
// });
}
function csh_payment_req_submit_finally() {
var win = Leaf.showConfirm('${l:HLS.PROMPT}', '${l:HLS.ARE_YOU_SURE_TO_SUBMIT}', function okFun() {
Leaf.showConfirm('${l:HLS.PROMPT}', '${l:HLS.ARE_YOU_SURE_TO_SUBMIT}', function okFun() {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd');
var hd_record = $(ds_id).getCurrentRecord();
var payment_req_id = hd_record.get('payment_req_id');
var line_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln');
var line_record = $(line_ds_id).getAt(0);
// var datas=$(line_ds_id).data;
// if(datas.length<=0){
// $L.showInfoMessage("提示",'无付款记录,不可提交审批!');
// window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
// return;
// }
// if (line_record.get('cf_item') == '52' || line_record.get('cf_item') == '509') {
// //保证金退还Doodream审批接口 CFL-FE5D96CF-694C-4290-A22E-241FC3F6DEF0
// var case_type = 'CFL-FE5D96CF-694C-4290-A22E-241FC3F6DEF0';
// $('${/parameter/@layout_code}_save').disable();
// $('${/parameter/@layout_code}_submit_approval').disable();
// getXml(case_type, payment_req_id);
// // else if (document_type == 'LEASEHOLD_CHAG') {
// // case_type = '';
// // }
//
// } else {
Leaf.request({
url: '${/request/@context_path}/autocrud/csh.CSH501.upd_csh_payment_sub_flag/execute',
para: {
......@@ -405,73 +242,9 @@
Leaf.SideBar.enable = true;
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
});
win.on('close', function () {
Leaf.SideBar.enable = true;
});
}
function getXml(case_type, payment_req_id) {
var req_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd');
var req_record = $(req_ds_id).getAt(0)
if (dirty_flag == 'Y') {
Leaf.showMessage('${l:HLS.PROMPT}', '页面数据存在修改,请先保存再发起起案!');
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return;
}
Leaf.request({
url: $('get_xml').getUrl(),
para: {
payment_req_id: payment_req_id,
interface_name: case_type
},
success: function (res) {
getUrl(res.result.xml)
//document.getElementById("doodream_iframe").contentWindow.ConnData(res.result.xml);
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
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
});
}
function getUrl(xml) {
Leaf.request({
url: '${/request/@context_path}/doodream/post/url',
para: {
xml: xml
},
success: function (res) {
window.open(res.message, "", "width=940, height=650, scrollbars=yes, toolbar=no, location=no, status=no, menubar=no");
Leaf.SideBar.show({
msg: '${l:HLS.SUBMIT_SUCCESS}',
duration: 2000
});
},
failure: function () {
Leaf.SideBar.show({
msg: 'failure',
duration: 2000
});
},
error: function () {
Leaf.SideBar.show({
msg: 'error',
duration: 2000
});
},
scope: this
});
}
//打印
function csh501_print() {
var hdds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd');
......@@ -479,29 +252,11 @@
var url_l = $('csh_payment_req_word_print_link_id').getUrl() + '?document_id=' + hd_record.get('payment_req_id') + '&document_table=CSH_PAYMENT_REQ&file_path=${/parameter/@file_path}&batch_flag=Y&source_type=COMMON';
window.open(href = url_l, target = "_self");
// var template_name = 'payment_apply_content.xml';
// var file_name = '付款请求书打印.doc';
// var url = $('cont811_con_sale_contract_info_print_link').getUrl() + '?template_name=' + template_name + '&payment_req_id=' + hd_record.get('payment_req_id') + '&file_name=' + encodeURI(file_name);
// window.location.href =url;
}
window['${/parameter/@layout_code}_submit_approval_layout_dynamic_click'] = function () {
Leaf.SideBar.enable = false;
//提交之前必须要保存
/* var hdds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd');
var hd_record = $(hdds_id).getCurrentRecord();
var payment_req_id = hd_record.get('payment_req_id');
if(payment_req_id){
$L.showInfoMessage("提示",'请先保存数据!');
return;
}*/
window['${/parameter/@layout_code}_SAVE_LAYOUT_DYNAMIC_CLICK'](csh_payment_req_submit_finally);
};
......@@ -517,286 +272,24 @@
} else {
csh501_print();
}
/*else {
Leaf.request({
url: '${/request/@context_path}/autocrud/csh.CSH504.csh_payment_print/execute',
para: {
payment_req_id: hd_record.get('payment_req_id'),
_status: 'execute'
},
success: function (res) {
csh501_print();
},
sync: true,
failure: function () {
Leaf.Masker.unmask(Ext.getBody());
},
error: function () {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
}, Leaf.Masker.unmask(Ext.getBody()));
}*/
};
// //车辆信息
// window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
// var lnds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln');
// var ln_ds = $(lnds_id);
// ln_record = ln_ds.getCurrentRecord();
// var param = {};
// param['function_usage'] = 'UPDATE';
// param['contract_id'] = ln_record.get('contract_id');
// //param['document_id'] = ln_record.get('contract_id');
// param['function_code'] = 'CSH501D_CAR_INFO';
// param['winid'] = 'csh501d_car_info_window';
// param['url_title'] = '车辆信息';
// hls_doc_get_layout_code('csh501D_get_layout_code_link_id', param, 'csh501d_car_info_link_id', null, '${/parameter/@layout_code}');
// };
//发票确认
window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function () {
var lnds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln');
var datas = $(lnds_id).getAt(0);
var contract_id = datas.get('contract_id');
var param = {};
param['function_code'] = 'ACR_INVOICE_QUERY_N';
param['function_usage'] = 'QUERY';
param['contract_id'] = contract_id;
param['winid'] = 'csh501_confirm_invoice_link_winid';
param['url_title'] = '发票确认';
hls_doc_get_layout_code('csh501D_get_layout_code_link_id', param, 'csh501_confirm_invoice_link_id');
};
window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function () {
var hdds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd');
var lnds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln');
var hd_ds = $(hdds_id),
ln_ds = $(lnds_id);
var Array = ln_ds.getSelected();
if (Array.length < 1) {
Leaf.showMessage('${l:PROMPT}', '${l:CHOOSE_ONE_RECORD}');
}
if (Array.length == ln_ds.getAll().length) {
window['${/parameter/@layout_code}_user_button7_layout_dynamic_click']();
} else {
Leaf.showConfirm('${l:HLS.PROMPT}', '${l:HLS.DELETE_CONFIRM}', function okFun() {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
var hdrecord = hd_ds.getCurrentRecord();
for (var i = 0,
length = Array.length; i < length; i++) {
if (Array[i].isNew) {
ln_ds.removeLocal(Array[i]);
hdrecord.set('amount', minus(hdrecord.get('amount') || 0, Array[i].act_amount || 0));
}
}
if (Array.length > 0) {
var param = ln_ds.getJsonData(true);
Leaf.request({
url: $('csh_payment_req_ln_del_link').getUrl(),
para: param,
success: function () {
if (hd_ds.getCurrentRecord().get('payment_req_id')) {
for (var i = 0; i < param.length; i++) {
hdrecord.set('amount', minus(hdrecord.get('amount') || 0, param[i].act_amount || 0));
}
ln_ds.query(ln_ds.currentPage);
}
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
failure: function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
scope: this
});
} else {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
}
});
}
};
window['${/parameter/@layout_code}_user_button3_layout_dynamic_click'] = function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
var lnds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln');
var ln_ds = $(lnds_id);
var records = ln_ds.getSelected();
if (records.length == 0) {
Leaf.showMessage('${l:PROMPT}', '请先选择要抵扣预付款的行明细!');
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return;
}
if (!records[0].get('payment_req_ln_id')) {
Leaf.showMessage('${l:PROMPT}', '请先保存数据!');
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return;
}
var param = {};
if ('${/parameter/@function_usage}' == 'QUERY') {
param['function_code'] = 'CSH501_PRE_DK_READONLY';
param['function_usage'] = 'QUERY';
} else {
param['function_code'] = 'CSH501_PRE_DK';
param['function_usage'] = 'UPDATE';
}
param['payment_req_id'] = records[0].get('payment_req_id');
param['winid'] = 'csh501_csh_payment_req_link_winid';
param['url_title'] = '预付款抵扣';
param['screen_width'] = '800';
param['screen_height'] = '500';
hls_doc_get_layout_code('csh501d_get_layout_code_link_id', param, 'csh_payment_prepayment_dk', lnds_id, '${/parameter/@layout_code}');
};
//业务核准函
window['${/parameter/@layout_code}_user_button8_layout_dynamic_click'] = function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
var hdds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd');
var hd_ds = $(hdds_id).getAt(0);
var lnds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln');
var ln_ds = $(lnds_id);
var records = ln_ds.getAll();
var record = records[0];
var param = {};
if ('${/parameter/@hzhan_flag}' == 'Y') {
var function_usage = 'MODIFY';
var maintain_type = 'MODIFY';
} else if ('${/parameter/@hzhan_flag}' == 'O') {
function_usage = 'QUERY';
maintain_type = 'READONLY';
}
param['contract_id'] = record.get('contract_id');
param['project_id'] = hd_ds.get('project_id');
param['function_code'] = 'PRJ_NOTICE_QUERY';
param['function_usage'] = function_usage;
param['maintain_type'] = maintain_type;
param['winId'] = 'prj_project_approval_link_winid';
param['url_title'] = '核准函';
hls_doc_get_layout_code('csh501d_get_layout_code_link_id', param, 'prj_project_approval_link', hdds_id, '${/parameter/@layout_code}');
};
// var first_repayment_flag = 'N';
//支付按钮
window['${/parameter/@layout_code}_user_button4_layout_dynamic_click'] = function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
var hdds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd'),
lnds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln');
var hd_ds = $(hdds_id),
ln_ds = $(lnds_id);
var hd_record = hd_ds.getCurrentRecord(),
line_records = ln_ds.getSelected();
var payment_req_id = hd_record.get('payment_req_id');
if (line_records.length == 0) {
Leaf.showMessage('${l:PROMPT}', '请选择一条单据进行确认!');
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return;
}
if (line_records.length > 1) {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
Leaf.showMessage('${l:PROMPT}', '一次支付只支持同一合同!');
return;
}
var current_bp_id;
var bp_bank_account_code;
var bp_bank_account_num;
var bp_bank_account_code_n;
var bp_bank_account_id;
var contract_id;
for (var i = 0; i < line_records.length; i++) {
var line_record = line_records[i];
if (!current_bp_id && line_record.get('bp_id')) {
current_bp_id = line_record.get('bp_id');
}
// if (line_record.get('cf_item') == '5') {
// first_repayment_flag = 'Y';
// }
/* if (current_bp_id && line_record.get('bp_id') && current_bp_id != line_record.get('bp_id')) {
Leaf.showMessage('${l:PROMPT}', '付款对象必须相同!');
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return;
} */
//支付金额为应付代理店
var this_pay_amount = plus(line_record.get('residual_agent_amount'), line_record.get('residual_vender_amount'));
if (this_pay_amount <= 0) {
Leaf.showMessage('${l:PROMPT}', '本次支付金额为空!');
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return;
}
if (line_record.get('payment_status') == 'FULL') {
Leaf.showMessage('${l:PROMPT}', '存在已全部付款的付款行,请核查付款明细!');
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return;
}
}
bp_bank_account_code = line_record.get('bp_bank_account_code');
bp_bank_account_num = line_record.get('bp_bank_account_num');
var vender_bank_account_num = line_record.get('vender_bank_account_number');
bp_bank_account_name = line_record.get('bp_bank_account_name');
bp_bank_account_code_n = line_record.get('bp_bank_account_code_n');
bp_bank_account_id = line_record.get('bp_bank_account_id');
contract_id = line_record.get('contract_id');
line_record.set('loan_date', hd_record.get('loan_date'));
line_record.set('hdds_id', hdds_id);
line_record.set('lnds_id', lnds_id);
line_record.set('vender_bank_account_num', vender_bank_account_num);
line_record.set('winid', 'csh_payment_req_pay_win');
var win = new Leaf.Window({
id: 'csh_payment_req_pay_win',
url: $('csh_payment_req_pay_win_link').getUrl(),
params: line_record.data,
/* {
payment_req_id: payment_req_id,
winid: 'csh_payment_req_pay_win',
hdds_id: hdds_id,
lnds_id: lnds_id,
bp_bank_account_code: bp_bank_account_code,
bp_bank_account_num: bp_bank_account_num,
bp_bank_account_name: bp_bank_account_name,
bp_bank_account_code_n: bp_bank_account_code_n,
bp_bank_account_id: bp_bank_account_id,
contract_id: contract_id,
loan_date: hd_record.get('loan_date')
//first_contract_day: hd_record.get('first_contract_day')
// ,first_repayment_flag: first_repayment_flag
},*/
title: '${l:CSH502.CSH_PAYMENT_REQ_PAY}',
fullScreen: true
});
win.on('close', function () {
var hdds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd');
$(hdds_id).query();
});
};
//保存前调用
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function (ds, record) {
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
debugger;
var check_flag = false;
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd');
var ds_line_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln');
if ($(ds_line_id).data.length <= 0) {
$L.showErrorMessage("错误", '无付款记录,不可提交审批!');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
check_flag = false;
return;
}
console.log('${/parameter/@division}');
var total_amount_agent = 0;
var total_amount_vender = 0;
var total_apply_amount = 0;
var total_amount_tenant=0;
//检验输入的数据是否符合要求
var check_due_amount_flag = true;
var line_datas = $(ds_line_id).data;
......@@ -806,14 +299,18 @@
for (var i = 0; i < line_datas.length; i++) {
var line_data = line_datas[i];
//应付我司金额
var amount_agent = line_data.get('amount_agent');
var amount_vender = line_data.get('amount_vender');
var due_amount = line_data.get('due_amount');
var amount_agent = get_current_amount(line_data.get('amount_agent'));
//应付厂商金额(
var amount_vender = get_current_amount(line_data.get('amount_vender'));
var due_amount = get_current_amount(line_data.get('due_amount'));
var bp_bank_account_id = line_data.get('bp_bank_account_id');
var vender_bank_account_id = line_data.get('vender_bank_account_id');
//首付款抵充金额
var other_payment2 = line_data.get('other_payment2');
var repur_con_ddct_amt=line_data.get('repur_con_ddct_amt');
var other_payment2 = get_current_amount(line_data.get('other_payment2'));
//回购抵充金额
var repur_con_ddct_amt = get_current_amount(line_data.get('repur_con_ddct_amt'));
//应付承租人金额
var amount_tenant = get_current_amount(line_data.get('amount_tenant'));
if (amount_agent < 0 || amount_vender < 0) {
$L.showErrorMessage("提示", '应付我司金额和首付款抵冲金额不能为负数!');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
......@@ -836,19 +333,33 @@
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
}
if (plus(plus(plus(amount_agent, amount_vender), other_payment2),repur_con_ddct_amt) != due_amount) {
$L.showErrorMessage("提示", '应付我司金额,委托付款金额,首付款抵冲金额和回购租金抵冲金额之和应等于应付金额!');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
if (con_business_type == 'LEASE') {
if (plus(plus(plus(amount_agent, amount_vender), other_payment2), repur_con_ddct_amt) != due_amount) {
$L.showErrorMessage("提示", '应付我司金额,委托付款金额,首付款抵冲金额和回购租金抵冲金额之和应等于应付金额!',null,500,300);
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
}
} else if (con_business_type == 'LEASEBACK') {
var entrusted_amount = get_current_amount(line_data.get('entrusted_amount'));
if (plus(plus(amount_agent, amount_vender),repur_con_ddct_amt) != entrusted_amount) {
$L.showErrorMessage("提示", '应付代理店金额、应付厂商金额、回购租金抵冲金额合计不等于合同签约时承租人所填写委托付款金额,请重新填写!',null,500,300);
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
}
if (plus(plus(plus(plus(amount_agent, amount_vender), other_payment2), repur_con_ddct_amt), amount_tenant) != due_amount) {
$L.showErrorMessage("提示", '应付我司金额,委托付款金额,应付承租人金额,首付款抵冲金额和回购租金抵冲金额之和应等于应付金额!',null,500,300);
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return false;
}
}
//本次申请金额等于委托加我司
var this_apply_amount = plus(amount_agent, amount_vender);
//本次申请金额等于委托加我司加应付承租人金额
var this_apply_amount = plus(plus(amount_agent, amount_vender),amount_tenant);
total_apply_amount = plus(total_apply_amount, this_apply_amount);
line_data.set('amount', this_apply_amount);
total_amount_agent = plus(total_amount_agent, amount_agent);
total_amount_vender = plus(total_amount_vender, amount_vender);
total_amount_tenant = plus(total_amount_tenant, amount_tenant);
}
if (gk_contract_num < line_datas.length && gk_contract_num != 0) {
$L.showErrorMessage("提示", '买断机合同(即厂商的付款金额为0)不可与其他正常合同同时进行付款申请支付');
......@@ -857,12 +368,14 @@
//给头表赋值
$(ds_id).getAt(0).set('amount_agent_total', total_amount_agent);
$(ds_id).getAt(0).set('amount_vender_total', total_amount_vender);
$(ds_id).getAt(0).set('amount_tenant_total', total_amount_tenant);
$(ds_id).getAt(0).set('amount', total_apply_amount);
$(ds_id).getAt(0).set('company_id', '${/session/@company_id}');
$(ds_id).getAt(0).set('transaction_category', 'BUSINESS');
$(ds_id).getAt(0).set('submitted_flag', 'N');
$(ds_id).getAt(0).set('printed_flag', 'N');
$(ds_id).getAt(0).set('document_category', 'PAYMENT_REQ');
//$(ds_id).getAt(0).set('currency_code', 'CNY');
//确认保存
var hd_record = $(ds_id).getCurrentRecord();
var payment_req_id = hd_record.get('payment_req_id');
......@@ -897,75 +410,20 @@
} else {
check_flag = true;
}
return check_flag || false;
};
//调用合同后督
window['${/parameter/@layout_code}_user_button5_layout_dynamic_click'] = function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
var lnds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln');
var ln_ds = $(lnds_id);
var records = ln_ds.getAll();
var record = records[0];
if (records.length == 0) {
Leaf.showMessage('${l:PROMPT}', '没有支付表。');
return;
}
var contract_id = record.get('contract_id');
var cdd_list_id = record.get('cdd_list_id');
if ('${/parameter/@layout_code}' == 'CSH501D') {
var url = $('con_contract_houdu_readOnly_link').getUrl();
} else {
var url = $('con_contract_houdu_link').getUrl();
}
// var url = $('con_contract_houdu_link').getUrl();
var win = new Leaf.Window({
id: 'contract_houdu_query_window',
url: url,
winId: 'contract_houdu_query_window_id',
params: {
contract_id: contract_id,
cdd_list_id: cdd_list_id,
winId: 'contract_houdu_query_window_id'
},
title: '后督事项',
fullScreen: true
});
win.on('close', function () {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
});
};
window['${/parameter/@layout_code}_on_layout_dynamic_form_add_and_load'] = function (ds, record, config_records, bp_seq) {
var hdds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd');
// if (!record.get('contract_number')) {
// record.set('contract_number', '${/parameter/@contract_number}');
// }
//
// if (!record.get('first_contract_day')) {
// record.set('first_contract_day', '${/parameter/@first_contract_day}');
// }
// //record.set('contract_number', '${/parameter/@contract_number}');
// record.set('contract_name', '${/parameter/@contract_name}');
// record.set('division', '${/parameter/@division}');
// record.set('division_n', '${/parameter/@division_n}');
if (hdds_id == ds.id && record.isNew) {
if ('${/parameter/@business_type}' == 'PAYMENT') {
record.set('business_type', '${/model/default_payment_document_type/record/@business_type}');
record.set('document_type', '${/model/default_payment_document_type/record/@document_type}');
record.set('document_type_n', '${/model/default_payment_document_type/record/@description}');
record.set('con_business_type', '${/parameter/@con_business_type}');
record.set('con_business_type_n', '${/parameter/@con_business_type_n}');
record.set('taxpayer_type', '${/parameter/@taxpayer_type}');
record.set('taxpayer_type_n', '${/parameter/@taxpayer_type_n}');
record.set('contract_id', '${/parameter/@contract_id}');
} else if ('${/parameter/@business_type}' == 'PREPAYMENT') {
......@@ -988,68 +446,9 @@
}
}
};
// // 加载时调用(grid,table,gridBox)
// window['${/parameter/@layout_code}_on_layout_dynamic_grid_load'] = function(ds, record) {
// var ds_call_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_cdd_item_doc_ref');
// jQuery("div").hover(function() {
// if (ds_call_id) {
// var records = $(ds_call_id).getAll();
// for (var i = 0;i < records.length;i++) {
// var id = "#${/parameter/@layout_code}_ACY_prj_cdd_item_doc_ref_layout_grid_id__" + records[i].id;
// if (1) {
// jQuery(id).removeClass("grid-ckb item-ckb-u").addClass('grid-ckb item-ckb-readonly-u');
// }
// jQuery("div").unbind(); //移除所有
// }
// }
// });
// };
function csh504_ddct_link(record_id, name) {
var record = window['${/parameter/@layout_code}_hls_link_render_record'][record_id + '---' + name];
if (record.dirty) {
Leaf.showMessage('${l:PROMPT}', '请先保存数据!');
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return;
}
var payment_req_ln_id = record.get('payment_req_ln_id'),
apply_amount = record.get('amount'),
contract_number = record.get('contract_number'),
ref_doc_id = record.get('ref_doc_id');
var win = new Leaf.Window({
id: 'csh_req_ddct_link_winid',
url: $('csh_req_ddct_link').getUrl(),
params: {
apply_amount: apply_amount,
payment_req_id: '${/parameter/@payment_req_id}',
payment_req_ln_id: payment_req_ln_id,
contract_number: contract_number,
contract_id: ref_doc_id,
winid: 'csh_req_ddct_link_winid',
function_usage: '${/parameter/@function_usage}'
},
title: '坐扣',
width: 1000,
height: 500
});
win.on('close', function () {
var hdds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd');
// var lnds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln');
var hd_record = $(hdds_id).getCurrentRecord();
var payment_req_id = hd_record.get('payment_req_id');
if (payment_req_id) {
$(hdds_id).setQueryParameter('payment_req_id', payment_req_id);
} else {
Leaf.showMessage('${l:PROMPT}', '请先保存数据');
return;
}
$(hdds_id).query();
// $(lnds_id).query($(lnds_id).currentPage);
});
}
//保存submitsuccess调用
window['${/parameter/@layout_code}_on_layout_dynamic_submitsuccess'] = function (ds, record, res, bp_seq) {
debugger;
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
dirty_flag = 'N';
var hdds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd');
......@@ -1096,93 +495,7 @@
};
function csh504_prepayment_dk_link(record_id, name) {
var record = window['${/parameter/@layout_code}_hls_link_render_record'][record_id + '---' + name];
var payment_req_ln_id = record.get('payment_req_ln_id');
var win = new Leaf.Window({
id: 'csh_payment_req_prepayment_dk_detail_link_winid',
url: $('csh_payment_req_prepayment_dk_detail_link_id').getUrl(),
params: {
bp_id: record.get('bp_id'),
payment_req_ln_id: payment_req_ln_id,
payment_req_id: record.get('payment_req_id'),
winid: 'csh_payment_req_prepayment_dk_detail_link_winid',
function_usage: '${/parameter/@function_usage}'
},
title: '预付款抵扣明细',
width: 650,
height: 500
});
win.on('close', function () {
var lnds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln');
$(lnds_id).query($(lnds_id).currentPage);
});
}
//add by zhuxianfei
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
});
}
function upload_file(id, name, query_only) {
var download = '${/parameter/@download}';
var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name];
if (record.get('check_id')) {
var url;
if (query_only == 'Y' || download == 'Y') {
url = $('${/parameter/@layout_code}${/parameter/@pre_layout}prj500_cdd_downloadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id');
} else {
url = $('${/parameter/@layout_code}${/parameter/@pre_layout}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: 'prj500_cdd_uploadFile_screen_id',
width: 850,
height: 400
});
win.on('close', function () {
record.ds.query();
});
} else {
Leaf.showMessage('${l:HLS.PROMPT}', '请先保存!');
}
}
// //合同编号超链接
// function open_con_contract_readonly_win(record_id, ds_id) {
// //创建明细页面根据条件表TBL_LA11字段 function_code、bp_class匹配布局代码layout_code BCML_CONTRACT_NP_MAINTAIN、BCML_CONTRACT_ORG_MAINTAIN
// var record = $(ds_id).findById(record_id);
// var param = record.data;
// param.function_code = 'CON301';
// param.function_usage = 'QUERY';
// param.url_title = '合同查询';
// param.winid = 'con_rd_wfl_link_winid';
// //param.layout_debugger_flag = 'Y';
// hls_doc_get_layout_code('csh501d_get_layout_code_link_id', param, 'con_rd_wfl_link', ds_id, '${/parameter/@layout_code}');
// }
//合同编号超链接
function open_con_contract_readonly_win(record_id, ds_id) {
//
//创建明细页面根据条件表TBL_LA11字段 function_code、bp_class匹配布局代码layout_code BCML_CONTRACT_NP_MAINTAIN、BCML_CONTRACT_ORG_MAINTAIN
......@@ -1193,10 +506,11 @@
}
// var param = {};
var param = record.data;
param.function_code = 'CON301_MODIFY';
param.function_code = 'CON3200Q';
param.division = division;
param.function_usage = 'QUERY';
param.url_title = '合同查询';
param.maintain_type = 'QUERY';
param.url_title = '${l:CON301.CONTRACT_DETAIL}';
param.winid = 'con_rd_wfl_link_winid';
//param.layout_debugger_flag = 'Y';
//hls_doc_get_layout_code('csh501d_get_layout_code_link_id', param, 'con_rd_wfl_link', null, '${/parameter/@layout_code}');
......@@ -1206,89 +520,11 @@
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 == 'ddct_link') {
link_function = 'csh504_ddct_link';
if (record.get('payment_req_ln_id')) {
return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\');">' + config_record.get('prompt') + '</a>';
} else {
return '';
}
} else if (name == 'act_amount') {
var act_amount = record.get('act_amount');
return Leaf.formatMoney(act_amount);
} else if (name == 'prepayment_dk') {
link_function = 'csh504_prepayment_dk_link';
if (record.get('payment_req_ln_id')) {
return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\');">' + config_record.get('prompt') + '</a>';
} else {
return '';
}
} else if (name == 'contract_number' && value) {
if (name == 'contract_number' && value) {
return '<a href="javascript:open_con_contract_readonly_win(\'' + record.id + '\',\'' + record.ds.id + '\')">' + value + '</a>';
}
if (name == 'attachment') {
link_function = 'upload_file';
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;
}
};
// function rendererDay(cell, date, text, currentMonth) {
// if (date.getDate() != '5' && date.getDate() != '10' && date.getDate() != '15' && date.getDate() != '20' && date.getDate() != '25' && date.getDate() != '30') {
// cell.disabled = 'true';
// }
// return text;
// }
// //加载时调用(attach)
// window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_attach_load'] = function(ds, record, config_records, bp_seq) {
// //add by zhuxianfei 放款阶段时不可修改租赁申请的附件
// var attach_file_type = record.get('attach_file_type');
// if (attach_file_type == 'PROJECT') {
// record.getField('note').setReadOnly(true);
// }
// };
window['${/parameter/@layout_code}_on_layout_dynamic_grid_query'] = function (ds, qpara, bp_seq) {
/* debugger
var hdds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd');
var hd_record = $(hdds_id).getAt(0);
qpara['payment_req_id'] = hd_record.get('payment_req_id');*/
/*if (hd_record.get('bp_id_vender_n')) {
qpara['bp_id_vender_n'] = hd_record.get('bp_id_vender_n');
}*/
};
function on_csh_payment_req_temp_ln_ds_query(ds, qpara) {
......@@ -1297,98 +533,6 @@
}
// function on_csh_payment_req_temp_ln_ds_update( dataSet, record, name, value,oldvalue) {
// if(name=='amount_vender'&&value){
// var due_amount=record.get('due_amount');
// var other_payment2=record.get('other_payment2');
// var amount_agent=minus(minus(due_amount,other_payment2),value);
// record.set('amount_agent',amount_agent);
// }
//
// }
function sumFunction(datas, name) {
var sum = 0;
for (var i = 0; i < datas.length; i++) {
var r = datas[i];
var d = r.get(name);
var n = parseFloat(d);
if (!isNaN(n)) {
sum = plus(sum, n);
}
}
var total = (typeof (sum) == 'undefined' ? '' : parseFloat(sum));
return '<font>' + Leaf.formatMoney(total) + '</font>';
}
window['${/parameter/@layout_code}_on_layout_dynamic_grid_select'] = function (ds, record, bp_seq) {
if (record.get('payment_status') != 'FULL' && Ext.isEmpty(record.get('pay_amount'))) {
record.set('pay_amount', record.get('act_amount'));
}
};
window['${/parameter/@layout_code}_on_layout_dynamic_grid_unselect'] = function (ds, record, bp_seq) {
record.set('pay_amount', '');
};
// window['${/parameter/@layout_code}_user_button5_layout_dynamic_click'] = function() {
// Leaf.showConfirm('${l:HLS.PROMPT}', '是否确定提起银行付款', function() {
// var hdds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd');
// var hd_record = $(hdds_id).getCurrentRecord();
// window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
// Leaf.request({
// url: $('csh_payment_bank_link').getUrl(),
// para: {
// payment_req_id: hd_record.get('payment_req_id')
// },
// success: function() {
// window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
// $('${/parameter/@winid}').close();
// },
// error: function() {
// window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
// },
// failure: function() {
// window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
// },
// scope: this
// });
// });
// };
//工作流中隐藏按钮
Leaf.onReady(function () {
if ('${/parameter/@source_type}' == 'WFL') {
document.getElementById('${/parameter/@layout_code}_save').style.display = "none";
}
});
window['${/parameter/@layout_code}_upload_layout_dynamic_click'] = function () {
var hdds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd');
var hd_record = $(hdds_id).getCurrentRecord();
var payment_req_id = hd_record.get('payment_req_id');
if (payment_req_id) {
var url = $('attachment_uploadFile_link').getUrl() + '?table_name=CSH_PAYMENT_REQ_HD&header_id=' + payment_req_id;
var win = new Leaf.Window({
url: url,
title: '${l:HLS.SUPPORTING_DOCUMENT}',
id: 'payment_req_uploadFile_id',
width: 850,
height: 400
});
win.on('close', function () {
$(hdds_id).setQueryParameter('payment_req_id', payment_req_id);
});
} else {
Leaf.showMessage('${l:PROMPT}', '请先保存数据');
return;
}
};
]]></script>
<a:link id="${/parameter/@layout_code}csh511_csh_payment_req_hd_query" model="csh.CSH511.csh_payment_req_hd"
modelaction="query"/>
......
......@@ -6,7 +6,7 @@
<a:model-insert model="csh.CSH501.csh_payment_req_cashflow_id" trace="true"/>
<a:model-execute model="csh.CSH501.del_csh_pay_cashflow_id_temp"/>
</batch-apply>
<a:model-update model="csh.CSH501.check_cf_0_total_amt" trace="true"/>
<!-- <a:model-update model="csh.CSH501.check_cf_0_total_amt" trace="true"/>-->
</a:init-procedure>
<a:service-output output="/parameter"/>
</a:service>
......@@ -11,11 +11,16 @@
<a:model-query fetchAll="true" model="basic.hls_sys_time_default_value" rootPath="sys_time_default_value_list"/>
</a:init-procedure>
<a:view>
<a:link id="csh_payment_req_link" url="${/request/@context_path}/modules/csh/CSH501/csh_payment_req_create.lview"/>
<a:link id="csh_payment_req_cashflow_id_link" url="${/request/@context_path}/modules/csh/CSH501/csh_payment_req_cashflow_id.lsc"/>
<a:link id="csh501_prepayment_link" url="${/request/@context_path}/modules/csh/CSH504/csh_prepayment_update.lview"/>
<a:link id="csh501_csh_payment_req_link_id" url="${/request/@context_path}/modules/csh/CSH501/csh_payment_req.lview"/>
<a:link id="csh501_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<a:link id="csh_payment_req_link"
url="${/request/@context_path}/modules/csh/CSH501/csh_payment_req_create.lview"/>
<a:link id="csh_payment_req_cashflow_id_link"
url="${/request/@context_path}/modules/csh/CSH501/csh_payment_req_cashflow_id.lsc"/>
<a:link id="csh501_prepayment_link"
url="${/request/@context_path}/modules/csh/CSH504/csh_prepayment_update.lview"/>
<a:link id="csh501_csh_payment_req_link_id"
url="${/request/@context_path}/modules/csh/CSH501/csh_payment_req.lview"/>
<a:link id="csh501_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code"
modelaction="update"/>
<div/>
<script type="text/javascript"><![CDATA[
......@@ -29,6 +34,7 @@
}
function confirmFun() {
debugger;
var a = $('csh_payment_req_selectedDs').getSelected();
var record = a[0];
......@@ -41,96 +47,96 @@
return;
}
//对是否为同一个厂商进行检查
var vender_name=record.get('vender_name_n');
var vender_flag=true;
var vender_name = record.get('vender_name_n');
var vender_flag = true;
var leaseback_count = 0, lease_count = 0;
//校验发票状态必须是全部开票且发票已确认
for (i = 0; i < a.length; i++) {
//检验厂商
if(a[i].get('vender_name_n')!=vender_name){
vender_flag=false;
$L.showErrorMessage("提示",'请选择厂商相同的现金流信息!');
return;
}
//检验厂商
if (a[i].get('vender_name_n') != vender_name) {
vender_flag = false;
$L.showErrorMessage("提示", '请选择厂商相同的现金流信息!');
return;
}
//暂时去掉
// if(a[i].get('billing_status_n')!='已开票' ||a[i].get('invoice_status_n')!='已确认'){
// $L.showErrorMessage("提示",'请选择开票状态为已开票,发票状态为已确认的现金流!');
// return;
// }
cashflow_id = a[i].get('cashflow_id');
var arr = {};
contract_id_list[i] = a[i].get('contract_id');
arr['_status'] = 'insert';
arr['cashflow_id'] = cashflow_id;
arr['contract_id'] = a[i].get('contract_id');
arr['session_id'] = '${/session/@session_id}';
cashflow_id_list.push(arr);
if (a[i].get('business_type') == 'LEASEBACK') {
leaseback_count += 1;
}
//
var max = contract_id_list[0];
var min = contract_id_list[0];
var length = contract_id_list.length;
for (i = 1; i < contract_id_list.length; i++) {
if (contract_id_list[i] > max) {
max = contract_id_list[i];
}
if (contract_id_list[i] < min) {
min = contract_id_list[i];
}
if (a[i].get('business_type') == 'LEASE') {
lease_count += 1;
}
param['details'] = cashflow_id_list;
param['contract_id'] = record.get('contract_id');
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.SAVING}');
Leaf.request({
url: $('csh_payment_req_cashflow_id_link').getUrl(),
para: param,
success: function () {
cashflow_id = a[i].get('cashflow_id');
var arr = {};
contract_id_list[i] = a[i].get('contract_id');
arr['_status'] = 'insert';
arr['cashflow_id'] = cashflow_id;
arr['contract_id'] = a[i].get('contract_id');
arr['session_id'] = '${/session/@session_id}';
cashflow_id_list.push(arr);
}
param['details'] = cashflow_id_list;
//param['contract_id'] = record.get('contract_id');
if ((leaseback_count > 0 && lease_count > 0) || leaseback_count > 1) {
$L.showErrorMessage("提示", '直/回租需分开申请,且回租只支持单个合同申请!');
return;
}
Leaf.Masker.mask(Ext.getBody(), '${l:HLS.SAVING}');
Leaf.request({
url: $('csh_payment_req_cashflow_id_link').getUrl(),
para: param,
success: function () {
if (cashflow_id != '') {
Leaf.Masker.unmask(Ext.getBody());
var param = {};
var query_record = $('csh_payment_req_query_ds').getCurrentRecord();
param['function_code'] = 'CSH501H';
param['function_usage'] = 'CREATE';
param['document_category'] = 'PAYMENT_REQ';
param['business_type'] = 'PAYMENT';
param['business_type_n'] = '预付款申请';
param['payment_bp_id'] = query_record.get('bp_id');
param['taxpayer_type'] = record.get('taxpayer_type');
param['taxpayer_type_n'] = record.get('taxpayer_type_n');
param['con_business_type'] = record.get('con_business_type');
param['con_business_type_n'] = record.get('con_business_type_n');
param['contract_id'] = record.get('contract_id');
param['contract_number'] = record.get('contract_number');
param['division_n'] = record.get('division_n');
param['contract_name'] = record.get('contract_name');
param['cdd_list_id'] = record.get('cdd_list_id');
param['division'] = record.get('division');
param['first_contract_day'] = record.get('first_contract_day');
if (cashflow_id != '') {
Leaf.Masker.unmask(Ext.getBody());
var param = {};
var query_record = $('csh_payment_req_query_ds').getCurrentRecord();
param['function_code'] = 'CSH501H';
param['function_usage'] = 'CREATE';
param['document_category'] = 'PAYMENT_REQ';
param['business_type'] = 'PAYMENT';
param['business_type_n'] = '预付款申请';
param['payment_bp_id'] = query_record.get('bp_id');
param['taxpayer_type'] = record.get('taxpayer_type');
param['taxpayer_type_n'] = record.get('taxpayer_type_n');
param['con_business_type'] = record.get('con_business_type');
param['con_business_type_n'] = record.get('con_business_type_n');
param['contract_id'] = record.get('contract_id');
param['bp_id'] = record.get('bp_id_agent_level1');
// param['contract_number'] = record.get('contract_number');
// param['division_n'] = record.get('division_n');
// param['contract_name'] = record.get('contract_name');
// param['cdd_list_id'] = record.get('cdd_list_id');
// param['division'] = record.get('division');
// param['first_contract_day'] = record.get('first_contract_day');
//add by 9188
if (a.length == 1) {
param['contract_number'] = record.get('contract_number');
param['bp_id_tenant_n'] = record.get('bp_id_tenant_n');
param['product_type_n'] = record.get('product_type_n');
param['product_name_write'] = record.get('product_name_write');
}
param['winid'] = 'csh501_csh_payment_req_link_winid';
param['url_title'] = '付款申请';
hls_doc_get_layout_code('csh501_get_layout_code_link_id', param, 'csh501_csh_payment_req_link_id', 'csh_payment_req_selectedDs');
//add by 9188
if (a.length == 1) {
param['contract_number'] = record.get('contract_number');
param['bp_id_tenant_n'] = record.get('bp_id_tenant_n');
param['product_type_n'] = record.get('product_type_n');
param['product_name_write'] = record.get('product_name_write');
}
},
failure: function () {
Leaf.showWarningMessage('', '${l:PRJ509.DATA_NOT_BACK}', null, 200, 100);
Leaf.Masker.unmask(Ext.getBody());
},
error: function () {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
// }
param['winid'] = 'csh501_csh_payment_req_link_winid';
param['url_title'] = '付款申请';
hls_doc_get_layout_code('csh501_get_layout_code_link_id', param, 'csh501_csh_payment_req_link_id', 'csh_payment_req_selectedDs');
}
},
failure: function () {
Leaf.showWarningMessage('', '${l:PRJ509.DATA_NOT_BACK}', null, 200, 100);
Leaf.Masker.unmask(Ext.getBody());
},
error: function () {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
// }
}
......@@ -202,7 +208,7 @@
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
<!-- <a:screen-include screen="modules/cont/CON500/con_contract_authority_list_validate.lview?document_category=CONTRACT&amp;function_code=CSH501"/>-->
<!-- <a:screen-include screen="modules/cont/CON500/con_contract_authority_list_validate.lview?document_category=CONTRACT&amp;function_code=CSH501"/>-->
<a:dataSets>
<a:dataSet id="vender_name_ds" lookupCode="VENDER_NAME"/>
<a:dataSet id="yes_no_ds" lookupCode="YES_NO"/>
......@@ -212,6 +218,12 @@
<a:record name="N" code="N"/>
</a:datas>
</a:dataSet>
<a:dataSet id="business_type_ds">
<a:datas>
<a:record name="直租" code="LEASE"/>
<a:record name="售后回租" code="LEASEBACK"/>
</a:datas>
</a:dataSet>
<a:dataSet id="con_write_off_flag_ds" lookupCode="CON_WRITE_OFF_FLAG"/>
<a:dataSet id="acr512_currency_ds">
<a:datas dataSource="/model/acr512_currency_list"/>
......@@ -219,8 +231,9 @@
<a:dataSet id="division_ds" loadData="true" model="basic.hls_division_for_lov"/>
<a:dataSet id="csh_payment_req_query_ds" autoCreate="true">
<a:fields>
<!-- <a:field name="vender_name_n" returnField="vender_name" displayField="code_value_name" valueField="code_value" options="vender_name_ds"/>-->
<a:field name="vender_name_n" lovGridHeight="300" lovHeight="450" lovLabelWidth="120" lovService="basic.hls_bp_master_v_for_lov?bp_category=VENDER" lovWidth="600" title="厂商">
<!-- <a:field name="vender_name_n" returnField="vender_name" displayField="code_value_name" valueField="code_value" options="vender_name_ds"/>-->
<a:field name="vender_name_n" lovGridHeight="300" lovHeight="450" lovLabelWidth="120"
lovService="basic.hls_bp_master_v_for_lov?bp_category=VENDER" lovWidth="600" title="厂商">
<a:mapping>
<a:map from="bp_name" to="vender_name_n"/>
</a:mapping>
......@@ -228,25 +241,32 @@
</a:field>
<a:field name="times"/>
<a:field name="due_date_to"/>
<a:field name="project_number_from" lovGridHeight="300" lovHeight="450" lovService="prj.PRJ501.prj_project_for_lov" lovWidth="500" title="ACR510.FIELD.PROJECT_NUMBER_FROM">
<a:field name="project_number_from" lovGridHeight="300" lovHeight="450"
lovService="prj.PRJ501.prj_project_for_lov" lovWidth="500"
title="ACR510.FIELD.PROJECT_NUMBER_FROM">
<a:mapping>
<a:map from="project_number" to="project_number_from"/>
<a:map from="project_name" to="project_name_from"/>
</a:mapping>
</a:field>
<a:field name="project_number_to" lovGridHeight="300" lovHeight="450" lovService="prj.PRJ501.prj_project_for_lov" lovWidth="500" title="ACR510.FIELD.PROJECT_NUMBER_TO">
<a:field name="project_number_to" lovGridHeight="300" lovHeight="450"
lovService="prj.PRJ501.prj_project_for_lov" lovWidth="500"
title="ACR510.FIELD.PROJECT_NUMBER_TO">
<a:mapping>
<a:map from="project_number" to="project_number_to"/>
<a:map from="project_name" to="project_name_to"/>
</a:mapping>
</a:field>
<a:field name="cf_item_desc" lovGridHeight="300" lovHeight="500" lovService="hls.HLS005.hls_cashflow_item_v_lov?cf_direction=OUTFLOW" lovWidth="850" title="ACR510.ACR_INVOICE_CONTRACT_CF_V.CF_ITEM_DESC">
<a:field name="cf_item_desc" lovGridHeight="300" lovHeight="500"
lovService="hls.HLS005.hls_cashflow_item_v_lov?cf_direction=OUTFLOW" lovWidth="850"
title="ACR510.ACR_INVOICE_CONTRACT_CF_V.CF_ITEM_DESC">
<a:mapping>
<a:map from="cf_item" to="cf_item"/>
<a:map from="cf_item_desc" to="cf_item_desc"/>
</a:mapping>
</a:field>
<a:field name="bp_code" lovGridHeight="300" lovHeight="450" lovLabelWidth="120" lovService="basic.hls_bp_master_v_for_lov" lovWidth="600" title="承租人">
<a:field name="bp_code" lovGridHeight="300" lovHeight="450" lovLabelWidth="120"
lovService="basic.hls_bp_master_v_for_lov" lovWidth="600" title="承租人">
<a:mapping>
<a:map from="bp_id" to="bp_id"/>
<a:map from="bp_code" to="bp_code"/>
......@@ -255,38 +275,55 @@
</a:field>
<a:field name="bp_name" readOnly="true"/>
<a:field name="bp_code_tenant" readOnly="true"/>
<a:field name="bp_name_tenant" lovGridHeight="300" lovHeight="450" lovLabelWidth="120" lovService="csh.CSH501.hls_bp_master_same_agent_for_lov?bp_category=TENANT" lovWidth="600" title="承租人">
<a:field name="bp_name_tenant" lovGridHeight="300" lovHeight="450" lovLabelWidth="120"
lovService="csh.CSH501.hls_bp_master_same_agent_for_lov?bp_category=TENANT" lovWidth="600"
title="承租人">
<a:mapping>
<a:map from="bp_code" to="bp_code_tenant"/>
<a:map from="bp_name" to="bp_name_tenant"/>
</a:mapping>
</a:field>
<a:field name="bp_code_tenant_from" lovGridHeight="300" lovHeight="450" lovLabelWidth="120" lovService="basic.hls_bp_master_v_for_lov?bp_category='AGENT'" lovWidth="600" title="HLS.TENANT_NUMBER_FROM">
<a:field name="bp_code_tenant_from" lovGridHeight="300" lovHeight="450" lovLabelWidth="120"
lovService="basic.hls_bp_master_v_for_lov?bp_category='AGENT'" lovWidth="600"
title="HLS.TENANT_NUMBER_FROM">
<a:mapping>
<a:map from="bp_code" to="bp_code_tenant_from"/>
<a:map from="bp_name" to="bp_name_tenant_from"/>
</a:mapping>
</a:field>
<a:field name="bp_code_tenant_to" lovGridHeight="300" lovHeight="450" lovLabelWidth="120" lovService="basic.hls_bp_master_v_for_lov" lovWidth="600" title="HLS.TENANT_NUMBER_TO">
<a:field name="bp_code_tenant_to" lovGridHeight="300" lovHeight="450" lovLabelWidth="120"
lovService="basic.hls_bp_master_v_for_lov" lovWidth="600" title="HLS.TENANT_NUMBER_TO">
<a:mapping>
<a:map from="bp_code" to="bp_code_tenant_to"/>
<a:map from="bp_name" to="bp_name_tenant_to"/>
</a:mapping>
</a:field>
<a:field name="currency_name" displayField="currency_name" options="acr512_currency_ds" returnField="currency" valueField="currency_code"/>
<a:field name="vat_flag" displayField="name" options="vat_flag_ds" returnField="code" valueField="code"/>
<a:field name="division_n" displayField="description" options="division_ds" returnField="division" valueField="division"/>
<a:field name="division"/>
<a:field name="currency_name" displayField="currency_name" options="acr512_currency_ds"
returnField="currency" valueField="currency_code"/>
<a:field name="vat_flag" displayField="name" options="vat_flag_ds" returnField="code"
valueField="code"/>
<a:field name="business_type_n" displayField="name" options="business_type_ds"
returnField="business_type" valueField="code"/>
<a:field name="division_n" displayField="description" options="division_ds" returnField="division"
valueField="division"/>
<a:field name="outflow_id" defaultValue="${/parameter/@outflow_id}"/>
<a:field name="invoice_uploaded_flag_n" displayField="code_value_name" options="yes_no_ds" returnField="invoice_uploaded_flag" valueField="code_value"/>
<a:field name="first_delay_flag_n" displayField="code_value_name" options="yes_no_ds" returnField="first_delay_flag" valueField="code_value"/>
<a:field name="invoice_uploaded_flag_n" displayField="code_value_name" options="yes_no_ds"
returnField="invoice_uploaded_flag" valueField="code_value"/>
<a:field name="first_delay_flag_n" displayField="code_value_name" options="yes_no_ds"
returnField="first_delay_flag" valueField="code_value"/>
<a:field name="bp_id_agent_level1"/>
<a:field name="bp_id_agent_level1_n" lovGridHeight="330" lovHeight="470" lovLabelWidth="120" lovService="cont.CON701.hls_bp_master_v_all_lov?bp_category=AGENT" lovWidth="700" title="代理商">
<a:field name="bp_id_agent_level1_n" lovGridHeight="330" lovHeight="470" lovLabelWidth="120"
lovService="cont.CON701.hls_bp_master_v_all_lov?bp_category=AGENT" lovWidth="700"
title="代理商">
<a:mapping>
<a:map from="bp_id" to="bp_id_agent_level1"/>
<a:map from="bp_name" to="bp_id_agent_level1_n"/>
</a:mapping>
</a:field>
<a:field name="cf_61_write_off_flag_n" displayField="code_value_name" options="con_write_off_flag_ds" returnField="cf_61_write_off_flag" valueField="code_value"/>
<a:field name="cf_61_write_off_flag_n" displayField="code_value_name"
options="con_write_off_flag_ds" returnField="cf_61_write_off_flag"
valueField="code_value"/>
</a:fields>
......@@ -294,7 +331,9 @@
<a:event name="update" handler="csh501_payment_maintain_update"/>
</a:events>
</a:dataSet>
<a:dataSet id="csh_payment_req_selectedDs" pageSize="10" autoQuery="true" model="csh.CSH501.csh_payment_req_selected" queryDataSet="csh_payment_req_query_ds" selectable="true">
<a:dataSet id="csh_payment_req_selectedDs" fetchAll="true" autoQuery="true"
model="csh.CSH501.csh_payment_req_selected" queryDataSet="csh_payment_req_query_ds"
selectable="true">
<a:field name="cf_item"/>
<a:field name="first_contract_day"/>
<a:events>
......@@ -352,13 +391,16 @@
<!--</a:events>-->
<!--</a:lov>-->
<!--<a:textField name="bp_name" bindTarget="csh_payment_req_query_ds" prompt="付款对象"/>-->
<!-- <a:textField name="times_from" bindTarget="csh_payment_req_query_ds" prompt="期次从"/>-->
<!-- <a:lov name="cf_item_desc" bindTarget="csh_payment_req_query_ds" prompt="现金流类型"/>-->
<!-- <a:textField name="times_from" bindTarget="csh_payment_req_query_ds" prompt="期次从"/>-->
<!-- <a:lov name="cf_item_desc" bindTarget="csh_payment_req_query_ds" prompt="现金流类型"/>-->
<a:datePicker name="due_date_from" bindTarget="csh_payment_req_query_ds" prompt="应付日期从"/>
<a:datePicker name="due_date_to" bindTarget="csh_payment_req_query_ds" prompt="应付日期到"/>
<a:lov name="vender_name_n" bindTarget="csh_payment_req_query_ds" prompt="厂商"/>
<a:numberField name="due_amount_from" allowDecimals="true" allowFormat="true" bindTarget="csh_payment_req_query_ds" prompt="应付金额从"/>
<a:numberField name="due_amount_to" allowDecimals="true" allowFormat="true" bindTarget="csh_payment_req_query_ds" prompt="应付金额到"/>
<a:lov name="vender_name_n" bindTarget="csh_payment_req_query_ds" prompt="厂商"/>
<a:comboBox name="business_type_n" bindTarget="csh_payment_req_query_ds" prompt="业务类型"/>
<a:numberField name="due_amount_from" allowDecimals="true" allowFormat="true"
bindTarget="csh_payment_req_query_ds" prompt="应付金额从"/>
<a:numberField name="due_amount_to" allowDecimals="true" allowFormat="true"
bindTarget="csh_payment_req_query_ds" prompt="应付金额到"/>
<!--<a:comboBox name="currency_name" bindTarget="csh_payment_req_query_ds" prompt="HLS.CURRENCY" width="150"/>-->
<!-- <a:comboBox name="vat_flag" bindTarget="csh_payment_req_qu ery_ds" prompt="增值税标志"/> -->
<!--<a:comboBox name="division_n" bindTarget="csh_payment_req_query_ds" prompt="产品线"/>-->
......@@ -368,7 +410,8 @@
<a:comboBox name="first_delay_flag_n" bindTarget="csh_payment_req_query_ds" prompt="是否首付延期"/>
<a:comboBox name="cf_61_write_off_flag_n" bindTarget="csh_payment_req_query_ds" prompt="应收保费付款情况"/>-->
</a:form>
<a:grid id="csh_payment_req_maintain_grid_ds" bindTarget="csh_payment_req_selectedDs" marginHeight="260" marginWidth="40" navBar="true">
<a:grid id="csh_payment_req_maintain_grid_ds" bindTarget="csh_payment_req_selectedDs" marginHeight="200"
marginWidth="40" navBar="true">
<a:toolBar>
<a:button type="excel"/>
</a:toolBar>
......@@ -377,27 +420,28 @@
<a:column name="contract_name" width="150"/>
<!-- <a:column name="search_term_1" prompt="合同号" width="120"/> -->
<a:column name="bp_id_tenant_n" prompt="商业伙伴名称" width="120"/>
<!-- <a:column name="bp_id_agent_level1_n" prompt="代理商" width="120"/>
<a:column name="agent_extra_nam" prompt="代理商简称" width="120"/>
<a:column name="first_delay_flag_n" align="center" prompt="是否首付延期"/>-->
<!-- <a:column name="bp_id_agent_level1_n" prompt="代理商" width="120"/>
<a:column name="agent_extra_nam" prompt="代理商简称" width="120"/>
<a:column name="first_delay_flag_n" align="center" prompt="是否首付延期"/>-->
<a:column name="cf_item_desc" prompt="现金流类型" width="80"/>
<a:column name="times" align="center" prompt="期数" width="40"/>
<a:column name="due_amount" align="right" prompt="应付金额" renderer="Leaf.formatMoney" width="110"/>
<a:column name="due_date" prompt="应付日期"/>
<a:column name="bp_id_agent_n" prompt="代理店"/>
<a:column name="vender_name_n" prompt="厂商"/>
<a:column name="billing_status_n" prompt="开票状态"/>
<a:column name="invoice_status_n" prompt="发票状态"/>
<!-- <a:column name="received_amount" align="right" prompt="实际支付金额" renderer="Leaf.formatMoney"/>
<a:column name="residual_amount" align="right" prompt="剩余未支付金额" renderer="Leaf.formatMoney" width="110"/>
<a:column name="invoice_uploaded_flag_n" align="center" prompt="发票上传标志"/>
<a:column name="interface_name" prompt="企案类型"/>
<a:column name="status_n" prompt="企案结果"/>
<a:column name="pattern" prompt="机型"/>-->
<a:column name="business_type_n" prompt="业务类型" align="center"/>
<a:column name="billing_status_n" prompt="开票状态" align="center"/>
<a:column name="invoice_status_n" prompt="发票状态" align="center"/>
<!-- <a:column name="received_amount" align="right" prompt="实际支付金额" renderer="Leaf.formatMoney"/>
<a:column name="residual_amount" align="right" prompt="剩余未支付金额" renderer="Leaf.formatMoney" width="110"/>
<a:column name="invoice_uploaded_flag_n" align="center" prompt="发票上传标志"/>
<a:column name="interface_name" prompt="企案类型"/>
<a:column name="status_n" prompt="企案结果"/>
<a:column name="pattern" prompt="机型"/>-->
<!--<a:column name="price" align="right" renderer="Leaf.formatMoney" prompt="销售价格"/>-->
<!--<a:column name="factory_price" align="right" renderer="Leaf.formatMoney" prompt="设备出厂价"/>-->
<!-- <a:column name="machine_number" prompt="机号"/>
<a:column name="cf_61_write_off_flag_n" prompt="应收保费收款情况"/>-->
<!-- <a:column name="machine_number" prompt="机号"/>
<a:column name="cf_61_write_off_flag_n" prompt="应收保费收款情况"/>-->
<!--<a:column name="applied_pay_amount" align="right" prompt="CSH501.CSH_APPLIED_PAYMENT_AMOUNT" renderer="Leaf.formatMoney" width="110"/>-->
<!-- <a:column name="serial_number" prompt="机编号" width="120"/> -->
<!--<a:column name="division_n" prompt="产品线" width="150"/>-->
......
......@@ -16,6 +16,7 @@
function cshdeposit102_receipt_exit() {
$('${/parameter/@winId}').close();
}
function cshdeposit102_transfer_submit() {
if ($('deposit_transfer_detail_result_ds').validate()) {
var head_record = $('deposit_transfer_maintain_result_ds').getAt(0);
......@@ -24,26 +25,33 @@
var saveData = [];
debugger;
param['source_contract_id'] = '${/parameter/@contract_id}';
param['je_date'] =deposit_records[0].get('je_date');
param['hd_contract_id'] =deposit_records[0].get('contract_id');
param['je_date'] = deposit_records[0].get('je_date');
param['hd_contract_id'] = deposit_records[0].get('contract_id');
//param['bp_id'] = head_record.get('bp_id');
// param['bp_category'] = head_record.get('bp_category');
// param['bp_category'] = head_record.get('bp_category');
for (var k = 0; k < deposit_records.length; k++) {
for (var m = k+1; m< deposit_records.length; m++) {
if ( Leaf.formatDate(deposit_records[k].get('je_date'))!= Leaf.formatDate(deposit_records[m].get('je_date'))){
Leaf.showMessage('${l:PROMPT}', "经济发生日请保持一致!");
return;
}
for (var m = k + 1; m < deposit_records.length; m++) {
if (Leaf.formatDate(deposit_records[k].get('je_date')) != Leaf.formatDate(deposit_records[m].get('je_date'))) {
Leaf.showMessage('${l:PROMPT}', "经济发生日请保持一致!");
return;
}
}
}
var total_deposit_amount = 0;
var unwrite_off_amount = get_current_amount(head_record.get('unwrite_off_amount'));
for (var i = 0; i < deposit_records.length; i++) {
var deposit_record;
deposit_record = deposit_records[i];
deposit_record.set('_status', 'update');
deposit_record.set('source_contract_id', '${/parameter/@contract_id}');
total_deposit_amount = plus(total_deposit_amount, get_current_amount(deposit_record.get('deposit_amount')));
saveData.push(deposit_record.data);
}
if (total_deposit_amount > unwrite_off_amount) {
Leaf.showMessage('${l:PROMPT}', "本次划转金额大于剩余可划转金额!");
return;
}
param['details'] = saveData;
Leaf.showConfirm('${l:PROMPT}', '确定进行保证金划转?', function () {
Leaf.Masker.mask($('${/parameter/@winId}').wrap, "正在执行划转。。。");
......@@ -68,14 +76,14 @@
});
}, function () {
Leaf.Masker.unmask($('${/parameter/@winId}').wrap);
return;
}, null, null);
}
}
function get_current_amount(amt) {
if (!Ext.isEmpty(amt)) {
return amt;
return parseFloat(amt).toFixed(2);
} else {
return 0;
}
......@@ -89,6 +97,8 @@
}
function get_min_amount(amt1, amt2) {
amt1 = get_current_amount(amt1);
amt2 = get_current_amount(amt2);
if (!Ext.isEmpty(amt1) && !Ext.isEmpty(amt2)) {
if (amt1 > amt2) {
return amt2;
......@@ -106,56 +116,64 @@
function on_csh_trx_deposit_write_off_update(ds, record, name, value, oldvalue) {
debugger;
var head_record = $('deposit_transfer_maintain_result_ds').getSelected()[0];
var unwrite_off_amount = head_record.get("unwrite_off_amount") || 0;
var head_record = $('deposit_transfer_maintain_result_ds').getAt(0);
var unwrite_off_amount = get_current_amount(head_record.get("unwrite_off_amount"));
if (name == 'deposit_amount') {
// if (value) {
// record.getField('write_off_due_amount').setRequired(false);
// }
// if (!value) {
// record.getField('write_off_due_amount').setRequired(true);
// }
if (value&&value != oldvalue) {
if ((!Ext.isEmpty(value) || !Ext.isEmpty(oldvalue)) && value != oldvalue) {
oldvalue = oldvalue || 0;
var change_value = get_minus_amount(value, oldvalue);
var current_apply_amount = get_current_amount(head_record.get('current_apply_amount') || 0);
if (((current_apply_amount - oldvalue + (value || 0))) < 0) {
Leaf.showMessage('${l:PROMPT}', "本次划转金额不能为负!");
setTimeout(function () {
record.set('deposit_amount', '');
}, 10);
head_record.set('current_apply_amount', 0);
return;
}
if ((current_apply_amount - oldvalue + (value || 0)) <=unwrite_off_amount && (current_apply_amount - oldvalue + (value || 0)) >= 0) {
head_record.set('current_apply_amount', current_apply_amount - oldvalue + (value || 0));
} else {
Leaf.showMessage('${l:PROMPT}', "本次入账金额小于剩余可入账金额!");
head_record.set('current_apply_amount', 0);
setTimeout(function () {
record.set('deposit_amount', '');
}, 10);
return;
}
var current_apply_amount = get_current_amount(head_record.get('current_apply_amount'));
// if (plus(current_apply_amount, change_value) < 0) {
// Leaf.showMessage('${l:PROMPT}', "本次划转金额不能为负!");
// setTimeout(function () {
// record.set('deposit_amount', '');
// }, 10);
// head_record.set('current_apply_amount', current_apply_amount);
// return;
// }
// if (plus(current_apply_amount, change_value) <= unwrite_off_amount && plus(current_apply_amount, change_value) >= 0) {
head_record.set('current_apply_amount', plus(current_apply_amount, change_value));
// } else {
// Leaf.showMessage('${l:PROMPT}', "本次划转金额大于剩余可划转金额!");
// head_record.set('current_apply_amount', current_apply_amount);
// setTimeout(function () {
// record.set('deposit_amount', '');
// }, 10);
// }
}
}
}
function on_csh_trx_deposit_write_off_remove(ds, record, index) {
var head_record = $('deposit_transfer_maintain_result_ds').getAt(0);
var change_value = record.get('deposit_amount') || 0,
current_apply_amount = head_record.get('current_apply_amount') || 0;
setTimeout(function () {
head_record.set('current_apply_amount', current_apply_amount - change_value);
}, 10);
debugger;
var selected = [].concat(ds.getSelected());
var head_record = $('deposit_transfer_maintain_result_ds').getAt(0);
var change_value = get_current_amount(record.get('deposit_amount')),
current_apply_amount = get_current_amount(head_record.get('current_apply_amount'));
// setTimeout(function () {
// head_record.set('current_apply_amount', minus(current_apply_amount, change_value));
// }, 10);
head_record.set('current_apply_amount', minus(current_apply_amount, change_value));
}
function on_csh_trx_deposit_write_off_add(ds, record, index) {
// record.set('je_date', '${/model/sys_time_default_value_path/record/@now_time}');
// record.set('write_off_type', 'DEPOSIT_ENTRY');
}
// function on_csh_trx_deposit_write_off_add(ds, record, index) {
// // record.set('je_date', '${/model/sys_time_default_value_path/record/@now_time}');
// // record.set('write_off_type', 'DEPOSIT_ENTRY');
//
// }
// function csh_trx_deposit_write_off_afterremove() {
// alert(111);
// debugger;
// var total_deposit_amount=0;
// var head_record = $('deposit_transfer_maintain_result_ds').getAt(0);
// var deposit_records = $('deposit_transfer_detail_result_ds').getAll();
// for (var m =0; m < deposit_records.length; m++) {
// total_deposit_amount=plus(total_deposit_amount,get_current_amount(deposit_records[m].get('deposit_amount')));
// }
// head_record.set('current_apply_amount', total_deposit_amount);
// }
]]></script>
......@@ -177,7 +195,8 @@
<a:field name="contract_number" lovGridHeight="300" lovHeight="430"
lovService="cus_deposit.CUS_DEPOSIT100.con_contract_v?bp_id_agent_level1=${/parameter/@bp_id_agent_level1}" lovWidth="500" required="true">
lovService="cus_deposit.CUS_DEPOSIT100.con_contract_v?bp_id_agent_level1=${/parameter/@bp_id_agent_level1}"
lovWidth="500" required="true">
<a:mapping>
<a:map from="contract_number" to="contract_number"/>
<a:map from="contract_id" to="contract_id"/>
......@@ -188,12 +207,13 @@
</a:mapping>
</a:field>
<a:field name="deposit_trans_type_desc" options="CUS102_DEPOSIT_TRANS_TYPE_DS"
returnField="deposit_trans_type" displayField="code_value_name" valueField="code_value" required="true" defaultValue="${/parameter/@deposit_trans_type_desc}" readOnly="true"/>
returnField="deposit_trans_type" displayField="code_value_name" valueField="code_value"
required="true" defaultValue="${/parameter/@deposit_trans_type_desc}" readOnly="true"/>
</a:fields>
<a:events>
<a:event name="update" handler="on_csh_trx_deposit_write_off_update"/>
<a:event name="remove" handler="on_csh_trx_deposit_write_off_remove"/>
<!--<a:event name="add" handler="on_csh_trx_deposit_write_off_add"/>-->
<!-- <a:event name="afterremove" handler="csh_trx_deposit_write_off_afterremove"/>-->
</a:events>
</a:dataSet>
</a:dataSets>
......@@ -205,18 +225,25 @@
</a:screenTopToolbar>
<a:fieldSet title="保证金信息">
<a:box column="3" labelWidth="100">
<a:textField name="contract_number" prompt="合同编号" bindTarget="deposit_transfer_maintain_result_ds" readOnly="true"/>
<a:textField name="bp_name" prompt="代理店" bindTarget="deposit_transfer_maintain_result_ds" readOnly="true"/>
<a:textField name="bp_id_telnet_n" prompt="承租人" bindTarget="deposit_transfer_maintain_result_ds" readOnly="true"/>
<a:textField name="deposit_trans_type_n" prompt="保证金类型" bindTarget="deposit_transfer_maintain_result_ds" readOnly="true"/>
<a:numberField name="unwrite_off_amount" bindTarget="deposit_transfer_maintain_result_ds"
<a:textField name="contract_number" prompt="合同编号" bindTarget="deposit_transfer_maintain_result_ds"
readOnly="true"/>
<a:textField name="bp_name" prompt="代理店" bindTarget="deposit_transfer_maintain_result_ds"
readOnly="true"/>
<a:textField name="bp_id_telnet_n" prompt="承租人" bindTarget="deposit_transfer_maintain_result_ds"
readOnly="true"/>
<a:textField name="deposit_trans_type_n" prompt="保证金类型"
bindTarget="deposit_transfer_maintain_result_ds" readOnly="true"/>
<a:numberField name="unwrite_off_amount" allowDecimals="true" decimalPrecision="2"
bindTarget="deposit_transfer_maintain_result_ds"
prompt="剩余可用金额" readOnly="true"/>
<a:numberField name="current_apply_amount" bindTarget="deposit_transfer_maintain_result_ds"
prompt="本次划转金额" readOnly="true" renderer="Leaf.formatMoney"/>
<a:numberField name="current_apply_amount" allowDecimals="true" decimalPrecision="2"
bindTarget="deposit_transfer_maintain_result_ds"
prompt="本次划转金额" readOnly="true"/>
</a:box>
</a:fieldSet>
<a:grid id="deposit_transfer_detail_result_grid" bindTarget="deposit_transfer_detail_result_ds" marginHeight="170"
<a:grid id="deposit_transfer_detail_result_grid" bindTarget="deposit_transfer_detail_result_ds"
marginHeight="170"
navBar="false" width="800">
<a:toolBar>
<a:button type="add"/>
......@@ -230,14 +257,15 @@
<a:column name="deposit_trans_type_desc" align="center" editor="deposit_type_box" prompt="保证金类型"
width="124"/>
<a:column name="deposit_amount" align="right" editor="deposit_amount_nb" prompt="划转金额"
renderer="Leaf.formatMoney" width="115"/>
<a:column name="je_date" align="center" editor="je_date_picker" prompt="经济业务发生日" renderer="Leaf.formatDate" width="103"/>
width="115"/>
<a:column name="je_date" align="center" editor="je_date_picker" prompt="经济业务发生日"
renderer="Leaf.formatDate" width="103"/>
</a:columns>
<a:editors>
<a:datePicker id="je_date_picker"/>
<a:comboBox id="deposit_type_box"/>
<a:lov id="contract_number_lov"/>
<a:numberField id="deposit_amount_nb"/>
<a:numberField id="deposit_amount_nb" allowDecimals="true" decimalPrecision="2"/>
</a:editors>
</a:grid>
</a:screenBody>
......
......@@ -189,7 +189,7 @@
<a:gridButton click="para_headDs_reset" text="HLS.RESET"/>
<a:gridButton click="headDs_grid_add" text="HLS.NEW"/>
<a:gridButton click="headDs_grid_clear" text="HLS.CLEAR"/>
<!-- <a:gridButton click="headDs_grid_remove" text="HLS.REMOVE"/> -->
<a:gridButton click="headDs_grid_remove" text="HLS.REMOVE"/>
<a:gridButton click="headDs_grid_save" text="HLS.SAVE"/>
</a:screenTopToolbar>
<a:form column="4" labelWidth="120" title="HAP_QUERY_TITLE">
......
......@@ -969,6 +969,12 @@
headRecords[i].set('column_value', detention);
headRecords[i].set('column_value_c', detention);
}
if (column_name =='business_type') {
headRecords[i].set('input_mode', 'READONLY');
headRecords[i].set('readonly_input_mode', 'TRUE');
headRecords[i].getField('column_value').setReadOnly(true);
headRecords[i].getField('column_value_c').setReadOnly(true);
}
}
......@@ -1663,6 +1669,14 @@
if (!$('temp_hd_attribute_ds').find('column_code', temp_head_records[i].get('column_code'))) {
$('temp_hd_attribute_ds').create(temp_head_records[i].data);
}
var H16;
if (temp_head_records[i].get('column_code') == 'H16') {
H16 = temp_head_records[i].get('column_value');
}
if (temp_head_records[i].get('column_code') == 'H109') {
temp_head_records[i].set('column_value', H16);
// temp_head_records[i].set('column_value_c',0);
}
}
var all_records = $('temp_hd_attribute_ds').getAll();
var headRecord = $('hls_fin_cal_save_hd_ds').getAt(0);
......
......@@ -814,8 +814,8 @@
strJs = strJs.substr(0, strJs.length - 1) + '})';
return eval(strJs);
}
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'], 'prj_project');
if (ds_id == ds.id && ds_id) {
if (record.get('pay_method') == 'WIRE_TRANSFER') {
......
......@@ -707,25 +707,34 @@
record.getField('bank_branch_name_n').setRequired(false);
}
if('${/parameter/@function_usage}'!='QUERY'){
if (record.get('secondary_lease') == 'YES') {
document.getElementById('${/parameter/@layout_code}_F_BASIC_INFO_1_PRJ_PROJECT_REPUR_CONTRACT_ID_prompt').style.display = 'block';
document.getElementById('${/parameter/@layout_code}_F_BASIC_INFO_1_PRJ_PROJECT_REPUR_CONTRACT_ID').style.display = 'block';
record.getField('repur_contract_id').setRequired(true);
record.getField('repur_contract_id_n').setRequired(true);
record.getField('repur_contract_id').setReadOnly(false);
record.getField('repur_contract_id_n').setReadOnly(false);
} else if (record.get('secondary_lease') == 'NO') {
record.getField('repur_contract_id').setRequired(false);
record.getField('repur_contract_id_n').setRequired(false);
record.getField('repur_contract_id').setReadOnly(true);
record.getField('repur_contract_id_n').setReadOnly(true);
record.set('repur_contract_id', null);
record.set('repur_contract_id_n', null);
document.getElementById('${/parameter/@layout_code}_F_BASIC_INFO_1_PRJ_PROJECT_REPUR_CONTRACT_ID_prompt').style.display = 'none';
document.getElementById('${/parameter/@layout_code}_F_BASIC_INFO_1_PRJ_PROJECT_REPUR_CONTRACT_ID').style.display = 'none';
if('${/parameter/@function_usage}'!='QUERY') {
if (record.get('secondary_lease') == 'YES') {
document.getElementById('${/parameter/@layout_code}_F_BASIC_INFO_1_PRJ_PROJECT_REPUR_CONTRACT_ID_prompt').style.display = 'block';
document.getElementById('${/parameter/@layout_code}_F_BASIC_INFO_1_PRJ_PROJECT_REPUR_CONTRACT_ID').style.display = 'block';
record.getField('repur_contract_id').setRequired(true);
record.getField('repur_contract_id_n').setRequired(true);
record.getField('repur_contract_id').setReadOnly(false);
record.getField('repur_contract_id_n').setReadOnly(false);
} else if (record.get('secondary_lease') == 'NO') {
record.getField('repur_contract_id').setRequired(false);
record.getField('repur_contract_id_n').setRequired(false);
record.getField('repur_contract_id').setReadOnly(true);
record.getField('repur_contract_id_n').setReadOnly(true);
record.set('repur_contract_id', null);
record.set('repur_contract_id_n', null);
document.getElementById('${/parameter/@layout_code}_F_BASIC_INFO_1_PRJ_PROJECT_REPUR_CONTRACT_ID_prompt').style.display = 'none';
document.getElementById('${/parameter/@layout_code}_F_BASIC_INFO_1_PRJ_PROJECT_REPUR_CONTRACT_ID').style.display = 'none';
}
} else {
if (record.get('secondary_lease') == 'YES') {
document.getElementById('${/parameter/@layout_code}_F_BASIC_INFO_1_PRJ_PROJECT_REPUR_CONTRACT_ID_prompt').style.display = 'block';
document.getElementById('${/parameter/@layout_code}_F_BASIC_INFO_1_PRJ_PROJECT_REPUR_CONTRACT_ID').style.display = 'block';
} else if (record.get('secondary_lease') == 'NO') {
document.getElementById('${/parameter/@layout_code}_F_BASIC_INFO_1_PRJ_PROJECT_REPUR_CONTRACT_ID_prompt').style.display = 'none';
document.getElementById('${/parameter/@layout_code}_F_BASIC_INFO_1_PRJ_PROJECT_REPUR_CONTRACT_ID').style.display = 'none';
}
}
}
//业务类型回租时,默认只读“首付款抵扣”选项
if (record.get('business_type') == 'LEASEBACK') {
record.set('payment_deduction', 'DOWN_PAYMENT_DEDUCTION');
......
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