package com.yem.wm.im.sourceapply.form;

import kd.bos.bill.AbstractBillPlugIn;
import kd.bos.entity.datamodel.events.PropertyChangedArgs;

/**
 * @author zhouc
 * @date 2024/1/9 20:42
 * @className SourceapplyFormEdit
 * @description 叉车资源申请单表单插件(已禁用)
 */
public class SourceapplyFormEdit extends AbstractBillPlugIn {

    @Override
    public void beforePropertyChanged(PropertyChangedArgs e) {
        super.beforePropertyChanged(e);
//        IFormView view = this.getView();
//        IDataModel model = this.getModel();
//        String name = e.getProperty().getName();
//        ChangeData changeData = e.getChangeSet()[0];
//        int rowIndex = changeData.getRowIndex();
//        Object newValue = changeData.getNewValue();
//        Object oldValue = changeData.getOldValue();
//        DynamicObject dataEntity = this.getModel().getDataEntity(true);
//        if ("yem_contract".equals(name)) {
//            if (newValue != null) {
//                if (newValue instanceof Long) {
//                    Long yem_contract = (Long) newValue;
//                    if (yem_contract > 0) {
//                        DynamicObject yem_ia_intebilllogon = BusinessDataServiceHelper.loadSingle(yem_contract, "yem_es_salesorder");
//                        if (yem_ia_intebilllogon != null) {
//                            this.getView().getModel().setValue("yem_contracttext", yem_ia_intebilllogon.getString("billno"));
//                        }
//                    } else {
//                        this.getView().getModel().setValue("yem_contracttext", "");
//                    }
//                }
//                if (newValue instanceof DynamicObject) {
//                    DynamicObject yem_contract = (DynamicObject) newValue;
//                    if (yem_contract != null) {
//                        this.getView().getModel().setValue("yem_contracttext", yem_contract.getString("billno"));
//                    }
//                    else{
//                        this.getView().getModel().setValue("yem_contracttext", "");
//                    }
//                }
//            }
//        }
    }
}
