Commit 9f8d6dea authored by lijingjing's avatar lijingjing

[fix]合同起租报价

parent b86e9bb1
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: gaoyang
$Date: 2013-4-24 上午10:17:59
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
aux_single_variable_calc_pkg.calc_real_rate(p_calc_session_id =>${@calc_session_id},
p_user_id => ${/session/@user_id},
p_msg => ${@msg});
end;
]]></bm:update-sql>
<bm:parameters>
<bm:parameter name="msg" dataType="java.lang.String" input="false" output="true" outputPath="/parameter/@msg"/>
</bm:parameters>
</bm:operation>
<bm:operation name="execute">
<bm:update-sql><![CDATA[
begin
aux_single_variable_calc_pkg.manual_trial_after_calc(p_calc_session_id =>${@calc_session_id},
p_user_id => ${/session/@user_id},
p_msg => ${@msg});
end;
]]></bm:update-sql>
<bm:parameters>
<bm:parameter name="msg" dataType="java.lang.String" input="false" output="true" outputPath="/parameter/@msg"/>
</bm:parameters>
</bm:operation>
</bm:operations>
</bm:model>
...@@ -15,7 +15,8 @@ ...@@ -15,7 +15,8 @@
p_document_category=>${@document_category}, p_document_category=>${@document_category},
p_user_id =>${/session/@user_id} p_user_id =>${/session/@user_id}
); );
hls_fin_calculator_itfc_pkg.calculate(
hls_fin_calculator_itfc_pkg.calculate(
p_calc_session_id=>${@calc_session_id}, p_calc_session_id=>${@calc_session_id},
p_recreate_H_formula=>${@recreate_H_formula}, p_recreate_H_formula=>${@recreate_H_formula},
p_recreate_L_formula=>${@recreate_L_formula}, p_recreate_L_formula=>${@recreate_L_formula},
......
...@@ -36,6 +36,8 @@ ...@@ -36,6 +36,8 @@
<a:link id="con_approval_link_id" model="cont.CON505.contract_approval" modelaction="execute"/> <a:link id="con_approval_link_id" model="cont.CON505.contract_approval" modelaction="execute"/>
<link href="${/request/@context_path}/css/lightbox.css" rel="stylesheet" type="text/css"/> <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/lightbox.js" type="text/javascript"/>
<a:link id="${/parameter/@layout_code}${/parameter/@tree_code}_hls_fin_calculator_update_link_id"
url="${/request/@context_path}/modules/hls/HLS500N/hls_fin_calculator_update_n.lview"/>
<script type="text/javascript"><![CDATA[ <script type="text/javascript"><![CDATA[
Ext.ux.Lightbox.register('a[ref=img]', true); Ext.ux.Lightbox.register('a[ref=img]', true);
function lock_current_window() { function lock_current_window() {
...@@ -470,6 +472,48 @@ ...@@ -470,6 +472,48 @@
} }
window['${/parameter/@layout_code}_quote_layout_dynamic_click'] = function () {
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
var cashflow_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_cashflow');
var record = $(ds_id).getCurrentRecord();
var price_list = record.get('price_list');
var calc_session_id = record.get('calc_session_id');
var parent_pk_value = record.get('contract_id');
var calc_type = '${/parameter/@calc_type}' || 'CLASSIC_CALCULATOR';
if (calc_session_id) {
//直接进入报价页面
var win = new Leaf.Window({
id: 'hls_fin_calc_quotation_update_link_winid',
params: {
document_id: parent_pk_value,
price_list: price_list,
document_category: 'CONTRACT',
maintain_type: 'MODIFY',
calc_session_id: record.get('calc_session_id'),
quotation_id: record.get('quotation_id'),
dsId: cashflow_ds_id,
winId: 'hls_fin_calc_quotation_update_link_winid',
global_flag: 'Y',
id_num: 1,
calc_type: calc_type,
recreate_L_formula: 'N'
},
url: $('${/parameter/@layout_code}${/parameter/@tree_code}_hls_fin_calculator_update_link_id').getUrl(),
fullScreen: true,
draggable: true
});
win.on('close', function () {
$(cashflow_ds_id).query();
$(ds_id).query();
});
}
}
;
]]></script> ]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/> <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
</a:view> </a:view>
......
...@@ -36,7 +36,8 @@ ...@@ -36,7 +36,8 @@
<a:link id="hls_fin_calc_import_line_link_id" url="${/request/@context_path}/modules/hls/HLS500/hls_fin_calc_import_line.lview"/> <a:link id="hls_fin_calc_import_line_link_id" url="${/request/@context_path}/modules/hls/HLS500/hls_fin_calc_import_line.lview"/>
<a:link id="hls_fin_calc_show_display_line_link_id" url="${/request/@context_path}/modules/hls/HLS500N/hls_fin_calc_show_display_line_n.lview"/> <a:link id="hls_fin_calc_show_display_line_link_id" url="${/request/@context_path}/modules/hls/HLS500N/hls_fin_calc_show_display_line_n.lview"/>
<a:link id="prj_check_prj_record_link_id" model="hls.HLS500N.check_prj_record" modelaction="execute"/> <a:link id="prj_check_prj_record_link_id" model="hls.HLS500N.check_prj_record" modelaction="execute"/>
<a:link id="hls_fin_calc_single_variable_calc_link_id" model="hls.HLS500.hls_fin_calc_single_variable_calc" modelaction="update"/>
<a:link id="hls_fin_calc_single_variable_manual_link_id" model="hls.HLS500.hls_fin_calc_single_variable_calc" modelaction="execute"/>
<style><![CDATA[ <style><![CDATA[
.finGrid td[dataindex=percent]{ .finGrid td[dataindex=percent]{
border-right-color:#FFF; border-right-color:#FFF;
...@@ -76,110 +77,115 @@ ...@@ -76,110 +77,115 @@
ln_calc_orign_value = []; ln_calc_orign_value = [];
Leaf.Masker.mask(document.documentElement, '${l:HLS.LOADING}'); Leaf.Masker.mask(document.documentElement, '${l:HLS.LOADING}');
function hls_hls500_save(nextStep, source_procedure) {
Leaf.request({ function hls_hls500_save(nextStep, source_procedure) {
url: $('prj_check_prj_record_link_id').getUrl(), lock_calc_current_window('${l:HLS.SAVING}');
para: { if('${/parameter/@document_category}'=='PROJECT'){
'project_id': '${/parameter/@document_id}' Leaf.request({
}, url: $('prj_check_prj_record_link_id').getUrl(),
success: function(res) { para: {
var secondary_lease = res.result.secondary_lease; 'project_id': '${/parameter/@document_id}'
var payment_deduction = res.result.payment_deduction; },
var price_list = res.result.price_list; success: function(res) {
if(price_list=='DS_PRICE_10' && secondary_lease=='NO'){ var secondary_lease = res.result.secondary_lease;
var count=0; var payment_deduction = res.result.payment_deduction;
var denominator=0; var price_list = res.result.price_list;
var temp_head_records = $('hls_fin_calculator_hd_ds').getAll(); if(price_list=='DS_PRICE_10' && secondary_lease=='NO'){
for (var i = 0;i < temp_head_records.length;i++) { var count=0;
if(temp_head_records[i].get('column_code')=='H16'||temp_head_records[i].get('column_code')=='H97'){ var denominator=0;
count=count+temp_head_records[i].get('column_value')||0 var temp_head_records = $('hls_fin_calculator_hd_ds').getAll();
}else if(temp_head_records[i].get('column_code')=='H99'||temp_head_records[i].get('column_code')=='H102'){
denominator=denominator+temp_head_records[i].get('column_value')||0
}
}
if((count/denominator)<0.15){
Leaf.showMessage('${l:PROMPT}', '首付款比例+首付款保证金比例之和不能低于15%');
unlock_calc_current_window('${l:HLS.CALCULATING}');
return;
}
}
if(price_list=='DS_PRICE_10'){
if(payment_deduction!='TRADE_IN'){
var record = $('hls_fin_calculator_hd_ds').getAll();
for (var i = 0;i < temp_head_records.length;i++) { for (var i = 0;i < temp_head_records.length;i++) {
if(record[i].get('column_code')=='H109') { if(temp_head_records[i].get('column_code')=='H16'||temp_head_records[i].get('column_code')=='H97'){
record[i].set('column_value',0); count=count+temp_head_records[i].get('column_value')||0
record[i].set('column_value_c',0); }else if(temp_head_records[i].get('column_code')=='H99'||temp_head_records[i].get('column_code')=='H102'){
var a= document.getElementById('hls_fin_calculator_hd_grid_id_column_value_'+record[i].id); denominator=denominator+temp_head_records[i].get('column_value')||0
console.log(a);
document.getElementById('hls_fin_calculator_hd_grid_id_column_value_'+record[i].id).innerHTML=0;
document.getElementById('hls_fin_calculator_hd_grid_id_column_value_'+record[i].id).title=0;
} }
} }
}else{
var temp_head_records = $('hls_fin_calculator_hd_ds').getAll(); if((count/denominator)<0.15){
for (var i = 0;i < temp_head_records.length;i++) { Leaf.showMessage('${l:PROMPT}', '首付款比例+首付款保证金比例之和不能低于15%');
var H16; unlock_calc_current_window('${l:HLS.CALCULATING}');
if(temp_head_records[i].get('column_code')=='H16'){ return;
H16=temp_head_records[i].get('column_value'); }
}
if(price_list=='DS_PRICE_10'){
if(payment_deduction!='TRADE_IN'){
var record = $('hls_fin_calculator_hd_ds').getAll();
for (var i = 0;i < temp_head_records.length;i++) {
if(record[i].get('column_code')=='H109') {
record[i].set('column_value',0);
record[i].set('column_value_c',0);
var a= document.getElementById('hls_fin_calculator_hd_grid_id_column_value_'+record[i].id);console.log(a);
document.getElementById('hls_fin_calculator_hd_grid_id_column_value_'+record[i].id).innerHTML=0;
document.getElementById('hls_fin_calculator_hd_grid_id_column_value_'+record[i].id).title=0;
}
} }
}else{
var temp_head_records = $('hls_fin_calculator_hd_ds').getAll();
for (var i = 0;i < temp_head_records.length;i++) {
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') { if(temp_head_records[i].get('column_code')=='H109') {
temp_head_records[i].set('column_value',H16); temp_head_records[i].set('column_value',H16);
// temp_head_records[i].set('column_value_c',0); // temp_head_records[i].set('column_value_c',0);
}
} }
} }
} }
}
lock_calc_current_window('${l:HLS.SAVING}'); },
if (!$('hls_fin_calculator_hd_ds').validate() || !$('hls_fin_calculator_ln_ds').validate()) { failure: function() {
unlock_calc_current_window(); unlock_calc_current_window('${l:HLS.SAVING}');
return;
}
var temp_head_records = $('hls_fin_calculator_hd_ds').getAll();
for (var i = 0;i < temp_head_records.length;i++) {
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 all_records = $('temp_hd_attribute_ds').getAll();
var headRecord = $('hls_fin_cal_save_hd_ds').getAt(0);
headRecord.isNew = false;
headRecord.dirty = true;
create_record_column(all_records, headRecord);
function hls_fin_cal_save_hd_submitsuccess(ds, res) { },
if (typeof(nextStep) == 'function') { error: function() {
nextStep(source_procedure); unlock_calc_current_window('${l:HLS.SAVING}');
} else {
function on_ln_formula_load(ds) {
Leaf.SideBar.enable = true;
success_sidebar_show();
unlock_calc_current_window();
$('ln_formula_ds').un('load', on_ln_formula_load);
}
$('ln_formula_ds').on('load', on_ln_formula_load);
$('ln_formula_ds').query();
}
}
$('hls_fin_cal_save_hd_ds').on('submitsuccess', hls_fin_cal_save_hd_submitsuccess);
Leaf.SideBar.enable = false;
$('hls_fin_cal_save_hd_ds').submit();
},
failure: function() {
}, },
error: function() { scope: this
});
}
if (!$('hls_fin_calculator_hd_ds').validate() || !$('hls_fin_calculator_ln_ds').validate()) {
unlock_calc_current_window();
return;
}
var temp_head_records = $('hls_fin_calculator_hd_ds').getAll();
for (var i = 0;i < temp_head_records.length;i++) {
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 all_records = $('temp_hd_attribute_ds').getAll();
var headRecord = $('hls_fin_cal_save_hd_ds').getAt(0);
headRecord.isNew = false;
headRecord.dirty = true;
create_record_column(all_records, headRecord);
function hls_fin_cal_save_hd_submitsuccess(ds, res) {
if (typeof(nextStep) == 'function') {
nextStep(source_procedure);
} else {
function on_ln_formula_load(ds) {
Leaf.SideBar.enable = true;
success_sidebar_show();
unlock_calc_current_window();
$('ln_formula_ds').un('load', on_ln_formula_load);
}
$('ln_formula_ds').on('load', on_ln_formula_load);
$('ln_formula_ds').query();
}
}
$('hls_fin_cal_save_hd_ds').on('submitsuccess', hls_fin_cal_save_hd_submitsuccess);
Leaf.SideBar.enable = false;
$('hls_fin_cal_save_hd_ds').submit();
},
scope: this
});
} }
...@@ -783,6 +789,18 @@ ...@@ -783,6 +789,18 @@
function onEditorHdload(ds) { function onEditorHdload(ds) {
var headRecords = ds.getAll(); var headRecords = ds.getAll();
if('${/parameter/@document_category}'=='CONTRACT'){
for (var i = 0;i < headRecords.length;i++) {
var column_name = headRecords[i].get('column_name')
if(column_name !="lease_start_date"&&column_name !="contract_inception_date"){
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);
}
}
}
if (headRecords[0].get('show_column_code') == 'N') { if (headRecords[0].get('show_column_code') == 'N') {
$('hls_fin_calculator_hd_grid_id').hideColumn('column_code'); $('hls_fin_calculator_hd_grid_id').hideColumn('column_code');
$('hls_fin_calculator_export_grid_id').hideColumn('column_code'); $('hls_fin_calculator_export_grid_id').hideColumn('column_code');
...@@ -1171,6 +1189,54 @@ ...@@ -1171,6 +1189,54 @@
return ''; return '';
} }
} }
//add by syj 单变量求解
function hls_hls500_user_button1() {
flag = 'Y';
lock_calc_current_window();
Leaf.request({
url: $('hls_fin_calc_single_variable_calc_link_id').getUrl(),
para: {
calc_session_id: '${/parameter/@calc_session_id}'
},
success: function() {
open_after_save_execute();
},
failure: function() {
unlock_calc_current_window();
},
error: function() {
unlock_calc_current_window();
},
scope: this
});
}
function hls_hls500_user_button2() {
flag = 'Y';
lock_calc_current_window();
Leaf.request({
url: $('hls_fin_calc_single_variable_manual_link_id').getUrl(),
para: {
calc_session_id: '${/parameter/@calc_session_id}'
},
success: function() {
open_after_save_execute();
},
failure: function() {
unlock_calc_current_window();
},
error: function() {
unlock_calc_current_window();
},
scope: this
});
}
]]></script> ]]></script>
<a:dataSets> <a:dataSets>
<a:placeHolder id="dynamicDataSet_left_id"/> <a:placeHolder id="dynamicDataSet_left_id"/>
...@@ -1389,6 +1455,16 @@ ...@@ -1389,6 +1455,16 @@
<a:gridButton id="hls_hls500_show_col_id" click="hls_hls500_show_col" style="margin-top:10px;margin-left:5px" text="${@prompt}"/> <a:gridButton id="hls_hls500_show_col_id" click="hls_hls500_show_col" style="margin-top:10px;margin-left:5px" text="${@prompt}"/>
</c:process-config> </c:process-config>
</p:case> </p:case>
<p:case value="USER_BUTTON1">
<c:process-config>
<a:gridButton id="hls_hls500_user_button1_col_id" click="hls_hls500_user_button1" style="margin-top:10px;margin-left:5px" text="${@prompt}"/>
</c:process-config>
</p:case>
<p:case value="USER_BUTTON2">
<c:process-config>
<a:gridButton id="hls_hls500_user_button2_col_id" click="hls_hls500_user_button2" style="margin-top:10px;margin-left:5px" text="${@prompt}"/>
</c:process-config>
</p:case>
<p:case value="*"> <p:case value="*">
<c:process-config> <c:process-config>
<a:gridButton id="hls500_${@button_code}" click="hls500_define_button" style="margin-top:10px;margin-left:5px" text="${@prompt}"/> <a:gridButton id="hls500_${@button_code}" click="hls500_define_button" style="margin-top:10px;margin-left:5px" text="${@prompt}"/>
......
...@@ -234,7 +234,6 @@ ...@@ -234,7 +234,6 @@
draggable: true draggable: true
}); });
win.on('close', function () { win.on('close', function () {
debugger;
$(quotation_ds_id).query(); $(quotation_ds_id).query();
$(history_ds_id).query(); $(history_ds_id).query();
}); });
...@@ -285,7 +284,6 @@ ...@@ -285,7 +284,6 @@
draggable: true draggable: true
}); });
win.on('close', function () { win.on('close', function () {
$(quotation_ds_id).query(); $(quotation_ds_id).query();
$(history_ds_id).query(); $(history_ds_id).query();
......
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