Commit 61c814cc by liuyang

2024-09-19

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