gld_journal_query.lview 11.6 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 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: MUMU  
    $Date: 2013-09-13 下午5:01:56  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
    <a:init-procedure>
        <a:model-query defaultWhereClause="(document_category = &apos;GLD_JE&apos; and enabled_flag = &apos;Y&apos;)" fetchAll="true" model="gld.GLD531.hls_document_type_combo" queryOrderBy="document_type desc" rootPath="gld_531_category_code_list"/>
    </a:init-procedure>
    <a:view>
        <a:link id="gld531_journal_query_link" model="gld.GLD531.gld_journal_headers"/>
        <a:link id="gld531_journal_approved_link" model="gld.GLD531.gld_journal_approved" modelaction="update"/>
        <a:link id="gld531_journal_reject_link" model="gld.GLD531.gld_journal_reject" modelaction="update"/>
        <a:link id="gld310_journal_details_query_link" url="gld_journal_entry_query.lview"/>
        <a:link id="gld530_journal_enter_link" url="gld_journal_entry.lview"/>
        <a:link id="gld530_journal_status_link" url="${/request/@context_path}/autocrud/gld.GLD530.journal_submit/update"/>
        <script type="text/javascript"><![CDATA[
        	function gld_530_journal_query()
        	{
        		$('gld_journal_headers_result_ds').query();
        	}
        	//重置按钮
        	function gld_530_journal_reset()
        	{
        	    $('gld_journal_headers_query').reset();
        	}
        	//退出按钮
        	function gld_530_journal_exit()
        	{
        	    history.go(-1);
        	}
        	//拒绝按钮
        	function gld_530_journal_reject()
        	{
        	    //获取选中的行
        	    var records = $('gld_journal_headers_result_ds').getSelected();
        	    if(	records.length<1 ){
        	    	Leaf.showMessage('提示','请选择行!');
        	    	return;
        	    }
        	    if( !$('gld_journal_headers_result_ds').validate()){
        	    	return;
        	    }
				//batch_update 代表多条数据批次更新     如果是update--则是表示更新一条数据
				$('gld_journal_headers_result_ds').submitSelected('${/request/@context_path}/autocrud/gld.GLD531.gld_journal_reject/batch_update');
				//更新完后台数据库数据之后,重新查询相关信息
				$('gld_journal_headers_result_ds').query();
        	}
        	//审核按钮
        	function gld_530_journal_approved()
        	{
        	    //获取选中的行
        	    var records = $('gld_journal_headers_result_ds').getSelected();
        	    if(	records.length<1 ){
        	    	Leaf.showMessage('提示','请选择行!');
        	    	return;
        	    }
        	    if( !$('gld_journal_headers_result_ds').validate()){
        	    	return;
        	    }
        	    //batch_update 代表多条数据批次更新     如果是update--则是表示更新一条数据
				$('gld_journal_headers_result_ds').submitSelected('${/request/@context_path}/autocrud/gld.GLD531.gld_journal_approved/batch_update');
				//更新完后台数据库数据之后,重新查询相关信息
				$('gld_journal_headers_result_ds').query();
        	}
        	
        	function gld_530_journal_details_link(id)
        	{
        	    var url = $('gld310_journal_details_query_link').getUrl() + '?journal_header_id=' + id;
                var win = new Leaf.Window({
                     id: 'gld310_journal_num_query_window',
                     url: url,
                     title: '凭证详细查询',
                     fullScreen: true
                 });
           		win.on('close', function() {                           
                                $('gld_journal_headers_result_ds').query();
                        }); 
        	}
        	//
        	function gld_530_renderer_journal_detail_query(value,record,name)
        	{
        	    return '<a href="javascript:gld_530_journal_details_link(' + record.get('journal_header_id') + ');">' + value + '</a>';
        	}
        	
        	function gld_530_journal_add()
        	{
        	    var url=$('gld530_journal_enter_link').getUrl();
        		var win = new Leaf.Window({
                     id: 'gld530_journal_enter_window',
                     url: url,
                     title: '凭证录入',
                     fullScreen: true
                 }); 
                 win.on('close', function() {                           
                                $('gld_journal_headers_result_ds').query();
                        });   
        	}
        	
        	function gld_530_journal_submit()
        	{
        	    var length=$('gld_journal_headers_result_ds').getSelected().length;
        	    var record;
        	    var journal_header_id;
        	    var journal_num ;
        	    if(length<1)
        	    {
        	        Leaf.showMessage('提示','请选择行!');
        	    	return;
        	    }
        	    for(var i=0;i<length;i++)
        	    {
        	        record = $('gld_journal_headers_result_ds').getSelected()[i];
        	        journal_header_id = record.get('journal_header_id');
        	        journal_num = record.get('journal_num');
        	         Leaf.request({
		           	             url:$('gld530_journal_status_link').getUrl(),
		           	             para:{'journal_header_id':journal_header_id},
		           	             success:function (data)
		           	             {           	                 
		           	                 Leaf.SideBar.show({
			                            	msg: '提交成功',
			                            	duration: 2000
	                        			});
	                        		$('gld_journal_headers_result_ds').query();	
		           	             }
		           	             
		           	         });
        	    }       	   
        	}
       	 ]]></script>
        <a:dataSets>
            <a:dataSet id="gld_531_category_code_ds">
                <a:datas dataSource="/model/gld_531_category_code_list"/>
            </a:dataSet>
            <a:dataSet id="gld_status_ds" lookupCode="GLD_JE_STATUS"/>
            <a:dataSet id="gld_journal_headers_query">
                <a:fields>
                    <a:field name="journal_num"/>
                    <a:field name="category_code_desc" displayField="description" options="gld_531_category_code_ds" returnField="category_code" valueField="document_type"/>
                    <a:field name="journal_date_from"/>
                    <a:field name="journal_date_to"/>
                    <a:field name="total_amount_dr_from"/>
                    <a:field name="total_amount_dr_to"/>
                    <a:field name="period_name"/>
                    <a:field name="period_year"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="gld_journal_headers_result_ds" autoQuery="true" model="gld.GLD530.gld_journal_query" queryDataSet="gld_journal_headers_query" selectable="true">
                <a:fields>
                    <a:field name="journal_header_id"/>
                    <a:field name="journal_num" readOnly="true"/>
                    <a:field name="journal_date" readOnly="true"/>
                    <a:field name="category_code_desc" readOnly="true"/>
                    <a:field name="currency_code_desc" readOnly="true"/>
                    <a:field name="total_amount_dr" readOnly="true"/>
                    <a:field name="total_amount_cr" readOnly="true"/>
                    <a:field name="description" readOnly="true"/>
                    <a:field name="status_desc" displayField="code_value_name" options="gld_status_ds" returnField="status" valueField="code_value"/>
                    <a:field name="status" readOnly="true"/>
                    <a:field name="created_name" readOnly="true"/>
                    <a:field name="approved_name" readOnly="true"/>
                </a:fields>
                <!-- <a:events>
                    <a:event name="submitsuccess" handler="gld5020_gld_journal_audit_query_submitsuccess"/>
                    <a:event name="submitfailed" handler="gld5020_gld_journal_audit_query_submitfailed"/>
                </a:events> -->
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:toolbarButton click="gld_530_journal_exit" text="后退"/>
                <a:toolbarButton click="gld_530_journal_query" text="查询"/>
                <a:toolbarButton click="gld_530_journal_reset" text="重置"/>
                <a:toolbarButton click="gld_530_journal_submit" text="提交"/>
                <a:toolbarButton click="gld_530_journal_add" text="录入新凭证"/>
                <!-- <a:toolbarButton click="gld_531_journal_reject  " text="拒绝"/>
                <a:toolbarButton click="gld_531_journal_approved" text="审核"/> -->
            </a:screenTopToolbar>
            <a:form column="4" labelSeparator=" " labelWidth="100" marginWidth="30" title="HAP_QUERY_TITLE">
                <a:comboBox name="category_code_desc" bindTarget="gld_journal_headers_query" prompt="凭证类型"/>
                <a:textField name="journal_num" bindTarget="gld_journal_headers_query" prompt="凭证编号" typeCase="upper"/>
                <a:numberField name="total_amount_dr_from" allowFormat="true" bindTarget="gld_journal_headers_query" prompt="金额从"/>
                <a:numberField name="total_amount_dr_to" allowFormat="true" bindTarget="gld_journal_headers_query" prompt="金额至"/>
                <a:datePicker name="journal_date_from" bindTarget="gld_journal_headers_query" prompt="日期从"/>
                <a:datePicker name="journal_date_to" bindTarget="gld_journal_headers_query" prompt="至日期"/>
                <a:textField name="period_name" bindTarget="gld_journal_headers_query" prompt="会计期名称"/>
                <a:textField name="period_year" bindTarget="gld_journal_headers_query" prompt="会计期年度"/>
            </a:form>
            <a:grid id="gld_journal_headers_grid" bindTarget="gld_journal_headers_result_ds" marginHeight="265" marginWidth="30" navBar="true">
                <a:columns>
                    <a:column name="journal_num" prompt="凭证编号" renderer="gld_530_renderer_journal_detail_query" width="150"/>
                    <a:column name="period_name" align="center" prompt="期间" width="80"/>
                    <a:column name="journal_date" prompt="凭证日期" renderer="Leaf.formatDate" width="100"/>
                    <a:column name="category_code_desc" prompt="凭证类型" width="100"/>
                    <a:column name="currency_code_desc" prompt="币种" width="100"/>
                    <a:column name="total_amount_dr" align="right" prompt="借方原币金额" renderer="Leaf.formatMoney" width="100"/>
                    <a:column name="total_amount_cr" align="right" prompt="贷方原币金额" renderer="Leaf.formatMoney" width="100"/>
                    <a:column name="description" prompt="摘要" width="150"/>
                    <a:column name="status_desc" align="center" prompt="状态" width="100"/>
                    <a:column name="created_name" prompt="制单人" width="100"/>
                    <a:column name="approved_name" prompt="审核人" width="100"/>
                </a:columns>
            </a:grid>
        </a:screenBody>
        <!-- <script type="text/javascript"><![CDATA[
        	Leaf.onReady(function(){
        	    $('gld5020_journal_headers_ds').setQueryParameter('journal_header_id','${/parameter/@journal_header_id}');
        	    $('gld5020_journal_details_ds').setQueryParameter('journal_header_id','${/parameter/@journal_header_id}');
        	    $('gld5020_journal_headers_ds').query();
        	    $('gld5020_journal_details_ds').query();
        	});
        ]]></script> -->
    </a:view>
</a:screen>