| | |
| | | <apex:page controller="ConsumTrialUpdateController" showHeader="false" action="{!init}" id="allPage"> |
| | | <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/> |
| | | <apex:stylesheet value="{!URLFOR($Resource.ConsumTrialPageCss)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.ReceivingNotePageJS)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.CommonUtilJs)}"/> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }"/> |
| | | <apex:page controller="ConsumUploadPictureController" lightningStylesheets="true" showHeader="false" action="{!init}" id="allPage"> |
| | | <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.RelationListPagingCmpJS)}"/> |
| | | <apex:stylesheet value="{!URLFOR($Resource.StyleUtilCss)}"/><!-- 20230619 ljh lightning --> |
| | | <style> |
| | | table { |
| | | border-collapse: collapse; |
| | | } |
| | | td, th { |
| | | border: 1px solid black; |
| | | text-align: center; |
| | | } |
| | | input.btn { |
| | | margin: 5px 0px; |
| | | } |
| | | </style> |
| | | <script type="text/javascript"> |
| | | function closeWindow(){ |
| | | if (j$(escapeVfId('allPage:allForm:done_flag')).val() == 'true') { |
| | | // window.opener.location.reload(); |
| | | if(j$(escapeVfId('allPage:allForm:hasPicture')).val() == 'true'){ |
| | | window.opener.document.getElementById("allPage:allForm:dataBlock:dataline_R:{!line}:button").style.background = '#009DDC'; |
| | | window.opener.document.getElementById("allPage:allForm:dataBlock:dataline_R:{!line}:button").style.color = 'white'; |
| | | window.opener.document.getElementById("allPage:allForm:dataBlock:dataline_L:{!line}:rowCheck").checked = true; |
| | | } |
| | | else{ |
| | | window.opener.document.getElementById("allPage:allForm:dataBlock:dataline_R:{!line}:button").style.background = '#e8e8e9'; |
| | | window.opener.document.getElementById("allPage:allForm:dataBlock:dataline_R:{!line}:button").style.color = '#333'; |
| | | window.opener.document.getElementById("allPage:allForm:dataBlock:dataline_L:{!line}:rowCheck").checked = true; |
| | | } |
| | | window.close(); |
| | | } |
| | | } |
| | | </script> |
| | | <apex:pageMessages id="message"/> |
| | | <apex:form id="allForm"> |
| | | <style> |
| | | table.headTable td { |
| | | /*min-width:150px;*/ |
| | | } |
| | | .left20 { |
| | | margin-left: 20px; |
| | | } |
| | | |
| | | body .pbBody table.list tr.headerRow td.colViewing { |
| | | background-image:url('{!URLFOR($Resource.IconResizeMinus_5)}') ; |
| | | background-repeat:no-repeat; |
| | | } |
| | | body .pbBody table.list tr.headerRow td.colUnHideIcon { |
| | | background-image:url('{!URLFOR($Resource.IconResizePlus_5)}'); |
| | | background-repeat:no-repeat; |
| | | } |
| | | </style> |
| | | <script type="text/javascript"> |
| | | var heightAjustment = 120; |
| | | var widthAjustment = 30; |
| | | var staticResource = JSON.parse('{!staticResource}'); |
| | | |
| | | // 适用按钮 |
| | | function applyJs() { |
| | | var appliedFlag = true; |
| | | var selectFlag = true; |
| | | var isCheckFlag = false; |
| | | var ConsumStartDate = j$(escapeVfId('allPage:allForm:searchBlock:ConsumStartDate}')).val(); // 预计使用日 |
| | | var TrialUser= j$(escapeVfId('allPage:allForm:searchBlock:TrialUser}')).val(); // 试用者 |
| | | var FollowerUserid = j$(escapeVfId('allPage:allForm:searchBlock:FollowerUser_lkid')).val(); // 跟台者Id |
| | | var FollowerUsername = j$(escapeVfId('allPage:allForm:searchBlock:FollowerUser_lkold')).val(); // 跟台者Name |
| | | // otherSelectOptionValue = j$.trim(otherSelectOptionValue); |
| | | // var otherSelectOptionValues = []; |
| | | // var otherSelectOptionApi = j$(escapeVfId('{!$Component.applyAssetTypeListId}')).val(); // 其他选项的api |
| | | // var otherSelectOptionText = j$(escapeVfId('{!$Component.applyAssetTypeListId}')).find("option:selected").text(); // 其他选项的text |
| | | // if (otherSelectOptionApi != "") { |
| | | // j$("td." + "col_" + otherSelectOptionApi + ".dataCellBorder1." + otherSelectOptionApi).each(function() { |
| | | // otherSelectOptionValues.push(j$(this)); |
| | | // }); |
| | | // } |
| | | var ConsumStartDates = []; // 备品预计使用日 |
| | | j$("td.intf.dataCellBorder1.Consum_Start_Date__c").each(function() { |
| | | ConsumStartDates.push(j$(this)); |
| | | }); |
| | | var TrialUsers = []; // 试用者 |
| | | j$("td.intf.dataCellBorder1.Trial_User__c").each(function() { |
| | | TrialUsers.push(j$(this)); |
| | | }); |
| | | |
| | | var FollowerUsers = []; // 跟台者: |
| | | j$("td.intf.dataCellBorder1.Follower_User__c").each(function() { |
| | | FollowerUsers.push(j$(this)); |
| | | }); |
| | | |
| | | var currentPageRecordCount = j$(escapeVfId('allPage:allForm:dataBlock:currentPageRecordCnt')).val(); |
| | | for (var i = 0; i < currentPageRecordCount; i++) { |
| | | var checkBox = j$(escapeVfId('allPage:allForm:dataBlock:dataline_L:' + i + ':rowCheck')); |
| | | if (checkBox.prop('checked') == true) { |
| | | isCheckFlag = true; |
| | | // if (internalAssetLocations[i].find("select").val() != internalAssetLocation && internalAssetLocation != '') { |
| | | if (ConsumStartDate != null && ConsumStartDate != '' && typeof(ConsumStartDate) != "undefined") { |
| | | // setChangeFlg(); |
| | | ConsumStartDates[i].find("input").val(ConsumStartDate); |
| | | appliedFlag = false; |
| | | } |
| | | |
| | | if (TrialUser != null && TrialUser != '' && typeof(TrialUser) != "undefined") { |
| | | // setChangeFlg(); |
| | | TrialUsers[i].find("input").val(TrialUser); |
| | | appliedFlag = false; |
| | | } |
| | | |
| | | // if (equipmentTypes[i].find("select").val() != productCategory && productCategory != '') { |
| | | if (FollowerUserid != null && parseInt(FollowerUserid) != 0 && typeof(FollowerUserid) != "undefined" |
| | | && FollowerUsername != null && FollowerUsername != 'null' && typeof(FollowerUsername) != "undefined") { |
| | | // setChangeFlg(); |
| | | var inputs = FollowerUsers[i].find("input"); |
| | | for (var j = 0; j < inputs.length; j++) { |
| | | if(inputs[j].name.endsWith('_lkid')) { |
| | | inputs[j].value = FollowerUserid; |
| | | } |
| | | else if (inputs[j].name.endsWith('_lkold') |
| | | || inputs[j].name.endsWith('inputField')) { |
| | | inputs[j].value = FollowerUsername; |
| | | } |
| | | } |
| | | appliedFlag = false; |
| | | } |
| | | } |
| | | } |
| | | j$(escapeVfId('allPage:allForm:pageBlockButton1:clearApplyFlagId')).val(false); |
| | | // var clearApplyFlag = false; |
| | | window.setTimeout(function () { |
| | | if (ConsumStartDate == null |
| | | && TrialUser == null |
| | | && (FollowerUserid== null || FollowerUsername == null)) { // 适用入力框全为空 |
| | | // alert('适用区输入框为空,请输入适用值。'); |
| | | var applyMsg = '适用区输入框为空,请输入适用值。'; |
| | | //passApplyMsgToController(applyMsg, 'Fail'); |
| | | return; |
| | | } |
| | | if (isCheckFlag == false) { |
| | | // alert('未勾选任何待适用数据。'); |
| | | var applyMsg = '未勾选任何待适用数据。'; |
| | | //passApplyMsgToController(applyMsg, 'Fail'); |
| | | return; |
| | | } |
| | | |
| | | if (selectFlag) { |
| | | if (!appliedFlag) { |
| | | var alertMsg = "适用完了 \r\n"; |
| | | if (ConsumStartDate != null && typeof(ConsumStartDate) != "undefined") { |
| | | var alertMsg1 = "已将打勾数据中的 " + "备品预计使用日" + " 适用为 " + ConsumStartDate + " \r\n"; |
| | | alertMsg += alertMsg1; |
| | | } |
| | | if (TrialUser != null && typeof(TrialUser) != "undefined") { |
| | | var alertMsg1 = "已将打勾数据中的 " + "试用者" + " 适用为 " + TrialUser + " \r\n"; |
| | | alertMsg += alertMsg1; |
| | | } |
| | | if (FollowerUserid != null && typeof(FollowerUserid) != "undefined" |
| | | && FollowerUsername != null && typeof(FollowerUsername) != "undefined") { |
| | | var alertMsg2 = "已将打勾数据中的 " + "跟台者:" + " 适用为 " + FollowerUsername + " \r\n"; |
| | | alertMsg += alertMsg2; |
| | | } |
| | | // alert(alertMsg); |
| | | // clearApplyFlag = true; |
| | | j$(escapeVfId('allPage:allForm:pageBlockButton1:clearApplyFlagId')).val(true); |
| | | // passApplyMsgToController(alertMsg, 'Success'); |
| | | } |
| | | } else { |
| | | if (!appliedFlag) { |
| | | var alertMsg = "适用完了 \r\n"; |
| | | if (ConsumStartDate != null && typeof(ConsumStartDate) != "undefined") { |
| | | var alertMsg1 = "已将打勾数据中的 " + "备品预计使用日" + " 适用为 " + ConsumStartDate + " \r\n"; |
| | | alertMsg += alertMsg1; |
| | | } |
| | | if (TrialUser != null && typeof(TrialUser) != "undefined") { |
| | | var alertMsg1 = "已将打勾数据中的 " + " 试用者" + " 适用为 " + TrialUser + " \r\n"; |
| | | alertMsg += alertMsg1; |
| | | } |
| | | if (FollowerUserid != null && typeof(FollowerUserid) != "undefined" |
| | | && FollowerUsername != null && typeof(FollowerUsername) != "undefined") { |
| | | var alertMsg2 = "已将打勾数据中的 " + "跟台者:" + " 适用为 " + FollowerUsername + " \r\n"; |
| | | alertMsg += alertMsg2; |
| | | } |
| | | // passApplyMsgToController(alertMsg, 'Success'); |
| | | j$(escapeVfId('allPage:allForm:pageBlockButton1:clearApplyFlagId')).val(true); |
| | | } else { |
| | | var alertMsg = "其他选项: " + otherSelectOptionText +"中无此选项值" + otherSelectOptionValue + ",无法更新。"; |
| | | // passApplyMsgToController(alertMsg, 'Fail'); |
| | | } |
| | | } |
| | | }, 5); |
| | | } |
| | | |
| | | function resetMove(d, up, len) { |
| | | var line = j$(escapeVfId(d)).find('input')[0].value; |
| | | resetMoveUpDown(up, parseInt(line), len); |
| | | } |
| | | |
| | | |
| | | function resetMoveUpDown(up, line, len) { |
| | | |
| | | var items = j$(".dataCellBorder2"); |
| | | var item1 = j$("td.intf.dataCellBorder1.Degree_Of_Importance__c"); |
| | | // alert(item1); |
| | | var i = line - 1; |
| | | var i1 = line + 1; |
| | | // var tr = j$('#tableData').find('tbody').find('tr:eq(' + (i) + ')'); |
| | | if (up == true){ |
| | | var tr = j$('#tableData').find('tbody').find('tr:eq(' + (i) + ')'); |
| | | if(line != 1) { |
| | | setChangeFlg(i-1); |
| | | setChangeFlg(i); |
| | | j$(items[i - 1]).children('.ordernocls').val(line); |
| | | j$(items[i]).children('.ordernocls').val(i); |
| | | |
| | | var v1 = j$(item1[i - 1]).find("input").val(); |
| | | var v2 = j$(item1[i]).find("input").val(); |
| | | j$(item1[i - 1]).find("input").val(v2); |
| | | j$(item1[i]).find("input").val(v1); |
| | | |
| | | // j$(item1[i - 1]).children('.ordernocls').val('' + line); |
| | | // j$(item1[i]).children('.ordernocls').val('' + i); |
| | | } |
| | | else { |
| | | j$(items[i]).children('.ordernocls').val(line); |
| | | } |
| | | var tr1 = j$(items[i]).parents("tr"); |
| | | tr.prev().before(tr); |
| | | tr1.prev().before(tr1); |
| | | } |
| | | else { |
| | | var tr = j$('#tableData').find('tbody').find('tr:eq(' + (i) + ')'); |
| | | if(line < len) { |
| | | setChangeFlg(i); |
| | | setChangeFlg(line); |
| | | j$(items[i]).children('.ordernocls').val(i1); |
| | | j$(items[line]).children('.ordernocls').val(line); |
| | | var v1 = j$(item1[i]).find("input").val(); |
| | | var v2 = j$(item1[line]).find("input").val(); |
| | | j$(item1[i]).find("input").val(v2); |
| | | j$(item1[line]).find("input").val(v1); |
| | | } |
| | | else { |
| | | j$(items[i]).children('.ordernocls').val(line); |
| | | } |
| | | var tr1 = j$(items[i]).parents("tr"); |
| | | tr.next().after(tr); |
| | | tr1.next().after(tr1); |
| | | } |
| | | } |
| | | function refopener() { |
| | | window.opener.location.href = '/apex/ConsumTrialUpdate?parid={!parId}'; |
| | | } |
| | | |
| | | function clearApplyValue() { |
| | | var clearApplyValueFlag = j$(escapeVfId('allPage:allForm:pageBlockButton1:clearApplyFlagId')).val(); |
| | | if(clearApplyValueFlag) { |
| | | j$(escapeVfId('{!$Component.stockId}')).val(''); |
| | | j$(escapeVfId('{!$Component.applyEquipmentTypeId}')).val(''); |
| | | j$(escapeVfId('{!$Component.applyAssetTypeListId}')).val(''); |
| | | j$(escapeVfId('{!$Component.otherSelectionId}')).val(''); |
| | | } |
| | | j$(escapeVfId('allPage:allForm:pageBlockButton1:clearApplyFlagId')).val(false); |
| | | } |
| | | |
| | | function checkSavingJs() { |
| | | var isSavingSuccess = j$(escapeVfId('isSavingSuccessId')).val(); |
| | | // alert(isSavingSuccess); |
| | | if (isSavingSuccess != 'false') { |
| | | //setSaveSuccessMsg(); |
| | | } |
| | | } |
| | | |
| | | //2022 02 24 张华建 display PI Data start |
| | | var rowBList; |
| | | var TrialUser = {}; |
| | | var ids = []; |
| | | |
| | | queryUser(); |
| | | |
| | | function q1(){ |
| | | 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){ |
| | | return; |
| | | } |
| | | let temp = {} |
| | | temp.trialUser = contacts.trialUser; |
| | | TrialUser[contacts.dataId] = temp; |
| | | x++; |
| | | }; |
| | | for(var i=0;i<rowBList.length;i++){ |
| | | if(rowBList[i].AWSDataId ){ |
| | | y++; |
| | | ids.push(rowBList[i].AWSDataId + '_' + rowBList[i].Id); |
| | | AWSService.query(staticResource.queryUrl,rowBList[i].AWSDataId,searchCallBack,staticResource.token); |
| | | } |
| | | } |
| | | var id = setInterval(function(){ |
| | | if(x == y){ |
| | | console.log('success') |
| | | resolve('success'); |
| | | clearInterval(id); |
| | | } |
| | | },500); |
| | | }); |
| | | return p; |
| | | } |
| | | |
| | | function q2(value){ |
| | | var p = new Promise(function(resolve, reject){ |
| | | console.log('进入q2'+value) |
| | | for(var i=0;i<ids.length;i++){ |
| | | console.log('i = '+i); |
| | | document.getElementById(ids[i]).children[0].children[0].innerText = TrialUser[ids[i].substring(0,18)].trialUser; |
| | | console.log('i = '+i); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function queryUser(){ |
| | | unblockUI() |
| | | rowBList = JSON.parse('{!rowListString}') |
| | | console.log('pageB.fixMode = '+'{!pageB.fixMode}') |
| | | if('{!pageB.fixMode}' == 'true'){ |
| | | q1().then(function(data){ |
| | | return q2(data); |
| | | }) |
| | | unblockUI(); |
| | | }else{ |
| | | blockme(); |
| | | console.log(rowBList) |
| | | let searchCallBack = function searchCallBack(result){ |
| | | let contacts = result.object; |
| | | if(contacts == null){ |
| | | return; |
| | | } |
| | | let temp = {} |
| | | temp.trialUser = contacts.trialUser; |
| | | TrialUser[contacts.dataId] = temp; |
| | | }; |
| | | for(var i=0;i<rowBList.length;i++){ |
| | | ids.push(rowBList[i].AWSDataId + '_' + rowBList[i].Id); |
| | | AWSService.query(staticResource.queryUrl,rowBList[i].AWSDataId,searchCallBack,staticResource.token); |
| | | } |
| | | unblockUI(); |
| | | } |
| | | } |
| | | |
| | | function showPIDiv(awsDataId){ |
| | | if(awsDataId.length == 0){ |
| | | return |
| | | } |
| | | let index = awsDataId.indexOf('_'); |
| | | console.log('show index = ' + index); |
| | | if(TrialUser[awsDataId.substring(0,index)] == null){ |
| | | return |
| | | } |
| | | console.log('awsDataId Value:'+awsDataId); |
| | | let parentNode = document.getElementById(awsDataId); |
| | | let createDiv = document.createElement("div"); |
| | | createDiv.id = awsDataId+"_PI"; |
| | | let piInformation = TrialUser[awsDataId.substring(0,index)].trialUser |
| | | //let piInformation = 'Name:'+contact['943114607025717249'].lastName +'\n' +'Phone:'+contact['943114607025717249'].phone |
| | | createDiv.innerText = piInformation; |
| | | let x=window.event.x; |
| | | let y=window.event.y; |
| | | createDiv.style.left=x; |
| | | createDiv.style.top=y; |
| | | createDiv.style.background="#dddddd"; |
| | | createDiv.style.position = "absolute"; |
| | | parentNode.appendChild(createDiv); |
| | | parentNode.style.position = "relative"; |
| | | } |
| | | |
| | | function hidePIDiv(awsDataId){ |
| | | if(awsDataId.length == 0){ |
| | | return |
| | | } |
| | | let index = awsDataId.indexOf('_'); |
| | | console.log('hide index = ' + index); |
| | | if(TrialUser[awsDataId.substring(0,index)] == 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 |
| | | let b = false; |
| | | for(var i=0;i<rowBList.length;i++){ |
| | | if(document.getElementById('allPage:allForm:dataBlock:dataline_L:'+i+':rowCheck').checked == true){ |
| | | b = true; |
| | | } |
| | | } |
| | | if(!b){ |
| | | //unblockUI(); |
| | | refopener(); |
| | | return; |
| | | } |
| | | saveRecord(); |
| | | } |
| | | function saveRecordJS(){ |
| | | if('{!pageB.fixMode}' != 'true'){ |
| | | unblockUI(); |
| | | return |
| | | } |
| | | // q3().then(function(data){ |
| | | // return q4(data); |
| | | // }) |
| | | saveRecord(); |
| | | unblockUI(); |
| | | } |
| | | //2022 02 24 张华建 display PI Data end |
| | | |
| | | </script> |
| | | <apex:pageMessages /> |
| | | <apex:actionFunction name="saveRecord" action="{!saveRecord}" oncomplete="unblockUI();refopener();" rerender="allForm"/> |
| | | <apex:inputHidden id="clearApplyFlagId" /> |
| | | <apex:outputPanel id="pageallPanel"> |
| | | <apex:pageBlock id="searchBlock"> |
| | | <table class="searchTable" style="width:100%"> |
| | | <tr> |
| | | <apex:outputPanel layout="none" rendered="{!canEdit}"> |
| | | <td> |
| | | <!-- 预计使用日 --> |
| | | {!$ObjectType.Consum_Apply_Equipment_Set_Detail__c.fields.Consum_Start_Date__c.label} |
| | | <apex:inputField id="ConsumStartDate" value="{!pageB.caesdInput.Consum_Start_Date__c}"/> |
| | | </td> |
| | | <td> |
| | | <!-- 试用者 --> |
| | | {!$ObjectType.Consum_Apply_Equipment_Set_Detail__c.fields.Trial_User__c.label} |
| | | <apex:inputField id="TrialUser" value="{!pageB.caesdInput.Trial_User__c}"/> |
| | | </td> |
| | | <td style="text-align: right;"> |
| | | <!-- 跟台者 --> |
| | | {!$ObjectType.Consum_Apply_Equipment_Set_Detail__c.fields.Follower_User__c.label} |
| | | </td> |
| | | <td> |
| | | <apex:inputField style="width:150px;" id="FollowerUser" value="{!pageB.caesdInput.Follower_User__c}"/> |
| | | </td> |
| | | </apex:outputPanel> |
| | | |
| | | <!-- </tr> --> |
| | | <!-- <tr> --> |
| | | <td> |
| | | <!-- </td> --> |
| | | <!-- <td colspan="5"> --> |
| | | <span style="margin-left: 10px;"> |
| | | <apex:commandButton value="编辑" rendered="{!canEdit}" onclick="blockme();" action="{!changeFixModel}" reRender="allForm" oncomplete="unblockUI();windowResize();"/> |
| | | <apex:commandButton value="编辑" style="float: right; margin-right: 40px;" rendered="{!canEdit == false}" onclick="w = window.open('/apex/ConsumTrialUpdate?parId={!parId}&canedit=true', '编辑试用表上传画面', 'width='+(window.screen.width-200)+',height='+(window.screen.height-200)+',left=100,top=100'); w.focus(); return false;"/> |
| | | </span> |
| | | <span style="margin-left: 10px;"> |
| | | <apex:commandButton value="适用" rendered="{!canEdit}" onclick="applyJs();return false;"/> |
| | | </span> |
| | | <span style="margin-left: 10px;"> |
| | | <apex:commandButton value="保存" onclick="blockme(); saveRecordJS(); return false;" rendered="{!canEdit}" reRender="allForm"/> |
| | | </span> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | </apex:pageBlock> |
| | | <apex:pageBlock id="dataBlock" tabStyle="Report"> |
| | | <apex:inputHidden id="currentPageRecordCnt" value="{!pageB.currentPageRecordCnt}"/> |
| | | <!-- <table id="msgtable"> |
| | | <tr> |
| | | <td> |
| | | <apex:outputPanel id="message"> |
| | | <apex:pageMessages /> |
| | | </apex:outputPanel> |
| | | </td> |
| | | </tr> |
| | | </table> --> |
| | | <div id="out_Div_L"> |
| | | <table class="list" style="border-bottom-width: 0px; font-size:11px; border-spacing:0;" border="" id="tableHeader_L"> |
| | | <tr class="headerRow" height="30px"> |
| | | <apex:outputPanel layout="none" rendered="{!canEdit}"> |
| | | <td class="col_chk" align="center"> |
| | | <input type='checkbox' onClick='checkAll()' id="checker" /> |
| | | </td> |
| | | </apex:outputPanel> |
| | | <apex:repeat value="{!outputFieldList}" var="info"> |
| | | <td class="col_{!info.value}"> |
| | | {!info.label} |
| | | </td> |
| | | </apex:repeat> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | <div id="out_Div" > |
| | | <table class="list" style="border-bottom-width: 0px; font-size:11px; border-spacing:0;" border="" id="tableHeader"> |
| | | <tr class="headerRow" height="30px"> |
| | | <apex:repeat value="{!inputFieldList}" var="info"> |
| | | <td class="col_{!info.value} colViewing"> |
| | | {!info.label} |
| | | </td> |
| | | </apex:repeat> |
| | | <td class="col_upload_picture colViewing">上传图片</td> |
| | | <td class="col_Asset_Center_Confirm colViewing">备品中心确认</td> |
| | | <td class="col_Scroll"></td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | <div style="clear:both;"/> |
| | | <div id="in_Div_L"> |
| | | <table class="list" style="border-bottom-width: 0px; font-size:11px; border-spacing:0;" border="" id="tableData_L"> |
| | | <apex:variable value="{!0}" var="Cnt" /> |
| | | <apex:repeat id="dataline_L" value="{!pageB.rowBList}" var="var"> |
| | | <tr class="dataRow" id="tableData_L_{!Cnt}" > |
| | | <apex:outputPanel layout="none" rendered="{!canEdit}"> |
| | | <td class="dataCellBorder1 col_chk" align="center"> |
| | | <apex:inputCheckbox styleClass="rowchkcls" value="{!var.checked}" id="rowCheck" disabled="{!!var.canChange}"/> |
| | | </td> |
| | | </apex:outputPanel> |
| | | <apex:repeat value="{!outputFieldList}" var="info"> |
| | | <td class="dataCellBorder1 col_{!info.value}" > |
| | | <apex:outputField value="{!var.rnd[info.value]}" /> |
| | | </td> |
| | | </apex:repeat> |
| | | </tr> |
| | | <apex:variable value="{!Cnt+1}" var="Cnt" /> |
| | | </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);}" > |
| | | <apex:variable value="{!0}" var="Col_R" /> |
| | | <apex:repeat value="{!inputFieldList}" var="info" id="inputField" > |
| | | <td class="dataCellBorder1 intf {!info.value} col_{!info.value}" style="{!IF(info.value=='RAESD_Status__c' && var.rnd[info.value]=='申请者收货NG','background-color: #009DDC','')}" 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)}"> |
| | | <apex:inputField id="inputField" value="{!var.rnd[info.value]}" onchange="setChangeFlg('{!var.lineNo-1}');changeEditable('{!var.lineNo-1}');" rendered="{!info.value != 'Asset_loaner_category__c' || var.haveAsset}" /> |
| | | |
| | | </apex:outputPanel> |
| | | <apex:outputPanel rendered="{!((contains(var.canChangeField, info.value) || var.canChangeField == '') && pageB.fixMode == true && var.canChange == true) == false}"> |
| | | <apex:outputField value="{!var.rnd[info.value]}" rendered="{!info.value != 'Asset_loaner_category__c' || var.haveAsset}"/> |
| | | </apex:outputPanel> |
| | | </td> |
| | | <apex:variable value="{!Col_R+1}" var="Col_R" /> |
| | | </apex:repeat> |
| | | <td class="dataCellBorder1 intf col_upload_picture"> |
| | | <apex:commandButton id="button" |
| | | style="{!IF(var.rnd.Has_Picture__c,'background: #009DDC !important;color:white !important;','')}" |
| | | disabled="{!NOT(canedit && pageB.fixMode && var.canChange)}" |
| | | value="上传图片" |
| | | onclick="window.open('ConsumUploadPicture?caesd_id={!var.rnd.Id}&line={!Cnt_R}', '上传图片','width=1000,height=600');return false;"/> |
| | | </td> |
| | | <td class="dataCellBorder1 intf col_Asset_Center_Confirm"> |
| | | <apex:outputPanel rendered="{!pageB.fixMode && var.canChange && var.canCenterEdit}"> |
| | | <apex:inputField id="centerConfirm" value="{!var.rnd.Asset_Center_Confirm__c}" onchange="setChangeFlg('{!var.lineNo-1}')"/> |
| | | </apex:outputPanel> |
| | | <apex:outputPanel rendered="{!NOT(pageB.fixMode && var.canChange && var.canCenterEdit)}"> |
| | | <apex:outputField value="{!var.rnd.Asset_Center_Confirm__c}"/> |
| | | </apex:outputPanel> |
| | | </td> |
| | | <td class="col_Scroll"></td> |
| | | </tr> |
| | | |
| | | <apex:variable value="{!Cnt_R+1}" var="Cnt_R" /> |
| | | </apex:repeat> |
| | | </table> |
| | | </div> |
| | | </apex:pageBlock> |
| | | <script type="text/javascript"> |
| | | function runSFDCAddRemote(MetadataConnectionWarning) { |
| | | if (MetadataConnectionWarning) SFDCAddRemote('{!$Api.Session_ID}'); |
| | | } |
| | | function sortTableJs(key) { |
| | | // blockme(); |
| | | sortTablefunc(key); |
| | | } |
| | | |
| | | j$(function() { |
| | | var tableWidth = 0; |
| | | j$('body .pbBody table#tableHeader tr.headerRow td').each(function() { |
| | | var colClass = getColClassName(this); |
| | | if (colClass != 'col_Scroll') { |
| | | var headerCol = j$('body .pbBody table.list tr.headerRow td.' + colClass); |
| | | tableWidth += headerCol.width() * 1.5; // 20191211 katsu 暫定対応 * 1.5 |
| | | } |
| | | }); |
| | | j$('table#tableData').css('width', (1740 + 2) + 'px'); |
| | | j$('table#tableHeader').css('width', (1740 + 2) + 'px'); |
| | | |
| | | // list の headerRow の tdに toggleWidth() を追加 |
| | | bindTdToggleWidth(); |
| | | if( document.getElementById('allPage:allForm:searchBlock:FollowerUser_mlktp')){ |
| | | document.getElementById('allPage:allForm:searchBlock:FollowerUser_mlktp').style.display="none" ; |
| | | } |
| | | }); |
| | | windowResize(); |
| | | |
| | | function changeEditable(i){ |
| | | var selectOption = document.getElementById("allPage:allForm:dataBlock:dataline_R:" + i+ ":inputField:13:inputField").value; |
| | | if(selectOption == 'NG'){ |
| | | document.getElementById("allPage:allForm:dataBlock:dataline_R:" + i + ":inputField:14:inputField").disabled = false; |
| | | document.getElementById("allPage:allForm:dataBlock:dataline_R:" + i + ":button").disabled = false; |
| | | document.getElementById("allPage:allForm:dataBlock:dataline_R:" + i + ":button").setAttribute("class",'btn'); |
| | | var centerConfirm = document.getElementById("allPage:allForm:dataBlock:dataline_R:" + i + ":centerConfirm"); |
| | | if(centerConfirm){ |
| | | centerConfirm.disabled = false; |
| | | } |
| | | } |
| | | else { |
| | | document.getElementById("allPage:allForm:dataBlock:dataline_R:" + i + ":inputField:14:inputField").disabled = true; |
| | | document.getElementById("allPage:allForm:dataBlock:dataline_R:" + i + ":button").disabled = true; |
| | | document.getElementById("allPage:allForm:dataBlock:dataline_R:" + i + ":button").setAttribute("class",'btnDisabled'); |
| | | var centerConfirm = document.getElementById("allPage:allForm:dataBlock:dataline_R:" + i + ":centerConfirm"); |
| | | if(centerConfirm){ |
| | | centerConfirm.disabled = true; |
| | | } |
| | | } |
| | | } |
| | | for(var i =0;i<j$("div#in_Div_L tr.dataRow").length;i++){ |
| | | if(document.getElementById("allPage:allForm:dataBlock:dataline_R:" + i+ ":inputField:13:inputField")){ |
| | | changeEditable(i); |
| | | } |
| | | } |
| | | </script> |
| | | </apex:outputPanel> |
| | | <apex:inputHidden value="{!done_flag}" id="done_flag"/> |
| | | <apex:inputHidden value="{!hasPicture}" id="hasPicture"/> |
| | | <table> |
| | | <tr> |
| | | <td colspan="6"> |
| | | <apex:commandButton value="保存" action="{!save}" reRender="message,done_flag,hasPicture" oncomplete="closeWindow();"/> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <th>备品配套明细型号</th> |
| | | <th>产品名称</th> |
| | | <th>重要性程度</th> |
| | | <th>跟台者</th> |
| | | <th>消耗品有效期至</th> |
| | | <th>耗材备品明细状态</th> |
| | | </tr> |
| | | <tr> |
| | | <td>{!caesd.Fixture_Model_No_F__c}</td> |
| | | <td>{!caesd.ProductName__c}</td> |
| | | <td>{!caesd.Degree_Of_Importance__c}</td> |
| | | <td> <apex:outputField value="{!caesd.Follower_User__c}"/> </td> |
| | | <td> |
| | | <apex:outputText value="{0,date,yyyy'/'MM'/'dd}"> |
| | | <apex:param value="{!caesd.Consumable_Guaranteen_end_F__c}" /> |
| | | </apex:outputText> |
| | | </td> |
| | | <td>{!caesd.RAESD_Status__c}</td> |
| | | </tr> |
| | | <tr> |
| | | <th colspan="3">图片1</th> |
| | | <th colspan="3">图片2</th> |
| | | </tr> |
| | | <tr> |
| | | <td colspan="3"> |
| | | <apex:inputField value="{!caesd.Picture1__c}"/> |
| | | </td> |
| | | <td colspan="3"> |
| | | <apex:inputField value="{!caesd.Picture2__c}"/> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | </apex:form> |
| | | </apex:page> |