出差申请单添加变更类型隐显必录逻辑
This commit is contained in:
parent
d9967c2bb9
commit
3eabd65c39
|
|
@ -0,0 +1,55 @@
|
||||||
|
package zcgj.zcdev.zcdev.fs.plugin.form;
|
||||||
|
|
||||||
|
import kd.bos.bill.AbstractBillPlugIn;
|
||||||
|
import kd.bos.dataentity.entity.DynamicObject;
|
||||||
|
import kd.bos.form.field.ComboEdit;
|
||||||
|
import kd.bos.form.field.TextEdit;
|
||||||
|
import kd.bos.orm.query.QCP;
|
||||||
|
import kd.bos.orm.query.QFilter;
|
||||||
|
import kd.bos.servicehelper.QueryServiceHelper;
|
||||||
|
|
||||||
|
import java.util.EventObject;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出差申请单表单插件
|
||||||
|
*/
|
||||||
|
public class TripReqBillPlugin extends AbstractBillPlugIn {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterCopyData(EventObject e) {
|
||||||
|
super.afterCopyData(e);
|
||||||
|
updateModificationTypeVisibility();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterBindData(EventObject e) {
|
||||||
|
super.afterBindData(e);
|
||||||
|
updateModificationTypeVisibility();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterCreateNewData(EventObject e) {
|
||||||
|
super.afterCreateNewData(e);
|
||||||
|
updateModificationTypeVisibility();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateModificationTypeVisibility() {
|
||||||
|
Boolean isChange = (Boolean) this.getModel().getValue("ischange");//是否变更
|
||||||
|
|
||||||
|
DynamicObject costCompany = (DynamicObject) this.getModel().getValue("costcompany");//费用承担公司
|
||||||
|
QFilter filter = new QFilter("zcgj_companyblentry.zcgj_org.id", QCP.equals, costCompany.getPkValue());
|
||||||
|
filter.and(new QFilter("number", QCP.equals, "001"));
|
||||||
|
filter.and(new QFilter("zcgj_changetype", QCP.equals, true));
|
||||||
|
DynamicObject companyBelong = QueryServiceHelper.queryOne("zcgj_companybelong", "id", new QFilter[]{filter});//公司归属区域
|
||||||
|
|
||||||
|
if (isChange && companyBelong != null) {
|
||||||
|
this.getView().setVisible(true, "zcgj_modificationtype");//变更类型可见
|
||||||
|
ComboEdit edit = this.getView().getControl("zcgj_modificationtype");
|
||||||
|
edit.setMustInput(true);//变更类型必录
|
||||||
|
} else {
|
||||||
|
this.getView().setVisible(false, "zcgj_modificationtype");//变更类型不可见
|
||||||
|
ComboEdit edit = this.getView().getControl("zcgj_modificationtype");
|
||||||
|
edit.setMustInput(false);//变更类型不必录
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue