WIDGET-CONT-CHGREQ.lview 17.3 KB
Newer Older
niminmin's avatar
niminmin 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 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 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 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 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432
<?xml version="1.0" encoding="UTF-8"?>

<!--
    $Author:
    $Date: 2018/8/2
    $Revision: 1.0
    12.合同变更查询
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure/>
    <a:view template="default" package="leaf.ui.std">
        <a:link id="widget_con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
        <a:link id="widget_con31_con_contract_info_link" url="${/request/@context_path}/modules/prj/PRJ506/virtual_contract_query.lview"/>
        <!--Beyond styles-->
        <link href="${/request/@context_path}/leafresource/hls/beyondChart/assets/css/beyond.min.css" rel="stylesheet" />
        <link href="${/request/@context_path}/leafresource/hls/beyondChart/assets/css/demo.min.css" rel="stylesheet" />
        <link href="${/request/@context_path}/leafresource/hls/beyondChart/assets/css/typicons.min.css" rel="stylesheet" />
        <link href="${/request/@context_path}/leafresource/hls/beyondChart/assets/css/animate.min.css" rel="stylesheet" />

        <!--Basic Scripts-->
        <script src="${/request/@context_path}/leafresource/hls/beyondChart/assets/js/skins.min.js"></script>
        <script src="${/request/@context_path}/leafresource/hls/beyondChart/assets/js/bootstrap.min.js"></script>
        <script src="${/request/@context_path}/leafresource/hls/beyondChart/assets/js/slimscroll/jquery.slimscroll.min.js"></script>
        <!--Beyond Scripts-->
        <script src="${/request/@context_path}/leafresource/hls/beyondChart/assets/js/beyond.min.js"></script>

        <!--Page Related Scripts-->
        <script src="${/request/@context_path}/leafresource/hls/beyondChart/assets/js/charts/morris/raphael-2.0.2.min.js"></script>
        <script src="${/request/@context_path}/leafresource/hls/beyondChart/assets/js/charts/morris/morris.js"></script>
        <script src="${/request/@context_path}/leafresource/hls/beyondChart/assets/js/charts/morris/morris-init.js"></script>
        <style>
            html,body{
            background-color:#eee;
            width:1170px;
            height:545px;
            margin: 0;
            padding: 0;
            }
            .widget_cont_chgreq{
            width:1170px;
            height:545px;
            position:relative;
            }
            .widget_cont_chgreq .left{
            width:270px;
            height:545px;
            background-color:#fff;
            float:left;
            }
            .widget_cont_chgreq .right{
            width:870px;
            height:545px;
            background-color:#fff;
            float:left;
            margin-left:30px;
            }
            .widget_cont_chgreq .hls-pagging-grid{
            width:870px;
            height:545px;
            }
            .widget_cont_chgreq .hls-pagging-grid .grid-title{
            border-bottom:4px solid #F57B69;
            height:45px;
            }
            .widget_cont_chgreq .hls-pagging-grid .grid-title img{
            width:20px;
            height:20px;
            position:relative;
            top:5px;
            }
            .widget_cont_chgreq .hls-pagging-grid .grid-title>span{
            font-family:"Helvetica Neue", "Luxi Sans", "DejaVu Sans", Tahoma, "Microsoft Yahei", "Hiragino Sans GB", sans-serif;
            font-size:13px;
            line-height:45px;
            color:#000;
            text-size-adjust:100%;
            font-weight:bold;
            }
            .widget_cont_chgreq .clickable{
            cursor:pointer;
            }
            .widget_cont_chgreq .clearFloat{
            clear:both;
            height:0;
            line-height:0;
            font-size:0
            }
            .widget_cont_chgreq .queryList .listTitle{
            border-bottom:4px solid #00B3B3;
            font-size: 13px;
            height: 40px;
            line-height: 40px;
            padding: 0 10px;
            font-weight: 600;
            }
            .widget_cont_chgreq #chgTypePie{
            width:160px;
            height:160px;
            margin-left:50px;
            }
            .widget_cont_chgreq .queryList .listTitle .right-img{
            width: 20px;
            height: 20px;
            margin:10px 10px 0 0;
            float:right;
            }
            .widget_cont_chgreq .queryList .listBody{
            padding:0 10px;
            }
            .widget_cont_chgreq .queryList .listRow{
            padding:5px;
            border-bottom:1px solid rgb(229, 229, 229);
            }
            .widget_cont_chgreq .queryList .listRow p{
            color:#000;
            font-size:13px;
            font-weight:100;
            line-height:20px;
            margin:0;
            }
            .widget_cont_chgreq .queryList .listRow .chgTypePie{
            height:230px;
            }
            .widget_cont_chgreq .queryList .listRow .selectSpan{
            display: inline-block;
            width:72px;
            height:30px;
            line-height:30px;
            text-align: center;
            border: 1px solid #CCC;
            border-radius: 4px;
            font-size: 12px;
            margin:10px 2px;
            cursor: pointer;
            background-color:#fff;
            color:#000;
            }
            .widget_cont_chgreq .queryList .listRow .smallSpan{
            width:54px;
            margin:3px 2px;
            }
            .widget_cont_chgreq .queryList .listRow .selectedSpan{
            background-color:#00b3b3;
            color:#fff;
            }
            .widget_cont_chgreq .queryList .listRow .submitBtn{
            text-align:right
            }
            .widget_cont_chgreq .queryList .listRow .submitBtn span{
            display:inline-block;
            width:72px;
            height:30px;
            line-height:30px;
            text-align: center;
            background-color:#FA6A4D;
            color:#fff;
            border-radius: 4px;
            font-size: 12px;
            margin:10px 2px;
            cursor: pointer;
            }
        </style>
        <script><![CDATA[
        //查询条件数据结构
        var queryParam={
            "timeZone":"",
            "new":0,
            "approving":0,
            "reject":0,
            "approved":0,
            "cancel":0
        };
        jQuery(document).ready(function(){
            jQuery(".listBody").on('click',function(e){
                $this=jQuery(e.target);

                //时间跨度单选点击事件
                if($this.attr("class").indexOf('timeZone')>=0){
                    var allSpans=jQuery(".timeZone");
                    for(var i=0;i<allSpans.length;i++){
                        if(allSpans[i].id!=$this.attr("id")){
                            jQuery(allSpans[i]).removeClass("selectedSpan");
                        }
                    }
                    $this.toggleClass("selectedSpan");
                    if($this.attr("class").indexOf('selectedSpan')>=0){
                        queryParam.timeZone=$this.attr("id");
                    }else{
                        queryParam.timeZone="";
                    }
                }

                //合同类型多选点击事件
                if($this.attr("id")=='new'){
                    $this.toggleClass("selectedSpan");
                    if($this.attr("class").indexOf('selectedSpan')>=0){
                        queryParam.new=1;
                    }else{
                        queryParam.new=0;
                    }
                }
                if($this.attr("id")=='approving'){
                    $this.toggleClass("selectedSpan");
                    if($this.attr("class").indexOf('selectedSpan')>=0){
                        queryParam.approving=1;
                    }else{
                        queryParam.approving=0;
                    }
                }
                if($this.attr("id")=='reject'){
                    $this.toggleClass("selectedSpan");
                    if($this.attr("class").indexOf('selectedSpan')>=0){
                        queryParam.reject=1;
                    }else{
                        queryParam.reject=0;
                    }
                }
                if($this.attr("id")=='approved'){
                    $this.toggleClass("selectedSpan");
                    if($this.attr("class").indexOf('selectedSpan')>=0){
                        queryParam.approved=1;
                    }else{
                        queryParam.approved=0;
                    }
                }
                if($this.attr("id")=='cancel'){
                    $this.toggleClass("selectedSpan");
                    if($this.attr("class").indexOf('selectedSpan')>=0){
                        queryParam.cancel=1;
                    }else{
                        queryParam.cancel=0;
                    }
                }

                //查询按钮点击事件
                if($this.attr("id")=='submitBtn'){
                    $("cont_chgreq_ds").qpara=queryParam;
                    $("cont_chgreq_ds").query();
                }
            });

        });
        function go_cont_chgreq_query(){
            <!--top.mainJumpCode('CON732',true)-->
            location.href='/modules/cont/CON732/hls_ccr_modify_entrance.lview?layout_code=CON732&function_code=CON732';
        }
        function chgreq_info_btn_renderer(record,index){
            return "<img onclick='open_contract_win(\"" + record.ds.id+ "\",\""+record.id+"\")' style='cursor:pointer;width:15px;height:15px;display:inline-block;margin:0px;' src='${base.contextPath}/leafresource/images/widget/detail.png' alt='png'/>";
        }
        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['maintain_type'] = 'UPDATE';
            param['cond_para2'] = record.get('hn_industry_classification');
            param['url_title'] = '${l:CON301.CONTRACT_DETAIL}';

            Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
            Leaf.request({
                url: $('widget_con_contract_get_layout_code_link_id').getUrl(),
                para: param,
                success: function(res) {
                    Leaf.Masker.unmask(Ext.getBody());
                    if (!res.result.layout_code) {
                        Leaf.showMessage('${l:PROMPT}', '${l:HLS.LAYOUT_CODE_IS_NULL}');
                        return;
                    }
                    param['layout_code'] = res.result.layout_code;
                    param['usage_type'] = res.result.usage_type;
                    var winid = 'hls_doc_get_layout_code_winid';
                    param['winid'] = winid;
                    param['calc_type'] = res.result.cond_para1;
                    var win;
                    win = new Leaf.Window({
                        id: winid,
                        params: param,
                        url: $('widget_con31_con_contract_info_link').getUrl(),
                        title: param['url_title'] + '(' + res.result.layout_code + ')',
                        fullScreen: true,
                        draggable: true
                    });
                    win.on('close', function() {
                        if (ds_id) {
                            $(ds_id).query();
                        }
                    });
                },
                failure: function() {
                    Leaf.Masker.unmask(Ext.getBody());
                },
                error: function() {
                    Leaf.Masker.unmask(Ext.getBody());
                },
                scope: this
            });
        }
        function chgreq_count_ds_loader(ds){
            var records=ds.data;
            var donutData=[];
            var colors=[];
            var typeInfo = [
                {
                    typeValue: "合同条款变更",
                    type: "CONTRACT_ALT",
                    color:"#E75B8D"
                },
                {
                    typeValue: "担保变更",
                    type: "GUATANTEE_ALT",
                    color:"#2EC3E8"
                },
                {
                    typeValue: "租赁物变更",
                    type: "LEASE_ALT",
                    color:"#A0D469"
                },
                {
                    typeValue: "承租人变更",
                    type: "LEASEES_ALT",
                    color:"#FA6A4D"
                },
                {
                    typeValue: "租金计划变更",
                    type: "RENT_PLAN_ALT",
                    color:"#FFCD55"
                }
            ];
            if(records!==null && records.length>0){
                records.forEach(function(i){
                    typeInfo.forEach(function(j){
                        if(i.data['ccr_type']==j.type){
                            j.value=i.data['ccr_type_count'];
                        }
                    });
                });
            }
            typeInfo.forEach(function(i){
                if(i.value==undefined){
                    i.value=0;
                }
                donutData.push({
                    label:i.typeValue,
                    value:i.value
                });
                colors.push(i.color);
            });
            console.log(typeInfo);
            Morris.Donut({
              element: 'chgTypePie',
              data:donutData,
              colors:colors
            });
        }
            ]]></script>
        <a:dataSets>
            <a:dataSet id="cont_chgreq_ds" autoQuery="true"  pageSize="9" model="cont.CON1003.cont_chgreq">
                <a:fields>
                    <a:field name="req_date"/>
                    <a:field name="ccr_type"/>
                    <a:field name="ccr_type_n"/>
                    <a:field name="req_status"/>
                    <a:field name="req_status_n"/>
                    <a:field name="change_req_id"/>
                    <a:field name="change_req_number"/>
                    <a:field name="contract_id"/>
                    <a:field name="contract_number"/>
                    <a:field name="contract_name"/>
                    <a:field name="bp_id"/>
                    <a:field name="bp_name"/>
                    <a:field name="bp_code"/>
                    <a:field name="hn_industry_classification"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="cont_chgreq_count_ds" autoQuery="true"  pageSize="9" model="cont.CON1003.cont_chgreq_count">
                <a:fields>
                    <a:field name="ccr_type"/>
                    <a:field name="ccr_type_n"/>
                    <a:field name="ccr_type_count"/>
                </a:fields>
                <a:events>
                    <a:event name="load" handler="chgreq_count_ds_loader"/>
                </a:events>
            </a:dataSet>
        </a:dataSets>
        <div class="widget_cont_chgreq">
            <div class="left queryList">
                <div class="listTitle">
                    <img class="right-img clickable" onclick="go_cont_chgreq_query()" src="${/request/@context_path}/leafresource/images/widget/search_flag.png"/>
                    <span>变更情况查询</span>
                </div>
                <div class="listBody">
                    <div class="listRow">
                        <p class="">时间跨度</p>
                        <span id="7" class="selectSpan timeZone">1周内</span>
                        <span id="30" class="selectSpan timeZone">1个月内</span>
                        <span id="90" class="selectSpan timeZone">3个月内</span>
                    </div>
                    <div class="listRow">
                        <p class="">变更情况统计</p>
                        <div class="chgTypePie" id="chgTypePie">

                        </div>
                    </div>
                    <div class="listRow">
                        <p class="">变更状态</p>
                        <span id="new" class="selectSpan smallSpan">新建</span>
                        <span id="approving" class="selectSpan smallSpan">审批中</span>
                        <span id="reject" class="selectSpan smallSpan">审批拒绝</span>
                        <span id="approved" class="selectSpan smallSpan">审批通过</span>
                        <span id="cancel" class="selectSpan smallSpan">取消</span>
                        <div class="submitBtn"><span class="" id="submitBtn">查询</span></div>
                    </div>
                </div>
            </div>
            <div class="right">
                <a:hapGrid title="合同变更信息" bindTarget="cont_chgreq_ds" titleImg="/leafresource/images/widget/contract.png" canWheel="true">
                    <a:columns>
                        <a:column name="change_req_number" prompt="合同变更编号"/>
                        <a:column name="contract_name" prompt="合同名称"/>
                        <a:column name="ccr_type_n" prompt="变更类型"/>
                        <a:column name="req_date"  prompt="变更日期"/>
                        <a:column name="bp_name"  prompt="承租人"/>
                        <a:column template="chgreq_info_btn_renderer" prompt="明细"/>
                    </a:columns>
                </a:hapGrid>
            </div>
            <div class="clearFloat"> </div>
        </div>
        <a:screenBody style="display:none"> </a:screenBody>
    </a:view>
</a:screen>