credit_credit.lview 3.06 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
<?xml version="1.0" encoding="UTF-8"?>

<!--
    $Author: sf
$Date: 2019/09/24 21:19
$Revision: 1.0
$Purpose: 商业伙伴授信创建
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true" trace="true">
    <a:init-procedure>
        <a:model-query fetchAll="true" model="basic.get_sys_default_time" rootPath="sys_default_time"/>-->
    </a:init-procedure>
    <a:view>
        <a:link id="credit_enhance_detail_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>

        <script type="text/javascript"><![CDATA[
        //保存前调用
        window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function(ds, record) {
            window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
            var check_flag = true;


           if( record.get('credit_total_amount')<0){
               $L.showErrorMessage("错误",'信用总额度不能为负数',null,null);
               window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
               return false;
           }
           if(record.get('credit_date_to')<record.get('credit_date_from')){
               $L.showErrorMessage("错误",'授信结束时间不能小于开始时间',null,null);
               window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
               return false;
           }

            window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
           return  check_flag;


        };

陆正友's avatar
陆正友 committed
40 41 42 43 44 45 46 47 48 49 50
        //更新时调用
        window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_update'] = function(ds, record, name, value, old_value, bp_seq){
            var f_bp_create_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master_credit_hd');
            if(f_bp_create_ds_id==ds.id){
                if(record.get('credit_type')=='CAPITAL_LOAN_CREDIT'){
                    record.set('amount_type','CIRCULATION');
                    record.set('amount_type_n','循环');
                }else if(record.get('credit_type')=='ASSET_PROCUREMENT') {
                    record.set('amount_type','IMMOBILIZATION');
                    record.set('amount_type_n','固定');
                }
51 52 53 54
                if(name=='bp_id'){
                    record.set('credit_type','');
                    record.set('credit_type_n','');
                }
陆正友's avatar
陆正友 committed
55 56 57
            }
        };

58 59 60 61 62 63 64 65 66 67
        //保存成功后刷新页面credit_ds
        // window['${/parameter/@layout_code}_on_layout_dynamic_submitsuccess'] = function(ds, record, res, bp_seq) {
        //     Leaf.SideBar.show({
        //         msg: '操作成功',
        //         duration: 2000
        //     });
        //     $('credit_ds').query();
        //     $('${/parameter/@winid}').close();
        //     window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
        // };
68 69 70 71 72

        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
    </a:view>
</a:screen>