Commit cf658b52 authored by 25484's avatar 25484

[fix]合同结束完善

parent 87666780
......@@ -7,112 +7,119 @@
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true">
<a:init-procedure><![CDATA[
]]></a:init-procedure>
]]>
</a:init-procedure>
<a:view>
<a:link id="con_contract_terminate_link_id" model="cont.CON560.con_contract_terminate" modelaction="batch_update"/>
<a:link id="con_contract_terminate_link_id" model="cont.CON560.con_contract_terminate"
modelaction="batch_update"/>
<a:link id="sys_service_welcome_link" url="${/request/@context_path}/welcome.lview"/>
<a:link id="con_contract_update_link_id" url="${/request/@context_path}/modules/cont/CON500/con_contract_update.lview"/>
<a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<a:link id="con_contract_update_link_id"
url="${/request/@context_path}/modules/cont/CON500/con_contract_update.lview"/>
<a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code"
modelaction="update"/>
<script type="text/javascript"><![CDATA[
function con560_con_contract_detail() {
var records = $('con560_contract_result_ds').getSelected();
if (!records.length) {
Leaf.showMessage('${l:PROMPT}', '请至少选择一条记录');
return;
}
var TerminateData = [];
for (var i = 0;i < records.length;i++) {
records[i].set('_status', 'update');
TerminateData.push(records[i].data);
}
Leaf.showConfirm('${l:PROMPT}', '确认要结束?', function() {
Leaf.request({
url: $('con_contract_terminate_link_id').getUrl(),
para: TerminateData,
success: function() {
Leaf.SideBar.show({
msg: '合同已结束',
duration: 2000
});
$('con560_contract_result_ds').query();
},
scope: this
});
}, function() {
return;
}, null, null);
}
function con560_render_contractMaintainDs_grid(value, record, name) {
if (name == 'contract_number') {
return '<a href="javascript:con560_contractMaintainDs_grid_update(' + record.id + ');">' + value + '</a>';
}
}
function con560_param_set_value(param) {
param['document_category'] = 'CONTRACT';
param['function_code'] = 'CON301';
param['function_usage'] = 'QUERY';
param['maintain_type'] = 'READONLY';
param['url_title'] = '${l:CON301.CONTRACT_DETAIL}';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'con_contract_update_link_id', 'con560_contract_result_ds');
function con560_con_contract_detail() {
var records = $('con560_contract_result_ds').getSelected();
if (!records.length) {
Leaf.showMessage('${l:PROMPT}', '请至少选择一条记录');
return;
}
function con560_contractMaintainDs_grid_update(id) {
var current_record = $('con560_contract_result_ds').findById(id);
var param = current_record.data;
param['document_id'] = current_record.get('contract_id');
con560_param_set_value(param);
var TerminateData = [];
for (var i = 0; i < records.length; i++) {
records[i].set('_status', 'update');
TerminateData.push(records[i].data);
}
function con560_con_contract_query() {
$('con560_contract_result_ds').query();
Leaf.showConfirm('${l:PROMPT}', '确认要结束?', function () {
Leaf.request({
url: $('con_contract_terminate_link_id').getUrl(),
para: TerminateData,
success: function () {
Leaf.SideBar.show({
msg: '合同已结束',
duration: 2000
});
$('con560_contract_result_ds').query();
},
scope: this
});
}, function () {
return;
}, null, null);
}
function con560_render_contractMaintainDs_grid(value, record, name) {
if (name == 'contract_number') {
return '<a href="javascript:con560_contractMaintainDs_grid_update(' + record.id + ');">' + value + '</a>';
}
function con560_con_contract_reset(){
$('con560_contract_query_ds').reset();
}
function summaryRenderer(datas, name) {
var sum = 0;
var sum2 = 0;
for (var i = 0;i < datas.length;i++) {
record = datas[i];
if (name == "lease_item_amount" ) {
var t_1 = record.get("lease_item_amount" );
var t_2 = parseFloat(t_1);
if (!isNaN(t_2)) {
sum += t_2;
}
}
if (name == "down_payment" ) {
var d_1 = record.get("down_payment" );
var d_2 = parseFloat(d_1);
if (!isNaN(d_2)) {
sum2 += d_2;
}
}
function con560_param_set_value(param) {
param['document_category'] = 'CONTRACT';
param['function_code'] = 'CON301';
param['function_usage'] = 'QUERY';
param['maintain_type'] = 'READONLY';
param['url_title'] = '${l:CON301.CONTRACT_DETAIL}';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'con_contract_update_link_id', 'con560_contract_result_ds');
}
function con560_contractMaintainDs_grid_update(id) {
var current_record = $('con560_contract_result_ds').findById(id);
var param = current_record.data;
param['document_id'] = current_record.get('contract_id');
con560_param_set_value(param);
}
function con560_con_contract_query() {
$('con560_contract_result_ds').query();
}
function con560_con_contract_reset() {
$('con560_contract_query_ds').reset();
}
function summaryRenderer(datas, name) {
var sum = 0;
var sum2 = 0;
for (var i = 0; i < datas.length; i++) {
record = datas[i];
if (name == "lease_item_amount") {
var t_1 = record.get("lease_item_amount");
var t_2 = parseFloat(t_1);
if (!isNaN(t_2)) {
sum += t_2;
}
}
if (name == "bp_vender") {
return '<div align="right">合计:</div>';
}
if (name == "lease_item_amount" ) {
return '<font color="red">' + Leaf.formatNumber(sum, 2) + '</font>';
if (name == "down_payment") {
var d_1 = record.get("down_payment");
var d_2 = parseFloat(d_1);
if (!isNaN(d_2)) {
sum2 += d_2;
}
}
if (name == "down_payment" ) {
return '<font color="red">' + Leaf.formatNumber(sum2, 2) + '</font>';
}
}
function onIndexChange(ds,record,name,value,oldvalue)
{
$('receivedAmountDs').setQueryParameter('contract_id', record.get('contract_id'));
$('unreceivedAmountDs').setQueryParameter('contract_id', record.get('contract_id'));
$('receivedAmountDs').query();
$('unreceivedAmountDs').query();
if (name == "bp_vender") {
return '<div align="right">合计:</div>';
}
if (name == "lease_item_amount") {
return '<font color="red">' + Leaf.formatNumber(sum, 2) + '</font>';
}
if (name == "down_payment") {
return '<font color="red">' + Leaf.formatNumber(sum2, 2) + '</font>';
}
}
function onIndexChange(ds, record, name, value, oldvalue) {
$('receivedAmountDs').setQueryParameter('contract_id', record.get('contract_id'));
$('unreceivedAmountDs').setQueryParameter('contract_id', record.get('contract_id'));
$('receivedAmountDs').query();
$('unreceivedAmountDs').query();
}
]]></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=CON560"/>
<a:screen-include
screen="modules/cont/CON500/con_contract_authority_list_validate.lview?document_category=CONTRACT&amp;function_code=CON560"/>
<a:dataSets>
<a:dataSet id="receivedAmountDs" autoQuery="true" model="cont.CON560.con_contract_received_amount"/>
<a:dataSet id="unreceivedAmountDs" autoQuery="true" model="cont.CON560.con_contract_unreceived_amount"/>
......@@ -121,7 +128,9 @@
model="basic.hls_lease_organization_for_lov"/>
<a:dataSet id="con560_contract_query_ds" autoCreate="true">
<a:fields>
<a:field name="bp_name" autoComplete="true" lovGridHeight="350" lovHeight="500" lovLabelWidth="100" lovService="cont.CON541.hls_bp_master_v_for_lov?bp_category=TENANT" lovWidth="520" title="HLS.BP_TITLE">
<a:field name="bp_name" autoComplete="true" lovGridHeight="350" lovHeight="500" lovLabelWidth="100"
lovService="cont.CON541.hls_bp_master_v_for_lov?bp_category=TENANT" lovWidth="520"
title="HLS.BP_TITLE">
<a:mapping>
<a:map from="bp_name" to="bp_name"/>
<a:map from="bp_id" to="bp_id_tenant"/>
......@@ -134,8 +143,11 @@
</a:mapping>
</a:field> -->
<a:field name="contract_number" typeCase="Upper"/>
<a:field name="lease_organization_name" displayField="description" options="con560_lease_organization_name_ds" returnField="lease_organization" valueField="lease_organization"/>
<a:field name="owner_user_id_n" lovGridHeight="350" lovHeight="475" lovService="cont.CON560.sys_user_for_lov" lovWidth="520" title="出单人选择">
<a:field name="lease_organization_name" displayField="description"
options="con560_lease_organization_name_ds" returnField="lease_organization"
valueField="lease_organization"/>
<a:field name="owner_user_id_n" lovGridHeight="350" lovHeight="475"
lovService="cont.CON560.sys_user_for_lov" lovWidth="520" title="出单人选择">
<a:mapping>
<a:map from="user_id" to="owner_user_id"/>
<a:map from="description" to="owner_user_id_n"/>
......@@ -171,9 +183,11 @@
<!--<a:lov name="owner_user_id_n" bindTarget="con560_contract_query_ds" prompt="出单人"/>-->
<a:comboBox name="lease_organization_name" bindTarget="con560_contract_query_ds" prompt="事业部"/>
</a:form>
<a:grid id="con560_con_contract_grid_ds" bindTarget="con560_contract_result_ds" marginHeight="365" marginWidth="30" navBar="true">
<a:grid id="con560_con_contract_grid_ds" bindTarget="con560_contract_result_ds" marginHeight="365"
marginWidth="30" navBar="true">
<a:columns>
<a:column name="contract_number" lock="true" prompt="HLS.CONTRACT_NUMBER" renderer="con560_render_contractMaintainDs_grid" width="150"/>
<a:column name="contract_number" lock="true" prompt="HLS.CONTRACT_NUMBER"
renderer="con560_render_contractMaintainDs_grid" width="150"/>
<a:column name="bp_name" prompt="HLS.TENANT_NAME" width="100"/>
<a:column name="inception_of_lease" prompt="起租日期" renderer="Leaf.formatDate" width="100"/>
<a:column name="lease_end_date" prompt="合同预计结束日期" renderer="Leaf.formatDate" width="100"/>
......@@ -184,8 +198,10 @@
<a:column name="signing_location" prompt="签约地点" width="100"/>
<a:column name="lease_channel_desc" prompt="商业模式" width="70"/>
<!--<a:column name="bp_vender" align="center" footerRenderer="summaryRenderer" prompt="主供应商名称" width="200"/>-->
<a:column name="lease_item_amount" align="right" footerRenderer="summaryRenderer" prompt="租赁物总价" renderer="Leaf.formatMoney" width="120"/>
<a:column name="down_payment" align="right" footerRenderer="summaryRenderer" prompt="首付款" renderer="Leaf.formatMoney" width="120"/>
<a:column name="lease_item_amount" align="right" footerRenderer="summaryRenderer" prompt="租赁物总价"
renderer="Leaf.formatMoney" width="120"/>
<a:column name="down_payment" align="right" footerRenderer="summaryRenderer" prompt="首付款"
renderer="Leaf.formatMoney" width="120"/>
<!--<a:column name="owner_user_id_n" prompt="出单人" width="60"/>-->
<a:column name="lease_organization_desc" prompt="事业部" width="80"/>
<a:column name="contract_status_n" prompt="合同状态" width="80"/>
......@@ -199,7 +215,8 @@
<a:column name="times" prompt="期数"/>
<a:column name="cf_type_dis" prompt="类型"/>
<a:column name="due_amount" align="right" prompt="应收金额" renderer="Leaf.formatMoney"/>
<a:column name="received_amount" align="right" prompt="已收金额" renderer="Leaf.formatMoney"/>
<a:column name="received_amount" align="right" prompt="已收金额"
renderer="Leaf.formatMoney"/>
<a:column name="due_date" prompt="预定支付日期"/>
<a:column name="amount" align="right" prompt="未收金额" renderer="Leaf.formatMoney"/>
<a:column name="principal" align="right" prompt="未收本金" renderer="Leaf.formatMoney"/>
......@@ -215,10 +232,13 @@
<a:column name="times" prompt="期数"/>
<a:column name="cf_type_dis" prompt="类型"/>
<a:column name="due_amount" align="right" prompt="应收金额" renderer="Leaf.formatMoney"/>
<a:column name="received_amount" align="right" prompt="已收金额" renderer="Leaf.formatMoney"/>
<a:column name="received_amount" align="right" prompt="已收金额"
renderer="Leaf.formatMoney"/>
<a:column name="due_date" prompt="预定支付日期"/>
<a:column name="received_principal" align="right" prompt="已收本金" renderer="Leaf.formatMoney"/>
<a:column name="received_interest" align="right" prompt="已收利息" renderer="Leaf.formatMoney"/>
<a:column name="received_principal" align="right" prompt="已收本金"
renderer="Leaf.formatMoney"/>
<a:column name="received_interest" align="right" prompt="已收利息"
renderer="Leaf.formatMoney"/>
<!--<a:column name="termination_date" prompt="回购日"/>-->
<a:column name="cf_status_dis" prompt="现金流状态"/>
</a:columns>
......@@ -228,4 +248,4 @@
</a:tabPanel>
</a:screenBody>
</a:view>
</a:screen>
</a:screen>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment