支出合同优化合同类型不为物资采购时,可选不定量不定价

This commit is contained in:
xuhaihui 2025-09-12 10:03:09 +08:00
parent b45923a708
commit 7f32a59511
1 changed files with 20 additions and 10 deletions

View File

@ -20,13 +20,13 @@ import java.util.List;
/**
* 支出合同单据界面插件
* 暂不用
*
*/
public class OutContractFromPlugin extends AbstractBillPlugIn implements Plugin {
private String entryName = "treelistentry";//分录标识
private String contracttype = "contracttype";//
private String contracttype = "contracttype";//合同类型
@Override
public void propertyChanged(PropertyChangedArgs e) {
@ -34,42 +34,50 @@ public class OutContractFromPlugin extends AbstractBillPlugIn implements Plugin
String changeName = e.getProperty().getName();
ChangeData changeData = e.getChangeSet()[0];
if (changeName.equals(contracttype)) {//收入合同字段值改变
//合同类型
DynamicObject contractType = (DynamicObject)changeData.getNewValue();
String number = contractType.getString("number");
List<ComboItem> comboList = new ArrayList<>();
List<ComboItem> comboList1 = new ArrayList<>();
if(number.equals("sbzl")){
//合同类型-设备租赁
comboList1.add(new ComboItem(new LocaleString("综合单价"), "gddj"));
comboList1.add(new ComboItem(new LocaleString("总价包干"), "zjbg"));
comboList1.add(new ComboItem(new LocaleString("不定量不定价"), "bdlbdj"));
comboList.add(new ComboItem(new LocaleString("全部租赁"), "C"));
comboList.add(new ComboItem(new LocaleString("部分租赁"), "D"));
comboList.add(new ComboItem(new LocaleString("零星租赁"), "F"));
} else if (number.equals("ZCHLX02") ||number.equals("wzcg01")) {
//合同类型-物资采购 或物资采购类已禁用
comboList1.add(new ComboItem(new LocaleString("综合单价"), "gddj"));
comboList1.add(new ComboItem(new LocaleString("总价包干"), "zjbg"));
} else if (number.equals("ZCHLX02") ||number.equals("wzcg01")) {
comboList1.add(new ComboItem(new LocaleString("综合单价"), "gddj"));
comboList1.add(new ComboItem(new LocaleString("不定量不定价"), "bdlbdj"));
comboList.add(new ComboItem(new LocaleString("全面合作"), "A"));
comboList.add(new ComboItem(new LocaleString("局部合作"), "B"));
Object pricetype = this.getModel().getValue("zcgj_pricetype");
Object pricetype = this.getModel().getValue("zcgj_pricetype");//计价方式
if (pricetype!=null){
if (pricetype.toString().equals("bdlbdj")){
this.getModel().setValue("isonlist",true);
//计价方式-不定量不定价
this.getModel().setValue("isonlist",true);//基于清单
this.getView().setEnable(false,"isonlist");
}
}
} else{
comboList1.add(new ComboItem(new LocaleString("综合单价"), "gddj"));
comboList1.add(new ComboItem(new LocaleString("总价包干"), "zjbg"));
comboList1.add(new ComboItem(new LocaleString("不定量不定价"), "bdlbdj"));
comboList.add(new ComboItem(new LocaleString("全面合作"), "A"));
comboList.add(new ComboItem(new LocaleString("局部合作"), "B"));
}
ComboEdit comboEdit = getView().getControl("zcgj_cooperatemode");
ComboEdit comboEdit = getView().getControl("zcgj_cooperatemode");//合作类型
comboEdit.setComboItems(comboList);
ComboEdit comboEdit1 = getView().getControl("zcgj_pricetype");
ComboEdit comboEdit1 = getView().getControl("zcgj_pricetype");//计价方式
comboEdit1.setComboItems(comboList1);
} else if (changeName.equals("zcgj_pricetype")) {
//计价方式
Object newValue = changeData.getNewValue();
if (newValue!=null){
if (newValue.toString().equals("gddj")){
//计价方式-综合单价
//设置必填
((FieldEdit)this.getControl("treeprice")).setMustInput(true);
}else {
@ -77,10 +85,12 @@ public class OutContractFromPlugin extends AbstractBillPlugIn implements Plugin
}
}
Object value = this.getModel().getValue(contracttype);
//合同类型
if (value!=null){
DynamicObject contractType = (DynamicObject)value;
if (contractType.getString("number").equals("ZCHLX02")){
this.getModel().setValue("isonlist",true);
//合同类型-物资采购
this.getModel().setValue("isonlist",true);//基于清单
this.getView().setEnable(false,"isonlist");
}
}