zhangzhengmei
2023-04-25 c427566ba3a33dfc5d59eb59fbadec8b6443c9cb
点检计划->打印筛选条件页面 修改
2个文件已添加
407 ■■■■■ 已修改文件
force-app/main/default/pages/PrintInspectupReport.page 400 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/PrintInspectupReport.page-meta.xml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/pages/PrintInspectupReport.page
New file
@@ -0,0 +1,400 @@
<apex:page id="allPage" showHeader="false" sidebar="false" controller="PrintInspectupReportController" applyBodyTag="false" applyHtmlTag="false" action="{!init}" pageStyle="PageStyleCss" lightningStylesheets="true">
<html>
<head>
    <title>打印筛选条件</title>
    <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
    <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
    <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
<!-- css -->
<style type="text/css">
    /*以下是下拉复选框的样式  start*/
    * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body {
            position: relative;
        }
        ul,
        li {
            list-style: none;
        }
        .nav_1st {
            width: 300px;
            height: 32px;
            line-height: 32px;
            padding: 5px 30px 5px 5px;
            border: 1px solid #c9c9c9;
            background-size: 5%;
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            user-select: none;
            margin: 0 auto;
        }
        .nav {
            width: 300px;
            line-height: 20px;
            border: 1px solid #c9c9c9;
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            user-select: none;
            position: absolute;
            top: 30px;
            right: 0;
            left: 0;
            margin: 10px 0 0 94px;
            z-index: 9999;
            display: none;
        }
        .nav_close {
            position: fixed;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
            z-index: 9990;
            display: none;
        }
        .nav li input {
            margin: 0px 3px 0px 3px;
        }
        .nav li p:hover {
            background: #1e90ff;
            color: #fff;
        }
        #classification {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
    /*以下是下拉复选框的样式  start*/
</style>
<!-- js -->
<script type="text/javascript">
    //下拉多选框  strat
     window.onload = () => {
           j$(".nav_1st").click(function () {
                j$(".nav,.nav_close").toggle();
            });
            j$(".nav_close").click(function () {
                j$(".nav,.nav_close").hide();
            });
            j$(".li-input").click(function () {
                var checked2 = j$(this).prop("checked");
                if (checked2 == true) {
                    j$(this).prop("checked", false);
                } else {
                    j$(this).prop("checked", true);
                }
            });
            j$(".ul-nav").click(function () {
                var checked1 = j$(this).children("input").prop("checked");
                if (checked1 == false) {
                    j$("#classification").children("#initial").remove();
                    j$(this).children("input").prop("checked", true);
                    j$("#classification").append("<span class='valClass' id='" + (j$(this).children("input")[0].value.trim()) + "'>" + (j$(this)
                        .text().trim() + ",") + "</span>");
                } else {
                    j$(this).children("input").prop("checked", false);
                    j$("#classification").children("#" + (j$(this).children("input")[0].value.trim())).remove();
                    var length = j$("#classification").html().length;
                    if (length === 0) {
                        j$("#classification").append("<span class='valClass' id='initial'>--无--</span>");
                    }
                }
                var optioncheck = j$(".valClass");
                var hint = '';
                for(var i = 0;i<optioncheck.length;i++){
                    hint +=optioncheck[i].innerText;
                }
                j$("#valId").attr("title",hint);
            });
        }
    //生成pdf
    function createPDFJs(){
        //blockme();
        //计数使用,用于判断选择的点检是否超过4个
        var index = 0;
        var strId = '';
        var lawtable = document.getElementById("tableHeader_L");//获取id为tableHeader_L的table
        var rows = lawtable.rows;//获取所有行
        //循环获取所有选中的点检
        for(var i=1; i < rows.length; i++){
            var row = rows[i];//获取每一行
            var getChecked = row.cells[2].getElementsByTagName("input")[0].checked;//获取复选框是否选中
            if(getChecked){
                //不能超过4条数据
                if(index < 4){
                    index++;
                    if(strId == ''){
                        strId = row.cells[2].getElementsByTagName("input")[0].id;//获取选中的复选框id
                    }else{
                        strId += ','+row.cells[2].getElementsByTagName("input")[0].id;//获取选中的复选框id
                    }
                }else{
                    alert('选择的点检不能超过4条!');
                    return;
                }
            }
        }
        var parameter = '';
        //加生成类型条件
        var produceTypeVal = document.getElementById('allPage:allForm:allBlock:paymentPlan1:isResultShow').value;
        parameter = produceTypeVal;
        //保有设备的类型
        var assetType = document.getElementById('allPage:allForm:allBlock:paymentPlan1:selectAssetType').value;
        parameter += ',,'+assetType;
        //保有设备 内容
        var assetStr = '';
        var assetList = j$("#classification").children();
        if(j$("#classification").children().text().trim() != '--无--'){
            for(var i = 0;i < assetList.length;i++){
                if(j$("#classification").children()[i].id != '' && j$("#classification").children()[i].id != null){
                    if(assetStr == ''){
                        assetStr = assetList[i].id;
                    }else{
                        assetStr += ','+assetList[i].id;
                    }
                }
            }
        }
        parameter += ',,'+assetStr;
        //是否分页
        var isPaging = document.getElementById('allPage:allForm:allBlock:paymentPlan1:isPaging').checked;
        parameter += ',,'+isPaging;
        //+  洗消信息条件
        var falg = document.getElementById("allPage:allForm:allBlock:paymentPlan2:activeOnId").checked;
        parameter += ',,'+falg;
        //+  点检对象
        if(strId != ''){
            parameter += ',,'+strId;
        }else{
            alert('请选择点检计划!');
            return false;
        }
        //+  合id
        parameter += ',,' + '{!maintenanceContractId}';
        // 打印医院合同配置
        window.open('/apex/PrintInspectupReportPDF?parameter=' + parameter);
        window.close();
        //createPDF(parameter);
    }
    //全选
    function onCheckAllJS(Obj){
        if(!Obj.checked){
            Obj.checked = false;
            var lawtable = document.getElementById("tableHeader_L");//获取id为tableHeader_L的table
            var rows = lawtable.rows;//获取所有行
            for(var i=1; i < rows.length; i++){
                var row = rows[i];//获取每一行
                var getChecked = row.cells[3].getElementsByTagName("input")[0].checked;//获取复选框是否选中
                if(getChecked){
                    row.cells[3].getElementsByTagName("input")[0].checked = false;
                }
            }
        }else{
            Obj.checked = true;
            var lawtable = document.getElementById("tableHeader_L");//获取id为tableHeader_L的table
            var rows = lawtable.rows;//获取所有行
            for(var i=1; i < rows.length; i++){
                var row = rows[i];//获取每一行
                var getChecked = row.cells[3].getElementsByTagName("input")[0].checked;//获取复选框是否选中
                if(!getChecked){
                    row.cells[3].getElementsByTagName("input")[0].checked = true;
                }
            }
        }
    }
    //选择下拉框值有变动以后触发
    function selectAssetTypeJs(Obj){
        var selectId = Obj.value;
        //如果保有设备选择无
        if(selectId == '' || selectId == null){
            j$("#isPagingId").hide();
            j$("#selectCheckId").hide();
        }else{
            //消除选择的其他选项
            if(j$("#classification").children().text() != "--无--"){
                j$("#classification").children().remove();
                j$("#classification").append("<span class='valClass' id='initial'>--无--</span>");
            }
            var inputObj = j$(".li-input");
            if(inputObj != null){
                for(var i = 0; i < inputObj.length;i++){
                    if(inputObj[i].checked){
                        inputObj[i].checked = false;
                    }
                }
            }
            //是否分页设置成不勾选状态
            document.getElementById('allPage:allForm:allBlock:paymentPlan1:isPaging').checked = false;
            if(selectId == "4" || selectId == "0"){
                j$("#selectCheckId").hide();
                j$("#isPagingId").hide();
            }else{
                j$("#selectCheckId").show();
                j$("#isPagingId").show();
                if(selectId == "1"){
                    j$("#divId1").show();
                    j$("#divId2").hide();
                    j$("#divId3").hide();
                }
                if(selectId == "2"){
                    j$("#divId1").hide();
                    j$("#divId2").show();
                    j$("#divId3").hide();
                }
                if(selectId == "3"){
                    j$("#divId1").hide();
                    j$("#divId2").hide();
                    j$("#divId3").show();
                }
            }
        }
    }
</script>
</head>
<body>
    <apex:form styleClass="BlockSytle" id="allForm">
    <!-- 页面数据初始化方法 -->
    <apex:actionFunction name="init" action="{!init}" rerender="oppBlock1,message,checEventFrame" onComplete="unblockUI();"></apex:actionFunction>
    <div>
        <apex:pageBlock id="allBlock" >
            <apex:pageBlockSection id="paymentPlan1" title="选择条件1" columns="2">
                <apex:outputPanel >
               <table style="width:1000px;">
                    <tr style="">
                        <td style="width: 76px;float: left;line-height: 40px;">
                            <font>是否空白</font>&nbsp;
                        </td>
                        <td style="float: left;">
                            <apex:selectList value="{!isResultShow}" id="isResultShow" size="1" style="width:85px;min-width: 80px;">
                                <apex:selectOptions value="{!isResultShowLOption}"/>
                                &nbsp;
                            </apex:selectList>
                        </td>
                        <td style="width: 76px;float: left;line-height: 40px;">
                            <font>保有设备</font>&nbsp;
                        </td>
                        <td style="min-width: 400px;float: left;">
                            <apex:selectList value="{!selectAssetType}" id="selectAssetType" size="1" style="width:85px;min-width: 80px;float: left;" onchange="selectAssetTypeJs(this);return false;">
                                <apex:selectOptions value="{!selectAssetTypeOption}"/>
                            </apex:selectList>
                            &nbsp;&nbsp;
                            <div style="float: left;display: none;line-height: 32px;" id="selectCheckId">
                                <div class="nav_1st" id="valId" title="">
                                    <p id="classification" style="margin-top: -7px;"><span id="initial">--无--</span></p>
                                </div>
                                <ul class="nav" style="background-color: #FFFFFF;">
                                    <div id="divId1" style="display:">
                                        <!-- 战略科室下拉框 -->
                                        <apex:repeat value="{!strategyDepartment}" var="orr" id="selSD">
                                            <li class="sdclass" style="margin-left:0px">
                                                <p class="ul-nav" name="cate_id[]" >
                                                    <input type="checkbox" value="{!orr.parameterName}" class="li-input" style="display: inline-block;vertical-align: middle;" />
                                                    <font style="">{!orr.parameterName}</font>
                                                </p>
                                            </li>
                                        </apex:repeat>
                                    </div>
                                    <div id="divId2" style="display:">
                                        <!-- 科室下拉框 -->
                                        <apex:repeat value="{!department}" var="orrr" id="selD">
                                            <li class="dclass" style="margin-left:0px">
                                                <p class="ul-nav" name="cate_id[]" >
                                                    <input type="checkbox" value="{!orrr.parameterName}" class="li-input" style="display: inline-block;vertical-align: middle;"/>
                                                    <font style="">{!orrr.parameterName}</font></p>
                                            </li>
                                        </apex:repeat>
                                    </div>
                                    <div id="divId3" style="display:;">
                                        <apex:repeat value="{!installationSite}" var="orrrr" id="seliD">
                                            <li class="iclass" style="margin-left:0px">
                                                <p class="ul-nav" name="cate_id[]" >
                                                    <input type="checkbox" value="{!orrrr.parameterName}" class="li-input" style="display: inline-block;vertical-align: middle;"/><font style="">{!orrrr.parameterName}</font>
                                                </p>
                                            </li>
                                        </apex:repeat>
                                    </div>
                                </ul>
                                <div class="nav_close"></div>
                            </div>
                        </td>
                        <td style="float: left;display: none;line-height: 40px;" id="isPagingId">
                            <font>是否分页</font>&nbsp;
                            <apex:inputCheckBox value="{!isPaging}" id="isPaging" style="display: inline-block;vertical-align: middle;"/>
                        </td>
                    </tr>
                </table>
                </apex:outputPanel>
            </apex:pageBlockSection>
            <apex:pageBlockSection id="paymentPlan2" title="筛选条件2" columns="2">
                <apex:outputPanel >
                <table style="width:800px;">
                    <tr>
                         <td>
                            <span style="vertical-align: text-bottom;float: left;">
                                <font>洗消信息&nbsp;&nbsp;</font>
                                <apex:inputCheckBox value="{!activeOn}" id="activeOnId" style="display: inline-block;vertical-align: middle;"/>
                            </span>
                        </td>
                    </tr>
                </table>
                </apex:outputPanel>
            </apex:pageBlockSection>
            <apex:pageBlockSection id="paymentPlan3" title="筛选条件3" columns="1">
                <apex:outputPanel >
                <table class="list" style="font-size:11px;width: 100%;" border="" id="tableHeader_L" >
                    <thead>
                        <tr class="headerRow" height="30px"  align="center">
                            <!--标题 -->
                            <td style="">信息对象</td>
                            <td style="">最后点检日</td>
                            <td style="width:100px" colspan="1">
                                <!-- <input type="checkbox" name="reading" onchange="onCheckAllJS(this);return false;" id="checkAll"/> -->
                                勾选
                            </td>
                        </tr>
                    </thead>
                    <tbody>
                        <apex:variable value="{!0}" var="cnt" />
                            <apex:repeat value="{!inspectupPlanList}" var="or" id="oppTable">
                                <tr class="dataRow {!IF(MOD(cnt, 2)==0, 'odd', 'even')} {!IF(cnt==1, 'first', '')}" onmouseover="if (window.hiOn){hiOn(this);} " onmouseout="if (window.hiOff){hiOff(this);} "  onblur="if (window.hiOff){hiOff(this);}" onfocus="if (window.hiOn){hiOn(this);}">
                                    <td style="border-width: 0 0 0px 0;" align="center" >
                                        <apex:outputText value="{!or.Chack_Plan_NO__c}次点检" />
                                    </td>
                                    <td style="border-width: 0 0 0px 0;" align="center">
                                        <apex:outputfield value="{!or.Execution_End_Date__c}" />
                                    </td>
                                    <td align="center" style="border-width: 0 0 0px 0;" colspan="1">
                                        <input type="checkbox" name="reading" id="{!or.id}"/>
                                    </td>
                                </tr>
                            <apex:variable value="{!cnt + 1}" var="cnt" />
                        </apex:repeat>
                    </tbody>
                </table>
                </apex:outputPanel>
            </apex:pageBlockSection>
        </apex:pageBlock>
        <div style="width: 98%;">
            <apex:commandButton onclick="createPDFJs();return false;"  rendered="true" value="生成PDF" style="width:80px;float: right;"/>
        </div>
    </div>
    </apex:form>
</body>
</html>
</apex:page>
force-app/main/default/pages/PrintInspectupReport.page-meta.xml
New file
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexPage xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>45.0</apiVersion>
    <availableInTouch>false</availableInTouch>
    <confirmationTokenRequired>false</confirmationTokenRequired>
    <label>PrintInspectupReport</label>
</ApexPage>