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

[refactor] 核销校验

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