From fd0bea6d4ad22f61b323ff5cf32e2b1104bb5492 Mon Sep 17 00:00:00 2001
From: 李金换 <lijinhuan@prec-tech.com>
Date: 星期四, 20 四月 2023 14:16:42 +0800
Subject: [PATCH] 失单报告增加限制
---
force-app/main/default/classes/NFM206Rest.cls | 1
force-app/main/default/pages/PCLLostReportPage.page | 75 ++++++++++++++++++++++++++++++-------
force-app/main/default/classes/PCLLostReportController.cls | 14 ++++++
3 files changed, 75 insertions(+), 15 deletions(-)
diff --git a/force-app/main/default/classes/NFM206Rest.cls b/force-app/main/default/classes/NFM206Rest.cls
index 361f53c..25041b8 100644
--- a/force-app/main/default/classes/NFM206Rest.cls
+++ b/force-app/main/default/classes/NFM206Rest.cls
@@ -250,6 +250,7 @@
opportunityUpsertList.add(opportunityInfo);
}
+ if (rowData.retry_cnt__c == null) rowData.retry_cnt__c = 0;// 20230419 ljh add
if (opportunityUpsertList.size() > 0) {
// 20220916 ljh SWAG-CG2A7S start
// upsert opportunityUpsertList;
diff --git a/force-app/main/default/classes/PCLLostReportController.cls b/force-app/main/default/classes/PCLLostReportController.cls
index eb40a5d..2af0b9e 100644
--- a/force-app/main/default/classes/PCLLostReportController.cls
+++ b/force-app/main/default/classes/PCLLostReportController.cls
@@ -337,6 +337,15 @@
}
// 褰撳け鍗曞搧鐗屽悕涓哄叾浠栨椂,鎶ラ敊瀛楁涓哄け鍗曞鎵嬪瀷鍙凤紙鎵嬪姩锛� thh 2022-01-17 end
// update tcm 20211123 end
+ // 20230418 ljh DB202304320022 start
+ String LostBrandNameS = tempLostBrand.lostBrand.Lost_By_Company__c != '鍏朵粬'?tempLostBrand.lostBrand.Lost_By_Company__c:tempLostBrand.lostBrand.Lost_By_Company_Mannual__c;
+ String LostBrandName = temlostProduct.LostProductss.LostBrandName__c;
+ if(LostBrandNameS != LostBrandName){
+ temlostProduct.LostProductss.LostBrandName__c.addError('澶卞崟鍝佺墝鍚嶄笉涓�鑷达紝璇风‘璁�');
+ dataCheck = false;
+ }
+ // 20230418 ljh DB202304320022 end
+
}
// 褰撳け鍗曞搧鐗屽悕涓哄叾浠栨椂,鎶ラ敊瀛楁涓哄け鍗曞鎵嬪瀷鍙凤紙鎵嬪姩锛� thh 2022-01-17 start
if (productCount == 0 && tempLostBrand.LostProducts != null && tempLostBrand.LostProducts.size() > 0) {
@@ -575,7 +584,10 @@
system.debug('brandNo:'+brandNo);
LostBrand tempLostBrand = LostReport.LostBrands.get(brandNo);
// PCLLostProduct__c plp = new PCLLostProduct__c(Competitor__c=CompetitionMap.get(LostReport.LostBrands[brandNo].lostBrand.Lost_By_Company__c));
- string brandName = tempLostBrand.lostBrand.Lost_By_Company__c;
+ // 20230418 ljh DB202304320022 start
+ // string brandName = tempLostBrand.lostBrand.Lost_By_Company__c;
+ string brandName = tempLostBrand.lostBrand.Lost_By_Company__c != '鍏朵粬'?tempLostBrand.lostBrand.Lost_By_Company__c:tempLostBrand.lostBrand.Lost_By_Company_Mannual__c;
+ // 20230418 ljh DB202304320022 end
PCLLostProduct__c plp = new PCLLostProduct__c();
plp.LostBrandName__c = brandName;
tempLostBrand.LostProducts.add(new PCLLostProducts(tempLostBrand.LostProducts.size(),plp));
diff --git a/force-app/main/default/pages/PCLLostReportPage.page b/force-app/main/default/pages/PCLLostReportPage.page
index bc89ad4..458eba3 100644
--- a/force-app/main/default/pages/PCLLostReportPage.page
+++ b/force-app/main/default/pages/PCLLostReportPage.page
@@ -5,6 +5,11 @@
<apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}" />
<apex:form id="allForm">
<script>
+ // 20230418 ljh DB202304320022 start
+ window.onload = function init(){
+ clearBrandMannualName();
+ }
+ // 20230418 ljh DB202304320022 end
function saveJs() {
blockme();
save();
@@ -31,6 +36,12 @@
search(topNum, secondNum);
}
// add tcm 20211118 end
+ // 20230418 ljh DB202304320022 start
+ function edit2JS() {
+ blockme();
+ edit2();
+ }
+ // 20230418 ljh DB202304320022 end
function setLostTotalAmount() {
//console.log('setLostTotalAmount start:');
var totalAmount = document.getElementById("allPage:allForm:allBlock:EditPage:LostReport:lstReport:LostTotalAmountOut:LostTotalAmount");
@@ -76,14 +87,32 @@
setbrandmannual(brandNumber);
}
// 澶卞崟鍝佺墝涓嶇瓑浜庡叾浠栨椂,澶卞崟鍝佺墝锛堟墜鍔級娓呯┖骞朵笖涓嶅厑璁稿~鍐�,澶卞崟鍝佺墝绛変簬鍏朵粬鏃�,澶卞崟瀵规墜鍨嬪彿涓嶅彲鐢� thh 2022-01-13 start
- function clearBrandMannualName(){
- if(document.getElementById('allPage:allForm:allBlock:EditPage:LostBrands:0:LostBrand:BrandContent:Lost_By_CompanyOut:Lost_By_Company').value == '鍏朵粬'){
- j$(escapeVfId('allPage:allForm:allBlock:EditPage:LostBrands:0:LostBrand:productTable:0:LostProduct')).attr("disabled", true);
- } else{
- document.getElementById('allPage:allForm:allBlock:EditPage:LostBrands:0:LostBrand:BrandContent:Lost_By_Company_MannualOut:Lost_By_Company_Mannual').value = '';
- j$(escapeVfId('allPage:allForm:allBlock:EditPage:LostBrands:0:LostBrand:BrandContent:Lost_By_Company_MannualOut:Lost_By_Company_Mannual')).attr("disabled", true);
+ // function clearBrandMannualName(){
+ // if(document.getElementById('allPage:allForm:allBlock:EditPage:LostBrands:0:LostBrand:BrandContent:Lost_By_CompanyOut:Lost_By_Company').value == '鍏朵粬'){
+ // j$(escapeVfId('allPage:allForm:allBlock:EditPage:LostBrands:0:LostBrand:productTable:0:LostProduct')).attr("disabled", true);
+ // } else{
+ // document.getElementById('allPage:allForm:allBlock:EditPage:LostBrands:0:LostBrand:BrandContent:Lost_By_Company_MannualOut:Lost_By_Company_Mannual').value = '';
+ // j$(escapeVfId('allPage:allForm:allBlock:EditPage:LostBrands:0:LostBrand:BrandContent:Lost_By_Company_MannualOut:Lost_By_Company_Mannual')).attr("disabled", true);
+ // }
+ // }
+ // 20230418 ljh DB202304320022 start
+ function clearBrandMannualName(){
+ var pageStatus = "{!pageStatus}";
+ if(pageStatus == 'Create'|| pageStatus == 'Edit'){
+ var brandCount = parseInt("{!brandCount}");
+ for(var i = 0;i<brandCount;i++){
+ if(document.getElementById('allPage:allForm:allBlock:EditPage:LostBrands:'+i+':LostBrand:BrandContent:Lost_By_CompanyOut:Lost_By_Company').value == '鍏朵粬'){
+ if(document.getElementById('allPage:allForm:allBlock:EditPage:LostBrands:'+i+':LostBrand:BrandContent:Lost_By_Company_MannualOut:Lost_By_Company_Mannual').value == '' || document.getElementById('allPage:allForm:allBlock:EditPage:LostBrands:'+i+':LostBrand:BrandContent:Lost_By_Company_MannualOut:Lost_By_Company_Mannual').value == null){
+ j$(escapeVfId('allPage:allForm:allBlock:EditPage:LostBrands:'+i+':LostBrand:productTable:0:LostProduct')).attr("disabled", true);
+ }
+ } else{
+ document.getElementById('allPage:allForm:allBlock:EditPage:LostBrands:'+i+':LostBrand:BrandContent:Lost_By_Company_MannualOut:Lost_By_Company_Mannual').value = '';
+ j$(escapeVfId('allPage:allForm:allBlock:EditPage:LostBrands:'+i+':LostBrand:BrandContent:Lost_By_Company_MannualOut:Lost_By_Company_Mannual')).attr("disabled", true);
+ }
+ }
}
}
+ // 20230418 ljh DB202304320022 end
// 澶卞崟鍝佺墝涓嶇瓑浜庡叾浠栨椂,澶卞崟鍝佺墝锛堟墜鍔級娓呯┖骞朵笖涓嶅厑璁稿~鍐�,澶卞崟鍝佺墝绛変簬鍏朵粬鏃�,澶卞崟瀵规墜鍨嬪彿涓嶅彲鐢� thh 2022-01-13 end
</script>
<apex:actionFunction name="save" action="{!save}" oncomplete="unblockUI();clearBrandMannualName();" rerender="allForm,EditButton2"></apex:actionFunction>
@@ -93,22 +122,35 @@
</apex:actionFunction>
<!-- 澶卞崟鍝佺墝涓嶇瓑浜庡叾浠栨椂,澶卞崟鍝佺墝锛堟墜鍔級娓呯┖骞朵笖涓嶅厑璁稿~鍐�,澶卞崟鍝佺墝绛変簬鍏朵粬鏃�,澶卞崟瀵规墜鍨嬪彿涓嶅彲鐢� thh 2022-01-13 end -->
- <apex:actionFunction name="setbrandmannual" action="{!setbrandmannual}" oncomplete="unblockUI();" rerender="allForm">
+ <!-- 20230418 ljh DB202304320022 start -->
+ <!-- <apex:actionFunction name="setbrandmannual" action="{!setbrandmannual}" oncomplete="unblockUI();" rerender="allForm"> -->
+ <apex:actionFunction name="setbrandmannual" action="{!setbrandmannual}" oncomplete="clearBrandMannualName(),unblockUI();" rerender="allForm">
+ <!-- 20230418 ljh DB202304320022 end -->
<apex:param assignTo="{!setBrandNo}" name="setBrandNo" value="" />
</apex:actionFunction>
<apex:actionFunction name="submit" action="{!submit}" oncomplete="unblockUI();" rerender="allForm,EditButton2"></apex:actionFunction>
-
-
- <apex:actionFunction name="addBrand" action="{!addBrand}" oncomplete="unblockUI();" rerender="allForm,EditButton2"></apex:actionFunction>
- <apex:actionFunction action="{!addProduct}" name="addProduct" reRender="allForm" oncomplete="unblockUI();">
+ <!-- 20230418 ljh DB202304320022 start -->
+ <apex:actionFunction name="edit2" action="{!edit2}" oncomplete="clearBrandMannualName(),unblockUI();" rerender="allForm,EditButton2"></apex:actionFunction>
+ <!-- <apex:actionFunction name="addBrand" action="{!addBrand}" oncomplete="unblockUI();" rerender="allForm,EditButton2"></apex:actionFunction> -->
+ <apex:actionFunction name="addBrand" action="{!addBrand}" oncomplete="clearBrandMannualName(),unblockUI();" rerender="allForm,EditButton2"></apex:actionFunction>
+
+ <!-- <apex:actionFunction action="{!addProduct}" name="addProduct" reRender="allForm" oncomplete="unblockUI();"> -->
+ <apex:actionFunction action="{!addProduct}" name="addProduct" reRender="allForm" oncomplete="clearBrandMannualName(),unblockUI();">
+ <!-- 20230418 ljh DB202304320022 end -->
<apex:param assignTo="{!brandNo}" name="brandNo" value="" />
</apex:actionFunction>
- <apex:actionFunction action="{!Remove}" name="Remove" reRender="allForm" oncomplete="unblockUI();">
+ <!-- 20230418 ljh DB202304320022 start -->
+ <!-- <apex:actionFunction action="{!Remove}" name="Remove" reRender="allForm" oncomplete="unblockUI();"> -->
+ <apex:actionFunction action="{!Remove}" name="Remove" reRender="allForm" oncomplete="clearBrandMannualName(),unblockUI();">
+ <!-- 20230418 ljh DB202304320022 end -->
<apex:param assignTo="{!RemoveBrandNo}" name="RemoveBrandNo" value="" />
</apex:actionFunction>
<!-- add tcm 20211118 start -->
- <apex:actionFunction action="{!search}" name="search" reRender="allForm" oncomplete="unblockUI();">
+ <!-- 20230418 ljh DB202304320022 start -->
+ <!-- <apex:actionFunction action="{!search}" name="search" reRender="allForm" oncomplete="unblockUI();"> -->
+ <apex:actionFunction action="{!search}" name="search" reRender="allForm" oncomplete="clearBrandMannualName(),unblockUI();">
+ <!-- 20230418 ljh DB202304320022 end -->
<apex:param assignTo="{!topNum}" name="topNum" value="" />
<apex:param assignTo="{!secondNum}" name="secondNum" value="" />
</apex:actionFunction>
@@ -403,9 +445,14 @@
<apex:commandButton rendered="{!IF(LostReport.lostReport.Report_Status__c = '鑽夋', 'true', 'false')}" id="SubmitButton" onclick="submitJS();return false;"
value="鎻愪氦" style="width: 150px;margin-left: 50px;" />
- <apex:commandButton rendered="{!IF(LostReport.lostReport.Report_Status__c = '鑽夋' || $Profile.Id = '00e10000000Y3o5AAC', 'true', 'false')}"
+ <!-- 20230418 ljh DB202304320022 start -->
+ <!-- <apex:commandButton rendered="{!IF(LostReport.lostReport.Report_Status__c = '鑽夋' || $Profile.Id = '00e10000000Y3o5AAC', 'true', 'false')}"
id="EditButton" reRender="allForm" action="{!edit2}" value="缂栬緫" style="width: 150px;margin-left: 50px;"
+ /> -->
+ <apex:commandButton rendered="{!IF(LostReport.lostReport.Report_Status__c = '鑽夋' || $Profile.Id = '00e10000000Y3o5AAC', 'true', 'false')}"
+ id="EditButton" reRender="allForm" onclick="edit2JS();return false;" value="缂栬緫" style="width: 150px;margin-left: 50px;"
/>
+ <!-- 20230418 ljh DB202304320022 end -->
<apex:commandButton id="CancelButton" action="{!cancel}" value="杩斿洖璇环" style="width: 150px;margin-left: 50px;" />
</apex:pageBlockButtons>
--
Gitblit v1.9.1