Commit fc912c68 authored by 王炜's avatar 王炜

修复报单页面重复提交问题

parent 459ced2e
...@@ -460,6 +460,8 @@ ...@@ -460,6 +460,8 @@
var count = 0; var count = 0;
var item_count = 0; var item_count = 0;
window['${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function (ds, record) { window['${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function (ds, record) {
$('${/parameter/@layout_code}_save').disable();
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
var check_flag = true; var check_flag = true;
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_record = $(prj_project_ds_id).getAt(0); var prj_record = $(prj_project_ds_id).getAt(0);
...@@ -476,9 +478,13 @@ ...@@ -476,9 +478,13 @@
if(project_lease_item_id.length<1 && item_count == 0){ if(project_lease_item_id.length<1 && item_count == 0){
$L.showErrorMessage('提示', '租赁物信息不能为空!'); $L.showErrorMessage('提示', '租赁物信息不能为空!');
item_count = item_count+1; item_count = item_count+1;
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_save').enable();
return false; return false;
}else if(project_lease_item_id.length<1 && item_count != 0){ }else if(project_lease_item_id.length<1 && item_count != 0){
item_count = 0; item_count = 0;
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_save').enable();
return false; return false;
} }
var machine_number = lease_item_record.get('machine_number_70'); var machine_number = lease_item_record.get('machine_number_70');
...@@ -532,6 +538,8 @@ ...@@ -532,6 +538,8 @@
if (prj_project_ds_id == ds.id && prj_project_ds_id) { if (prj_project_ds_id == ds.id && prj_project_ds_id) {
if ((record.get('pay_method') == 'CCB_THREE'||record.get('pay_method') == 'CCB_TWO') && record.get('deduction_limit') <=0) { if ((record.get('pay_method') == 'CCB_THREE'||record.get('pay_method') == 'CCB_TWO') && record.get('deduction_limit') <=0) {
Leaf.showMessage('${l:HLS.PROMPT}', '扣款限额应大于0'); Leaf.showMessage('${l:HLS.PROMPT}', '扣款限额应大于0');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_save').enable();
return false; return false;
} }
if (record.get('signing_city')){ if (record.get('signing_city')){
...@@ -584,12 +592,14 @@ ...@@ -584,12 +592,14 @@
} }
} }
if(!bp_rate_flag){ if(!bp_rate_flag){
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_save').enable();
return false; return false;
} }
if (prj_record.get('project_number')) { if (prj_record.get('project_number')) {
return true; return true;
} }
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({ Leaf.request({
url: $('get_special_fields_link_id').getUrl(), url: $('get_special_fields_link_id').getUrl(),
para: { para: {
...@@ -621,6 +631,10 @@ ...@@ -621,6 +631,10 @@
sync: true, sync: true,
scope: this scope: this
}); });
if(!check_flag){
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_save').enable();
}
return check_flag; return check_flag;
}; };
...@@ -718,6 +732,13 @@ ...@@ -718,6 +732,13 @@
$(tenant_ds_id).setQueryUrl(url); $(tenant_ds_id).setQueryUrl(url);
$(tenant_ds_id).query(); $(tenant_ds_id).query();
window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_save').enable();
};
//保存失败调用
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_submitfailed'] = function(ds) {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_save').enable();
}; };
//查询时调用(form,fieldboxcolumn) //查询时调用(form,fieldboxcolumn)
......
...@@ -384,6 +384,8 @@ ...@@ -384,6 +384,8 @@
var count = 0; var count = 0;
var item_count = 0; var item_count = 0;
window['${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function (ds, record) { window['${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function (ds, record) {
$('${/parameter/@layout_code}_save').disable();
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
var check_flag = true; var check_flag = true;
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_record = $(prj_project_ds_id).getAt(0); var prj_record = $(prj_project_ds_id).getAt(0);
...@@ -400,9 +402,13 @@ ...@@ -400,9 +402,13 @@
if(project_lease_item_id.length<1 && item_count == 0){ if(project_lease_item_id.length<1 && item_count == 0){
$L.showErrorMessage('提示', '租赁物信息不能为空!'); $L.showErrorMessage('提示', '租赁物信息不能为空!');
item_count = item_count+1; item_count = item_count+1;
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_save').enable();
return false; return false;
}else if(project_lease_item_id.length<1 && item_count != 0){ }else if(project_lease_item_id.length<1 && item_count != 0){
item_count = 0; item_count = 0;
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_save').enable();
return false; return false;
} }
var machine_number = lease_item_record.get('machine_number_70'); var machine_number = lease_item_record.get('machine_number_70');
...@@ -445,6 +451,8 @@ ...@@ -445,6 +451,8 @@
if (prj_project_ds_id == ds.id && prj_project_ds_id) { if (prj_project_ds_id == ds.id && prj_project_ds_id) {
if ((record.get('pay_method') == 'CCB_THREE'||record.get('pay_method') == 'CCB_TWO') && record.get('deduction_limit') <=0) { if ((record.get('pay_method') == 'CCB_THREE'||record.get('pay_method') == 'CCB_TWO') && record.get('deduction_limit') <=0) {
Leaf.showMessage('${l:HLS.PROMPT}', '扣款限额应大于0'); Leaf.showMessage('${l:HLS.PROMPT}', '扣款限额应大于0');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_save').enable();
return false; return false;
} }
if (record.get('signing_city')){ if (record.get('signing_city')){
...@@ -492,12 +500,14 @@ ...@@ -492,12 +500,14 @@
} }
} }
if(!bp_rate_flag){ if(!bp_rate_flag){
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_save').enable();
return false; return false;
} }
if (prj_record.get('project_number')) { if (prj_record.get('project_number')) {
return true; return true;
} }
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({ Leaf.request({
url: $('get_special_fields_link_id').getUrl(), url: $('get_special_fields_link_id').getUrl(),
para: { para: {
...@@ -529,6 +539,10 @@ ...@@ -529,6 +539,10 @@
sync: true, sync: true,
scope: this scope: this
}); });
if(!check_flag){
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_save').enable();
}
return check_flag; return check_flag;
}; };
...@@ -626,6 +640,13 @@ ...@@ -626,6 +640,13 @@
$(tenant_ds_id).setQueryUrl(url); $(tenant_ds_id).setQueryUrl(url);
$(tenant_ds_id).query(); $(tenant_ds_id).query();
window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_save').enable();
};
//保存失败调用
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_submitfailed'] = function(ds) {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_save').enable();
}; };
//查询时调用(form,fieldboxcolumn) //查询时调用(form,fieldboxcolumn)
......
...@@ -319,7 +319,8 @@ ...@@ -319,7 +319,8 @@
var count = 0; var count = 0;
var item_count = 0; var item_count = 0;
window['${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function (ds, record) { window['${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function (ds, record) {
debugger; $('${/parameter/@layout_code}_save').disable();
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
var check_flag = true; var check_flag = true;
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_record = $(prj_project_ds_id).getAt(0); var prj_record = $(prj_project_ds_id).getAt(0);
...@@ -335,10 +336,14 @@ ...@@ -335,10 +336,14 @@
var project_lease_item_id = $(lease_item_ds_id).getAll(); var project_lease_item_id = $(lease_item_ds_id).getAll();
if(project_lease_item_id.length<1 && item_count == 0){ if(project_lease_item_id.length<1 && item_count == 0){
$L.showErrorMessage('提示', '租赁物信息不能为空!'); $L.showErrorMessage('提示', '租赁物信息不能为空!');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_save').enable();
item_count = item_count+1; item_count = item_count+1;
return false; return false;
}else if(project_lease_item_id.length<1 && item_count != 0){ }else if(project_lease_item_id.length<1 && item_count != 0){
item_count = 0; item_count = 0;
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_save').enable();
return false; return false;
} }
var project_id = project_record.get('project_id'); var project_id = project_record.get('project_id');
...@@ -348,6 +353,8 @@ ...@@ -348,6 +353,8 @@
if (prj_project_ds_id == ds.id && prj_project_ds_id) { if (prj_project_ds_id == ds.id && prj_project_ds_id) {
if ((record.get('pay_method') == 'CCB_THREE'||record.get('pay_method') == 'CCB_TWO') && record.get('deduction_limit') <=0) { if ((record.get('pay_method') == 'CCB_THREE'||record.get('pay_method') == 'CCB_TWO') && record.get('deduction_limit') <=0) {
Leaf.showMessage('${l:HLS.PROMPT}', '扣款限额应大于0'); Leaf.showMessage('${l:HLS.PROMPT}', '扣款限额应大于0');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_save').enable();
return false; return false;
} }
if (record.get('signing_city')){ if (record.get('signing_city')){
...@@ -360,7 +367,6 @@ ...@@ -360,7 +367,6 @@
if (prj_record.get('project_number')) { if (prj_record.get('project_number')) {
return true; return true;
} }
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({ Leaf.request({
url: $('get_special_fields_prj_link_id').getUrl(), url: $('get_special_fields_prj_link_id').getUrl(),
para: { para: {
...@@ -392,6 +398,11 @@ ...@@ -392,6 +398,11 @@
sync: true, sync: true,
scope: this scope: this
}); });
if(!check_flag){
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_save').enable();
}
return check_flag; return check_flag;
}; };
...@@ -482,6 +493,13 @@ ...@@ -482,6 +493,13 @@
$(tenant_ds_id).setQueryUrl(url); $(tenant_ds_id).setQueryUrl(url);
$(tenant_ds_id).query(); $(tenant_ds_id).query();
window['${/parameter/@layout_code}_unlock_layout_dynamic_window'](); window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_save').enable();
};
//保存失败调用
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_submitfailed'] = function(ds) {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_save').enable();
}; };
//查询时调用(form,fieldboxcolumn) //查询时调用(form,fieldboxcolumn)
......
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