con_contract_query_entrance.lview 18.9 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 下午01:54:29  
    $Revision: 1.0  
    $Purpose: 合同维护入口界面
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true"
          trace="true">
10 11
    <a:init-procedure>
        <a:model-query model="cont.CON620.get_sys_role" rootPath="role_info"/>
12
        <a:model-query fetchAll="true" model="prj.PRJ500D.user_agent_description" rootPath="user_agent_description"/>
gzj34291's avatar
gzj34291 committed
13
        <a:model-query fetchAll="true" model="cont.CON301N.get_employee_type_code" rootPath="user_type_code"/>
14
    </a:init-procedure>
Spencer Chang's avatar
Spencer Chang committed
15 16 17 18 19 20 21 22 23 24 25 26
    <a:view>
        <a:link id="${/parameter/@layout_code}${/parameter/@pre_layout}zj_wfl_approve_history_check"
                url="${/request/@context_path}/modules/zjwfl/zj_wfl_approve_history_check.lview"/>
        <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/CON505/con_contract_modify.lview"/>
        <!-- <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_special_link2"
                url="${/request/@context_path}/modules/prj/PRJ500N/prj_project_create_special.lview"/>
        <a:link id="car_modify_mananger_link"
                url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_maintain_manager.lview"/>
27 28 29
<!--        <a:link id="car_modify_link"-->
<!--                url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_maintain_readonly.lview"/>-->
        <a:link id="car_modify_link_readonly" url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_maintain.lview"/>
Spencer Chang's avatar
Spencer Chang committed
30 31 32 33
        <a:link id="car_modify_special_link"
                url="${/request/@context_path}/modules/prj/PRJ500N/prj_project_create.lview"/>
        <a:link id="${/parameter/@layout_code}_contract_print_link_id"
                url="${/request/@context_path}/modules/cont/CON301N/con_contract_print.lview"/>
niminmin's avatar
niminmin committed
34 35
        <a:link id="${/parameter/@layout_code}con_contract_query_link"
                url="${/request/@context_path}/modules/cont/CON3200/con_re_incept_modify.lview"/>
liyuan.chen's avatar
liyuan.chen committed
36 37
        <a:link id="${/parameter/@layout_code}_contract_seal_link_id" url="${/request/@context_path}/modules/cont/CON301N/con_contract_finish_seal_info.lview"/>
        <a:link id="con_contract_finish_print_link_id" url="${/request/@context_path}/modules/csh/CSH501/csh_payment_req_history_pdf_print.lsc"/>
38 39 40
        <!--        <script src="${/request/@context_path}/javascripts/hap/dynamicStopAutoQuery.js" type="text/javascript"/>-->
        <a:link id="${/parameter/@layout_code}_contract_print_signatures_link_id"
                url="${/request/@context_path}/modules/cont/CON301N/con_contract_print_signatures.lview"/>
Spencer Chang's avatar
Spencer Chang committed
41 42
        <script type="text/javascript"><![CDATA[

25484's avatar
25484 committed
43
        // stopDymanicAutoQuery('${/parameter/@layout_code}', 'G_CONTRACT_RESULT', 'con_contract');
44 45 46 47 48 49 50 51 52 53 54 55
        Leaf.onReady(function() {
            if("${/model/role_info/record/@role_code}"!="0018"&&"${/model/role_info/record/@role_code}"!="0019") {
                document.getElementById("CONTRACT_QUERY_ENTRANCE_F_QUERY_NULL_AGENT_EXTRA_NAM_prompt").style.display = "";
                document.getElementById("CONTRACT_QUERY_ENTRANCE_F_QUERY_NULL_AGENT_EXTRA_NAM").style.display = "";
                document.getElementById("CONTRACT_QUERY_ENTRANCE_F_QUERY_NULL_BP_ID_AGENT_LEVEL1_prompt").style.display = "";
                document.getElementById("CONTRACT_QUERY_ENTRANCE_F_QUERY_NULL_BP_ID_AGENT_LEVEL1").style.display = "";
            } else {
                document.getElementById("CONTRACT_QUERY_ENTRANCE_F_QUERY_NULL_AGENT_EXTRA_NAM_prompt").style.display = "none";
                document.getElementById("CONTRACT_QUERY_ENTRANCE_F_QUERY_NULL_AGENT_EXTRA_NAM").style.display = "none";
                document.getElementById("CONTRACT_QUERY_ENTRANCE_F_QUERY_NULL_BP_ID_AGENT_LEVEL1_prompt").style.display = "none";
                document.getElementById("CONTRACT_QUERY_ENTRANCE_F_QUERY_NULL_BP_ID_AGENT_LEVEL1").style.display = "none";
            }
56
            //深圳美鹏和hcs显示分公司,其他隐藏
57 58 59 60 61
            var bp_code = '${/model/user_agent_description/record/@bp_code}';
            if (!Ext.isEmpty(bp_code) && bp_code !== 'D00010001' && bp_code !== 'D00000009') {
                $('${/parameter/@layout_code}_G_CONTRACT_RESULT_con_contract_layout_grid_id').hideColumn('branch_code');
                $('${/parameter/@layout_code}_G_CONTRACT_RESULT_con_contract_layout_grid_id').hideColumn('branch_code_n');
            }
62
            //dev---环境得code
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
            // if (!Ext.isEmpty(bp_code)&&bp_code!== 'C00010168') {
            //     $('CONTRACT_QUERY_ENTRANCE_G_CONTRACT_RESULT_con_contract_layout_grid_id').hideColumn('branch_code_n');
            //     $('CONTRACT_QUERY_ENTRANCE_G_CONTRACT_RESULT_con_contract_layout_grid_id').hideColumn('branch_code');
            // }
            //dev---环境得code
            // if (!Ext.isEmpty(bp_code)) {
            //     if (bp_code == 'C00010168' || bp_code == 'C00010198' || bp_code == 'C00010170') {
            //         $('CONTRACT_QUERY_ENTRANCE_G_CONTRACT_RESULT_con_contract_layout_grid_id').showColumn('large_balance_n');
            //         $('CONTRACT_QUERY_ENTRANCE_G_CONTRACT_RESULT_con_contract_layout_grid_id').showColumn('large_balance');
            //     }else {
            //         $('CONTRACT_QUERY_ENTRANCE_G_CONTRACT_RESULT_con_contract_layout_grid_id').hideColumn('large_balance_n');
            //         $('CONTRACT_QUERY_ENTRANCE_G_CONTRACT_RESULT_con_contract_layout_grid_id').hideColumn('large_balance');
            //     }
            // }
            if (!Ext.isEmpty(bp_code)) {
                if (bp_code == 'D00000041' || bp_code == 'D00010001' || bp_code == 'D00000026') {
                    $('CONTRACT_QUERY_ENTRANCE_G_CONTRACT_RESULT_con_contract_layout_grid_id').showColumn('large_balance_n');
                    $('CONTRACT_QUERY_ENTRANCE_G_CONTRACT_RESULT_con_contract_layout_grid_id').showColumn('large_balance');
                    document.getElementById('CONTRACT_QUERY_ENTRANCE_F_QUERY_NULL_LARGE_BALANCE_prompt').style.display = 'block';
                    document.getElementById('CONTRACT_QUERY_ENTRANCE_F_QUERY_NULL_LARGE_BALANCE').style.display = 'block';

                }else {
                    $('CONTRACT_QUERY_ENTRANCE_G_CONTRACT_RESULT_con_contract_layout_grid_id').hideColumn('large_balance_n');
                    $('CONTRACT_QUERY_ENTRANCE_G_CONTRACT_RESULT_con_contract_layout_grid_id').hideColumn('large_balance');

                    document.getElementById('CONTRACT_QUERY_ENTRANCE_F_QUERY_NULL_LARGE_BALANCE_prompt').style.display = 'none';
                    document.getElementById('CONTRACT_QUERY_ENTRANCE_F_QUERY_NULL_LARGE_BALANCE').style.display = 'none';

                }
            }
93

94
        });
Spencer Chang's avatar
Spencer Chang committed
95 96 97
        function open_contract_win(ds_id, record_id) {
            var record = $(ds_id).findById(record_id);
            var param = record.data;
niminmin's avatar
niminmin committed
98
          //  param['function_code'] = 'CON301';
Spencer Chang's avatar
Spencer Chang committed
99
            param['function_usage'] = 'QUERY';
niminmin's avatar
niminmin committed
100
            param['function_code'] = 'CON3200Q';
Spencer Chang's avatar
Spencer Chang committed
101 102
            param['maintain_type'] = 'QUERY';
            param['url_title'] = '${l:CON301.CONTRACT_DETAIL}';
niminmin's avatar
niminmin committed
103 104 105

            //hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'con_contract_modify_link', null);
            hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, '${/parameter/@layout_code}con_contract_query_link', ds_id);
Spencer Chang's avatar
Spencer Chang committed
106 107 108 109 110
        }

        function open_project_Window(record_id, ds_id) {
            var record = $(ds_id).findById(record_id);
            //项目类layout_code
niminmin's avatar
niminmin committed
111
            maintain_type = 'READONLY';
Spencer Chang's avatar
Spencer Chang committed
112
            param = record.data;
113
            param['hide_flag'] = 'Y';
Spencer Chang's avatar
Spencer Chang committed
114
            param['document_id'] = record.get('project_id');
niminmin's avatar
niminmin committed
115 116
            param['function_code'] = 'PRJ501_WFL';
            param['function_usage'] = 'QUERY';
Spencer Chang's avatar
Spencer Chang committed
117 118
            param['maintain_type'] = maintain_type;
            param['url_title'] = '${l:HLS.PROJECT_MAITAIN}';
119
            hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'car_modify_link_readonly', ds_id);
Spencer Chang's avatar
Spencer Chang committed
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134


        }

        function open_bs_Window(record_id, ds_id) {

            var record = $(ds_id).findById(record_id);
            var param = record.data;
            param['function_code'] = 'CON301BS';
            param['function_usage'] = 'QUERY';
            param['maintain_type'] = 'QUERY';
            param['contract_id'] = record.get('contract_id');
            param['url_title'] = 'BS明细';
            hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'con_contract_modify_link', ds_id);
        }
liyuan.chen's avatar
liyuan.chen committed
135
        function open_seal_win(record_id, ds_id) {
Spencer Chang's avatar
Spencer Chang committed
136

liyuan.chen's avatar
liyuan.chen committed
137 138 139 140 141 142 143 144 145
            var record = $(ds_id).findById(record_id);
            var win = new Leaf.Window({
                id: 'con_contract_seal_win_id',
                params: {
                    contract_id: record.get('contract_id'),
                    winid: 'con_contract_seal_win_id'
                },
                url: $('${/parameter/@layout_code}_contract_seal_link_id').getUrl(),
                title: '用印信息',
liyuan.chen's avatar
liyuan.chen committed
146
                width: 1240,
liyuan.chen's avatar
liyuan.chen committed
147 148 149
                height: 350
            });
        }
liyuan.chen's avatar
liyuan.chen committed
150 151 152 153 154 155
        /*
         @Modified: Liyuan.Chen
         @Date: 2020/5/18
         @Description: _self 换成 _blank
         @Param:
         */
liyuan.chen's avatar
liyuan.chen committed
156 157 158 159
        function download_recovery(record_id, ds_id){
            var record = $(ds_id).findById(record_id);
            var contract_id = record.get('contract_id');
            var url_l = $('con_contract_finish_print_link_id').getUrl() + '?document_id=' + contract_id + '&document_table=CON_CONTRACT_FINISH&batch_flag=Y&source_type=COMMON';
liyuan.chen's avatar
liyuan.chen committed
160 161 162 163
            // window.open(href = url_l, target = "_self");
            var OpenWindow = window.open(href = url_l, target = "_blank");
            //OpenWindow.alert('正在下载...');

liyuan.chen's avatar
liyuan.chen committed
164 165 166 167 168 169
        }

        function download_ownership(record_id, ds_id){
            var record = $(ds_id).findById(record_id);
            var contract_id = record.get('contract_id');
            var url_l = $('con_contract_finish_print_link_id').getUrl() + '?document_id=' + contract_id + '&document_table=CON_CONTRACT_FINISH_LEASE&batch_flag=Y&source_type=COMMON';
liyuan.chen's avatar
liyuan.chen committed
170
            window.open(href = url_l, target = "_blank");
liyuan.chen's avatar
liyuan.chen committed
171
        }
Spencer Chang's avatar
Spencer Chang committed
172 173 174 175 176 177 178 179 180 181 182

        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>';
            }
            if (name == 'project_id_c' && value) {
                return '<a href="javascript:open_project_Window(\'' + record.id + '\',\'' + record.ds.id + '\')">' + value + '</a>';
            }
            if (name == 'bs_link') {
                return '<a href="javascript:open_bs_Window(\'' + record.id + '\',\'' + record.ds.id + '\')">明细</a>';
            }
183
            //modify by lihh 显示字段调整
184
            if(record.get('contract_status') == 'TERMINATE' || record.get('contract_status') == 'INCEPT' || record.get('contract_status') == 'TERMINATING' || record.get('contract_status') == 'ET'
185
                || record.get('contract_status') == 'ETING' || record.get('contract_status') == 'REPURING' || record.get('contract_status') == 'REPUR'){
liyuan.chen's avatar
liyuan.chen committed
186 187 188 189 190 191 192 193 194 195 196
                if(name == 'con_seal_link'){
                    return '<a href="javascript:open_seal_win(\'' + record.id + '\',\'' + record.ds.id + '\')">用印信息</a>';
                }
                if(name == 'rent_recovery_link'){
                    return '<a href="javascript:download_recovery(\'' + record.id + '\',\'' + record.ds.id + '\')">附件</a>';
                }
                if(name == 'ownership_link'){
                    return '<a href="javascript:download_ownership(\'' + record.id + '\',\'' + record.ds.id + '\')">附件</a>';
                }
            }

Spencer Chang's avatar
Spencer Chang committed
197 198 199 200 201 202 203 204 205 206
            return value;
        };
        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)) {
                aut_authority_list_validate_query(ds, qpara);

            }

207
            //ds.setQueryParameter('__async__', 'Y');
Spencer Chang's avatar
Spencer Chang committed
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263
        };

        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 grid_id = ds_id.replace('ds', 'layout_grid_id');
            $(grid_id)._export();
        };

        window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function () {
            var result_ds = $('CONTRACT_QUERY_ENTRANCE_G_CONTRACT_RESULT_con_contract_ds');
            var record = result_ds.getCurrentRecord();
            var document_id = record.get('contract_id');
            var contract_number = record.get('contract_number');
            var contract_name = record.get('contract_name');
            var win = new Leaf.Window({
                id: 'con_contract_print_win_id',
                params: {
                    contract_id: record.get('contract_id'),
                    winid: 'con_contract_print_win_id',
                    contract_number: contract_number,
                    contract_name: contract_name
                },
                url: $('${/parameter/@layout_code}_contract_print_link_id').getUrl(),
                title: '打印支付计划',
                width: 1300,
                height: 550
            });
            //在关闭页面之后,刷新一下ds
            win.on('close', function () {

            });
        };

        //单据跟踪
        window['${/parameter/@layout_code}_user_button3_layout_dynamic_click'] = function () {
            // var prj_project_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project');
            // var records = $('prj_project_ds_id').getSelected();
            var ds = $('CONTRACT_QUERY_ENTRANCE_G_CONTRACT_RESULT_con_contract_ds');
            var records = ds.getSelected();
            if (records.length != 1) {
                Leaf.showMessage('提示', '请选择一条数据!');
                return;
            }
            var instance_id = records[0].get('wfl_instance_id');
            var win = new Leaf.Window({
                id: 'history_check',
                url: $('${/parameter/@layout_code}${/parameter/@pre_layout}zj_wfl_approve_history_check').getUrl(),
                params: {
                    instance_id: instance_id
                },
                title: '单据历史查看',
                height: 500,
                width: 860,
                fullScreen: true
            });
        };
264 265 266

        window['${/parameter/@layout_code}_user_button4_layout_dynamic_click'] = function () {
            debugger;
267 268 269 270 271 272
			//modify by 18938 I-7158
			var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
			var record = $(ds_id).getSelected()[0];
			var url;
			url ='${/request/@context_path}/con/contract/conExportExcel?contractId=' + record.get('contract_id');
			window.open(href = url);
273

274

275 276
            //window.location.href='${/request/@context_path}/con/contract/conExportExcel?contractId='+record.get('contract_id');
        };
277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293
        //返还金通知打印
        window['${/parameter/@layout_code}_user_button9_layout_dynamic_click'] = function () {
            debugger;
            var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
            var cur_record = $(ds_id).getSelected()[0];
            var rl_flag = cur_record.get("rl_flag");
            if(rl_flag == 'Y'){
                var document_id = cur_record.get("contract_id");
                var to_file_name = '返还租金通知'+ cur_record.get("contract_number") + '.docx'
                var url = $('rl_notice_print_link').getUrl() + '?document_id=' + document_id + '&document_table=CON_RL_NOTICE&file_path=${/parameter/@file_path}&batch_flag=Y&source_type=COMMON&to_file_name='+to_file_name;
                window.open(href = url, target = "_blank");
            }else if(rl_flag == 'N'){
                Leaf.showMessage('提示', '请选择是日立为优质客户付租金的合同!');
                return;
            }
        };
	 window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_load'] = function (ds, record, config_records, bp_seq) {
gzj34291's avatar
gzj34291 committed
294 295 296 297 298 299 300 301

            //代理店隐藏,管理员和宏菱员工展示
            var employee_type_code = '${/model/user_type_code/record/@employee_type_code}';
            var rood_code = "${/model/role_info/record/@role_code}";
            if (employee_type_code !='STAFF' && rood_code != '0017' && rood_code != 'HAND') {
                $('${/parameter/@layout_code}_G_CONTRACT_RESULT_con_contract_layout_grid_id').hideColumn('tj_score');
                $('${/parameter/@layout_code}_G_CONTRACT_RESULT_con_contract_layout_grid_id').hideColumn('score_result');
                $('${/parameter/@layout_code}_G_CONTRACT_RESULT_con_contract_layout_grid_id').hideColumn('lease_item_location');
lizhe's avatar
lizhe committed
302 303
            }

gzj34291's avatar
gzj34291 committed
304 305

        }
306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334

        //对账单打印加盖公章
        window['${/parameter/@layout_code}_user_button5_layout_dynamic_click'] = function () {
            var ds = $('CONTRACT_QUERY_ENTRANCE_G_CONTRACT_RESULT_con_contract_ds');
            var records = ds.getSelected();
            if (records.length != 1) {
                Leaf.showMessage('提示', '请选择一条数据!');
                return;
            }
            var contract_id = records[0].get('contract_id');
            var contract_number = records[0].get('contract_number');
            var contract_name = records[0].get('contract_name');
            var tenant_name = records[0].get('bp_id_tenant_n');
            var win = new Leaf.Window({
                id: 'contract_print_signatures',
                url: $('${/parameter/@layout_code}_contract_print_signatures_link_id').getUrl(),
                params: {
                    contract_id: contract_id,
                    contract_number: contract_number,
                    contract_name: contract_name,
                    tenant_name: tenant_name,
                    winid : 'contract_print_signatures_winid'
                },
                title: '对账单打印',
                height: 500,
                width: 800
            });

        };
Spencer Chang's avatar
Spencer Chang committed
335 336 337 338 339 340
        ]]></script>
        <a:screen-include
                screen="modules/cont/CON500/con_contract_authority_list_validate.lview?document_category=CONTRACT&amp;function_code=CON501"/>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
    </a:view>
</a:screen>