<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: lingfeng.chen
    $Date: 2017-7-14 上午10:06:32
    $Revision: 1.0
    $Purpose: 潜在客户管理
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" trace="true">
    <a:init-procedure>
        <a:model-query model="basic.sys_session_info" rootPath="mainPage_session_record"/>
        <a:model-query defaultWhereClause="t1.role_id=${/session/@role_id} and t1.company_id=${/session/@company_id}" fetchAll="true" model="hls.HLS109.hls_default_parameter" rootPath="hls_default_parameter_path"/>
    </a:init-procedure>
    <a:view>
        <script type="text/javascript"><![CDATA[
            function hls210d_grid_editorFunction(record, name) {
                var current_user_id = '${/session/@user_id}';
                if (current_user_id == record.get('interviewer_user_id') || record.isNew) {
                    if (name == 'interview_name') {
                        return 'hls210d_grid_textField';
                    }
                    if (name == 'interview_date') {
                        return 'hls210d_grid_datePicker';
                    }
                    if (name == 'interview_location') {
                        return 'hls210d_grid_textField';
                    }
            
                    if (name == 'description') {
                        return 'hls210d_grid_textArea';
            
                    }
            
                }
            
                return '';
            }
            
            function hls210d_query() {
                $("hls210d_chance_bp_detail_result_ds").query();
            }
            
            function hls210d_reset() {
                $('hls210d_chance_bp_detail_query_ds').reset();
            }
            
         
            function hls210d_submitsuccess_handler_func(ds,res){
                hls210d_query();
            }
         
        ]]></script>
        <a:dataSets>
            <a:dataSet id="hls210d_chance_bp_detail_query_ds" autoCreate="true">
                <a:fields>
                    <a:field name="chance_bp_id" defaultValue="${/parameter/@chance_bp_id}"/>
                    <a:field name="interview_date_from"/>
                    <a:field name="interview_date_to"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="hls210d_chance_bp_detail_result_ds" autoPageSize="true" autoQuery="true" model="hls.HLS210.hn_chance_bp_interviews" queryDataSet="hls210d_chance_bp_detail_query_ds">
                <a:fields>
                    <a:field name="chance_bp_name" defaultValue="${/parameter/@chance_bp_name}"/>
                    <a:field name="chance_bp_id" defaultValue="${/parameter/@chance_bp_id}"/>
                    <a:field name="interviewer_user_id_n" defaultValue="${/model/mainPage_session_record/record/@user_desc}"/>
                </a:fields>
                <a:events>
                    <a:event name="submitsuccess" handler="hls210d_submitsuccess_handler_func"/>
                </a:events>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="hls210d_query" text="HLS.QUERY"/>
                <a:gridButton click="hls210d_reset" text="HLS.RESET"/>
                <!--  <a:gridButton bind="hls210d_chance_bp_detail_result_grid" text="新增" type="add"/>
                <a:gridButton bind="hls210d_chance_bp_detail_result_grid" text="HLS.SAVE" type="save"/> -->
            </a:screenTopToolbar>
            <a:form column="2" title="查询条件">
                <a:datePicker name="interview_date_from" bindTarget="hls210d_chance_bp_detail_query_ds" prompt="访谈时间从"/>
                <a:datePicker name="interview_date_to" bindTarget="hls210d_chance_bp_detail_query_ds" prompt="访谈时间到"/>
            </a:form>
            <a:grid id="hls210d_chance_bp_detail_result_grid" bindTarget="hls210d_chance_bp_detail_result_ds" marginHeight="200" marginWidth="30" navBar="true">
                <a:columns>
                    <a:column name="chance_bp_name" prompt="客户名称" width="200"/>
                    <a:column name="interview_name" prompt="访谈名称" width="200"/>
                    <a:column name="interviewee_name" prompt="访谈人员" width="150"/>
                    <a:column name="interview_date" prompt="访谈时间" renderer="Leaf.formatDate"/>
                    <a:column name="interview_location" prompt="访谈地点" width="150"/>
                    <a:column name="interviewer_user_id_n" prompt="创建人"/>
                    <a:column name="description" prompt="说明" width="300"/>
                </a:columns>
                <a:editors>
                    <a:comboBox id="hls210d_grid_comboBox"/>
                    <a:checkBox id="hls210d_grid_checkBox" checkedValue="Y" uncheckedValue="N"/>
                    <a:datePicker id="hls210d_grid_datePicker"/>
                    <a:lov id="hls210d_grid_lov"/>
                    <a:textArea id="hls210d_grid_textArea" height="100" width="300"/>
                    <a:textField id="hls210d_grid_textField"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>
