Commit 452318b8 authored by 高泉铭's avatar 高泉铭

[refactor] 核销校验

parent b315e283
......@@ -24,17 +24,16 @@
}
function init() {
debugger;
var record = $('csh_transaction_receipt_write_off_detail_ds').getCurrentRecord();
var deposit_ds = $('csh_transaction_deposit_ds');
var advanced_ds = $('csh_transaction_advanced_ds');
if(advanced_ds.getAll().length == 0){
if (advanced_ds.getAll().length == 0) {
}
if ('${/parameter/@depositDisplayFlag}' == 'Y') {
document.getElementById('write_off_deposit').style.display='block';
document.getElementById('write_off_deposit').style.display = 'block';
}
if ('${/parameter/@readOnly}' == 'Y') {
$('csh_grid_add_bt').setVisible(false);
......@@ -281,29 +280,36 @@
function csh531n_write_off() {
if (checkAmount('WRITE_OFF')) {
var record = $('csh_transaction_receipt_write_off_detail_ds').getCurrentRecord();
$('csh_write_off_interface_ds').submit();
$('csh_transaction_deposit_ds').submit();
$('csh_transaction_advanced_ds').submit();
if (record) {
csh531d_lock_current_window();
var transaction_id = record.get('transaction_id');
Leaf.request({
url: $('csh531n_csh_confirm_data_link').getUrl(),
para: {
transaction_id: '${/parameter/@transaction_id}',
_status: 'update'
},
success: function () {
csh531d_unlock_current_window();
csh531n_detail_win_close();
}, failure: function () {
csh531d_unlock_current_window();
},
error: function () {
csh531d_unlock_current_window();
},
scope: this
});
if(submit_flag == 'Y'){
var record = $('csh_transaction_receipt_write_off_detail_ds').getCurrentRecord();
if (record) {
csh531d_lock_current_window();
var transaction_id = record.get('transaction_id');
Leaf.request({
url: $('csh531n_csh_confirm_data_link').getUrl(),
para: {
transaction_id: '${/parameter/@transaction_id}',
_status: 'update'
},
success: function () {
csh531d_unlock_current_window();
csh531n_detail_win_close();
}, failure: function () {
csh531d_unlock_current_window();
},
error: function () {
csh531d_unlock_current_window();
},
scope: this
});
}
}
}
}
......@@ -330,10 +336,17 @@
}
}
var submit_flag = 'N';
function csh531_submitsuccess(ds) {
submit_flag = 'Y';
ds.query();
}
function csh531_submitfailed(ds){
submit_flag = 'N';
}
function compareDate(start, end) {
if (start > end) {
return false;
......@@ -530,6 +543,7 @@
<a:event name="beforesubmit" handler="csh531_beforesubmit_fun"/>
<a:event name="load" handler="csh531_load_fun"/>
<a:event name="submitsuccess" handler="csh531_submitsuccess"/>
<a:event name="submitfailed" handler="csh531_submitfailed"/>
<a:event name="add" handler="csh531_add_fun"/>
</a:events>
</a:dataSet>
......@@ -551,7 +565,7 @@
<a:field name="transaction_id" defaultValue="${/parameter/@transaction_id}"/>
<a:field name="write_off_type" defaultValue="RECEIPT_DEPOSIT_POOL"/>
<a:field name="company_id" defaultValue="${/session/@company_id}"/>
<a:field name="write_off_amount" required="true"/>
<a:field name="write_off_amount"/>
<a:field name="write_off_date" validator="write_off_date_validator" required="true" readOnly="true"
defaultValue="${/parameter/@transaction_date}"/>
</a:fields>
......@@ -561,7 +575,8 @@
queryUrl="${/request/@context_path}/autocrud/csh.CSH531N.csh_transaction_plan_query/query?transaction_id=${/parameter/@transaction_id}&amp;write_off_type=RECEIPT_ADVANCE_RECEIPT"
selectable="true">
<a:fields>
<a:field name="bp_name" readOnly="true" autoComplete="true" lovGridHeight="350" lovHeight="550" lovLabelWidth="50"
<a:field name="bp_name" readOnly="true" autoComplete="true" lovGridHeight="350" lovHeight="550"
lovLabelWidth="50"
lovWidth="550"
required="true"
lovService="basic.hls_bp_master_v_for_lov?bp_id=${/parameter/@bp_id}" title="HLS.BP_TITLE">
......@@ -574,7 +589,7 @@
<a:field name="transaction_id" defaultValue="${/parameter/@transaction_id}"/>
<a:field name="write_off_type" defaultValue="RECEIPT_ADVANCE_RECEIPT"/>
<a:field name="company_id" defaultValue="${/session/@company_id}"/>
<a:field name="write_off_amount" required="true"/>
<a:field name="write_off_amount"/>
<a:field name="write_off_date" validator="write_off_date_validator" required="true" readOnly="true"
defaultValue="${/parameter/@transaction_date}"/>
</a:fields>
......@@ -757,7 +772,7 @@
</a:editors>
</a:grid>
</a:tab>
<a:tab id="write_off_advance" prompt="核销为预收款" width="150" >
<a:tab id="write_off_advance" prompt="核销为预收款" width="150">
<a:grid id="csh_transaction_advanced_grid" navBar="true"
bindTarget="csh_transaction_advanced_ds" height="370"
marginWidth="10">
......
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