hls_ccr_modify_entrance.lview 8.69 KB
Newer Older
Spencer Chang's avatar
Spencer Chang committed
1 2
<?xml version="1.0" encoding="UTF-8"?>
<!--
3
    2019-09 变更申请-维护
Spencer Chang's avatar
Spencer Chang committed
4 5
 -->
<a:screen xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" customizationEnabled="true" dynamiccreateenabled="true" trace="true">
6 7 8
    <a:init-procedure>
        <a:model-query model="cont.CON620.get_sys_role" rootPath="role_info"/>
    </a:init-procedure>
Spencer Chang's avatar
Spencer Chang committed
9 10 11 12 13 14 15 16 17 18 19 20
    <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="con_contract_modify_link" url="${/request/@context_path}/modules/cont/CON501N/con_contract_modify.lview"/>
        <a:link id="con_contract_change_link" url="${/request/@context_path}/modules/cont/CON731/hls_con_contract_change_detail.lview"/>
        <a:link id="hls_ccr_modify_wfl_msg_link" url="${/request/@context_path}/modules/cont/CON732/hls_ccr_modify_wfl_msg_detail.lview"/>
        <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 = [];
21 22 23 24 25 26 27 28 29 30 31

        Leaf.onReady(function() {
            if("${/model/role_info/record/@role_code}"!="0018"&&"${/model/role_info/record/@role_code}"!="0019") {
                document.getElementById("CON736_F_QUERY_NULL_BP_ID_AGENT_LEVEL1_prompt").style.display = "";
                document.getElementById("CON736_F_QUERY_NULL_BP_ID_AGENT_LEVEL1").style.display = "";
            } else {
                document.getElementById("CON736_F_QUERY_NULL_BP_ID_AGENT_LEVEL1_prompt").style.display = "none";
                document.getElementById("CON736_F_QUERY_NULL_BP_ID_AGENT_LEVEL1").style.display = "none";
            }

        });
Spencer Chang's avatar
Spencer Chang committed
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
            
            function open_contract_win(ds_id, record_id) {
                var record = $(ds_id).findById(record_id);
                var param = record.data;
                param['function_code'] = 'CON301';
                param['function_usage'] = 'QUERY';
                param['download'] = 'Y';
                param['maintain_type'] = 'UPDATE';
                param['url_title'] = '${l:CON301.CONTRACT_DETAIL}';
                hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'con_contract_modify_link', ds_id);
            }
            
            function open_change_detail(ds_id, record_id) {
                var record = $(ds_id).findById(record_id);
                var param = record.data;
                param['change_req_id'] = record.get('contract_id');
                param['contract_id'] = record.get('contract_id');
                param['function_usage'] = 'MODIFY';
                param['maintain_type'] = 'UPDATE';
                param['function_code'] = 'CON732D_BASIC';
                param['url_title'] = '变更申请-合同变更';
                param['document_type'] = record.get('ccr_document_type');
                hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'con_contract_change_link', ds_id);
            }
            
            //工作流审批记录
            
            function open_wfl_msg_detail(ds_id, record_id) {
                var record = $(ds_id).findById(record_id);
                var req_wfl_instance_id = record.get('req_wfl_instance_id');
                new Leaf.Window({
                    id: 'open_wfl_msg_win',
                    url: $('hls_ccr_modify_wfl_msg_link').getUrl(),
                    params: {
                        instance_id: req_wfl_instance_id,
                        winId: 'open_wfl_msg_win'
                    },
                    width: '800',
                    height: '400'
                });
            }
            
            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>';
                }
                /* else if (name == 'change_req_number' && value) {
                 return '<a href="javascript:open_change_detail(\'' + record.ds.id + '\',\'' + record.id + '\')">' + value + '</a>';
                 } else if (name == 'wfl_msg_detail') {
                 return '<a href="javascript:open_wfl_msg_detail(\'' + record.ds.id + '\',\'' + record.id + '\')">审批记录</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;
                }
                var record = records[0];
            
                var req_status = record.get('req_status');
                var param = record.data;
                var req_status = record.get('req_status');
99
                param['change_req_id'] = record.get('change_req_id');
100
                param['source_contract_id'] = record.get('source_contract_id');//變更前源合同id
101
                param['contract_id'] = record.get('change_req_id');
Spencer Chang's avatar
Spencer Chang committed
102 103
                param['req_status'] = req_status;
            
104
                if (req_status == 'APPROVED' || req_status == 'APPROVING' || req_status == 'CANCEL' || req_status == 'REJECT' ) {
Spencer Chang's avatar
Spencer Chang committed
105
                    param['maintain_type'] = 'READONLY';
106
                    param['function_usage'] = 'QUERY';
Spencer Chang's avatar
Spencer Chang committed
107 108
                } else {
                    param['maintain_type'] = 'UPDATE';
109
                    param['function_usage'] = 'MODIFY';
Spencer Chang's avatar
Spencer Chang committed
110
                }
111 112
                if (record.get('ccr_document_type') == 'CUT_CHAG') {
                    param['function_code'] = 'CON733CF';
113
                    param['url_title'] = '变更申请-合同租金计划变更';
114 115
                } else if (record.get('ccr_document_type') == 'LEASE_CHAG') {
                    param['function_code'] = 'CON733BPT';
116
                    param['url_title'] = '变更申请-合同承租人变更';
117 118 119
                } else if (record.get('ccr_document_type') == 'ACC_CHAG') {
                    param['function_code'] = 'CON733BPB';
                    param['url_title'] = '变更申请-合同回款账户变更';
Spencer Chang's avatar
Spencer Chang committed
120 121 122 123 124 125
                }
                param['document_type'] = record.get('ccr_document_type');
                hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'con_contract_change_link', ds_id);
            };
            
            //变更申请打印单
126 127 128 129 130 131 132 133
            // 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);
            // };
134
            //合同变更维护和查询功能那里,各个角色只能看到自己角色提交的变更申请
Spencer Chang's avatar
Spencer Chang committed
135 136 137
            window['${/parameter/@layout_code}_on_layout_dynamic_grid_query'] = function(ds, qpara, bp_seq) { //查询权限
                var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
                if (ds == $(ds_id)) {
138 139 140 141 142 143 144 145 146 147 148 149 150 151
                   //aut_authority_list_validate_query(ds, qpara);
                    var role_code='${/model/role_info/record/@role_code}';
                        if(role_code=='0007'){
                            $(ds_id).setQueryParameter('ccr_document_type', 'ACC_CHAG');
                        }else if(role_code=='0008'){
                            $(ds_id).setQueryParameter('ccr_document_type', 'LEASE_CHAG');
                        }
                        else if(role_code=='0019'){
                            $(ds_id).setQueryParameter('change_created_by', '${/session/@user_id}');
                        }


               }

Spencer Chang's avatar
Spencer Chang committed
152 153 154 155 156 157
            };
        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
        <a:screen-include screen="modules/cont/CON500/con_contract_authority_list_validate.lview?document_category=CHANGE_REQUEST&amp;function_code=CON732"/>
    </a:view>
</a:screen>