From b9055688b13a23f8e445de2bc3d5d0d2b85fec30 Mon Sep 17 00:00:00 2001 From: 李彤 <litong@prec-tech.com> Date: 星期三, 17 五月 2023 19:27:19 +0800 Subject: [PATCH] 包含超声 --- force-app/main/default/pages/PCLLostReportPage.page | 212 +++++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 183 insertions(+), 29 deletions(-) diff --git a/force-app/main/default/pages/PCLLostReportPage.page b/force-app/main/default/pages/PCLLostReportPage.page index bb3d375..4bb04f3 100644 --- a/force-app/main/default/pages/PCLLostReportPage.page +++ b/force-app/main/default/pages/PCLLostReportPage.page @@ -1,13 +1,16 @@ <apex:page standardcontroller="Lost_cancel_report__c" extensions="PCLLostReportController" showHeader="false" sidebar="false" - id="allPage" action="{!init}" title="璇环澶卞崟/鍙栨秷鎶ュ憡" lightningStylesheets="true"> + id="allPage" action="{!init}" title="璇环澶卞崟/鍙栨秷鎶ュ憡"> <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}" /> - - <!-- <apex:stylesheet value="{!URLFOR($Resource.PCLLostReportPagecss)}" /> --> <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}" /> <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(); @@ -34,6 +37,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"); @@ -70,6 +79,82 @@ } //console.log('setLostTotalAmount end'); } + + //20230506 lt DB202304618804 鍖呭惈瓒呭0 start + function setInclusionUltrasound() { + debugger + //鍖呭惈瓒呭0 + // var Inc = document.getElementById("allPage:allForm:allBlock:ReadPage:LostReport:lstReport1:InclusionUltrasoundOut1:InclusionUltrasound"); + // //鈥嬪け鍗曚骇鍝佺被鍒� + // var Inc = document.getElementById("allPage:allForm:allBlock:ReadPage:LostReport:lstReport1:InclusionUltrasoundOut1:InclusionUltrasound"); + // //澶卞崟浜у搧鍖哄垎 + // var Inc = document.getElementById("allPage:allForm:allBlock:ReadPage:LostReport:lstReport1:InclusionUltrasoundOut1:InclusionUltrasound"); + + var Inc = document.getElementById("allPage:allForm:allBlock:EditPage:LostReport:lstReport1:InclusionUltrasoundOut:InclusionUltrasound"); + var IncHidden = document.getElementById("allPage:allForm:allBlock:InclusionUltrasound"); + + if(Inc == null || Inc == undefined){ + Inc = '0'; + } + + // if (!!Inc && !!IncHidden) { + var tempInc = '0'; + + //澶卞崟鍝佺墝 + var i = 0; + var brandCount = parseInt("{!brandCount}"); + //澶卞崟鍨嬪彿 + var j = 0; + + for (var i = 0; i < brandCount; i++){ + for (var j = 0; j < 10; j++) { + //鈥嬪け鍗曚骇鍝佺被鍒� + //allPage:allForm:allBlock:ReadPage:LostBrands:0:LostBrand:productTable:0:LostPRoductClass + // var LostProClassObject = + // document.getElementById("allPage:allForm:allBlock:EditPage:LostBrands:" + + // i + ":LostBrand:productTable:"+ j +":LostPRoductClass1"); + var LostProClassObject = j$(escapeVfId('allPage:allForm:allBlock:EditPage:LostBrands:' + + i + ':LostBrand:productTable:'+ j +':LostPRoductClass1')).value(); + + var LostProClassObject1 = j$(escapeVfId('allPage:allForm:allBlock:EditPage:LostBrands:' + + i + ':LostBrand:productTable:'+ j +':LostPRoductClass')).value(); + //澶卞崟浜у搧鍖哄垎 + //allPage:allForm:allBlock:ReadPage:LostBrands:0:LostBrand:productTable:0:LostProductCategory + // var LostProCategoryObject = + // document.getElementById("allPage:allForm:allBlock:EditPage:LostBrands:" + + // i + ":LostBrand:productTable:"+ j +":LostProductCategory1"); + var LostProCategoryObject = j$(escapeVfId('allPage:allForm:allBlock:EditPage:LostBrands:' + + i + ':LostBrand:productTable:'+ j +':LostProductCategory1')).value(); + + var LostProCategoryObject1 = j$(escapeVfId('allPage:allForm:allBlock:EditPage:LostBrands:' + + i + ':LostBrand:productTable:'+ j +':LostProductCategory')).value(); + + if(tempInc != '1'){ + if((LostProClassObject == '涓绘満' && LostProCategoryObject == '瓒呭0涓绘満') || (LostProClassObject1 == '涓绘満' && LostProCategoryObject1 == '瓒呭0涓绘満')){ + tempInc = '1'; + } + } + + // if (!!LostProClassObject && !!LostProCategoryObject) { + + // var LostProClassText = LostProClassObject.innerText; + // var LostProClassValue = LostProClassObject.value; + + // var LostProCategoryText = LostProCategoryObject.innerText; + // var LostProCategoryValue = LostProCategoryObject.value; + + // } + } + } + + Inc.innerText = tempInc; + IncHidden.value = tempInc; + + // } + + } + //20230506 lt DB202304618804 鍖呭惈瓒呭0 end + function setBrandName(brandNumber) { blockme(); setbrand(brandNumber); @@ -79,14 +164,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> @@ -96,22 +199,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> @@ -121,9 +237,12 @@ <apex:pageMessages /> </apex:outputPanel> <apex:inputHidden id="LostTotalAmount" value="{!LostReport.lostReport.LostTotalAmount__c}" /> + + <apex:inputHidden id="InclusionUltrasound" value="{!InclusionUltrasound}" /> <!-- 20230506 lt DB202304618804 鍖呭惈瓒呭0 add --> + <apex:outputPanel rendered="{!IF(pageStatus == 'Create'|| pageStatus == 'Edit' , 'true', 'false')}"> <apex:pageBlock title="澶卞崟鎶ュ憡缂栬緫椤甸潰" id="EditPage"> - <apex:pageBlockSection columns="2" id="LostReport"> + <apex:pageBlockSection columns="3" id="LostReport"> <apex:pageBlockSectionItem id="lstReport" labelStyle="text-align:left;"> <apex:pageBlockSectionItem labelStyle="text-align:left;"> <apex:outputLabel value="澶卞崟绫诲瀷: "> @@ -135,12 +254,24 @@ <apex:outputLabel value="澶卞崟鎬婚噾棰濓紙鍏冿級: "></apex:outputLabel> <apex:outputField id="LostTotalAmount" value="{!LostReport.lostReport.LostTotalAmount__c}" /> </apex:pageBlockSectionItem> - </apex:pageBlockSectionItem> + + <!-- 20230506 lt DB202304618804 鍖呭惈瓒呭0 start --> + <apex:pageBlockSectionItem id="lstReport1" labelStyle="text-align:left;"> + + <apex:pageBlockSectionItem id="InclusionUltrasoundOut" labelStyle="text-align:left;"> + <apex:outputLabel value="鍖呭惈瓒呭0: "></apex:outputLabel> + <apex:outputLabel id="InclusionUltrasound" value="{!InclusionUltrasound}" /> + </apex:pageBlockSectionItem> + <apex:pageBlockSectionItem id="Report_Statusout" labelStyle="text-align:left;"> <apex:outputLabel value="鐘舵��: "></apex:outputLabel> <apex:outputField id="Report_Status" value="{!LostReport.lostReport.Report_Status__c}" /> </apex:pageBlockSectionItem> + + </apex:pageBlockSectionItem> + <!-- 20230506 lt DB202304618804 鍖呭惈瓒呭0 end --> + </apex:pageBlockSection> <apex:variable value="{!0}" var="BCnt" /> <apex:repeat value="{!LostReport.LostBrands}" var="brand" id="LostBrands"> @@ -150,7 +281,7 @@ <apex:outputText id="LostBrandName" value="澶卞崟鍝佺墝{!brand.lineNo + 1}" /> <apex:commandButton rendered="{!IF(brandCount > 1 , 'true', 'false')}" onclick="RemoveJs({!brand.lineNo});return false;" value="鍒犻櫎" style="width: 100px;margin-left: 50px;float: right;" /> - <apex:commandButton onclick="saveJs();return false;" value="淇濆瓨" style="width: 100px;margin-left: 50px;float: right;" /> + <apex:commandButton onclick="setInclusionUltrasound();saveJs();return false;" value="淇濆瓨" style="width: 100px;margin-left: 50px;float: right;" /> </apex:outputPanel> </apex:facet> <apex:pageBlockSection id="BrandContent" columns="3"> @@ -159,7 +290,8 @@ <apex:outputLabel value="澶卞崟鍝佺墝:"> <span style="color:red;font-size: 18px;">* </span> </apex:outputLabel> - <apex:inputField id="Lost_By_Company" onchange="setLostTotalAmount();setBrandName({!brand.lineNo});" value="{!brand.lostBrand.Lost_By_Company__c}"/> + <!-- 20230506 lt DB202304618804 鍖呭惈瓒呭0 add setInclusionUltrasound(); --> + <apex:inputField id="Lost_By_Company" onchange="setLostTotalAmount();setInclusionUltrasound();setBrandName({!brand.lineNo});" value="{!brand.lostBrand.Lost_By_Company__c}"/> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem dataStyle="width:10%;border-top:2px solid;border-left:2px solid;border-bottom:2px solid;" labelStyle="width:23%;white-space:none;text-align:left;border-top:2px solid; solid ;border-bottom:2px solid;"> @@ -238,7 +370,8 @@ </apex:column> <apex:column headerValue="澶卞崟鏁伴噺"> <span style="color:red;font-size: 18px;">* </span> - <apex:inputField id="Quantity" style="min-width: 150px;" value="{!product.LostProductss.Quantity__c}" /> + <!-- 20230506 lt DB202304618804 鍖呭惈瓒呭0 add onclick="setInclusionUltrasound();" --> + <apex:inputField id="Quantity" style="min-width: 150px;" value="{!product.LostProductss.Quantity__c}" onclick="setInclusionUltrasound();" /> </apex:column> <!-- SWAG-C6P9PX lt 20210913 add start --> <apex:column headerValue="澶卞崟瀵规墜鍨嬪彿(鎵嬪姩)"> @@ -251,7 +384,7 @@ <apex:outputPanel rendered="{!IF(product.bool=true,true,false)}"> <apex:outputField id="LostPRoductClass1" value="{!product.LostProductss.ProductClass__c}" /> </apex:outputPanel> - <apex:outputPanel rendered="{!!IF(product.bool==true,true,false)}"> + <apex:outputPanel rendered="{!!IF(product.bool==true,true,false)}" > <apex:inputField id="LostPRoductClass" value="{!product.LostProductss.ProductClass__c}" /> </apex:outputPanel> </apex:column> @@ -261,7 +394,8 @@ <apex:outputField id="LostProductCategory1" value="{!product.LostProductss.ProductCategory__c}" /> </apex:outputPanel> <apex:outputPanel rendered="{!!IF(product.bool==true,true,false)}"> - <apex:inputField id="LostProductCategory" value="{!product.LostProductss.ProductCategory__c}" /> + <!-- 20230506 lt DB202304618804 鍖呭惈瓒呭0 add onchange="setInclusionUltrasound();" --> + <apex:inputField id="LostProductCategory" value="{!product.LostProductss.ProductCategory__c}" onchange="setInclusionUltrasound();"/> </apex:outputPanel> </apex:column> <!-- tcm 20211117 add end --> @@ -275,14 +409,14 @@ </apex:repeat> <apex:pageBlockButtons > <apex:commandButton onclick="addBrandJs();return false;" value="杩藉姞鍝佺墝" style="width: 150px;margin-left: 50px;" /> - <apex:commandButton onclick="saveJs();return false;" value="淇濆瓨" style="width: 150px;margin-left: 50px;" /> + <apex:commandButton onclick="setInclusionUltrasound();saveJs();return false;" value="淇濆瓨" style="width: 150px;margin-left: 50px;" /> <apex:commandButton id="CancelButton" action="{!cancel}" value="杩斿洖璇环" style="width: 150px;margin-left: 50px;" /> </apex:pageBlockButtons> </apex:pageBlock> </apex:outputPanel> <apex:outputPanel rendered="{!IF(pageStatus == 'View', 'true', 'false')}"> <apex:pageBlock title="澶卞崟鎶ュ憡鏌ョ湅椤甸潰" id="ReadPage"> - <apex:pageBlockSection columns="2" id="LostReport"> + <apex:pageBlockSection columns="3" id="LostReport"> <apex:pageBlockSectionItem labelStyle="text-align:left;"> <apex:pageBlockSectionItem labelStyle="text-align:left;"> <apex:outputLabel value="澶卞崟绫诲瀷: "></apex:outputLabel> @@ -294,10 +428,25 @@ </apex:pageBlockSectionItem> </apex:pageBlockSectionItem> - <apex:pageBlockSectionItem id="Report_Statusout" labelStyle="text-align:left;"> - <apex:outputLabel value="鐘舵��: "></apex:outputLabel> - <apex:outputField id="Report_Status" value="{!LostReport.lostReport.Report_Status__c}" /> + + <!-- 20230506 lt DB202304618804 鍖呭惈瓒呭0 start --> + <apex:pageBlockSectionItem id="lstReport1" labelStyle="text-align:left;"> + + <apex:pageBlockSectionItem id="InclusionUltrasoundOut1" labelStyle="text-align:left;"> + <apex:outputLabel value="鍖呭惈瓒呭0: "></apex:outputLabel> + <apex:outputLabel id="InclusionUltrasound" value="{!InclusionUltrasound}" /> + </apex:pageBlockSectionItem> + + <apex:pageBlockSectionItem id="Report_Statusout" labelStyle="text-align:left;"> + <apex:outputLabel value="鐘舵��: "></apex:outputLabel> + <apex:outputField id="Report_Status" value="{!LostReport.lostReport.Report_Status__c}" /> + </apex:pageBlockSectionItem> + </apex:pageBlockSectionItem> + + <!-- 20230506 lt DB202304618804 鍖呭惈瓒呭0 end --> + + </apex:pageBlockSection> <apex:variable value="{!0}" var="BCnt" /> <apex:repeat value="{!LostReport.LostBrands}" var="brand" id="LostBrands"> @@ -406,9 +555,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