hn_contract_quotation_detail.lview 7.85 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: wangwei  
    $Date: 2016-5-30 下午5:01:18  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" dynamiccreateenabled="true" trace="true">
    <a:view>
        <a:link id="hn010d_cancel_contract_quo_link_id" model="hn.HN010.hn_contract_quotation" modelaction="delete"/>
        <a:link id="hn010d_submit_contract_quo_link_id" model="hn.HN010.hn_contract_quotation" modelaction="execute"/>
        <a:link id="hls_fin_calculator_update_link_id" url="${/request/@context_path}/modules/hls/HLS500N/hls_fin_calculator_update_n.lview"/>
        <a:link id="hls_fin_calculator_query_link_id" url="${/request/@context_path}/modules/hls/HLS500/hls_fin_calculator_readonly.lview"/>
        <script type="text/javascript"><![CDATA[
            //撤销变更
            window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
                var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hn_contract_quotation');
                if ($(ds_id).validate()) {
                    var record = $(ds_id).getAt(0);
                    Leaf.showConfirm('${l:HLS.PROMPT}', '确定撤销当前单据吗?', function() {
                        window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
                        Leaf.request({
                            url: $('hn010d_cancel_contract_quo_link_id').getUrl(),
                            para: {
                                quotation_id: record.get('quotation_id')
                            },
                            success: function(res) {
                                window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                                var param = {};
                                $('${/parameter/@winid}').close();
                            },
                            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
                        });
                    });
                }
            };
            
            //调整报价
            window['${/parameter/@layout_code}_quote_layout_dynamic_click'] = function() {
                var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hn_contract_quotation');
                if (ds_id) {
                    var record = $(ds_id).getAt(0);
                    if ('${/parameter/@function_code}' == 'HN010D') {
                        var url = $('hls_fin_calculator_update_link_id').getUrl();
                        var calc_recreate_L_formula = 'N';
                        var win = new Leaf.Window({
                            id: 'hls_fin_calc_quotation_link_winid',
                            params: {
                                document_id: record.get('quotation_id'),
                                document_category: 'CONTRACT_QUOTATION',
                                maintain_type: 'MODIFY',
                                calc_session_id: record.get('calc_session_id'),
                                //quotation_id: quotation_id,
                                dsId: '${/parameter/@layout_code}_G_NEW_CASHFLOW_hls_fin_calculator_ln_ds',
                                winId: 'hls_fin_calc_quotation_link_winid',
                                global_flag: 'Y',
                                id_num: 0,
                                calc_type: 'CLASSIC_CALCULATOR',
                                recreate_L_formula: calc_recreate_L_formula
                            },
                            url: url,
                            fullScreen: true,
                            draggable: true
                        });
                        win.on('close', function() {
                            $('${/parameter/@layout_code}_G_HIS_CASHFLOW_hls_fin_calculator_ln_ds').query();
                            $('${/parameter/@layout_code}_G_NEW_CASHFLOW_hls_fin_calculator_ln_ds').query();
            
                        });
                    }else {
                    //不可维护主报价
                    var win_query = new Leaf.Window({
                        id: 'hls_fin_calc_quotation_link_query_winid',
                        params: {
                            document_id: record.get('quotation_id'),
                            document_category: 'CONTRACT_QUOTATION',
                            maintain_type: 'QUERY',
                            calc_session_id: record.get('calc_session_id'),
                            // quotation_id: record.get('quotation_id'),
                            // dsId: quotation_ds_id,
                            winId: 'hls_fin_calc_quotation_link_query_winid',
                            global_flag: 'Y',
                            id_num: 0,
                            calc_type: 'CLASSIC_CALCULATOR'
                            //recreate_L_formula: calc_recreate_L_formula
                        },
                        url: $('hls_fin_calculator_query_link_id').getUrl(),
                        fullScreen: true,
                        draggable: true
                    });
                    win_query.on('close', function() {
                        $('${/parameter/@layout_code}_G_HIS_CASHFLOW_hls_fin_calculator_ln_ds').query();
                        $('${/parameter/@layout_code}_G_NEW_CASHFLOW_hls_fin_calculator_ln_ds').query();
                    });
                }
                } 
            };
            
            //提交审批
            window['${/parameter/@layout_code}_submit_approval_layout_dynamic_click'] = function() {
                var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hn_contract_quotation');
                if ($(ds_id).validate()) {
                    var record = $(ds_id).getAt(0);
                    Leaf.showConfirm('${l:HLS.PROMPT}', '确定提交审批吗?', function() {
                        window['${/parameter/@bp_seq}${/parameter/@layout_code}_lock_layout_dynamic_window']();
                        Leaf.request({
                            url: $('hn010d_submit_contract_quo_link_id').getUrl(),
                            para: {
                                quotation_id: record.get('quotation_id')
                            },
                            success: function(res) {
                                window['${/parameter/@bp_seq}${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                                var param = {};
                                $('${/parameter/@winid}').close();
                            },
                            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
                        });
                    });
                }
            };
            
            //新增时调用
            window['${/parameter/@layout_code}_on_layout_dynamic_grid_add'] = function(ds, record, config_records, bp_seq) {
            	record.set('contract_id', '${/parameter/@contract_id}');
               };
        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
    </a:view>
</a:screen>