<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: Calvin  
    $Date: 2017年11月22日18:21:48
    $Revision: 1.0  
    $Purpose:电催详情
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" dynamiccreateenabled="true" trace="true">
    <a:view>
        <a:link id="${/parameter/@layout_code}_con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
        <a:link id="con632_cdd_uploadFile_id" url="${/request/@context_path}/uploadFile.lview"/>
        <a:link id="con632_cdd_downloadFile_id" url="${/request/@context_path}/downloadFile.lview"/>
        <script type="text/javascript"><![CDATA[
            //更新时调用
            window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_update'] = function(ds, record, name, value, old_value, bp_seq) {
                if (name == 'overdue_state') {
                    if (value == '01') {
                        record.getField('payments_day').setRequired(true);
                        record.getField('payments_date').setRequired(true);
                    } else {
                        record.getField('payments_day').setRequired(false);
                        record.getField('payments_date').setRequired(false);
                    }
                }
            };
            
            //关闭
            window['${/parameter/@layout_code}_upload_layout_dynamic_click'] = function() {
                var root_ds = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_collection_call_hd');
                var record = $(root_ds).getCurrentRecord();
                var url;
                if ('${/parameter/@maintain_type}' == 'READONLY') {
                    url = $('con632_cdd_downloadFile_id').getUrl() + '?table_name=CON_COLLECTION&header_id=' + record.get('call_id');
                } else {
                    url = $('con632_cdd_uploadFile_id').getUrl() + '?table_name=CON_COLLECTION&header_id=' + record.get('call_id');
                }
                var win = new Leaf.Window({
                    url: url,
                    title: '${l:HLS.SUPPORTING_DOCUMENT}',
                    id: 'con632_cdd_uploadFile_screen_id',
                    width: 850,
                    height: 400
                });
            
                win.on('close', function() {
                    record.ds.query();
                });
            };
        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
    </a:view>
</a:screen>
