Commit de0db20c authored by 38823's avatar 38823

茂甲控制保证金校验自定义保存方法

parent 1a2b38d2
...@@ -20,7 +20,8 @@ ...@@ -20,7 +20,8 @@
p_sql_type => 'INSERT', p_sql_type => 'INSERT',
p_user_id =>${/session/@user_id}, p_user_id =>${/session/@user_id},
p_margin_check_id => ${@margin_check_id}, p_margin_check_id => ${@margin_check_id},
p_mar_after_status => ${@mar_after_status} p_mar_after_status => ${@mar_after_status},
p_mar_before_status =>${@mar_before_status}
); );
end; end;
]]></bm:update-sql> ]]></bm:update-sql>
......
...@@ -7,28 +7,40 @@ ...@@ -7,28 +7,40 @@
<a:view> <a:view>
<a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/> <a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<a:link id="${/parameter/@layout_code}_csh531_margin_check_submit_link_id" model="csh.CSH531F.csh_transaction_recoi_check_wfl" modelaction="execute"/> <a:link id="${/parameter/@layout_code}_csh531_margin_check_submit_link_id" model="csh.CSH531F.csh_transaction_recoi_check_wfl" modelaction="execute"/>
<a:link id="${/parameter/@layout_code}_csh531_margin_check_save_link_id" model="csh.CSH531F.csh_transaction_recoi_check_wfl" modelaction="insert"/>
<script type="text/javascript"><![CDATA[ <script type="text/javascript"><![CDATA[
$L.onReady(function () { $L.onReady(function () {
if("${/parameter/@function_usage}" == 'QUERY' && document.getElementById('${/parameter/@layout_code}_user_button1') && document.getElementById('${/parameter/@layout_code}_save')){ if("${/parameter/@function_usage}" == 'QUERY'){
if(document.getElementById('${/parameter/@layout_code}_user_button1')){
$jq('#${/parameter/@layout_code}_user_button1').hide(); $jq('#${/parameter/@layout_code}_user_button1').hide();
}
if(document.getElementById('${/parameter/@layout_code}_save')){
$jq('#${/parameter/@layout_code}_save').hide(); $jq('#${/parameter/@layout_code}_save').hide();
}
var marginCheckId="${/parameter/@MARGIN_CHECK_ID}"; var marginCheckId="${/parameter/@MARGIN_CHECK_ID}";
var ds_query_id= 'MARGIN_CHECK_F_QUERY_csh_margin_check_ds'; var ds_query_id= 'MARGIN_CHECK_F_QUERY_csh_margin_check_ds';
var ds_result_id= 'MARGIN_CHECK_F_RESULT_csh_margin_check_ds'; var ds_result_id= 'MARGIN_CHECK_F_RESULT_csh_margin_check_ds';
if($(ds_query_id)){
$(ds_query_id).setQueryParameter('margin_check_id',marginCheckId); $(ds_query_id).setQueryParameter('margin_check_id',marginCheckId);
$(ds_query_id).query(); $(ds_query_id).query();
}
if($(ds_result_id)){
$(ds_result_id).setQueryParameter('margin_check_id',marginCheckId); $(ds_result_id).setQueryParameter('margin_check_id',marginCheckId);
$(ds_result_id).query(); $(ds_result_id).query();
} }
}else{
var ds_result_id= 'MARGIN_CHECK_F_RESULT_csh_margin_check_ds';
if($(ds_result_id)){
$(ds_result_id).query();
}
}
var ds_id= 'MARGIN_CHECK_F_QUERY_csh_margin_check_ds'; var ds_id= 'MARGIN_CHECK_F_QUERY_csh_margin_check_ds';
var record= $(ds_id).getCurrentRecord(); var record= $(ds_id).getCurrentRecord();
if(Ext.isEmpty('${/model/wfl_status/record/@mar_status}')){ if(Ext.isEmpty('${/model/wfl_status/record/@mar_status}')){
record.set('mar_before_status','Y'); record.set('mar_before_status','Y');
record.set('mar_before_status_n','打开'); record.set('mar_before_status_n','打开');
} }else {
if(!Ext.isEmpty('${/model/wfl_status/record/@mar_status}')){
record.set('mar_before_status','${/model/wfl_status/record/@mar_status}'); record.set('mar_before_status','${/model/wfl_status/record/@mar_status}');
record.set('mar_before_status_n','${/model/wfl_status/record/@mar_after_status_n}'); record.set('mar_before_status_n','${/model/wfl_status/record/@mar_after_status_n}');
} }
...@@ -41,12 +53,8 @@ ...@@ -41,12 +53,8 @@
var record= $(ds_id).getSelected()[0]; var record= $(ds_id).getSelected()[0];
var marginId=record.get('margin_check_id'); var marginId=record.get('margin_check_id');
var wflStatus=record.get('wflStatus'); var wflStatus=record.get('wflStatus');
if(wflStatus == 'APPROVING'){ if(wflStatus == 'APPROVING' || wflStatus == 'APPROVED'){
Leaf.showErrorMessage('提示', '必须审批通过后才可以再提交审批'); Leaf.showErrorMessage('提示', '只有新建的单据才可以提交审批');
return false;
}
if(wflStatus == 'APPROVED'){
Leaf.showErrorMessage('提示','已经审批通过的单据不能重复提交');
return false; return false;
} }
Leaf.showConfirm('${l:HLS.PROMPT}', '${l:HLS.ARE_YOU_SURE_TO_SUBMIT}', function() { Leaf.showConfirm('${l:HLS.PROMPT}', '${l:HLS.ARE_YOU_SURE_TO_SUBMIT}', function() {
...@@ -75,50 +83,50 @@ ...@@ -75,50 +83,50 @@
}); });
} }
//自定义保存
//保存前调用 window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function() {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function(ds, record) { var ds_id = 'MARGIN_CHECK_F_QUERY_csh_margin_check_ds';
var check_flag=true; var ds_result_id = 'MARGIN_CHECK_F_RESULT_csh_margin_check_ds';
var record=$(ds_id).getCurrentRecord();
window['${/parameter/@layout_code}_lock_layout_dynamic_window'](); var params = record.data;
var ds_id='MARGIN_CHECK_F_RESULT_csh_margin_check_ds'; var marAfterStatus= params.mar_after_status;
var ds_query_id = 'MARGIN_CHECK_F_QUERY_csh_margin_check_ds'; if (marAfterStatus == '${/model/wfl_status/record/@mar_status}') {
if(ds.id == ds_query_id){ Leaf.showErrorMessage('提示', '修改前的状态和修改后的状态不能一样');
var marAfterStatus= $(ds_query_id).getCurrentRecord().get('mar_after_status');
if(check_flag == true){
if(marAfterStatus == '${/model/wfl_status/record/@mar_status}'){
Leaf.showErrorMessage('提示','修改前的状态和修改后的状态不能一样');
check_flag = false;
return false; return false;
} }
} if($(ds_result_id)){
} var record=$(ds_result_id).getAll();
if (record.length != 1) {
if(ds.id == ds_id){ for (var i = 0; i < record.length; i++) {
var record=$(ds_id).getAll(); if (record[i].get('wfl_status') == 'NEW' || record[i].get('wfl_status') == 'APPROVING') {
if(check_flag == true){
for(var i=0;i<record.length;i++){
if(record[i].get('wfl_status')=='NEW' || record[i].get('wfl_status')=='APPROVING'){
Leaf.showErrorMessage('提示', '必须审批通过后才可以新建'); Leaf.showErrorMessage('提示', '必须审批通过后才可以新建');
check_flag =false;
return false; return false;
} }
} }
} }
$(ds_id).query();
}
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
} }
Leaf.request({
// 保存submitsuccess调用 url: $('${/parameter/@layout_code}_csh531_margin_check_save_link_id').getUrl(),
window['${/parameter/@layout_code}_on_layout_dynamic_submitsuccess'] = function(ds, record, res) { para: params,
window['${/parameter/@layout_code}_lock_layout_dynamic_window'](); success: function(res) {
var ds_id='MARGIN_CHECK_F_RESULT_csh_margin_check_ds'; window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
if(ds.id==ds_id){ Leaf.SideBar.show({
msg: '操作成功',
duration: 200
});
var ds_result_id = 'MARGIN_CHECK_F_RESULT_csh_margin_check_ds';
$(ds_result_id).query();
},
failure: function() {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function() {
window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
scope: this
});
$(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"/>
......
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