WIDGET-BP-NEW-ADD-old-bak.lview 6.09 KB
<?xml version="1.0" encoding="UTF-8"?>

<!--
    $Author:
    $Date: 2018/8/2
    $Revision: 1.0
    2.最近添加商业伙伴
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure/>
    <a:view template="default" package="leaf.ui.std">
        <a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
        <a:link id="hls_bp_master_modify_link" url="${/request/@context_path}/modules/hls/HLS214N/hls_bp_master_modify.lview"/>
        <style>
            html,body{
            background-color:#fff;
            width:552px;
            height:337px;
            margin: 0;
            padding: 0;
            }
            .bp_new_add .hls-pagging-grid .grid-title {
                display: none;
            }
            .bp_new_add .hls-pagging-grid{
                width:552px;
                height:292px;
            }
            .bp_new_add .title{
                height:44px ;
                width: 100%;
                border-bottom: 1px solid  #F0F0F3;
            }
        </style>
        <script><![CDATA[
        function bp_edit_btn_renderer(record,index){
            return "<img onclick='open_bp_modify_win(\"" + record.ds.id + "\",\""+record.id+ "\")' style='cursor:pointer;width:15px;height:15px;display:inline-block;margin:0px;' src='${base.contextPath}/leafresource/images/widget/modify.png' alt='png'/>";
        }
        function bp_fav_btn_renderer(record,index){
            if (record.data.collectFlag == 'Y') {
                return "<img id='" + record.data.bp_id + "' onclick='toggle_collect(" + record.data.bp_id + ")' style='cursor:pointer;width:15px;height:15px;display:inline-block;margin:0px;' src='${base.contextPath}/leafresource/images/widget/light1.png' alt='png'/>";
            } else {
                return "<img id='" + record.data.bp_id + "' onclick='toggle_collect(" + record.data.bp_id + ")' style='cursor:pointer;width:15px;height:15px;display:inline-block;margin:0px;' src='${base.contextPath}/leafresource/images/widget/unLight1.png' alt='png'/>";
            }
        }
        function toggle_collect(bp_id) {
            var icon = document.getElementById(bp_id);
            if (icon.src.substr(icon.src.length - 12) != 'unLight1.png') {
                <!--取消收藏-->
                icon.src = "${base.contextPath}/leafresource/images/widget/unLight1.png"
                <!--$.ajax({-->
                    <!--url: '${base.contextPath}' + "/hls/favorite/collect/submit?collectBpId=" + collectBpId,-->
                    <!--type: "POST",-->
                    <!--dataType: "json",-->
                    <!--contentType: "application/json",-->
                    <!--success: function (e) {-->
                        <!--parent.kendo.ui.showInfoDialog({-->
                            <!--title: "提示",-->
                            <!--message: "收藏成功!"-->
                        <!--})-->
                        <!--if(getWindowObj("BP801W")){-->
                            <!--getWindowObj("BP801W").contentWindow. BP801W_rollTableDataSource.read();-->
                        <!--}-->
                    <!--},-->
                    <!--error: function () {-->
                    <!--}-->
                <!--});-->
            } else {
                <!--//收藏-->
                icon.src = "${base.contextPath}/leafresource/images/widget/light1.png"
            }
        }
        function open_bp_modify_win(ds_id, record_id) {
            var record = $(ds_id).findById(record_id);
            var param = record.data;
            param['cond_para2'] = param['bp_type'];
            param['function_code'] = 'HLS224D';
            param['function_usage'] = 'MODIFY';
            param['url_title'] = '${l:HLS212.BP_MASTER_MAINTAIN}';

            var bm_url_link='con_contract_get_layout_code_link_id';
            var list_ds=ds_id;

            Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
            Leaf.request({
                url: $(bm_url_link).getUrl(),
                para: param,
                success: function(res) {
                    Leaf.Masker.unmask(Ext.getBody());
                    param['layout_code'] = 'BP_MODIFY';
                    param['winid'] = 'hls_doc_get_layout_code_winid';
                    var win = new Leaf.Window({
                        id: param['winid'],
                        params: param,
                        url: $('hls_bp_master_modify_link').getUrl(),
                        title: param['url_title'] + '(BP_MODIFY)',
                        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="bp_trend_ds" autoQuery="true" pageSize="5" model="bp.bp_new_add">
                <a:fields>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <div class="bp_new_add">
            <div class="title">

            </div>
            <a:hapGrid id="bp-new-add-grid"  bindTarget="bp_trend_ds" canWheel="true">
                <a:columns>
                    <a:column name="creation_date_n" prompt="添加日期" width="80"/>
                    <a:column name="bp_name" prompt="商业伙伴名称" width="150"/>
                    <a:column name="bp_category_n"  prompt="商业伙伴类型" width="80"/>
                    <a:column template="bp_edit_btn_renderer" prompt="编辑" width="40"/>
                    <a:column template="bp_fav_btn_renderer" prompt="收藏" width="40"/>
                </a:columns>
            </a:hapGrid>
        </div>
        <a:screenBody style="display:none"></a:screenBody>
    </a:view>
</a:screen>