acr_invoice_query.lview 4.11 KB
Newer Older
Spencer Chang's avatar
Spencer Chang committed
1 2 3 4 5 6 7 8 9 10 11
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: LR  
    $Date: 2013-7-17 下午06:22:37  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true" trace="true">
    <a:init-procedure><![CDATA[
    ]]></a:init-procedure>
    <a:view>
niminmin's avatar
niminmin committed
12
        <a:link id="acr513n_invoice_readonly_page" url="${/request/@context_path}/modules/acr/ACR512/acr_invoice_update_detail.lview"/>
Spencer Chang's avatar
Spencer Chang committed
13 14
        <a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
        <a:link id="acr_invoice_account_link" model="acr.ACR310.acr_invoice_account" modelaction="execute"/>
lijingjing's avatar
lijingjing committed
15
        <script><![CDATA[
Spencer Chang's avatar
Spencer Chang committed
16 17 18 19 20
            function open_document_win(ds_id, record_id) {
                var record = $(ds_id).findById(record_id);
                var param = record.data;
                param['function_code'] = 'ACR513';
                param['function_usage'] = 'QUERY';
niminmin's avatar
niminmin committed
21
                param['maintain_type'] = 'READONLY';
Spencer Chang's avatar
Spencer Chang committed
22
                param['url_title'] = '${l:ACR.INVOICE_DETAIL}';
niminmin's avatar
niminmin committed
23
                hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'acr513n_invoice_readonly_page', ds_id);
Spencer Chang's avatar
Spencer Chang committed
24 25 26 27 28
            }
            
            window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record) {
                if (name == 'document_number' && value) {
                    return '<a href="javascript:open_document_win(\'' + record.ds.id + '\',\'' + record.id + '\')">' + value + '</a>';
29
					}else if(name == 'invoice_file_name'){
30 31 32 33 34
                    if(record.get('invoice_file_name')){
                        var link = '${/request/@context_path}/atm_download.lsc?attachment_id=';
                        var url = '<a href=' + link + record.get('attach_id') + '>'+record.get('invoice_file_name')+'</a>';
                        return url;
                    }
Spencer Chang's avatar
Spencer Chang committed
35 36 37 38 39 40 41
                }
                return value;
            };
            
            window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
                $('ACR310_RESULT_acr_invoice_hd_layout_grid_id')._export('xls', '应收发票查询');
            };
lijingjing's avatar
lijingjing committed
42 43


Spencer Chang's avatar
Spencer Chang committed
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
            
            
            window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function() {
                var tax_type_rate = $('ACR310_QUERY__ds').getAt(0).get('tax_type_rate');
                var product_name = $('ACR310_QUERY__ds').getAt(0).get('product_name');
                var invoice_kind = $('ACR310_QUERY__ds').getAt(0).get('invoice_kind');
                var vat_interface_status = $('ACR310_QUERY__ds').getAt(0).get('vat_interface_status');
                var invoice_date_from = $('ACR310_QUERY__ds').getAt(0).get('invoice_date_from');
                var invoice_date_to = $('ACR310_QUERY__ds').getAt(0).get('invoice_date_to');	
                Leaf.request({
                url: $('acr_invoice_account_link').getUrl(),
                para: {
                    tax_type_rate: tax_type_rate,
                    product_name: product_name,
                    invoice_kind: invoice_kind,
                    vat_interface_status: vat_interface_status,
                    invoice_date_from: invoice_date_from,
                    invoice_date_to: invoice_date_to
                },
                success: function() {
                	window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                	$('ACR310_STAT_acr_invoice_hd_detail_all_ds').query();
                	$('ACR310_RESULT_acr_invoice_hd_ds').query();
                    },
                    failure: function() {
                        window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                    },
                    error: function() {
                        window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                    },
                    scope: this
                    });
            };
        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
    </a:view>
</a:screen>