hn_invest_app_create.lview 7.34 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
<?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" trace="true">
    <a:init-procedure>
        <a:model-query defaultWhereClause="document_category=&apos;INVESTMENT_BUSINESS&apos;" fetchAll="true" model="basic.hls_document_type_for_lov" rootPath="hls_document_type_path"/>
    </a:init-procedure>
    <a:view>
        <a:link id="hn1210_hn_invest_app_approval_print_link" url="${/request/@context_path}/modules/hn/HN1210/hn_invest_app_approval_print.lsc"/>
        <a:link id="hn1210_hn_invest_app_create_entrance_link" url="${/request/@context_path}/modules/hn/HN1210/hn_invest_app_create_detail.lview"/>
        <a:link id="hn1210_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
        <script type="text/javascript"><![CDATA[
            function hn1210_query() {
                $('hn1210_hn_invest_app_query_result_ds').query();
            }
            
            function hn1210_reset() {
                $('hn1210_hn_invest_app_query_ds').reset();
            }
            
            function hn1210_add() {
                var ds_id = 'hn1210_hn_invest_app_query_result_ds';
                var param = {};
                param['function_code'] = 'HN1210D';
                param['function_usage'] = 'CREATE';
                param['url_title'] = '投资业务申请';
                hls_doc_get_layout_code('hn1210_get_layout_code_link_id', param, 'hn1210_hn_invest_app_create_entrance_link', ds_id);
            }
            
            function hn1210_export() {
                $('hn1210_hn_invest_app_query_grid')._export();
            }
            
            function hn1210_invest_open_detail(id) {
                var ds_id = 'hn1210_hn_invest_app_query_result_ds';
                var record = $(ds_id).findById(id);
                var param = record.data;
                param['function_code'] = 'HN1210D';
                param['function_usage'] = 'MODIFY';
                if (record.get('wfl_status') == 'APPROVING' || record.get('wfl_status') == 'APPROVED') {
                    param['function_code'] = 'HN1210WFL';
                    param['function_usage'] = 'QUERY';
                }
                if ('${/session/@user_id}' != record.get('owner_user_id')){
                      param['function_code'] = 'HN1210WFL';
                    param['function_usage'] = 'QUERY';
                }
            
                param['url_title'] = '投资业务申请';
                param['invest_id'] = record.get('invest_id');
                param['winid'] = 'hn1210_hn_invest_app_detail_winid';
                hls_doc_get_layout_code('hn1210_get_layout_code_link_id', param, 'hn1210_hn_invest_app_create_entrance_link', ds_id);
            
            }
            
            function hn1210_invest_number_renderer(value, record, name) {
                if (name == 'invest_number') {
                    return '<a href="javascript:hn1210_invest_open_detail(' + record.id + ')">' + value + '</a>';
                }
            }
            
            function hn1210_print() {
                var url = $('hn1210_hn_invest_app_approval_print_link').getUrl();
                var records = $('hn1210_hn_invest_app_query_result_ds').getSelected();
                var param;
                var record = records[0];
                if (record) {

                    if (record.get('wfl_status') == 'APPROVED') {
                        param = '?invest_id=' + record.get('invest_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_invest_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="investment_business_doc_type_ds">
                <a:datas dataSource="/model/hls_document_type_path"/>
            </a:dataSet>
            <a:dataSet id="hn1210_hn_invest_app_query_ds" autoCreate="true">
                <a:fields>
                    <a:field name="invest_number"/>
                    <a:field name="invest_name"/>
                    <a:field name="document_type"/>
                    <a:field name="document_type_n" displayField="description" options="investment_business_doc_type_ds" returnField="document_type" valueField="document_type"/>
                    <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="hn1210_hn_invest_app_query_result_ds" autoPageSize="true" autoQuery="true" model="hn.HN1210.hn_invest_app_query" queryDataSet="hn1210_hn_invest_app_query_ds" selectable="true" selectionModel="single"/>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="hn1210_reset" text="重置"/>
                <a:gridButton click="hn1210_query" text="HLS.QUERY"/>
                <a:gridButton click="hn1210_add" text="新增"/>
                <a:gridButton click="hn1210_export" text="导出"/>
                <a:gridButton click="hn1210_print" text="打印审批单"/>
            </a:screenTopToolbar>
            <a:form column="4" labelWidth="120" marginWidth="30" title="查询条件">
                <a:textField name="invest_number" bindTarget="hn1210_hn_invest_app_query_ds" prompt="投资业务编号"/>
                <a:textField name="invest_name" bindTarget="hn1210_hn_invest_app_query_ds" prompt="投资业务名称"/>
                <a:comboBox name="document_type_n" bindTarget="hn1210_hn_invest_app_query_ds" prompt="业务类型"/>
                <a:comboBox name="wfl_status_desc" bindTarget="hn1210_hn_invest_app_query_ds" prompt="审批状态"/>
            </a:form>
            <a:grid id="hn1210_hn_invest_app_query_grid" bindTarget="hn1210_hn_invest_app_query_result_ds" marginHeight="200" marginWidth="30" navBar="true">
                <a:columns>
                    <a:column name="invest_number" prompt="投资业务编号" renderer="hn1210_invest_number_renderer"/>
                    <a:column name="invest_name" prompt="投资业务名称"/>
                    <a:column name="document_type_n" prompt="业务类型"/>
                    <a:column name="transaction_type" prompt="交易品种"/>
                    <a:column name="transaction_direction_n" prompt="交易方向"/>
                    <a:column name="amount_quantity" prompt="金额/数量"/>
                    <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>