prj_project_modify_entrance.lview 11.7 KB
Newer Older
Spencer Chang's avatar
Spencer Chang committed
1 2 3 4 5 6 7 8 9
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhangxing5129  
    $Date: 2014-8-1 下午04:16:45  
    $Revision: 1.0  
    $Purpose: 项目报告维护入口界面
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true"
          trace="true">
stone's avatar
stone committed
10 11 12
    <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
13 14 15 16 17 18
    <a:view>
        <a:link id="prj_project_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code"
                modelaction="update"/>
        <a:link id="prj_project_modify_link"
                url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_create_tree_n.lview"/>
        <a:link id="car_modify_link" url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_maintain.lview"/>
19
        <a:link id="car_modify_constru_link" url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_maintain_constru.lview"/>
Spencer Chang's avatar
Spencer Chang committed
20 21 22 23 24 25 26 27 28
        <a:link id="car_modify_dff_link"
                url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_maintain.lview"/>
        <a:link id="car_modify_mananger_link"
                url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_maintain_manager.lview"/>
        <a:link id="prj_project_bp_parameter_link"
                url="${/request/@context_path}/modules/prj/PRJ501/prj_project_bp_parameter.lview"/>
        <a:link id="prj_project_modify_special_link"
                url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_maintain_special.lview"/>
        <a:link id="prj_project_close_link_id" model="prj.PRJ501.prj_project_close" modelaction="update"/>
Darming's avatar
Darming committed
29
        <a:link id="prj_quotation_print_link" url="${/request/@context_path}/modules/prj/PRJ501N/create_content_for_prj_quotation.lsc"/>
Spencer Chang's avatar
Spencer Chang committed
30 31 32 33 34 35
        <!-- <link href="${/request/@context_path}/css/lightbox.css" rel="stylesheet" type="text/css"/>
        <script src="${/request/@context_path}/javascripts/lightbox.js" type="text/javascript"/>-->
        <script type="text/javascript"><![CDATA[
        function open_project_modify_win(record_id, ds_id) {
            var record = $(ds_id).findById(record_id);
            var project_status = record.get('project_status');
36
            var url;
Spencer Chang's avatar
Spencer Chang committed
37 38 39 40 41 42 43 44 45 46
            //项目类layout_code
            if (record.get('document_type') == 'PRJ') {
                var maintain_type = 'UPDATE';
                var param = record.data;
                param['document_id'] = record.get('project_id');
                param['function_code'] = 'PRJ501D';
                param['function_usage'] = 'MODIFY';
                param['bp_class'] = 'NP';
                param['prj_bp_id'] = record.get('prj_bp_id');
                param['maintain_type'] = maintain_type;
stone's avatar
stone committed
47
                param['url_title'] = '报价申请维护';
Spencer Chang's avatar
Spencer Chang committed
48 49 50
                param['layout_debugger_flag'] = 'Y';
                hls_doc_get_layout_code('prj_project_get_layout_code_link_id', param, 'prj_project_modify_link', ds_id);
            } else if (record.get('document_type') == 'CARLS') {
lijingjing's avatar
lijingjing committed
51

52
                if (record.get('project_status') == 'APPROVED' ||record.get('project_status') == 'APPROVING'||record.get('project_status') == 'CONTRACT_CREATED' || record.get('project_status') == 'CLOSED') {
lijingjing's avatar
lijingjing committed
53
                    maintain_type = 'READONLY';
Spencer Chang's avatar
Spencer Chang committed
54
                    param = record.data;
lijingjing's avatar
lijingjing committed
55
                    param['bp_id_tenant'] = record.get('bp_id_tenant');
Spencer Chang's avatar
Spencer Chang committed
56
                    param['document_id'] = record.get('project_id');
lijingjing's avatar
lijingjing committed
57
                    param['function_usage'] = 'QUERY';
Spencer Chang's avatar
Spencer Chang committed
58 59 60
                    param['bp_class'] = 'NP';
                    param['maintain_type'] = maintain_type;
                    param['prj_bp_id'] = record.get('prj_bp_id');
stone's avatar
stone committed
61
                    param['url_title'] = '报价申请维护';
62 63 64 65 66 67 68 69
                    if(record.get('is_constru_unit') == 'Y'){
                        param['function_code'] = 'PRJ501_CONSTRU_WFL';
                        url = 'car_modify_constru_link';
                    }else{
                        param['function_code'] = 'PRJ501_WFL';
                        url = 'car_modify_link';
                    }
                    hls_doc_get_layout_code('prj_project_get_layout_code_link_id', param, url, ds_id);
Spencer Chang's avatar
Spencer Chang committed
70
                } else {
lijingjing's avatar
lijingjing committed
71
                    maintain_type = 'UPDATE';
Spencer Chang's avatar
Spencer Chang committed
72 73
                    param = record.data;
                    param['document_id'] = record.get('project_id');
lijingjing's avatar
lijingjing committed
74
                    param['function_usage'] = 'MODIFY';
Spencer Chang's avatar
Spencer Chang committed
75 76
                    param['bp_class'] = 'NP';
                    param['maintain_type'] = maintain_type;
lijingjing's avatar
lijingjing committed
77
                    param['bp_id'] = record.get('bp_id');
Spencer Chang's avatar
Spencer Chang committed
78
                    param['prj_bp_id'] = record.get('prj_bp_id');
lijingjing's avatar
lijingjing committed
79
                    param['bp_id_tenant'] = record.get('bp_id_tenant');
stone's avatar
stone committed
80
                    param['url_title'] = '报价申请维护';
81 82 83 84 85 86 87 88
                    if(record.get('is_constru_unit') == 'Y'){
                        param['function_code'] = 'PRJ500D_CONSTRU';
                        url = 'car_modify_constru_link';
                    }else{
                        param['function_code'] = 'PRJ501D';
                        url = 'car_modify_link';
                    }
                    hls_doc_get_layout_code('prj_project_get_layout_code_link_id', param, url, ds_id);
Spencer Chang's avatar
Spencer Chang committed
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
                }
            }
        }

        window['${/parameter/@layout_code}_dynamic_link_renderer'] = function (value, record, name, config_record) {
            if (name == 'project_number' && value) {
                return '<a href="javascript:open_project_modify_win(\'' + record.id + '\',\'' + record.ds.id + '\')">' + value + '</a>';
            }
            return value;
        };

        var ajax_flag = 'N';

        //关闭商机
        window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function () {
            var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project');
            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 confirm_win = Leaf.showConfirm('${l:PROMPT}', '${l:HLS.PROJECT_NUMBER}:' + record.get('project_number') + ',${l:HLS.IS_CLOSE_CONFIRM}' + '<font color="red">关闭后本项目无法再次提交!', function () {
                ajax_flag = 'Y';
                window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
                Leaf.request({
                    url: $('prj_project_close_link_id').getUrl(),
                    para: {
                        project_id: record.get('project_id')
                    },
                    success: function (res) {
                        parent.Leaf.SideBar.enable = true;
                        parent.Leaf.SideBar.show({
                            msg: '${l:HLS.SUBMIT_SUCCESS}',
                            duration: 2000
                        });
                        prj_project_result_ds.query(prj_project_result_ds.currentPage);
                        window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                    },
                    error: function (res) {
                        window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                    },
                    faliure: function () {
                        window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                    },
                    scope: this
                });
            }, function (res) {
            });
            confirm_win.on('close', function () {
                if (ajax_flag == 'N') {
                    window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
                }
            });
        };

        //商业伙伴参数修改
        window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function () {
            var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project');
            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 win = new Leaf.Window({
                id: 'prj_project_bp_parameter_window',
                url: $('prj_project_bp_parameter_link').getUrl(),
                params: {
                    project_id: record.get('project_id')
                },
                title: '${l:HLS.PROJECT_PARAMETER_UPDATE}',
                width: 620,
                height: 520
            });
            win.on('close', function () {
                prj_project_result_ds.query(prj_project_result_ds.currentPage);
            });
        };
Darming's avatar
Darming committed
170 171 172 173 174

        //报价单打印
        window['${/parameter/@layout_code}_user_button3_layout_dynamic_click'] = function () {
            var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project');
            var project_id = $(ds_id).getSelected()[0].get('project_id');
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
            //根据是否是代理店打印不同的文本
             var templet_code='';
            // if("${/model/role_info/record/@role_code}"!="0018"&&"${/model/role_info/record/@role_code}"!="0019") {
            //     templet_code='PROJECT_QUOTATION_N';
            // }

            templet_code = 'PROJECT_QUOTATION';
            var  url=$('prj_quotation_print_link').getUrl() + '?project_id=' + project_id + '&templet_code=' + templet_code;
            window.open(url, '_self');
        };
        //参考报价单打印
        window['${/parameter/@layout_code}_user_button4_layout_dynamic_click'] = function () {
            var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project');
            var project_id = $(ds_id).getSelected()[0].get('project_id');
            //根据是否是代理店打印不同的文本
            var templet_code='';
            templet_code = 'PROJECT_QUOTATION_N';
Darming's avatar
Darming committed
192 193 194
            var  url=$('prj_quotation_print_link').getUrl() + '?project_id=' + project_id + '&templet_code=' + templet_code;
            window.open(url, '_self');
        };
Spencer Chang's avatar
Spencer Chang committed
195 196 197 198 199 200 201 202
        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'], 'prj_project');

            if (ds == $(ds_id)) {
                aut_authority_list_validate_query(ds, qpara);

            }
        };
stone's avatar
stone committed
203 204 205 206
       Leaf.onReady(function(){
           //上级 btn4 可见
           if("${/model/role_info/record/@role_code}"=="0019") {
               $('PROJECT_MODIFY_ENTRANCE_user_button4').hide();
Spencer Chang's avatar
Spencer Chang committed
207

stone's avatar
stone committed
208
           }else if("${/model/role_info/record/@role_code}"=="0018"){
stone's avatar
stone committed
209 210
              var t= document.getElementById('PROJECT_MODIFY_ENTRANCE_user_button3').style.display="none";
               t.remove();
stone's avatar
stone committed
211 212 213
               $('PROJECT_MODIFY_ENTRANCE_user_button3').hide();
           }
       })
Spencer Chang's avatar
Spencer Chang committed
214 215 216 217 218 219 220 221 222 223 224 225 226
        function check_isload() {

        }

        //加载时调用(grid,table,gridBox)
        window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_load'] = function (ds, record, config_records, bp_seq) {
            clearInterval(check_isload);
        };
        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_authority_list_validate.lview?document_category=PROJECT&amp;function_code=PRJ501"/>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
    </a:view>
</a:screen>