<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: wangwei5743 
    $Date: 2014-11-25 下午01:23:56  
    $Revision: 1.0  
    $Purpose: 合同变更信息查询
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" trace="true">
    <a:view>
        <script type="text/javascript"><![CDATA[
            function on_table_name_change(ds, record, name, value, oldVlaue){
                if(name=='table_name'){
                    record.set('table_pk_value','');
                    record.set('table_pk_code','');
                    record.set('table_pk_name','');
                    var table_pk_name=record.getField('table_pk_name');
                    table_pk_name.clear();
                    if(value){
                        table_pk_name.setLovPara('table_name',value);
                    }
                }
                 if(name=='source_table'){
                    record.set('source_table_pk_value','');
                    record.set('source_table_pk_code','');
                    record.set('source_table_pk_name','');
                    var source_tbble_pk_name=record.getField('source_table_pk_name');
                    source_tbble_pk_name.clear();
                    if(value){
                        source_tbble_pk_name.setLovPara('table_name',value);
                    }
                }
            }
            
            function hls_standard_history_query(){
                $('hls_standard_history_ds').query();
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="query_ds" autoCreate="true">
                <a:fields>
                    <a:field name="table_name"/>
                    <a:field name="table_name_desc" lovHeight="500" lovService="cont.CON380.hls_base_table_info" lovWidth="500" title="变更内容">
                        <a:mapping>
                            <a:map from="table_name" to="table_name"/>
                            <a:map from="comments" to="table_name_desc"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="table_pk_value"/>
                    <a:field name="table_pk_code"/>
                    <a:field name="table_pk_name" lovHeight="500" lovService="cont.CON380.hls_standrd_his_pk_v" lovWidth="500" title="变更单据信息">
                        <a:mapping>
                            <a:map from="table_pk_vlaue" to="table_pk_value"/>
                            <a:map from="table_pk_code" to="table_pk_code"/>
                            <a:map from="table_pk_name" to="table_pk_name"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="source_table"/>
                    <a:field name="source_table_desc" lovHeight="500" lovService="cont.CON380.hls_base_table_info" lovWidth="500" title="源变更来源">
                        <a:mapping>
                            <a:map from="table_name" to="source_table"/>
                            <a:map from="comments" to="source_table_desc"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="source_table_pk_value"/>
                    <a:field name="source_table_pk_code"/>
                    <a:field name="source_table_pk_name" lovHeight="500" lovService="cont.CON380.hls_standrd_his_pk_v" lovWidth="500" title="变更单据信息">
                        <a:mapping>
                            <a:map from="table_pk_vlaue" to="source_table_pk_value"/>
                            <a:map from="table_pk_code" to="source_table_pk_code"/>
                            <a:map from="table_pk_name" to="source_table_pk_name"/>
                        </a:mapping>
                    </a:field>
                </a:fields>
                <a:events>
                    <a:event name="update" handler="on_table_name_change"/>
                </a:events>
            </a:dataSet>
            <a:dataSet id="hls_standard_history_ds" autoQuery="true" model="cont.CON380.hls_standard_history" queryDataSet="query_ds"/>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:gridButton id="hls_standard_his_id" click="hls_standard_history_query" text="查询"/>
            </a:screenTopToolbar>
            <a:form column="4" labelWidth="120" title="查询条件">
                <a:lov name="table_name_desc" bindTarget="query_ds" prompt="变更内容"/>
                <a:lov name="table_pk_name" bindTarget="query_ds" prompt="变更单据"/>
                <a:lov name="source_table_desc" bindTarget="query_ds" prompt="变更内容来源"/>
                <a:lov name="source_table_pk_name" bindTarget="query_ds" prompt="源变更单据"/>
            </a:form>
            <a:grid bindTarget="hls_standard_history_ds" marginHeight="250" marginWidth="100" navBar="true">
                <a:columns>
                    <a:column name="table_name" prompt="变更内容" width="200"/>
                    <a:column name="table_name_comments" prompt="变更内容描述" width="150"/>
                    <a:column name="source_table" prompt="源变更内容" width="200"/>
                    <a:column name="source_table_comments" prompt="源变更内容描述" width="150"/>
                    <a:column name="column_name" prompt="字段" width="150"/>
                    <a:column name="column_prompt" prompt="字段描述" width="150"/>
                    <a:column name="from_value" prompt="修改前值" width="130"/>
                    <a:column name="to_value" prompt="修改后值" width="130"/>
                </a:columns>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>
