ds_abc_interface_entrance.lview 9.34 KB
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhuxianfei
    $Date: 2017年8月17日 下午3:55:06  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
    <!-- <a:init-procedure>
         <a:model-query fetchAll="true" model="cont.CON506.get_sys_role_code" rootPath="role_path"/>
     </a:init-procedure>-->
    <a:view>
        <a:link id="ds_abc_trans_confirm_link"
                url="${/request/@context_path}/modules/ccb/CCB503/ds_abc_trans_confirm.lview"/>
        <a:link id="ds_abc_trans_link"
                url="${/request/@context_path}/modules/ccb/CCB503/ds_abc_transaction_detail.lview"/>
        <a:link id="init_abc_inteface_link" model="ccb.CCB503.ds_abc_trans_update" modelaction="insert"/>
        <a:link id="ds_abc_upload_txt_link"
                url="${/request/@context_path}/modules/ccb/CCB503/ds_abc_import_txt.lview"/>
        <a:link id="ds_abc_download_txt_link"
                url="${/request/@context_path}/modules/ccb/CCB503/ds_abc_download_txt.lsc"/>
        <script type="text/javascript"><![CDATA[
        function ccb503_abc_query() {
            $('csh_abc_result_ds').query();
        }

        function ccb503_abc_reset() {
            $('csh_abc_query_ds').reset();
        }

        function ds_abc_detail_open(head_id) {
            var win = new Leaf.Window({
                id: 'ds_abc_transaction_detail_link_winId',
                url: $('ds_abc_trans_confirm_link').getUrl(),
                params: {
                    head_id: head_id,
                    winId: 'ds_abc_transaction_detail_link_winId'
                },
                title: '扣款详细信息',
                fullScreen: true,
                draggable: true
            });
            win.on('close', function () {
                ccb503_abc_query();
            });
        }

        function ds_abc_detail_render(value, record, name) {
            return '<a href="javascript:ds_abc_detail_open(' + record.get('head_id') + ')">' + value + '</a>';
        }

        var check_flag = 'N';
        var str = '';

        function ccb503_abc_add() {
            var records = $('csh_abc_result_ds').getAll();
            if (records.length > 0) {
                for (var i = 0; i < records.length; i++) {
                    if (records[i].get('status') == 'NEW') {
                        check_flag = 'N';
                    } else {
                        check_flag = 'Y'
                    }

                    str = str + check_flag;
                }
            }

            if (str.indexOf('N') != -1) {
                Leaf.showMessage('提示', '存在还未回盘的文件,不可再次生成代扣文件!');
                return;
            }

            Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
            Leaf.request({
                url: $('init_abc_inteface_link').getUrl(),
                para: {
                    'session_id': '${/session/@session_id}',
                    'user_id': '${/session/@user_id}'
                },
                success: function () {
                    Leaf.Masker.unmask(Ext.getBody());
                    open_csh_trans_detail();
                },
                failure: function () {
                    Leaf.Masker.unmask(Ext.getBody());
                },
                error: function () {
                    Leaf.Masker.unmask(Ext.getBody());
                },
                scope: this
            });

        }

        function open_csh_trans_detail() {
            var win = new Leaf.Window({
                id: 'ds_abc_trans_link_winId',
                url: $('ds_abc_trans_link').getUrl(),
                params: {
                    winId: 'ds_abc_trans_link_winId'
                },
                title: '生成代扣数据',
                fullScreen: true
            });
            win.on('close', function () {
                $('csh_abc_result_ds').query();
            });
        }

        function ccb503_abc_import() {
            var record = $('csh_abc_result_ds').getCurrentRecord();
            if (record.get('status') != 'NEW') {
                Leaf.showMessage('提示', '该数据不是新建状态,不可操作');
                return;
            }

            var win = new Leaf.Window({
                id: 'ds_abc_upload_link_winId',
                url: $('ds_abc_upload_txt_link').getUrl() + '?header_number=' + record.get('header_number'),
                params: {
                    winId: 'ds_abc_upload_link_winId'
                },
                title: '扣款文件上传',
                width: 420,
                height: 275
            });
            win.on('close', function () {
                $('csh_abc_result_ds').query();
            });
        }

        function fileDownload_render(value, record, name) {
            var url = $('ds_abc_download_txt_link').getUrl();
            return '<a href="' + url + '?header_number=' + record.get('header_number') + '">' + '下载' + '</a>';
        }

        ]]></script>
        <a:dataSets>
            <a:dataSet id="hd_status_ds" lookupCode="DS_ABC_STATUS"/>
            <a:dataSet id="csh_abc_query_ds" autoCreate="true">
                <a:fields>
                    <a:field name="due_date_from"/>
                    <a:field name="due_date_to"/>
                    <a:field name="user_name" lovGridHeight="350" lovHeight="500" lovService="rsc.RSC710.sys_user_lov"
                             lovWidth="500">
                        <a:mapping>
                            <a:map from="user_id" to="user_id"/>
                            <a:map from="description" to="user_name"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="status_desc" displayField="code_value_name" options="hd_status_ds"
                             returnField="status" valueField="code_value"/>
                    <a:field name="status"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="csh_abc_result_ds" autoPageSize="true" autoQuery="true"
                       model="ccb.CCB503.ds_abc_transaction_query" queryDataSet="csh_abc_query_ds" selectable="true"
                       selectionModel="single">
                <a:fields>
                    <a:field name="header_number"/>
                    <a:field name="due_date"/>
                    <a:field name="row_count"/>
                    <a:field name="amount_total"/>
                    <a:field name="user_name"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="ccb503_abc_query" text="HLS.QUERY"/>
                <a:gridButton click="ccb503_abc_reset" text="HLS.RESET"/>
                <a:gridButton click="ccb503_abc_add" text="生成代扣单"/>
                <a:gridButton click="ccb503_abc_import" text="导入回盘文件"/>
            </a:screenTopToolbar>
            <a:form column="5" labelWidth="100" marginWidth="50" row="1" title="查询">
                <a:textField name="header_number" bindTarget="csh_abc_query_ds" prompt="文件名"/>
                <a:datePicker name="due_date_from" bindTarget="csh_abc_query_ds" prompt="扣款日期从"/>
                <a:datePicker name="due_date_to" bindTarget="csh_abc_query_ds" prompt="扣款日期到"/>
                <a:comboBox name="status_desc" bindTarget="csh_abc_query_ds" prompt="文件状态"/>
                <a:lov name="user_name" bindTarget="csh_abc_query_ds" prompt="操作者"/>
            </a:form>
            <a:grid id="csh_abc_grid" bindTarget="csh_abc_result_ds" marginHeight="210" marginWidth="50" navBar="true">
                <a:columns>
                    <a:column name="header_number" align="center" prompt="文件名" renderer="ds_abc_detail_render"
                              width="150"/>
                    <a:column name="due_date" align="center" prompt="扣款日期" renderer="Leaf.formatDate"/>
                    <a:column name="row_count" align="right" prompt="应扣款条数"/>
                    <a:column name="amount_total" align="right" prompt="应扣款总额" renderer="Leaf.formatMoney"
                              width="150"/>
                    <a:column name="succe_count_total" align="right" prompt="扣款成功条数"/>
                    <a:column name="succe_amount_total" align="right" prompt="扣款成功金额" width="150"/>
                    <a:column name="fail_count_total" align="right" prompt="扣款失败条数"/>
                    <a:column name="fail_amount_total" align="right" prompt="扣款失败金额" width="150"/>
                    <!--<a:column name="write_off_error_total" align="right" prompt="自动核销失败条数"/>
                    <a:column name="write_off_error_amount" align="right" prompt="自动核销失败总额" width="150"/>-->
                    <a:column align="center" prompt="CSH533.DOWNLOAD_FILE" renderer="fileDownload_render" width="80"/>
                    <a:column name="status_n" align="center" prompt="文件状态" width="130"/>
                    <a:column name="user_name" align="center" prompt="操作人" width="120"/>
                    <a:column name="job_status_n" align="center" prompt="核销下账状态" width="120"/>
                </a:columns>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>