feat: 作废原因
This commit is contained in:
parent
068d66138b
commit
7c59762995
@ -0,0 +1,59 @@
|
|||||||
|
package com.yem.wm.im.servicerepair.dynamic;
|
||||||
|
|
||||||
|
import com.yem.wm.utils.YEM;
|
||||||
|
import kd.bos.entity.datamodel.IDataModel;
|
||||||
|
import kd.bos.form.IFormView;
|
||||||
|
import kd.bos.form.control.Control;
|
||||||
|
import kd.bos.form.plugin.AbstractFormPlugin;
|
||||||
|
|
||||||
|
import java.util.EventObject;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: TODO
|
||||||
|
* @Date: 2024/8/29 10:54
|
||||||
|
* @Created: by ZZSLL
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class VoidReasonEdit extends AbstractFormPlugin {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void registerListener(EventObject e) {
|
||||||
|
super.registerListener(e);
|
||||||
|
this.addClickListeners("btncancel", "btnok");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterCreateNewData(EventObject e) {
|
||||||
|
super.afterCreateNewData(e);
|
||||||
|
IFormView view = this.getView();
|
||||||
|
IDataModel model = view.getModel();
|
||||||
|
IFormView parentView = view.getParentView();
|
||||||
|
IDataModel parentViewModel = parentView.getModel();
|
||||||
|
String voidreson = (String) parentViewModel.getValue("yem_voidreson");
|
||||||
|
model.setValue("yem_voidreson", voidreson);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void click(EventObject e) {
|
||||||
|
super.click(e);
|
||||||
|
IFormView view = this.getView();
|
||||||
|
IDataModel model = view.getModel();
|
||||||
|
Control control = (Control)e.getSource();
|
||||||
|
String key = control.getKey();
|
||||||
|
IFormView parentView = view.getParentView();
|
||||||
|
IDataModel parentViewModel = parentView.getModel();
|
||||||
|
if ("btnok".equals(key)) {
|
||||||
|
String voidreson = (String) model.getValue("yem_voidreson");
|
||||||
|
if (YEM.isNotEmpty(voidreson.trim())) {
|
||||||
|
parentViewModel.setValue("yem_voidreson", voidreson);
|
||||||
|
parentViewModel.setValue("yem_voidstatus", "B");
|
||||||
|
view.close();
|
||||||
|
} else {
|
||||||
|
view.showErrorNotification("请填写作废原因!!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ("btncancel".equals(key)) {
|
||||||
|
view.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,50 @@
|
|||||||
|
package com.yem.wm.im.servicerepair.form;
|
||||||
|
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
|
import com.yem.wm.utils.FunctionalCommon;
|
||||||
|
import com.yem.wm.utils.YEM;
|
||||||
|
import kd.bos.bill.AbstractBillPlugIn;
|
||||||
|
import kd.bos.extplugin.sample.AbstractFormPlugin;
|
||||||
|
import kd.bos.form.CloseCallBack;
|
||||||
|
import kd.bos.form.FormShowParameter;
|
||||||
|
import kd.bos.form.IFormView;
|
||||||
|
import kd.bos.form.ShowType;
|
||||||
|
import kd.bos.form.events.BeforeDoOperationEventArgs;
|
||||||
|
import kd.bos.form.events.ClosedCallBackEvent;
|
||||||
|
import kd.bos.form.operate.FormOperate;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: TODO
|
||||||
|
* @Date: 2024/8/29 10:55
|
||||||
|
* @Created: by ZZSLL
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class ServiceRepairFormPlugin extends AbstractBillPlugIn {
|
||||||
|
@Override
|
||||||
|
public void beforeDoOperation(BeforeDoOperationEventArgs e) {
|
||||||
|
super.beforeDoOperation(e);
|
||||||
|
FormOperate source = (FormOperate) e.getSource();
|
||||||
|
String key = source.getOperateKey();
|
||||||
|
IFormView view = this.getView();
|
||||||
|
if ("do_void".equals(key)) {
|
||||||
|
FormShowParameter fsp = new FormShowParameter();
|
||||||
|
fsp.setFormId("yem_voidreason");
|
||||||
|
fsp.getOpenStyle().setShowType(ShowType.Modal);
|
||||||
|
fsp.setCloseCallBack(new CloseCallBack(this, "voidreason"));
|
||||||
|
view.showForm(fsp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void closedCallBack(ClosedCallBackEvent e) {
|
||||||
|
super.closedCallBack(e);
|
||||||
|
IFormView view = this.getView();
|
||||||
|
String actionId = e.getActionId();
|
||||||
|
if ("voidreason".equals(actionId)) {
|
||||||
|
view.invokeOperation("save");
|
||||||
|
view.invokeOperation("refresh");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user