Commit 24218c44 authored by Darming's avatar Darming

[feat]BP评分校验

parent 819e2e32
Pipeline #4692 canceled with stages
window['${/parameter/@bp_seq}${/parameter/@layout_code}_SAVE_LAYOUT_DYNAMIC_CLICK']=function(nextStep){
window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
var root_ds=$('${/parameter/@bp_seq}${/parameter/@layout_code}_virtual_ds');
window['${/parameter/@layout_code}_ignore_required_before_save']();
if (root_ds.validate()) {
var winid = '${/parameter/@winid}';
var root_record = root_ds.getCurrentRecord();
root_ds.setSubmitParameter('layout_code', '${/parameter/@layout_code}');
function ON_LAYOUT_DYNAMIC_BEFORE_SAVE(){
root_ds.un('beforesubmit',ON_LAYOUT_DYNAMIC_BEFORE_SAVE);
var flag = false;
for (var name in root_record.data) {
if (root_record.data[name].data[0].ds && root_record.data[name].data[0].ds instanceof $L.DataSet) {
var current_record = root_record.data[name].data[0].ds.getCurrentRecord();
flag = window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_before_submit'](root_record.data[name].data[0].ds, current_record);
}
}
if(!flag){
UN_SUBMIT_REF_FUNCTION();
}
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
return flag;
}
function UN_SUBMIT_REF_FUNCTION(){
root_ds.un('submitsuccess', ON_LAYOUT_DYNAMIC_INNER_SUBMITSUCCESS);
root_ds.un('submitfailed', ON_LAYOUT_DYNAMIC_INNER_SUBMITFAILED);
root_ds.un('submiterror', ON_LAYOUT_DYNAMIC_INNER_SUBMITERROR);
}
function ON_LAYOUT_DYNAMIC_INNER_SUBMITSUCCESS(ds, res) {
UN_SUBMIT_REF_FUNCTION();
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_submitsuccess'](ds,root_record,res);
if (typeof(nextStep) == 'function') {
nextStep(ds);
}
}
function ON_LAYOUT_DYNAMIC_INNER_SUBMITFAILED(){
UN_SUBMIT_REF_FUNCTION();
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
}
function ON_LAYOUT_DYNAMIC_INNER_SUBMITERROR(){
UN_SUBMIT_REF_FUNCTION();
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
}
root_ds.on('beforesubmit',ON_LAYOUT_DYNAMIC_BEFORE_SAVE);
root_ds.on('submitsuccess', ON_LAYOUT_DYNAMIC_INNER_SUBMITSUCCESS);
root_ds.on('submitfailed', ON_LAYOUT_DYNAMIC_INNER_SUBMITFAILED);
root_ds.on('submiterror', ON_LAYOUT_DYNAMIC_INNER_SUBMITERROR);
root_ds.submit();
}else{
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
}
};
\ No newline at end of file
...@@ -308,8 +308,7 @@ ...@@ -308,8 +308,7 @@
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}');
} }
var bp_rate_flag;
/*保存前调用,生成项目编号*/ /*保存前调用,生成项目编号*/
window['${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function (ds, record) { window['${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function (ds, record) {
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');
...@@ -320,7 +319,25 @@ ...@@ -320,7 +319,25 @@
var lease_item_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project_lease_item'); 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 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') {
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')) { if (prj_record.get('project_number')) {
return true; return true;
} }
...@@ -401,7 +418,6 @@ ...@@ -401,7 +418,6 @@
} }
}; };
//保存submitsuccess调用 //保存submitsuccess调用
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']();
......
...@@ -927,7 +927,34 @@ ...@@ -927,7 +927,34 @@
} }
} };
var bp_rate_flag;
/*保存前调用,生成项目编号*/
window['${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function (ds, record) {
var prj_project_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project');
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') {
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;
}
return true;
};
]]></script> ]]></script>
......
...@@ -289,6 +289,33 @@ ...@@ -289,6 +289,33 @@
} }
}; };
var bp_rate_flag;
/*保存前调用,生成项目编号*/
window['${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function (ds, record) {
var prj_project_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project');
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') {
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;
}
return true;
};
function prj501n_upload_file(id, name, query_only) { function prj501n_upload_file(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];
......
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