package com.yem.wm.im.inquirylist.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;

/**
 * @author power
 * @ClassName
 * @description: 列表过滤插件 根据单据类型过滤插件数据
 * @date 2023/7/28
 */
public class InquirylistListPlugln 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_im_inquirylist_pj".equals(billFormId)){
            e.addCustomQFilter(new QFilter("yem_billtype.number", QCP.equals,"yem_im_inquirylist_PJ"));
        }else if("yem_im_inquirylist_zj".equals(billFormId)){
            e.addCustomQFilter(new QFilter("yem_billtype.number", QCP.equals,"yem_im_inquirylist_ZJ"));
        }
    }
}
