WIDGET-CONT-RECENT-TRAN.lview 16.2 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
<?xml version="1.0" encoding="UTF-8"?>

<!--
    $Author:
    $Date: 2018/8/2
    $Revision: 1.0
    最近成交合同
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure/>
    <a:view template="default" package="leaf.ui.std">
        <a:link id="leaf_con_prj910_project_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
        <a:link id="leaf_con_con301_con_contract_info_link" url="${/request/@context_path}/modules/prj/PRJ506/virtual_contract_query.lview"/>
        <style>
            html,body{
            width:240px;
            height:491px;
            margin: 0;
            padding: 0;
            }
            .widget_cont_recent_tran{
            box-sizing:border-box;
            width:240px;
            height:491px;
            background-color:#fff;
            position:relative;
            border:1px solid #F0F0F3;
            padding:0;
            cursor:default;
            }
            .widget_cont_recent_tran .widget_label{
            position:absolute;
            width:29px;
            height:4px;
            margin-top: 4px;
            left:66px;
            background-color:#657efe;
            }
            .widget_cont_recent_tran .widget_border{
                margin-top: 19px;
                width: 228px;
                margin-left: 5px;
                border: dashed 1px #ccc;
                opacity: 0.54;
                height: 5px;
            }
            .widget_cont_recent_tran .cont_recent-img {
            float: left;
            margin-left:20px;
            height: 29px;
            width: 23px;
                margin-top: 17px;
            }
            .widget_cont_recent_tran .divide-line{
                float: left;
                width: 218px;
                height: 5px;
                background-color: #666666;
                opacity: 0.03;
                margin-left: 10px;
            }
            .widget_cont_recent_tran .cont_recent-img .img-content {
            width: 23px;
            margin-left: 0px;
            height: 29px;

            }

            .widget_cont_recent_tran .cont_recent-img .img-content img {
            width: 17px;
            /*height:29px;*/
            margin-top: 0px;

            }
            .widget_cont_recent_tran .company_info{
            width:240px;
            /*height:71px;*/
            }
            .widget_cont_recent_tran .company_img{
            float:left;
            margin-left:17px;
            margin-top:12px;
            width:30px;
            height:30px;
            }
            .widget_cont_recent_tran .company_img img{
            width:30px;
            height:30px;
            }
            .widget_cont_recent_tran .company_content{
            float:left;
            /*height:71px;*/
            }
            .widget_cont_recent_tran .company_name{
            margin-top:12px;
            margin-left:15px;
            width: 145px;
            /*height: 14px;*/
            font-family: NotoSansHans-Thin;
            font-size: 12px;
            font-weight: normal;
            font-stretch: normal;
            letter-spacing: 0px;
            color: #333333;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
            }
            .widget_cont_recent_tran .company_date{
            margin-top:8px;
            margin-left:15px;
            width: 142px;
            height: 15px;
            font-family: NotoSansHans-Thin;
            font-size: 12px;
            font-weight: normal;
            font-stretch: normal;
            letter-spacing: 0px;
            color: #999999;
            }
            .widget_cont_recent_tran .company_detail{
            float:left;
            }

            .widget_cont_recent_tran .con-right-arrow {
            float:right;
            margin-right:19px;
            margin-top:30px;
            width: 7px;
            height: 10px;
            cursor: pointer;
            }
            .widget_cont_recent_tran .con-right-arrow .right-arrow-img{
            width: 7px;
            height: 10px;
            cursor: pointer;
            }
            .widget_cont_recent_tran .row1{
            position:relative;
            height:16px;
            margin:17px 0 0 66px;
            font-family: PingFangSC-Medium;
            font-size: 16px;
            color: rgba(75,80,90,0.85);
            letter-spacing: 0;
            line-height: 20px;
            }
            .widget_cont_recent_tran #cont_recent_grid{
            width:240px;
            }
            .widget_cont_recent_tran #cont_recent_grid-wraper{
            display:inline-block;
            position:relative;
            height:390px;
            margin:9px 0 0 0;
            font-family: PingFangSC-Regular;
            font-size: 12px;
            color: #5A7FFF;
            letter-spacing: 0;
                width: 238px;
            }
            .widget_cont_recent_tran .hls-pagging-grid{
            width:240px;
            height:278px;
            -webkit-box-shadow:none;
            box-shadow:none;
            }
            .widget_cont_recent_tran .hls-table{
            width:100%;
            }
            .widget_cont_recent_tran .hls-table-hover{
            width:100%;
            }
            .widget_cont_recent_tran .hls-pagging-grid .grid-title{
            display:none;
            }
            .widget_cont_recent_tran .hls-pagging-grid .grid-body{
            padding:0;
            }
            .widget_cont_recent_tran .hls-pagging-grid .hls-table>tr:first-child{
            display:none;
            }
            .widget_cont_recent_tran .hls-pagging-grid .hls-table tbody tr:first-child{
            height:59px;
            width:240px;
            /*border-top:1px solid #F0F0F3;*/
            }
            .widget_cont_recent_tran .hls-pagging-grid .hls-table listRow1{

            }
            .widget_cont_recent_tran .hls-pagging-grid .hls-table tr:hover{
            background: rgba(90,127,255,0.08);
            }
            .hls-pagging-grid .grid-body table {
            width:240px;
            }
            .widget_cont_recent_tran .hls-pagging-grid .hls-table tr img{
            height:40 px;
            }
            .widget_cont_recent_tran .hls-pagging-grid .hls-table-active{
            background: rgba(90,127,255,0.08);
            }
            .widget_cont_recent_tran .hls-pagging-grid .grid-foot{
            margin-top:0;
            line-height:36px;
            }
            .widget_cont_recent_tran .hls-pagging-grid .hls-table tr{
            height:59px;
                border-bottom: 0px;
            }
            .widget_cont_recent_tran .hls-pagging-grid .hls-table tr td{
            height:56px;
            width:100%;
            padding:0 0;
            }
            .widget_cont_recent_tran .hls-pagging-grid .hls-table tr td .listRow1{
            height:17px;
            width:100%;
            margin-bottom:8px;
            }
            .widget_cont_recent_tran .hls-pagging-grid .hls-table tr td .listRow1 .bp_name{
            float:left;
            max-width:140px;
            overflow:hidden;
            line-height:17px;
            white-space:nowrap;
            text-overflow:ellipsis;
            font-family: PingFangSC-Regular;
            font-size: 12px;
            cursor:pointer;
            color: rgba(75,80,90,0.75);
            }
            .widget_cont_recent_tran .hls-pagging-grid .hls-table tr td .listRow1 .date{
            float:right;font-family: PingFangSC-Regular;
            font-size: 12px;
            line-height:17px;
            color: rgba(75,80,90,0.45);
            }

            .widget_cont_recent_tran .hls-pagging-grid .hls-table tr td .listRow2{
            height:14px;
            width:100%;
            }
            .widget_cont_recent_tran .hls-pagging-grid .hls-table tr td .listRow2 .amount{
            float:left;
            line-height:14px;font-family: Baskerville;
            font-size: 12px;
            color: #4866CC;
            text-align: left;
            }
            .widget_cont_recent_tran .hls-pagging-grid .hls-table tr td .listRow2 .amount img{
            margin-right:8px;
            position:relative;
            top:1px;
            }
            .widget_cont_recent_tran .hls-pagging-grid .hls-table tr td .listRow2 .goDetail{
            float:right;
            line-height:14px;
            position:relative;
            top:1px;
            cursor:pointer;
            }
            .widget_cont_recent_tran .hls-pagging-grid .hls-table tr td .clearFloat{
            clear:both;
            height:0;
            line-height:0;
            font-size:0
            }
            .widget_cont_recent_tran .hls-pagging-grid .grid-foot .page_count{
            }
            .widget_cont_recent_tran .hls-pagging-grid .grid-foot .page_count_last_end_page{

            }
            .widget_cont_recent_tran .hls-pagging-grid .grid-foot .page_count_last_page{}
            .widget_cont_recent_tran .hls-pagging-grid .grid-foot .page_count_page_number{}
            .widget_cont_recent_tran .hls-pagging-grid .grid-foot .page_count_next_page{
            margin-right:15px;
            }
            .widget_cont_recent_tran .hls-pagging-grid .grid-foot .page_count_next_end_page{

            }
            .widget_cont_recent_tran .hls-pagging-grid .grid-foot .page_count_total_message{}
            .widget_cont_recent_tran .hls-pagging-grid .grid-foot .page-message .page_message_refresh{
            margin-right:15px;
            }
            .widget_cont_recent_tran .hls-pagging-grid .grid-foot .page-message .page_message_num{
            display:none;
            width:0px;
            height:0px;
            }
            .widget_cont_recent_tran .hls-pagging-grid .grid-foot .page-message {
            width:13px;
            min-width:75px;
            height:11px;
            }
        </style>
        <script><![CDATA[
        function cont_recent_grid_renderer(record,index){
            var html='';
            html+='<div class="company_info"><div class="company_img"><img src="${/request/@context_path}/leafresource/images/widget/bpimg'+(index+1)+'@2x.png"/></div><div class="company_content">'
                +'<div class="company_name" title="'+ record.data['bp_name'] +'">' + record.data['bp_name'] + '</div>';
            var con_date=new Date(record.data['year'],record.data['month']-1,record.data['day']);
            <!--测试用var con_date=new Date(2018,5,24);-->
            console.log(record);
            var today=new Date();
            var days=Math.floor(Math.abs(today-con_date)/1000/60/60/24);
            var leave1 = (con_date.getTime()-today.getTime()) % (24 * 3600 * 1000)    //计算天数后剩余的毫秒数
            var hours = Math.floor(leave1 / (3600 * 1000))//计算出小时数
            //计算相差分钟数
            var leave2 = leave1 % (3600 * 1000)    //计算小时数后剩余的毫秒数
            var minutes = Math.floor(leave2 / (60 * 1000))//计算相差分钟数
             var weekday=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];
            var dateStr=''
            if(days == 0&&hours!=0){
                dateStr=hours+'小时前';
            }else if(days == 0&&hours==0&&minutes!=0){
                dateStr=minutes+'分钟前';
            }else{
                dateStr=record.data['year']+'.'+record.data['month']+'.'+record.data['day']+'/'+weekday[con_date.getDay()];
            }
            html+='<div class="company_date">' + dateStr + '</div>'
                +'<span class="clearFloat"></span></div>'
                +'<div class="company_datail"><div class="con-right-arrow" onclick="open_vir_con_win(\'' + record.ds.id + '\',' + record.id + ')"><img class="right-arrow-img" src="${/request/@context_path}/leafresource/images/home_page/detail-arrow@2x.png"/></div>'
                +'<span class="clearFloat"></span></div>'
                + '<div class="divide-line"></div></div>';
            return html;
        }
        function bigNumFormat(num){
            var str=num.toString(10);
            var zLength=str.indexOf('.');
            var arr=[];
            if(zLength>3 || zLength == -1){
                var length=(zLength>3)?zLength:str.length;
                for(var i=length-1,j=1;i>=0;i--,j++){
                    arr.unshift(str.charAt(i));
                    if(j%3==0 && i!=0){
                        arr.unshift(',');
                    }
                }
                if(zLength==-1){
                    str=arr.join('')
                }else{
                    str=arr.join('') + str.substring(zLength);
                }
            }
            return str
        }
        function open_vir_con_win(ds_id, record_id){
            var record = $(ds_id).findById(record_id);
            var param = record.data;
            param['function_code'] = 'C0N301D_CON';
            param['function_usage'] = 'QUERY';
            param['maintain_type'] = 'READONLY';
            param['cond_para2'] = record.get('hn_industry_classification');
            param['url_title'] = '合同明细';
            param['winid'] = 'con301_virtual_contract_query_detail_link_id';
            var list_ds=ds_id;
            Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
            Leaf.request({
                url: $('leaf_con_prj910_project_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: $('leaf_con_con301_con_contract_info_link').getUrl(),
                        title: param['url_title'] + '(' + res.result.layout_code + ')',
                        fullScreen: true,
                        draggable: true
                    });
                    win.on('close', function() {
                        if (list_ds) {
                            $(list_ds).query();
                        }
                    });
                },
                failure: function() {
                    Leaf.Masker.unmask(Ext.getBody());
                },
                error: function() {
                    Leaf.Masker.unmask(Ext.getBody());
                },
                scope: this
            });
        }
            ]]></script>
        <a:dataSets>
            <a:dataSet id="leaf_cont_recent_ds" autoQuery="true" pageSize="7" model="cont.CON1003.cont_recent">
                <a:fields>
                    <a:field name="contract_id"/>
                    <a:field name="project_id"/>
                    <a:field name="bp_name"/>
                    <a:field name="CONTRACT_AMOUNT"/>
                    <a:field name="hn_industry_classification"/>
                    <a:field name="year"/>
                    <a:field name="month"/>
                    <a:field name="day"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <div class="widget_cont_recent_tran">
            <div class="cont_recent-img">
                <div class="img-content">
                    <img src="${/request/@context_path}/leafresource/images/home_page/con-recent-tran@2x.png"/>
                </div>
            </div>
            <div class="row1">最近成交</div>
            <span class="widget_label"> </span>
            <div class="widget_border"/>

            <a:hapGrid id="cont_recent_grid" bindTarget="leaf_cont_recent_ds" canWheel="true">
                <a:columns>
                    <a:column template="cont_recent_grid_renderer"/>
                </a:columns>
            </a:hapGrid>
        </div>
        <a:screenBody style="display:none"> </a:screenBody>
    </a:view>
</a:screen>