| | |
| | | var p = new Promise(function(resolve, reject){ |
| | | rowBList = JSON.parse('{!rowListString}') |
| | | var x = 0; |
| | | var y = 0; |
| | | let searchCallBack = function searchCallBack(result){ |
| | | let contacts = result.object; |
| | | if(contacts == null){ |
| | |
| | | x++; |
| | | }; |
| | | for(var i=0;i<rowBList.length;i++){ |
| | | ids.push(rowBList[i].rnd.AWS_Data_Id__c + '_' + rowBList[i].rnd.Id); |
| | | AWSService.query(staticResource.queryUrl,rowBList[i].rnd.AWS_Data_Id__c,searchCallBack,staticResource.token); |
| | | if(rowBList[i].rnd.AWS_Data_Id__c ){ |
| | | y++; |
| | | ids.push(rowBList[i].rnd.AWS_Data_Id__c + '_' + rowBList[i].rnd.Id); |
| | | AWSService.query(staticResource.queryUrl,rowBList[i].rnd.AWS_Data_Id__c,searchCallBack,staticResource.token); |
| | | } |
| | | } |
| | | var id = setInterval(function(){ |
| | | if(x >= rowBList.length){ |
| | | if(x == y){ |
| | | console.log('success') |
| | | resolve('success'); |
| | | clearInterval(id); |
| | | } |
| | | },1000); |
| | | },500); |
| | | }); |
| | | return p; |
| | | } |
| | |
| | | if(awsDataId.length == 0){ |
| | | return |
| | | } |
| | | if(TrialUser[awsDataId.substring(0,18)] == null){ |
| | | return |
| | | } |
| | | console.log('awsDataId Value:'+awsDataId); |
| | | let parentNode = document.getElementById(awsDataId); |
| | | let createDiv = document.createElement("div"); |
| | | createDiv.id = awsDataId+"_PI"; |
| | | let piInformation = 'trialUser:'+TrialUser[awsDataId.substring(0,18)].trialUser |
| | | let piInformation = TrialUser[awsDataId.substring(0,18)].trialUser |
| | | //let piInformation = 'Name:'+contact['943114607025717249'].lastName +'\n' +'Phone:'+contact['943114607025717249'].phone |
| | | createDiv.innerText = piInformation; |
| | | let x=window.event.x; |
| | |
| | | createDiv.style.background="#dddddd"; |
| | | createDiv.style.position = "absolute"; |
| | | parentNode.appendChild(createDiv); |
| | | parentNode.style.position = "relative"; |
| | | } |
| | | |
| | | function hidePIDiv(awsDataId){ |
| | | if(awsDataId.length == 0){ |
| | | return |
| | | } |
| | | if(TrialUser[awsDataId.substring(0,18)] == null){ |
| | | return |
| | | } |
| | | document.getElementById(awsDataId+'_PI').remove(); |
| | | } |
| | | |
| | | function q3(){ |
| | | var p = new Promise(function(resolve, reject){ |
| | | console.log('saveRecordJS') |
| | | |
| | | var a = 0; |
| | | var b = 0; |
| | | let newCallBack = function newCallBack(result,indexNumber){ |
| | | |
| | | console.log('result = '+JSON.stringify(result)) |
| | | //赋值dataId和trialUser |
| | | document.getElementById('allPage:allForm:dataBlock:dataline_R_aws:'+indexNumber+':EditAWSDataId').value = result.object[0].dataId; |
| | | document.getElementById('allPage:allForm:dataBlock:dataline_R:'+indexNumber+':inputField:6:inputField').value = result.object[0].trialUser; |
| | | let transParameters = { |
| | | txId: result.txId, |
| | | isSuccess: 1 |
| | | }; |
| | | let confirmCallBack = function confirmCallBack(result){ |
| | | console.log('confirmCallBack = '+JSON.stringify(result)) |
| | | } |
| | | b++; |
| | | AWSService.confirmTrans(staticResource.transactionUrl,JSON.stringify(transParameters),confirmCallBack,staticResource.token) |
| | | }; |
| | | for(var i=0;i<rowBList.length;i++){ |
| | | if(document.getElementById('allPage:allForm:dataBlock:dataline_L:'+i+':rowCheck').checked == true){ |
| | | a++; |
| | | } |
| | | } |
| | | debugger |
| | | for(var i=0;i<rowBList.length;i++){ |
| | | if(document.getElementById('allPage:allForm:dataBlock:dataline_L:'+i+':rowCheck').checked == true){ |
| | | //加密试用者 |
| | | var trialUser = document.getElementById('allPage:allForm:dataBlock:dataline_R:'+i+':inputField:6:j_id86').children[0].children[0].value |
| | | let consumApplyPayloadList = []; |
| | | let consumApplyPIData = new Object(); |
| | | consumApplyPIData.trialUser = trialUser; |
| | | consumApplyPIData.sfRecordId = ''; |
| | | consumApplyPayloadList.push(consumApplyPIData); |
| | | AWSService.postConsumTrial(staticResource.newUrl,i,JSON.stringify(consumApplyPayloadList),newCallBack,staticResource.token); |
| | | } |
| | | } |
| | | var id = setInterval(function(){ |
| | | if(a == b){ |
| | | console.log('a==b success') |
| | | resolve('success'); |
| | | clearInterval(id); |
| | | } |
| | | },500); |
| | | }); |
| | | return p; |
| | | } |
| | | |
| | | function q4(){ |
| | | debugger |
| | | saveRecord(); |
| | | } |
| | | function saveRecordJS(){ |
| | | if('{!pageB.fixMode}' != 'true'){ |
| | | return |
| | | } |
| | | q3().then(function(data){ |
| | | return q4(data); |
| | | }) |
| | | unblockUI(); |
| | | } |
| | | //2022 02 24 张华建 display PI Data end |
| | | </script> |
| | |
| | | <apex:commandButton value="适用" rendered="{!canEdit}" onclick="applyJs();return false;"/> |
| | | </span> |
| | | <span style="margin-left: 10px;"> |
| | | <apex:commandButton value="保存" onclick="blockme();saveRecord(); return false;" rendered="{!canEdit}"/> |
| | | <apex:commandButton value="保存" onclick="blockme();saveRecordJS(); return false;" rendered="{!canEdit}"/> |
| | | </span> |
| | | </td> |
| | | </tr> |
| | |
| | | </apex:repeat> |
| | | </table> |
| | | </div> |
| | | <apex:repeat id="dataline_R_aws" value="{!pageB.rowBList}" var="var"> |
| | | <apex:inputHidden value="{!var.rnd.AWS_Data_Id__c}" id="EditAWSDataId"/> |
| | | </apex:repeat> |
| | | <div id="in_Div" style="overflow:auto;"> |
| | | <table class="list" style="border-bottom-width: 0px; font-size:11px; border-spacing:0;" border="" id="tableData"> |
| | | <apex:variable value="{!0}" var="Cnt_R" /> |
| | | <apex:repeat id="dataline_R" value="{!pageB.rowBList}" var="var"> |
| | | <tr id="tableData_R_{!Cnt_R}" class="dataRow" onmouseover="if (window.hiOn){hiOn(this);} " onmouseout="if (window.hiOff){hiOff(this);} " onblur="if (window.hiOff){hiOff(this);}" onfocus="if (window.hiOn){hiOn(this);}" style="{!IF(var.isOddnumber, 'background-color : #EFF4FC;', '')}"> |
| | | <apex:repeat value="{!inputFieldList}" var="info" id="inputField"> |
| | | <td class="dataCellBorder1 intf {!info.value} col_{!info.value}" id="{! IF(info.value=='Trial_User__c',var.rnd.AWS_Data_Id__c+'_'+var.rnd.Id,info.value)}" onmouseover="showPIDiv('{! IF(info.value=='Trial_User__c',var.rnd.AWS_Data_Id__c+'_'+var.rnd.Id,'')}')" onmouseout="hidePIDiv('{! IF(info.value=='Trial_User__c',var.rnd.AWS_Data_Id__c+'_'+var.rnd.Id,'')}')"> |
| | | <td class="dataCellBorder1 intf {!info.value} col_{!info.value}" id="{! IF(info.value=='Trial_User__c',var.rnd.AWS_Data_Id__c+'_'+var.rnd.Id,info.value)}" onmouseover="showPIDiv('{! IF(info.value=='Trial_User__c',var.rnd.AWS_Data_Id__c+'_'+var.rnd.Id,'')}')" onmouseout="hidePIDiv('{! IF(info.value=='Trial_User__c',var.rnd.AWS_Data_Id__c+'_'+var.rnd.Id,'')}')"> |
| | | <apex:outputPanel rendered="{!(contains(var.canChangeField, info.value) || var.canChangeField == '') && pageB.fixMode == true && var.canChange == true && info.value != 'Degree_Of_Importance__c'}"> |
| | | <!-- onchange="setChangeFlg('{!var.lineNo}')" --> |
| | | <apex:outputPanel rendered="{!info.value != 'Case_OR_animal_organ__c'}"> |
| | |
| | | <!-- <apex:inputHidden value="{!var.rnd.Degree_Of_Importance__c}"/> --> |
| | | </td> |
| | | <td class="col_Scroll"></td> |
| | | |
| | | </tr> |
| | | <apex:variable value="{!Cnt_R+1}" var="Cnt_R" /> |
| | | |
| | | </apex:repeat> |
| | | </table> |
| | | </div> |