buli
2023-07-11 80a3f59e2d3df07805bc67e329300b8de90a5b3a
force-app/main/default/pages/OFSInsReportLayout.page
@@ -1,749 +1,1874 @@
<apex:page id="Page" showHeader="false" sidebar="false" controller="OFSInsReportLayoutController" applyBodyTag="false" applyHtmlTag="false" action="{!init}" lightningStylesheets="true">
<!-- <apex:page id="Page" showHeader="false" sidebar="false" standardcontroller="Inspection_Item__c" extensions="OFSInsReportLayoutController" applyBodyTag="false" applyHtmlTag="false" action="{!init}"> -->
<html>
<head>
    <meta name="viewport" content="width=1150,user-scalable=yes" />     <!-- TODO 1150はコンテンツの幅 -->
    <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
    <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
    <apex:includeScript value="{!URLFOR($Resource.connection20)}"/>
    <apex:includeScript value="{!URLFOR($Resource.apex20)}"/>
    <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
    <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" />
    <style type="text/css">
        table#AssetTable select {
            width: 98%;
        }
        table#AssetTableHeader .headerCell {
            box-sizing: border-box;
            padding: 2px 1px;
        }
        table#AssetTable .dataCell {
            box-sizing: border-box;
            padding: 1px 1px;
        }
        .bPageBlock .dataCol .requiredInput {
            display: inline-table;
        }
        .bPageBlock .detailList .labelCol {
            width: 1%;
        }
        .dateFormat  {
            display: none;
        }
    </style>
    <script type="text/javascript">
        var tmpaid = "";
        var tmpan = "";
        var tmpahid = "";
        var tmpahn = "";
        var tmpadid = "";
        var tmpadn = "";
        var tmpaaid = "";
        var tmpaan = "";
        var tmpinsid = "";
        var tmpinsn = "";
        var tmprstr = "";
        sforce.connection.sessionId = '{!$Api.Session_ID}';
        function toggleIrNameDisabled(checker) {
            if (checker.checked) {
                j$(escapeVfId('Page:Form:Block:Ir_Name')).prop("disabled", false);
            } else {
                j$(escapeVfId('Page:Form:Block:Ir_Name')).prop("disabled", true);
            }
        }
        function changeAllCheckResult(val) {
            var cnt = j$(escapeVfId('ProductCnt')).val();
            for (var i = 0; i < cnt; i++) {
                if (val == ' ') {
                    document.getElementById('Page:Form:Block:CheckSection:CheckedInfoList:' + i + ':AssetRowCheckboxIsNormal').value = '';
                } else {
                    document.getElementById('Page:Form:Block:CheckSection:CheckedInfoList:' + i + ':AssetRowCheckboxIsNormal').value = val;
<apex:page
    id="Page"
    showHeader="false"
    sidebar="false"
    controller="OFSInsReportLayoutController"
    applyBodyTag="false"
    applyHtmlTag="false"
    action="{!init}"
    lightningStylesheets="true"
>
    <!-- <apex:page id="Page" showHeader="false" sidebar="false" standardcontroller="Inspection_Item__c" extensions="OFSInsReportLayoutController" applyBodyTag="false" applyHtmlTag="false" action="{!init}"> -->
    <html>
        <head>
            <meta name="viewport" content="width=1150,user-scalable=yes" />
            <!-- TODO 1150はコンテンツの幅 -->
            <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}" />
            <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}" />
            <apex:includeScript value="{!URLFOR($Resource.connection20)}" />
            <apex:includeScript value="{!URLFOR($Resource.apex20)}" />
            <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}" />
            <apex:includeScript
                value="{! URLFOR($Resource.AWSService, 'AWSService.js') }"
            />
            <style type="text/css">
                table#AssetTable select {
                    width: 98%;
                }
            }
        }
        function clearAndSearch() {
            document.getElementById("Page:Form:Block:UnCheckSection:text1").value = "";
            document.getElementById("Page:Form:Block:UnCheckSection:cond1").value = "equals";
            document.getElementById("Page:Form:Block:UnCheckSection:val1").value = "";
            blockme();
            searchfunc();
        }
        function searchJs() {
            blockme();
            searchfunc();
        }
        function sortTableJs(key) {
            blockme();
            sortTablefunc(key);
        }
        function exchangeAssetJs() {
            blockme();
            exchangeAssetfunc();
        }
        function saveByRepairJs(aid, an, ahid, ahn, adid, adn, aaid, aan, rstr) {
            tmpaid = aid;
            tmpan = an;
            tmpahid = ahid;
            tmpahn = ahn;
            tmpadid = adid;
            tmpadn = adn;
            tmpaaid = aaid;
            tmpaan = aan;
            tmprstr = rstr;
    // 点検報告書変更できなくても、修理を作れる?
    if (tmpinsid == "") {
        blockme();
        saveByRepair();
    } else {
        openRepair();
    }
}
function openRepair() {
    // TODO 今後採番テーブルを使いNameを取得、点検報告書は一時的なものです
    window.open('/a0J/e?retURL=%2F' + tmpaid + '&CF00N10000002Dx66_lkid=' + tmpahid + '&CF00N10000002Dx66=' + encodeURIComponent(tmpahn) + '&CF00N10000002Dx5t_lkid=' + tmpadid + '&CF00N10000002Dx5t=' + encodeURIComponent(tmpadn) + '&CF00N10000002Dx5n_lkid=' + tmpaaid + '&CF00N10000002Dx5n=' + encodeURIComponent(tmpaan) + '&CF00N10000002Dx1X_lkid=' + tmpaid + '&CF00N10000002Dx1X=' + encodeURIComponent(tmpan) + '&00N10000002FH86=' + encodeURIComponent(tmprstr) + '&CF00N10000006PRCp=' + encodeURIComponent(tmpinsn) + '&CF00N10000006PRCp_lkid=' + tmpinsid, '_blank');
}
//add by rentx 20210809 全选功能 start
function checkAll(checker) {
    var cnt = j$(escapeVfId('ProductCnt')).val();
    for (var i = 0; i < cnt; i++) {
        if (j$(escapeVfId('Page:Form:Block:CheckSection:CheckedInfoList:'+i+':AssetRowCheckbox1')).size() == 0) {
            break;
        }
        document.getElementById('Page:Form:Block:CheckSection:CheckedInfoList:'+i+':AssetRowCheckbox1').checked = checker.checked;
    }
}
function checkAll2(checker) {
    var cnt = j$(escapeVfId('ProductCnt2')).val();
    var tempi = parseInt(cnt / 900 )+1;
    for (var j = 0; j < tempi; j++) {
        for (var i = 0; i < 900; i++) {
            if (j$(escapeVfId('Page:Form:Block:UnCheckSection:unCheckedInfoListForThousend:'+j+':UnCheckedInfoList:'+i+':AssetRowCheckbox2')).size() == 0) {
                break;
            }
            document.getElementById('Page:Form:Block:UnCheckSection:unCheckedInfoListForThousend:'+j+':UnCheckedInfoList:'+i+':AssetRowCheckbox2').checked = checker.checked;
        }
    }
}
//add by rentx 20210809 全选功能 end
AWSService.sfSessionId = '{!GETSESSIONID()}';
var staticResource = JSON.parse('{!staticResource}');
var aws_data = {};
var txid = null;
function Encrypt(callback){
    blockme();
    //callback();return;
    //<input type="hidden" value="{!ir.Id}" id="IrId"/>
    let e_id = document.getElementById("IrId");
    let url = staticResource.newUrl;
    aws_data = {
        "phone":j$("[field-api='phone__c']").val(),
        "responsiblePerson":j$("[field-api='Responsible_Person__c']").val(),
    };
    if(e_id && e_id.value){
        url = staticResource.updateUrl;
        aws_data.dataId = document.getElementById("Page:Form:Block:AWS_Data_Id__c").value;
    }
    AWSService.post(url, JSON.stringify([aws_data]), function(data){
        if (!(data && data.object && data.object.length)) {
            console.log('AWSService.post failed');
            return;
        }
        let aws_data1 = data.object[0];
        txid = data.txId;
        document.getElementById("Page:Form:Block:AWS_Data_Id__c").value = aws_data1.dataId;
        j$("[field-api='phone__c']").val(aws_data1.phone);
        j$("[field-api='Responsible_Person__c']").val(aws_data1.responsiblePerson);
        if (callback) {
            callback();
        }
    }, staticResource.token);
}
function saveBtnJs(){
    Encrypt(saveBtn);
}
function submitJs(){
    Encrypt(submit);
}
function showPDFJs(){
    Encrypt(showPDF);
}
function afterSaveBtnJs(){
    Trans();
}
function afterSubmitJs(){
    Trans();
}
function afterShowPDFJs(){
    Trans(function(){
        if (!HasError()) {
            window.location.href = '/apex/InsReportPDFOuter?id=' + document.getElementById("IrId").value;
        }
    });
}
function HasError(){
    // if (IsAddmessage) {
    //     return true;
    // }
    let e = document.getElementById("Page:Form:MessageP");
    if (!e) {
        return false;
    }
    let divs = j$(e).find("div.message");
    for (let i = 0; i < divs.length; i++) {
        for (let j = 0; j < divs[i].classList.length; j++) {
            for(let clsi in divs[i].classList){let cls=divs[i].classList[clsi];
                if (typeof cls == 'string'  && cls.indexOf('error')>-1) {
                    return true;
                table#AssetTableHeader .headerCell {
                    box-sizing: border-box;
                    padding: 2px 1px;
                }
            }
        }
    }
                table#AssetTable .dataCell {
                    box-sizing: border-box;
                    padding: 1px 1px;
                }
                .bPageBlock .dataCol .requiredInput {
                    display: inline-table;
                }
                .bPageBlock .detailList .labelCol {
                    width: 1%;
                }
                .dateFormat {
                    display: none;
                }
                table.detailList td:nth-child(4) .requiredInput select {
                    min-width: 150px;
                    width: 150px;
                }
                table.detailList
                    td:nth-child(4)
                    .requiredInput
                    .lookupInput
                    input {
                    min-width: 180px;
                    width: 180px;
                }
                body .bPageBlock .detailList .labelCol,
                .slds-vf-scope .bPageBlock .detailList .labelCol {
                    width: 9%;
                }
                body .bPageBlock .detailList .dataCol {
                    width: auto;
                }
                table.detailList
                    tr:nth-child(2)
                    .dataCol
                    .requiredInput
                    span
                    input,
                table.detailList
                    tr:nth-child(3)
                    .dataCol
                    span.dateInput
                    > input {
                    min-width: 150px;
                    width: 100px;
                }
                table.detailList td.dataCol.last input {
                    min-width: 150px;
                    width: 150px;
                }
                table.detailList tr:nth-child(2) .dataCol:nth-child(4) > input,
                table.detailList tr:nth-child(3) .dataCol:nth-child(4) > input {
                    width: 20px;
                    min-width: 50px;
                }
            </style>
            <script type="text/javascript">
                var tmpaid = '';
                var tmpan = '';
                var tmpahid = '';
                var tmpahn = '';
                var tmpadid = '';
                var tmpadn = '';
                var tmpaaid = '';
                var tmpaan = '';
                var tmpinsid = '';
                var tmpinsn = '';
                var tmprstr = '';
                sforce.connection.sessionId = '{!$Api.Session_ID}';
                function toggleIrNameDisabled(checker) {
                    if (checker.checked) {
                        j$(escapeVfId('Page:Form:Block:Ir_Name')).prop(
                            'disabled',
                            false
                        );
                    } else {
                        j$(escapeVfId('Page:Form:Block:Ir_Name')).prop(
                            'disabled',
                            true
                        );
                    }
                }
                function changeAllCheckResult(val) {
                    var cnt = j$(escapeVfId('ProductCnt')).val();
                    for (var i = 0; i < cnt; i++) {
                        if (val == ' ') {
                            document.getElementById(
                                'Page:Form:Block:CheckSection:CheckedInfoList:' +
                                    i +
                                    ':AssetRowCheckboxIsNormal'
                            ).value = '';
                        } else {
                            document.getElementById(
                                'Page:Form:Block:CheckSection:CheckedInfoList:' +
                                    i +
                                    ':AssetRowCheckboxIsNormal'
                            ).value = val;
                        }
                    }
                }
    return false;
}
                function clearAndSearch() {
                    document.getElementById(
                        'Page:Form:Block:UnCheckSection:text1'
                    ).value = '';
                    document.getElementById(
                        'Page:Form:Block:UnCheckSection:cond1'
                    ).value = 'equals';
                    document.getElementById(
                        'Page:Form:Block:UnCheckSection:val1'
                    ).value = '';
                    blockme();
                    searchfunc();
                }
function Decrypt(data){
    j$("[field-api='phone__c']").val(data.phone);
    j$("[field-api='Responsible_Person__c']").val(data.responsiblePerson);
}
                function searchJs() {
                    blockme();
                    searchfunc();
                }
function Trans(callback){
    let payload = {
        "txId":txid,
        "sfRecordId":document.getElementById("IrId").value,
        "isSuccess":(txid && !HasError()) ? 1 : 0
    };
    AWSService.post(staticResource.transactionUrl, JSON.stringify(payload), function(result){
        Decrypt(aws_data);
        if(callback)callback();
        unblockUI();
    }, staticResource.token);
}
                function sortTableJs(key) {
                    blockme();
                    sortTablefunc(key);
                }
function Query(){
    let ele = document.getElementById("Page:Form:Block:AWS_Data_Id__c");
    if (ele && ele.value) {
        blockme();
        AWSService.query(staticResource.queryUrl, ele.value, function(data){
            if (data && data.object) {
                Decrypt(data.object);
            }
            unblockUI();
        }, staticResource.token);
    }
}
                function exchangeAssetJs() {
                    blockme();
                    exchangeAssetfunc();
                }
j$(function(){
    Query();
})
                function saveByRepairJs(
                    aid,
                    an,
                    ahid,
                    ahn,
                    adid,
                    adn,
                    aaid,
                    aan,
                    rstr
                ) {
                    tmpaid = aid;
                    tmpan = an;
                    tmpahid = ahid;
                    tmpahn = ahn;
                    tmpadid = adid;
                    tmpadn = adn;
                    tmpaaid = aaid;
                    tmpaan = aan;
                    tmprstr = rstr;
                    // 点検報告書変更できなくても、修理を作れる?
                    if (tmpinsid == '') {
                        blockme();
                        saveByRepair();
                    } else {
                        openRepair();
                    }
                }
</script>
<title>{!ir.Name}</title>
</head>
<body>
    <!-- HWAG-B4Q3G5 20180918Start -->
    <apex:form id="Form" style="margin:0 5px;" onkeydown="if(event.keyCode==13){return false;}">>
    <!-- HWAG-B4Q3G5 20180918End -->
    <script type="text/javascript">
    // 保存後、新規の報告書IDを取得
    tmpinsid = '{!ir.Id}';
    tmpinsn = '{!JSENCODE(ir.Name)}';
    //var IsAddmessage = {IsAddmessage};
    var isPDF = {!isPDF};
</script>
<apex:actionFunction name="searchfunc" action="{!searchBtn}" rerender="Form,Block,UnCheckSection" onComplete="unblockUI();"></apex:actionFunction>
                function openRepair() {
                    // TODO 今後採番テーブルを使いNameを取得、点検報告書は一時的なものです
                    window.open(
                        '/a0J/e?retURL=%2F' +
                            tmpaid +
                            '&CF00N10000002Dx66_lkid=' +
                            tmpahid +
                            '&CF00N10000002Dx66=' +
                            encodeURIComponent(tmpahn) +
                            '&CF00N10000002Dx5t_lkid=' +
                            tmpadid +
                            '&CF00N10000002Dx5t=' +
                            encodeURIComponent(tmpadn) +
                            '&CF00N10000002Dx5n_lkid=' +
                            tmpaaid +
                            '&CF00N10000002Dx5n=' +
                            encodeURIComponent(tmpaan) +
                            '&CF00N10000002Dx1X_lkid=' +
                            tmpaid +
                            '&CF00N10000002Dx1X=' +
                            encodeURIComponent(tmpan) +
                            '&00N10000002FH86=' +
                            encodeURIComponent(tmprstr) +
                            '&CF00N10000006PRCp=' +
                            encodeURIComponent(tmpinsn) +
                            '&CF00N10000006PRCp_lkid=' +
                            tmpinsid,
                        '_blank'
                    );
                }
                //add by rentx 20210809 全选功能 start
                function checkAll(checker) {
                    var cnt = j$(escapeVfId('ProductCnt')).val();
                    for (var i = 0; i < cnt; i++) {
                        if (
                            j$(
                                escapeVfId(
                                    'Page:Form:Block:CheckSection:CheckedInfoList:' +
                                        i +
                                        ':AssetRowCheckbox1'
                                )
                            ).size() == 0
                        ) {
                            break;
                        }
                        document.getElementById(
                            'Page:Form:Block:CheckSection:CheckedInfoList:' +
                                i +
                                ':AssetRowCheckbox1'
                        ).checked = checker.checked;
                    }
                }
                function checkAll2(checker) {
                    var cnt = j$(escapeVfId('ProductCnt2')).val();
                    var tempi = parseInt(cnt / 900) + 1;
                    for (var j = 0; j < tempi; j++) {
                        for (var i = 0; i < 900; i++) {
                            if (
                                j$(
                                    escapeVfId(
                                        'Page:Form:Block:UnCheckSection:unCheckedInfoListForThousend:' +
                                            j +
                                            ':UnCheckedInfoList:' +
                                            i +
                                            ':AssetRowCheckbox2'
                                    )
                                ).size() == 0
                            ) {
                                break;
                            }
                            document.getElementById(
                                'Page:Form:Block:UnCheckSection:unCheckedInfoListForThousend:' +
                                    j +
                                    ':UnCheckedInfoList:' +
                                    i +
                                    ':AssetRowCheckbox2'
                            ).checked = checker.checked;
                        }
                    }
                }
                //add by rentx 20210809 全选功能 end
<apex:actionFunction name="exchangeAssetfunc" action="{!exchangeAsset}" rerender="Form" onComplete="unblockUI();"></apex:actionFunction>
                AWSService.sfSessionId = '{!GETSESSIONID()}';
                var staticResource = JSON.parse('{!staticResource}');
                var aws_data = {};
                var txid = null;
                function Encrypt(callback) {
                    blockme();
                    //callback();return;
                    //<input type="hidden" value="{!ir.Id}" id="IrId"/>
                    let e_id = document.getElementById('IrId');
                    let url = staticResource.newUrl;
<apex:actionFunction name="sortTablefunc" action="{!sortTable}" rerender="Form" onComplete="unblockUI();">
<apex:param name="firstParam" assignTo="{!sortKey}" value="" />
</apex:actionFunction>
                    aws_data = {
                        phone: j$("[field-api='phone__c']").val(),
                        responsiblePerson: j$(
                            "[field-api='Responsible_Person__c']"
                        ).val()
                    };
<apex:actionFunction name="getAssetFromHp" action="{!getAssetFromHp}" rerender="Form" onComplete="unblockUI();" />
                    if (e_id && e_id.value) {
                        url = staticResource.updateUrl;
                        aws_data.dataId = document.getElementById(
                            'Page:Form:Block:AWS_Data_Id__c'
                        ).value;
                    }
<apex:actionFunction name="saveByRepair" action="{!saveBtn}" rerender="Form" onComplete="unblockUI();openRepair();"/>
                    AWSService.post(
                        url,
                        JSON.stringify([aws_data]),
                        function (data) {
                            if (!(data && data.object && data.object.length)) {
                                console.log('AWSService.post failed');
                                return;
                            }
                            let aws_data1 = data.object[0];
                            txid = data.txId;
<apex:actionFunction name="saveBtn" action="{!saveBtn}" rerender="Form" onComplete="afterSaveBtnJs();"/>
<apex:actionFunction name="submit" action="{!submit}" rerender="Form" onComplete="afterSubmitJs();"/>
<apex:actionFunction name="showPDF" action="{!showPDF}" rerender="Form" onComplete="afterShowPDFJs();"/>
                            document.getElementById(
                                'Page:Form:Block:AWS_Data_Id__c'
                            ).value = aws_data1.dataId;
                            j$("[field-api='phone__c']").val(aws_data1.phone);
                            j$("[field-api='Responsible_Person__c']").val(
                                aws_data1.responsiblePerson
                            );
<apex:outputPanel id="MessageP">
<apex:pageMessages />
</apex:outputPanel>
                            if (callback) {
                                callback();
                            }
                        },
                        staticResource.token
                    );
                }
                function saveBtnJs() {
                    Encrypt(saveBtn);
                }
                function submitJs() {
                    Encrypt(submit);
                }
                function showPDFJs() {
                    Encrypt(showPDF);
                }
<div><apex:pageBlock mode="maindetail" Id="Block" rendered="{!initFlag}">
    <div style="position: relative;top:0;width:100%;">
        <table>
            <tr>
                <td><apex:outputLabel value="{!$ObjectType.Inspection_Report__c.Label}:" style="font-size:18px;font-weight:bold;padding-right: 5px;"/></td>
                <td>(<apex:inputCheckBox value="{!ir.Name_Manual__c}" id="Name_Manual" onchange="toggleIrNameDisabled(this);return false;"/>
                    <apex:outputLabel value="{!$ObjectType.Inspection_Report__c.fields.Name_Manual__c.Label}" for="Name_Manual"/>)
                    <apex:inputField value="{!ir.Name}" id="Ir_Name" html-disabled="disabled" style="border-width:0px;font-size:18px;font-weight:bold;padding-right:20px;-webkit-text-fill-color:black;"/>
                </td>
                <td style="text-align: center;padding-right: 100px;"><input class="btn" type="Button" style="width:80px;" value="保存" action="" onclick="saveBtnJs();" rerender="Form" onComplete="unblockUI();"/></td>
                <td style="text-align: center;padding-right: 100px;"><input class="btn" type="Button" value="提交" action="" onclick="submitJs();" style="width:80px" rerender="Form" id="submitButton" onComplete="unblockUI();"/></td>
                <td style="text-align: center;padding-right: 100px;"><apex:commandButton style="width:80px;" value="关闭窗口" onclick="location.href='/apex/OFSWindowClose';return false;" id="closeButton"/></td>
                <td style="text-align: center;"><input class="btn" type="Button" style="width:80px;" value="PDF" action="" onclick="showPDFJs();" rerender="Form" onComplete="unblockUI();"/></td>
            </tr>
        </table>
        <apex:pageBlockSection title="{!sectionList[0].title}" columns="{!sectionList[0].column}" showHeader="{!sectionList[0].showHeader}" rendered="{!sectionList.size>0}">
        <apex:repeat value="{!sectionList[0].sectionItemList}" var="sectionItem" id="SectionItemList">
        <apex:outputField value="{!ir[sectionItem.api]}" rendered="{!NOT(sectionItem.isDummy)&&NOT(sectionItem.isCustomize)&&NOT(sectionItem.isInput)}"/>
        <apex:inputField style="width:{!sectionItem.width};height:{!sectionItem.height};" value="{!ir[sectionItem.api]}" rendered="{!NOT(sectionItem.isDummy)&&NOT(sectionItem.isCustomize)&&sectionItem.isInput}" required="{!sectionItem.isRequired}" html-tabindex="{!sectionItem.index}"/>
        <apex:pageblockSectionItem rendered="{!NOT(sectionItem.isDummy)&&(sectionItem.isCustomize)&&Not(isNull(sectionItem.customizeLable))}">
        <apex:outputLabel value="{!sectionItem.customizeLable}"/>
        <apex:outputPanel layout="none">
        <apex:repeat value="{!sectionItem.apiList}" var="api">
        <!-- 保存後、病院は強制outputField -->
        <apex:outputPanel layout="none" rendered="{!api == 'Hospital__c' && ir.Id != ''}">
        <apex:outputField value="{!ir[api]}"/>
    </apex:outputPanel>
    <apex:outputPanel layout="none" rendered="{!NOT(api == 'Hospital__c' && ir.Id != '')}">
    <apex:outputLabel style="font-weight: bold; padding-right: 5px;" value="{!sectionItem.apiLabelMap[api]}"/>
    <apex:inputField value="{!ir[api]}" style="{!sectionItem.apiStyleMap[api]}" rendered="{!NOT(api=='') && (sectionItem.isInput || sectionItem.apiInputMap[api])}" required="{!sectionItem.apiRequireMap[api]}" html-tabindex="{!sectionItem.index}"/>
    <apex:outputPanel style="display:inline-block;{!sectionItem.apiStyleMap[api]}" rendered="{!NOT(api=='') && NOT((sectionItem.isInput || sectionItem.apiInputMap[api]))}">
    <apex:outputField value="{!ir[api]}"/>
</apex:outputPanel>
</apex:outputPanel>
</apex:repeat>
</apex:outputPanel>
</apex:pageblockSectionItem>
<apex:pageblockSectionItem rendered="{!NOT(sectionItem.isDummy)&&(sectionItem.isCustomize)&&(isNull(sectionItem.customizeLable))}">
<apex:outputPanel layout="none">
<apex:repeat value="{!sectionItem.apiList}" var="api">
<apex:outputLabel style="font-weight: bold; padding-right: 5px;" value="{!sectionItem.apiLabelMap[api]}"/>
<apex:inputField value="{!ir[api]}" style="{!sectionItem.apiStyleMap[api]}" rendered="{!NOT(api=='') && (sectionItem.isInput || sectionItem.apiInputMap[api])}" required="{!sectionItem.apiRequireMap[api]}" html-tabindex="{!sectionItem.index}"/>
<apex:outputPanel style="display:inline-block;{!sectionItem.apiStyleMap[api]}" rendered="{!NOT(api=='') && NOT((sectionItem.isInput || sectionItem.apiInputMap[api]))}">
<apex:outputField value="{!ir[api]}"/>
</apex:outputPanel>
</apex:repeat>
</apex:outputPanel>
</apex:pageblockSectionItem>
<apex:pageBlockSectionItem rendered="{!sectionItem.isDummy}"/>
</apex:repeat>
</apex:pageBlockSection>
</div>
<div style="position: relative;top:0;height:700px;overflow:hidden;overflow-y:auto;-webkit-overflow-scrolling: touch;">
    <input type="hidden" value="{!ir.Id}" id="IrId"/>
    <apex:inputHidden value="{!ir.AWS_Data_Id__c}" id="AWS_Data_Id__c"/>
                function afterSaveBtnJs() {
                    Trans();
                }
                function afterSubmitJs() {
                    Trans();
                }
    <apex:repeat value="{!sectionList}" var="section" id="SectionList">
    <apex:pageBlockSection title="{!section.title}" columns="{!section.column}" showHeader="{!section.showHeader}" rendered="{!!section.isTop}">
    <apex:repeat value="{!section.sectionItemList}" var="sectionItem" id="SectionItemList">
    <apex:outputField value="{!ir[sectionItem.api]}" rendered="{!NOT(sectionItem.isDummy)&&NOT(sectionItem.isCustomize)&&NOT(sectionItem.isInput)}"/>
    <apex:inputField html-field-api="{!sectionItem.api}" style="width:{!sectionItem.width};height:{!sectionItem.height};" value="{!ir[sectionItem.api]}" rendered="{!NOT(sectionItem.isDummy)&&NOT(sectionItem.isCustomize)&&sectionItem.isInput}" required="{!sectionItem.isRequired}" html-tabindex="{!sectionItem.index}"/>
    <apex:pageblockSectionItem rendered="{!NOT(sectionItem.isDummy)&&(sectionItem.isCustomize)&&Not(isNull(sectionItem.customizeLable))}">
    <apex:outputLabel value="{!sectionItem.customizeLable}"/>
    <apex:outputPanel layout="none">
    <apex:repeat value="{!sectionItem.apiList}" var="api">
    <!-- 保存後、病院は強制outputField -->
    <apex:outputPanel layout="none" rendered="{!api == 'Hospital__c' && ir.Id != ''}">
    <apex:outputField value="{!ir[api]}"/>
</apex:outputPanel>
<apex:outputPanel layout="none" rendered="{!NOT(api == 'Hospital__c' && ir.Id != '')}">
<apex:outputLabel style="font-weight: bold; padding-right: 5px;" value="{!sectionItem.apiLabelMap[api]}"/>
<apex:inputField html-field-api="{!api}" value="{!ir[api]}" style="{!sectionItem.apiStyleMap[api]}" rendered="{!NOT(api=='') && (sectionItem.isInput || sectionItem.apiInputMap[api])}" required="{!sectionItem.apiRequireMap[api]}" html-tabindex="{!sectionItem.index}"/>
<apex:outputPanel style="display:inline-block;{!sectionItem.apiStyleMap[api]}" rendered="{!NOT(api=='') && NOT((sectionItem.isInput || sectionItem.apiInputMap[api]))}">
<apex:outputField value="{!ir[api]}"/>
</apex:outputPanel>
</apex:outputPanel>
</apex:repeat>
</apex:outputPanel>
</apex:pageblockSectionItem>
<apex:pageblockSectionItem rendered="{!NOT(sectionItem.isDummy)&&(sectionItem.isCustomize)&&(isNull(sectionItem.customizeLable))}">
<apex:outputPanel layout="none">
<apex:repeat value="{!sectionItem.apiList}" var="api">
<apex:outputLabel style="font-weight: bold; padding-right: 5px;" value="{!sectionItem.apiLabelMap[api]}"/>
<apex:inputField html-field-api="api" value="{!ir[api]}" style="{!sectionItem.apiStyleMap[api]}" rendered="{!NOT(api=='') && (sectionItem.isInput || sectionItem.apiInputMap[api])}" required="{!sectionItem.apiRequireMap[api]}" html-tabindex="{!sectionItem.index}"/>
<apex:outputPanel style="display:inline-block;{!sectionItem.apiStyleMap[api]}" rendered="{!NOT(api=='') && NOT((sectionItem.isInput || sectionItem.apiInputMap[api]))}">
<apex:outputField value="{!ir[api]}"/>
</apex:outputPanel>
</apex:repeat>
</apex:outputPanel>
</apex:pageblockSectionItem>
<apex:pageBlockSectionItem rendered="{!sectionItem.isDummy}"/>
</apex:repeat>
</apex:pageBlockSection>
</apex:repeat>
                function afterShowPDFJs() {
                    Trans(function () {
                        if (!HasError()) {
                            window.location.href =
                                '/apex/InsReportPDFOuter?id=' +
                                document.getElementById('IrId').value;
                        }
                    });
                }
<script type="text/javascript">
    // 病院の左側「刷新」ボタン追加
    var labels = document.getElementsByTagName("label");
    for (var i = 0; i < labels.length; i++) {
        var lbl = labels[i];
        if (lbl.innerText == "医院" || lbl.innerText == "病院") {
            var html = lbl.parentNode.innerHTML;
            html = "<input type='button' value='刷新' class='btn' onclick='blockme();getAssetFromHp();' />&nbsp;&nbsp;&nbsp;&nbsp;" + html;
            lbl.parentNode.innerHTML = html;
            break;
        }
    }
</script>
<apex:pageBlockSection title="已选保有设备字段历史" columns="1" id="CheckSection">
<input type="hidden" id="ProductCnt" value="{!productCount}" />
                function HasError() {
                    // if (IsAddmessage) {
                    //     return true;
                    // }
                    let e = document.getElementById('Page:Form:MessageP');
                    if (!e) {
                        return false;
                    }
<apex:outputPanel >
<table width="100%">
    <tr>
        <td>&nbsp;</td>
        <td width="100px">
            <span>全</span>
            <select style="vertical-align:text-bottom" id="allCheckResult" size="1" onchange="changeAllCheckResult(this.value);">
                <option value=" ">--无--</option>
                <!-- 默认全OK -->
                <option value="OK" selected = "selected" >OK</option>
                <!-- 默认全OK -->
                <option value="NG">NG</option>
                <!-- add by rentx 20210630 start -->
                <option value="医院放弃">医院放弃</option>
                <!-- add by rentx 20210630 end -->
            </select>
        </td>
        <td width="500px">&nbsp;</td>
    </tr>
</table>
<!-- TODO minus scroll with -->
<table id="AssetTableHeader" class="list" style="border-bottom-width: 0px; font-size:13px;" border="0" cellspacing="0" cellpadding="0">
    <tr style="border-bottom: 1px groove rgba(254, 254, 254, 0.48);background: #f2f3f3;">
        <!-- add by rentx 20210809  -->
        <th class="headerCell" style="width:14px"> <apex:inputCheckbox id="checkAll1" onclick="checkAll(this)" /> </th>
        <!-- <th class="headerCell" style="width:14px" /> -->
        <!-- add by rentx 202120809  -->
        <th class="headerCell" style="width:24px"/>
        <th class="headerCell" style="width:60px">{!$ObjectType.Asset.fields.Asset_situation__c.label}</th>
        <th class="headerCell">{!$ObjectType.Asset.fields.Name.label}</th>
        <th class="headerCell" style="width:100px">{!$ObjectType.Inspection_Item__c.Fields.SerialNumber__c.Label}</th>
        <!-- TODO 項目の作成 -->
        <th class="headerCell" style="width:80px">上次点检日</th>
        <th class="headerCell" style="width:100px">上次修理完毕日</th>
        <th class="headerCell" style="width:80px">
         {!$ObjectType.Inspection_Item__c.Fields.ItemStatus__c.Label}
     </th>
     <th class="headerCell" style="width:100px">{!$ObjectType.Inspection_Item__c.Fields.Fault_Classification1__c.Label}</th>
     <th class="headerCell" style="width:100px">{!$ObjectType.Inspection_Item__c.Fields.Fault_Classification2__c.Label}</th>
     <th class="headerCell" style="width:100px">{!$ObjectType.Inspection_Item__c.Fields.Fault_Classification3__c.Label}</th>
     <th class="headerCell" style="width:100px">{!$ObjectType.Inspection_Item__c.Fields.Diagnosis__c.Label}</th>
     <!-- add by rentx 20210630  -->
     <th class="headerCell" style="width:85px">{!$ObjectType.Inspection_Item__c.Fields.Abandonment_Reasons__c.Label}</th>
     <!-- add by rentx 20210630 -->
     <th class="headerCell" style="width:35px">{!$ObjectType.Asset.Fields.Create_repair__c.Label}</th>
     <!--                                 <td class="headerScroll"></td> -->
 </tr>
</table>
                    let divs = j$(e).find('div.message');
                    for (let i = 0; i < divs.length; i++) {
                        for (let j = 0; j < divs[i].classList.length; j++) {
                            for (let clsi in divs[i].classList) {
                                let cls = divs[i].classList[clsi];
                                if (
                                    typeof cls == 'string' &&
                                    cls.indexOf('error') > -1
                                ) {
                                    return true;
                                }
                            }
                        }
                    }
<div style="height:320px; width:100%; overflow:auto;">
    <table style="border-collapse:collapse; width:100%;" id="AssetTable">
        <apex:variable value="{!1}" var="cnt" />
        <apex:repeat value="{!checkedInfoList}" var="cInfo" id="CheckedInfoList" >
        <tr style="border-bottom: 1px groove rgba(254, 254, 254, 0.48);">
            <td style="width:14px">
                <apex:inputCheckbox value="{!cInfo.rec_checkBox_c}" id="AssetRowCheckbox1" rendered="{!Not(cInfo.IsManual)}"/>
                <apex:outputText value="{!cInfo.IsManual}" id="IsManual" style="display:none;" />
                <input type="hidden" value="{!cInfo.rec.Id}" id="CheckAssetId"/>
            </td>
            <td style="font-weight:bold; text-align:right; width:24px;">{!cnt}</td>
            <td class="dataCell" style="width:60px">
                <apex:outputField value="{!cInfo.rec.Asset_situation__c}"/>
            </td>
            <td class="dataCell">
                <!-- HWAG-BDCA9J 添加了 onclick blurProduct 内容 start-->
                <apex:outputField value="{!cInfo.rec.Name}" rendered="{!Not(cInfo.IsManual)}"/>
                <apex:inputField value="{!cInfo.ah.Product_Manual__c}" id="Assert" style="width:90%;" rendered="{!cInfo.IsManual}"
                onclick="if(!blurProduct(this))return false;"/>
                <!-- HWAG-BDCA9J 添加了 onclick  blurProduct 内容 end-->
            </td>
            <td class="dataCell" style="width:100px">
                <apex:outputField value="{!cInfo.ah.SerialNumber__c}" rendered="{!Not(cInfo.IsManual)}"/>
                <apex:inputField value="{!cInfo.ah.SerialNo_Manual__c}" id="SerialNo" style="width:90%;" rendered="{!cInfo.IsManual}" />
            </td>
            <td class="dataCell" style="width:80px">
                <apex:outputField value="{!cInfo.rec.Final_Examination_Date__c}" rendered="{!Not(cInfo.IsManual)}"/>
            </td>
            <td class="dataCell" style="width:100px">
                <apex:outputField value="{!cInfo.rec.After_repair_last_internal_check_day__c}" rendered="{!Not(cInfo.IsManual)}"/>
            </td>
            <td class="dataCell" style="width:80px">
                <apex:inputField value="{!cInfo.ah.ItemStatus__c}" id="AssetRowCheckboxIsNormal" style="width:98%"/>
            </td>
            <td class="dataCell" style="width:100px">
                <apex:inputField value="{!cInfo.ah.Fault_Classification1__c}" />
             </td>
             <td class="dataCell" style="width:100px">
                 <apex:inputField value="{!cInfo.ah.Fault_Classification2__c}" id="cat2" />
             </td>
             <td class="dataCell" style="width:100px">
                 <apex:inputField value="{!cInfo.ah.Fault_Classification3__c}" id="cat3" />
             </td>
             <td class="dataCell" style="width:100px">
                <apex:inputField value="{!cInfo.ah.Diagnosis__c}" style="width:93%"/>
            </td>
            <!-- add by rentx 20210630 -->
            <td class="dataCell" style="width:85px">
                <apex:inputField value="{!cInfo.ah.Abandonment_Reasons__c}"  style="width:93%"   />
            </td>
            <!-- add by rentx 20210630 -->
            <td class="dataCell" style="width:35px">
                <apex:outputPanel layout="none" rendered="{!Not(cInfo.IsManual)}">
                    <a href="#" onclick="saveByRepairJs('{!cInfo.rec.Id}', '{!JSENCODE(cInfo.rec.Name)}', '{!cInfo.rec.Hospital__r.Id}', '{!JSENCODE(cInfo.rec.Hospital__r.Name)}', '{!cInfo.rec.Department_Class__r.Id}', '{!JSENCODE(cInfo.rec.Department_Class__r.Name)}', '{!cInfo.rec.Account.Id}', '{!JSENCODE(cInfo.rec.Account.Name)}', '只修理');">■</a>
                    return false;
                }
                function Decrypt(data) {
                    j$("[field-api='phone__c']").val(data.phone);
                    j$("[field-api='Responsible_Person__c']").val(
                        data.responsiblePerson
                    );
                }
                function Trans(callback) {
                    let payload = {
                        txId: txid,
                        sfRecordId: document.getElementById('IrId').value,
                        isSuccess: txid && !HasError() ? 1 : 0
                    };
                    AWSService.post(
                        staticResource.transactionUrl,
                        JSON.stringify(payload),
                        function (result) {
                            Decrypt(aws_data);
                            if (callback) callback();
                            unblockUI();
                        },
                        staticResource.token
                    );
                }
                function Query() {
                    let ele = document.getElementById(
                        'Page:Form:Block:AWS_Data_Id__c'
                    );
                    if (ele && ele.value) {
                        blockme();
                        AWSService.query(
                            staticResource.queryUrl,
                            ele.value,
                            function (data) {
                                if (data && data.object) {
                                    Decrypt(data.object);
                                }
                                unblockUI();
                            },
                            staticResource.token
                        );
                    }
                }
                j$(function () {
                    Query();
                });
            </script>
            <title>{!ir.Name}</title>
        </head>
        <body>
            <!-- HWAG-B4Q3G5 20180918Start -->
            <apex:form
                id="Form"
                style="margin: 0 5px"
                onkeydown="if(event.keyCode==13){return false;}"
            >
                <!-- HWAG-B4Q3G5 20180918End -->
                <script type="text/javascript">
                    // 保存後、新規の報告書IDを取得
                    tmpinsid = '{!ir.Id}';
                    tmpinsn = '{!JSENCODE(ir.Name)}';
                    //var IsAddmessage = {IsAddmessage};
                    var isPDF = {!isPDF};
                </script>
                <apex:actionFunction
                    name="searchfunc"
                    action="{!searchBtn}"
                    rerender="Form,Block,UnCheckSection"
                    onComplete="unblockUI();"
                ></apex:actionFunction>
                <apex:actionFunction
                    name="exchangeAssetfunc"
                    action="{!exchangeAsset}"
                    rerender="Form"
                    onComplete="unblockUI();"
                ></apex:actionFunction>
                <apex:actionFunction
                    name="sortTablefunc"
                    action="{!sortTable}"
                    rerender="Form"
                    onComplete="unblockUI();"
                >
                    <apex:param
                        name="firstParam"
                        assignTo="{!sortKey}"
                        value=""
                    />
                </apex:actionFunction>
                <apex:actionFunction
                    name="getAssetFromHp"
                    action="{!getAssetFromHp}"
                    rerender="Form"
                    onComplete="unblockUI();"
                />
                <apex:actionFunction
                    name="saveByRepair"
                    action="{!saveBtn}"
                    rerender="Form"
                    onComplete="unblockUI();openRepair();"
                />
                <apex:actionFunction
                    name="saveBtn"
                    action="{!saveBtn}"
                    rerender="Form"
                    onComplete="afterSaveBtnJs();"
                />
                <apex:actionFunction
                    name="submit"
                    action="{!submit}"
                    rerender="Form"
                    onComplete="afterSubmitJs();"
                />
                <apex:actionFunction
                    name="showPDF"
                    action="{!showPDF}"
                    rerender="Form"
                    onComplete="afterShowPDFJs();"
                />
                <apex:outputPanel id="MessageP">
                    <apex:pageMessages />
                </apex:outputPanel>
            </td>
        </tr>
<apex:variable value="{!cnt + 1}" var="cnt" />
</apex:repeat>
</table>
</div>
</apex:outputPanel>
</apex:pageBlockSection>
                <div>
                    <apex:pageBlock
                        mode="maindetail"
                        Id="Block"
                        rendered="{!initFlag}"
                    >
                        <div style="position: relative; top: 0; width: 100%">
                            <table>
                                <tr>
                                    <td>
                                        <apex:outputLabel
                                            value="{!$ObjectType.Inspection_Report__c.Label}:"
                                            style="
                                                font-size: 18px;
                                                font-weight: bold;
                                                padding-right: 5px;
                                            "
                                        />
                                    </td>
                                    <td>
                                        (<apex:inputCheckBox
                                            value="{!ir.Name_Manual__c}"
                                            id="Name_Manual"
                                            onchange="toggleIrNameDisabled(this);return false;"
                                        />
                                        <apex:outputLabel
                                            value="{!$ObjectType.Inspection_Report__c.fields.Name_Manual__c.Label}"
                                            for="Name_Manual"
                                        />)
                                        <apex:inputField
                                            value="{!ir.Name}"
                                            id="Ir_Name"
                                            html-disabled="disabled"
                                            style="
                                                border-width: 0px;
                                                font-size: 18px;
                                                font-weight: bold;
                                                padding-right: 20px;
                                                -webkit-text-fill-color: black;
                                            "
                                        />
                                    </td>
                                    <td
                                        style="
                                            text-align: center;
                                            padding-right: 100px;
                                        "
                                    >
                                        <input
                                            class="btn"
                                            type="Button"
                                            style="width: 80px"
                                            value="保存"
                                            action=""
                                            onclick="saveBtnJs();"
                                            rerender="Form"
                                            onComplete="unblockUI();"
                                        />
                                    </td>
                                    <td
                                        style="
                                            text-align: center;
                                            padding-right: 100px;
                                        "
                                    >
                                        <input
                                            class="btn"
                                            type="Button"
                                            value="提交"
                                            action=""
                                            onclick="submitJs();"
                                            style="width: 80px"
                                            rerender="Form"
                                            id="submitButton"
                                            onComplete="unblockUI();"
                                        />
                                    </td>
                                    <td
                                        style="
                                            text-align: center;
                                            padding-right: 100px;
                                        "
                                    >
                                        <apex:commandButton
                                            style="width: 90px"
                                            value="关闭窗口"
                                            onclick="location.href='/apex/OFSWindowClose';return false;"
                                            id="closeButton"
                                        />
                                    </td>
                                    <td style="text-align: center">
                                        <input
                                            class="btn"
                                            type="Button"
                                            style="width: 80px"
                                            value="PDF"
                                            action=""
                                            onclick="showPDFJs();"
                                            rerender="Form"
                                            onComplete="unblockUI();"
                                        />
                                    </td>
                                </tr>
                            </table>
                            <apex:pageBlockSection
                                title="{!sectionList[0].title}"
                                columns="{!sectionList[0].column}"
                                showHeader="{!sectionList[0].showHeader}"
                                rendered="{!sectionList.size>0}"
                            >
                                <apex:repeat
                                    value="{!sectionList[0].sectionItemList}"
                                    var="sectionItem"
                                    id="SectionItemList"
                                >
                                    <apex:outputField
                                        value="{!ir[sectionItem.api]}"
                                        rendered="{!NOT(sectionItem.isDummy)&&NOT(sectionItem.isCustomize)&&NOT(sectionItem.isInput)}"
                                    />
                                    <apex:inputField
                                        style="width:{!sectionItem.width};height:{!sectionItem.height};"
                                        value="{!ir[sectionItem.api]}"
                                        rendered="{!NOT(sectionItem.isDummy)&&NOT(sectionItem.isCustomize)&&sectionItem.isInput}"
                                        required="{!sectionItem.isRequired}"
                                        html-tabindex="{!sectionItem.index}"
                                    />
                                    <apex:pageblockSectionItem
                                        rendered="{!NOT(sectionItem.isDummy)&&(sectionItem.isCustomize)&&Not(isNull(sectionItem.customizeLable))}"
                                    >
                                        <apex:outputLabel
                                            value="{!sectionItem.customizeLable}"
                                        />
                                        <apex:outputPanel layout="none">
                                            <apex:repeat
                                                value="{!sectionItem.apiList}"
                                                var="api"
                                            >
                                                <!-- 保存後、病院は強制outputField -->
                                                <apex:outputPanel
                                                    layout="none"
                                                    rendered="{!api == 'Hospital__c' && ir.Id != ''}"
                                                >
                                                    <apex:outputField
                                                        value="{!ir[api]}"
                                                    />
                                                </apex:outputPanel>
                                                <apex:outputPanel
                                                    layout="none"
                                                    rendered="{!NOT(api == 'Hospital__c' && ir.Id != '')}"
                                                >
                                                    <apex:outputLabel
                                                        style="
                                                            font-weight: bold;
                                                            padding-right: 5px;
                                                        "
                                                        value="{!sectionItem.apiLabelMap[api]}"
                                                    />
                                                    <apex:inputField
                                                        value="{!ir[api]}"
                                                        style="{!sectionItem.apiStyleMap[api]}"
                                                        rendered="{!NOT(api=='') && (sectionItem.isInput || sectionItem.apiInputMap[api])}"
                                                        required="{!sectionItem.apiRequireMap[api]}"
                                                        html-tabindex="{!sectionItem.index}"
                                                    />
                                                    <apex:outputPanel
                                                        style="display:inline-block;{!sectionItem.apiStyleMap[api]}"
                                                        rendered="{!NOT(api=='') && NOT((sectionItem.isInput || sectionItem.apiInputMap[api]))}"
                                                    >
                                                        <apex:outputField
                                                            value="{!ir[api]}"
                                                        />
                                                    </apex:outputPanel>
                                                </apex:outputPanel>
                                            </apex:repeat>
                                        </apex:outputPanel>
                                    </apex:pageblockSectionItem>
                                    <apex:pageblockSectionItem
                                        rendered="{!NOT(sectionItem.isDummy)&&(sectionItem.isCustomize)&&(isNull(sectionItem.customizeLable))}"
                                    >
                                        <apex:outputPanel layout="none">
                                            <apex:repeat
                                                value="{!sectionItem.apiList}"
                                                var="api"
                                            >
                                                <apex:outputLabel
                                                    style="
                                                        font-weight: bold;
                                                        padding-right: 5px;
                                                    "
                                                    value="{!sectionItem.apiLabelMap[api]}"
                                                />
                                                <apex:inputField
                                                    value="{!ir[api]}"
                                                    style="{!sectionItem.apiStyleMap[api]}"
                                                    rendered="{!NOT(api=='') && (sectionItem.isInput || sectionItem.apiInputMap[api])}"
                                                    required="{!sectionItem.apiRequireMap[api]}"
                                                    html-tabindex="{!sectionItem.index}"
                                                />
                                                <apex:outputPanel
                                                    style="display:inline-block;{!sectionItem.apiStyleMap[api]}"
                                                    rendered="{!NOT(api=='') && NOT((sectionItem.isInput || sectionItem.apiInputMap[api]))}"
                                                >
                                                    <apex:outputField
                                                        value="{!ir[api]}"
                                                    />
                                                </apex:outputPanel>
                                            </apex:repeat>
                                        </apex:outputPanel>
                                    </apex:pageblockSectionItem>
                                    <apex:pageBlockSectionItem
                                        rendered="{!sectionItem.isDummy}"
                                    />
                                </apex:repeat>
                            </apex:pageBlockSection>
                        </div>
                        <div
                            style="
                                position: relative;
                                top: 0;
                                height: 700px;
                                overflow: hidden;
                                overflow-y: auto;
                                -webkit-overflow-scrolling: touch;
                            "
                        >
                            <input type="hidden" value="{!ir.Id}" id="IrId" />
                            <!-- zhj 新方案改造 2022-12-05  start-->
                            <!-- <apex:inputHidden value="{!ir.Responsible_Person_Encrypted__c}" id="Responsible_Person_Encrypted__c"/>
    <apex:inputHidden value="{!ir.phone_Encrypted__c}" id="phone_Encrypted__c"/> -->
                            <!-- zhj 新方案改造 2022-12-05  end-->
                            <apex:inputHidden
                                value="{!ir.AWS_Data_Id__c}"
                                id="AWS_Data_Id__c"
                            />
<apex:outputPanel id="ButtonPanel">
<table style="width:100%;">
    <tr>
        <td>
            <apex:commandButton value="行追加" action="{!addNewRows}" disabled="{!Not($ObjectType.Inspection_Item__c.createable)}"
            style="margin-left:10px;float:left;" onclick="blockme();" oncomplete="unblockUI();" rerender="Form" />
            <apex:commandButton value="刷新选中的保有设备" onclick="exchangeAssetJs();return false;" rerender="dummy"/>
            <!-- <apex:commandButton value="刷新选中的保有设备" action="{!exchangeAsset}" onclick="blockme();" oncomplete="unblockUI();" rerender="Form" /> -->
            <!--                                 <apex:commandButton value="刷新医院下的全部保有设备" action="{!getAssetFromHp}" onclick="blockme();" oncomplete="unblockUI();" rerender="Form" /> -->
        </td>
    </tr>
</table>
</apex:outputPanel>
<table>
    <tr>
        <td><div id="ErrorName" style="color: red;font-weight: bold;">{!alertMessage}</div>
        </td>
    </tr>
</table>
<!-- HWAG-B4Q3G5 20180918Start -->
<apex:pageBlockSection title="未选保有设备字段历史" columns="1" id="UnCheckSection" onkeydown="if(event.keyCode==13){searchJs(); return false;}">
<!-- HWAG-B4Q3G5 20180918End -->
<input type="hidden" id="ProductCnt2" value="{!productCount2}" />
<apex:outputPanel >
<div align="center">
    <apex:outputPanel id="countorder">第{!countorder}页</apex:outputPanel>
    <apex:commandButton value="上一页" action="{!UpPage}" onclick="blockme();" disabled="{!IF(countorder=1,true,false)}" oncomplete="unblockUI();" reRender="Form"/>
    <apex:commandButton value="下一页" action="{!DownPage}" onclick="blockme();" disabled="{!IF(countorder >=nowAssetcount ,true,false)}" oncomplete="unblockUI();" rerender="Form"/>
    <apex:outputPanel id="NowOrdercount">共{!nowAssetcount}页</apex:outputPanel>
</div>
                            <apex:repeat
                                value="{!sectionList}"
                                var="section"
                                id="SectionList"
                            >
                                <apex:pageBlockSection
                                    title="{!section.title}"
                                    columns="{!section.column}"
                                    showHeader="{!section.showHeader}"
                                    rendered="{!!section.isTop}"
                                >
                                    <apex:repeat
                                        value="{!section.sectionItemList}"
                                        var="sectionItem"
                                        id="SectionItemList"
                                    >
                                        <apex:outputField
                                            value="{!ir[sectionItem.api]}"
                                            rendered="{!NOT(sectionItem.isDummy)&&NOT(sectionItem.isCustomize)&&NOT(sectionItem.isInput)}"
                                        />
                                        <apex:inputField
                                            html-field-api="{!sectionItem.api}"
                                            style="width:{!sectionItem.width};height:{!sectionItem.height};margin-left:17px;"
                                            value="{!ir[sectionItem.api]}"
                                            rendered="{!NOT(sectionItem.isDummy)&&NOT(sectionItem.isCustomize)&&sectionItem.isInput}"
                                            required="{!sectionItem.isRequired}"
                                            html-tabindex="{!sectionItem.index}"
                                        />
                                        <apex:pageblockSectionItem
                                            rendered="{!NOT(sectionItem.isDummy)&&(sectionItem.isCustomize)&&Not(isNull(sectionItem.customizeLable))}"
                                        >
                                            <apex:outputLabel
                                                value="{!sectionItem.customizeLable}"
                                            />
                                            <apex:outputPanel layout="none">
                                                <apex:repeat
                                                    value="{!sectionItem.apiList}"
                                                    var="api"
                                                >
                                                    <!-- 保存後、病院は強制outputField -->
                                                    <apex:outputPanel
                                                        layout="none"
                                                        rendered="{!api == 'Hospital__c' && ir.Id != ''}"
                                                    >
                                                        <apex:outputField
                                                            value="{!ir[api]}"
                                                        />
                                                    </apex:outputPanel>
                                                    <apex:outputPanel
                                                        layout="none"
                                                        rendered="{!NOT(api == 'Hospital__c' && ir.Id != '')}"
                                                    >
                                                        <apex:outputLabel
                                                            style="
                                                                font-weight: bold;
                                                                padding-right: 5px;
                                                            "
                                                            value="{!sectionItem.apiLabelMap[api]}"
                                                        />
                                                        <apex:inputField
                                                            html-field-api="{!api}"
                                                            value="{!ir[api]}"
                                                            style="{!sectionItem.apiStyleMap[api]}"
                                                            rendered="{!NOT(api=='') && (sectionItem.isInput || sectionItem.apiInputMap[api])}"
                                                            required="{!sectionItem.apiRequireMap[api]}"
                                                            html-tabindex="{!sectionItem.index}"
                                                        />
                                                        <apex:outputPanel
                                                            style="display:inline-block;{!sectionItem.apiStyleMap[api]}"
                                                            rendered="{!NOT(api=='') && NOT((sectionItem.isInput || sectionItem.apiInputMap[api]))}"
                                                        >
                                                            <apex:outputField
                                                                value="{!ir[api]}"
                                                            />
                                                        </apex:outputPanel>
                                                    </apex:outputPanel>
                                                </apex:repeat>
                                            </apex:outputPanel>
                                        </apex:pageblockSectionItem>
                                        <apex:pageblockSectionItem
                                            rendered="{!NOT(sectionItem.isDummy)&&(sectionItem.isCustomize)&&(isNull(sectionItem.customizeLable))}"
                                        >
                                            <apex:outputPanel layout="none">
                                                <apex:repeat
                                                    value="{!sectionItem.apiList}"
                                                    var="api"
                                                >
                                                    <apex:outputLabel
                                                        style="
                                                            font-weight: bold;
                                                            padding-right: 5px;
                                                        "
                                                        value="{!sectionItem.apiLabelMap[api]}"
                                                    />
                                                    <apex:inputField
                                                        html-field-api="api"
                                                        value="{!ir[api]}"
                                                        style="{!sectionItem.apiStyleMap[api]}"
                                                        rendered="{!NOT(api=='') && (sectionItem.isInput || sectionItem.apiInputMap[api])}"
                                                        required="{!sectionItem.apiRequireMap[api]}"
                                                        html-tabindex="{!sectionItem.index}"
                                                    />
                                                    <apex:outputPanel
                                                        style="display:inline-block;{!sectionItem.apiStyleMap[api]}"
                                                        rendered="{!NOT(api=='') && NOT((sectionItem.isInput || sectionItem.apiInputMap[api]))}"
                                                    >
                                                        <apex:outputField
                                                            value="{!ir[api]}"
                                                        />
                                                    </apex:outputPanel>
                                                </apex:repeat>
                                            </apex:outputPanel>
                                        </apex:pageblockSectionItem>
                                        <apex:pageBlockSectionItem
                                            rendered="{!sectionItem.isDummy}"
                                        />
                                    </apex:repeat>
                                </apex:pageBlockSection>
                            </apex:repeat>
<table>
    <tr>
        <td style="width:85px" align="right">选择条件</td>
        <td style="width:85px" align="right"><apex:selectList value="{!text1}" id="text1" size="1" style="width:80px"><apex:selectOptions value="{!textOpts}"/></apex:selectList></td>
        <td style="width:85px" align="center"><apex:selectList value="{!cond1}" id="cond1" size="1" style="width:80px"><apex:selectOptions value="{!equalOpts}"/></apex:selectList></td>
        <td style="width:95px" align="left"><apex:inputText value="{!val1}" id="val1" style="width:100px"/></td>
        <td align="left">
            &nbsp;&nbsp;&nbsp;&nbsp;
            <apex:commandButton value="检索" onclick="searchJs();return false;" style="width:130px" rerender="dummy"/>
            &nbsp;&nbsp;
            <apex:commandButton value="清除条件" onclick="clearAndSearch();" style="width:130px" rerender="dummy"/>
            &nbsp;&nbsp;
            <span style="vertical-align: text-bottom;">使用中<apex:inputCheckBox value="{!activeOn}" /></span>
        </td>
    </tr>
</table>
<table style="border-collapse:collapse;" id="AssetTable2">
    <tr style="border-bottom: 1px groove rgba(254, 254, 254, 0.48);background: #f2f3f3;">
        <!-- add by rentx 20210809 start 全选功能  -->
        <!-- <th class="headerCell" style="width:25px"></th> -->
        <th class="headerCell" style="padding: 2px 5px; width:25px"><apex:inputCheckbox id="checkAll1" onclick="checkAll2(this)" /> </th>
        <!-- add by rentx 20210809 end 全选功能  -->
        <th class="headerCell" style="width:70px">
            <a href="#" onclick="sortTableJs('0');return false;" style="text-decoration: underline;">{!$ObjectType.Asset.fields.Asset_situation__c.label}</a>{!sortOrder[0]}
        </th>
        <th class="headerCell">
            <a href="#" onclick="sortTableJs('1');return false;" style="text-decoration: underline;">{!$ObjectType.Asset.fields.Name.label}</a>{!sortOrder[1]}
        </th>
        <th class="headerCell" style="width:70px">
            <a href="#" onclick="sortTableJs('2');return false;" style="text-decoration: underline;">{!$ObjectType.Asset.fields.SerialNumber.label}</a>{!sortOrder[2]}
        </th>
        <th class="headerCell" style="width:70px">
            <a href="#" onclick="sortTableJs('3');return false;" style="text-decoration: underline;">{!$ObjectType.Asset.fields.CurrentContract__c.label}</a>{!sortOrder[3]}
        </th>
        <th class="headerCell" style="width:70px">
            <a href="#" onclick="sortTableJs('4');return false;" style="text-decoration: underline;">{!$ObjectType.Asset.fields.Department_Name__c.label}</a>{!sortOrder[4]}
        </th>
        <th class="headerCell" style="width:70px">
            <a href="#" onclick="sortTableJs('5');return false;" style="text-decoration: underline;">{!$ObjectType.Asset.fields.Status.label}</a>{!sortOrder[5]}
        </th>
        <th class="headerCell" style="width:90px">
            <a href="#" onclick="sortTableJs('6');return false;" style="text-decoration: underline;">{!$ObjectType.Asset.fields.Installation_Site__c.label}</a>{!sortOrder[6]}
        </th>
        <th class="headerCell" style="width:90px">
            <a href="#" onclick="sortTableJs('7');return false;" style="text-decoration: underline;">{!$ObjectType.Asset.fields.Room_Number__c.label}</a>{!sortOrder[7]}
        </th>
        <th class="headerCell" style="width:90px">
            <a href="#" onclick="sortTableJs('8');return false;" style="text-decoration: underline;">{!$ObjectType.Asset.fields.InstallDate.label}</a>{!sortOrder[8]}
        </th>
        <th class="headerCell" style="width:90px">
            <a href="#" onclick="sortTableJs('9');return false;" style="text-decoration: underline;">{!$ObjectType.Asset.fields.Asset_Owner__c.label}</a>{!sortOrder[9]}
        </th>
        <th class="headerCell" style="width:90px">
            <a href="#" onclick="sortTableJs('10');return false;" style="text-decoration: underline;">{!$ObjectType.Asset.fields.Accumulation_Repair_Amount__c.label}</a>{!sortOrder[10]}
        </th>
    </tr>
    <apex:variable value="{!1}" var="cnt" />
    <apex:variable value="{!0}" var="cntOut" />
    <apex:repeat value="{!IF(ThousandFLG>0,unCheckedInfoListForThousend,1)}" var="Thoinfo" id="unCheckedInfoListForThousend">
    <apex:repeat value="{!IF(ThousandFLG>0,Thoinfo,unCheckedInfoList)}" var="ucInfo" id="UnCheckedInfoList" >
                            <script type="text/javascript">
                                // 病院の左側「刷新」ボタン追加
                                var labels =
                                    document.getElementsByTagName('label');
                                for (var i = 0; i < labels.length; i++) {
                                    var lbl = labels[i];
                                    if (
                                        lbl.innerText == '医院' ||
                                        lbl.innerText == '病院'
                                    ) {
                                        var html = lbl.parentNode.innerHTML;
                                        html =
                                            "<input type='button' value='刷新' class='btn' onclick='blockme();getAssetFromHp();' />&nbsp;&nbsp;&nbsp;&nbsp;" +
                                            html;
                                        lbl.parentNode.innerHTML = html;
                                        break;
                                    }
                                }
                            </script>
                            <apex:pageBlockSection
                                title="已选保有设备字段历史"
                                columns="1"
                                id="CheckSection"
                            >
                                <input
                                    type="hidden"
                                    id="ProductCnt"
                                    value="{!productCount}"
                                />
    <tr style="border-bottom: 1px groove rgba(254, 254, 254, 0.48);">
        <td style="padding: 2px 5px; width:25px">
            <apex:inputCheckbox value="{!ucInfo.rec_checkBox_c}" id="AssetRowCheckbox2"/>
            <input type="hidden" value="{!ucInfo.rec.Id}" id="UncheckAssetId"/>
        </td>
        <td style="padding: 2px 5px; width:70px">
            <apex:outputField value="{!ucInfo.rec.Asset_situation__c}"/>
        </td>
        <td style="padding: 2px 5px;">
            <a href="#" onclick="window.open('/{!ucInfo.rec.Id}', '_blank');">{!ucInfo.rec.Name}</a>
            <!--                                     <apex:outputField value="{!ucInfo.rec.name}" id="assetName"/> -->
        </td>
        <td style="padding: 2px 5px; width:70px">
            <apex:outputField value="{!ucInfo.rec.SerialNumber}"/>
        </td>
        <td style="padding: 2px 5px; width:70px">
            <!--                                     <apex:outputField value="{!ucInfo.rec.CurrentContract__c}"/> -->
            <a href="#" onclick="window.open('/{!ucInfo.rec.CurrentContract__c}', '_blank');">{!ucInfo.rec.CurrentContract__r.Management_Code__c}</a>
        </td>
        <td style="padding: 2px 5px; width:70px">
            <apex:outputField value="{!ucInfo.rec.Department_Name__c}"/>
        </td>
        <td style="padding: 2px 5px; width:70px">
            <apex:outputField value="{!ucInfo.rec.Status}"/>
        </td>
        <td style="padding: 2px 5px; width:70px">
            <apex:outputField value="{!ucInfo.rec.Installation_Site__c}"/>
        </td>
        <td style="padding: 2px 5px; width:70px">
            <apex:outputField value="{!ucInfo.rec.Room_Number__c}"/>
        </td>
        <td style="padding: 2px 5px; width:90px;text-align:center">
            <apex:outputField value="{!ucInfo.rec.InstallDate}"/>
        </td>
        <td style="padding: 2px 5px; width:90px">
            <apex:outputField value="{!ucInfo.rec.Asset_Owner__c}"/>
        </td>
        <td style="padding: 2px 5px; width:90px;text-align:center">
            <apex:outputField value="{!ucInfo.rec.Accumulation_Repair_Amount__c}"/>
        </td>
    </tr>
    <apex:variable value="{!cnt + 1}" var="cnt" />
</apex:repeat>
<apex:variable value="{!cntOut + 1}" var="cntOut" />
</apex:repeat>
</table>
</apex:outputPanel>
</apex:pageBlockSection>
<!-- fxk 2021/8/4 新加 Start-->
<apex:pageBlockSection title="打印时洗消信息" columns="1" id="UnCheckSection1" >
<apex:outputPanel >
<table class="edittable" border="0" style="border-collapse: collapse; width:600px; table-layout:fixed;">
    <tr>
        <td>{!$ObjectType.Inspection_Report__c.fields.CleaningFluid__c.Label}:</td>
        <td><apex:inputField value="{!ir.CleaningFluid__c}" style="width: 90%"/></td>
        <!-- 方式  add by rentx 20210927 start-->
        <td>{!$ObjectType.Inspection_Report__c.fields.Mode__c.Label}:</td>
        <td><apex:inputField value="{!ir.Mode__c}" style="width: 90%"/></td>
        <!-- 方式 add by rentx 20210927 end -->
        <td>{!$ObjectType.Inspection_Report__c.fields.SterilizationMethod__c.Label}:</td>
        <td><apex:inputField value="{!ir.SterilizationMethod__c}" style="width: 90%"/></td>
        <td>{!$ObjectType.Inspection_Report__c.fields.Remarks__c.Label}:</td>
        <td><apex:inputText value="{!ir.Remarks__c}" style="width: 90%"/></td>
    </tr>
    <tr>
        <td>{!$ObjectType.Inspection_Report__c.fields.Disinfectant__c.Label}:</td>
        <td><apex:inputField value="{!ir.Disinfectant__c}" style="width: 90%"/></td>
        <td>{!$ObjectType.Inspection_Report__c.fields.UsedMachine__c.Label}:</td>
        <td><apex:inputField value="{!ir.UsedMachine__c}" style="width: 90%"/></td>
        <td>{!$ObjectType.Inspection_Report__c.fields.Used_ET__c.Label}:</td>
        <td><apex:inputText value="{!ir.Used_ET__c}" style="width: 90%"/></td>
    </tr>
</table>
</apex:outputPanel>
</apex:pageBlockSection>
<!-- fxk 2021/8/4 新加 End-->
</div>
</apex:pageBlock></div>
<script type="text/javascript">
    // 已签字の場合、変更不能にする
    var status = '{!ir.Status__c}';
    if (status == "申请中" || status == "批准") {
        var inputs = document.getElementsByTagName("input");
        for (var i = 0; i < inputs.length; i++) {
            var obj = inputs[i];
            if (obj.id == "Page:Form:Block:closeButton") continue;
            //if (obj.id == "Page:Form:Block:submitButton") continue;
            //if (status == "已签字" && obj.id == "Page:Form:Block:submitButton") continue;
            if (obj.type == "button") {
                setButtonDisable(obj, true);
            } else {
                obj.disabled = true;
            }
        }
        var selects = document.getElementsByTagName("select");
        console.log(selects);
        for (var i = 0; i < selects.length; i++) {
            selects[i].disabled = true;
        }
    } else {
        //var smb = j$(escapeVfId("Page:Form:Block:submitButton"))[0];
        //setButtonDisable(smb, true);
    }
    // HWAG-BDCA9J 提醒未保存和刷新前不能选择产品 start
    function blurProduct(obj) {
        var irID = "{!ir.Id}";
        var productCount2 = "{!productCount2}";
        if(!irID && productCount2  == 0){
            alert('请先输入医院并点击刷新按钮调出保有设备,否则点检结果无法与设备关联。');
            obj.blur();
            return false;
        }
        return true;
    }
    // HWAG-BDCA9J 提醒未保存和刷新前不能选择产品 end
</script>
</apex:form>
</body>
</html>
</apex:page>
                                <apex:outputPanel>
                                    <table width="100%">
                                        <tr>
                                            <td>&nbsp;</td>
                                            <td width="120px">
                                                <span>全</span>
                                                <select
                                                    style="
                                                        vertical-align: text-bottom;
                                                    "
                                                    id="allCheckResult"
                                                    size="1"
                                                    onchange="changeAllCheckResult(this.value);"
                                                >
                                                    <option value=" ">
                                                        --无--
                                                    </option>
                                                    <!-- 默认全OK -->
                                                    <option
                                                        value="OK"
                                                        selected="selected"
                                                    >
                                                        OK
                                                    </option>
                                                    <!-- 默认全OK -->
                                                    <option value="NG">
                                                        NG
                                                    </option>
                                                    <!-- add by rentx 20210630 start -->
                                                    <option value="医院放弃">
                                                        医院放弃
                                                    </option>
                                                    <!-- add by rentx 20210630 end -->
                                                </select>
                                            </td>
                                            <td width="500px">&nbsp;</td>
                                        </tr>
                                    </table>
                                    <!-- TODO minus scroll with -->
                                    <table
                                        id="AssetTableHeader"
                                        class="list"
                                        style="
                                            border-bottom-width: 0px;
                                            font-size: 13px;
                                        "
                                        border="0"
                                        cellspacing="0"
                                        cellpadding="0"
                                    >
                                        <tr
                                            style="
                                                border-bottom: 1px groove
                                                    rgba(254, 254, 254, 0.48);
                                                background: #f2f3f3;
                                            "
                                        >
                                            <!-- add by rentx 20210809  -->
                                            <th
                                                class="headerCell"
                                                style="width: 14px"
                                            >
                                                <apex:inputCheckbox
                                                    id="checkAll1"
                                                    onclick="checkAll(this)"
                                                />
                                            </th>
                                            <!-- <th class="headerCell" style="width:14px" /> -->
                                            <!-- add by rentx 202120809  -->
                                            <th
                                                class="headerCell"
                                                style="width: 24px"
                                            />
                                            <th
                                                class="headerCell"
                                                style="width: 60px"
                                            >
                                                {!$ObjectType.Asset.fields.Asset_situation__c.label}
                                            </th>
                                            <th class="headerCell">
                                                {!$ObjectType.Asset.fields.Name.label}
                                            </th>
                                            <th
                                                class="headerCell"
                                                style="width: 100px"
                                            >
                                                {!$ObjectType.Inspection_Item__c.Fields.SerialNumber__c.Label}
                                            </th>
                                            <!-- TODO 項目の作成 -->
                                            <th
                                                class="headerCell"
                                                style="width: 80px"
                                            >
                                                上次点检日
                                            </th>
                                            <th
                                                class="headerCell"
                                                style="width: 100px"
                                            >
                                                上次修理完毕日
                                            </th>
                                            <th
                                                class="headerCell"
                                                style="width: 80px"
                                            >
                                                {!$ObjectType.Inspection_Item__c.Fields.ItemStatus__c.Label}
                                            </th>
                                            <th
                                                class="headerCell"
                                                style="width: 100px"
                                            >
                                                {!$ObjectType.Inspection_Item__c.Fields.Fault_Classification1__c.Label}
                                            </th>
                                            <th
                                                class="headerCell"
                                                style="width: 100px"
                                            >
                                                {!$ObjectType.Inspection_Item__c.Fields.Fault_Classification2__c.Label}
                                            </th>
                                            <th
                                                class="headerCell"
                                                style="width: 100px"
                                            >
                                                {!$ObjectType.Inspection_Item__c.Fields.Fault_Classification3__c.Label}
                                            </th>
                                            <th
                                                class="headerCell"
                                                style="width: 100px"
                                            >
                                                {!$ObjectType.Inspection_Item__c.Fields.Diagnosis__c.Label}
                                            </th>
                                            <!-- add by rentx 20210630  -->
                                            <th
                                                class="headerCell"
                                                style="width: 85px"
                                            >
                                                {!$ObjectType.Inspection_Item__c.Fields.Abandonment_Reasons__c.Label}
                                            </th>
                                            <!-- add by rentx 20210630 -->
                                            <th
                                                class="headerCell"
                                                style="width: 35px"
                                            >
                                                {!$ObjectType.Asset.Fields.Create_repair__c.Label}
                                            </th>
                                            <!--                                 <td class="headerScroll"></td> -->
                                        </tr>
                                    </table>
                                    <div
                                        style="
                                            height: 400px;
                                            width: 100%;
                                            overflow: auto;
                                        "
                                    >
                                        <table
                                            style="
                                                border-collapse: collapse;
                                                width: 100%;
                                            "
                                            id="AssetTable"
                                        >
                                            <apex:variable
                                                value="{!1}"
                                                var="cnt"
                                            />
                                            <apex:repeat
                                                value="{!checkedInfoList}"
                                                var="cInfo"
                                                id="CheckedInfoList"
                                            >
                                                <tr
                                                    style="
                                                        border-bottom: 1px
                                                            groove
                                                            rgba(
                                                                254,
                                                                254,
                                                                254,
                                                                0.48
                                                            );
                                                    "
                                                >
                                                    <td style="width: 14px">
                                                        <apex:inputCheckbox
                                                            value="{!cInfo.rec_checkBox_c}"
                                                            id="AssetRowCheckbox1"
                                                            rendered="{!Not(cInfo.IsManual)}"
                                                        />
                                                        <apex:outputText
                                                            value="{!cInfo.IsManual}"
                                                            id="IsManual"
                                                            style="
                                                                display: none;
                                                            "
                                                        />
                                                        <input
                                                            type="hidden"
                                                            value="{!cInfo.rec.Id}"
                                                            id="CheckAssetId"
                                                        />
                                                    </td>
                                                    <td
                                                        style="
                                                            font-weight: bold;
                                                            text-align: right;
                                                            width: 24px;
                                                        "
                                                    >
                                                        {!cnt}
                                                    </td>
                                                    <td
                                                        class="dataCell"
                                                        style="width: 60px"
                                                    >
                                                        <apex:outputField
                                                            value="{!cInfo.rec.Asset_situation__c}"
                                                        />
                                                    </td>
                                                    <td class="dataCell">
                                                        <!-- HWAG-BDCA9J 添加了 onclick blurProduct 内容 start-->
                                                        <apex:outputField
                                                            value="{!cInfo.rec.Name}"
                                                            rendered="{!Not(cInfo.IsManual)}"
                                                        />
                                                        <apex:inputField
                                                            value="{!cInfo.ah.Product_Manual__c}"
                                                            id="Assert"
                                                            style="width: 100%"
                                                            rendered="{!cInfo.IsManual}"
                                                            onclick="if(!blurProduct(this))return false;"
                                                        />
                                                        <!-- HWAG-BDCA9J 添加了 onclick  blurProduct 内容 end-->
                                                    </td>
                                                    <td
                                                        class="dataCell"
                                                        style="width: 100px"
                                                    >
                                                        <apex:outputField
                                                            value="{!cInfo.ah.SerialNumber__c}"
                                                            rendered="{!Not(cInfo.IsManual)}"
                                                        />
                                                        <apex:inputField
                                                            value="{!cInfo.ah.SerialNo_Manual__c}"
                                                            id="SerialNo"
                                                            style="width: 90%"
                                                            rendered="{!cInfo.IsManual}"
                                                        />
                                                    </td>
                                                    <td
                                                        class="dataCell"
                                                        style="width: 80px"
                                                    >
                                                        <apex:outputField
                                                            value="{!cInfo.rec.Final_Examination_Date__c}"
                                                            rendered="{!Not(cInfo.IsManual)}"
                                                        />
                                                    </td>
                                                    <td
                                                        class="dataCell"
                                                        style="width: 100px"
                                                    >
                                                        <apex:outputField
                                                            value="{!cInfo.rec.After_repair_last_internal_check_day__c}"
                                                            rendered="{!Not(cInfo.IsManual)}"
                                                        />
                                                    </td>
                                                    <td
                                                        class="dataCell"
                                                        style="width: 80px"
                                                    >
                                                        <apex:inputField
                                                            value="{!cInfo.ah.ItemStatus__c}"
                                                            id="AssetRowCheckboxIsNormal"
                                                            style="width: 98%"
                                                        />
                                                    </td>
                                                    <td
                                                        class="dataCell"
                                                        style="width: 100px"
                                                    >
                                                        <apex:inputField
                                                            value="{!cInfo.ah.Fault_Classification1__c}"
                                                        />
                                                    </td>
                                                    <td
                                                        class="dataCell"
                                                        style="width: 100px"
                                                    >
                                                        <apex:inputField
                                                            value="{!cInfo.ah.Fault_Classification2__c}"
                                                            id="cat2"
                                                        />
                                                    </td>
                                                    <td
                                                        class="dataCell"
                                                        style="width: 100px"
                                                    >
                                                        <apex:inputField
                                                            value="{!cInfo.ah.Fault_Classification3__c}"
                                                            id="cat3"
                                                        />
                                                    </td>
                                                    <td
                                                        class="dataCell"
                                                        style="width: 100px"
                                                    >
                                                        <apex:inputField
                                                            value="{!cInfo.ah.Diagnosis__c}"
                                                            style="width: 93%"
                                                        />
                                                    </td>
                                                    <!-- add by rentx 20210630 -->
                                                    <td
                                                        class="dataCell"
                                                        style="width: 85px"
                                                    >
                                                        <apex:inputField
                                                            value="{!cInfo.ah.Abandonment_Reasons__c}"
                                                            style="width: 93%"
                                                        />
                                                    </td>
                                                    <!-- add by rentx 20210630 -->
                                                    <td
                                                        class="dataCell"
                                                        style="width: 35px"
                                                    >
                                                        <apex:outputPanel
                                                            layout="none"
                                                            rendered="{!Not(cInfo.IsManual)}"
                                                        >
                                                            <a
                                                                href="#"
                                                                onclick="saveByRepairJs('{!cInfo.rec.Id}', '{!JSENCODE(cInfo.rec.Name)}', '{!cInfo.rec.Hospital__r.Id}', '{!JSENCODE(cInfo.rec.Hospital__r.Name)}', '{!cInfo.rec.Department_Class__r.Id}', '{!JSENCODE(cInfo.rec.Department_Class__r.Name)}', '{!cInfo.rec.Account.Id}', '{!JSENCODE(cInfo.rec.Account.Name)}', '只修理');"
                                                                >■</a
                                                            >
                                                        </apex:outputPanel>
                                                    </td>
                                                </tr>
                                                <apex:variable
                                                    value="{!cnt + 1}"
                                                    var="cnt"
                                                />
                                            </apex:repeat>
                                        </table>
                                    </div>
                                </apex:outputPanel>
                            </apex:pageBlockSection>
                            <apex:outputPanel id="ButtonPanel">
                                <table style="width: 100%">
                                    <tr>
                                        <td>
                                            <apex:commandButton
                                                value="行追加"
                                                action="{!addNewRows}"
                                                disabled="{!Not($ObjectType.Inspection_Item__c.createable)}"
                                                style="
                                                    margin-left: 10px;
                                                    float: left;
                                                "
                                                onclick="blockme();"
                                                oncomplete="unblockUI();"
                                                rerender="Form"
                                            />
                                            <apex:commandButton
                                                value="刷新选中的保有设备"
                                                onclick="exchangeAssetJs();return false;"
                                                rerender="dummy"
                                            />
                                            <!-- <apex:commandButton value="刷新选中的保有设备" action="{!exchangeAsset}" onclick="blockme();" oncomplete="unblockUI();" rerender="Form" /> -->
                                            <!--                                 <apex:commandButton value="刷新医院下的全部保有设备" action="{!getAssetFromHp}" onclick="blockme();" oncomplete="unblockUI();" rerender="Form" /> -->
                                        </td>
                                    </tr>
                                </table>
                            </apex:outputPanel>
                            <table>
                                <tr>
                                    <td>
                                        <div
                                            id="ErrorName"
                                            style="
                                                color: red;
                                                font-weight: bold;
                                            "
                                        >
                                            {!alertMessage}
                                        </div>
                                    </td>
                                </tr>
                            </table>
                            <!-- HWAG-B4Q3G5 20180918Start -->
                            <apex:pageBlockSection
                                title="未选保有设备字段历史"
                                columns="1"
                                id="UnCheckSection"
                                onkeydown="if(event.keyCode==13){searchJs(); return false;}"
                            >
                                <!-- HWAG-B4Q3G5 20180918End -->
                                <input
                                    type="hidden"
                                    id="ProductCnt2"
                                    value="{!productCount2}"
                                />
                                <apex:outputPanel>
                                    <div align="center">
                                        <apex:outputPanel id="countorder"
                                            >第{!countorder}页</apex:outputPanel
                                        >
                                        <apex:commandButton
                                            value="上一页"
                                            action="{!UpPage}"
                                            onclick="blockme();"
                                            disabled="{!IF(countorder=1,true,false)}"
                                            oncomplete="unblockUI();"
                                            reRender="Form"
                                        />
                                        <apex:commandButton
                                            value="下一页"
                                            action="{!DownPage}"
                                            onclick="blockme();"
                                            disabled="{!IF(countorder >=nowAssetcount ,true,false)}"
                                            oncomplete="unblockUI();"
                                            rerender="Form"
                                        />
                                        <apex:outputPanel id="NowOrdercount"
                                            >共{!nowAssetcount}页</apex:outputPanel
                                        >
                                    </div>
                                    <table>
                                        <tr>
                                            <td
                                                style="width: 85px"
                                                align="right"
                                            >
                                                选择条件
                                            </td>
                                            <td
                                                style="width: 85px"
                                                align="right"
                                            >
                                                <apex:selectList
                                                    value="{!text1}"
                                                    id="text1"
                                                    size="1"
                                                    style="width: 80px"
                                                    ><apex:selectOptions
                                                        value="{!textOpts}"
                                                /></apex:selectList>
                                            </td>
                                            <td
                                                style="width: 85px"
                                                align="center"
                                            >
                                                <apex:selectList
                                                    value="{!cond1}"
                                                    id="cond1"
                                                    size="1"
                                                    style="width: 80px"
                                                    ><apex:selectOptions
                                                        value="{!equalOpts}"
                                                /></apex:selectList>
                                            </td>
                                            <td
                                                style="width: 95px"
                                                align="left"
                                            >
                                                <apex:inputText
                                                    value="{!val1}"
                                                    id="val1"
                                                    style="width: 100px"
                                                />
                                            </td>
                                            <td align="left">
                                                &nbsp;&nbsp;&nbsp;&nbsp;
                                                <apex:commandButton
                                                    value="检索"
                                                    onclick="searchJs();return false;"
                                                    style="width: 130px"
                                                    rerender="dummy"
                                                />
                                                &nbsp;&nbsp;
                                                <apex:commandButton
                                                    value="清除条件"
                                                    onclick="clearAndSearch();"
                                                    style="width: 130px"
                                                    rerender="dummy"
                                                />
                                                &nbsp;&nbsp;
                                                <span
                                                    style="
                                                        vertical-align: text-bottom;
                                                    "
                                                    >使用中<apex:inputCheckBox
                                                        value="{!activeOn}"
                                                /></span>
                                            </td>
                                        </tr>
                                    </table>
                                    <table
                                        style="border-collapse: collapse"
                                        id="AssetTable2"
                                    >
                                        <tr
                                            style="
                                                border-bottom: 1px groove
                                                    rgba(254, 254, 254, 0.48);
                                                background: #f2f3f3;
                                            "
                                        >
                                            <!-- add by rentx 20210809 start 全选功能  -->
                                            <!-- <th class="headerCell" style="width:25px"></th> -->
                                            <th
                                                class="headerCell"
                                                style="
                                                    padding: 2px 5px;
                                                    width: 25px;
                                                "
                                            >
                                                <apex:inputCheckbox
                                                    id="checkAll1"
                                                    onclick="checkAll2(this)"
                                                />
                                            </th>
                                            <!-- add by rentx 20210809 end 全选功能  -->
                                            <th
                                                class="headerCell"
                                                style="width: 70px"
                                            >
                                                <a
                                                    href="#"
                                                    onclick="sortTableJs('0');return false;"
                                                    style="
                                                        text-decoration: underline;
                                                    "
                                                    >{!$ObjectType.Asset.fields.Asset_situation__c.label}</a
                                                >{!sortOrder[0]}
                                            </th>
                                            <th class="headerCell">
                                                <a
                                                    href="#"
                                                    onclick="sortTableJs('1');return false;"
                                                    style="
                                                        text-decoration: underline;
                                                    "
                                                    >{!$ObjectType.Asset.fields.Name.label}</a
                                                >{!sortOrder[1]}
                                            </th>
                                            <th
                                                class="headerCell"
                                                style="width: 70px"
                                            >
                                                <a
                                                    href="#"
                                                    onclick="sortTableJs('2');return false;"
                                                    style="
                                                        text-decoration: underline;
                                                    "
                                                    >{!$ObjectType.Asset.fields.SerialNumber.label}</a
                                                >{!sortOrder[2]}
                                            </th>
                                            <th
                                                class="headerCell"
                                                style="width: 70px"
                                            >
                                                <a
                                                    href="#"
                                                    onclick="sortTableJs('3');return false;"
                                                    style="
                                                        text-decoration: underline;
                                                    "
                                                    >{!$ObjectType.Asset.fields.CurrentContract__c.label}</a
                                                >{!sortOrder[3]}
                                            </th>
                                            <th
                                                class="headerCell"
                                                style="width: 70px"
                                            >
                                                <a
                                                    href="#"
                                                    onclick="sortTableJs('4');return false;"
                                                    style="
                                                        text-decoration: underline;
                                                    "
                                                    >{!$ObjectType.Asset.fields.Department_Name__c.label}</a
                                                >{!sortOrder[4]}
                                            </th>
                                            <th
                                                class="headerCell"
                                                style="width: 70px"
                                            >
                                                <a
                                                    href="#"
                                                    onclick="sortTableJs('5');return false;"
                                                    style="
                                                        text-decoration: underline;
                                                    "
                                                    >{!$ObjectType.Asset.fields.Status.label}</a
                                                >{!sortOrder[5]}
                                            </th>
                                            <th
                                                class="headerCell"
                                                style="width: 90px"
                                            >
                                                <a
                                                    href="#"
                                                    onclick="sortTableJs('6');return false;"
                                                    style="
                                                        text-decoration: underline;
                                                    "
                                                    >{!$ObjectType.Asset.fields.Installation_Site__c.label}</a
                                                >{!sortOrder[6]}
                                            </th>
                                            <th
                                                class="headerCell"
                                                style="width: 90px"
                                            >
                                                <a
                                                    href="#"
                                                    onclick="sortTableJs('7');return false;"
                                                    style="
                                                        text-decoration: underline;
                                                    "
                                                    >{!$ObjectType.Asset.fields.Room_Number__c.label}</a
                                                >{!sortOrder[7]}
                                            </th>
                                            <th
                                                class="headerCell"
                                                style="width: 90px"
                                            >
                                                <a
                                                    href="#"
                                                    onclick="sortTableJs('8');return false;"
                                                    style="
                                                        text-decoration: underline;
                                                    "
                                                    >{!$ObjectType.Asset.fields.InstallDate.label}</a
                                                >{!sortOrder[8]}
                                            </th>
                                            <th
                                                class="headerCell"
                                                style="width: 90px"
                                            >
                                                <a
                                                    href="#"
                                                    onclick="sortTableJs('9');return false;"
                                                    style="
                                                        text-decoration: underline;
                                                    "
                                                    >{!$ObjectType.Asset.fields.Asset_Owner__c.label}</a
                                                >{!sortOrder[9]}
                                            </th>
                                            <th
                                                class="headerCell"
                                                style="width: 90px"
                                            >
                                                <a
                                                    href="#"
                                                    onclick="sortTableJs('10');return false;"
                                                    style="
                                                        text-decoration: underline;
                                                    "
                                                    >{!$ObjectType.Asset.fields.Accumulation_Repair_Amount__c.label}</a
                                                >{!sortOrder[10]}
                                            </th>
                                        </tr>
                                        <apex:variable value="{!1}" var="cnt" />
                                        <apex:variable
                                            value="{!0}"
                                            var="cntOut"
                                        />
                                        <apex:repeat
                                            value="{!IF(ThousandFLG>0,unCheckedInfoListForThousend,1)}"
                                            var="Thoinfo"
                                            id="unCheckedInfoListForThousend"
                                        >
                                            <apex:repeat
                                                value="{!IF(ThousandFLG>0,Thoinfo,unCheckedInfoList)}"
                                                var="ucInfo"
                                                id="UnCheckedInfoList"
                                            >
                                                <tr
                                                    style="
                                                        border-bottom: 1px
                                                            groove
                                                            rgba(
                                                                254,
                                                                254,
                                                                254,
                                                                0.48
                                                            );
                                                    "
                                                >
                                                    <td
                                                        style="
                                                            padding: 2px 5px;
                                                            width: 25px;
                                                        "
                                                    >
                                                        <apex:inputCheckbox
                                                            value="{!ucInfo.rec_checkBox_c}"
                                                            id="AssetRowCheckbox2"
                                                        />
                                                        <input
                                                            type="hidden"
                                                            value="{!ucInfo.rec.Id}"
                                                            id="UncheckAssetId"
                                                        />
                                                    </td>
                                                    <td
                                                        style="
                                                            padding: 2px 5px;
                                                            width: 70px;
                                                        "
                                                    >
                                                        <apex:outputField
                                                            value="{!ucInfo.rec.Asset_situation__c}"
                                                        />
                                                    </td>
                                                    <td
                                                        style="padding: 2px 5px"
                                                    >
                                                        <a
                                                            href="#"
                                                            onclick="window.open('/{!ucInfo.rec.Id}', '_blank');"
                                                            >{!ucInfo.rec.Name}</a
                                                        >
                                                        <!--                                     <apex:outputField value="{!ucInfo.rec.name}" id="assetName"/> -->
                                                    </td>
                                                    <td
                                                        style="
                                                            padding: 2px 5px;
                                                            width: 70px;
                                                        "
                                                    >
                                                        <apex:outputField
                                                            value="{!ucInfo.rec.SerialNumber}"
                                                        />
                                                    </td>
                                                    <td
                                                        style="
                                                            padding: 2px 5px;
                                                            width: 70px;
                                                        "
                                                    >
                                                        <!--                                     <apex:outputField value="{!ucInfo.rec.CurrentContract__c}"/> -->
                                                        <a
                                                            href="#"
                                                            onclick="window.open('/{!ucInfo.rec.CurrentContract__c}', '_blank');"
                                                            >{!ucInfo.rec.CurrentContract__r.Management_Code__c}</a
                                                        >
                                                    </td>
                                                    <td
                                                        style="
                                                            padding: 2px 5px;
                                                            width: 70px;
                                                        "
                                                    >
                                                        <apex:outputField
                                                            value="{!ucInfo.rec.Department_Name__c}"
                                                        />
                                                    </td>
                                                    <td
                                                        style="
                                                            padding: 2px 5px;
                                                            width: 70px;
                                                        "
                                                    >
                                                        <apex:outputField
                                                            value="{!ucInfo.rec.Status}"
                                                        />
                                                    </td>
                                                    <td
                                                        style="
                                                            padding: 2px 5px;
                                                            width: 70px;
                                                        "
                                                    >
                                                        <apex:outputField
                                                            value="{!ucInfo.rec.Installation_Site__c}"
                                                        />
                                                    </td>
                                                    <td
                                                        style="
                                                            padding: 2px 5px;
                                                            width: 70px;
                                                        "
                                                    >
                                                        <apex:outputField
                                                            value="{!ucInfo.rec.Room_Number__c}"
                                                        />
                                                    </td>
                                                    <td
                                                        style="
                                                            padding: 2px 5px;
                                                            width: 90px;
                                                            text-align: center;
                                                        "
                                                    >
                                                        <apex:outputField
                                                            value="{!ucInfo.rec.InstallDate}"
                                                        />
                                                    </td>
                                                    <td
                                                        style="
                                                            padding: 2px 5px;
                                                            width: 90px;
                                                        "
                                                    >
                                                        <apex:outputField
                                                            value="{!ucInfo.rec.Asset_Owner__c}"
                                                        />
                                                    </td>
                                                    <td
                                                        style="
                                                            padding: 2px 5px;
                                                            width: 90px;
                                                            text-align: center;
                                                        "
                                                    >
                                                        <apex:outputField
                                                            value="{!ucInfo.rec.Accumulation_Repair_Amount__c}"
                                                        />
                                                    </td>
                                                </tr>
                                                <apex:variable
                                                    value="{!cnt + 1}"
                                                    var="cnt"
                                                />
                                            </apex:repeat>
                                            <apex:variable
                                                value="{!cntOut + 1}"
                                                var="cntOut"
                                            />
                                        </apex:repeat>
                                    </table>
                                </apex:outputPanel>
                            </apex:pageBlockSection>
                            <!-- fxk 2021/8/4 新加 Start-->
                            <apex:pageBlockSection
                                title="打印时洗消信息"
                                columns="1"
                                id="UnCheckSection1"
                            >
                                <apex:outputPanel>
                                    <table
                                        class="edittable"
                                        border="0"
                                        style="
                                            border-collapse: collapse;
                                            width: 600px;
                                            table-layout: fixed;
                                        "
                                    >
                                        <tr>
                                            <td>
                                                {!$ObjectType.Inspection_Report__c.fields.CleaningFluid__c.Label}:
                                            </td>
                                            <td>
                                                <apex:inputField
                                                    value="{!ir.CleaningFluid__c}"
                                                    style="width: 90%"
                                                />
                                            </td>
                                            <!-- 方式  add by rentx 20210927 start-->
                                            <td>
                                                {!$ObjectType.Inspection_Report__c.fields.Mode__c.Label}:
                                            </td>
                                            <td>
                                                <apex:inputField
                                                    value="{!ir.Mode__c}"
                                                    style="width: 90%"
                                                />
                                            </td>
                                            <!-- 方式 add by rentx 20210927 end -->
                                            <td>
                                                {!$ObjectType.Inspection_Report__c.fields.SterilizationMethod__c.Label}:
                                            </td>
                                            <td>
                                                <apex:inputField
                                                    value="{!ir.SterilizationMethod__c}"
                                                    style="width: 90%"
                                                />
                                            </td>
                                            <td>
                                                {!$ObjectType.Inspection_Report__c.fields.Remarks__c.Label}:
                                            </td>
                                            <td>
                                                <apex:inputText
                                                    value="{!ir.Remarks__c}"
                                                    style="width: 90%"
                                                />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                {!$ObjectType.Inspection_Report__c.fields.Disinfectant__c.Label}:
                                            </td>
                                            <td>
                                                <apex:inputField
                                                    value="{!ir.Disinfectant__c}"
                                                    style="width: 90%"
                                                />
                                            </td>
                                            <td>
                                                {!$ObjectType.Inspection_Report__c.fields.UsedMachine__c.Label}:
                                            </td>
                                            <td>
                                                <apex:inputField
                                                    value="{!ir.UsedMachine__c}"
                                                    style="width: 90%"
                                                />
                                            </td>
                                            <td>
                                                {!$ObjectType.Inspection_Report__c.fields.Used_ET__c.Label}:
                                            </td>
                                            <td>
                                                <apex:inputText
                                                    value="{!ir.Used_ET__c}"
                                                    style="width: 90%"
                                                />
                                            </td>
                                        </tr>
                                    </table>
                                </apex:outputPanel>
                            </apex:pageBlockSection>
                            <!-- fxk 2021/8/4 新加 End-->
                        </div>
                    </apex:pageBlock>
                </div>
                <script type="text/javascript">
                    // 已签字の場合、変更不能にする
                    var status = '{!ir.Status__c}';
                    if (status == '申请中' || status == '批准') {
                        var inputs = document.getElementsByTagName('input');
                        for (var i = 0; i < inputs.length; i++) {
                            var obj = inputs[i];
                            if (obj.id == 'Page:Form:Block:closeButton')
                                continue;
                            //if (obj.id == "Page:Form:Block:submitButton") continue;
                            //if (status == "已签字" && obj.id == "Page:Form:Block:submitButton") continue;
                            if (obj.type == 'button') {
                                setButtonDisable(obj, true);
                            } else {
                                obj.disabled = true;
                            }
                        }
                        var selects = document.getElementsByTagName('select');
                        console.log(selects);
                        for (var i = 0; i < selects.length; i++) {
                            selects[i].disabled = true;
                        }
                    } else {
                        //var smb = j$(escapeVfId("Page:Form:Block:submitButton"))[0];
                        //setButtonDisable(smb, true);
                    }
                    // HWAG-BDCA9J 提醒未保存和刷新前不能选择产品 start
                    function blurProduct(obj) {
                        var irID = '{!ir.Id}';
                        var productCount2 = '{!productCount2}';
                        if (!irID && productCount2 == 0) {
                            alert(
                                '请先输入医院并点击刷新按钮调出保有设备,否则点检结果无法与设备关联。'
                            );
                            obj.blur();
                            return false;
                        }
                        return true;
                    }
                    // HWAG-BDCA9J 提醒未保存和刷新前不能选择产品 end
                </script>
            </apex:form>
        </body>
    </html>
</apex:page>