contract_cost_scene.lview 3.24 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
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true" trace="true">
    <a:view>
        <a:link id="get_xml" model="cont.CON316.contract_cost_scene" modelaction="execute"/>
        <script type="text/javascript"><![CDATA[
        window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
            window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
            getXml();
            $('${/parameter/@layout_code}_save').disable();
            $('${/parameter/@layout_code}_user_button1').disable();
        };

        function getXml() {
            var req_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_cost_support');
            var req_record = $(req_ds_id).getCurrentRecord();
            var contract_cost_id = req_record.get('contract_cost_id');
            if (req_record.dirty) {
                Leaf.showMessage('${l:HLS.PROMPT}', '页面数据存在修改,请先保存再发起起案!');
                window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                return;
            }
                Leaf.request({
                    url: $('get_xml').getUrl(),
                    para: {
                        contract_cost_id: contract_cost_id,
                        interface_name: '${/parameter/@case_type}'
                    },
                    success: function(res) {
                        getUrl(res.result.xml)
                        window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                    },
                    failure: function() {
                        window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                    },
                    error: function() {
                        window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                    },
                    scope: this
                });

        }

        function getUrl(xml) {
            Leaf.request({
                url: '${/request/@context_path}/doodream/post/url',
                para: {
                    xml: xml
                },
                success: function(res) {
                    window.open(res.message, "", "width=940, height=650, scrollbars=yes, toolbar=no, location=no, status=no, menubar=no");
                    Leaf.SideBar.show({
                        msg: '${l:HLS.SUBMIT_SUCCESS}',
                        duration: 2000
                    });
                },
                failure: function() {
                    Leaf.SideBar.show({
                        msg: 'failure',
                        duration: 2000
                    });
                },
                error: function() {
                    Leaf.SideBar.show({
                        msg: 'error',
                        duration: 2000
                    });
                },
                scope: this
            });
        }

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