Commit 61c814cc by liuyang

2024-09-19

1、租赁合同增加合同类型字段
2、选择为需方时,甲方为公司,乙方供应商,当选择为供方时,甲方为客户,乙方为公司
3、甲方改为承租方,乙方改为出租方
4、租赁合同修改功能bug修复
parent 8468398f
...@@ -57,6 +57,7 @@ public class HGCW006 extends DaoEPBase { ...@@ -57,6 +57,7 @@ public class HGCW006 extends DaoEPBase {
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/ public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
public static final String FIELD_REMAINING_AMOUNT = "remainingAmount"; /* 剩余开票/收票金额*/ public static final String FIELD_REMAINING_AMOUNT = "remainingAmount"; /* 剩余开票/收票金额*/
public static final String FIELD_COMPANY_CODES = "companyCodes"; public static final String FIELD_COMPANY_CODES = "companyCodes";
public static final String FIELD_CONTRACT_TYPE = "contractType"; /* 合同类型;6-供方 7-需方*/
public static final String COL_ID = "ID"; public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/ public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
...@@ -92,6 +93,7 @@ public class HGCW006 extends DaoEPBase { ...@@ -92,6 +93,7 @@ public class HGCW006 extends DaoEPBase {
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 记录修改时间*/ public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 记录修改时间*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/ public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
public static final String COL_REMAINING_AMOUNT = "REMAINING_AMOUNT"; public static final String COL_REMAINING_AMOUNT = "REMAINING_AMOUNT";
public static final String COL_CONTRACT_TYPE = "CONTRACT_TYPE"; /* 合同类型;6-供方 7-需方*/
public static final String QUERY = "HGCW006.query"; public static final String QUERY = "HGCW006.query";
public static final String COUNT = "HGCW006.count"; public static final String COUNT = "HGCW006.count";
...@@ -133,6 +135,7 @@ public class HGCW006 extends DaoEPBase { ...@@ -133,6 +135,7 @@ public class HGCW006 extends DaoEPBase {
private String updatedTime = " "; /* 记录修改时间*/ private String updatedTime = " "; /* 记录修改时间*/
private String depCode = " "; /* 部门编码*/ private String depCode = " "; /* 部门编码*/
private BigDecimal remainingAmount = new BigDecimal("0"); /* 剩余开票/收票金额*/ private BigDecimal remainingAmount = new BigDecimal("0"); /* 剩余开票/收票金额*/
private Integer contractType; /* 合同类型;6-供方 7-需方*/
/** /**
* initialize the metadata. * initialize the metadata.
*/ */
...@@ -186,25 +189,25 @@ public class HGCW006 extends DaoEPBase { ...@@ -186,25 +189,25 @@ public class HGCW006 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_TOTAL_QUANTITY); eiColumn = new EiColumn(FIELD_TOTAL_QUANTITY);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(3); eiColumn.setScaleLength(0);
eiColumn.setFieldLength(15); eiColumn.setFieldLength(15);
eiColumn.setDescName("总数量"); eiColumn.setDescName("总数量");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PARTY_A_NAME); eiColumn = new EiColumn(FIELD_PARTY_A_NAME);
eiColumn.setDescName("方联系人姓名"); eiColumn.setDescName("承租方联系人姓名");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PARTY_A_PHONE_NUMBER); eiColumn = new EiColumn(FIELD_PARTY_A_PHONE_NUMBER);
eiColumn.setDescName("方联系人电话"); eiColumn.setDescName("承租方联系人电话");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_ALREADY_NAME); eiColumn = new EiColumn(FIELD_ALREADY_NAME);
eiColumn.setDescName("方联系人姓名"); eiColumn.setDescName("出租方联系人姓名");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_ALREADY_PHONE_NUMBER); eiColumn = new EiColumn(FIELD_ALREADY_PHONE_NUMBER);
eiColumn.setDescName("方联系人电话"); eiColumn.setDescName("出租方联系人电话");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CONTRACT_STATUS); eiColumn = new EiColumn(FIELD_CONTRACT_STATUS);
...@@ -233,21 +236,20 @@ public class HGCW006 extends DaoEPBase { ...@@ -233,21 +236,20 @@ public class HGCW006 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_TOTAL_CONTRACT_PRICE_EXCLUDING); eiColumn = new EiColumn(FIELD_TOTAL_CONTRACT_PRICE_EXCLUDING);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(3); eiColumn.setScaleLength(2);
eiColumn.setFieldLength(15); eiColumn.setFieldLength(15);
eiColumn.setDescName("合同总价(不含税)"); eiColumn.setDescName("合同总价(不含税)");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_VALUE_ADDED_TAX); eiColumn = new EiColumn(FIELD_VALUE_ADDED_TAX);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(3); eiColumn.setScaleLength(2);
eiColumn.setFieldLength(15); eiColumn.setDescName("税额");
eiColumn.setDescName("增值税");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_TOTAL_CONTRACT_PRICE_INCLUDING); eiColumn = new EiColumn(FIELD_TOTAL_CONTRACT_PRICE_INCLUDING);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(3); eiColumn.setScaleLength(2);
eiColumn.setFieldLength(15); eiColumn.setFieldLength(15);
eiColumn.setDescName("合同总价(含税)"); eiColumn.setDescName("合同总价(含税)");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
...@@ -290,6 +292,11 @@ public class HGCW006 extends DaoEPBase { ...@@ -290,6 +292,11 @@ public class HGCW006 extends DaoEPBase {
eiColumn.setFieldLength(15); eiColumn.setFieldLength(15);
eiColumn.setDescName("剩余开票/收票金额"); eiColumn.setDescName("剩余开票/收票金额");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CONTRACT_TYPE);
eiColumn.setDescName("合同类型;6-供方 7-需方");
eiMetadata.addMeta(eiColumn);
} }
/** /**
...@@ -835,6 +842,15 @@ public class HGCW006 extends DaoEPBase { ...@@ -835,6 +842,15 @@ public class HGCW006 extends DaoEPBase {
public void setRemainingAmount(BigDecimal remainingAmount) { public void setRemainingAmount(BigDecimal remainingAmount) {
this.remainingAmount = remainingAmount; this.remainingAmount = remainingAmount;
} }
public Integer getContractType() {
return contractType;
}
public void setContractType(Integer contractType) {
this.contractType = contractType;
}
/** /**
* get the value from Map. * get the value from Map.
* *
...@@ -877,6 +893,7 @@ public class HGCW006 extends DaoEPBase { ...@@ -877,6 +893,7 @@ public class HGCW006 extends DaoEPBase {
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime)); setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode)); setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setRemainingAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_REMAINING_AMOUNT)), remainingAmount)); setRemainingAmount(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_REMAINING_AMOUNT)), remainingAmount));
setContractType(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_CONTRACT_TYPE)), contractType));
} }
/** /**
...@@ -920,6 +937,7 @@ public class HGCW006 extends DaoEPBase { ...@@ -920,6 +937,7 @@ public class HGCW006 extends DaoEPBase {
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME))); map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE))); map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_REMAINING_AMOUNT, StringUtils.toString(remainingAmount, eiMetadata.getMeta(FIELD_REMAINING_AMOUNT))); map.put(FIELD_REMAINING_AMOUNT, StringUtils.toString(remainingAmount, eiMetadata.getMeta(FIELD_REMAINING_AMOUNT)));
map.put(FIELD_CONTRACT_TYPE, StringUtils.toString(contractType, eiMetadata.getMeta(FIELD_CONTRACT_TYPE)));
return map; return map;
} }
......
...@@ -123,7 +123,7 @@ public class HGCW007 extends DaoEPBase { ...@@ -123,7 +123,7 @@ public class HGCW007 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_DEVICE_NUMBER); eiColumn = new EiColumn(FIELD_DEVICE_NUMBER);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(3); eiColumn.setScaleLength(0);
eiColumn.setFieldLength(15); eiColumn.setFieldLength(15);
eiColumn.setDescName("数量"); eiColumn.setDescName("数量");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
...@@ -137,28 +137,28 @@ public class HGCW007 extends DaoEPBase { ...@@ -137,28 +137,28 @@ public class HGCW007 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_DAY_NUMBER); eiColumn = new EiColumn(FIELD_DAY_NUMBER);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(3); eiColumn.setScaleLength(0);
eiColumn.setFieldLength(15); eiColumn.setFieldLength(15);
eiColumn.setDescName("天数"); eiColumn.setDescName("天数");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_TOTAL_PRICE); eiColumn = new EiColumn(FIELD_TOTAL_PRICE);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(3); eiColumn.setScaleLength(2);
eiColumn.setFieldLength(15); eiColumn.setFieldLength(15);
eiColumn.setDescName("总价"); eiColumn.setDescName("总价");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_TAX_AMOUNT); eiColumn = new EiColumn(FIELD_TAX_AMOUNT);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(3); eiColumn.setScaleLength(2);
eiColumn.setFieldLength(15); eiColumn.setFieldLength(15);
eiColumn.setDescName("税额"); eiColumn.setDescName("税额");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_TOTAL_PRICE_INCLUDING); eiColumn = new EiColumn(FIELD_TOTAL_PRICE_INCLUDING);
eiColumn.setType("N"); eiColumn.setType("N");
eiColumn.setScaleLength(3); eiColumn.setScaleLength(2);
eiColumn.setFieldLength(15); eiColumn.setFieldLength(15);
eiColumn.setDescName("含税总价"); eiColumn.setDescName("含税总价");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
......
...@@ -83,56 +83,36 @@ public class ServiceHGCW006 extends ServiceBase { ...@@ -83,56 +83,36 @@ public class ServiceHGCW006 extends ServiceBase {
List<Map> detail2Rows = inInfo.getBlock("detail2").getRows(); List<Map> detail2Rows = inInfo.getBlock("detail2").getRows();
if (CollectionUtils.isNotEmpty(resultRows)) { if (CollectionUtils.isNotEmpty(resultRows)) {
HGCW006 HGCW006 = new HGCW006(); HGCW006 hgcw006 = new HGCW006();
HGCW006.fromMap(resultRows.get(0)); hgcw006.fromMap(resultRows.get(0));
//获取项目所属公司 //获取项目所属公司
String projCode = HGCW006.getProjCode(); String projCode = hgcw006.getProjCode();
HGSC001 HGSC001 = HGSCTools.Hgsc001.queryByCode(projCode); HGSC001 HGSC001 = HGSCTools.Hgsc001.queryByCode(projCode);
if (HGSC001 != null) { if (HGSC001 != null) {
HGCW006.setCompanyCode(HGSC001.getCompanyCode()); hgcw006.setCompanyCode(HGSC001.getCompanyCode());
HGCW006.setCompanyName(HGSC001.getCompanyName()); hgcw006.setCompanyName(HGSC001.getCompanyName());
} else { } else {
inInfo.setStatus(EiConstant.STATUS_FAILURE); inInfo.setStatus(EiConstant.STATUS_FAILURE);
inInfo.setMsg("操作失败!项目编码:[" + projCode + "]未找到对应的项目信息!"); inInfo.setMsg("操作失败!项目编码:[" + projCode + "]未找到对应的项目信息!");
} }
HGCW006.setLeaseStartDate(DateUtils.formatShort(HGCW006.getLeaseStartDate())); hgcw006.setLeaseStartDate(DateUtils.formatShort(hgcw006.getLeaseStartDate()));
HGCW006.setLeaseEndDate(DateUtils.formatShort(HGCW006.getLeaseEndDate())); hgcw006.setLeaseEndDate(DateUtils.formatShort(hgcw006.getLeaseEndDate()));
HGCW006.setSigningDate(DateUtils.formatShort(HGCW006.getSigningDate())); hgcw006.setSigningDate(DateUtils.formatShort(hgcw006.getSigningDate()));
if (HGCW006.getId() == null || HGCW006.getId() == 0) { if (hgcw006.getId() == null || hgcw006.getId() == 0) {
String contractNumber =HGCW006.getCompanyCode() + String contractNumber =hgcw006.getCompanyCode() +
"5" + "5" +
SequenceGenerator.getNextSequence(HGConstant.SequenceId.CW_CONTRACT_NO); SequenceGenerator.getNextSequence(HGConstant.SequenceId.CW_CONTRACT_NO);
HGCW006.setContractNumber(contractNumber); hgcw006.setContractNumber(contractNumber);
HGCW006.setReviewStatus(0); hgcw006.setReviewStatus(0);
hgcw006.setRemainingAmount(hgcw006.getTotalContractPriceIncluding());
this.add(HGCW006); this.add(hgcw006);
// 写入其他数据 // 写入其他数据
HGCWTools.HgCw007.save(detail1Rows,contractNumber,HGCW006); HGCWTools.HgCw007.save(detail1Rows,contractNumber,hgcw006);
HGCWTools.HgCw999.batchUpdate(detail2Rows,HGCW006.getId()); HGCWTools.HgCw999.batchUpdate(detail2Rows,hgcw006.getId());
} else { } else {
hgcw006.setRemainingAmount(hgcw006.getTotalContractPriceIncluding());
BigDecimal totalContractPriceExcluding = new BigDecimal(0); this.modify(hgcw006);
BigDecimal totalContractPriceIncluding = new BigDecimal(0);
BigDecimal valueAddedTax = new BigDecimal(0);
BigDecimal totalQuantity = new BigDecimal(0);
//计算合同清单金额
for (int i = 0; i < detail1Rows.size(); i++) {
HGCW007 hgcw007 = new HGCW007();
hgcw007.fromMap(detail1Rows.get(i));
totalContractPriceExcluding = totalContractPriceExcluding.add(hgcw007.getTotalPrice());
totalQuantity = totalQuantity.add(hgcw007.getDeviceNumber());
}
BigDecimal taxPoints = new BigDecimal(HGCW006.getTaxPoints() / 100);
totalContractPriceIncluding = totalContractPriceExcluding.multiply(taxPoints.add(new BigDecimal(1)));
valueAddedTax = totalContractPriceIncluding.subtract(totalContractPriceExcluding);
DecimalFormat decimalFormat = new DecimalFormat("#.000");
HGCW006.setTotalContractPriceExcluding(new BigDecimal(decimalFormat.format(totalContractPriceExcluding)));
HGCW006.setTotalContractPriceIncluding(new BigDecimal(decimalFormat.format(totalContractPriceIncluding)));
HGCW006.setValueAddedTax(new BigDecimal(decimalFormat.format(valueAddedTax)));
HGCW006.setTotalQuantity(totalQuantity);
this.modify(HGCW006);
} }
} }
inInfo = this.query(inInfo); inInfo = this.query(inInfo);
......
...@@ -14,6 +14,9 @@ import com.baosight.hggp.hg.xs.domain.Org; ...@@ -14,6 +14,9 @@ import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.tools.HGXSTools; import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.hggp.util.CommonMethod; import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.LogUtils; import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.StringUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
...@@ -22,6 +25,8 @@ import org.apache.commons.collections.CollectionUtils; ...@@ -22,6 +25,8 @@ import org.apache.commons.collections.CollectionUtils;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/** /**
* @author yukang * @author yukang
...@@ -57,23 +62,99 @@ public class ServiceHGCW006A extends ServiceBase { ...@@ -57,23 +62,99 @@ public class ServiceHGCW006A extends ServiceBase {
*/ */
public EiInfo partyAQuery(EiInfo inInfo) { public EiInfo partyAQuery(EiInfo inInfo) {
try { try {
List<Map> params = inInfo.getBlock(EiConstant.queryBlock).getRows();
List<UserVO> userVOList = new ArrayList<>(); List<UserVO> userVOList = new ArrayList<>();
String contractCategory = inInfo.getString("contractCategory"); String contractCategory = inInfo.getString("contractType");
List<Org> orgList = HGXSTools.XsOrg.queryByUser(); String partyA = inInfo.getString("partyA");
if (CollectionUtils.isNotEmpty(orgList)) { if (contractCategory.equals("6")) {
Org org = orgList.get(0); params.get(0).put("custCode",params.get(0).get("usercode"));
if (!org.getOrgType().equals("company")) { params.get(0).put("custName",params.get(0).get("username"));
//如果不是公司公司,则找到上一级 inInfo = super.query(inInfo,HGPZ002.QUERY, new HGPZ002(),false,new HGPZ002().eiMetadata,EiConstant.queryBlock, "partyAResult", "partyAResult");
List<Company> list = UserSessionUtils.getRoleCompany(); List<HGPZ002> hgpz002List = MapUtils.toDaoEPBases(inInfo.getBlock("partyAResult").getRows(), HGPZ002.class);
for (Company c:list) { if (CollectionUtils.isNotEmpty(hgpz002List)) {
if(params.size()>0){
Map<String,String> params1 = params.get(0);
Map<String,String> params2 = params.size()>1?params.get(1):null;
String username = params1.get("username");
String usercode = params1.get("usercode");
String username1 = params2==null?null:params2.get("username");
String usercode1 = params2==null?null:params2.get("usercode");
if (StringUtils.isNotNull(username)){
switch (username1){
case "eq":
hgpz002List = hgpz002List.stream().filter(hgpz002 -> hgpz002.getCustName().equals(username)).collect(Collectors.toList());
break;
case "neq":
hgpz002List = hgpz002List.stream().filter(hgpz002 -> !hgpz002.getCustName().equals(username)).collect(Collectors.toList());
break;
default:
hgpz002List = hgpz002List.stream().filter(hgpz002 -> hgpz002.getCustName().contains(username)).collect(Collectors.toList());
}
}
if (StringUtils.isNotNull(usercode)){
switch (usercode1){
case "eq":
hgpz002List = hgpz002List.stream().filter(hgpz002 -> hgpz002.getCustCode().equals(usercode)).collect(Collectors.toList());
break;
case "neq":
hgpz002List = hgpz002List.stream().filter(hgpz002 -> !hgpz002.getCustCode().equals(usercode)).collect(Collectors.toList());
break;
default:
hgpz002List = hgpz002List.stream().filter(hgpz002 -> hgpz002.getCustCode().contains(usercode)).collect(Collectors.toList());
}
}
}
hgpz002List.forEach(hgpz002 -> {
UserVO userVO = new UserVO(); UserVO userVO = new UserVO();
userVO.setUsercode(c.getCompanyCode()); userVO.setUsercode(hgpz002.getCustCode());
userVO.setUsername(c.getCompanyName()); userVO.setUsername(hgpz002.getCustName());
userVOList.add(userVO); userVOList.add(userVO);
});
}
} else if (contractCategory.equals("7")) {
List<Company> list = UserSessionUtils.getRoleCompany().stream().filter(c -> c.getCompanyCode().equals(partyA)).collect(Collectors.toList());
if(params.size()>0){
Map<String,String> params1 = params.get(0);
Map<String,String> params2 = params.size()>1?params.get(1):null;
String username = params1.get("username");
String usercode = params1.get("usercode");
String username1 = params2==null?null:params2.get("username");
String usercode1 = params2==null?null:params2.get("usercode");
if (StringUtils.isNotNull(username)){
switch (username1){
case "eq":
list = list.stream().filter(hgpz002 -> hgpz002.getCompanyName().equals(username)).collect(Collectors.toList());
break;
case "neq":
list = list.stream().filter(hgpz002 -> !hgpz002.getCompanyName().equals(username)).collect(Collectors.toList());
break;
default:
list = list.stream().filter(hgpz002 -> hgpz002.getCompanyName().contains(username)).collect(Collectors.toList());
}
} }
if (StringUtils.isNotNull(usercode)){
switch (usercode1){
case "eq":
list = list.stream().filter(hgpz002 -> hgpz002.getCompanyCode().equals(usercode)).collect(Collectors.toList());
break;
case "neq":
list = list.stream().filter(hgpz002 -> !hgpz002.getCompanyCode().equals(usercode)).collect(Collectors.toList());
break;
default:
list = list.stream().filter(hgpz002 -> hgpz002.getCompanyCode().contains(usercode)).collect(Collectors.toList());
}
}
}
for (Company c:list) {
UserVO userVO = new UserVO();
userVO.setUsercode(c.getCompanyCode());
userVO.setUsername(c.getCompanyName());
userVOList.add(userVO);
} }
} }
inInfo.addBlock("partyAResult").addRows(userVOList); //inInfo.getBlock("partyAResult").set(EiConstant.countStr, userVOList.size());
inInfo.getBlock("partyAResult").setRows(userVOList);
} catch (PlatException e) { } catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "甲方名称查询失败"); LogUtils.setDetailMsg(inInfo, e, "甲方名称查询失败");
} }
...@@ -86,10 +167,90 @@ public class ServiceHGCW006A extends ServiceBase { ...@@ -86,10 +167,90 @@ public class ServiceHGCW006A extends ServiceBase {
*/ */
public EiInfo partyBQuery(EiInfo inInfo) { public EiInfo partyBQuery(EiInfo inInfo) {
try { try {
List<Map> params = inInfo.getBlock(EiConstant.queryBlock).getRows();
List<UserVO> userVOList = new ArrayList<>(); List<UserVO> userVOList = new ArrayList<>();
String contractCategory = inInfo.getString("contractCategory"); String contractType = inInfo.getString("contractType");
List<HGPZ003> hgpz003List = HGCWTools.HgCw002.list(1); String partyB = inInfo.getString("partyB");
if (contractType.equals("6")) {
List<Company> list = UserSessionUtils.getRoleCompany().stream().filter(c -> c.getCompanyCode().equals(partyB)).collect(Collectors.toList());
if(params.size()>0){
Map<String,String> params1 = params.get(0);
Map<String,String> params2 = params.size()>1?params.get(1):null;
String username = params1.get("username");
String usercode = params1.get("usercode");
String username1 = params2==null?null:params2.get("username");
String usercode1 = params2==null?null:params2.get("usercode");
if (StringUtils.isNotNull(username)){
switch (username1){
case "eq":
list = list.stream().filter(hgpz002 -> hgpz002.getCompanyName().equals(username)).collect(Collectors.toList());
break;
case "neq":
list = list.stream().filter(hgpz002 -> !hgpz002.getCompanyName().equals(username)).collect(Collectors.toList());
break;
default:
list = list.stream().filter(hgpz002 -> hgpz002.getCompanyName().contains(username)).collect(Collectors.toList());
}
}
if (StringUtils.isNotNull(usercode)){
switch (usercode1){
case "eq":
list = list.stream().filter(hgpz002 -> hgpz002.getCompanyCode().equals(usercode)).collect(Collectors.toList());
break;
case "neq":
list = list.stream().filter(hgpz002 -> !hgpz002.getCompanyCode().equals(usercode)).collect(Collectors.toList());
break;
default:
list = list.stream().filter(hgpz002 -> hgpz002.getCompanyCode().contains(usercode)).collect(Collectors.toList());
}
}
}
for (Company c:list) {
UserVO userVO = new UserVO();
userVO.setUsercode(c.getCompanyCode());
userVO.setUsername(c.getCompanyName());
userVOList.add(userVO);
}
}
else if (contractType.equals("7")) {
params.get(0).put("supCode",params.get(0).get("usercode"));
params.get(0).put("supName",params.get(0).get("username"));
inInfo = super.query(inInfo,HGPZ003.QUERY, new HGPZ003(),false,new HGPZ003().eiMetadata,EiConstant.queryBlock, "partyAResult", "partyAResult");
List<HGPZ003> hgpz003List = MapUtils.toDaoEPBases(inInfo.getBlock("partyAResult").getRows(), HGPZ003.class);
if (CollectionUtils.isNotEmpty(hgpz003List)) { if (CollectionUtils.isNotEmpty(hgpz003List)) {
if(params.size()>0){
Map<String,String> params1 = params.get(0);
Map<String,String> params2 = params.size()>1?params.get(1):null;
String username = params1.get("username");
String usercode = params1.get("usercode");
String username1 = params2==null?null:params2.get("username");
String usercode1 = params2==null?null:params2.get("usercode");
if (StringUtils.isNotNull(username)){
switch (username1){
case "eq":
hgpz003List = hgpz003List.stream().filter(hgpz002 -> hgpz002.getSupName().equals(username)).collect(Collectors.toList());
break;
case "neq":
hgpz003List = hgpz003List.stream().filter(hgpz002 -> !hgpz002.getSupName().equals(username)).collect(Collectors.toList());
break;
default:
hgpz003List = hgpz003List.stream().filter(hgpz002 -> hgpz002.getSupName().contains(username)).collect(Collectors.toList());
}
}
if (StringUtils.isNotNull(usercode)){
switch (usercode1){
case "eq":
hgpz003List = hgpz003List.stream().filter(hgpz002 -> hgpz002.getSupCode().equals(usercode)).collect(Collectors.toList());
break;
case "neq":
hgpz003List = hgpz003List.stream().filter(hgpz002 -> !hgpz002.getSupCode().equals(usercode)).collect(Collectors.toList());
break;
default:
hgpz003List = hgpz003List.stream().filter(hgpz002 -> hgpz002.getSupCode().contains(usercode)).collect(Collectors.toList());
}
}
}
hgpz003List.forEach(hgpz003 -> { hgpz003List.forEach(hgpz003 -> {
UserVO userVO = new UserVO(); UserVO userVO = new UserVO();
userVO.setUsercode(hgpz003.getSupCode()); userVO.setUsercode(hgpz003.getSupCode());
...@@ -97,7 +258,9 @@ public class ServiceHGCW006A extends ServiceBase { ...@@ -97,7 +258,9 @@ public class ServiceHGCW006A extends ServiceBase {
userVOList.add(userVO); userVOList.add(userVO);
}); });
} }
inInfo.addBlock("partyAResult").addRows(userVOList); }
//inInfo.getBlock("partyAResult").set(EiConstant.countStr, userVOList.size());
inInfo.getBlock("partyAResult").setRows(userVOList);
} catch (PlatException e) { } catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "乙方名称查询失败"); LogUtils.setDetailMsg(inInfo, e, "乙方名称查询失败");
} }
......
...@@ -2,6 +2,7 @@ package com.baosight.hggp.hg.cw.service; ...@@ -2,6 +2,7 @@ package com.baosight.hggp.hg.cw.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum; import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cw.domain.HGCW006; import com.baosight.hggp.hg.cw.domain.HGCW006;
import com.baosight.hggp.hg.cw.domain.HGCW003; import com.baosight.hggp.hg.cw.domain.HGCW003;
import com.baosight.hggp.hg.cw.domain.HGCW007; import com.baosight.hggp.hg.cw.domain.HGCW007;
...@@ -16,6 +17,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceBase; ...@@ -16,6 +17,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @author yukang * @author yukang
......
...@@ -71,13 +71,13 @@ public class ServiceHGCW007 extends ServiceBase { ...@@ -71,13 +71,13 @@ public class ServiceHGCW007 extends ServiceBase {
String contractNumber = ""; String contractNumber = "";
// 写入数据 // 写入数据
for (int i = 0; i < resultRows.size(); i++) { for (int i = 0; i < resultRows.size(); i++) {
HGCW007 HGCW007 = new HGCW007(); HGCW007 hgcw007 = new HGCW007();
HGCW007.fromMap(resultRows.get(i)); hgcw007.fromMap(resultRows.get(i));
contractNumber = HGCW007.getContractNumber(); contractNumber = hgcw007.getContractNumber();
if (HGCW007.getId() == null || HGCW007.getId() == 0) { if (hgcw007.getId() == null || hgcw007.getId() == 0) {
this.add(HGCW007); this.add(hgcw007);
} else { } else {
this.modify(HGCW007); this.modify(hgcw007);
} }
} }
List<HGCW007> HGCW007List = HGCWTools.HgCw007.queryByContractNumber(contractNumber); List<HGCW007> HGCW007List = HGCWTools.HgCw007.queryByContractNumber(contractNumber);
......
...@@ -156,6 +156,9 @@ ...@@ -156,6 +156,9 @@
<isNotEmpty prepend=" AND " property="supName"> <isNotEmpty prepend=" AND " property="supName">
PARTY_B like concat('%',#supName#,'%') PARTY_B like concat('%',#supName#,'%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="contractType">
CONTRACT_TYPE = #contractType#
</isNotEmpty>
</sql> </sql>
<select id="query" parameterClass="java.util.HashMap" <select id="query" parameterClass="java.util.HashMap"
...@@ -194,7 +197,8 @@ ...@@ -194,7 +197,8 @@
UPDATED_BY as "updatedBy", <!-- 记录修改者 --> UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 --> UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 --> UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DEP_CODE as "depCode" <!-- 部门编码 --> DEP_CODE as "depCode", <!-- 部门编码 -->
CONTRACT_TYPE as "contractType"
FROM ${hggpSchema}.HGCW006 WHERE 1=1 FROM ${hggpSchema}.HGCW006 WHERE 1=1
<include refid="condition" /> <include refid="condition" />
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
...@@ -349,9 +353,10 @@ ...@@ -349,9 +353,10 @@
UPDATED_BY, <!-- 记录修改者 --> UPDATED_BY, <!-- 记录修改者 -->
UPDATED_NAME, <!-- 记录修改名称 --> UPDATED_NAME, <!-- 记录修改名称 -->
UPDATED_TIME, <!-- 记录修改时间 --> UPDATED_TIME, <!-- 记录修改时间 -->
DEP_CODE <!-- 部门编码 --> DEP_CODE, <!-- 部门编码 -->
CONTRACT_TYPE
) )
VALUES (#id#, #accountCode#, #companyCode#, #companyName#, #projCode#, #projName#, #contractNumber#, #contractName#, #partyA#, #partyB#, #signingDate#, #totalQuantity#, #partyAName#, #partyAPhoneNumber#, #alreadyName#, #alreadyPhoneNumber#, #contractStatus#, #leaseStartDate#, #leaseEndDate#, #paymentMethod#, #pricingMethod#, #taxPoints#, #totalContractPriceExcluding#, #valueAddedTax#, #totalContractPriceIncluding#,#remainingAmount#, #reviewStatus#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #depCode#) VALUES (#id#, #accountCode#, #companyCode#, #companyName#, #projCode#, #projName#, #contractNumber#, #contractName#, #partyA#, #partyB#, #signingDate#, #totalQuantity#, #partyAName#, #partyAPhoneNumber#, #alreadyName#, #alreadyPhoneNumber#, #contractStatus#, #leaseStartDate#, #leaseEndDate#, #paymentMethod#, #pricingMethod#, #taxPoints#, #totalContractPriceExcluding#, #valueAddedTax#, #totalContractPriceIncluding#,#remainingAmount#, #reviewStatus#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #depCode#, #contractType#)
<selectKey resultClass="long" keyProperty="id"> <selectKey resultClass="long" keyProperty="id">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGCW006 SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGCW006
</selectKey> </selectKey>
...@@ -388,7 +393,8 @@ ...@@ -388,7 +393,8 @@
TOTAL_CONTRACT_PRICE_INCLUDING = #totalContractPriceIncluding#, <!-- 合同总价(含税) --> TOTAL_CONTRACT_PRICE_INCLUDING = #totalContractPriceIncluding#, <!-- 合同总价(含税) -->
UPDATED_BY = #updatedBy#, <!-- 记录修改者 --> UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 --> UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime# <!-- 记录修改时间 --> UPDATED_TIME = #updatedTime#, <!-- 记录修改时间 -->
CONTRACT_TYPE = #contractType#
WHERE WHERE
ID = #id# ID = #id#
</update> </update>
......
...@@ -223,7 +223,7 @@ ...@@ -223,7 +223,7 @@
UNIT_PRICE = #unitPrice#, <!-- 单价 --> UNIT_PRICE = #unitPrice#, <!-- 单价 -->
DAY_NUMBER = #dayNumber#, <!-- 天数 --> DAY_NUMBER = #dayNumber#, <!-- 天数 -->
TOTAL_PRICE = #totalPrice#, <!-- 总价 --> TOTAL_PRICE = #totalPrice#, <!-- 总价 -->
TAX_AMOUNT = #taxAmount# TAX_AMOUNT = #taxAmount#,
TOTAL_PRICE_INCLUDING = #totalPriceIncluding#, TOTAL_PRICE_INCLUDING = #totalPriceIncluding#,
CREATED_BY = #createdBy#, <!-- 记录创建者 --> CREATED_BY = #createdBy#, <!-- 记录创建者 -->
CREATED_NAME = #createdName#, <!-- 记录创建名称 --> CREATED_NAME = #createdName#, <!-- 记录创建名称 -->
......
...@@ -151,16 +151,12 @@ function saveFunc() { ...@@ -151,16 +151,12 @@ function saveFunc() {
EiCommunicator.send("HGCW004", "save", info, { EiCommunicator.send("HGCW004", "save", info, {
onSuccess: function (ei) { onSuccess: function (ei) {
if (ei.getStatus() >= 0) { if (ei.getStatus() >= 0) {
try {
query();
} catch (e) {
// TODO: handle exception
}
if (ei.getStatus() == 0) { if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning'); NotificationUtil(ei, 'warning');
} else { } else {
NotificationUtil(ei); NotificationUtil(ei);
} }
query();
} else { } else {
NotificationUtil(ei, "error"); NotificationUtil(ei, "error");
} }
...@@ -220,16 +216,12 @@ function switchRow() { ...@@ -220,16 +216,12 @@ function switchRow() {
EiCommunicator.send("HGCW004", "switchRow", info, { EiCommunicator.send("HGCW004", "switchRow", info, {
onSuccess: function (ei) { onSuccess: function (ei) {
if (ei.getStatus() >= 0) { if (ei.getStatus() >= 0) {
try {
query();
} catch (e) {
// TODO: handle exception
}
if (ei.getStatus() == 0) { if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning'); NotificationUtil(ei, 'warning');
} else { } else {
NotificationUtil(ei); NotificationUtil(ei);
} }
query();
} else { } else {
NotificationUtil(ei, "error"); NotificationUtil(ei, "error");
} }
...@@ -298,16 +290,12 @@ function submitFunc() { ...@@ -298,16 +290,12 @@ function submitFunc() {
EiCommunicator.send("HGCW004", "submit", info, { EiCommunicator.send("HGCW004", "submit", info, {
onSuccess: function (ei) { onSuccess: function (ei) {
if (ei.getStatus() >= 0) { if (ei.getStatus() >= 0) {
try {
query();
} catch (e) {
// TODO: handle exception
}
if (ei.getStatus() == 0) { if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning'); NotificationUtil(ei, 'warning');
} else { } else {
NotificationUtil(ei); NotificationUtil(ei);
} }
query();
} else { } else {
NotificationUtil(ei, "error"); NotificationUtil(ei, "error");
} }
......
$(function() { $(function() {
var projectCodeBox = __eiInfo.getBlock("projectCodeBox_block_id").getMappedRows();
$("#cancel").on("click", function () { $("#cancel").on("click", function () {
cancelFunc(); cancelFunc();
}); });
...@@ -55,6 +57,7 @@ $(function() { ...@@ -55,6 +57,7 @@ $(function() {
} }
} }
}); });
IPLAT.EFInput.value($("#result-0-signingDate"), currShortDate());
}, },
onSave: function (e) { onSave: function (e) {
// 阻止默认请求,使用自定义保存 // 阻止默认请求,使用自定义保存
...@@ -103,6 +106,29 @@ $(function() { ...@@ -103,6 +106,29 @@ $(function() {
} else { } else {
$("#result-0-projName").val(textField); $("#result-0-projName").val(textField);
} }
let contractType = $("#result-0-contractType").val();
for (let i = 0; i < projectCodeBox.length; i++) {
if (!isBlank(valueField)){
if (projectCodeBox[i]['valueField'] === valueField){
if (contractType == "7"){
$("#result-0-partyA").val(projectCodeBox[i]['param3Field']+"-"+projectCodeBox[i]['param4Field']);
IPLAT.EFPopupInput.text( $("#popupInputPartyA") , projectCodeBox[i]['param3Field']+"-"+projectCodeBox[i]['param4Field']);
}else {
$("#result-0-partyB").val(projectCodeBox[i]['param3Field']+"-"+projectCodeBox[i]['param4Field']);
IPLAT.EFPopupInput.text( $("#popupInputPartyB") , projectCodeBox[i]['param3Field']+"-"+projectCodeBox[i]['param4Field']);
}
var planStartDate = $("#result-0-leaseStartDate").data("kendoDatePicker");
planStartDate.value(projectCodeBox[i]['param5Field'], "d");
var planEndDate = $("#result-0-leaseEndDate").data("kendoDatePicker");
planEndDate.value(projectCodeBox[i]['param6Field'], "d");
IPLAT.EFInput.value($("#result-0-partyAName"), projectCodeBox[i]['param7Field']);
IPLAT.EFInput.value($("#result-0-partyAPhoneNumber"), projectCodeBox[i]['param8Field']);
break;
}
}
}
} }
}, },
"result-0-taxPoints": { "result-0-taxPoints": {
...@@ -112,38 +138,98 @@ $(function() { ...@@ -112,38 +138,98 @@ $(function() {
if (allRows.length > 0) { if (allRows.length > 0) {
var dataItem = e.dataItem; var dataItem = e.dataItem;
var valueField = dataItem['valueField']; var valueField = dataItem['valueField'];
let taxPoints = valueField / 100 + 1;
if (valueField) { if (valueField) {
var taxPoints = valueField / 100; let totalContractPriceIncluding = 0;
var totalContractPriceIncluding = 0; let totalContractPriceExcluding = 0;
var valueAddedTax = 0; let valueAddedTax = 0;
//更新表格含税金额 //更新表格含税金额
for (var i = 0; i < allRows.length; i++) { for (var i = 0; i < allRows.length; i++) {
var row = allRows[i]; let row = allRows[i];
var totalPriceIncluding = row.totalPrice * (1 + parseFloat(taxPoints)); let totalPriceIncluding = row.totalPrice * (parseFloat(taxPoints));
var taxAmount = totalPriceIncluding - row.totalPrice; let taxAmount = totalPriceIncluding - row.totalPrice;
detail1Grid.setCellValue(row, 'totalPriceIncluding', parseFloat(totalPriceIncluding).toFixed(3)); detail1Grid.setCellValue(row, 'totalPriceIncluding', parseFloat(totalPriceIncluding).toFixed(2));
detail1Grid.setCellValue(row, 'taxAmount', parseFloat(taxAmount).toFixed(3)); detail1Grid.setCellValue(row, 'taxAmount', parseFloat(taxAmount).toFixed(2));
totalContractPriceIncluding += totalPriceIncluding; totalContractPriceIncluding += totalPriceIncluding;
totalContractPriceExcluding += parseFloat(row.totalPrice,2);
} }
$("#result-0-totalContractPriceIncluding").val(totalContractPriceIncluding.toFixed(3)) $("#result-0-totalContractPriceIncluding").val(totalContractPriceIncluding.toFixed(2))
var totalPriceExcluding = $("#result-0-totalContractPriceExcluding").val(); $("#result-0-totalContractPriceExcluding").val(totalContractPriceExcluding.toFixed(2));
valueAddedTax = parseFloat(totalContractPriceIncluding.toFixed(3)) - parseFloat(totalPriceExcluding); valueAddedTax = parseFloat(totalContractPriceIncluding.toFixed(2)) - parseFloat(totalContractPriceExcluding.toFixed(2));
$("#result-0-valueAddedTax").val(valueAddedTax.toFixed(3)) $("#result-0-valueAddedTax").val(valueAddedTax.toFixed(2))
} else { } else {
var totalContractPriceExcluding = 0; let totalContractPriceIncluding = 0;
var valueAddedTax = 0; let totalContractPriceExcluding = 0;
let valueAddedTax = 0;
for (var i = 0; i < allRows.length; i++) { for (var i = 0; i < allRows.length; i++) {
var row = allRows[i]; var row = allRows[i];
detail1Grid.setCellValue(row, 'totalPriceIncluding', row.totalPrice); let totalPriceIncluding = row.totalPrice * (parseFloat(taxPoints));
detail1Grid.setCellValue(row, 'taxAmount', 0); let taxAmount = totalPriceIncluding - row.totalPrice;
totalContractPriceExcluding += parseFloat(row.totalPrice); detail1Grid.setCellValue(row, 'totalPriceIncluding', parseFloat(totalPriceIncluding).toFixed(2));
detail1Grid.setCellValue(row, 'taxAmount', parseFloat(taxAmount).toFixed(2));
totalContractPriceExcluding += parseFloat(row.totalPrice.toFixed(2));
totalContractPriceIncluding += parseFloat(totalPriceIncluding.toFixed(2));
} }
$("#result-0-totalContractPriceIncluding").val(totalContractPriceExcluding.toFixed(3)) valueAddedTax = parseFloat(totalContractPriceIncluding.toFixed(2)) - parseFloat(totalContractPriceExcluding.toFixed(2));
$("#result-0-valueAddedTax").val(valueAddedTax.toFixed(3)) $("#result-0-totalContractPriceIncluding").val(totalContractPriceIncluding.toFixed(2));
$("#result-0-totalContractPriceExcluding").val(totalContractPriceExcluding.toFixed(2));
$("#result-0-valueAddedTax").val(valueAddedTax.toFixed(2))
} }
} }
} }
}, },
"result-0-contractType": {
/**
* 销售合同和补充协议合同类别为收入,其余的为支出
* @param e
*/
select: function (e) {
var dataItem = e.dataItem;
console.log(dataItem)
//清除甲乙方
IPLAT.EFPopupInput.clear(("#popupInputPartyA"), true)
IPLAT.EFPopupInput.clear(("#popupInputPartyB"), true)
let planStartDate = $("#result-0-leaseStartDate").data("kendoDatePicker");
let planEndDate = $("#result-0-leaseEndDate").data("kendoDatePicker");
planStartDate.value("", "d");
planEndDate.value("", "d");
$("#result-0-partyA").val("");
$("#result-0-partyB").val("");
var valueField = dataItem['valueField'];
if (valueField == "6") {
for (let i = 0; i < projectCodeBox.length; i++) {
let projCode = $("#result-0-projCode").val()
if (!isBlank(projCode)){
if (projectCodeBox[i]['valueField'] === projCode){
$("#result-0-partyB").val(projectCodeBox[i]['param3Field']+"-"+projectCodeBox[i]['param4Field']);
IPLAT.EFPopupInput.text( $("#popupInputPartyB") , projectCodeBox[i]['param3Field']+"-"+projectCodeBox[i]['param4Field']);
planStartDate.value(projectCodeBox[i]['param5Field'], "d");
planEndDate.value(projectCodeBox[i]['param6Field'], "d");
IPLAT.EFInput.value($("#result-0-partyAName"), projectCodeBox[i]['param7Field']);
IPLAT.EFInput.value($("#result-0-partyAPhoneNumber"), projectCodeBox[i]['param8Field']);
break;
}
}
}
} else if (valueField == "7"){
for (let i = 0; i < projectCodeBox.length; i++) {
let projCode = $("#result-0-projCode").val()
if (!isBlank(projCode)){
if (projectCodeBox[i]['valueField'] === projCode){
$("#result-0-partyA").val(projectCodeBox[i]['param3Field']+"-"+projectCodeBox[i]['param4Field']);
IPLAT.EFPopupInput.text( $("#popupInputPartyA") , projectCodeBox[i]['param3Field']+"-"+projectCodeBox[i]['param4Field']);
planStartDate.value(projectCodeBox[i]['param5Field'], "d");
planEndDate.value(projectCodeBox[i]['param6Field'], "d");
IPLAT.EFInput.value($("#result-0-partyAName"), projectCodeBox[i]['param7Field']);
IPLAT.EFInput.value($("#result-0-partyAPhoneNumber"), projectCodeBox[i]['param8Field'])
}
}
}
}
}
}
} }
IPLATUI.EFPopupInput = { IPLATUI.EFPopupInput = {
...@@ -155,8 +241,16 @@ $(function() { ...@@ -155,8 +241,16 @@ $(function() {
* 配置了query时,默认每次打开窗口都会进行一次查询 * 配置了query时,默认每次打开窗口都会进行一次查询
*/ */
query: function (e) { query: function (e) {
console.log("Step" + (++i) + ": ----query----"); var contractType = $("#result-0-contractType").val();
if (!contractType) {
message("请先选择合同类型!");
// 阻止弹窗
e.preventDefault();
}
var info = new EiInfo(); var info = new EiInfo();
info.set("contractType",contractType);
info.set("partyA",$("#result-0-partyA").val().split("-")[0])
info.set("inqu_status-0-status",1);
return info; return info;
}, },
/** /**
...@@ -167,7 +261,6 @@ $(function() { ...@@ -167,7 +261,6 @@ $(function() {
* e.model 选中的数据行model * e.model 选中的数据行model
*/ */
backFill: function (e) { backFill: function (e) {
console.log("Step" + (++i) + ": ----backFill----");
// 回填数据 // 回填数据
var model = e.model; var model = e.model;
// var data = model.toJSON(); // var data = model.toJSON();
...@@ -177,7 +270,8 @@ $(function() { ...@@ -177,7 +270,8 @@ $(function() {
IPLAT.EFPopupInput.text( $("#popupInputPartyA") , partyA) IPLAT.EFPopupInput.text( $("#popupInputPartyA") , partyA)
e.preventDefault(); // 不使用默认的回填逻辑 e.preventDefault(); // 不使用默认的回填逻辑
} }
},"popupInputPartyB": { },
"popupInputPartyB": {
/** /**
* EFGrid 查询时触发的事件,通常在此处,设置查询条件 * EFGrid 查询时触发的事件,通常在此处,设置查询条件
...@@ -185,10 +279,16 @@ $(function() { ...@@ -185,10 +279,16 @@ $(function() {
* 配置了query时,默认每次打开窗口都会进行一次查询 * 配置了query时,默认每次打开窗口都会进行一次查询
*/ */
query: function (e) { query: function (e) {
console.log("Step" + (++i) + ": ----query----"); var contractType = $("#result-0-contractType").val();
// 将自定义div中的字段构造成查询条件 EiInfo if (!contractType) {
// var queryInfo = EiInfo.build("#result-0-contractCategory"); message("请先选择合同类型!");
// 阻止弹窗
e.preventDefault();
}
var info = new EiInfo(); var info = new EiInfo();
info.set("contractType",contractType);
info.set("partyB",$("#result-0-partyB").val().split("-")[0]);
info.set("inqu_status-0-status",1);
return info; return info;
}, },
/** /**
...@@ -199,11 +299,9 @@ $(function() { ...@@ -199,11 +299,9 @@ $(function() {
* e.model 选中的数据行model * e.model 选中的数据行model
*/ */
backFill: function (e) { backFill: function (e) {
console.log("Step" + (++i) + ": ----backFill----");
// 回填数据 // 回填数据
var model = e.model; var model = e.model;
// var data = model.toJSON(); // var data = model.toJSON();
console.log(model);
var partyB = model.usercode + "-" + model.username; var partyB = model.usercode + "-" + model.username;
$("#result-0-partyB").val(partyB); $("#result-0-partyB").val(partyB);
IPLAT.EFPopupInput.text( $("#popupInputPartyB") , partyB) IPLAT.EFPopupInput.text( $("#popupInputPartyB") , partyB)
...@@ -394,10 +492,10 @@ function calculateAmount(item) { ...@@ -394,10 +492,10 @@ function calculateAmount(item) {
totalPriceIncluding = totalPriceExcluding * (1 + parseFloat(taxPoints)); totalPriceIncluding = totalPriceExcluding * (1 + parseFloat(taxPoints));
valueAddedTax = parseFloat(totalPriceIncluding) - parseFloat(totalPriceExcluding); valueAddedTax = parseFloat(totalPriceIncluding) - parseFloat(totalPriceExcluding);
$("#result-0-totalContractPriceExcluding").val(parseFloat(totalPriceExcluding).toFixed(3)) $("#result-0-totalContractPriceExcluding").val(parseFloat(totalPriceExcluding).toFixed(2))
$("#result-0-totalContractPriceIncluding").val(parseFloat(totalPriceIncluding).toFixed(3)) $("#result-0-totalContractPriceIncluding").val(parseFloat(totalPriceIncluding).toFixed(2))
$("#result-0-valueAddedTax").val(parseFloat(valueAddedTax).toFixed(3)) $("#result-0-valueAddedTax").val(parseFloat(valueAddedTax).toFixed(2))
$("#result-0-totalQuantity").val(parseFloat(deviceNumber).toFixed(3)) $("#result-0-totalQuantity").val(parseFloat(deviceNumber).toFixed(2))
} }
/** /**
...@@ -432,9 +530,9 @@ function calculateUnitAmount(item) { ...@@ -432,9 +530,9 @@ function calculateUnitAmount(item) {
totalPriceIncluding = totalPriceExcluding * (1 + parseFloat(taxPoints)); totalPriceIncluding = totalPriceExcluding * (1 + parseFloat(taxPoints));
valueAddedTax = parseFloat(totalPriceIncluding) - parseFloat(totalPriceExcluding); valueAddedTax = parseFloat(totalPriceIncluding) - parseFloat(totalPriceExcluding);
$("#result-0-totalContractPriceExcluding").val(parseFloat(totalPriceExcluding).toFixed(3)) $("#result-0-totalContractPriceExcluding").val(parseFloat(totalPriceExcluding).toFixed(2))
$("#result-0-totalContractPriceIncluding").val(parseFloat(totalPriceIncluding).toFixed(3)) $("#result-0-totalContractPriceIncluding").val(parseFloat(totalPriceIncluding).toFixed(2))
$("#result-0-valueAddedTax").val(parseFloat(valueAddedTax).toFixed(3)) $("#result-0-valueAddedTax").val(parseFloat(valueAddedTax).toFixed(2))
$("#result-0-totalQuantity").val(parseFloat(deviceNumber).toFixed(3)) $("#result-0-totalQuantity").val(parseFloat(deviceNumber).toFixed(2))
} }
...@@ -4,15 +4,15 @@ ...@@ -4,15 +4,15 @@
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %> <%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/> <c:set var="ctx" value="${pageContext.request.contextPath}"/>
<head> <script>
</head> var ctx = "${ctx}";
</script>
<EF:EFPage title="新增合同"> <EF:EFPage title="新增合同">
<EF:EFRegion id="inqu1" title="基本信息"> <EF:EFRegion id="inqu1" title="基本信息">
<div class="row"> <div class="row">
<EF:EFSelect cname="项目编号" ename="projCodeBox" colWidth="4" required="true" filter="contains"> <EF:EFSelect cname="项目编号" ename="projCodeBox" colWidth="4" required="true" filter="contains">
<EF:EFOption label="-- 请选择 --" value="" /> <EF:EFOption label="-- 请选择 --" value="" />
<EF:EFOptions <EF:EFOptions blockId="projectCodeBox_block_id" valueField="valueField" textField="textField"/>
blockId="projectCodeBox_block_id" valueField="valueField" textField="textField"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFInput ename="result-0-projCode" cname="项目编号" type="hidden"/> <EF:EFInput ename="result-0-projCode" cname="项目编号" type="hidden"/>
<EF:EFInput ename="result-0-projName" cname="项目简称" colWidth="4" readonly="true"/> <EF:EFInput ename="result-0-projName" cname="项目简称" colWidth="4" readonly="true"/>
...@@ -20,50 +20,52 @@ ...@@ -20,50 +20,52 @@
</div> </div>
<div class="row"> <div class="row">
<EF:EFInput ename="result-0-contractName" cname="合同名称" colWidth="4" required="true"/> <EF:EFInput ename="result-0-contractName" cname="合同名称" colWidth="4" required="true"/>
<EF:EFPopupInput ename="popupInputPartyA" cname="甲方名称" colWidth="4" <EF:EFSelect ename="result-0-contractType" cname="合同类型" colWidth="4" filter="contains" required="true" defaultValue="6">
serviceName="HGCW006A" methodName="partyAQuery" <EF:EFOption label="-- 请选择 --" value=""/>
resultId="partyAResult" <EF:EFCodeOption codeName="hggp.cw.contractType" condition="ITEM_CODE IN ('6', '7')"/>
required="true" save="false" popupType="ServiceGrid" </EF:EFSelect>
<EF:EFDatePicker ename="result-0-signingDate" cname="签约日期" colWidth="4" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
</div>
<div class="row">
<EF:EFPopupInput ename="popupInputPartyA" cname="承租方" colWidth="4"
serviceName="HGCW006A" methodName="partyAQuery" resultId="partyAResult"
save="false" popupType="ServiceGrid"
valueField="username" textField="username" valueField="username" textField="username"
columnEnames="username,usercode" columnEnames="username,usercode"
columnCnames="名称,编码" columnCnames="名称,编码"
readonly="true" required="true" readonly="true" resizable="true"
resizable="true" popupTitle="甲方名称" popupWidth="400"> popupTitle="承租方" popupWidth="400">
</EF:EFPopupInput> </EF:EFPopupInput>
<EF:EFInput ename="result-0-partyA" cname="甲方名称" type="hidden" /> <EF:EFInput ename="result-0-partyA" cname="承租方" type="hidden" />
<EF:EFPopupInput ename="popupInputPartyB" cname="乙方名称" colWidth="4" <EF:EFPopupInput ename="popupInputPartyB" cname="出租方" colWidth="4"
serviceName="HGCW006A" methodName="partyBQuery" serviceName="HGCW006A" methodName="partyBQuery" resultId="partyAResult"
resultId="partyAResult"
save="false" popupType="ServiceGrid" save="false" popupType="ServiceGrid"
valueField="username" textField="username" valueField="username" textField="username"
columnEnames="username,usercode" columnEnames="username,usercode"
columnCnames="名称,编码" columnCnames="名称,编码"
readonly="true" readonly="true" resizable="true"
resizable="true" popupTitle="乙方名称" popupWidth="400"> popupTitle="出租方名称" popupWidth="400">
</EF:EFPopupInput> </EF:EFPopupInput>
<EF:EFInput ename="result-0-partyB" cname="方名称" type="hidden"/> <EF:EFInput ename="result-0-partyB" cname="出租方名称" type="hidden"/>
<EF:EFInput ename="result-0-totalQuantity" cname="总数量" colWidth="4" readonly="true"/>
</div> </div>
<div class="row"> <div class="row">
<EF:EFDatePicker cname="签约日期" ename="result-0-signingDate" colWidth="4" <EF:EFInput ename="result-0-partyAName" cname="承租方联系人姓名" colWidth="4" />
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/> <EF:EFInput ename="result-0-partyAPhoneNumber" cname="承租方联系人电话" colWidth="4" />
<EF:EFInput ename="result-0-totalQuantity" cname="总数量" colWidth="4" readonly="true"/> <EF:EFSelect cname="合同状态" ename="result-0-contractStatus" colWidth="4" filter="contains" defaultValue="2">
<EF:EFInput ename="result-0-partyAName" cname="甲方联系人姓名" colWidth="4" /> <EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.contractStatus"/>
</EF:EFSelect>
</div> </div>
<div class="row"> <div class="row">
<EF:EFInput ename="result-0-partyAPhoneNumber" cname="甲方联系人电话" colWidth="4" /> <EF:EFInput ename="result-0-alreadyName" cname="出租方联系人姓名" colWidth="4" />
<EF:EFInput ename="result-0-alreadyName" cname="已方联系人姓名" colWidth="4" /> <EF:EFInput ename="result-0-alreadyPhoneNumber" cname="出租方联系人电话" colWidth="4" />
<EF:EFInput ename="result-0-alreadyPhoneNumber" cname="已方联系人电话" colWidth="4" />
</div> </div>
<div class="row"> <div class="row">
<EF:EFDateSpan startCname="租赁开始/结束日期" endCname="至" required="true" colWidth="8" blockId="result" <EF:EFDateSpan startCname="租赁开始/结束日期" endCname="至" required="true" colWidth="8" blockId="result"
startName="leaseStartDate" endName="leaseEndDate" row="0" role="date" startName="leaseStartDate" endName="leaseEndDate" row="0" role="date"
format="yyyy-MM-dd" ratio="4:4" satrtRatio="4:8" endRatio="4:8"> format="yyyy-MM-dd" ratio="4:4" satrtRatio="4:8" endRatio="4:8">
</EF:EFDateSpan> </EF:EFDateSpan>
<EF:EFSelect cname="合同状态" ename="result-0-contractStatus" colWidth="4" filter="contains">
<EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.contractStatus"/>
</EF:EFSelect>
</div> </div>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="inqu2" title="承包方式及合同价款"> <EF:EFRegion id="inqu2" title="承包方式及合同价款">
...@@ -80,24 +82,22 @@ ...@@ -80,24 +82,22 @@
<EF:EFOption label="-- 请选择 --" value=""/> <EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.taxPoints"/> <EF:EFCodeOption codeName="hggp.cw.taxPoints"/>
</EF:EFSelect> </EF:EFSelect>
</div>
<div class="row">
<EF:EFInput ename="result-0-totalContractPriceExcluding" cname="合同总价(不含税)" colWidth="4" readonly="true"/> <EF:EFInput ename="result-0-totalContractPriceExcluding" cname="合同总价(不含税)" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-valueAddedTax" cname="增值税" colWidth="4" readonly="true"/> <EF:EFInput ename="result-0-valueAddedTax" cname="税额" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-totalContractPriceIncluding" cname="合同总价(含税)" colWidth="4" readonly="true"/> <EF:EFInput ename="result-0-totalContractPriceIncluding" cname="合同总价(含税)" colWidth="4" readonly="true"/>
</div> </div>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="detail1" title="合同清单"> <EF:EFRegion id="detail1" title="合同清单">
<EF:EFGrid blockId="detail1" autoDraw="override" checkMode="row" isFloat="true" copyToAdd="false"> <EF:EFGrid blockId="detail1" autoDraw="override" checkMode="row" isFloat="true" copyToAdd="false">
<EF:EFColumn ename="rowNo" cname="行号" hidden="true"/>
<EF:EFColumn ename="id" cname="主键" hidden="true"/> <EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="rowNo" cname="行号" hidden="true"/>
<EF:EFColumn ename="deviceName" cname="设备名称" align="center" /> <EF:EFColumn ename="deviceName" cname="设备名称" align="center" />
<EF:EFColumn ename="deviceNumber" cname="数量" format="{0:N3}" align="center"/> <EF:EFColumn ename="deviceNumber" cname="数量" format="{0:N3}" align="center"/>
<EF:EFColumn ename="unitPrice" cname="单价" format="{0:N3}" align="center"/> <EF:EFColumn ename="unitPrice" cname="单价" format="{0:N3}" align="center"/>
<EF:EFColumn ename="dayNumber" cname="天数" format="{0:N3}" align="center"/> <EF:EFColumn ename="dayNumber" cname="天数" format="{0:N3}" align="center"/>
<EF:EFColumn ename="totalPrice" cname="总价" format="{0:N3}" align="center"/> <EF:EFColumn ename="totalPrice" cname="总价" format="{0:N2}" align="center"/>
<EF:EFColumn ename="taxAmount" cname="税额" enable="false" format="{0:N3}" align="center"/> <EF:EFColumn ename="taxAmount" cname="税额" enable="false" format="{0:N2}" align="center"/>
<EF:EFColumn ename="totalPriceIncluding" cname="含税总价" enable="false" format="{0:N3}" align="center"/> <EF:EFColumn ename="totalPriceIncluding" cname="含税总价" enable="false" format="{0:N2}" align="center"/>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </EF:EFRegion>
...@@ -115,10 +115,4 @@ ...@@ -115,10 +115,4 @@
<EF:EFButton ename="cancel" cname="取消" type="button" class="btn-center"/> <EF:EFButton ename="cancel" cname="取消" type="button" class="btn-center"/>
<EF:EFButton ename="btn_save" cname="保存" type="button" class="btn-center"/> <EF:EFButton ename="btn_save" cname="保存" type="button" class="btn-center"/>
</div> </div>
</EF:EFPage> </EF:EFPage>
\ No newline at end of file
<script>
var ctx = "${ctx}";
</script>
<script src="${ctx}/HG/CW/HGCW006A.js"></script>
\ No newline at end of file
$(function() { $(function() {
var projectCodeBox = __eiInfo.getBlock("projectCodeBox_block_id").getMappedRows();
$("#cancel").on("click", function () { $("#cancel").on("click", function () {
cancelFunc(); cancelFunc();
}); });
...@@ -17,6 +19,21 @@ $(function() { ...@@ -17,6 +19,21 @@ $(function() {
], ],
loadComplete: function (grid) { loadComplete: function (grid) {
grid.dataSource.bind("change", function(e) { grid.dataSource.bind("change", function(e) {
if (e.field == "deviceNumber" || e.field == "unitPrice" || e.field == "dayNumber" || e.field == "totalPrice") {
var tr,index;
// 获取此model元素信息
var item = e.items[0];
var pricingMethod = $("#result-0-pricingMethod").val();
if (pricingMethod == 1) {
calculateAmount(item);
} else if (pricingMethod == 2) {
calculateUnitAmount(item);
} else {
}
}
});
/*grid.dataSource.bind("change", function(e) {
if (e.field == "dayNumber") { if (e.field == "dayNumber") {
var tr,index; var tr,index;
// 获取此model元素信息 // 获取此model元素信息
...@@ -49,7 +66,7 @@ $(function() { ...@@ -49,7 +66,7 @@ $(function() {
$("#result-0-totalQuantity").val(parseFloat(deviceNumber).toFixed(3)) $("#result-0-totalQuantity").val(parseFloat(deviceNumber).toFixed(3))
} }
}); });*/
setTimeout(function() { setTimeout(function() {
initDate(); initDate();
}, 1000); }, 1000);
...@@ -113,6 +130,127 @@ $(function() { ...@@ -113,6 +130,127 @@ $(function() {
} else { } else {
$("#result-0-projName").val(textField); $("#result-0-projName").val(textField);
} }
let contractType = $("#result-0-contractType").val();
for (let i = 0; i < projectCodeBox.length; i++) {
if (!isBlank(valueField)){
if (projectCodeBox[i]['valueField'] === valueField){
if (contractType == "7"){
$("#result-0-partyA").val(projectCodeBox[i]['param3Field']+"-"+projectCodeBox[i]['param4Field']);
IPLAT.EFPopupInput.text( $("#popupInputPartyA") , projectCodeBox[i]['param3Field']+"-"+projectCodeBox[i]['param4Field']);
}else {
$("#result-0-partyB").val(projectCodeBox[i]['param3Field']+"-"+projectCodeBox[i]['param4Field']);
IPLAT.EFPopupInput.text( $("#popupInputPartyB") , projectCodeBox[i]['param3Field']+"-"+projectCodeBox[i]['param4Field']);
}
var planStartDate = $("#result-0-leaseStartDate").data("kendoDatePicker");
planStartDate.value(projectCodeBox[i]['param5Field'], "d");
var planEndDate = $("#result-0-leaseEndDate").data("kendoDatePicker");
planEndDate.value(projectCodeBox[i]['param6Field'], "d");
IPLAT.EFInput.value($("#result-0-partyAName"), projectCodeBox[i]['param7Field']);
IPLAT.EFInput.value($("#result-0-partyAPhoneNumber"), projectCodeBox[i]['param8Field']);
break;
}
}
}
}
},
"result-0-taxPoints": {
// 点击下拉选项时触发
select: function (e) { //获取勾选值
var allRows = detail1Grid.getDataItems();
if (allRows.length > 0) {
var dataItem = e.dataItem;
var valueField = dataItem['valueField'];
let taxPoints = valueField / 100 + 1;
if (valueField) {
let totalContractPriceIncluding = 0;
let totalContractPriceExcluding = 0;
let valueAddedTax = 0;
//更新表格含税金额
for (var i = 0; i < allRows.length; i++) {
let row = allRows[i];
let totalPriceIncluding = row.totalPrice * (parseFloat(taxPoints));
let taxAmount = totalPriceIncluding - row.totalPrice;
detail1Grid.setCellValue(row, 'totalPriceIncluding', parseFloat(totalPriceIncluding).toFixed(2));
detail1Grid.setCellValue(row, 'taxAmount', parseFloat(taxAmount).toFixed(2));
totalContractPriceIncluding += totalPriceIncluding;
totalContractPriceExcluding += parseFloat(row.totalPrice,2);
}
$("#result-0-totalContractPriceIncluding").val(totalContractPriceIncluding.toFixed(2))
$("#result-0-totalContractPriceExcluding").val(totalContractPriceExcluding.toFixed(2));
valueAddedTax = parseFloat(totalContractPriceIncluding.toFixed(2)) - parseFloat(totalContractPriceExcluding.toFixed(2));
$("#result-0-valueAddedTax").val(valueAddedTax.toFixed(2))
} else {
let totalContractPriceIncluding = 0;
let totalContractPriceExcluding = 0;
let valueAddedTax = 0;
for (var i = 0; i < allRows.length; i++) {
var row = allRows[i];
let totalPriceIncluding = row.totalPrice * (parseFloat(taxPoints));
let taxAmount = totalPriceIncluding - row.totalPrice;
detail1Grid.setCellValue(row, 'totalPriceIncluding', parseFloat(totalPriceIncluding).toFixed(2));
detail1Grid.setCellValue(row, 'taxAmount', parseFloat(taxAmount).toFixed(2));
totalContractPriceExcluding += parseFloat(row.totalPrice.toFixed(2));
totalContractPriceIncluding += parseFloat(totalPriceIncluding.toFixed(2));
}
valueAddedTax = parseFloat(totalContractPriceIncluding.toFixed(2)) - parseFloat(totalContractPriceExcluding.toFixed(2));
$("#result-0-totalContractPriceIncluding").val(totalContractPriceIncluding.toFixed(2));
$("#result-0-totalContractPriceExcluding").val(totalContractPriceExcluding.toFixed(2));
$("#result-0-valueAddedTax").val(valueAddedTax.toFixed(2))
}
}
}
},
"result-0-contractType": {
/**
* 销售合同和补充协议合同类别为收入,其余的为支出
* @param e
*/
select: function (e) {
var dataItem = e.dataItem;
console.log(dataItem)
//清除甲乙方
IPLAT.EFPopupInput.clear(("#popupInputPartyA"), true)
IPLAT.EFPopupInput.clear(("#popupInputPartyB"), true)
let planStartDate = $("#result-0-leaseStartDate").data("kendoDatePicker");
let planEndDate = $("#result-0-leaseEndDate").data("kendoDatePicker");
planStartDate.value("", "d");
planEndDate.value("", "d");
$("#result-0-partyA").val("");
$("#result-0-partyB").val("");
var valueField = dataItem['valueField'];
if (valueField == "6") {
for (let i = 0; i < projectCodeBox.length; i++) {
let projCode = $("#result-0-projCode").val()
if (!isBlank(projCode)){
if (projectCodeBox[i]['valueField'] === projCode){
$("#result-0-partyB").val(projectCodeBox[i]['param3Field']+"-"+projectCodeBox[i]['param4Field']);
IPLAT.EFPopupInput.text( $("#popupInputPartyB") , projectCodeBox[i]['param3Field']+"-"+projectCodeBox[i]['param4Field']);
planStartDate.value(projectCodeBox[i]['param5Field'], "d");
planEndDate.value(projectCodeBox[i]['param6Field'], "d");
IPLAT.EFInput.value($("#result-0-partyAName"), projectCodeBox[i]['param7Field']);
IPLAT.EFInput.value($("#result-0-partyAPhoneNumber"), projectCodeBox[i]['param8Field']);
break;
}
}
}
} else if (valueField == "7"){
for (let i = 0; i < projectCodeBox.length; i++) {
let projCode = $("#result-0-projCode").val()
if (!isBlank(projCode)){
if (projectCodeBox[i]['valueField'] === projCode){
$("#result-0-partyA").val(projectCodeBox[i]['param3Field']+"-"+projectCodeBox[i]['param4Field']);
IPLAT.EFPopupInput.text( $("#popupInputPartyA") , projectCodeBox[i]['param3Field']+"-"+projectCodeBox[i]['param4Field']);
planStartDate.value(projectCodeBox[i]['param5Field'], "d");
planEndDate.value(projectCodeBox[i]['param6Field'], "d");
IPLAT.EFInput.value($("#result-0-partyAName"), projectCodeBox[i]['param7Field']);
IPLAT.EFInput.value($("#result-0-partyAPhoneNumber"), projectCodeBox[i]['param8Field'])
}
}
}
}
} }
} }
} }
...@@ -126,8 +264,16 @@ $(function() { ...@@ -126,8 +264,16 @@ $(function() {
* 配置了query时,默认每次打开窗口都会进行一次查询 * 配置了query时,默认每次打开窗口都会进行一次查询
*/ */
query: function (e) { query: function (e) {
console.log("Step" + (++i) + ": ----query----"); var contractType = $("#result-0-contractType").val();
if (!contractType) {
message("请先选择合同类型!");
// 阻止弹窗
e.preventDefault();
}
var info = new EiInfo(); var info = new EiInfo();
info.set("contractType",contractType);
info.set("partyA",$("#result-0-partyA").val().split("-")[0])
info.set("inqu_status-0-status",1);
return info; return info;
}, },
/** /**
...@@ -148,6 +294,43 @@ $(function() { ...@@ -148,6 +294,43 @@ $(function() {
IPLAT.EFPopupInput.text( $("#popupInputPartyA") , partyA) IPLAT.EFPopupInput.text( $("#popupInputPartyA") , partyA)
e.preventDefault(); // 不使用默认的回填逻辑 e.preventDefault(); // 不使用默认的回填逻辑
} }
},
"popupInputPartyB": {
/**
* EFGrid 查询时触发的事件,通常在此处,设置查询条件
* 注意: 必须返回一个EiInfo,作为初始查询条件
* 配置了query时,默认每次打开窗口都会进行一次查询
*/
query: function (e) {
var contractType = $("#result-0-contractType").val();
if (!contractType) {
message("请先选择合同类型!");
// 阻止弹窗
e.preventDefault();
}
var info = new EiInfo();
info.set("contractType",contractType);
info.set("partyB",$("#result-0-partyB").val().split("-")[0]);
info.set("inqu_status-0-status",1);
return info;
},
/**
* grid中的数据回填时触发的事件
* @param e 回填数据事件
* e.sender 弹出窗口对象
* e.grid 弹出的grid对象
* e.model 选中的数据行model
*/
backFill: function (e) {
// 回填数据
var model = e.model;
// var data = model.toJSON();
var partyB = model.usercode + "-" + model.username;
$("#result-0-partyB").val(partyB);
IPLAT.EFPopupInput.text( $("#popupInputPartyB") , partyB)
e.preventDefault(); // 不使用默认的回填逻辑
}
} }
}; };
...@@ -165,9 +348,10 @@ function initDate() { ...@@ -165,9 +348,10 @@ function initDate() {
var projCode = $("#result-0-projCode").val(); var projCode = $("#result-0-projCode").val();
$("#projCodeBox").data("kendoDropDownList").value(projCode); $("#projCodeBox").data("kendoDropDownList").value(projCode);
var partyA = $("#result-0-partyA").val(); var partyA = $("#result-0-partyA").val();
IPLAT.EFPopupInput.text( $("#popupInputPartyA") , partyA) var partyB = $("#result-0-partyB").val();
IPLAT.EFPopupInput.text( $("#popupInputPartyA") , partyA)
IPLAT.EFPopupInput.text( $("#popupInputPartyB") , partyB)
} }
function saveResult1Func(btn) { function saveResult1Func(btn) {
...@@ -180,11 +364,12 @@ function saveResult1Func(btn) { ...@@ -180,11 +364,12 @@ function saveResult1Func(btn) {
ok: function () { ok: function () {
var info = new EiInfo(); var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("detail1")); info.addBlock(JSUtils.checkedRows2Block("detail1"));
EiCommunicator.send("HGCW003", "save", info, { EiCommunicator.send("HGCW007", "save", info, {
onSuccess: function (ei) { onSuccess: function (ei) {
if (ei.getStatus() >= 0) { if (ei.getStatus() >= 0) {
try { try {
NotificationUtil(response.msg); NotificationUtil(response.msg);
calculateAmount(null);
} catch (e) { } catch (e) {
// TODO: handle exception // TODO: handle exception
} }
...@@ -269,7 +454,7 @@ function btnSaveFunc() { ...@@ -269,7 +454,7 @@ function btnSaveFunc() {
fieldValidation(); fieldValidation();
JSUtils.confirm("确定对数据做\"保存\"操作? ", { JSUtils.confirm("确定对数据做\"保存\"操作? ", {
ok: function () { ok: function () {
JSUtils.submitGrid("detail1,detail2", "HGCW002", "save", {isAlldata:true,onSuccessCallback:parent.windowCallback}); JSUtils.submitGrid("detail1,detail2", "HGCW006", "save", {isAlldata:true,onSuccessCallback:parent.windowCallback});
} }
}); });
} }
...@@ -315,6 +500,7 @@ function deleteFileFunc() { ...@@ -315,6 +500,7 @@ function deleteFileFunc() {
}); });
} }
function deleteResult1Func() { function deleteResult1Func() {
let rows = detail1Grid.getCheckedRows(); let rows = detail1Grid.getCheckedRows();
if (rows.length < 1) { if (rows.length < 1) {
...@@ -325,17 +511,12 @@ function deleteResult1Func() { ...@@ -325,17 +511,12 @@ function deleteResult1Func() {
ok: function () { ok: function () {
var info = new EiInfo(); var info = new EiInfo();
info.addBlock(JSUtils.checkedRows2Block("detail1")); info.addBlock(JSUtils.checkedRows2Block("detail1"));
EiCommunicator.send("HGCW003", "delete", info, { EiCommunicator.send("HGCW007", "delete", info, {
onSuccess: function (ei) { onSuccess: function (ei) {
if (ei.getStatus() >= 0) { if (ei.getStatus() >= 0) {
try {
NotificationUtil(response.msg);
} catch (e) {
// TODO: handle exception
}
if (IPLAT.isAvailable("detail1")) { if (IPLAT.isAvailable("detail1")) {
window['detail1Grid'].setEiInfo(ei); window['detail1Grid'].setEiInfo(ei);
calculateAmount(); calculateAmount(null);
} }
if (ei.getStatus() == 0) { if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning'); NotificationUtil(ei, 'warning');
...@@ -345,7 +526,7 @@ function deleteResult1Func() { ...@@ -345,7 +526,7 @@ function deleteResult1Func() {
} else { } else {
NotificationUtil(ei, "error"); NotificationUtil(ei, "error");
} }
//deleteDetail1Func()
}, },
onFail: function (ei) { onFail: function (ei) {
// 发生异常 // 发生异常
...@@ -356,22 +537,6 @@ function deleteResult1Func() { ...@@ -356,22 +537,6 @@ function deleteResult1Func() {
}); });
} }
function calculateAmount() {
var allRows = detail1Grid.getDataItems();
var totalPriceExcluding = 0;
var totalPriceIncluding = 0;
var valueAddedTax = 0;
allRows.forEach(function (row, index) {
totalPriceExcluding += parseFloat(row.totalPriceExcluding);
totalPriceIncluding += parseFloat(row.totalPriceIncluding);
});
valueAddedTax = parseFloat(totalPriceIncluding) - parseFloat(totalPriceExcluding);
$("#result-0-totalContractPriceExcluding").val(totalPriceExcluding.toFixed(3))
$("#result-0-totalContractPriceIncluding").val(totalPriceIncluding.toFixed(3))
$("#result-0-valueAddedTax").val(valueAddedTax.toFixed(3))
}
function fieldValidation() { function fieldValidation() {
var contractType = $("#result-0-contractType").val(); var contractType = $("#result-0-contractType").val();
if (contractType == "3") { if (contractType == "3") {
...@@ -383,3 +548,135 @@ function fieldValidation() { ...@@ -383,3 +548,135 @@ function fieldValidation() {
} }
} }
let refreshRowNo = function () {
let allRows = detail1Grid.getDataItems();
for (let i = 0; i < allRows.length; i++) {
detail1Grid.setCellValue(i, "rowNo", i);
detail1Grid.refresh();
}
}
/**
* 计算总价
* @param item
*/
function calculateAmount(item) {
if (item == null){
var allRows = detail1Grid.getDataItems();
var totalPriceExcluding = 0;
var totalPriceIncluding = 0;
var valueAddedTax = 0;
allRows.forEach(function (row, index) {
totalPriceExcluding += parseFloat(row.totalPrice);
totalPriceIncluding += parseFloat(row.totalPriceIncluding);
});
valueAddedTax = parseFloat(totalPriceIncluding) - parseFloat(totalPriceExcluding);
$("#result-0-totalContractPriceExcluding").val(totalPriceExcluding.toFixed(2))
$("#result-0-totalContractPriceIncluding").val(totalPriceIncluding.toFixed(2))
$("#result-0-valueAddedTax").val(valueAddedTax.toFixed(2))
}else {
var taxPoints = $("#result-0-taxPoints").val() ? $("#result-0-taxPoints").val() / 100 : 0;
var deviceNumber = item != null ? parseFloat(item.deviceNumber) || 0 : 0;
var unitPrice = item != null ? parseFloat(item.unitPrice) || 0 : 0;
var dayNumber = item != null ? parseFloat(item.dayNumber) || 0 : 0;
var totalPrice = deviceNumber * unitPrice * dayNumber;
var totalPriceIncluding = totalPrice * (1 + parseFloat(taxPoints));
var taxAmount = totalPriceIncluding - totalPrice
if (item) {
detail1Grid.setCellValue(item, 'totalPrice', parseFloat(totalPrice));
detail1Grid.setCellValue(item, 'totalPriceIncluding', parseFloat(totalPriceIncluding));
detail1Grid.setCellValue(item, 'taxAmount', parseFloat(taxAmount));
}
var allRows = detail1Grid.getDataItems();
var totalPriceExcluding = 0;
var totalPriceIncluding = 0;
var valueAddedTax = 0;
totalPrice = 0;
deviceNumber = 0
allRows.forEach(function (row, index) {
totalPrice += parseFloat(row.totalPrice);
deviceNumber += parseFloat(row.deviceNumber);
});
totalPriceExcluding = totalPrice;
totalPriceIncluding = totalPriceExcluding * (1 + parseFloat(taxPoints));
valueAddedTax = parseFloat(totalPriceIncluding) - parseFloat(totalPriceExcluding);
$("#result-0-totalContractPriceExcluding").val(parseFloat(totalPriceExcluding).toFixed(2));
$("#result-0-totalContractPriceIncluding").val(parseFloat(totalPriceIncluding).toFixed(2));
$("#result-0-valueAddedTax").val(parseFloat(valueAddedTax).toFixed(2));
$("#result-0-totalQuantity").val(parseFloat(deviceNumber).toFixed(2));
var taxPoints = $("#result-0-taxPoints").val() ? $("#result-0-taxPoints").val() / 100 : 0;
var deviceNumber = item != null ? parseFloat(item.deviceNumber) || 0 : 0;
var unitPrice = item != null ? parseFloat(item.unitPrice) || 0 : 0;
var dayNumber = item != null ? parseFloat(item.dayNumber) || 0 : 0;
var totalPrice = deviceNumber * unitPrice * dayNumber;
var totalPriceIncluding = totalPrice * (1 + parseFloat(taxPoints));
var taxAmount = totalPriceIncluding - totalPrice
if (item) {
detail1Grid.setCellValue(item, 'totalPrice', parseFloat(totalPrice));
detail1Grid.setCellValue(item, 'totalPriceIncluding', parseFloat(totalPriceIncluding));
detail1Grid.setCellValue(item, 'taxAmount', parseFloat(taxAmount));
}
var allRows = detail1Grid.getDataItems();
var totalPriceExcluding = 0;
var totalPriceIncluding = 0;
var valueAddedTax = 0;
totalPrice = 0;
deviceNumber = 0
allRows.forEach(function (row, index) {
totalPrice += parseFloat(row.totalPrice);
deviceNumber += parseFloat(row.deviceNumber);
});
totalPriceExcluding = totalPrice;
totalPriceIncluding = totalPriceExcluding * (1 + parseFloat(taxPoints));
valueAddedTax = parseFloat(totalPriceIncluding) - parseFloat(totalPriceExcluding);
$("#result-0-totalContractPriceExcluding").val(parseFloat(totalPriceExcluding).toFixed(2))
$("#result-0-totalContractPriceIncluding").val(parseFloat(totalPriceIncluding).toFixed(2))
$("#result-0-valueAddedTax").val(parseFloat(valueAddedTax).toFixed(2))
$("#result-0-totalQuantity").val(parseFloat(deviceNumber).toFixed(2))
}
}
/**
* 计算单价
*/
function calculateUnitAmount(item) {
var taxPoints = $("#result-0-taxPoints").val() ? $("#result-0-taxPoints").val() / 100 : 0;
var deviceNumber = item != null ? parseFloat(item.deviceNumber) || 0 : 0;
var dayNumber = item != null ? parseFloat(item.dayNumber) || 0 : 0;
var totalPrice = item != null ? parseFloat(item.totalPrice) || 0 : 0;
var unitPrice = totalPrice / (deviceNumber * dayNumber);
var totalPriceIncluding = totalPrice * (1 + parseFloat(taxPoints));
var taxAmount = totalPriceIncluding - totalPrice
if (item) {
detail1Grid.setCellValue(item, 'unitPrice', parseFloat(unitPrice));
detail1Grid.setCellValue(item, 'totalPriceIncluding', parseFloat(totalPriceIncluding));
detail1Grid.setCellValue(item, 'taxAmount', parseFloat(taxAmount));
}
var allRows = detail1Grid.getDataItems();
var totalPriceExcluding = 0;
var totalPriceIncluding = 0;
var valueAddedTax = 0;
totalPrice = 0;
deviceNumber = 0
allRows.forEach(function (row, index) {
totalPrice += parseFloat(row.totalPrice);
deviceNumber += parseFloat(row.deviceNumber);
});
totalPriceExcluding = totalPrice;
totalPriceIncluding = totalPriceExcluding * (1 + parseFloat(taxPoints));
valueAddedTax = parseFloat(totalPriceIncluding) - parseFloat(totalPriceExcluding);
$("#result-0-totalContractPriceExcluding").val(parseFloat(totalPriceExcluding).toFixed(2))
$("#result-0-totalContractPriceIncluding").val(parseFloat(totalPriceIncluding).toFixed(2))
$("#result-0-valueAddedTax").val(parseFloat(valueAddedTax).toFixed(2))
$("#result-0-totalQuantity").val(parseFloat(deviceNumber).toFixed(2))
}
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %> <%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/> <c:set var="ctx" value="${pageContext.request.contextPath}"/>
<script>
var ctx = "${ctx}";
</script>
<head> <head>
</head> </head>
<EF:EFPage title="修改合同"> <EF:EFPage title="修改合同">
...@@ -21,40 +24,54 @@ ...@@ -21,40 +24,54 @@
</div> </div>
<div class="row"> <div class="row">
<EF:EFInput ename="result-0-contractName" cname="合同名称" colWidth="4" required="true"/> <EF:EFInput ename="result-0-contractName" cname="合同名称" colWidth="4" required="true"/>
<EF:EFPopupInput ename="popupInputPartyA" cname="甲方名称" colWidth="4" <EF:EFSelect ename="result-0-contractType" cname="合同类型" colWidth="4" filter="contains" required="true">
serviceName="HGCW006A" methodName="partyAQuery" <EF:EFOption label="-- 请选择 --" value=""/>
resultId="partyAResult" <EF:EFCodeOption codeName="hggp.cw.contractType" condition="ITEM_CODE IN ('6', '7')"/>
required="true" save="false" popupType="ServiceGrid" </EF:EFSelect>
<EF:EFDatePicker cname="签约日期" ename="result-0-signingDate" colWidth="4"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
</div>
<div class="row">
<EF:EFPopupInput ename="popupInputPartyA" cname="承租方" colWidth="4"
serviceName="HGCW006A" methodName="partyAQuery" resultId="partyAResult"
save="false" popupType="ServiceGrid"
valueField="username" textField="username" valueField="username" textField="username"
columnEnames="username,usercode" columnEnames="username,usercode"
columnCnames="名称,编码" columnCnames="名称,编码"
readonly="true" required="true" readonly="true" resizable="true"
resizable="true" popupTitle="甲方名称" popupWidth="400"> popupTitle="承租方" popupWidth="400">
</EF:EFPopupInput> </EF:EFPopupInput>
<EF:EFInput ename="result-0-partyA" cname="甲方名称" type="hidden" /> <EF:EFInput ename="result-0-partyA" cname="承租方" type="hidden" />
<EF:EFInput ename="result-0-partyB" cname="乙方名称" colWidth="4" /> <EF:EFPopupInput ename="popupInputPartyB" cname="出租方" colWidth="4"
serviceName="HGCW006A" methodName="partyBQuery" resultId="partyAResult"
save="false" popupType="ServiceGrid"
valueField="username" textField="username"
columnEnames="username,usercode"
columnCnames="名称,编码"
readonly="true" resizable="true"
popupTitle="出租方名称" popupWidth="400">
</EF:EFPopupInput>
<EF:EFInput ename="result-0-partyB" cname="出租方名称" type="hidden"/>
<EF:EFInput ename="result-0-totalQuantity" cname="总数量" colWidth="4" readonly="true"/>
</div> </div>
<div class="row"> <div class="row">
<EF:EFDatePicker cname="签约日期" ename="result-0-signingDate" colWidth="4" <EF:EFInput ename="result-0-partyAName" cname="承租方联系人姓名" colWidth="4" />
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/> <EF:EFInput ename="result-0-partyAPhoneNumber" cname="承租方联系人电话" colWidth="4" />
<EF:EFInput ename="result-0-totalQuantity" cname="总数量" colWidth="4" readonly="true"/> <EF:EFSelect cname="合同状态" ename="result-0-contractStatus" colWidth="4" filter="contains">
<EF:EFInput ename="result-0-partyAName" cname="甲方联系人姓名" colWidth="4" /> <EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.contractStatus"/>
</EF:EFSelect>
</div> </div>
<div class="row"> <div class="row">
<EF:EFInput ename="result-0-partyAPhoneNumber" cname="甲方联系人电话" colWidth="4" /> <EF:EFInput ename="result-0-alreadyName" cname="出租方联系人姓名" colWidth="4" />
<EF:EFInput ename="result-0-alreadyName" cname="已方联系人姓名" colWidth="4" /> <EF:EFInput ename="result-0-alreadyPhoneNumber" cname="出租方联系人电话" colWidth="4" />
<EF:EFInput ename="result-0-alreadyPhoneNumber" cname="已方联系人电话" colWidth="4" />
</div> </div>
<div class="row"> <div class="row">
<EF:EFDateSpan startCname="租赁开始/结束日期" endCname="至" required="true" colWidth="8" blockId="result" <EF:EFDateSpan startCname="租赁开始/结束日期" endCname="至" required="true" colWidth="8" blockId="result"
startName="leaseStartDate" endName="leaseEndDate" row="0" role="date" startName="leaseStartDate" endName="leaseEndDate" row="0" role="date"
format="yyyy-MM-dd" ratio="4:4" satrtRatio="4:8" endRatio="4:8"> format="yyyy-MM-dd" ratio="4:4" satrtRatio="4:8" endRatio="4:8">
</EF:EFDateSpan> </EF:EFDateSpan>
<EF:EFSelect cname="合同状态" ename="result-0-contractStatus" colWidth="4" filter="contains">
<EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.contractStatus"/>
</EF:EFSelect>
</div> </div>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="inqu2" title="承包方式及合同价款"> <EF:EFRegion id="inqu2" title="承包方式及合同价款">
...@@ -74,19 +91,21 @@ ...@@ -74,19 +91,21 @@
</div> </div>
<div class="row"> <div class="row">
<EF:EFInput ename="result-0-totalContractPriceExcluding" cname="合同总价(不含税)" colWidth="4" readonly="true"/> <EF:EFInput ename="result-0-totalContractPriceExcluding" cname="合同总价(不含税)" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-valueAddedTax" cname="增值税" colWidth="4" readonly="true"/> <EF:EFInput ename="result-0-valueAddedTax" cname="税额" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-totalContractPriceIncluding" cname="合同总价(含税)" colWidth="4" readonly="true"/> <EF:EFInput ename="result-0-totalContractPriceIncluding" cname="合同总价(含税)" colWidth="4" readonly="true"/>
</div> </div>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="detail1" title="合同清单"> <EF:EFRegion id="detail1" title="合同清单">
<EF:EFGrid blockId="detail1" autoDraw="override" checkMode="row" isFloat="true" copyToAdd="false"> <EF:EFGrid blockId="detail1" autoDraw="override" checkMode="row" isFloat="true" copyToAdd="false">
<EF:EFColumn ename="rowNo" cname="行号" hidden="true"/>
<EF:EFColumn ename="id" cname="主键" hidden="true"/> <EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="rowNo" cname="行号" hidden="true"/>
<EF:EFColumn ename="deviceName" cname="设备名称" align="center" /> <EF:EFColumn ename="deviceName" cname="设备名称" align="center" />
<EF:EFColumn ename="deviceNumber" cname="数量" format="{0:N3}" align="center"/> <EF:EFColumn ename="deviceNumber" cname="数量" format="{0:N3}" align="center"/>
<EF:EFColumn ename="unitPrice" cname="单价" format="{0:N3}" align="center"/> <EF:EFColumn ename="unitPrice" cname="单价" format="{0:N3}" align="center"/>
<EF:EFColumn ename="dayNumber" cname="天数" format="{0:N3}" align="center"/> <EF:EFColumn ename="dayNumber" cname="天数" format="{0:N3}" align="center"/>
<EF:EFColumn ename="totalPrice" cname="总价" enable="false" format="{0:N3}" align="center"/> <EF:EFColumn ename="totalPrice" cname="总价" enable="false" format="{0:N2}" align="center"/>
<EF:EFColumn ename="taxAmount" cname="税额" enable="false" format="{0:N2}" align="center"/>
<EF:EFColumn ename="totalPriceIncluding" cname="含税总价" enable="false" format="{0:N2}" align="center"/>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="detail2" title="附件信息"> <EF:EFRegion id="detail2" title="附件信息">
...@@ -103,10 +122,4 @@ ...@@ -103,10 +122,4 @@
<EF:EFButton ename="cancel" cname="取消" type="button" class="btn-center"/> <EF:EFButton ename="cancel" cname="取消" type="button" class="btn-center"/>
<EF:EFButton ename="btn_save" cname="保存" type="button" class="btn-center"/> <EF:EFButton ename="btn_save" cname="保存" type="button" class="btn-center"/>
</div> </div>
</EF:EFPage> </EF:EFPage>
\ No newline at end of file
<script>
var ctx = "${ctx}";
</script>
<script src="${ctx}/HG/CW/HGCW006B.js"></script>
\ No newline at end of file
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %> <%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/> <c:set var="ctx" value="${pageContext.request.contextPath}"/>
<script>
var ctx = "${ctx}";
</script>
<head> <head>
</head> </head>
<EF:EFPage title="合同详情"> <EF:EFPage title="合同详情">
...@@ -16,28 +19,38 @@ ...@@ -16,28 +19,38 @@
</div> </div>
<div class="row"> <div class="row">
<EF:EFInput ename="result-0-contractName" cname="合同名称" colWidth="4" readonly="true"/> <EF:EFInput ename="result-0-contractName" cname="合同名称" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-partyA" cname="甲方名称" colWidth="4" readonly="true"/> <EF:EFSelect ename="result-0-contractType" cname="合同类型" colWidth="4" filter="contains" required="true">
<EF:EFInput ename="result-0-partyB" cname="乙方名称" colWidth="4" readonly="true"/> <EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.contractType" condition="ITEM_CODE IN ('6', '7')"/>
</EF:EFSelect>
<EF:EFDatePicker cname="签约日期" ename="result-0-signingDate" colWidth="4" readonly="true"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
</div> </div>
<div class="row"> <div class="row">
<EF:EFInput ename="result-0-signingDate" cname="签约日期" colWidth="4" readonly="true"/> <EF:EFInput ename="result-0-partyA" cname="承租方" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-partyB" cname="出租方" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-totalQuantity" cname="总数量" colWidth="4" readonly="true"/> <EF:EFInput ename="result-0-totalQuantity" cname="总数量" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-partyAName" cname="甲方联系人姓名" colWidth="4" readonly="true" enable="false"/>
</div>
<div class="row">
<EF:EFInput ename="result-0-partyAPhoneNumber" cname="甲方联系人电话" colWidth="4" readonly="true" enable="false"/>
<EF:EFInput ename="result-0-alreadyName" cname="已方联系人姓名" colWidth="4" readonly="true" enable="false"/>
<EF:EFInput ename="result-0-alreadyPhoneNumber" cname="已方联系人电话" colWidth="4" readonly="true" enable="false"/>
</div> </div>
<div class="row"> <div class="row">
<EF:EFInput ename="result-0-leaseStartDate" cname="租赁开始日期" colWidth="4" readonly="true"/> <EF:EFInput ename="result-0-partyAName" cname="承租方联系人姓名" colWidth="4" readonly="true" enable="false"/>
<EF:EFInput ename="result-0-leaseEndDate" cname="租赁结束日期" colWidth="4" readonly="true"/> <EF:EFInput ename="result-0-partyAPhoneNumber" cname="承租方联系人电话" colWidth="4" readonly="true" enable="false"/>
<EF:EFSelect cname="合同状态" ename="result-0-contractStatus" colWidth="4" filter="contains" readonly="true" enable="false"> <EF:EFSelect cname="合同状态" ename="result-0-contractStatus" colWidth="4" filter="contains" readonly="true" enable="false">
<EF:EFOption label="-- 请选择 --" value=""/> <EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.contractStatus"/> <EF:EFCodeOption codeName="hggp.cw.contractStatus"/>
</EF:EFSelect> </EF:EFSelect>
</div> </div>
<div class="row">
<EF:EFInput ename="result-0-alreadyName" cname="出租方联系人姓名" colWidth="4" readonly="true" enable="false"/>
<EF:EFInput ename="result-0-alreadyPhoneNumber" cname="出租方联系人电话" colWidth="4" readonly="true" enable="false"/>
</div>
<div class="row">
<EF:EFDatePicker cname="租赁开始日期" ename="result-0-leaseStartDate" colWidth="4" readonly="true"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFDatePicker cname="租赁结束日期" ename="result-0-leaseEndDate" colWidth="4" readonly="true"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
</div>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="inqu2" title="承包方式及合同价款"> <EF:EFRegion id="inqu2" title="承包方式及合同价款">
<div class="row"> <div class="row">
...@@ -56,7 +69,7 @@ ...@@ -56,7 +69,7 @@
</div> </div>
<div class="row"> <div class="row">
<EF:EFInput ename="result-0-totalContractPriceExcluding" cname="合同总价(不含税)" colWidth="4" readonly="true" enable="false"/> <EF:EFInput ename="result-0-totalContractPriceExcluding" cname="合同总价(不含税)" colWidth="4" readonly="true" enable="false"/>
<EF:EFInput ename="result-0-valueAddedTax" cname="增值税" colWidth="4" readonly="true" enable="false"/> <EF:EFInput ename="result-0-valueAddedTax" cname="税额" colWidth="4" readonly="true" enable="false"/>
<EF:EFInput ename="result-0-totalContractPriceIncluding" cname="合同总价(含税)" colWidth="4" readonly="true" enable="false"/> <EF:EFInput ename="result-0-totalContractPriceIncluding" cname="合同总价(含税)" colWidth="4" readonly="true" enable="false"/>
</div> </div>
</EF:EFRegion> </EF:EFRegion>
...@@ -64,10 +77,12 @@ ...@@ -64,10 +77,12 @@
<EF:EFGrid blockId="detail1" autoDraw="override" checkMode="row" isFloat="true"> <EF:EFGrid blockId="detail1" autoDraw="override" checkMode="row" isFloat="true">
<EF:EFColumn ename="id" cname="主键" hidden="true"/> <EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="deviceName" cname="设备名称" align="center" enable="false"/> <EF:EFColumn ename="deviceName" cname="设备名称" align="center" enable="false"/>
<EF:EFColumn ename="deviceNumber" cname="数量" format="{0:N3}" align="center" enable="false"/> <EF:EFColumn ename="deviceNumber" cname="数量" format="{0:N0}" align="center" enable="false"/>
<EF:EFColumn ename="unitPrice" cname="单价" format="{0:N3}" align="center" enable="false"/> <EF:EFColumn ename="unitPrice" cname="单价" format="{0:N3}" align="center" enable="false"/>
<EF:EFColumn ename="dayNumber" cname="天数" format="{0:N3}" align="center" enable="false"/> <EF:EFColumn ename="dayNumber" cname="天数" format="{0:N3}" align="center" enable="false"/>
<EF:EFColumn ename="totalPrice" cname="总价" enable="false" format="{0:N3}" align="center"/> <EF:EFColumn ename="totalPrice" cname="总价" enable="false" format="{0:N3}" align="center"/>
<EF:EFColumn ename="taxAmount" cname="税额" enable="false" format="{0:N2}" align="center"/>
<EF:EFColumn ename="totalPriceIncluding" cname="含税总价" enable="false" format="{0:N2}" align="center"/>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="detail2" title="附件信息"> <EF:EFRegion id="detail2" title="附件信息">
...@@ -80,10 +95,4 @@ ...@@ -80,10 +95,4 @@
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/> parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </EF:EFRegion>
</EF:EFPage> </EF:EFPage>
\ No newline at end of file
<script>
var ctx = "${ctx}";
</script>
<script src="${ctx}/HG/CW/HGCW006C.js"></script>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment