con350_insurance_entrance.lview 8.7 KB
Newer Older
Spencer Chang's avatar
Spencer Chang committed
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 40 41 42 43 44 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 74 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 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhuxianfei
    $Date: 2018年7月16日 上午11:03:45  
    $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 model="cont.CON350.con_insurance_import_batch_id" rootPath="batch_id"/>
    </a:init-procedure>
    <a:view>
        <a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code"
                modelaction="update"/>
        <a:link id="con_change_ds_inusurance_link"
                url="${/request/@context_path}/modules/cont/CON350/con350_change_ds_inusurance.lview"/>
        <a:link id="con_change_other_inusurance_link"
                url="${/request/@context_path}/modules/cont/CON350/con350_change_other_inusurance.lview"/>
        <a:link id="con_insurance_upload_link"
                url="${/request/@context_path}/modules/cont/CON350/con350_insurance_import.lview"/>
        <a:link id="con_insurance_modify_link"
                url="${/request/@context_path}/modules/cont/CON350/con350_modify_insurance.lview"/>
        <a:link id="${/parameter/@layout_code}${/parameter/@pre_layout}_insurance_cdd_uploadFile_id"
                url="${/request/@context_path}/uploadFile.lview"/>

        <script src="${/request/@context_path}/javascripts/hap/dynamicStopAutoQuery.js" type="text/javascript"/>

        <script type="text/javascript"><![CDATA[
        stopDymanicAutoQuery('${/parameter/@layout_code}', 'G_INSUR', 'con_contract');

        //变更为宏菱代办
        window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function () {
            var con_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
            var records = $(con_ds_id).getSelected();
            var insurance_method = records[0].get('insurance_method');
            var contract_status = records[0].get('contract_status');
            if (records.length != 1) {
                Leaf.showMessage('${l:PROMPT}', '请选择一条记录');
                return;
            } else if (insurance_method == 'DS') {
                Leaf.showMessage('${l:PROMPT}', '该合同已为宏菱代办方式,无需更改!');
                return;
            }else if(contract_status == 'PENDING' || contract_status == 'ETING' ){
                Leaf.showMessage('${l:PROMPT}', '该合同处于变更流程中,不可进行保费变更!');
                return;
            }else if(contract_status == 'ET' || contract_status == 'TERMINATE' ){
                Leaf.showMessage('${l:PROMPT}', '该合同已结清完成,不可进行保费变更!');
                return;
            }
            var win = new Leaf.Window({
                id: 'con_change_ds_ins_link_winId',
                url: $('con_change_ds_inusurance_link').getUrl(),
                params: {
                    contract_id: records[0].get('contract_id'),
                    winId: 'con_change_ds_ins_link_winId'
                },
                title: '变更宏菱代办',
                draggable: true,
                width: 900,
                height: 300
            });
            win.on('close', function () {
                $(con_ds_id).query();
            });

        }

        //宏菱代办变更为其他
        window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function () {
            var con_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
            var records = $(con_ds_id).getSelected();
            var insurance_method = records[0].get('insurance_method');
            var contract_status = records[0].get('contract_status');

            if (records.length != 1) {
                Leaf.showMessage('${l:PROMPT}', '请选择一条记录');
                return;
            } else if (insurance_method != 'DS') {
                Leaf.showMessage('${l:PROMPT}', '该合同投保方式不是宏菱投保,请检查数据!');
                return;
            }else if(contract_status == 'PENDING' || contract_status == 'ETING' ){
                Leaf.showMessage('${l:PROMPT}', '该合同处于变更流程中,不可进行保费变更!');
                return;
            }else if(contract_status == 'ET' || contract_status == 'TERMINATE' ){
                Leaf.showMessage('${l:PROMPT}', '该合同已结清完成,不可进行保费变更!');
                return;
            }
            var win = new Leaf.Window({
                id: 'change_other_ins_link_winId',
                url: $('con_change_other_inusurance_link').getUrl(),
                params: {
                    contract_id: records[0].get('contract_id'),
                    winId: 'change_other_ins_link_winId'
                },
                title: '宏菱代办变更其他',
                draggable: true,
                width: 900,
                height: 300
            });
            win.on('close', function () {
                $(con_ds_id).query();
            });

        }

        //维护投保信息
        window['${/parameter/@layout_code}_user_button3_layout_dynamic_click'] = function () {
            var con_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
            var records = $(con_ds_id).getSelected();
            if (records.length != 1) {
                Leaf.showMessage('${l:PROMPT}', '请选择一条记录');
                return;
            }

            var win = new Leaf.Window({
                id: 'con_insurance_modify_link_winId',
                url: $('con_insurance_modify_link').getUrl(),
                params: {
                    contract_id: records[0].get('contract_id'),
                    winId: 'con_insurance_modify_link_winId'
                },
                title: '信息维护',
                width: 1300,
                height: 320,
                draggable: true
            });
            win.on('close', function () {
                $(con_ds_id).query();
            });

        }

        //批量导入
        window['${/parameter/@layout_code}_user_button4_layout_dynamic_click'] = function () {
            var con_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
            var records = $(con_ds_id).getSelected();
            var win = new Leaf.Window({
                id: 'con_insurance_upload_link_winId',
                url: $('con_insurance_upload_link').getUrl(),
                params: {
                    batch_id: '${/model/batch_id/record/@batch_id}',
                    winId: 'con_insurance_upload_link_winId'
                },
                title: '投保信息',
                fullScreen: true,
                draggable: true
            });
            win.on('close', function () {
                $(con_ds_id).query();
            });
        }

        //超链接渲染
        window['${/parameter/@bp_seq}${/parameter/@layout_code}_dynamic_link_renderer'] = function (value, record, name, config_record, bp_seq) {
            //
            var link_function = '';
            var contract_id = record.get('contract_id');
            window['${/parameter/@bp_seq}${/parameter/@layout_code}_hls_link_render_record'][record.id + '---' + name] = record;
            if (name == 'attachment') {
                return '<a href="javascript:hls_attachment_window_open(\'' + contract_id + '\',\'' + record.id + '\',\'' + record.ds.id + '\');">' + '上传' + '</a>';
            }
        };

        function hls_attachment_window_open(contract_id, record_id, ds_id) {
            url = $('${/parameter/@layout_code}${/parameter/@pre_layout}_insurance_cdd_uploadFile_id').getUrl() + '?table_name=CONTRACT_INSURANCE&header_id=' + contract_id;
            wd = new Leaf.Window({
                id: 'open_attachment_window',
                url: url,
                title: '附件上传',
                height: 350,
                width: 850
            });
        }

        window['${/parameter/@layout_code}_on_layout_dynamic_grid_query'] = function (ds, qpara, bp_seq) {
            var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');

            if (ds == $(ds_id)) {
                aut_authority_list_validate_query(ds, qpara);

            }

            ds.setQueryParameter('__async__', 'Y');
        };


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