ins_insurance_claim_confirm.lview 9.41 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 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author:   
    $Date: 2014-8-4 下午01:58:31  
    $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="acr.ACR516.acr_vat_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="ins_claims_create_link_id" model="ins.INS505.ins_cashflow_create" modelaction="batch_update"/>
        <a:link id="pageLink_bpQueryScreen_welcome" url="${/request/@context_path}/welcome.lview"/>
        <a:link id="pageLink_insurance_claim_matain" url="${/request/@context_path}/modules/ins/INS503/ins_insurance_claim_matain.lview"/>
        <a:link id="ins_import_upload_link" url="${/request/@context_path}/modules/ins/INS503/ins_import_upload.lview"/>
        <script type="text/javascript"><![CDATA[
            function open_bp_modify_win(ds_id, record_id) {
                var param = new Object();
                if ('null' == record_id) {
                    param['url_title'] = '保险理赔新增';
                    param['function_code'] = 'INS503D';
                } else {
                    var record = $(ds_id).findById(record_id);
                    param = record.data; // new Object();
                    param['url_title'] = '保险理赔修改';
                    param['function_code'] = 'INS503M';
                }
                
                param['function_usage'] = 'CREATE';
                param['master_type'] = 'INSURANCE';
                param['master_id'] = param['claims_id'];
                hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'pageLink_insurance_claim_matain', ds_id);
            }
            
            window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record) {
                if (name == 'machine_number' && value) {
                    return '<a href="javascript:open_bp_modify_win(\'' + record.ds.id + '\',\'' + record.id + '\')">' + value + '</a>';
                }
                return '';
            };
            
          
            
            
            //新增
            window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
            
                var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'cla_insurance_claims_policy');
                open_bp_modify_win(ds_id, 'null');
            };
            
            //修改
            window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function() {
                var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'cla_insurance_claims_policy');
                var record = $(ds_id).getSelected()[0];
                open_bp_modify_win(ds_id, record.id);
            
            };
            
            //删除
            window['${/parameter/@layout_code}_user_button3_layout_dynamic_click'] = function() {
             var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'cla_insurance_claims_policy');
   
                var records = $(ds_id).getSelected();
    
                if (!records.length) {
                    Leaf.showMessage('${l:PROMPT}', '请至少选择一条记录');
                    return;
                }
            
                //校验
                for (var i = 0;i < records.length;i++) {
                    var status = records[i].get('status');
                    if (status == 'C') {
                        Leaf.showMessage("${l:PROMPT}", "已生成现金流的理赔不能删除!");
                        return;
                    }
                }
            
                var param = new Object();
                var datas = [];
            
                if (records.length == 0) {
                    Leaf.showInfoMessage('提示', '请至少选择一行!', null, 200, 100);
                }
            
                for (var i = 0;i < records.length;i++) {
                    if (records[i].get('claims_id')) {
            
                        data = {};
                        data['claims_id'] = records[i].get('claims_id');
                        data['contract_id'] = records[i].get('contract_id');
                        data['policy_id'] = records[i].get('policy_id');
              
                        data['_status'] = 'insert';
                        datas.push(data);
            
                    }
                }
                param['details'] = datas;
                var url_l = $('ins_claims_create_link_id').getUrl();
                Leaf.request({
                    url: url_l,
                    para: datas,
                    success: function() {
                        window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                        $(ds_id).query();
                    },
                    error: function() {
                        window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                    },
                    failure: function() {
                        window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                    },
                    scope: this
                });
               };
            
            //上传
            window['${/parameter/@layout_code}_user_button4_layout_dynamic_click'] = function() {
               new Leaf.Window({
                    id: 'upload_window',
                    url: $('ins_import_upload_link').getUrl() + '?batch_id=${/model/batch_id/record/@batch_id}&&import_type=01&&type=PPD',
                    title: '上传理赔信息',
                    width: 420,
                    height: 280
                });
               };
               
            //生成理赔现金流
            window['${/parameter/@layout_code}_user_button5_layout_dynamic_click'] = function() {
               var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'cla_insurance_claims_policy');
            
                var records = $(ds_id).getSelected();
            
                for (var i = 0;i < records.length;i++) {
                    if (records[i].dirty == true) {
                        Leaf.showMessage('${l:PROMPT}', '请先保存再确认');
                        return;
                    }
                }
            
                if (!records.length) {
                    Leaf.showMessage('${l:PROMPT}', '请至少选择一条记录');
                    return;
                }
            
                //校验
                for (var i = 0;i < records.length;i++) {
                    var status = records[i].get('status');
                    if (status == 'C') {
                        Leaf.showMessage("${l:PROMPT}", "已生成现金流的理赔不能再次生成!");
                        return;
                    }
                }
            
                var param = new Object();
                var datas = [];
            
                if (records.length == 0) {
                    Leaf.showInfoMessage('提示', '请至少选择一行!', null, 200, 100);
                }
            
                for (var i = 0;i < records.length;i++) {
                    if (records[i].get('claims_id')) {
            
                        data = {};
                        data['claims_id'] = records[i].get('claims_id');
                        data['contract_id'] = records[i].get('contract_id');
                        data['policy_id'] = records[i].get('policy_id');
              
                        data['_status'] = 'update';
                        datas.push(data);
            
                    }
                }
                param['details'] = datas;
                var url_l = $('ins_claims_create_link_id').getUrl();
                Leaf.request({
                    url: url_l,
                    para: datas,
                    success: function() {
                        window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                        $(ds_id).query();
                    },
                    error: function() {
                        window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                    },
                    failure: function() {
                        window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                    },
                    scope: this
                });
               };
            
            
            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'], 'cla_insurance_claims_policy');
            
                if (ds == $(ds_id)) {
                    aut_authority_list_validate_query(ds, qpara);
            
                }
            };
        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_authority_list_validate.lview?document_category=INSURANCE&amp;function_code=INS503"/>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
    </a:view>
</a:screen>