bgfl_all_wfl_layout.lview 14 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 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true" trace="true">
    <a:init-procedure><![CDATA[
        
    ]]></a:init-procedure>
    <a:view>
        <a:link id="${/parameter/@layout_code}_hls_fin_doc_quotation_link_id" url="${/request/@context_path}/modules/hls/HLS500/hls_fin_doc_quotation.lsc"/>
        <a:link id="${/parameter/@layout_code}_hls_fin_calculator_update_link_id" url="${/request/@context_path}/modules/hls/HLS500N/hls_fin_calculator_update_n.lview"/>
        <a:link id="${/parameter/@layout_code}_hls_fin_calculator_readonly_link_id" url="${/request/@context_path}/modules/hls/HLS500/hls_fin_calculator_readonly.lview"/>
        <a:link id="${/parameter/@layout_code}${/parameter/@tree_code}_con500_cdd_uploadFile_id" url="${/request/@context_path}/uploadFile.lview"/>
        <a:link id="${/parameter/@layout_code}${/parameter/@tree_code}_con500_cdd_downloadFile_id" url="${/request/@context_path}/downloadFile.lview"/>
        <a:link id="${/parameter/@layout_code}${/parameter/@tree_code}_con500_prj_cdd_downloadFile_id" url="${/request/@context_path}/downloadFile.lview"/>
        <a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
        <a:link id="content_download_link_id" url="${/request/@context_path}/modules/cont/CON505/con_atm_batch_dl.lsc"/>
        <a:link id="prj_chance_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
        <a:link id="hls_bp_master_modify_link" url="${/request/@context_path}/modules/hls/HLS214N/hls_bp_master_modify.lview"/>
        <script type="text/javascript"><![CDATA[
            /*add by syj
             //desc:该页面为国资项目所有非树类的工作流审批动态页面
             */
            
            function check_releated_layout(releated_table) {
                var str = '${/parameter/@layout_code}';
                //商机
                if (str.indexOf(releated_table) >= 0) {
                    return true;
                } else {
                    return false;
                }
            }
            
            function quote_link(type, record_id) {
                var prj_quotation_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_quotation');
                var prj_quotation_record = $(prj_quotation_ds_id).findById(record_id);
                var calc_recreate_L_formula;
                var saveData = [];
                if (type == 'quote') {
                    url = $('${/parameter/@layout_code}_hls_fin_calculator_update_link_id').getUrl();
                } else {
                    url = $('${/parameter/@layout_code}_hls_fin_calculator_readonly_link_id').getUrl();
                    new Leaf.Window({
                        id: '${/parameter/@layout_code}_hls_fin_calc_readonly_link_winid',
                        params: {
                            document_id: '${/parameter/@document_id}',
                            document_category: '${/parameter/@document_category}',
                            maintain_type: 'READONLY',
                            calc_session_id: prj_quotation_record.get('calc_session_id'),
                            winId: '${/parameter/@layout_code}_hls_fin_calc_readonly_link_winid',
                            global_flag: 'Y',
                            calc_type: 'CLASSIC_CALCULATOR'
                        },
                        url: url,
                        fullScreen: true,
                        draggable: true
                    });
                    return;
                }
            }
            
            function quote_link_contract(type, record_id) {
                var prj_quotation_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_quotation');
                var prj_quotation_record = $(prj_quotation_ds_id).findById(record_id);
                var saveData = [];
                if (type == 'readOnly') {
                    url = $('${/parameter/@layout_code}_hls_fin_calculator_readonly_link_id').getUrl();
                    new Leaf.Window({
                        id: '${/parameter/@layout_code}_hls_fin_calc_readonly_link_winid',
                        params: {
                            document_id: '${/parameter/@document_id}',
                            document_category: '${/parameter/@document_category}',
                            maintain_type: 'READONLY',
                            calc_session_id: prj_quotation_record.get('calc_session_id'),
                            winId: '${/parameter/@layout_code}_hls_fin_calc_readonly_link_winid',
                            global_flag: 'Y',
                            calc_type: 'CLASSIC_CALCULATOR'
                        },
                        url: url,
                        fullScreen: true,
                        draggable: true
                    });
                    return;
                }
            }
            
            window['${/parameter/@layout_code}_con500_cdd_attachtment_upload'] = function(id, name, query_only) {
                var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name];
                if (record.get('check_id')) {
                    var url;
                    if (query_only == 'Y') {
                        url = $('${/parameter/@layout_code}${/parameter/@tree_code}_con500_cdd_downloadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id');
                    } else {
                        url = $('${/parameter/@layout_code}${/parameter/@tree_code}_con500_cdd_uploadFile_id').getUrl() + '?table_name=PRJ_CDD_ITEM_CHECK&header_id=' + record.get('check_id');
                    }
                    var win = new Leaf.Window({
                        url: url,
                        title: '${l:HLS.SUPPORTING_DOCUMENT}',
                        id: '${/parameter/@layout_code}${/parameter/@tree_code}_con_cdd_uploadFile_screen_id',
                        width: 850,
                        height: 400
                    });
            
                    win.on('close', function() {
                        record.ds.query();
                    });
                } else {
                    Leaf.showMessage('${l:HLS.PROMPT}', '请先保存!');
                }
            };
            
            //文本正本下载
            window['${/parameter/@layout_code}_con500_accessory_download'] = function(id, name, query_only) {
                var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name];
                var url = $('content_download_link_id').getUrl() + '?content_id=' + record.get('content_id') + '&contract_id=' + record.get('contract_id') + '&content_type=' + record.get('content_type');
                window.open(url, '_self');
            };
            //文本附件
            window['${/parameter/@layout_code}_con500_attachment_upload'] = function(id, name, query_only) {
                var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name];
                var url;
                if (query_only === 'Y') {
                    url = $('${/parameter/@layout_code}${/parameter/@tree_code}_con500_cdd_downloadFile_id').getUrl() + '?table_name=CON_CONTRACT_CONTENT_V&header_id=' + record.get('content_id');
                } else {
                    url = $('${/parameter/@layout_code}${/parameter/@tree_code}_con500_cdd_uploadFile_id').getUrl() + '?table_name=CON_CONTRACT_CONTENT_V&header_id=' + record.get('content_id');
                }
                var win = new Leaf.Window({
                    url: url,
                    title: '${l:HLS.SUPPORTING_DOCUMENT}',
                    id: '${/parameter/@layout_code}${/parameter/@tree_code}_con500_cdd_uploadFile_win_id',
                    width: 850,
                    height: 400
                });
            };
            //modify by liuguocai5900
            //文本附件
            window['${/parameter/@layout_code}_user_button4_layout_dynamic_click'] = function(id, name, query_only) {

                var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name];
                var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
                var ds_id_record = $(ds_id).getCurrentRecord();
                var project_id = ds_id_record.get('project_id');
                var pj_instance_id = ds_id_record.get('wfl_instance_id');
                var url;
                if (query_only === 'Y') {
                    url = $('${/parameter/@layout_code}${/parameter/@tree_code}_con500_prj_cdd_downloadFile_id').getUrl() + '?table_name=ZJ_WFL_APPROVE_RECORD&header_id=' + pj_instance_id;
                } else {
                    url = $('${/parameter/@layout_code}${/parameter/@tree_code}_con500_prj_cdd_downloadFile_id').getUrl() + '?table_name=ZJ_WFL_APPROVE_RECORD&header_id=' + pj_instance_id;
                }
                var win = new Leaf.Window({
                    url: url,
                    title: '${l:HLS.SUPPORTING_DOCUMENT}',
                    id: '${/parameter/@layout_code}${/parameter/@tree_code}_con500_prj_cdd_uploadFile_win_id',
                    width: 850,
                    height: 400
                });
            };
            
            
            
            window['${/parameter/@layout_code}_open_bp_win'] = function(id, name, query_only) {
                var prj_chance_bp_record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name];
                var param = prj_chance_bp_record.data;
                param['document_id'] = prj_chance_bp_record.get('bp_id');
                param['cond_para2'] = prj_chance_bp_record.get('bp_type');
                param['function_code'] = 'HLS306';
                param['function_usage'] = 'QUERY';
                param['url_title'] = '${l:HLS212.BP_MASTER_MAINTAIN}';
                hls_doc_get_layout_code('prj_chance_get_layout_code_link_id', param, 'hls_bp_master_modify_link', null, '${/parameter/@layout_code}', '${/parameter/@winid}');
            };
            
            window['${/parameter/@bp_seq}${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record, bp_seq) {
                window['${/parameter/@layout_code}_hls_link_render_record'][record.id + '---' + name] = record;
                var ds_id = record.ds.id;
                if (name == 'attachment') {
                    link_function = '${/parameter/@layout_code}_con500_cdd_attachtment_upload';
                    return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>';
                } else if (name == 'attach_file_name') {
                    if (value != null) {
                        var link = '${/request/@context_path}/atm_download.lsc?attachment_id=';
                        var str = value.split(';;');
                        var url = '';
                        for (var i = 0;i < str.length;i++) {
                            var temp = str[i].split('--');
                            if (!Leaf.isEmpty(temp[0])) {
                                url = url + '<a href=' + link + temp[1] + '>' + temp[0] + '</a>' + ',';
                            }
                        }
                        return url;
            
                    }
                } else if (name.indexOf('quote') >= 0) {
                    if (check_releated_layout('CHANCE')) {
                        return '<a href="javascript:quote_link(\'' + 'readOnly' + '\',\'' + record.id + '\')">报价查看</a>';
                    } else if (check_releated_layout('CONTRACT')) {
                        return '<a href="javascript:quote_link_contract(\'' + 'readOnly' + '\',\'' + record.id + '\')">报价查看</a>';
                    }
                } else if (name === 'accessory') { // 文本正本
                    link_function = '${/parameter/@layout_code}_con500_accessory_download';
                    return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>';
                } else if (name === 'attachment_upload') { // 文本附件
                    link_function = '${/parameter/@layout_code}_con500_attachment_upload';
                    return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>';
                } else if (name === 'more') {
                    link_function = '${/parameter/@layout_code}_open_bp_win';
                    return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">明细</a>';
                }
            };
            
            //保存时选择签字授权人,校验附件“签字授权书”上传  modify  by liuguocai5900
            window['${/parameter/@layout_code}_on_layout_dynamic_submitsuccess'] = function(ds, record, res) {
                window['${/parameter/@layout_code}_lock_layout_dynamic_window']();

                var contract_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
                $('${/parameter/@layout_code}_virtual_ds').setSubmitParameter('document_id', $(contract_id).getAt(0).get('contract_id'));
                $('${/parameter/@layout_code}_virtual_ds').setSubmitParameter('document_category', 'CONTRACT_SIGN_CHECK');
                window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
            
            };
        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
    </a:view>
</a:screen>