ast_insurance_approve.lview 7.94 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhangxing5129  
    $Date: 2015-11-13 上午09:40:28  
    $Revision: 1.0  
    $Purpose: 保险审批功能
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" trace="true">
    <a:view>
        <a:link id="insurance_attachment_uploadFile_id" url="${/request/@context_path}/downloadFile.lview"/>
        <a:link id="ast_insurance_approve_link" model="ast.AST530.ast_insurance_approve" modelaction="batch_update"/>
        <script type="text/javascript"><![CDATA[
            function ast_insurance_approve_query() {
                $('ast_insurance_approve_ds').query();
            }
            
            function ast_insurance_approve_approve() {
                var records = $('ast_insurance_approve_ds').getSelected();
                if (records.length == 0) {
                    Leaf.showMessage('提示', '请选择需要审批的单据信息!');
                    return;
                }
                Leaf.Masker.mask(Ext.getBody(), '正在操作......');
                Leaf.showConfirm('提示', '是否确定审批通过?', function() {
                    var datas = [];
                    for (var i = 0;i < records.length;i++) {
                        records[i].set('_status', 'update');
                        datas.push(records[i].data);
                    }
            
                    Leaf.request({
                        url: $('ast_insurance_approve_link').getUrl(),
                        para: datas,
                        success: function() {
                            Leaf.Masker.unmask(Ext.getBody());
                            $('ast_insurance_approve_ds').query();
                        },
                        failure: function() {
                            Leaf.Masker.unmask(Ext.getBody());
                        },
                        error: function() {
                            Leaf.Masker.unmask(Ext.getBody());
                        },
                        scope: this
                    });
                }, function() {
                    Leaf.Masker.unmask(Ext.getBody());
                });
            }
            
            function open_upload_window(record_id) {
                if (Leaf.isEmpty(record_id)) {
                    Leaf.showMessage('提示', '请先保存再上传附件!');
                    return;
                }
                var url = $('insurance_attachment_uploadFile_id').getUrl() + '?table_name=AST_CAR_INSURANCE&header_id=' + record_id;
                var win = new Leaf.Window({
                    url: url,
                    title: '${l:HLS.SUPPORTING_DOCUMENT}',
                    id: 'insurance_uploadFile_id',
                    width: 850,
                    height: 400
                });
                win.on('close', function() {});
            }
            
            function attachment_detail_renderer(value, record, name) {
                if (!Ext.isEmpty(record.get('ast_car_insurance_id'))) {
                    return '<a href=javascript:open_upload_window(' + record.get('ast_car_insurance_id') + ')>附件查看</a>';
                }
                return value;
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="ast_insurance_approve_query_ds">
                <a:fields>
                    <a:field name="contract_number"/>
                    <a:field name="insurance_number"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="ast_insurance_approve_ds" autoPageSize="true" autoQuery="true" model="ast.AST530.ast_insurance_approve" queryDataSet="ast_insurance_approve_query_ds" selectable="true">
                <a:fields>
                    <a:field name="insure_date" datatype="java.util.Date"/>
                    <a:field name="insurance_date_from" datatype="java.util.Date"/>
                    <a:field name="insurance_date_to" datatype="java.util.Date"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="ast_insurance_approve_query" text="查询"/>
                <a:gridButton click="ast_insurance_approve_approve" text="确认通过"/>
            </a:screenTopToolbar>
            <a:form column="2" labelWidth="120" title="查询条件">
                <a:textField name="contract_number" bindTarget="ast_insurance_approve_query_ds" prompt="合同编号"/>
                <a:textField name="insurance_number" bindTarget="ast_insurance_approve_query_ds" prompt="保单号"/>
            </a:form>
            <a:grid bindTarget="ast_insurance_approve_ds" marginHeight="170" marginWidth="30" navBar="true">
                <a:columns>
                    <a:column name="contract_number" prompt="合同编号" width="120"/>
                    <a:column name="insurer_dis" prompt="保险公司" width="200"/>
                    <a:column name="insurance_number" prompt="保单号" width="200"/>
                    <a:column name="insurance_type_desc" prompt="保险类型" width="100"/>
                    <a:column name="document_status_des" prompt="单据状态" width="100"/>
                    <a:column name="payment_finish_flag" prompt="是否完成支付" width="100"/>
                    <a:column name="insure_date" prompt="投保日" renderer="Leaf.formatDate" width="100"/>
                    <a:column name="insure_name" prompt="投保人" width="100"/>
                    <a:column name="protege_name" prompt="被保人" width="100"/>
                    <a:column name="insurance_date_from" prompt="保险起始日" renderer="Leaf.formatDate" width="100"/>
                    <a:column name="insurance_date_to" prompt="保险终止日" renderer="Leaf.formatDate" width="100"/>
                    <a:column name="compulsory_insurance_amount" align="right" prompt="交强险金额" renderer="Leaf.formatMoney" width="100"/>
                    <a:column name="travel_tax" align="right" prompt="车船税" renderer="Leaf.formatMoney" width="100"/>
                    <a:column name="damage_insurance_amount" align="right" prompt="车损险金额" renderer="Leaf.formatMoney" width="100"/>
                    <a:column name="third_party_insurance_amount" align="right" prompt="第三者责任险金额" renderer="Leaf.formatMoney" width="100"/>
                    <a:column name="basic_non_deductible_amount" align="right" prompt="不计免赔金额" renderer="Leaf.formatMoney" width="100"/>
                    <a:column name="pilfer_insurance_amount" align="right" prompt="盗抢险金额" renderer="Leaf.formatMoney" width="100"/>
                    <a:column name="commercial_insurance_amount" align="right" prompt="商业险" renderer="Leaf.formatMoney" width="100"/>
                    <a:column name="glass_insurance_amount" align="right" prompt="玻璃险" renderer="Leaf.formatMoney" width="100"/>
                    <a:column name="seat_insurance_amount" align="right" prompt="座位险" renderer="Leaf.formatMoney" width="100"/>
                    <a:column name="combustion_insurance_amount" align="right" prompt="自燃险" renderer="Leaf.formatMoney" width="100"/>
                    <a:column name="others_insurance_amount" align="right" prompt="其他险种" renderer="Leaf.formatMoney" width="100"/>
                    <a:column name="insure_place" prompt="投保地点" width="100"/>
                    <a:column name="first_beneficiary" prompt="第一受益人" width="100"/>
                    <a:column name="ref_v01" prompt="备注" width="200"/>
                    <a:column name="confirm_flag" prompt="保险确认" width="100"/>
                    <a:column align="center" prompt="批单更改" width="100"/>
                    <a:column name="attachment_detail" align="center" prompt="附件查看" renderer="attachment_detail_renderer" width="80"/>
                </a:columns>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>