Commit 1a1531f3 authored by Darming's avatar Darming

[fix]建行代扣及评分调整

parent 2d1e99ba
...@@ -35,8 +35,20 @@ ...@@ -35,8 +35,20 @@
FROM hls_cashflow_item FROM hls_cashflow_item
WHERE cf_item = ccc.cf_item) cf_item_desc, WHERE cf_item = ccc.cf_item) cf_item_desc,
c.pay_method, c.pay_method,
(ccc.due_amount - nvl(ccc.received_amount, 0)) due_amount, (select decode(cf_item, 9,
(ccc.due_amount - nvl(ccc.received_amount, 0)) manual_amount CON_OVERDUE_PENALTY_PKG.CALC_PENALTY_FOR_WRITE_OFF(p_cashflow_id=> cashflow_id,
p_calc_date=>to_date(${@due_date_to}, 'yyyy-mm-dd'),
p_user_id=>${/session/@user_id},
p_penalty_flag=>'Y'),
due_amount) from con_contract_cashflow where cashflow_id = ccc.cashflow_id) - nvl(ccc.received_amount, 0) due_amount,
(select decode(cf_item, 9,
CON_OVERDUE_PENALTY_PKG.CALC_PENALTY_FOR_WRITE_OFF(p_cashflow_id=> cashflow_id,
p_calc_date=>to_date(${@due_date_to}, 'yyyy-mm-dd'),
p_user_id=>${/session/@user_id},
p_penalty_flag=>'Y'),
due_amount) from con_contract_cashflow where cashflow_id = ccc.cashflow_id) - nvl(ccc.received_amount, 0) manual_amount
--(ccc.due_amount - nvl(ccc.received_amount, 0)) due_amount,
--(ccc.due_amount - nvl(ccc.received_amount, 0)) manual_amount
FROM con_contract c, FROM con_contract c,
con_contract_cashflow ccc #WHERE_CLAUSE#) t con_contract_cashflow ccc #WHERE_CLAUSE#) t
where not exists(select 1 where not exists(select 1
...@@ -45,16 +57,30 @@ ...@@ -45,16 +57,30 @@
where g.status in ('NEW', 'DEAL') where g.status in ('NEW', 'DEAL')
and g.group_id = l.group_id and g.group_id = l.group_id
and l.cashflow_id = t.cashflow_id) and l.cashflow_id = t.cashflow_id)
ORDER BY t.due_date_ORDER, t.contract_id, t.times, t.cf_item DESC ORDER BY t.due_date_ORDER, t.contract_id, t.times, decode(t.cf_item,1,2,8,3,9,1)
]]></bm:query-sql> ]]></bm:query-sql>
</bm:operation> </bm:operation>
</bm:operations> </bm:operations>
<bm:query-fields> <bm:query-fields>
<bm:query-field name="pay_method" queryExpression="(c.pay_method = ${@pay_method})"/> <bm:query-field name="pay_method" queryExpression="(c.pay_method = ${@pay_method})"/>
<bm:query-field name="due_date_from" <bm:query-field name="due_date_from"
queryExpression="(ccc.due_date &gt;= to_date(${@due_date_from},'yyyy-mm-dd'))"/> queryExpression="(decode(ccc.cf_item,
9,
(SELECT due_date
FROM con_contract_cashflow
WHERE cf_item = 1
AND times = ccc.times
AND contract_id = ccc.contract_id),
due_date) &gt;= to_date(${@due_date_from},'yyyy-mm-dd'))"/>
<bm:query-field name="due_date_to" <bm:query-field name="due_date_to"
queryExpression="(ccc.due_date &lt;= to_date(${@due_date_to},'yyyy-mm-dd'))"/> queryExpression="(decode(ccc.cf_item,
9,
(SELECT due_date
FROM con_contract_cashflow
WHERE cf_item = 1
AND times = ccc.times
AND contract_id = ccc.contract_id),
due_date) &lt;= to_date(${@due_date_to},'yyyy-mm-dd'))"/>
<bm:query-field name="contract_id" queryExpression="(ccc.contract_id = ${@contract_id})"/> <bm:query-field name="contract_id" queryExpression="(ccc.contract_id = ${@contract_id})"/>
<bm:query-field name="cf_item" queryExpression="(ccc.cf_item = ${@cf_item})"/> <bm:query-field name="cf_item" queryExpression="(ccc.cf_item = ${@cf_item})"/>
<bm:query-field name="bp_id_tenant" queryExpression="(bp_id_tenant = ${@bp_id_tenant})"/> <bm:query-field name="bp_id_tenant" queryExpression="(bp_id_tenant = ${@bp_id_tenant})"/>
......
...@@ -32,7 +32,18 @@ ...@@ -32,7 +32,18 @@
<bm:field name="bp_tenant_name" forInsert="false" forceUpdate="false" expression="(select h.bp_name from hls_bp_master h,con_contract c,con_contract_cashflow cf where c.contract_id = cf.contract_id and cf.cashflow_id = t1.cashflow_id and c.bp_id_tenant = h.bp_id)"/> <bm:field name="bp_tenant_name" forInsert="false" forceUpdate="false" expression="(select h.bp_name from hls_bp_master h,con_contract c,con_contract_cashflow cf where c.contract_id = cf.contract_id and cf.cashflow_id = t1.cashflow_id and c.bp_id_tenant = h.bp_id)"/>
<bm:field name="times" forceUpdate="false" forInsert="false" expression="(select times from con_contract_cashflow where cashflow_id = t1.cashflow_id)"/> <bm:field name="times" forceUpdate="false" forInsert="false" expression="(select times from con_contract_cashflow where cashflow_id = t1.cashflow_id)"/>
<bm:field name="due_date" forceUpdate="false" forInsert="false" expression="(select to_char(due_date,'yyyy-mm-dd') from con_contract_cashflow where cashflow_id = t1.cashflow_id)"/> <bm:field name="due_date" forceUpdate="false" forInsert="false" expression="(select to_char(due_date,'yyyy-mm-dd') from con_contract_cashflow where cashflow_id = t1.cashflow_id)"/>
<bm:field name="due_amount" forceUpdate="false" forInsert="false" expression="(select due_amount - nvl(received_amount,0) from con_contract_cashflow where cashflow_id = t1.cashflow_id)"/> <!-- <bm:field name="due_amount" forceUpdate="false" forInsert="false" expression="(select due_amount - nvl(received_amount,0) from con_contract_cashflow where cashflow_id = t1.cashflow_id)"/>-->
<bm:field name="due_amount" forceUpdate="false" forInsert="false" expression="((select decode(cf_item, 9,
CON_OVERDUE_PENALTY_PKG.CALC_PENALTY_FOR_WRITE_OFF(p_cashflow_id=> cashflow_id,
p_calc_date=>(select due_date from hls_ebank_batch where batch_id = t1.batch_id),
p_user_id=>${/session/@user_id},
p_penalty_flag=>'Y'),
due_amount)
from con_contract_cashflow
where cashflow_id = t1.cashflow_id) - nvl((select sum(CSH_WRITE_OFF_AMOUNT)
from csh_write_off
where cashflow_id = t1.cashflow_id and reversed_flag = 'N'
and write_off_date &lt; (select due_date from hls_ebank_batch where batch_id = t1.batch_id)),0))"/>
</bm:fields> </bm:fields>
<bm:query-fields> <bm:query-fields>
<bm:query-field name="batch_id" queryExpression="t1.batch_id = ${@batch_id}"/> <bm:query-field name="batch_id" queryExpression="t1.batch_id = ${@batch_id}"/>
......
...@@ -18,13 +18,16 @@ ...@@ -18,13 +18,16 @@
fst.parent_line_id) tree_parent_field, fst.parent_line_id) tree_parent_field,
fsd.target_value, fsd.target_value,
CASE CASE
when fst.score_target_code in ('HL_CM_10','HL_CM_11','HL_CM_14') then
to_char(fsd.target_value,'FM999,999,999,990.00')
when fst.score_target_code = 'HL_CM_24' then when fst.score_target_code = 'HL_CM_24' then
(SELECT DECODE(sign(t.EXCAVATOR_QUANTITY), 1, t.EXCAVATOR_QUANTITY || '台挖掘机;', null) || (SELECT DECODE(sign(t.EXCAVATOR_QUANTITY), 1, t.EXCAVATOR_QUANTITY || '台挖掘机;', null) ||
DECODE(sign(t.LOADER_QUANTITY), 1, t.LOADER_QUANTITY || '台装载机;', null) || DECODE(sign(t.LOADER_QUANTITY), 1, t.LOADER_QUANTITY || '台装载机;', null) ||
DECODE(sign(t.OTHER_OTHER), 1, t.OTHER_OTHER || '台其他机器;', null) target_value DECODE(sign(t.OTHER_OTHER), 1, t.OTHER_OTHER || '台其他机器;', null) ||
FROM (SELECT SUM(DECODE(item_type, 'EXCAVATOR', 1, 0) * nvl(quantity, 1)) EXCAVATOR_QUANTITY, decode(t.EXCAVATOR_QUANTITY + t.LOADER_QUANTITY + t.OTHER_OTHER, 0 , '无工程机械设备') target_value
SUM(DECODE(item_type, 'LOADER', 1, 0) * nvl(quantity, 1)) LOADER_QUANTITY, FROM (SELECT nvl(SUM(DECODE(item_type, 'EXCAVATOR', 1, 0) * nvl(quantity, 1)),0) EXCAVATOR_QUANTITY,
SUM(DECODE(item_type, 'OTHER', 1, 0) * nvl(quantity, 1)) OTHER_OTHER nvl(SUM(DECODE(item_type, 'LOADER', 1, 0) * nvl(quantity, 1)) ,0) LOADER_QUANTITY,
nvl(SUM(DECODE(item_type, 'OTHER', 1, 0) * nvl(quantity, 1)),0) OTHER_OTHER
FROM bp_tenant_rate_item_device_lv t FROM bp_tenant_rate_item_device_lv t
WHERE project_id = (select project_id WHERE project_id = (select project_id
from fnd_sc_score fs, from fnd_sc_score fs,
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
params.bank_account_id = record.get('bank_account_id'); params.bank_account_id = record.get('bank_account_id');
params.merger_rules = record.get('merger_rules'); params.merger_rules = record.get('merger_rules');
params.pay_method = record.get('pay_method'); params.pay_method = record.get('pay_method');
// params.due_date = record.get('due_date'); params.due_date = record.get('due_date');
//处理行 //处理行
var details = []; var details = [];
...@@ -139,6 +139,16 @@ ...@@ -139,6 +139,16 @@
} }
return true; return true;
} }
function hls_ccb_form_update(ds,record,name,value,oldvalue){
if(name == 'due_date_to'){
var r =$('hls_ccb_form_create_ds').getCurrentRecord();
if(r){
r.set('due_date',value);
}
}
}
]]></script> ]]></script>
<a:dataSets> <a:dataSets>
<a:dataSet id="pay_methods_ds"> <a:dataSet id="pay_methods_ds">
...@@ -187,6 +197,9 @@ ...@@ -187,6 +197,9 @@
</a:field> </a:field>
<a:field name="cf_item"/> <a:field name="cf_item"/>
</a:fields> </a:fields>
<a:events>
<a:event name="update" handler="hls_ccb_form_update"/>
</a:events>
</a:dataSet> </a:dataSet>
<a:dataSet id="hls_ccb_form_create_ds" autoCreate="true"> <a:dataSet id="hls_ccb_form_create_ds" autoCreate="true">
<a:fields> <a:fields>
......
...@@ -177,7 +177,7 @@ ...@@ -177,7 +177,7 @@
var status = records[0].get('status'); var status = records[0].get('status');
var batch_id = records[0].get('batch_id'); var batch_id = records[0].get('batch_id');
if (status != 'NEW' && status != 'POST_FAIL') { if (status != 'NEW' && status != 'POST_FAIL') {
Leaf.showMessage('${l:HLS.PROMPT}', '只有新建或推送失败的数据才能删除!'); Leaf.showMessage('${l:HLS.PROMPT}', '只有新建的数据才能删除!');
return; return;
} else { } else {
Leaf.Masker.mask(Ext.getBody(), '删除中...'); //锁屏 Leaf.Masker.mask(Ext.getBody(), '删除中...'); //锁屏
...@@ -298,6 +298,10 @@ ...@@ -298,6 +298,10 @@
}); });
} }
function query_reset(){
$('hls_ccb_batch_query_ds').reset();
}
]]></script> ]]></script>
<a:dataSets> <a:dataSets>
<a:dataSet id="bank_name_combobox_ds"> <a:dataSet id="bank_name_combobox_ds">
...@@ -331,6 +335,7 @@ ...@@ -331,6 +335,7 @@
<a:screenTopToolbar height="29"> <a:screenTopToolbar height="29">
<a:screenTitle/> <a:screenTitle/>
<a:gridButton click="query_batch" text="查询"/> <a:gridButton click="query_batch" text="查询"/>
<a:gridButton click="query_reset" text="重置"/>
<a:gridButton click="open_batch" text="生成代扣指令"/> <a:gridButton click="open_batch" text="生成代扣指令"/>
<a:gridButton click="delete_batch" text="删除代扣指令"/> <a:gridButton click="delete_batch" text="删除代扣指令"/>
<a:gridButton click="export_batch" text="导出划扣单"/> <a:gridButton click="export_batch" text="导出划扣单"/>
...@@ -340,7 +345,7 @@ ...@@ -340,7 +345,7 @@
<!-- <a:gridButton click="withhold_list" text="手工代扣单"/>--> <!-- <a:gridButton click="withhold_list" text="手工代扣单"/>-->
</a:screenTopToolbar> </a:screenTopToolbar>
<a:form column="3"> <a:form column="3">
<a:comboBox name="bank_name" bindTarget="hls_ccb_batch_query_ds" prompt="银行名称"/> <!-- <a:comboBox name="bank_name" bindTarget="hls_ccb_batch_query_ds" prompt="银行名称"/>-->
<a:comboBox name="status_desc" bindTarget="hls_ccb_batch_query_ds" prompt="状态"/> <a:comboBox name="status_desc" bindTarget="hls_ccb_batch_query_ds" prompt="状态"/>
<a:datePicker name="batch_date" bindTarget="hls_ccb_batch_query_ds" prompt="创建日期"/> <a:datePicker name="batch_date" bindTarget="hls_ccb_batch_query_ds" prompt="创建日期"/>
</a:form> </a:form>
...@@ -358,7 +363,7 @@ ...@@ -358,7 +363,7 @@
<a:column name="created_by_n" align="center" prompt="制单人" width="150"/> <a:column name="created_by_n" align="center" prompt="制单人" width="150"/>
<a:column name="total_real_amount" align="right" prompt="实扣总金额" renderer="Leaf.formatMoney" <a:column name="total_real_amount" align="right" prompt="实扣总金额" renderer="Leaf.formatMoney"
width="100"/> width="100"/>
<a:column name="total_success_count" align="right" prompt="扣款成功合同" width="100"/> <a:column name="total_success_count" align="right" prompt="扣款成功账号数" width="100"/>
<a:column name="message" align="right" prompt="错误消息" width="150"/> <a:column name="message" align="right" prompt="错误消息" width="150"/>
</a:columns> </a:columns>
</a:grid> </a:grid>
......
...@@ -17,6 +17,9 @@ ...@@ -17,6 +17,9 @@
</s:server-script> </s:server-script>
</a:init-procedure> </a:init-procedure>
<a:view> <a:view>
<a:link id="bp_tenant_detail_query_link" model="prj.PRJ500D.bp_tenant_old_r_query" modelaction="query"/>
<a:link id="${/parameter/@layout_code}_tenant_rate_query_link"
url="${/request/@context_path}/modules/prj/PRJ902/prj_project_score_result.lview"/>
<a:link id="${/parameter/@layout_code}${/parameter/@pre_layout}get_special_fields_link_id" <a:link id="${/parameter/@layout_code}${/parameter/@pre_layout}get_special_fields_link_id"
model="cont.CON500.con_contract_get_special_fields" modelaction="update"/> model="cont.CON500.con_contract_get_special_fields" modelaction="update"/>
<a:link id="${/parameter/@layout_code}${/parameter/@pre_layout}prj500_cdd_uploadFile_id" <a:link id="${/parameter/@layout_code}${/parameter/@pre_layout}prj500_cdd_uploadFile_id"
...@@ -62,9 +65,9 @@ ...@@ -62,9 +65,9 @@
var quotation_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_quotation'); var quotation_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_quotation');
var quo_record = $(quotation_ds_id).getCurrentRecord(); var quo_record = $(quotation_ds_id).getCurrentRecord();
var cal_hd_price_list= quo_record.get('cal_hd_price_list'); var cal_hd_price_list = quo_record.get('cal_hd_price_list');
var price_list= quo_record.get('price_list'); var price_list = quo_record.get('price_list');
if(cal_hd_price_list == price_list) { if (cal_hd_price_list == price_list) {
var url = $('${/parameter/@layout_code}_prj_project_create_contract_link_id').getUrl(); var url = $('${/parameter/@layout_code}_prj_project_create_contract_link_id').getUrl();
var record = $(ds_id).getCurrentRecord(); var record = $(ds_id).getCurrentRecord();
if ($(ds_id).validate()) { if ($(ds_id).validate()) {
...@@ -94,7 +97,8 @@ ...@@ -94,7 +97,8 @@
} }
); );
}}else{ }
} else {
Leaf.showMessage('${l:PROMPT}', '报价有变动请重新计算!'); Leaf.showMessage('${l:PROMPT}', '报价有变动请重新计算!');
return; return;
} }
...@@ -108,7 +112,7 @@ ...@@ -108,7 +112,7 @@
var url; var url;
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project'); var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project');
var quotation_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_quotation'); var quotation_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_quotation');
var history_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'G_CASHFLOW_NS', 'prj_quotation'); var history_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_CASHFLOW_NS', 'prj_quotation');
var record = $(quotation_ds_id).getCurrentRecord(); var record = $(quotation_ds_id).getCurrentRecord();
var head_record = $(ds_id).getAt(0); var head_record = $(ds_id).getAt(0);
...@@ -196,9 +200,9 @@ ...@@ -196,9 +200,9 @@
}); });
} else { } else {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
var cal_hd_price_list= record.get('cal_hd_price_list'); var cal_hd_price_list = record.get('cal_hd_price_list');
var price_list= record.get('price_list'); var price_list = record.get('price_list');
if(cal_hd_price_list == price_list) { if (cal_hd_price_list == price_list) {
//直接进入报价页面 //直接进入报价页面
var win = new Leaf.Window({ var win = new Leaf.Window({
...@@ -224,7 +228,7 @@ ...@@ -224,7 +228,7 @@
$(quotation_ds_id).query(); $(quotation_ds_id).query();
$(history_ds_id).query(); $(history_ds_id).query();
}); });
}else { } else {
record.set('to_doc_table', 'HLS_FIN_CALCULATOR_HD'); record.set('to_doc_table', 'HLS_FIN_CALCULATOR_HD');
var calc_recreate_L_formula; var calc_recreate_L_formula;
calc_recreate_L_formula = 'Y'; calc_recreate_L_formula = 'Y';
...@@ -316,11 +320,11 @@ ...@@ -316,11 +320,11 @@
var param = {}; var param = {};
param['bp_id'] = record.get('bp_id'); param['bp_id'] = record.get('bp_id');
param['bp_class'] = record.get('bp_class'); param['bp_class'] = record.get('bp_class');
if(record.get('bp_category') =='AGENT'){ if (record.get('bp_category') == 'AGENT') {
param['function_code'] = 'HLS303_Q'; param['function_code'] = 'HLS303_Q';
param['function_usage'] = 'QUERY'; param['function_usage'] = 'QUERY';
}else{ } else {
param['function_code'] = 'HLS215D'; param['function_code'] = 'HLS215D';
param['function_usage'] = 'QUERY'; param['function_usage'] = 'QUERY';
} }
...@@ -332,7 +336,7 @@ ...@@ -332,7 +336,7 @@
hls_doc_get_layout_code('${/parameter/@layout_code}_get_layout_code_link_id', param, '${/parameter/@layout_code}hls_bp_master_query_link', record.ds.id, '${/parameter/@layout_code}'); hls_doc_get_layout_code('${/parameter/@layout_code}_get_layout_code_link_id', param, '${/parameter/@layout_code}hls_bp_master_query_link', record.ds.id, '${/parameter/@layout_code}');
} }
function prj501n_project_number_renderer(id, name, query_only){ function prj501n_project_number_renderer(id, name, query_only) {
var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name]; var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name];
var param = {}; var param = {};
param['bp_id'] = record.get('project_id'); param['bp_id'] = record.get('project_id');
...@@ -344,8 +348,9 @@ function prj501n_project_number_renderer(id, name, query_only){ ...@@ -344,8 +348,9 @@ function prj501n_project_number_renderer(id, name, query_only){
param['prj_bp_id'] = record.get('prj_bp_id'); param['prj_bp_id'] = record.get('prj_bp_id');
hls_doc_get_layout_code('${/parameter/@layout_code}_get_layout_code_link_id', param, '${/parameter/@layout_code}project_number_query_link', record.ds.id, '${/parameter/@layout_code}'); hls_doc_get_layout_code('${/parameter/@layout_code}_get_layout_code_link_id', param, '${/parameter/@layout_code}project_number_query_link', record.ds.id, '${/parameter/@layout_code}');
} }
function prj501n_contract_number_renderer(id, name, query_only){
function prj501n_contract_number_renderer(id, name, query_only) {
var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name]; var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name];
var param = {}; var param = {};
param['contract_id'] = record.get('contract_id'); param['contract_id'] = record.get('contract_id');
...@@ -355,7 +360,7 @@ function prj501n_contract_number_renderer(id, name, query_only){ ...@@ -355,7 +360,7 @@ function prj501n_contract_number_renderer(id, name, query_only){
param['url_title'] = '${l:CON301.CONTRACT_DETAIL}'; param['url_title'] = '${l:CON301.CONTRACT_DETAIL}';
hls_doc_get_layout_code('${/parameter/@layout_code}_get_layout_code_link_id', param, '${/parameter/@layout_code}contract_number_query_link', record.ds.id, '${/parameter/@layout_code}'); hls_doc_get_layout_code('${/parameter/@layout_code}_get_layout_code_link_id', param, '${/parameter/@layout_code}contract_number_query_link', record.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) {
...@@ -388,11 +393,11 @@ function prj501n_contract_number_renderer(id, name, query_only){ ...@@ -388,11 +393,11 @@ function prj501n_contract_number_renderer(id, name, query_only){
return url; return url;
}*/ }*/
if (value != null ) { if (value != null) {
var link = '${/request/@context_path}/atm_download.lsc?attachment_id='; var link = '${/request/@context_path}/atm_download.lsc?attachment_id=';
var str = value.split(';;'); var str = value.split(';;');
var url = ''; var url = '';
for (var i = 0;i < str.length;i++) { for (var i = 0; i < str.length; i++) {
// //
var temp = str[i].split('--'); var temp = str[i].split('--');
if (!Leaf.isEmpty(temp[0])) { if (!Leaf.isEmpty(temp[0])) {
...@@ -416,13 +421,13 @@ function prj501n_contract_number_renderer(id, name, query_only){ ...@@ -416,13 +421,13 @@ function prj501n_contract_number_renderer(id, name, query_only){
link_function = 'prj501n_bp_code_renderer'; link_function = 'prj501n_bp_code_renderer';
return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>'; return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>';
}else if(name=='project_number'){ } else if (name == 'project_number') {
link_function = 'prj501n_project_number_renderer'; link_function = 'prj501n_project_number_renderer';
return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + value+ '</a>'; return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + value + '</a>';
}else if(name =='contract_number'){ } else if (name == 'contract_number') {
link_function = 'prj501n_contract_number_renderer'; link_function = 'prj501n_contract_number_renderer';
return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + value+ '</a>'; return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + value + '</a>';
} }
}; };
...@@ -430,13 +435,13 @@ function prj501n_contract_number_renderer(id, name, query_only){ ...@@ -430,13 +435,13 @@ function prj501n_contract_number_renderer(id, name, query_only){
window['${/parameter/@layout_code}_on_layout_dynamic_submitsuccess'] = function (ds, record, res) { window['${/parameter/@layout_code}_on_layout_dynamic_submitsuccess'] = function (ds, record, res) {
window['${/parameter/@layout_code}_lock_layout_dynamic_window'](); window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project'); var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project');
var bp_ds_ids = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_BASIC_INFO_1','prj_project'); var bp_ds_ids = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_BASIC_INFO_1', 'prj_project');
var bp_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_BP','prj_project_bp'); var bp_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_BP', 'prj_project_bp');
var tenant_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'T_HISTORY_INGO', 'hls_bp_master'); var tenant_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'T_HISTORY_INGO', 'hls_bp_master');
var cdd_item_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_cdd_item_doc_ref'); var cdd_item_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_cdd_item_doc_ref');
var virtual_ds_id = '${/parameter/@layout_code}_virtual_ds'; var virtual_ds_id = '${/parameter/@layout_code}_virtual_ds';
if (ds_id==ds.id || virtual_ds_id==ds.id) { if (ds_id == ds.id || virtual_ds_id == ds.id) {
$(cdd_item_ds_id).query(); $(cdd_item_ds_id).query();
$(bp_ds_id).query(); $(bp_ds_id).query();
$(tenant_ds_id).query(); $(tenant_ds_id).query();
...@@ -447,8 +452,8 @@ function prj501n_contract_number_renderer(id, name, query_only){ ...@@ -447,8 +452,8 @@ function prj501n_contract_number_renderer(id, name, query_only){
}; };
//选择事件(grid,attach,gridbox,table) //选择事件(grid,attach,gridbox,table)
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_select'] = function(ds, record, bp_seq) { window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_select'] = function (ds, record, bp_seq) {
var bp_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'G_BP', 'prj_project_bp'); var bp_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_BP', 'prj_project_bp');
if (bp_ds_id == ds.id && bp_ds_id) { if (bp_ds_id == ds.id && bp_ds_id) {
if (record.get('bp_category') == 'TENANT') { if (record.get('bp_category') == 'TENANT') {
//实际为不选中 //实际为不选中
...@@ -466,8 +471,8 @@ function prj501n_contract_number_renderer(id, name, query_only){ ...@@ -466,8 +471,8 @@ function prj501n_contract_number_renderer(id, name, query_only){
}; };
//加载时调用(grid,table,gridBox) //加载时调用(grid,table,gridBox)
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_load'] = function(ds, record, config_records, bp_seq) { window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_load'] = function (ds, record, config_records, bp_seq) {
var bp_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'G_BP', 'prj_project_bp'); var bp_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_BP', 'prj_project_bp');
/* var bp_ds_ids = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'F_HISTORY_INFO_1', 'prj_project_bp'); /* var bp_ds_ids = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'F_HISTORY_INFO_1', 'prj_project_bp');
$(bp_ds_ids).setQueryParameter('bp_id','${/parameter/@bp_id_tenant}'); $(bp_ds_ids).setQueryParameter('bp_id','${/parameter/@bp_id_tenant}');
$(bp_ds_ids).query();*/ $(bp_ds_ids).query();*/
...@@ -485,6 +490,45 @@ function prj501n_contract_number_renderer(id, name, query_only){ ...@@ -485,6 +490,45 @@ function prj501n_contract_number_renderer(id, name, query_only){
}; };
function jsGetAge(strBirthday) {
var returnAge;
var strBirthdayArr = strBirthday.split("-");
var birthYear = strBirthdayArr[0];
var birthMonth = strBirthdayArr[1];
var birthDay = strBirthdayArr[2];
var d = new Date();
var nowYear = d.getFullYear();
var nowMonth = d.getMonth() + 1;
var nowDay = d.getDate();
if (nowYear == birthYear) {
returnAge = 0;//同年 则为0岁  
} else {
var ageDiff = nowYear - birthYear; //年之差  
if (ageDiff > 0) {
if (nowMonth == birthMonth) {
var dayDiff = nowDay - birthDay;//日之差  
if (dayDiff < 0) {
returnAge = ageDiff - 1;
} else {
returnAge = ageDiff;
}
} else {
var monthDiff = nowMonth - birthMonth;//月之差  
if (monthDiff < 0) {
returnAge = ageDiff - 1;
} else {
returnAge = ageDiff;
}
}
} else {
returnAge = -1;//返回-1 表示出生日期输入错误 晚于今天  
}
}
return returnAge;//返回周岁年龄  
}
//pdf预览 add by zhuxianfei //pdf预览 add by zhuxianfei
function view_pdf(attachment_id) { function view_pdf(attachment_id) {
Leaf.request({ Leaf.request({
...@@ -492,7 +536,7 @@ function prj501n_contract_number_renderer(id, name, query_only){ ...@@ -492,7 +536,7 @@ function prj501n_contract_number_renderer(id, name, query_only){
para: { para: {
attachment_id: attachment_id attachment_id: attachment_id
}, },
success: function(res) { success: function (res) {
var path = res.result.record.file_path; var path = res.result.record.file_path;
path = path.substr(path.indexOf('hls_attachment')); path = path.substr(path.indexOf('hls_attachment'));
var tomcat_source = '${/parameter/@tomcat_source}'; var tomcat_source = '${/parameter/@tomcat_source}';
...@@ -504,19 +548,19 @@ function prj501n_contract_number_renderer(id, name, query_only){ ...@@ -504,19 +548,19 @@ function prj501n_contract_number_renderer(id, name, query_only){
} }
Leaf.onReady(function(){ Leaf.onReady(function () {
var bp_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'T_HISTORY_INGO', 'hls_bp_master'); var bp_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'T_HISTORY_INGO', 'hls_bp_master');
var url='${/request/@context_path}/autocrud/prj.PRJ501N.prj_project_history_display/query?project_id=${/parameter/@project_id}&bp_id=${/parameter/@bp_id}'; var url = '${/request/@context_path}/autocrud/prj.PRJ501N.prj_project_history_display/query?project_id=${/parameter/@project_id}&bp_id=${/parameter/@bp_id}';
$(bp_ds_id).setQueryUrl(url); $(bp_ds_id).setQueryUrl(url);
$(bp_ds_id).query(); $(bp_ds_id).query();
//ADD BY SHEN //ADD BY SHEN
var billing_ds_id=get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'],'prj_project_bp'); var billing_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project_bp');
var billing_url='${/request/@context_path}/autocrud/prj.PRJ501N.prj_project_bp/query?project_id=${/parameter/@project_id}'; var billing_url = '${/request/@context_path}/autocrud/prj.PRJ501N.prj_project_bp/query?project_id=${/parameter/@project_id}';
$(billing_ds_id).setQueryUrl(billing_url); $(billing_ds_id).setQueryUrl(billing_url);
$(billing_ds_id).query(); $(billing_ds_id).query();
}) })
//序号自增 add by lijingjing //序号自增 add by lijingjing
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_add'] = function(ds, record, config_records, bp_seq) { window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_add'] = function (ds, record, config_records, bp_seq) {
//租赁物序号 //租赁物序号
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project_lease_item'); var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project_lease_item');
if (ds_id == ds.id && ds_id) { if (ds_id == ds.id && ds_id) {
...@@ -524,7 +568,7 @@ function prj501n_contract_number_renderer(id, name, query_only){ ...@@ -524,7 +568,7 @@ function prj501n_contract_number_renderer(id, name, query_only){
var measure_records = ds.getAll(), var measure_records = ds.getAll(),
seq_num = 0; seq_num = 0;
if (measure_records.length) { if (measure_records.length) {
for (var j = 0;j < measure_records.length;j++) { for (var j = 0; j < measure_records.length; j++) {
var measure_record = measure_records[j], var measure_record = measure_records[j],
rk = measure_record.get('lease_item_seq'); rk = measure_record.get('lease_item_seq');
if (seq_num <= rk) { if (seq_num <= rk) {
...@@ -535,34 +579,73 @@ function prj501n_contract_number_renderer(id, name, query_only){ ...@@ -535,34 +579,73 @@ function prj501n_contract_number_renderer(id, name, query_only){
var rk_value = seq_num + 1; var rk_value = seq_num + 1;
record.set('lease_item_seq', rk_value); record.set('lease_item_seq', rk_value);
} }
var device_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_SCORE_DEVICE', 'bp_tenant_rate_item');
var traffic_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_SCORE_TRAFFIC', 'bp_tenant_rate_item');
if ((device_ds_id == ds.id && device_ds_id) || (traffic_ds_id == ds.id && traffic_ds_id)) {
//设置序号
var rs = ds.getAll(),
seq_num = 0;
if (rs.length) {
for (var j = 0; j < rs.length; j++) {
var r = rs[j],
rk = r.get('seq_num');
if (seq_num <= rk) {
seq_num = rk;
}
}
}
var rk_value = seq_num + 1;
record.set('seq_num', rk_value);
}
}; };
//客户评分 //客户评分
window['${/parameter/@layout_code}_user_button9_layout_dynamic_click'] = function() { window['${/parameter/@layout_code}_user_button9_layout_dynamic_click'] = function () {
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project'); var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project');
var record = $(ds_id).getCurrentRecord(); var record = $(ds_id).getCurrentRecord();
var param = {}; if (record) {
if(record.get('project_status')=='NEW'||record.get('project_status')=='APPROVE_RETURN'||record.get('project_status')=='REJECT'){ var param = record.data;
param['function_code'] = 'PRJ501TENANT'; if (record.get('project_id')) {
param['function_usage'] = 'UPDATE';
}else{
param['function_code'] = 'PRJ501TENANT';
param['function_usage'] = 'QUERY';
}
param['project_id'] = record.get('project_id'); param['project_id'] = record.get('project_id');
param['winid'] = 'hl_tenant_score_rate_win_id'; param['winid'] = 'hl_tenant_score_rate_win_id';
param['url_title'] = '客户评分明细'; param['url_title'] = '客户评分明细';
hls_doc_get_layout_code('${/parameter/@layout_code}_get_layout_code_link_id', param, '${/parameter/@layout_code}tenant_rate_query_link', '${/parameter/@layout_code}'); var score_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_TENANT_SCORE_INFO', 'bp_tenant_rate_detail');
var r = $(score_ds_id).getCurrentRecord();
if (r.dirty) {
Leaf.showInfoMessage('提示', '评分数据发生修改,请先保存再进行评分');
return;
}
if ($(ds_id).validate()) {
var win = new Leaf.Window({
id: param['winid'],
params: param,
url: $('${/parameter/@layout_code}_tenant_rate_query_link').getUrl(),
title: param['url_title'],
fullScreen: true,
draggable: true
});
win.on('close', function () {
$(ds_id).setQueryParameter('project_id', record.get('project_id'));
$(ds_id).query();
});
}
} else {
Leaf.showMessage('${l:PROMPT}', '请先保存');
return;
} }
}
};
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'], 'prj_project'); var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project');
var current_record = $(ds_id).getCurrentRecord(); var current_record = $(ds_id).getCurrentRecord();
var project_id = current_record.get('project_id'); var project_id = current_record.get('project_id');
Leaf.showConfirm('${HLS.PROMPT}', '确认要提交工作流吗?', function() { Leaf.showConfirm('${HLS.PROMPT}', '确认要提交工作流吗?', function () {
window['${/parameter/@layout_code}_lock_layout_dynamic_window'](); window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({ Leaf.request({
url: $('prj_approval_link_id').getUrl(), url: $('prj_approval_link_id').getUrl(),
...@@ -570,24 +653,24 @@ function prj501n_contract_number_renderer(id, name, query_only){ ...@@ -570,24 +653,24 @@ function prj501n_contract_number_renderer(id, name, query_only){
project_id: project_id project_id: project_id
}, },
scope: this, scope: this,
success: function() { success: function () {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@winid}').close(); $('${/parameter/@winid}').close();
}, },
failure: function() { failure: function () {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
}, },
error: function() { error: function () {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
} }
}); });
}); });
} }
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_form_add_and_load'] = function(ds, record, config_records, bp_seq) { 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'], 'prj_project'); var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project');
if(ds_id==ds.id && ds_id){ if (ds_id == ds.id && ds_id) {
if(record.get('pay_method') == 'WIRE_TRANSFER'){ if (record.get('pay_method') == 'WIRE_TRANSFER') {
record.getField('bank_branch_name').setReadOnly(true); record.getField('bank_branch_name').setReadOnly(true);
record.getField('bank_branch_name_n').setReadOnly(true); record.getField('bank_branch_name_n').setReadOnly(true);
record.getField('bank_branch_name').setRequired(false); record.getField('bank_branch_name').setRequired(false);
...@@ -598,26 +681,83 @@ function prj501n_contract_number_renderer(id, name, query_only){ ...@@ -598,26 +681,83 @@ function prj501n_contract_number_renderer(id, name, query_only){
}; };
//更新时调用 //更新时调用
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_update'] = function(ds, record, name, value, old_value, bp_seq) { window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_update'] = function (ds, record, name, value, old_value, bp_seq) {
//选择承租人带出开票信息 //选择承租人带出开票信息
var prj_project_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project'); var prj_project_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project');
var prj_project_history_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'T_HISTORY_INGO', 'hls_bp_master');; var prj_project_history_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'T_HISTORY_INGO', 'hls_bp_master');
if(prj_project_ds_id==ds.id &&prj_project_ds_id){ ;
if(name=="bp_id_tenant" && value){ var score_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_TENANT_SCORE_INFO', 'bp_tenant_rate_detail');
if (prj_project_ds_id == ds.id && prj_project_ds_id) {
if (name == "bp_id_tenant" && value) {
//根据承租人查找该承租人的历史合同信息 //根据承租人查找该承租人的历史合同信息
$(prj_project_history_ds_id).setQueryUrl('${/request/@context_path}/autocrud/prj.PRJ501N.prj_project_history_display/query'); $(prj_project_history_ds_id).setQueryUrl('${/request/@context_path}/autocrud/prj.PRJ501N.prj_project_history_display/query');
$(prj_project_history_ds_id).setQueryParameter("bp_id",value); $(prj_project_history_ds_id).setQueryParameter("bp_id", value);
$(prj_project_history_ds_id).query(); $(prj_project_history_ds_id).query();
}
if (name == 'bp_id_tenant_n' && value) {
Leaf.Masker.mask(Ext.getBody());
var bp_id_tenant = record.get('bp_id_tenant');
$(score_ds_id).getCurrentRecord().set('score_name', value);
Leaf.request({
url: $('bp_tenant_detail_query_link').getUrl(),
para: {
bp_id: bp_id_tenant
},
success: function (res) {
var obj = res.result.record;
if (obj) {
var bp_tenant_detail_r = $(score_ds_id).getCurrentRecord();
if (bp_tenant_detail_r) {
for (var key in bp_tenant_detail_r.data) {
if (key != 'bp_detail_id' && key != 'score_name' && key != 'bp_age') {
var vl = obj[key];
if (key == 'bp_birth' && obj[key]) {
vl = new Date(obj[key].toString());
}
if (vl != "null" && vl != "undefined") {
bp_tenant_detail_r.set(key, vl);
}
}
}
}
}
Leaf.Masker.unmask(Ext.getBody());
},
failure: function () {
Leaf.Masker.unmask(Ext.getBody());
},
error: function () {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
}
if (name == 'legal_person' && value) {
$(score_ds_id).getCurrentRecord().set('score_name', value);
}
if (name == 'bp_id_tenant') {
if (!value) {
var bp_tenant_detail_r = $(score_ds_id).getCurrentRecord();
if (bp_tenant_detail_r) {
for (var key in bp_tenant_detail_r.data) {
bp_tenant_detail_r.set(key, '');
}
}
}
record.getField('bank_account_id').setLovPara('bp_id_tenant', record.get('bp_id_tenant'));
} }
} }
if(name=='pay_method'){ if (name == 'pay_method') {
if ( record.get('pay_method') == 'WIRE_TRANSFER') { if (record.get('pay_method') == 'WIRE_TRANSFER') {
record.set('bank_account_id',null); record.set('bank_account_id', null);
record.set('bank_account_id_n',null); record.set('bank_account_id_n', null);
record.set('bank_branch_num',''); record.set('bank_branch_num', '');
record.set('bank_account_name',''); record.set('bank_account_name', '');
record.getField('bank_account_id').setReadOnly(true); record.getField('bank_account_id').setReadOnly(true);
record.getField('bank_account_id_n').setReadOnly(true); record.getField('bank_account_id_n').setReadOnly(true);
record.getField('bank_account_id').setRequired(false); record.getField('bank_account_id').setRequired(false);
...@@ -630,16 +770,16 @@ function prj501n_contract_number_renderer(id, name, query_only){ ...@@ -630,16 +770,16 @@ function prj501n_contract_number_renderer(id, name, query_only){
} }
} }
if(name=='payment_deduction') { if (name == 'payment_deduction') {
var quoation_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_QUOTATION_N', 'prj_quotation'); var quoation_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_QUOTATION_N', 'prj_quotation');
var quoation_record = $(quoation_ds_id).getCurrentRecord(); var quoation_record = $(quoation_ds_id).getCurrentRecord();
var down_payment = quoation_record.get('down_payment') || 0; var down_payment = quoation_record.get('down_payment') || 0;
var calc_session_id= quoation_record.get('calc_session_id'); var calc_session_id = quoation_record.get('calc_session_id');
var other_payment2; var other_payment2;
if (old_value && value &&calc_session_id&& value == 'NO_DEDUCTION') { if (old_value && value && calc_session_id && value == 'NO_DEDUCTION') {
other_payment2 = 0; other_payment2 = 0;
} else if (old_value && value &&calc_session_id&& value != 'NO_DEDUCTION'){ } else if (old_value && value && calc_session_id && value != 'NO_DEDUCTION') {
other_payment2=down_payment; other_payment2 = down_payment;
} }
window['${/parameter/@layout_code}_lock_layout_dynamic_window'](); window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({ Leaf.request({
...@@ -663,6 +803,29 @@ function prj501n_contract_number_renderer(id, name, query_only){ ...@@ -663,6 +803,29 @@ function prj501n_contract_number_renderer(id, name, query_only){
} }
if (score_ds_id == ds.id) {
if (name == 'bp_birth' && value) {
if (jsGetAge(value.format('yyyy-mm-dd').toString()) == -1) {
Leaf.showInfoMessage("提示", "出生日期不能大于当前日期");
setTimeout(function () {
record.set('bp_birth', old_value);
}, 0);
} else {
record.set('bp_age', jsGetAge(value.format('yyyy-mm-dd').toString()));
}
}
}
var device_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_SCORE_DEVICE', 'bp_tenant_rate_item');
if (device_ds_id == ds.id) {
if (name == 'quantity') {
if (value <= 0) {
Leaf.showInfoMessage("提示", "数量必须大于0");
setTimeout(function () {
record.set('quantity', old_value);
}, 0);
}
}
}
}; };
......
...@@ -5,19 +5,28 @@ ...@@ -5,19 +5,28 @@
$Revision: 1.0 $Revision: 1.0
$Purpose: $Purpose:
--> -->
<a:screen xmlns:c="leaf.application.action" xmlns:a="http://www.leaf-framework.org/application" xmlns:p="uncertain.proc" trace="true"> <a:screen xmlns:c="leaf.application.action" xmlns:a="http://www.leaf-framework.org/application" xmlns:p="uncertain.proc"
trace="true">
<a:init-procedure> <a:init-procedure>
<a:model-query defaultWhereClause="sc.result_id = ${/parameter/@result_id}" model="fnd.FND714.fnd_sc_score_query" rootPath="fnd714_sc_score_query_path"/> <a:model-query defaultWhereClause="sc.result_id = ${/parameter/@result_id}"
<a:model-query model="fnd.FND714.fnd_sc_score_result_grade_from_to" rootPath="fnd714_sc_score_result_grade_from_to_path"/> model="fnd.FND714.fnd_sc_score_query" rootPath="fnd714_sc_score_query_path"/>
<a:model-query model="fnd.FND714.fnd_sc_score_result_grade_from_to"
rootPath="fnd714_sc_score_result_grade_from_to_path"/>
</a:init-procedure> </a:init-procedure>
<a:view> <a:view>
<a:link id="prj_project_score_result_link_id" model="prj.PRJ902.prj_project_score_result" modelaction="execute"/> <a:link id="prj_project_score_result_link_id" model="prj.PRJ902.prj_project_score_result"
<a:link id="prj_project_evaluate_level_link_id" model="prj.PRJ902.prj_project_score_result" modelaction="update"/> modelaction="execute"/>
<a:link id="prj_project_evaluate_level_link_id" model="prj.PRJ902.prj_project_score_result"
modelaction="update"/>
<style>
#fnd714_sc_score_result_dtl_grid_tb div {
display: none
}
</style>
<script type="text/javascript"><![CDATA[ <script type="text/javascript"><![CDATA[
Leaf.onReady(function() { Leaf.onReady(function () {
//获取评级结果 //获取评级结果
//reset_evaluate_level(${/parameter/@result_id}, ${/model/fnd714_sc_score_query_path/record/@score_result}); //reset_evaluate_level(${/parameter/@result_id}, ${/model/fnd714_sc_score_query_path/record/@score_result});
var expand_flag = '${/parameter/@expand_flag}'; var expand_flag = '${/parameter/@expand_flag}';
if (expand_flag == 'Y') { if (expand_flag == 'Y') {
return; return;
...@@ -48,8 +57,8 @@ ...@@ -48,8 +57,8 @@
if (record.get('summary_flag') == 'Y') { if (record.get('summary_flag') == 'Y') {
return ''; return '';
} }
if (value == 'DQ'){ if (value == 'DQ') {
return '<font color=red>'+ value + '</font>'; return '<font color=red>' + value + '</font>';
} }
return value; return value;
} }
...@@ -57,9 +66,9 @@ ...@@ -57,9 +66,9 @@
function fnd714_sc_score_result_dtl_render_target_score_sum(value, record, name) { function fnd714_sc_score_result_dtl_render_target_score_sum(value, record, name) {
var target_score = record.get('target_score'); var target_score = record.get('target_score');
if (record.get('display_flag') == 'Y' && record.get('summary_flag') == 'Y' && $('fnd714_sc_score_head_query_ds').getCurrentRecord().get('template_type') == 'PD') { if (record.get('display_flag') == 'Y' && record.get('summary_flag') == 'Y' && $('fnd714_sc_score_head_query_ds').getCurrentRecord().get('template_type') == 'PD') {
return '<font color=red>'+ Leaf.formatNumber(target_score, 2) + '</font>'; return '<font color=red>' + Leaf.formatNumber(target_score, 2) + '</font>';
} else if (record.get('display_flag') == 'Y' && record.get('summary_flag') == 'Y' && $('fnd714_sc_score_head_query_ds').getCurrentRecord().get('template_type') == 'LGD') { } else if (record.get('display_flag') == 'Y' && record.get('summary_flag') == 'Y' && $('fnd714_sc_score_head_query_ds').getCurrentRecord().get('template_type') == 'LGD') {
return '<font color=red>'+ Leaf.formatNumber(target_score, 2) + '</font>'; return '<font color=red>' + Leaf.formatNumber(target_score, 2) + '</font>';
} }
return ''; return '';
} }
...@@ -111,7 +120,7 @@ ...@@ -111,7 +120,7 @@
//行业分析 BAOXIN2-1-5 公司性质 BAOXIN2-1-1 计算对应上级分数和总分数 //行业分析 BAOXIN2-1-5 公司性质 BAOXIN2-1-1 计算对应上级分数和总分数
if (record.get('score_target_code') == 'BAOXIN2-1-5' || record.get('score_target_code') == 'BAOXIN2-1-1') { if (record.get('score_target_code') == 'BAOXIN2-1-5' || record.get('score_target_code') == 'BAOXIN2-1-1') {
var records = ds.getAll(); var records = ds.getAll();
for (var i = 0;i < records.length;i++) { for (var i = 0; i < records.length; i++) {
//稳定性:78分 //稳定性:78分
if (records[i].get('score_target_code') == 'BAOXIN2-1') { if (records[i].get('score_target_code') == 'BAOXIN2-1') {
var target_score_tmp = records[i].get('target_score'); var target_score_tmp = records[i].get('target_score');
...@@ -140,7 +149,7 @@ ...@@ -140,7 +149,7 @@
function score_head_beforesubmit(ds) { function score_head_beforesubmit(ds) {
var records = $('fnd714_sc_score_result_dtl_ds').getAll(); var records = $('fnd714_sc_score_result_dtl_ds').getAll();
for (var i = 0;i < records.length;i++) { for (var i = 0; i < records.length; i++) {
var record = records[i]; var record = records[i];
var target_value = record.get('target_value'); var target_value = record.get('target_value');
var score_target_code = record.get('score_target_code'); var score_target_code = record.get('score_target_code');
...@@ -218,15 +227,15 @@ ...@@ -218,15 +227,15 @@
score_num: '${/parameter/@score_num}', score_num: '${/parameter/@score_num}',
recalc_flag: 'Y' recalc_flag: 'Y'
}, },
success: function(res) { success: function (res) {
$('fnd714_sc_score_head_query_ds').query(); $('fnd714_sc_score_head_query_ds').query();
//$('fnd714_sc_score_result_dtl_ds').query(); //$('fnd714_sc_score_result_dtl_ds').query();
Leaf.Masker.unmask(Ext.getBody()); Leaf.Masker.unmask(Ext.getBody());
}, },
error: function() { error: function () {
Leaf.Masker.unmask(Ext.getBody()); Leaf.Masker.unmask(Ext.getBody());
}, },
failure: function() { failure: function () {
Leaf.Masker.unmask(Ext.getBody()); Leaf.Masker.unmask(Ext.getBody());
}, },
sync: true, sync: true,
...@@ -234,11 +243,12 @@ ...@@ -234,11 +243,12 @@
}); });
} }
function score_head_load(ds){ function score_head_load(ds) {
//获取评级结果 //获取评级结果
var score_result = $('fnd714_sc_score_head_query_ds').getAt(0).get('score_result'); var score_result = $('fnd714_sc_score_head_query_ds').getAt(0).get('score_result');
reset_evaluate_level(${/parameter/@result_id}, score_result); reset_evaluate_level(${/parameter/@result_id}, score_result);
} }
]]></script> ]]></script>
<a:dataSets> <a:dataSets>
<a:dataSet id="prj_project_evaluate_level_ds" autoCreate="true"> <a:dataSet id="prj_project_evaluate_level_ds" autoCreate="true">
...@@ -246,7 +256,9 @@ ...@@ -246,7 +256,9 @@
<a:field name="evaluate_level"/> <a:field name="evaluate_level"/>
</a:fields> </a:fields>
</a:dataSet> </a:dataSet>
<a:dataSet id="fnd714_sc_score_head_query_ds" model="fnd.FND714.fnd_sc_score_query" queryUrl="${/request/@context_path}/autocrud/fnd.FND714.fnd_sc_score_query/query?result_id = ${/parameter/@result_id}&amp;sc_score_id=${/parameter/@sc_score_id}" submitUrl="${/request/@context_path}/modules/prj/PRJ902/prj_project_score_result_dtl.lsc"> <a:dataSet id="fnd714_sc_score_head_query_ds" model="fnd.FND714.fnd_sc_score_query"
queryUrl="${/request/@context_path}/autocrud/fnd.FND714.fnd_sc_score_query/query?result_id = ${/parameter/@result_id}&amp;sc_score_id=${/parameter/@sc_score_id}"
submitUrl="${/request/@context_path}/modules/prj/PRJ902/prj_project_score_result_dtl.lsc">
<a:datas dataSource="/model/fnd714_sc_score_query_path"/> <a:datas dataSource="/model/fnd714_sc_score_query_path"/>
<a:events> <a:events>
<a:event name="submitsuccess" handler="score_head_submitsuccess"/> <a:event name="submitsuccess" handler="score_head_submitsuccess"/>
...@@ -254,7 +266,10 @@ ...@@ -254,7 +266,10 @@
<a:event name="load" handler="score_head_load"/> <a:event name="load" handler="score_head_load"/>
</a:events> </a:events>
</a:dataSet> </a:dataSet>
<a:dataSet id="fnd714_sc_score_result_dtl_ds" bindName="result_dtl" bindTarget="fnd714_sc_score_head_query_ds" fetchAll="true" loadData="true" model="fnd.FND714.fnd_sc_score_result_dtl_query" queryUrl="${/request/@context_path}/autocrud/fnd.FND714.fnd_sc_score_result_dtl_query/query?template_type=${/parameter/@template_type}&amp;expand_flag=${/parameter/@expand_flag}"> <a:dataSet id="fnd714_sc_score_result_dtl_ds" bindName="result_dtl"
bindTarget="fnd714_sc_score_head_query_ds" fetchAll="true" loadData="true"
model="fnd.FND714.fnd_sc_score_result_dtl_query"
queryUrl="${/request/@context_path}/autocrud/fnd.FND714.fnd_sc_score_result_dtl_query/query?template_type=${/parameter/@template_type}&amp;expand_flag=${/parameter/@expand_flag}">
<a:fields> <a:fields>
<a:field name="target_score" lovGridHeight="350" lovHeight="550" lovWidth="500" title="评级"> <a:field name="target_score" lovGridHeight="350" lovHeight="550" lovWidth="500" title="评级">
<a:mapping> <a:mapping>
...@@ -281,29 +296,40 @@ ...@@ -281,29 +296,40 @@
<a:hBox> <a:hBox>
<a:vBox labelSeparator=" " labelWidth="100"> <a:vBox labelSeparator=" " labelWidth="100">
<!-- <a:textField name="template_type_desc" bindTarget="fnd714_sc_score_head_query_ds" prompt="FND713.FND_SCORE_TEMPLATE.TEMPLATE_TYPE" readOnly="true"/> --> <!-- <a:textField name="template_type_desc" bindTarget="fnd714_sc_score_head_query_ds" prompt="FND713.FND_SCORE_TEMPLATE.TEMPLATE_TYPE" readOnly="true"/> -->
<!-- <a:textField name="evaluate_level" bindTarget="prj_project_evaluate_level_ds" prompt="评级" readOnly="true"/>--> <!-- <a:textField name="evaluate_level" bindTarget="prj_project_evaluate_level_ds" prompt="评级" readOnly="true"/>-->
<a:numberField name="score_result" allowDecimals="true" bindTarget="fnd714_sc_score_head_query_ds" decimalPrecision="2" prompt="分数" readOnly="true" style="font-weight:bold"/> <a:numberField name="score_result" allowDecimals="true" bindTarget="fnd714_sc_score_head_query_ds"
<a:textField name="object_name" bindTarget="fnd714_sc_score_head_query_ds" prompt="评分对象" readOnly="true"/> decimalPrecision="2" prompt="分数" readOnly="true" style="font-weight:bold"/>
</a:vBox> </a:vBox>
<a:vBox labelSeparator=" " labelWidth="100"> <a:vBox labelSeparator=" " labelWidth="100">
<a:textField name="template_name" bindTarget="fnd714_sc_score_head_query_ds" prompt="FND714.SCORE_TEMPLATE_NAME" readOnly="true"/> <!-- <a:textField name="template_name" bindTarget="fnd714_sc_score_head_query_ds"-->
<a:datePicker name="score_date" bindTarget="fnd714_sc_score_head_query_ds" prompt="FND714.SCORE_DATE" readOnly="true" renderer="Leaf.formatDate"/> <!-- prompt="FND714.SCORE_TEMPLATE_NAME" readOnly="true"/>-->
<a:datePicker name="score_date" bindTarget="fnd714_sc_score_head_query_ds"
prompt="FND714.SCORE_DATE" readOnly="true" renderer="Leaf.formatDate"/>
</a:vBox> </a:vBox>
<!-- <a:vBox labelSeparator=" " labelWidth="100">-->
<!-- <a:textField name="last_update_name" bindTarget="fnd714_sc_score_head_query_ds"-->
<!-- prompt="FND714.LAST_UPDATE_NAME" readOnly="true"/>-->
<!-- </a:vBox>-->
<a:vBox labelSeparator=" " labelWidth="100"> <a:vBox labelSeparator=" " labelWidth="100">
<a:textField name="last_update_name" bindTarget="fnd714_sc_score_head_query_ds" prompt="FND714.LAST_UPDATE_NAME" readOnly="true"/> <a:textField name="object_name" bindTarget="fnd714_sc_score_head_query_ds" prompt="评分对象"
readOnly="true"/>
</a:vBox> </a:vBox>
</a:hBox> </a:hBox>
<a:treeGrid id="fnd714_sc_score_result_dtl_grid" bindTarget="fnd714_sc_score_result_dtl_ds" expandField="expand_flag" idField="tree_id_feild" marginHeight="180" marginWidth="30" navBar="false" parentField="tree_parent_field" sequenceField="score_target_code"> <a:treeGrid id="fnd714_sc_score_result_dtl_grid" bindTarget="fnd714_sc_score_result_dtl_ds"
expandField="expand_flag" idField="tree_id_feild" marginHeight="180" marginWidth="30"
navBar="false" parentField="tree_parent_field" sequenceField="score_target_code">
<a:columns> <a:columns>
<a:column name="score_target_name" prompt="FND714.SCORE_TARGET_NAME" width="250"/> <a:column name="score_target_name" prompt="FND714.SCORE_TARGET_NAME" width="250"/>
<!-- <a:column name="target_value" prompt="指标值" width="150"/> --> <!-- <a:column name="target_value" prompt="指标值" width="150"/> -->
<a:column name="target_value_desc" prompt="指标值" width="250"/> <a:column name="target_value_desc" prompt="指标值" width="250"/>
<!-- <a:column name="score_value" prompt="权重" renderer="fnd714_sc_score_result_dtl_render_score_value" width="80"/> --> <!-- <a:column name="score_value" prompt="权重" renderer="fnd714_sc_score_result_dtl_render_score_value" width="80"/> -->
<!-- <a:column name="target_score" editorFunction="fnd714_sc_score_result_dtl_grid_editorFunc" prompt="FND714.TARGET_SCORE" renderer="fnd714_sc_score_result_dtl_render_target_score"/> --> <!-- <a:column name="target_score" editorFunction="fnd714_sc_score_result_dtl_grid_editorFunc" prompt="FND714.TARGET_SCORE" renderer="fnd714_sc_score_result_dtl_render_target_score"/> -->
<a:column name="target_score" prompt="得分" align="right" renderer="fnd714_sc_score_result_dtl_render_target_score" width="80"/> <a:column name="target_score" prompt="得分" align="right"
renderer="fnd714_sc_score_result_dtl_render_target_score" width="80"/>
<a:placeHolder id="fnd714_dynamicColumns"/> <a:placeHolder id="fnd714_dynamicColumns"/>
<a:column name="target_score_sum" prompt="小计" renderer="fnd714_sc_score_result_dtl_render_target_score_sum" width="80"/> <a:column name="target_score_sum" prompt="小计"
renderer="fnd714_sc_score_result_dtl_render_target_score_sum" width="80"/>
</a:columns> </a:columns>
<a:editors> <a:editors>
<a:numberField id="fnd714_sc_score_result_dtl_grid_nf"/> <a:numberField id="fnd714_sc_score_result_dtl_grid_nf"/>
...@@ -315,7 +341,8 @@ ...@@ -315,7 +341,8 @@
<c:create-config targetId="fnd714_dynamicColumns"> <c:create-config targetId="fnd714_dynamicColumns">
<p:loop source="/model/fnd714_sc_score_result_grade_from_to_path"> <p:loop source="/model/fnd714_sc_score_result_grade_from_to_path">
<c:process-config> <c:process-config>
<a:column name="${@line_number}" align="center" prompt="${@sc_scaleplate_code}" renderer="fnd714_sc_score_result_dtl_grid_render_name" width="60"/> <a:column name="${@line_number}" align="center" prompt="${@sc_scaleplate_code}"
renderer="fnd714_sc_score_result_dtl_grid_render_name" width="60"/>
</c:process-config> </c:process-config>
</p:loop> </p:loop>
</c:create-config> </c:create-config>
......
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