Commit de0db20c authored by 38823's avatar 38823

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

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