hn_expenses_app_create.lview 6.69 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: chenlingfeng
    $Date: 2017-8-2 上午11:14:17
    $Revision: 1.0
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:view>
        <a:link id="hn1310_hn_expenses_app_approval_print_link" url="${/request/@context_path}/modules/hn/HN1310/hn_expenses_app_approval_print.lsc"/>
        <a:link id="hn1310_hn_expenses_app_create_entrance_link" url="${/request/@context_path}/modules/hn/HN1310/hn_expenses_app_create_detail.lview"/>
        <a:link id="hn1310_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
        <script type="text/javascript"><![CDATA[
            function hn1310_query() {
                $('hn1310_hn_expenses_app_query_result_ds').query();
            }
            
            function hn1310_reset() {
            $('hn1310_hn_expenses_app_query_ds').reset();
               }
            
            function hn1310_add() {
                var ds_id = 'hn1310_hn_expenses_app_query_result_ds';
                var param = {};
                param['function_code'] = 'HN1310D';
                param['function_usage'] = 'CREATE';
                param['url_title'] = '资金用款申请';
                param['winid'] = 'hn1310_hn_expenses_app_detail_add_winid';
                hls_doc_get_layout_code('hn1310_get_layout_code_link_id', param, 'hn1310_hn_expenses_app_create_entrance_link', ds_id);
            }
            
            function hn1310_export() {
                $('hn1310_hn_expenses_app_query_grid')._export();
            }
            
            function hn1310_expenses_open_detail(id) {
                var ds_id = 'hn1310_hn_expenses_app_query_result_ds';
                var record = $(ds_id).findById(id);
                var param = record.data;
                param['function_code'] = 'HN1310D';
                param['function_usage'] = 'MODIFY';
                if (record.get('wfl_status') == 'APPROVING' || record.get('wfl_status') == 'APPROVED') {
                    param['function_code'] = 'HN1310WFL';
                    param['function_usage'] = 'QUERY';
                }
                if ('${/session/@user_id}' != record.get('owner_user_id')){
                      param['function_code'] = 'HN1310WFL';
                    param['function_usage'] = 'QUERY';
                }
            
                param['url_title'] = '资金用款申请';
                param['expenses_id'] = record.get('expenses_id');
                param['winid'] = 'hn1310_hn_expenses_app_detail_winid';
                hls_doc_get_layout_code('hn1310_get_layout_code_link_id', param, 'hn1310_hn_expenses_app_create_entrance_link', ds_id);
            
            }
            
            function hn1310_expenses_number_renderer(value, record, name) {
                if (name == 'expenses_number') {
                    return '<a href="javascript:hn1310_expenses_open_detail(' + record.id + ')">' + value + '</a>';
                }
            }
            function hn1210_print() {
                var url = $('hn1310_hn_expenses_app_approval_print_link').getUrl();
                var records = $('hn1310_hn_expenses_app_query_result_ds').getSelected();
                var param;
                var record = records[0];
                if (record) {

                    if (record.get('wfl_status') == 'APPROVED') {
                        param = '?expenses_id=' + record.get('expenses_id');
                        param = param+'&cdd_list_id=' + record.get('cdd_list_id');
                        param = param+'&instance_id=' + record.get('wfl_instance_id');
                        param = param+'&templt_name=hn_expenses_app_approval.xml';
                        url = url + param;
                        window.open(url);
                    } else {
                        Leaf.showMessage('提示','无法打印未审批通过的单据');
                    }
                }
            
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="hn_common_wfl_status_ds" lookupCode="HN_COMMON_WFL_STATUS"/>
            <a:dataSet id="hn1310_hn_expenses_app_query_ds" autoCreate="true">
                <a:fields>
                    <a:field name="expenses_number"/>
                    <a:field name="expenses_name"/>
                    <a:field name="wfl_status"/>
                    <a:field name="wfl_status_desc" displayField="code_value_name" options="hn_common_wfl_status_ds" returnField="wfl_status" valueField="code_value"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="hn1310_hn_expenses_app_query_result_ds" autoPageSize="true" autoQuery="true" model="hn.HN1310.hn_expenses_app_query" queryDataSet="hn1310_hn_expenses_app_query_ds" selectable="true" selectionModel="single"/>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="hn1310_reset" text="重置"/>
                <a:gridButton click="hn1310_query" text="HLS.QUERY"/>
                <a:gridButton click="hn1310_add" text="新增"/>
                <a:gridButton click="hn1310_export" text="导出"/>
                <a:gridButton click="hn1210_print" text="用款申请单打印"/>
            </a:screenTopToolbar>
            <a:form column="4" labelWidth="120" marginWidth="30" title="查询条件">
                <a:textField name="expenses_number" bindTarget="hn1310_hn_expenses_app_query_ds" prompt="投资业务编号"/>
                <a:textField name="expenses_name" bindTarget="hn1310_hn_expenses_app_query_ds" prompt="投资业务名称"/>
                <a:comboBox name="wfl_status_desc" bindTarget="hn1310_hn_expenses_app_query_ds" prompt="审批状态"/>
            </a:form>
            <a:grid id="hn1310_hn_expenses_app_query_grid" bindTarget="hn1310_hn_expenses_app_query_result_ds" marginHeight="200" marginWidth="30" navBar="true">
                <a:columns>
                    <a:column name="expenses_number" prompt="资金用款申请编号" renderer="hn1310_expenses_number_renderer" width="150"/>
                    <a:column name="expenses_name" prompt="资金用款申请名称" width="200"/>
                    <a:column name="expenses_amount" align="right" prompt="用款金额" renderer="Leaf.formatMoney"/>
                    <a:column name="expenses_date" prompt="用款日期" renderer="Leaf.formatDate"/>
                    <a:column name="owner_user_id_n" prompt="经办人"/>
                    <a:column name="wfl_status_n" prompt="审批状态"/>
                </a:columns>
            </a:grid>
        </a:screenBody>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
    </a:view>
</a:screen>