Commit f53805b2 authored by 王炜's avatar 王炜

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

parent c4859929
......@@ -463,6 +463,8 @@
var count = 0;
var item_count = 0;
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 prj_project_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project');
var prj_record = $(prj_project_ds_id).getAt(0);
......@@ -479,9 +481,13 @@
if(project_lease_item_id.length<1 && item_count == 0){
$L.showErrorMessage('提示', '租赁物信息不能为空!');
item_count = item_count+1;
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_save').enable();
return false;
}else if(project_lease_item_id.length<1 && item_count != 0){
item_count = 0;
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_save').enable();
return false;
}
var machine_number = lease_item_record.get('machine_number_70');
......@@ -493,6 +499,8 @@
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) {
Leaf.showMessage('${l:HLS.PROMPT}', '扣款限额应大于0');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_save').enable();
return false;
}
if (record.get('signing_city')){
......@@ -556,12 +564,14 @@
}
}
if(!bp_rate_flag){
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_save').enable();
return false;
}
if (prj_record.get('project_number')) {
return true;
}
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({
url: $('get_special_fields_link_id').getUrl(),
para: {
......@@ -593,6 +603,10 @@
sync: true,
scope: this
});
if(!check_flag){
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_save').enable();
}
return check_flag;
};
......@@ -690,6 +704,13 @@
$(tenant_ds_id).setQueryUrl(url);
$(tenant_ds_id).query();
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)
......
......@@ -384,6 +384,8 @@
var count = 0;
var item_count = 0;
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 prj_project_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project');
var prj_record = $(prj_project_ds_id).getAt(0);
......@@ -400,9 +402,13 @@
if(project_lease_item_id.length<1 && item_count == 0){
$L.showErrorMessage('提示', '租赁物信息不能为空!');
item_count = item_count+1;
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_save').enable();
return false;
}else if(project_lease_item_id.length<1 && item_count != 0){
item_count = 0;
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_save').enable();
return false;
}
var machine_number = lease_item_record.get('machine_number_70');
......@@ -416,6 +422,8 @@
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) {
Leaf.showMessage('${l:HLS.PROMPT}', '扣款限额应大于0');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_save').enable();
return false;
}
if (record.get('signing_city')){
......@@ -463,12 +471,14 @@
}
}
if(!bp_rate_flag){
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_save').enable();
return false;
}
if (prj_record.get('project_number')) {
return true;
}
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({
url: $('get_special_fields_link_id').getUrl(),
para: {
......@@ -500,6 +510,10 @@
sync: true,
scope: this
});
if(!check_flag){
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_save').enable();
}
return check_flag;
};
......@@ -597,6 +611,13 @@
$(tenant_ds_id).setQueryUrl(url);
$(tenant_ds_id).query();
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)
......
......@@ -319,7 +319,8 @@
var count = 0;
var item_count = 0;
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 prj_project_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project');
var prj_record = $(prj_project_ds_id).getAt(0);
......@@ -335,10 +336,14 @@
var project_lease_item_id = $(lease_item_ds_id).getAll();
if(project_lease_item_id.length<1 && item_count == 0){
$L.showErrorMessage('提示', '租赁物信息不能为空!');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_save').enable();
item_count = item_count+1;
return false;
}else if(project_lease_item_id.length<1 && item_count != 0){
item_count = 0;
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_save').enable();
return false;
}
var project_id = project_record.get('project_id');
......@@ -348,6 +353,8 @@
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) {
Leaf.showMessage('${l:HLS.PROMPT}', '扣款限额应大于0');
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_save').enable();
return false;
}
if (record.get('signing_city')){
......@@ -360,7 +367,6 @@
if (prj_record.get('project_number')) {
return true;
}
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({
url: $('get_special_fields_prj_link_id').getUrl(),
para: {
......@@ -392,6 +398,11 @@
sync: true,
scope: this
});
if(!check_flag){
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
$('${/parameter/@layout_code}_save').enable();
}
return check_flag;
};
......@@ -482,6 +493,13 @@
$(tenant_ds_id).setQueryUrl(url);
$(tenant_ds_id).query();
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)
......
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