WIDGET-LEAF-ASSET-INFO.lview 23 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 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513
<?xml version="1.0" encoding="UTF-8"?>

<!--
    $Author:WJW
    $Date: 2018/9/12
    $Revision: 1.0
    leaf微件-资产信息
-->
<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_info_prj910_project_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
        <a:link id="leaf_info_con301_con_contract_info_link" url="${/request/@context_path}/modules/prj/PRJ506/virtual_contract_query.lview"/>
        <style>
            html,body{
            width:1185px;
            height:553px;
            margin: 0;
            padding: 0;
            color:#000;
            }
            .leaf_widget_asset_info{
            box-sizing:border-box;
            width:1185px;
            height:553px;
            padding:0;
            background-color:#fff;
            position:relative;
            border:1px solid #F0F0F3;
            cursor:default;
            user-select:none;
            }
            .leaf_widget_asset_info .leaf-asset-img{
                width: 20px;
                display: inline-block;
                margin: 33px 0 0 38px;
            }
            .leaf_widget_asset_info .row1{
                display: inline-block;
            position:absolute;
                top: 37px;
                margin-left: 16px;
            /*padding:16px 0 12px 16px;*/
            /*font-family: PingFangSC-Medium;*/
            /*font-size: 14px;*/
            /*color: rgba(75,80,90,0.85);*/
            /*letter-spacing: 0;*/
            /*border-bottom:1px solid  #F0F0F3;*/
                font-family: NotoSansHans-Bold;
                font-size: 17px;
                font-weight: normal;
                font-stretch: normal;
                letter-spacing: 2px;
                color: #333333;
            }
            .leaf_widget_asset_info .asset-info{
                margin: 29px 0px 0px 75px;
                font-family: NotoSansHans-Bold;
                font-size: 13px;
                font-weight: normal;
                font-stretch: normal;
                letter-spacing: 1px;
                color: #333333;
            }
            .leaf_widget_asset_info .asset-info-line{
                width: 28px;
                height: 5px;
                background-color: #657efe;
                margin-left: 75px;
                margin-top: 4px;
            }
            .leaf_widget_asset_info .row2{
            box-sizing:border-box;
            /*height:109px;*/
            padding:24px 83px 0 75px;
            /*border-bottom:1px solid  #F0F0F3;*/
            }
            .leaf_widget_asset_info .row2 .row2-child{
               display: inline-block;
                padding-right: 29px;
                padding-left: 29px;
                border-right: 7px solid #ccc
            }
            .leaf_widget_asset_info .row2 .row2-child:first-child{

                padding-left: 0px;

            }
            .leaf_widget_asset_info .row2 .row2-child:last-child{

                border-right: 0px;

            }
            /*.leaf_widget_asset_info .row2 .func-divide-line{*/
                /*display: inline-block;*/
                /*width: 7px;*/
                /*height: 66px;*/
                /*background-color: #dcdcdc;*/
                /*opacity: 0.59;*/
                /*margin: 0 29px;*/
            /*}*/
            .leaf_widget_asset_info .row2 .row2-child .divide-line{
                width: 248px;
                height: 3px;
                background-color: #657efe;
                opacity: 0.07;
                margin: 7px 0 9px 0;
            }
            .leaf_widget_asset_info .asset_query_form div{
            /*height:24px;*/
            /*line-height:24px;*/
            }
            .leaf_widget_asset_info .asset_query_form div:first-child{
            /*margin-bottom:18px;*/
            }
            .leaf_widget_asset_info .asset_query_form .label{
            display:block;
                font-family: NotoSansHans-DemiLight;
                font-size: 12px;
                font-weight: normal;
                font-stretch: normal;
                letter-spacing: 1px;
                color: #333333;
            }
            .leaf_widget_asset_info .asset_query_form .clickable{
            box-sizing:border-box;
            width:66px;
            height:22px;
            line-height:22px;
            display:inline-block;
            /*padding:0 5px;*/
            margin:0 6px 0 0;
            border-radius:4px;
            cursor:pointer;
            text-align:center;
                font-family: NotoSansHans-Light;
                font-size: 12px;
                font-weight: normal;
                font-stretch: normal;
                letter-spacing: 1px;
                color: #999999;
            }
            .leaf_widget_asset_info .asset_query_form input[type='text']{
            box-sizing:border-box;
            width:248px;
            height:27px;
            /*margin:0 30px 0 0;*/
            padding-left:8px;
            display:block;
            border: 1px solid rgba(83,93,127,0.60);
            border-radius: 2px;
            font-family: PingFangSC-Medium;
            font-size: 12px;
            color: rgba(75,80,90,0.85);
                background: #fff;
            }
            .leaf_widget_asset_info .asset_query_form #leaf_submit{
            background: #5A7FFF;
            color:#fff;
                right: 83px;
                position: absolute;
                margin-right: 0px;
                margin-top: 35px;
            }
            .leaf_widget_asset_info .asset_query_form .asset_query_currency{
            border:1px solid rgba(83,93,127,0.50);

            }
            .leaf_widget_asset_info .asset_query_form .asset_query_currency_active{
                background-color: #657efe;
                color:#fff;
            }
            .leaf_widget_asset_info .hls-pagging-grid{
            width:100%;
            /*height:392px;*/
            -webkit-box-shadow:none;
            box-shadow:none;
            }
            .leaf_widget_asset_info .hls-pagging-grid .grid-title{
            display:none;
            }
            .leaf_widget_asset_info .hls-pagging-grid .grid-body{
                padding: 0px 83px 0px 75px;
            }
            .leaf_widget_asset_info .hls-pagging-grid .hls-table tr td{
            text-align:center;
            }
            /*表头*/
            .leaf_widget_asset_info .hls-pagging-grid .grid-body table{
                width: 100% !important;
            }
            .leaf_widget_asset_info .hls-pagging-grid .grid-body table>tr{
            height:48px;
            border-bottom:1px solid #F0F0F3;
                font-family: NotoSansHans-Medium;
                font-size: 13px;
                font-weight: normal;
                font-stretch: normal;
                letter-spacing: 1px;
                color: #333333;
            }
            .leaf_widget_asset_info .hls-pagging-grid .hls-table tr td:nth-child(1),
            .leaf_widget_asset_info .hls-pagging-grid .hls-table tr td:nth-child(2),
            .leaf_widget_asset_info .hls-pagging-grid .hls-table tr td:nth-child(4){
            text-align:left;
            }
            .leaf_widget_asset_info .hls-pagging-grid .hls-table tr td:nth-child(6){
            text-align:right;
            }
            .leaf_widget_asset_info .hls-pagging-grid .hls-table tbody tr{
            height:56px;
            /*font-family: PingFangSC-Medium;*/
            font-size: 12px;
            /*color: rgba(75,80,90,0.85);*/
            /*letter-spacing: 0;*/
            border-bottom:1px solid #F0F0F3;
                background: #fff;
                font-family: NotoSansHans-Light;
                font-size: 12px;
                font-weight: normal;
                font-stretch: normal;
                letter-spacing: 1px;
                color: #333333;
            }
            .leaf_widget_asset_info .hls-pagging-grid .hls-table tbody td{
            max-width:13em;
            }
            .leaf_widget_asset_info .hls-pagging-grid .hls-table tbody td div p{
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
                font-family: NotoSansHans-Light;
                font-size: 12px;
                font-weight: normal;
                font-stretch: normal;
                letter-spacing: 1px;
                color: #333333;
            }
            .leaf_widget_asset_info .hls-pagging-grid .hls-table tbody td div p:last-child{
                color: #999999;
            }
            .leaf_widget_asset_info .hls-pagging-grid .hls-table tbody tr:hover{
                background-color: rgba(238,238,238,.32);
                /*opacity: 0.32;*/
                font-family: NotoSansHans-Medium;
                color: #333333;
            }
            .leaf_widget_asset_info .hls-table-active{
            /*background-color: rgba(90,127,255,0.08);*/
            }
            .leaf_widget_asset_info .hls-pagging-grid .icon{
            cursor:pointer;
            width:16px;
            height:16px;
            }
            .leaf_widget_asset_info .hls-pagging-grid input[type='checkbox']{
            display:none;
            }
            .leaf_widget_asset_info .hls-pagging-grid input[type='checkbox'] ~ .label1{
            display:block;
            margin:0 auto;
            width:14px;
            height:14px;
            cursor:pointer;
            position:relative;
            top:0;
            left:0;
            /*border:1px solid #5A7FFF;*/
            border-radius:1.85px;
            color:#5A7FFF;
            }
            .leaf_widget_asset_info .hls-pagging-grid input[type='checkbox'] ~ .label0{
            display:none;
            margin:0 auto;
            width:14px;
            height:14px;
            cursor:pointer;
            position:relative;
            top:0;
            left:0;
            /*border:1px solid rgba(83,93,127,0.85);*/
            border-radius:1.85px;
            }
            .leaf_widget_asset_info .hls-pagging-grid input[type='checkbox']:checked ~ .label1{
            display:none;
            }
            .leaf_widget_asset_info .hls-pagging-grid input[type='checkbox']:checked ~ .label0{
            display:block;
            }
        </style>
        <script><![CDATA[
        function con_asset_prj_renderer(record,index){
            var number=record.data["project_id"]||'';
            var name=record.data["project_id_n"]||'';
            return '<p title="' + name + '">'+ name +'</p>' + '<p >'+ number +'</p>'
        }
        function con_asset_cont_renderer(record,index){
            var number=record.data["contract_number"]||'';
            var name=record.data["contract_name"]||'';
            return '<p title="' + name + '">'+ name +'</p>' + '<p>'+ number +'</p>'
        }
        function asset_employee_renderer(record,index){
            var name=record.data["employee_id_n"]||'';
            var unit=record.data["unit_id_n"]||'';
            return '<p >'+ name +'</p>' + '<p title="' + unit + '">'+ unit +'</p>'
        }
        function con_asset_detail_renderer(record,index){
            return "<img onclick='open_vir_con_modify_win(\"" + record.ds.id + "\",\""+record.id+ "\")' class='icon' src='${/request/@context_path}/leafresource/images/widget/asset-detail@2x.png'/>";
        }

        function con_asset_factoring_renderer(record,index){
            var recourse_factoring=record.data["recourse_factoring"]||0;
            var number=record.data["contract_number"]||'';
            var html='';
            if(recourse_factoring){
                html='<input type="checkbox" class="icon" checked="checked" id="' + number + '_factoring_input"/>'
                    +'<label class="label1" for="' + number + '_factoring_input"><img style="width: 16px" src="${/request/@context_path}/leafresource/images/widget/choose-asset.png"/></label>'
                    +'<label class="label0" for="' + number + '_factoring_input"><img style="width: 16px" src="${/request/@context_path}/leafresource/images/widget/unchoose-asset.png"/></label>';
            }else{
                html='<input type="checkbox" class="icon" id="' + number + '_factoring_input"/>'
                    +'<label class="label1" for="' + number + '_factoring_input"><img style="width: 16px" src="${/request/@context_path}/leafresource/images/widget/choose-asset.png"/></label>'
                    +'<label class="label0" for="' + number + '_factoring_input"><img style="width: 16px" src="${/request/@context_path}/leafresource/images/widget/unchoose-asset.png"/></label>';
            }
            return html;
        }
        function con_asset_refinance_renderer(record,index){
            var refinance=record.data["refinance"]||0;
            var number=record.data["contract_number"]||'';
            var html='';
            if(refinance){
                html='<input type="checkbox" class="icon" checked="checked" id="' + number + '_refinance_input"/>'
                    +'<label class="label1" for="' + number + '_refinance_input"><img style="width: 16px" src="${/request/@context_path}/leafresource/images/widget/choose-asset.png"/></label>'
                    +'<label class="label0" for="' + number + '_refinance_input"><img style="width: 16px" src="${/request/@context_path}/leafresource/images/widget/unchoose-asset.png"/></label>';
            }else{
                html='<input type="checkbox" class="icon" id="' + number + '_refinance_input"/>'
                    +'<label class="label1" for="' + number + '_refinance_input"><img style="width: 16px" src="${/request/@context_path}/leafresource/images/widget/choose-asset.png"/></label>'
                    +'<label class="label0" for="' + number + '_refinance_input"><img style="width: 16px" src="${/request/@context_path}/leafresource/images/widget/unchoose-asset.png"/></label>';
            }
            return html;
        }
        function con_asset_securitization_renderer(record,index){
            var asset_securitization=record.data["asset_securitization"]||0;
            var number=record.data["contract_number"]||'';
            var html='';
            if(asset_securitization){
                html='<input type="checkbox" class="icon" checked="checked" id="' + number + '_securitization_input"/>'
                    +'<label class="label1" for="' + number + '_securitization_input"><img style="width: 16px" src="${/request/@context_path}/leafresource/images/widget/choose-asset.png"/></label>'
                    +'<label class="label0" for="' + number + '_securitization_input"><img style="width: 16px" src="${/request/@context_path}/leafresource/images/widget/unchoose-asset.png"/></label>';
            }else{
                html='<input type="checkbox" class="icon" id="' + number + '_securitization_input"/>'
                    +'<label class="label1" for="' + number + '_securitization_input"><img style="width: 16px" src="${/request/@context_path}/leafresource/images/widget/choose-asset.png"/></label>'
                    +'<label class="label0" for="' + number + '_securitization_input"><img style="width: 16px" src="${/request/@context_path}/leafresource/images/widget/unchoose-asset.png"/></label>';
            }
            return html;
        }
        jQuery(document).ready(function(){
            //查询条件数据结构
            var queryParam={
                "leaf_asset_query_unit":'',
                "leaf_asset_query_bp":'',
                "leaf_asset_query_con":'',
                "currency":''
            };
            jQuery(".leaf_widget_asset_info .asset_query_form").on('click',function(e){
                $this=jQuery(e.target);

                //人民币单选点击事件
                if($this.attr("class") && $this.attr("class").indexOf('asset_query_currency')>=0){
                    var currencys=jQuery(".asset_query_currency");
                    for(var i=0;i<currencys.length;i++){
                        if(currencys[i].id!=$this.attr("id")){
                            jQuery(currencys[i]).removeClass("asset_query_currency_active");
                        }
                    }
                    $this.toggleClass("asset_query_currency_active");
                    if($this.attr("class").indexOf('asset_query_currency')>=0){
                        queryParam.currency=$this.attr("id");
                    }else{
                        queryParam.currency="";
                    }
                }

                //查询按钮点击事件
                if($this.attr("id")=='leaf_submit'){
                    queryParam["asset_query_unit"]=jQuery("#leaf_asset_query_unit").val();
                    queryParam["asset_query_bp"]=jQuery("#leaf_asset_query_bp").val();
                    queryParam["asset_query_con"]=jQuery("#leaf_asset_query_con").val();
                    $("leaf_con_contract_asset_ds").qpara=queryParam;
                    $("leaf_con_contract_asset_ds").query();
                }
            });

        });
        function open_vir_con_modify_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';

            Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
            Leaf.request({
                url: $('leaf_info_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_info_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();
                        }
                        if (function_name) {
                            window[function_name]();
                        }
                    });*/
                },
                failure: function() {
                    Leaf.Masker.unmask(Ext.getBody());
                },
                error: function() {
                    Leaf.Masker.unmask(Ext.getBody());
                },
                scope: this
            });
        }
            ]]></script>
        <a:dataSets>
            <a:dataSet id="leaf_con_contract_asset_ds" autoQuery="true" pageSize="5" model="ast.AST511.con_contract_asset" >
                <a:fields>
                    <a:field name="contract_number"/>
                    <a:field name="contract_name"/>
                    <a:field name="project_id"/>
                    <a:field name="project_id_n"/>
                    <a:field name="business_type_n"/>
                    <a:field name="employee_id_n"/>
                    <a:field name="unit_id_n"/>
                    <a:field name="currency_n"/>
                    <a:field name="lease_item_amount"/>
                    <a:field name="contract_id"/>
                    <a:field name="recourse_factoring"/>
                    <a:field name="refinance"/>
                    <a:field name="asset_securitization"/>
                    <a:field name="bp_name"/>
                    <a:field name="hn_industry_classification"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <div class="leaf_widget_asset_info">
            <!--<span class="widget_label"> </span>-->
            <img class="leaf-asset-img" src="${/request/@context_path}/leafresource/images/widget/leaf-asset@2x.png"/>
            <div class="row1">资产信息查询</div>
            <div class="row2 asset_query_form">
                <div class="row2-child">
                    <span class="label">部门信息</span>
                    <div class="divide-line"></div>
                    <input type="text" id="leaf_asset_query_unit" placeholder="部门名称/项目经办人"/>
                </div>
                <div class="row2-child">
                    <span class="label">承租人/合同信息</span>
                    <div class="divide-line"></div>
                    <input type="text" id="leaf_asset_query_con" placeholder="合同编号/合同名称"/>
                    <!--<span class="label">合同信息</span>-->
                    <!--<input type="text" id="leaf_asset_query_con" placeholder="合同编号/合同名称"/>-->
                    <!--<span class="clickable" id="leaf_submit">查询</span>-->
                </div>
                <div class="row2-child" style="border: 0px">
                    <span class="label" style="min-width:4em;">币种</span>
                    <div class="divide-line"></div>
                    <span class="clickable asset_query_currency" id="CNY">人民币</span>
                    <span class="clickable asset_query_currency" id="USD">美元</span>
                </div>
                <span class="clickable" id="leaf_submit">查询</span>
            </div>
            <div class="asset-info">资产信息</div>
            <div class="asset-info-line"></div>
            <a:hapGrid id="leaf_con_contract_asset_grid" bindTarget="leaf_con_contract_asset_ds" canWheel="true">
                <a:columns>
                    <a:column template="con_asset_factoring_renderer" prompt="有追保理"/>
                    <a:column template="con_asset_refinance_renderer" prompt="再融资"/>
                    <a:column template="con_asset_securitization_renderer" prompt="资产证券化"/>
                    <a:column template="con_asset_prj_renderer" prompt="项目名称/项目编号"/>
                    <a:column template="con_asset_cont_renderer" prompt="合同名称/合同编号"/>
                    <a:column name="business_type_n" prompt="租赁性质"/>
                    <a:column template="asset_employee_renderer" prompt="项目经办人/部门"/>
                    <a:column name="currency_n" prompt="币种"/>
                    <a:column name="lease_item_amount" prompt="资产金额"/>
                    <a:column template="con_asset_detail_renderer" prompt="明细"/>
                </a:columns>
            </a:hapGrid>
        </div>
        <a:screenBody style="display:none"> </a:screenBody>
    </a:view>
</a:screen>