cus_contract_gps_modify.lview 2.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
<?xml version="1.0" encoding="UTF-8"?>
<!--
  create by nyl  2014-12-3 
  for contract context create
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true" trace="true">
    <a:view>
        <a:link id="con638_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
        <a:link id="cus100_excel_export_link" url="${/request/@context_path}/modules/cus/CUS100/cus_con_gps_notice_print.lsc"/>
        <a:link id="cus100_gps_notice_print_link_id" model="cus.CUS100.cus_con_gps_notice_print" modelaction="update"/>
        <script type="text/javascript"><![CDATA[
            function print() {
                var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'cus_con_contract_gps');
                var record = $(ds_id).getCurrentRecord();
            
                var contract_id = record.get('contract_id');
                var contract_number = record.get('contract_number');
                var file_name = 'GPS通知函' + contract_number;
                var url = $('cus100_excel_export_link').getUrl() + '?contract_id=' + contract_id + '&file_name=' + file_name + '&templt_name=' + 'cus_gps_notice.xml';
                window.open(url);
            
            
            }
            
            //GPS
            window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
            
                var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'cus_con_contract_gps');
            
                var record = $(ds_id).getCurrentRecord();
                record.set('_status', 'update');
                window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
                Leaf.request({
                    url: $('cus100_gps_notice_print_link_id').getUrl(),
                    para: record.data,
                    success: function(res) {
                        window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                        Leaf.SideBar.show({
                            msg: '${l:HLS.SUBMIT_SUCCESS}',
                            duration: 2000
                        });
                        print();
                    },
                    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']();
                    },
                    sync: true,
                    scope: this
                });
            
            };
        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
    </a:view>
</a:screen>