eq_con_change_entrance.lview 6.97 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
    2014-10-21  create bu xuls for 变更申请-支付期调整 
    
 -->
<a:screen xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" customizationEnabled="true" dynamiccreateenabled="true" trace="true">
    <a:init-procedure/>
    <a:view>
        <a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
        <a:link id="eq_con_contract_modify_link" url="${/request/@context_path}/modules/cont/CON640N/eq_con_contract_query.lview"/>
        <!-- <a:link id="con_contract_modify_link" url="${/request/@context_path}/modules/cont/CON505/con_contract_modify.lview"/> -->
        <a:link id="eq_con_contract_change_link" url="${/request/@context_path}/modules/cont/CON641N/eq_con_change.lview"/>
        <a:link id="con731_create_change_link" model="cont.CON731.create_change_req" modelaction="execute"/>
        <!-- <a:link id="con_contract_change_req_link" url="${/request/@context_path}/modules/cont/CON701/con_contract_et_print.lsc"/> -->
        <script type="text/javascript"><![CDATA[
            var new_recs = []; //任务数组
            var total_index = 0;
            var current_index = 0;
            var file_path = '${/parameter/@file_path}';
            var download_arr = [];
            
            
            function open_contract_win(ds_id, record_id) {
                var record = $(ds_id).findById(record_id);
                var param = record.data;
                param['function_code'] = 'CON640';
                param['function_usage'] = 'QUERY';
                param['maintain_type'] = 'UPDATE';
                param['url_title'] = '${l:CON301.CONTRACT_DETAIL}';
                hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'eq_con_contract_modify_link', ds_id);
            }
            window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record) {
                if (name == 'contract_number' && value) {
                    return '<a href="javascript:open_contract_win(\'' + record.ds.id + '\',\'' + record.id + '\')">' + value + '</a>';
                }
                return value;
            };
            
            window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
                var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
                var prj_project_result_ds = $(ds_id);
                var records = prj_project_result_ds.getSelected();
                if (records.length != 1) {
                    Leaf.showMessage('${l:PROMPT}', '${l:HLS.SELECT_RECORD}');
                    return;
                }
                Leaf.showConfirm('${l:HLS.PROMPT}', '<font color="red">该操作将导致合同在变更期间无法进行后续操作,请谨慎操作!!!</font></br></br><font color="red">【特别注意】如果需要取消变更,请一定点击取消变更按钮!!!</font>', function() {
                    var record = records[0];
            
                    var head_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_change_req');
                    var head_record = $(head_ds_id).getAt(0);
                    if ($(head_ds_id).validate()) {
                        var contract = record.get('contract_id');
                        var ccr_document_type = head_record.get('ccr_document_type');
                        var req_date = head_record.get('req_date');
                        var description = head_record.get('description');
                        Leaf.Masker.mask(Ext.getBody());
                        Leaf.request({
                            url: $('con731_create_change_link').getUrl(),
                            para: {
                                simulation_flag: 'N',
                                contract_id: record.get('contract_id'),
                                req_type: ccr_document_type,
                                req_date: req_date,
                                description: description
                            },
                            success: function(res) {
                                var param = record.data;
                                param['change_req_id'] = res.result.change_req_id;
                                param['contract_id'] = res.result.change_req_id;
                                if (ccr_document_type == 'CONEXTHAG') {
                                    param['function_code'] = 'CON731D';
                                    param['url_title'] = '变更申请-合同变更 ';
                                } else if (ccr_document_type == 'CGUTCHAG') {
                                    param['function_code'] = 'CON731D_GUAR';
                                    param['url_title'] = '变更申请-合同变更';
                                } else {
                                    param['function_code'] = 'CON641';
                                    param['url_title'] = '变更申请-合同变更';
                                }
                                param['function_usage'] = 'MODIFY';
                                param['maintain_type'] = 'UPDATE';
                                param['document_type'] = ccr_document_type;
                                hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'eq_con_contract_change_link', ds_id);
                            },
                            failure: function() {
                                Leaf.Masker.unmask(Ext.getBody());
                            },
                            error: function() {
                                Leaf.Masker.unmask(Ext.getBody());
                            },
                            scope: this
                        });
                    }
                }, null, 300, 150);
                /* var param = record.data;
                 param['function_code'] = 'CON731D';
                 param['change_req_id'] = record.get('contract_id');
                 param['function_usage'] = 'MODIFY';
                 param['maintain_type'] = 'UPDATE';
                 param['url_title'] = '变更申请-支付期调整 ';
                 hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'con_contract_change_link', ds_id); */
            };
            
            //变更申请打印单
            window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function() {
                var xmlTemp = '';
                var fileName = '';
                xmlTemp = 'con_contract_change_req_apply.xml';
                fileName = '变更申请单.pdf';
                var url = $('con_contract_change_req_link').getUrl() + '?xmlTemp=' + xmlTemp + '&fileName=' + fileName;
                window.open(url);
            };
        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
    </a:view>
</a:screen>