<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: hand  
    $Date: 2016-6-27 下午6:36:11  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure/>
    <a:view>
        <a:link id="con_collection" url="${/request/@context_path}/modules/cont/CON630/con_collection_type.lview"/>
        <a:link id="con_persons_district_link1" url="${/request/@context_path}/modules/cont/CON630/con_persons_district.lview"/>
        <script type="text/javascript"><![CDATA[
            function query_con_collection_tgp_result_ds() {
                //
                $('con_collection_tgp_result_ds').query();
            }
            
            function persons_district_renderer(value, record, name) {
                var staff_id = record.get('staff_id');
                if (name == 'district') {
                    return '<a  href="javascript:persons_district_window_open(\'' + staff_id + '\',\'' + name + '\')">' + '<font color="#FF9900">区域</font>' + '</a>';
                }
            }
            
            function persons_district_window_open(id, name) {
                if (Ext.isEmpty(id) || id == 'undefined') {
                    Leaf.showMessage('${l:HLS.PROMPT}', '请先点击保存!');
                } else {
                    var win = new Leaf.Window({
                        id: 'con_persons_district_window',
                        url: $('con_persons_district_link1').getUrl(),
                        params: {
                            winId: 'con_persons_district_window',
                            staff_id: id
                        },
                        title: '区域定义',
                        height: 550,
                        width: 400
                    });
                }
            }
            
            function openWindow() {
                var url = $('con_collection').getUrl();
                var win = new Leaf.Window({
                    url: url,
                    title: '催收定义',
                    id: 'mywin',
                    fullScreen: true
                });
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="con_collection_tgp_query_ds" fetchAll="true">
                <a:fields>
                    <a:field name="type_name"/>
                    <a:field name="group_name"/>
                    <a:field name="staff_name"/>
                    <a:field name="district"/>
                    <a:field name="note"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="con_collection_tgp_result_ds" autoQuery="true" canQuery="true" fetchAll="true" model="cont.CON630.con_collection_tgp" queryDataSet="con_collection_tgp_query_ds">
                <a:fields>
                    <a:field name="type_name"/>
                    <a:field name="group_name"/>
                    <a:field name="staff_name"/>
                    <a:field name="district"/>
                    <a:field name="note"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="query_con_collection_tgp_result_ds" text="查询"/>
                <a:gridButton click="openWindow" text="催收定义"/>
            </a:screenTopToolbar>
            <a:form column="3" marginWidth="250" title="查询">
                <a:textField name="type_name" bindTarget="con_collection_tgp_query_ds" prompt="催收类型"/>
                <a:textField name="group_name" bindTarget="con_collection_tgp_query_ds" prompt="催收组别"/>
                <a:textField name="staff_name" bindTarget="con_collection_tgp_query_ds" prompt="催收组员"/>
            </a:form>
            <a:grid id="grid_id4" bindTarget="con_collection_tgp_result_ds" marginHeight="180" marginWidth="250" navBar="true">
                <a:columns>
                    <a:column name="type_name" editor="grid_id_textField_id4" prompt="催收类型" width="150"/>
                    <a:column name="group_name" editor="grid_id_textField_id4" prompt="催收组别" width="150"/>
                    <a:column name="staff_name" editor="grid_id_textField_id4" prompt="催收组员" width="150"/>
                    <a:column name="district" prompt="区域" renderer="persons_district_renderer" width="150"/>
                    <a:column name="note" editor="grid_id_textField_id4" prompt="备注" width="400"/>
                </a:columns>
            </a:grid>
            <a:hBox/>
        </a:screenBody>
    </a:view>
</a:screen>
