con350_change_ds_inusurance.lview 4.91 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhuxianfei
    $Date: 2018年7月16日 下午2:18:45  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
    <a:init-procedure/>
    <a:view>
        <script type="text/javascript"><![CDATA[

        //锁屏
        function lock_window() {
            Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
        }

        //解屏
        function unlock_window() {
            Leaf.Masker.unmask(Ext.getBody());
        }

        //确定
        function con_confirm() {
            //
            var record = $('contract_change_result_ds').getCurrentRecord();
            var bp_id  = record.get('bp_id');
            lock_window();
            Leaf.request({
                url: '${/request/@context_path}/autocrud/cont.CON350.con350_insurance_result/update',
                para: {
                    contract_id: '${/parameter/@contract_id}',
                    bp_id: bp_id,
                    insurance_rate : record.get('insurance_rate')
                },
                success: function (res) {
                    Leaf.SideBar.show({
                        msg: '操作成功',
                        duration: 2000
                    });
                    unlock_window();
                    con_cancel();
                },
                error: function () {
                    unlock_window();

                },
                failure: function () {
                   unlock_window();

                },
                sync: true,
                scope: this
            })
            ;
        }

        //取消
        function con_cancel() {
            $('con_change_ds_ins_link_winId').close();
        }

        function changeLoad(ds){
            //
            var record = ds.getCurrentRecord();
            record.set('insurance_method','DS');
            record.set('insurance_method_n','宏菱代办');
        }

        ]]></script>
        <a:dataSets>
            <a:dataSet id="insurance_method_ds" lookupCode="INSURANCE_METHOD"/>

            <a:dataSet id="contract_change_result_ds" autoQuery="true" fetchAll="true"
                       model="cont.CON350.con350_insurance_result"
                       queryUrl="${/request/@context_path}/autocrud/cont.CON350.con350_insurance_result/query?contract_id=${/parameter/@contract_id}">
                <a:fields>
                    <a:field name="contract_number" readOnly="true"/>
                    <a:field name="bp_id_tenant_n" readOnly="true"/>
                    <a:field name="insurance_rate" required="true"/>
                    <a:field name="insurance_method"  defaultValue="DS"  readOnly="true"/>
                    <a:field name="insurance_method_n" defaultValue="宏菱代办" readOnly="true"  displayField="code_value_name"
                             options="insurance_method_ds"
                             returnField="insurance_method" valueField="code_value"/>
                    <a:field name="bp_name" lovHeight="530" lovService="cont.CON350.con350_contract_bp_lov" lovWidth="550" title="商业伙伴" required="true">
                    <a:mapping>
                        <a:map from="bp_id" to="bp_id"/>
                        <a:map from="bp_code" to="bp_code"/>
                        <a:map from="bp_name" to="bp_name"/>
                    </a:mapping>
                    </a:field>
                    <a:field name="bp_id"/>
                    <a:field name="bp_code"/>
                </a:fields>
                <a:events>
                    <a:event name="load" handler="changeLoad"/>
                </a:events>name="load"
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <!--<a:screenTitle/>-->
                <a:gridButton click="con_confirm" text="确定"/>
                <a:gridButton click="con_cancel" text="取消"/>
            </a:screenTopToolbar>
            <a:grid id="cont_change_result_ds_id" bindTarget="contract_change_result_ds" width="850" height="200"
                    navBar="true">
                <a:columns>
                    <a:column name="contract_number" prompt="合同编号" width="200"/>
                    <a:column name="bp_id_tenant_n" prompt="客户名" width="200"/>
                    <a:column name="insurance_rate" prompt="保险费率" editor="nf_id" width="200"/>
                    <a:column name="insurance_method_n" prompt="投保方式"  width="200"/>
                    <a:column name="bp_name" prompt="商业伙伴"  width="200" editor="lov_id"/>
                </a:columns>
                <a:editors>
                    <a:numberField id="nf_id" allowDecimals="true" allowNegative="false" decimalPrecision="4"/>
                    <a:comboBox id="cb_id"/>
                    <a:lov id ="lov_id"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>