credit_credit_maintain.lview 5.37 KB
Newer Older
stone's avatar
stone committed
1 2 3 4 5 6 7 8 9 10
<?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>
niminmin's avatar
niminmin committed
11
        <a:model-query fetchAll="true" model="basic.get_sys_default_time" rootPath="sys_default_time"/>
stone's avatar
stone committed
12 13 14 15 16 17 18
    </a:init-procedure>
    <a:view>
        <a:link id="credit_enhance_detail_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
        <a:link id="hls361N_update_credit_link_id" model="hls.HLS361N.hls_bp_master_credit_update_status" modelaction="update"/>
        <script type="text/javascript"><![CDATA[
        Leaf.onReady(function() {
            var credit_ds = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master_credit_hd');
19
            $(credit_ds).setQueryParameter('bp_credit_hd_id', ${/parameter/@bp_credit_hd_id});
stone's avatar
stone committed
20 21 22
            $(credit_ds).query();

        })
niminmin's avatar
niminmin committed
23 24 25 26 27 28
        var  dirty_flag='N';
        //更新时调用
        window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_update'] = function(ds, record, name, value, old_value, bp_seq) {
            dirty_flag='Y';
        };
        window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
stone's avatar
stone committed
29
            window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
niminmin's avatar
niminmin committed
30 31 32 33 34 35 36 37 38
            var credit_ds = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master_credit_hd');
            var record =$(credit_ds).getCurrentRecord();
            var credit_date_from=Leaf.formatDate(record.get('credit_date_from'))
            var credit_date_to=Leaf.formatDate(record.get('credit_date_to'));
            var total_amount=record.get('credit_total_amount');
            var used_credit_amount=record.get('used_amount');
            if (dirty_flag=='Y'){
                if(credit_date_from>credit_date_to){
                    $L.showErrorMessage("错误",'终止日需大于生效日',null,null);
stone's avatar
stone committed
39
                    window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
niminmin's avatar
niminmin committed
40 41 42 43
                    return false;
                }
                if(credit_date_to<Leaf.formatDate(new Date())){
                    $L.showErrorMessage("错误",'终止日早于当前时间',null,null);
stone's avatar
stone committed
44
                    window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
niminmin's avatar
niminmin committed
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
                    return false;
                }
                Leaf.request({
                    url: $('hls361N_update_credit_link_id').getUrl(),
                    para: {
                        bp_credit_hd_id    :   record.get('bp_credit_hd_id'),
                        credit_total_amount:   total_amount,
                        credit_date_from   :   credit_date_from,
                        credit_date_to     :   credit_date_to,
                        used_amount: record.get('used_amount'),
                        bp_id:record.get('bp_id')
                    },
                    success: function ()  {
                        window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                        $('${/parameter/@winid}').close();
                        //$('credit_ds').query();

                    },
                    error: function() {
                        window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                    },
                    failure: function() {
                        window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                    },
                    scope: this,
                    sync:true
                });
             }else{
                if('${/parameter/@credit_status}'=='APPROVED'){
stone's avatar
stone committed
74
                    window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
niminmin's avatar
niminmin committed
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
                    $('${/parameter/@winid}').close();
                    // $('credit_ds').query();
                }
                else if('${/parameter/@credit_status}'=='REJECT'){

                    Leaf.request({
                        url: $('hls361N_update_credit_link_id').getUrl(),
                        para: {
                            bp_credit_hd_id    :   record.get('bp_credit_hd_id'),
                            credit_total_amount:   total_amount,
                            credit_date_from   :   credit_date_from,
                            credit_date_to     :   credit_date_to,
                            used_amount: record.get('used_amount'),
                            bp_id:record.get('bp_id')
                        },
                        success: function ()  {
                            window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                            $('${/parameter/@winid}').close();
                        },
                        error: function() {

                            window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                        },
                        failure: function() {
                            window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                        },
                        scope: this
                    });
                }
            }
        }
stone's avatar
stone committed
106 107 108 109 110 111


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