Commit a815ac35 by liuyang

2024-07-22 合同管理项目信息根据选择合同类型自动填充

parent da6eabb7
......@@ -340,7 +340,8 @@ public enum DdynamicEnum {
/**
*
*/
PROJECT_CODE_BOX_BLOCK_ID("projectCodeBox_block_id","projCode","projName","HGSC001.queryProjectCodeBox"),
PROJECT_CODE_BOX_BLOCK_ID("projectCodeBox_block_id","projCode","projName","genralContractCode", "genralContractName",
"subcontractCode", "subcontractName", "startDate","endDate","partyPmName","partyPmHpone","HGSC001.queryProjectCodeBox"),
/**
* 模块: 销售发货
......
......@@ -25,6 +25,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author yukang
......@@ -62,6 +63,7 @@ public class ServiceHGCW002A extends ServiceBase {
try {
List<UserVO> userVOList = new ArrayList<>();
String contractCategory = inInfo.getString("contractCategory");
String partyA = inInfo.getString("partyA");
if (contractCategory.equals("1")) {
List<HGPZ002> hgpz002List = HGPZTools.HgPz002.list(1);
if (CollectionUtils.isNotEmpty(hgpz002List)) {
......@@ -73,7 +75,7 @@ public class ServiceHGCW002A extends ServiceBase {
});
}
} else if (contractCategory.equals("2")) {
List<Company> list = UserSessionUtils.getRoleCompany();
List<Company> list = UserSessionUtils.getRoleCompany().stream().filter(c -> c.getCompanyCode().equals(partyA)).collect(Collectors.toList());;
for (Company c:list) {
UserVO userVO = new UserVO();
userVO.setUsercode(c.getCompanyCode());
......@@ -98,8 +100,9 @@ public class ServiceHGCW002A extends ServiceBase {
try {
List<UserVO> userVOList = new ArrayList<>();
String contractCategory = inInfo.getString("contractCategory");
String partyB = inInfo.getString("partyB");
if (contractCategory.equals("1")) {
List<Company> list = UserSessionUtils.getRoleCompany();
List<Company> list = UserSessionUtils.getRoleCompany().stream().filter(c -> c.getCompanyCode().equals(partyB)).collect(Collectors.toList());
for (Company c:list) {
UserVO userVO = new UserVO();
userVO.setUsercode(c.getCompanyCode());
......
......@@ -386,7 +386,15 @@
<select id="queryProjectCodeBox" parameterClass="java.util.HashMap" resultClass="java.util.HashMap">
SELECT distinct
proj_code as "projCode", <!-- 项目编码 -->
CONCAT(proj_code,"-",proj_name) as "projName" <!-- 项目名称 -->
CONCAT(proj_code,"-",proj_name) as "projName", <!-- 项目名称 -->
genral_contract_code as "genralContractCode", <!-- 总包商编码 甲方 -->
genral_contract_name as "genralContractName", <!-- 总包商名称 -->
subcontract_code as "subcontractCode", <!-- 分包商编码 乙方 -->
subcontract_name as "subcontractName", <!-- 分包商名称 -->
start_date as "startDate", <!-- 开工日期 -->
end_date as "endDate", <!-- 竣工日期 -->
party_pm_name as "partyPmName", <!-- 甲方项目经理名称 -->
party_pm_hpone as "partyPmHpone" <!-- 甲方项目经理联系电话-->
FROM ${hggpSchema}.HGSC001 WHERE approval_status = 2 and proj_status = 0
<include refid="condition" />
</select>
......
......@@ -18,7 +18,7 @@
<EF:EFInput cname="合同名称" ename="contractName" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFSelect cname="合同类型" ename="inqu_status-0-contractType" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.cw.contractType"/>
<EF:EFCodeOption codeName="hggp.cw.contractType" condition="ITEM_CODE IN ('1', '2', '3', '5')"/>
</EF:EFSelect>
<EF:EFSelect cname="合同类别" ename="inqu_status-0-contractCategory" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
......@@ -67,7 +67,7 @@
</EF:EFComboColumn>
<EF:EFComboColumn ename="contractType" cname="合同类型" width="100" align="center"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" >
<EF:EFCodeOption codeName="hggp.cw.contractType"/>
<EF:EFCodeOption codeName="hggp.cw.contractType" condition="ITEM_CODE IN ('1', '2', '3', '5')"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="contractCategory" cname="合同类别" width="100" align="center"
columnTemplate="#=textField#" itemTemplate="#=textField#" enable="false" >
......
$(function() {
var projectCodeBox = __eiInfo.getBlock("projectCodeBox_block_id").getMappedRows();
$("#cancel").on("click", function () {
cancelFunc();
});
......@@ -133,6 +135,30 @@ $(function() {
} else {
$("#result-0-projName").val(textField);
}
let contractType = $("#result-0-contractType").val();
if (!isBlank(contractType)){
for (let i = 0; i < projectCodeBox.length; i++) {
if (!isBlank(valueField)){
if (projectCodeBox[i]['valueField'] === valueField){
if (contractType == "2"){
$("#result-0-partyA").val(projectCodeBox[i]['param3Field']);
IPLAT.EFPopupInput.text( $("#popupInputPartyA") , projectCodeBox[i]['param4Field']);
}else {
$("#result-0-partyB").val(projectCodeBox[i]['param3Field']);
IPLAT.EFPopupInput.text( $("#popupInputPartyB") , projectCodeBox[i]['param4Field']);
}
var planStartDate = $("#result-0-planStartDate").data("kendoDatePicker");
planStartDate.value(projectCodeBox[i]['param5Field'], "d");
var planEndDate = $("#result-0-planEndDate").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-contractType": {
......@@ -143,23 +169,58 @@ $(function() {
select: function (e) {
var dataItem = e.dataItem;
console.log(dataItem)
//清除甲乙方
IPLAT.EFPopupInput.clear(("#popupInputPartyA"), true)
IPLAT.EFPopupInput.clear(("#popupInputPartyB"), true)
IPLAT.EFPopupInput.clear(("#popupInputMainContractNumber"), true)
let planStartDate = $("#result-0-planStartDate").data("kendoDatePicker");
let planEndDate = $("#result-0-planEndDate").data("kendoDatePicker");
planStartDate.value("", "d");
planEndDate.value("", "d");
$("#result-0-partyA").val("");
$("#result-0-partyB").val("");
$("#result-0-mainContractNumber").val("");
var valueField = dataItem['valueField'];
if (valueField == "1" || valueField == "3") {
if (valueField == "1" || valueField == "" || valueField == "3" || valueField == "5") {
$("#result-0-contractCategory").val("1");
$("#contractCategoryName").val("收入");
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']);
IPLAT.EFPopupInput.text( $("#popupInputPartyB") , 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 == "2" || valueField == "4"){
$("#result-0-contractCategory").val("2");
$("#contractCategoryName").val("支出");
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']);
IPLAT.EFPopupInput.text( $("#popupInputPartyA") , 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'])
}
}
}
} else {
$("#result-0-contractCategory").val("");
}
//清除甲乙方
IPLAT.EFPopupInput.clear(("#popupInputPartyA"), true)
IPLAT.EFPopupInput.clear(("#popupInputPartyB"), true)
IPLAT.EFPopupInput.clear(("#popupInputMainContractNumber"), true)
$("#result-0-partyA").val("");
$("#result-0-partyB").val("");
$("#result-0-mainContractNumber").val("");
}
},
......@@ -220,7 +281,8 @@ $(function() {
e.preventDefault();
}
var info = new EiInfo();
info.set("contractCategory",contractCategory)
info.set("contractCategory",contractCategory);
info.set("partyA",$("#result-0-partyA").val())
return info;
},
/**
......@@ -261,6 +323,7 @@ $(function() {
}
var info = new EiInfo();
info.set("contractCategory",contractCategory)
info.set("partyB",$("#result-0-partyB").val())
return info;
},
/**
......@@ -282,6 +345,7 @@ $(function() {
e.preventDefault(); // 不使用默认的回填逻辑
}
},
"popupInputMainContractNumber": {
/**
......
......@@ -21,7 +21,7 @@
<EF:EFInput ename="result-0-contractName" cname="合同名称" colWidth="4" required="true"/>
<EF:EFSelect cname="合同类型" ename="result-0-contractType" colWidth="4" filter="contains" required="true">
<EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.contractType"/>
<EF:EFCodeOption codeName="hggp.cw.contractType" condition="ITEM_CODE IN ('1', '2', '3', '5')"/>
</EF:EFSelect>
<EF:EFInput ename="result-0-contractCategory" cname="合同类别" type="hidden"/>
......@@ -79,7 +79,7 @@
<EF:EFDatePicker cname="签约日期" ename="result-0-signingDate" colWidth="4"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFInput ename="result-0-mainContractNumber" cname="主合同号" type="hidden"/>
<EF:EFPopupInput ename="popupInputMainContractNumber" cname="主合同号" colWidth="8" ratio="2:10"
<EF:EFPopupInput ename="popupInputMainContractNumber" cname="主合同号" colWidth="4" ratio="4:8"
serviceName="HGCW002" methodName="contractComboBox" filterPopupGrid="false"
resultId="contract_block_id"
save="false" popupType="ServiceGrid"
......@@ -87,8 +87,12 @@
columnEnames="valueField,textField"
columnCnames="合同号,合同名称"
readonly="true"
resizable="true" popupTitle="主合同号" popupWidth="800">
resizable="true" popupTitle="主合同号" popupWidth="400">
</EF:EFPopupInput>
<EF:EFSelect cname="付款方式" ename="result-0-paymentMethod" colWidth="4" filter="contains">
<EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.paymentMethod"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFInput type="textarea" ename="result-0-contractContent" cname="合同内容" colWidth="8" ratio="2:10" required="true"/>
......@@ -97,24 +101,18 @@
<EF:EFRegion id="inqu2" title="承包方式及合同价款">
<div class="row">
<EF:EFInput ename="result-0-contractingMethod" cname="承包方式" colWidth="4" />
<EF:EFSelect cname="付款方式" ename="result-0-paymentMethod" colWidth="4" filter="contains">
<EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.paymentMethod"/>
</EF:EFSelect>
<EF:EFSelect cname="计价方式" ename="result-0-pricingMethod" colWidth="4" filter="contains" required="true">
<EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.pricingMethod"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFSelect cname="税点" ename="result-0-taxPoints" colWidth="4" filter="contains">
<EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.taxPoints"/>
</EF:EFSelect>
<EF:EFInput ename="result-0-totalContractPriceExcluding" cname="合同总价(不含税)" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-valueAddedTax" cname="增值税" colWidth="4" readonly="true"/>
</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-totalContractPriceIncluding" cname="合同总价(含税)" colWidth="4" readonly="true"/>
</div>
</EF:EFRegion>
......
......@@ -24,7 +24,7 @@
<EF:EFInput ename="result-0-contractName" cname="合同名称" colWidth="4" required="true"/>
<EF:EFSelect cname="合同类型" ename="result-0-contractType" colWidth="4" filter="contains" required="true">
<EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.contractType"/>
<EF:EFCodeOption codeName="hggp.cw.contractType" condition="ITEM_CODE IN ('1', '2', '3', '5')"/>
</EF:EFSelect>
<EF:EFInput ename="result-0-contractCategory" cname="合同类别" type="hidden"/>
......@@ -82,7 +82,7 @@
<EF:EFDatePicker cname="签约日期" ename="result-0-signingDate" colWidth="4"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFInput ename="result-0-mainContractNumber" cname="主合同号" type="hidden"/>
<EF:EFPopupInput ename="popupInputMainContractNumber" cname="主合同号" colWidth="8" ratio="2:10"
<EF:EFPopupInput ename="popupInputMainContractNumber" cname="主合同号" colWidth="4" ratio="4:8"
serviceName="HGCW002" methodName="contractComboBox"
resultId="contract_block_id"
save="false" popupType="ServiceGrid"
......@@ -92,6 +92,10 @@
readonly="true"
resizable="true" popupTitle="主合同号" popupWidth="800">
</EF:EFPopupInput>
<EF:EFSelect cname="付款方式" ename="result-0-paymentMethod" colWidth="4" filter="contains">
<EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.paymentMethod"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFInput type="textarea" ename="result-0-contractContent" cname="合同内容" colWidth="8" ratio="2:10" required="true"/>
......@@ -100,24 +104,18 @@
<EF:EFRegion id="inqu2" title="承包方式及合同价款">
<div class="row">
<EF:EFInput ename="result-0-contractingMethod" cname="承包方式" colWidth="4" />
<EF:EFSelect cname="付款方式" ename="result-0-paymentMethod" colWidth="4" filter="contains">
<EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.paymentMethod"/>
</EF:EFSelect>
<EF:EFSelect cname="计价方式" ename="result-0-pricingMethod" colWidth="4" filter="contains" required="true">
<EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.pricingMethod"/>
</EF:EFSelect>
</div>
<div class="row">
<EF:EFSelect cname="税点" ename="result-0-taxPoints" colWidth="4" filter="contains">
<EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.taxPoints"/>
</EF:EFSelect>
<EF:EFInput ename="result-0-totalContractPriceExcluding" cname="合同总价(不含税)" colWidth="4" readonly="true"/>
<EF:EFInput ename="result-0-valueAddedTax" cname="增值税" colWidth="4" readonly="true"/>
</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-totalContractPriceIncluding" cname="合同总价(含税)" colWidth="4" readonly="true"/>
</div>
</EF:EFRegion>
......
......@@ -18,7 +18,7 @@
<EF:EFInput ename="result-0-contractName" cname="合同名称" colWidth="4" readonly="true"/>
<EF:EFSelect cname="合同类型" ename="result-0-contractType" colWidth="4" filter="contains" readonly="true" enable="false">
<EF:EFOption label="-- 请选择 --" value=""/>
<EF:EFCodeOption codeName="hggp.cw.contractType"/>
<EF:EFCodeOption codeName="hggp.cw.contractType" condition="ITEM_CODE IN ('1', '2', '3', '5')"/>
</EF:EFSelect>
<EF:EFSelect cname="合同类别" ename="result-0-contractCategory" colWidth="4" filter="contains" readonly="true" enable="false">
<EF:EFOption label="-- 请选择 --" value=""/>
......
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