package com.yem.wm.im.priceLibrary.list;

;

import kd.bos.form.events.SetFilterEvent;
import kd.bos.list.IListView;
import kd.bos.list.plugin.AbstractListPlugin;
import kd.bos.orm.query.QCP;
import kd.bos.orm.query.QFilter;
import kd.sdk.plugin.Plugin;


/**
 * @Description 价格库列表插件
 *              1.根据打开的布局的单据类型 过滤列表显示数据
 */
public class PriceLibraryListPlugIn extends AbstractListPlugin implements Plugin {

    @Override
    public void setFilter(SetFilterEvent e) {
        super.setFilter(e);
        billTypeFilter(e);
    }

    /**
     * @Description 根据打开的布局的单据类型 过滤列表显示数据
     * @param e
     */
    public void billTypeFilter(SetFilterEvent e){
        String billFormId = ((IListView) this.getView()).getBillFormId();
        if("yem_pricelibrary_zj".equals(billFormId)){
            e.addCustomQFilter(new QFilter("yem_billtype.number", QCP.equals,"yem_pricelibrary_ZJ"));
        }else if("yem_pricelibrary_pj".equals(billFormId)){
            e.addCustomQFilter(new QFilter("yem_billtype.number", QCP.equals,"yem_pricelibrary_PJ"));
        }else if("yem_xpricelibrary_zj".equals(billFormId)){
            e.addCustomQFilter(new QFilter("yem_billtype.number", QCP.equals,"yem_pricelibrary_e_ZJ"));
        }else if("yem_xpricelibrary_pj".equals(billFormId)){
            e.addCustomQFilter(new QFilter("yem_billtype.number", QCP.equals,"yem_pricelibrary_e_PJ"));
        }

    }
}