供方入围可添加供应商修订版1.2:

标准初始供应商不允许删除,新增初始为新增状态
This commit is contained in:
zengweihai 2024-11-22 14:18:32 +08:00
parent f6b3c01b15
commit 7530eb6f0d
1 changed files with 31 additions and 25 deletions

View File

@ -9,6 +9,7 @@ import kd.bos.entity.EntityMetadataCache;
import kd.bos.entity.EntityType;
import kd.bos.entity.datamodel.IDataModel;
import kd.bos.entity.datamodel.IEntryOperate;
import kd.bos.entity.datamodel.events.AfterAddRowEventArgs;
import kd.bos.entity.datamodel.events.ChangeData;
import kd.bos.entity.datamodel.events.PropertyChangedArgs;
import kd.bos.form.control.Button;
@ -74,33 +75,38 @@ public class SupplierInvitationFormPlugin extends SupplierInvitationBidNumEdit {
@Override
public void beforeDoOperation(BeforeDoOperationEventArgs args) {
super.beforeDoOperation(args);
// FormOperate source = (FormOperate) args.getSource();
// String operateKey = source.getOperateKey();
// DynamicObject bidproject = (DynamicObject) this.getModel().getValue("bidproject");
// if ("addsupplierdetail".equals(operateKey)){
// EntryGrid SEEntryGrid = this.getControl("supplierenrollentry");
// DynamicObjectCollection SEEntry = this.getModel().getEntryEntity("supplierenrollentry");
// int[] selectRows = SEEntryGrid.getSelectRows();
// for (int selectRow : selectRows) {
// this.getView().showTipNotification("beforedo:"+String.valueOf(selectRow));
// DynamicObject dy = SEEntry.get(selectRow);
// DynamicObject enrollsupplier = dy.getDynamicObject("enrollsupplier");//报名供应商
// if (enrollsupplier != null){
// Object enrollsupplierPkValue = enrollsupplier.getPkValue();
// boolean flag = checkSupplierCollection(enrollsupplierPkValue,bidproject);
// if (!flag){
// this.createRespMyTender(enrollsupplierPkValue);
// DynamicObject dataEntity = this.getModel().getDataEntity();
// SaveServiceHelper.save(new DynamicObject[]{dataEntity});
// }
// }
//
// }
// }
FormOperate source = (FormOperate) args.getSource();
String operateKey = source.getOperateKey();
if ("deleteentry1".equals(operateKey)){
EntryGrid SEEntryGrid = this.getControl("supplierenrollentry");
DynamicObjectCollection SEEntry = this.getModel().getEntryEntity("supplierenrollentry");
int[] selectRows = SEEntryGrid.getSelectRows();
int flag = 0;
for (int selectRow : selectRows) {
DynamicObject dy = SEEntry.get(selectRow);
boolean qeug_isaddnew = dy.getBoolean("qeug_isaddnew");
if (!qeug_isaddnew){
flag++;
}
}
if (flag > 0){
args.setCancel(true);
this.getView().showTipNotification("选择供应商存在非新增供应商,请重新选择!");
}
}
}
@Override
public void afterDoOperation(AfterDoOperationEventArgs afterDoOperationEventArgs) {
super.afterDoOperation(afterDoOperationEventArgs);
String operateKey = afterDoOperationEventArgs.getOperateKey();
if ("newentry1".equals(operateKey)){
DynamicObjectCollection supplierenrollentry = this.getModel().getEntryEntity("supplierenrollentry");
DynamicObject addNew = supplierenrollentry.get(supplierenrollentry.size() - 1);
addNew.set("qeug_isaddnew",true);
this.getView().updateView("supplierenrollentry");
}
}
@Override
public void propertyChanged(PropertyChangedArgs args) {