<!--20230427 zq <apex:page standardController="Consum_Apply__c" extensions="ConsumTrialController" showHeader="false" action="{!init}" id="allPage"> -->
    <apex:page lightningStylesheets="true" standardController="Consum_Apply__c" extensions="ConsumTrialController" 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') }"/> deloitte-zhj 20231114 PIPL还原 -->
        <apex:stylesheet value="{!URLFOR($Resource.StyleUtilCss)}"/><!-- 20230619 ljh lightning  -->
        <!-- 标准控件弹出页面修改 start -->
        <apex:includeScript value="{!URLFOR($Resource.SelectFieldJs)}"/>
        <!-- 标准控件弹出页面修改 end -->
        
        <script type="text/javascript">
            //deloitte-zhj 20231114 PIPL还原
            var txIds = [];
            var trialuserMap={};
            var trialUserNameArray = [];
        </script>
        
        <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;
                }
                .searchTable td {
                    display: -webkit-inline-box;
                    margin: 10px 10px;
                    line-height: 2rem;
                }
                .searchTable td:last-child {
                    display: inline-block;
                }
                #tableData td{display: inline-flex;}
            </style>
            <script type="text/javascript">
            
            var heightAjustment = 120;
            var widthAjustment = 30;
    
            // 适用按钮
            function applyJs() {
                var appliedFlag = true;
                var selectFlag = true;
                var isCheckFlag = false;
                var ShowDemonstration = j$(escapeVfId('allPage:allForm:searchBlock:ShowDemonstration')).val();  // 展示/演示
                var OperationType = j$(escapeVfId('allPage:allForm:searchBlock:OperationType')).val();  // 术式类别
                var ConsumStartDate = j$(escapeVfId('allPage:allForm:searchBlock:ConsumStartDate')).val();  // 预计使用日
                var CaseOrAnimalOrgan = j$(escapeVfId('allPage:allForm:searchBlock:CaseOrAnimalOrgan')).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
    
                var ShowDemonstrations = []; // 展示/演示
                j$("td.intf.dataCellBorder1.Show_demonstration__c").each(function() {
                    ShowDemonstrations.push(j$(this));
                });
                var OperationTypes = [];  // 术式类别
                j$("td.intf.dataCellBorder1.Operation_Type__c").each(function() {
                    OperationTypes.push(j$(this));
                });
                var ConsumStartDates = [];  // 备品预计使用日
                j$("td.intf.dataCellBorder1.Consum_Start_Date__c").each(function() {
                    ConsumStartDates.push(j$(this));
                });
                var CaseOrAnimalOrgans = [];  // 病例/动物脏器
                j$("td.intf.dataCellBorder1.Case_OR_animal_organ__c").each(function() {
                    CaseOrAnimalOrgans.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;
                        // 'x'时不适用
                        if (ShowDemonstration != 'x') {
                            ShowDemonstrations[i].find("select").val(ShowDemonstration);
                            appliedFlag = false;
                        }
                        if (OperationType != 'x') {
                            OperationTypes[i].find("select").val(OperationType);
                            appliedFlag = false;
                        }
                        if (ConsumStartDate != null && ConsumStartDate != '' && typeof(ConsumStartDate) != "undefined") {
                            ConsumStartDates[i].find("input").val(ConsumStartDate);
                            appliedFlag = false;
                        }
                        if (CaseOrAnimalOrgan != 'x') {
                            CaseOrAnimalOrgans[i].find("select").val(CaseOrAnimalOrgan);
                            appliedFlag = false;
                        }
    
                        if (TrialUser != null && TrialUser != '' && typeof(TrialUser) != "undefined") {
                            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 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();
                }
            }
    
            function resetMove(d, up, len) {
                var line = j$(escapeVfId(d)).find('input')[0].value;
                resetMoveUpDown(up, parseInt(line), len);
            }
    
            function moveToTop(d, up, len) {
                var line = j$(escapeVfId(d)).find('input')[0].value;
                console.log(line);
                var isSuccessful = true;
                if (up) {
                    for(var i = parseInt(line) ; i > 1 && isSuccessful; i-- ) {
                        isSuccessful = resetMoveUpDown(up, i, len);
                    }
                }
                else {
                    for(var i = parseInt(line) ; i < len && isSuccessful; i++ ) {
                        isSuccessful = resetMoveUpDown(up, i, len);
                    }
                }
                unblockUI();
            }
    
            function resetMoveUpDown(up, line, len) {
    
                var items = j$(".dataCellBorder2");
                var item1 = j$("td.intf.dataCellBorder1.Degree_Of_Importance__c");
                var item2 = j$("td.dataCellBorder1.col_Fixture_Model_No__c");
                var currentPageRecordCount = j$(escapeVfId('allPage:allForm:dataBlock:currentPageRecordCnt')).val();
                var isSuccessful = false;
                // 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) + ')');
                    var trL = j$('#tableData_L').find('tbody').find('tr:eq(' + (i) + ')');
                    if(line != 1) {
                        var model1 = j$(item2[i - 1]).find("span").text();
                        var model2 = j$(item2[i]).find("span").text();
                        if (model1 != model2) {
                            unblockUI();
                            return;
                        }
    
                        var v1 = j$(item1[i - 1]).find("input").val();
                        var v2 = j$(item1[i]).find("input").val();
                        setChangeFlg(i-1);
                        setChangeFlg(i);
                        j$(items[i - 1]).children('.ordernocls').val(line);
                        j$(items[i]).children('.ordernocls').val(line - 1);
                        j$(item1[i - 1]).find("input").val(v2);
                        j$(item1[i]).find("input").val(v1);
    
                        isSuccessful = true;
                        // 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);
                    trL.prev().before(trL);
                }
                else {
                    if(line < currentPageRecordCount) {
                        var model1 = j$(item2[i]).find("span").text();
                        var model2 = j$(item2[line]).find("span").text();
                        if (model1 != model2) {
                            unblockUI();
                            return;
                        }
                        var tr = j$('#tableData').find('tbody').find('tr:eq(' + (i) + ')');
                        var trL = j$('#tableData_L').find('tbody').find('tr:eq(' + (i) + ')');
                        var v1 = j$(item1[i]).find("input").val();
                        var v2 = j$(item1[i + 1]).find("input").val();
                        setChangeFlg(i);
                        setChangeFlg(i + 1);
                        j$(items[i]).children('.ordernocls').val(line + 1);
                        j$(items[i + 1]).children('.ordernocls').val(line);
                        j$(item1[i]).find("input").val(v2);
                        j$(item1[line]).find("input").val(v1);
                        var tr1 = j$(items[i]).parents("tr");
                        tr.next().after(tr);
                        trL.next().after(trL);
                        isSuccessful = true;
                    }
                    else {
                        j$(items[i]).children('.ordernocls').val(line);
                    }
                }
                unblockUI();
                return isSuccessful;
            }
    
            function refopener() {
                window.opener.location.href = '/apex/ConsumTrial?id={!parId}';
            }
    
            if (window.history.pushState) {
                if (window.location.href.indexOf('&saveType=1') > -1) {
                    refopener();
                }
                window.history.pushState({}, "", window.location.href.replace('&saveType=1', ''));
            }
            function saveRecordJS(){
                if('{!pageB.fixMode}' != 'true'){
                    unblockUI();
                    return
                }
                saveRecord();
            }
            //deloitte-zhj 20231114 PIPL还原 end
        </script>
            <apex:pageMessages id="message"/>

            <!-- oncomplete="clearApplyValue(); return false;" -->
            <apex:actionFunction name="passApplyMsgToController" action="{!showApplyMsg}"  rerender="allForm">
                <apex:param name="applyMsg" value="" />
                <apex:param name="applyMsgType" value="" />
            </apex:actionFunction>
            <apex:actionFunction name="sendEmail" action="{!sendEmail}"  rerender="allForm" oncomplete="unblockUI();">
                <apex:param name="emailBody" value="" />
            </apex:actionFunction>
            <apex:actionFunction name="saveRecord" action="{!saveRecord}" oncomplete="unblockUI();" rerender="allForm"/> <!-- deloitte-zhj 20231114 PIPL改造 去掉Trans() -->
            <apex:inputHidden id="clearApplyFlagId" />
            <apex:outputPanel id="pageallPanel">
                <apex:pageBlock id="searchBlock">
                    <apex:outputPanel layout="none" rendered="{!showEditButton}">
                        <table class="searchTable" style="width:100%">
                            <tr>
                                <apex:outputPanel layout="none" rendered="{!canEdit}">
                                    <td>
                                        <!-- 展示/演示 -->
                                        {!$ObjectType.Consum_Apply_Equipment_Set_Detail__c.fields.Show_demonstration__c.label}
                                        <!-- <apex:inputField id="Show_demonstration" value="{!pageB.caesdInput.Show_demonstration__c}"/> -->
                                        <apex:selectList id="ShowDemonstration" value="{!pageB.caesdInput.Show_demonstration__c}" size="1">
                                            <apex:selectOptions value="{!ShowDemonstrationOps}"/>
                                        </apex:selectList>
                                    </td>
                                    <td>
                                        <!-- 术式类别 -->
                                        {!$ObjectType.Consum_Apply_Equipment_Set_Detail__c.fields.Operation_Type__c.label}
                                        <apex:selectList id="OperationType" value="{!pageB.caesdInput.Operation_Type__c}" size="1">
                                            <apex:selectOptions value="{!OperationTypeOps}"/>
                                        </apex:selectList>
                                    </td>
                                    <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.Case_OR_animal_organ__c.label}
                                        <apex:selectList id="CaseOrAnimalOrgan" value="{!pageB.caesdInput.Case_OR_animal_organ__c}" size="1">
                                            <apex:selectOptions value="{!Case_OR_animal_organOpsHead}"/>
                                        </apex:selectList>
                                    </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>
                                        <!-- 跟台者 -->
                                        {!$ObjectType.Consum_Apply_Equipment_Set_Detail__c.fields.Follower_User__c.label}:
                                        <apex:inputField 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="{!AND(canEdit == false, redOnly == false)}" onclick="var w = window.open('/apex/ConsumTrial?id={!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}"/>
                                    </span>
                                </td>
                            </tr>
                        </table>
                    </apex:outputPanel>
                </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_UpDown"> 向上/向下 </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}" style="{!IF(var.isOddnumber, 'background-color : #EFF4FC;', '')}">
                                    <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: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)}"> deloitte-zhj 20231114 PIPL还原-->
                                            <td class="dataCellBorder1 intf {!info.value} col_{!info.value}" id="{! IF(info.value=='Trial_User__c',var.rnd.Id,info.value)}">
                                            <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:inputField id="inputField" value="{!var.rnd[info.value]}" onchange="setChangeFlg('{!var.lineNo - 1}')" style="{!IF(info.value == 'Follower_User__c', 'width: 75%; ', '')}"/>
                                                    <script>
                                                        if( document.getElementById('{!$Component.inputField}' + ':inputField_mlktp')){
                                                            document.getElementById('{!$Component.inputField}' + ':inputField_mlktp').style.display="none" ;
                                                        }
                                                    </script>
                                                </apex:outputPanel>
                                                <apex:outputPanel rendered="{!info.value == 'Case_OR_animal_organ__c'}">
                                                    <apex:selectList value="{!var.rnd.Case_OR_animal_organ__c}" multiselect="false" size="1">
                                                        <apex:selectOptions value="{!Case_OR_animal_organOps}"/>
                                                    </apex:selectList>
                                                </apex:outputPanel>
                                            </apex:outputPanel>
                                            <apex:outputPanel rendered="{!(contains(var.canChangeField, info.value) || var.canChangeField == '') && pageB.fixMode == true && var.canChange == true && info.value == 'Degree_Of_Importance__c'}">
                                                <input id="Degree_Of_Importance__c" value="{!var.rnd[info.value]}" disabled="true"/>
                                                <apex:inputHidden value="{!var.rnd[info.value]}"/>
                                            </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]}"/>
                                            </apex:outputPanel>
                                        </td>
                                    </apex:repeat>
                                    <td class="dataCellBorder2 col_UpDown" id="row{!Cnt_R}">
                                        <apex:outputPanel rendered="{!pageB.fixMode}">
                                            <button value="↑↑" id="top" onclick="blockme(); moveToTop('row{!Cnt_R}', true, '{!var.maxDegree_Of_Importance}'); return false;">↑↑</button>
                                            <button value="↑" id="up" onclick="blockme(); resetMove('row{!Cnt_R}', true, '{!var.maxDegree_Of_Importance}'); return false;">↑</button>|
                                            <button value="↓" id="down" onclick="blockme(); resetMove('row{!Cnt_R}', false, '{!var.maxDegree_Of_Importance}'); return false;">↓</button>
                                            <button value="↓↓" id="bottom" onclick="blockme(); moveToTop('row{!Cnt_R}', false, '{!var.maxDegree_Of_Importance}'); return false;">↓↓</button>
                                        </apex:outputPanel>
                                        <apex:inputText value="{!var.lineNo}" styleClass="ordernocls" style="display:none;"/>
                                        <!-- <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>
                </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();
                            }
                        });
                        j$('table#tableData').css('width', (1260 + 2) + 'px');
                        j$('table#tableHeader').css('width', (1260 + 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" ;
                        }
                    });
                    // var elements = document.getElementsByTagName("select");
                    // for (i = 0; i < elements.length; i++) {
                    //     var id = elements[i].id;
                    //     if (id.length > 5 && id.substring(id.length - 5, id.length) == 'mlktp') {
                    //         elements[i].style.display = "none";
                    //     }
                    // }
                    // var tbl_l = document.getElementById("tableData_L");
                    // var input_l = tbl_l.getElementsByTagName("input");
                    // for (i = 0; i < input_l.length; i++) {
                    //     var id = input_l[i].id + '_lkid';
                    //     if (document.getElementById(id) != null) {
                    //         input_l[i].style.width = "75%";
                    //     }
                    // }
                    // var tbl = document.getElementById("tableData");
                    // var input = tbl.getElementsByTagName("input");
                    // for (i = 0; i < input.length; i++) {
                    //     var id = input[i].id + '_lkid';
                    //     if (document.getElementById(id) != null) {
                    //         input[i].style.width = "75%";
                    //     }
                    // }
                    //aをクリックする際に、tdイベントを実装しない
                    // j$("a[name='out_Div_a']").bind("click",function(event){
                    //     event.stopPropagation();
                    // });
                    windowResize();
                    j$("td.dataCellBorder1 input").change(function(){
                        var names = this.name.split(':');
                        var i = names[names.length - 4];
                        j$("input.rowchkcls")[i].checked = true;
                    })
                </script>
            </apex:outputPanel>
        </apex:form>
        <script>
            // 在页面加载时执行这个函数
            // window.onload = function() {
            //     console.log('processErrorMessages');
            //     processErrorMessages();
            // };
            //标准控件弹出页面修改 start
            //查询参数列表
            let SelectFieldParamList=[
                // 
                {
                    //原apex:inputField的id值，需要在页面上获取
                    inputFieldId : 'allPage:allForm:searchBlock:FollowerUser',
                    //查找字段所在对象
                    ObjectType : 'Consum_Apply_Equipment_Set_Detail__c',
                    //查找字段的api名称
                    QueryFieldApiName : 'Follower_User__c',
                    //查找字段的查找对象
                    SelectObj : 'User',
                    //搜索时使用的字段
                    SelectFld : 'Name',
            
                }
            ]
            //初始化
            resetOpenPage(SelectFieldParamList);
            
            
            function unblockUI(){
                j$("#sbArea").fadeOut(500, function(){
                    j$("#sbArea").remove();
                });
                resetOpenPage(SelectFieldParamList);
            }
            //标准控件弹出页面修改 end
          </script>
    </apex:page>