ccb_manual_transaction_create.lview 4.47 KB
Newer Older
Spencer Chang's avatar
Spencer Chang committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: xuls  
    $Date: 2016-12-10 下午2:49:46  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true">
    <a:init-procedure/>
    <a:view>
        <a:link id="ccb501_reverse_link" model="ccb.ccb502.reverse_manual_ccb_doc" modelaction="batch_update"/>
        <a:link id="ccb501_create_transaction_link" url="${/request/@context_path}/modules/ccb/ccb502/ccb_manual_transaction_create.lsc"/>
        <script type="text/javascript"><![CDATA[
        window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
            var param = {};
            var saveData = [];
            var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_ebank_ccb_document');
            var document_ds = $(ds_id);
            var records = document_ds.getSelected();
            if (records.length == 0) {
                Leaf.showMessage('${l:PROMPT}', '请选择要发送银行交易的代扣单');
                return;
            }
            Leaf.showConfirm('${l:PROMPT}', '是否确定发送银行交易?', function() {
                var detail_mask = Ext.getBody();
                Leaf.Masker.mask(detail_mask, '${l:HLS.EXECUTING}');
                for (var i = 0;i < records.length;i++) {

                    var record = records[i];
                    saveData.push({
                        'manual_rec_amount': record.get('receivable_amount'),
                        'document_id': record.get('document_id'),
                        '_status': 'insert'
                    });
                }
                param['details'] = saveData;
                Leaf.request({
                    url: $('ccb501_create_transaction_link').getUrl(),
                    para: param,
                    success: function() {
                        Leaf.SideBar.show({
                            msg: '${l:HLS.SUBMIT_SUCCESS}',
                            duration: 2000
                        });
                        document_ds.query(document_ds.currentPage);
                        Leaf.Masker.unmask(detail_mask);
                    },
                    failure: function() {
                        Leaf.Masker.unmask(detail_mask);
                    },
                    error: function() {
                        Leaf.Masker.unmask(detail_mask);
                    },
                    scope: this
                });
            });
        
        };
        window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function() {
            var saveData = [];
            var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_ebank_ccb_document');
            var document_ds = $(ds_id);
            var records = document_ds.getSelected();
            if (records.length == 0) {
                Leaf.showMessage('${l:PROMPT}', '请选择要反冲的代扣单');
                return;
            }
            Leaf.showConfirm('${l:PROMPT}', '是否确认要反冲选中代扣单?', function() {
                var detail_mask = Ext.getBody();
                Leaf.Masker.mask(detail_mask, '${l:HLS.EXECUTING}');
                for (var i = 0;i < records.length;i++) {
                    var record = records[i];
                    saveData.push({
                        'document_id': record.get('document_id'),
                        '_status': 'update'
                    });
                }
                Leaf.request({
                    url: $('ccb501_reverse_link').getUrl(),
                    para: saveData,
                    success: function() {
                        Leaf.SideBar.show({
                            msg: '${l:HLS.SUBMIT_SUCCESS}',
                            duration: 2000
                        });
                        document_ds.query(document_ds.currentPage);
                        Leaf.Masker.unmask(detail_mask);
                    },
                    failure: function() {
                        Leaf.Masker.unmask(detail_mask);
                    },
                    error: function() {
                        Leaf.Masker.unmask(detail_mask);
                    },
                    scope: this
                });
            });
        
        };
    ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
    </a:view>
</a:screen>