bgfl_acp_invoice_ipt.lview 6.18 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 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: qianming			  
    $Date: 2015-9-4 下午3:52:21  
    $Revision: 1.0  
    $Purpose: 进项票导入
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure>
        <a:model-query defaultWhereClause="t1.function_code = &apos;ACP516&apos;" model="fnd.FND6000.bgfl_common_template_query" rootPath="template_path"/>
    </a:init-procedure>
    <a:view>
        <a:link id="bgfl_acp_invoice_ipt_upload_link_id" url="${/request/@context_path}/modules/acp/ACP516/acp_excel_import.lview"/>
        <a:link id="bgfl_acp_invoice_ipt_create_link_id" model="acp.ACP516.bgfl_acp_invoice_ipt" modelaction="execute"/>
        <a:link id="bgfl_template_download" url="${/request/@context_path}/downloadFile.lview"/>
        <script type="text/javascript"><![CDATA[
        	function bgfl_acp_invoice_ipt_upload(){
        	    new Leaf.Window({
                    id: 'bgfl_acp_invoice_ipt_upload_id',
                    url: $('bgfl_acp_invoice_ipt_upload_link_id').getUrl(),
                    title: '${l:HLS.IMPORT}',
                    width: 420,
                    height: 275
                });
        	}
        	
        	function bgfl_acp_invoice_ipt_import(){
        	    Leaf.showConfirm('提示','您确定导入?',function(){
        	        Leaf.request({
		                url: $('bgfl_acp_invoice_ipt_create_link_id').getUrl(),
		                para: {
		                    batch_id :'${/parameter/@batch_id}'
		                },
		                success: function(res) {
		    	            $('bgfl_acp_invoice_ipt_result_ds').query();
		    	            Leaf.showMessage('提示','数据导入结束,如若界面仍有数据显示,说明该数据未成功导入,请查看错误信息!');
		                },
		                failure:function(){
		                    Leaf.SideBar.show({
		    	            	msg:'数据导入失败',
		    	            	duration:2000
		    	            });
		    	            $('bgfl_acp_invoice_ipt_result_ds').query();
		                },
		                error:function(){
		                    Leaf.SideBar.show({
		    	            	msg:'数据导入错误',
		    	            	duration:2000
		    	            });
		    	            $('bgfl_acp_invoice_ipt_result_ds').query();
		                },
		                scope: this
	            	}); 
        	    });
        	}
        	function bgfl_acp_invoice_ipt_excle_download(){
        	    new Leaf.Window({
                    url: $('bgfl_template_download').getUrl(),
                    title: '${l:HLS.SUPPORTING_DOCUMENT}',
                    params: {
                        'table_name': 'BGFL_COMMON_TEMPLATE',
                        'header_id': '${/model/template_path/record/@template_id}'
                    },
                    width: 850,
                    height: 400
                });
        	}
        	Leaf.onReady(function(){
        	    if('${/parameter/@batch_id}'){
        	        $('bgfl_acp_invoice_ipt_import_btn_id').enable();
        	    }else{
        	        $('bgfl_acp_invoice_ipt_import_btn_id').disable();
        	    }
        	});
		]]></script>
        <a:dataSets>
            <a:dataSet id="bgfl_acp_invoice_ipt_result_ds" autoQuery="true" fetchAll="true" model="acp.ACP516.bgfl_acp_invoice_ipt" queryUrl="${/request/@context_path}/autocrud/acp.ACP516.bgfl_acp_invoice_ipt/query?batch_id=${/parameter/@batch_id}">
                <a:fields>
                    <a:field name="import_message" readOnly="true"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="bgfl_acp_invoice_ipt_excle_download" text="模版下载"/>
                <a:gridButton click="bgfl_acp_invoice_ipt_upload" text="上传excle"/>
                <a:gridButton id="bgfl_acp_invoice_ipt_import_btn_id" click="bgfl_acp_invoice_ipt_import" text="HLS.IMPORT"/>
            </a:screenTopToolbar>
            <a:grid id="grid_id" bindTarget="bgfl_acp_invoice_ipt_result_ds" marginHeight="100" marginWidth="35" navBar="true">
                <a:toolBar>
                    <a:button type="excel"/>
                    <a:button type="clear"/>
                </a:toolBar>
                <a:columns>
                    <a:column name="line_number" align="center" lock="true" prompt="序号" width="60"/>
                    <a:column name="invoice_code" lock="true" prompt="发票代码" width="140"/>
                    <a:column name="invoice_number" lock="true" prompt="发票号码" width="140"/>
                    <a:column name="contract_number" lock="true" prompt="合同号" width="140"/>
                    <a:column name="contract_name" lock="true" prompt="合同名称" width="160"/>
                    <a:column name="cf_item_desc" align="center" prompt="应付项目" width="80"/>
                    <a:column name="times" align="center" prompt="期数" width="60"/>
                    <a:column name="product_name_desc" prompt="发票内容" showTitle="true" width="100"/>
                    <a:column name="invoice_kind_desc" align="center" prompt="发票种类" width="100"/>
                    <a:column name="invoice_date_desc" align="center" prompt="发票日期" width="80"/>
                    <a:column name="accounting_date_desc" align="center" prompt="记账日期" width="80"/>
                    <a:column name="bp_name" prompt="销方对象" showTitle="true" width="160"/>
                    <a:column name="billing_amount" align="right" prompt="开票金额" width="120"/>
                    <a:column name="note" prompt="备注" showTitle="true" width="120"/>
                    <a:column name="import_flag" align="center" prompt="导入标志" width="60"/>
                    <a:column name="import_message" editor="textArea" prompt="错误消息" showTitle="true" width="140"/>
                    <a:column name="match_flag" align="center" prompt="匹配标志" width="60"/>
                </a:columns>
                <a:editors>
                    <a:textArea id="textArea_id"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>