D C
2023-08-07 5ddfce2bc1c37265902b8f61d6e1c298b94a7091
force-app/main/default/pages/RentalFixtureSetAssign.page
@@ -1,260 +1,191 @@
<apex:page lightningStylesheets="true" controller="RentalFixtureSetAssignController" showHeader="false" sidebar="false" id="allPage" action="{!init}">
<apex:page lightningStylesheets="true" controller="RentalFixtureSetAssignController" showHeader="false" sidebar="false" id="allPage" action="{!init}" >
<head>
<title>备品出借分配设备</title>
<apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
<apex:stylesheet value="{!URLFOR($Resource.RentalFixtureSetAssignCss)}"/>
<apex:stylesheet value="{!URLFOR($Resource.StyleUtilCss)}"/><!-- 20230619 ljh lightning  -->
<apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
<apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
<apex:includeScript value="{!URLFOR($Resource.RelationListPagingCmpJS)}"/>
<!-- <apex:includeScript value="{!URLFOR($Resource.connection20)}"/>
<apex:includeScript value="{!URLFOR($Resource.apex20)}"/> -->
<style type="text/css">
        .hideDropdown select{
            display: none
        }
        .modal {
           display:none;
           position: fixed; /* Stay in place */
           z-index: 10; /* Sit on top */
           left: 0;
           top: 0;
           width: 100%; /* Full width */
           height: 100%; /* Full height */
           overflow: auto; /* Enable scroll if needed */
           background-color: rgb(0,0,0); /* Fallback color */
           background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
        }
        span.dateFormat {
            display: none;
        }
    .hideDropdown select{
        display: none
    }
    .modal {
        display:none;
        position: fixed; /* Stay in place */
        z-index: 10; /* Sit on top */
        left: 0;
        top: 0;
        width: 100%; /* Full width */
        height: 100%; /* Full height */
        overflow: auto; /* Enable scroll if needed */
        background-color: rgb(0,0,0); /* Fallback color */
        background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
    }
    span.dateFormat {
        display: none;
    }
        /* Modal Content/Box */
        .modal-content {
           background-color: #fefefe;
           margin-left: 6px;
           margin-top: 100px;
           padding: 20px;
           border: 1px solid #888;
           right: 5%;
           position: absolute;
           width: 200px;
        }
        .modal-content-cancel {
           background-color: #fefefe;
           margin-left: -150px;
           margin-top: 100px;
           padding: 20px;
           border: 1px solid #888;
           left: 50%;
           position: absolute;
           width: 300px;
        }
    /* Modal Content/Box */
    .modal-content {
        background-color: #fefefe;
        margin-left: 6px;
        margin-top: 100px;
        padding: 20px;
        border: 1px solid #888;
        right: 5%;
        position: absolute;
        width: 200px;
    }
    .modal-content-cancel {
        background-color: #fefefe;
        margin-left: -150px;
        margin-top: 100px;
        padding: 20px;
        border: 1px solid #888;
        left: 50%;
        position: absolute;
        width: 300px;
    }
    /* 20230606 ljh lightning start */
    body .detailList .dataCol input[type="text"],body .detailList .dataCol select{
        min-width: 180px;
    }
    /* body .bPageBlock .detailList .dataCol{
        width: 8%;
    } */
    body .bPageBlock .detailList .dataCol input[type="checkbox"]:first-child{
        margin-top: 0;
    }
    body .detailList td{
        position: static;
    }
    /*以下是下拉复选框的样式  start*/
    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }
    .nav {
        width: 180px;/*20230606 ljh*/
        line-height: 30px;/*20230606 ljh*/
        /* border: 1px solid #000; *//*20230610 ljh*/
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        position: absolute;
        top: 0;
        right: 0;
        left: 0;
        margin: 0;
        /* z-index: 9999; */
        z-index: 2;
        display: inline-block;
        border-radius: 0.25rem;/*20230607 ljh lightning*/
        border: 1px solid rgb(201, 201, 201);/*20230610 ljh lightning*/
    }
    ul,li {
        list-style: none;
    }
    .nav li input {
        margin: 0px 3px 0px 3px;
    }
        body {
            position: relative;
        }
        ul,
        li {
            list-style: none;
        }
        .nav_1st {
            width: 180px;
            height: 6px;
            line-height: 20px;
            padding: 5px 30px 5px 5px;
            border: 1px solid #000;
            background-color: rgb(255, 255, 255);
            background-size: 5%;
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            user-select: none;
            margin: 0 auto;
        }
        .nav_1st0 {
            width: 160px;
            height: 6px;
            margin-left: 19px;
            line-height: 20px;
            padding: 5px 30px 5px 5px;
            background-color: rgb(255, 255, 255);
            border: 1px solid #000;
            background-size: 5%;
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            user-select: none;
            margin: 0 auto;
        }
        .nav {
            width: 180px;
            line-height: 20px;
            border: 1px solid #000;
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            user-select: none;
            position: absolute;
            top: 11.4rem;
            z-index: 9999;
            display: none;
        }
        .nav0 {
            width: 160px;
            line-height: 20px;
            border: 1px solid #000;
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            user-select: none;
            position: absolute;
            top: 9.5rem;
            z-index: 9999;
            display: none;
        }
        .nav_close {
            position: fixed;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
            z-index: 9990;
            display: none;
        }
        .nav_close0 {
            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;
        }
        .nav0 li input {
            margin: 0px 3px 0px 3px;
        }
        .nav0 li p:hover {
            background: #1e90ff;
            color: #fff;
        }
        #classification {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        #classification0 {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
    .nav li p:hover {
        background: #1e90ff;
        color: #fff;
    }
    #classification_f,#classification_b {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
</style>
<script type="text/javascript">
var heightAjustment = 120;
var widthAjustment = 30;
var clickLineNo;
var iszhu;
window.onload = () => {
   j$(".nav_1st").click(function () {
        j$(".nav,.nav_close").toggle();
    });
   j$(".nav_1st0").click(function () {
        j$(".nav0,.nav_close0").toggle();
    });
    j$(".nav_close").click(function () {
        j$(".nav,.nav_close").hide();
    });
    j$(".nav_close0").click(function () {
        j$(".nav0,.nav_close0").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);
// 20230607 ljh lightning start
j$(document).bind("click",function(e){
    var e = e || window.event;    //事件对象,兼容IE
    var target = e.target || e.srcElement;  //源对象,兼容火狐和IE
    while(target){
        // console.log(target.id);
        if (target.id && (target.id == "nav_f" ||target.id == "nav_b")){
            //循环判断至根节点,防止点击的是#selected和它的子元素
            return;
        }
    });
    j$(".ul-nav").click(function () {
        var checked1 = j$(this).children("input").prop("checked");
        console.log('checked1***',checked1);
        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().replace('.','')) + "'>" + (j$(this)
                .text().trim() + ",") + "</span>");
        } else {
            j$(this).children("input").prop("checked", false);
            j$("#classification").children("#" + (j$(this).children("input")[0].value.trim().replace('.',''))).remove();
            var length = j$("#classification").html().length;
            if (length === 0) {
                j$("#classification").append("<span class='valClass' id='initial'>--无--</span>");
            }
        target = target.parentNode;
    }
    j$("#selectCheckId_f").hide();   //点击的不是#selected和它的子元素,隐藏下拉菜单
    j$("#selectCheckId_b").hide();
})
//点击 分类选择
function selectFenLei(obj,name){
    var checked1 = j$(obj).prop("checked");
    if (checked1 == true) {
        j$("#classification_f").children("#initial_f").remove();
        var idTemp = j$(obj).value().trim();
        idTemp = 'Id'+idTemp.split('.')[0];
        j$("#classification_f").append("<span class='valClass' id='" + (idTemp) + "'>" + (j$(obj)
            .value().trim() + ",") + "</span>");
    } else {
        var idTemp = 'Id'+name.split('.')[0];
        j$("#classification_f").children("#" + (idTemp)).remove();
        var length = j$("#classification_f").html().length;
        if (length === 0) {
            j$("#classification_f").append("<span class='valClass' id='initial_f'>--无--</span>");
        }
        var optioncheck = j$(".valClass");
        var hint = '';
        for(var i = 0;i<optioncheck.length;i++){
    }
    var optioncheck = j$(".valClass");
    var hint = '';
    for(var i = 0;i<optioncheck.length;i++){
        if(optioncheck[i].innerText != '--无--'){
            hint +=optioncheck[i].innerText;
        }
        j$("#valId").attr("title",hint);
        j$("[id*='salesdepartments']").val(hint);
        // j$("#salesdepartments").val(hint);
        // alert(j$("[id*='salesdepartments']").val());
    });
    j$(".ul-nav0").click(function () {
        var checked1 = j$(this).children("input").prop("checked");
        console.log('checked1***00',checked1);
        if (checked1 == false) {
            j$("#classification0").children("#initial0").remove();
            j$(this).children("input").prop("checked", true);
            j$("#classification0").append("<span class='valClass0' id='" + (j$(this).children("input")[0].value.trim()) + "'>" + (j$(this)
                .text().trim() + ",") + "</span>");
        } else {
            j$(this).children("input").prop("checked", false);
            j$("#classification0").children("#" + (j$(this).children("input")[0].value.trim())).remove();
            var length = j$("#classification0").html().length;
            if (length === 0) {
                j$("#classification0").append("<span class='valClass0' id='initial0'>--无--</span>");
            }
        }
        var optioncheck = j$(".valClass0");
        var hint = '';
        for(var i = 0;i<optioncheck.length;i++){
            hint +=optioncheck[i].innerText;
        }
        j$("#valId0").attr("title",hint);
        j$("[id*='equipmenttypes']").val(hint);
        // j$("#equipmenttypes").val(hint);
    });
    }
    j$("[id*='equipmenttypes']").val(hint);
}
// function tagclick() {
//     j$(".nav,.nav_close").toggle();
// }
// function tagclick0() {
//      j$(".nav0,.nav_close0").toggle();
// }
//点击 本部选择
function selectBenBu(obj,name){
    var checked1 = j$(obj).prop("checked");
    if (checked1 == true) {
        j$("#classification_b").children("#initial_b").remove();
        var idTemp = j$(obj).value().trim();
        idTemp = 'Id'+idTemp.split('.')[0];
        j$("#classification_b").append("<span class='valClass' id='" + (idTemp) + "'>" + (j$(obj)
            .value().trim() + ",") + "</span>");
    } else {
        var idTemp = 'Id'+name.split('.')[0];
        j$("#classification_b").children("#" + (idTemp)).remove();
        var length = j$("#classification_b").html().length;
        if (length === 0) {
            j$("#classification_b").append("<span class='valClass' id='initial_b'>--无--</span>");
        }
    }
    var optioncheck = j$(".valClass");
    var hint = '';
    for(var i = 0;i<optioncheck.length;i++){
        if(optioncheck[i].innerText != '--无--'){
            hint +=optioncheck[i].innerText;
        }
    }
    j$("[id*='salesdepartments']").val(hint);
}
// 分类
function navClose_f(){
    j$("#selectCheckId_f").toggle();
}
// 本部
function navClose_b(){
    j$("#selectCheckId_b").toggle();
}
// 20230607 ljh lightning end
function saveGoPageJs(clickLineNo1, iszhu1) {
    blockme();
    clickLineNo = clickLineNo1;
@@ -264,9 +195,6 @@
    lock.prop('checked', true);
    saveGoPageJs_save();
}
function saveGoPageJsComplete() {
    var errorFlag = j$(escapeVfId('allPage:allForm:hasError')).value();
    if(errorFlag == 'false'){
@@ -447,61 +375,61 @@
                    <apex:outputField value="{!parentObj.Request_shipping_day__c}"/>
                    <apex:outputField value="{!parentObj.Request_return_day__c}"/>
                    <apex:outputField value="{!parentObj.Product_category__c}"/>
                    <apex:outputPanel id="SelectOP" style="display:flex;margin-left: 27%;" rendered="{!!(parentObj.Demo_purpose1__c=='维修代用'||parentObj.Demo_purpose1__c=='协议借用')}">
                    <apex:pageBlockSectionItem id="SelectOP"  rendered="{!!(parentObj.Demo_purpose1__c=='维修代用'||parentObj.Demo_purpose1__c=='协议借用')}">
                    <!-- 20220106 ljh 放开 服务培训/学会 parentObj.CampaignType__c=='服务培训/学会'|| -->
                        <apex:outputLabel for="bieBeiPinFenLei" style="font-weight: bold; font-family: Arial,Helvetica,sans-serif; font-size: 91%;color: #4a4a56;" value="备品分类" />
                        <div  id="selectCheckId0" style="margin-left: 19px;">
                            <div class="nav_1st0" id="valId0" title="" style="height: 19px;">  <!-- lighting升级 20230210 lt 多选框的样式不正确问题 add style="height: 19px;" -->
                                <p id="classification0"  style="margin-top: -7px;"><span id="initial0">--无--</span></p>
                            </div>
                            <ul class="nav0" style="background-color: #FFFFFF;">
                                <div id="divId0" style="display:">
                                    <apex:repeat value="{!bieBeiPinFenLeiOps}" var="orr" id="selSD0">
                                        <li class="sdclass" style="margin-left:0px">
                                            <p class="ul-nav0" name="cate_id[]" >
                                                <input type="checkbox" value="{!orr.value}" class="li-input" style="display: inline-block;vertical-align: middle;" />
                                                <font style="">{!orr.label}</font>
                                            </p>
                                        </li>
                                    </apex:repeat>
                                </div>
                            </ul>
                            <div class="nav_close0"></div>
                        </div>
                    <apex:outputLabel for="bieBeiPinFenLei" style="font-weight: bold; font-family: Arial,Helvetica,sans-serif; font-size: 91%;color: #4a4a56;" value="备品分类" />
                    <apex:outputPanel style="position:absolute; " id="S_bieFenLei">
                        <ul class="nav" id="nav_f" style="background-color: #FFFFFF;left:0px;top:-5px;">
                            <li id="classification_f" class="transparent_class" style="margin-left:0px;height:30px;" onclick="navClose_f();return false;">
                                <span id="initial_f">--无--</span>
                            </li>
                            <li id="selectCheckId_f" style="margin-left:0px;display: none;">
                                <ul style="margin-left:0px;">
                                <apex:repeat value="{!bieBeiPinFenLeiOps}" var="orr" id="selFL">
                                <li class="sdclass" style="margin-left:0px">
                                    <p class="ul-nav" name="cate_id[]" >
                                        <input type="checkbox" value="{!orr.value}" onclick="selectFenLei(this,'{!orr.value}');"  class="li-input" style="display: inline-block;vertical-align: middle;"/>
                                        <font style="">{!orr.label}</font>
                                    </p>
                                </li>
                                </apex:repeat>
                                </ul>
                            </li>
                        </ul>
                    </apex:outputPanel>
                    <apex:outputPanel id="Selectsalesd" style="display:flex;margin-left: 30%;" rendered="{!!(parentObj.Demo_purpose1__c=='维修代用'||parentObj.Demo_purpose1__c=='协议借用')}">
                    </apex:pageBlockSectionItem>
                    <apex:pageBlockSectionItem id="Selectsalesd" rendered="{!!(parentObj.Demo_purpose1__c=='维修代用'||parentObj.Demo_purpose1__c=='协议借用')}">
                        <!-- 20220106 ljh 放开 服务培训/学会 parentObj.CampaignType__c=='服务培训/学会'|| -->
                        <apex:outputLabel for="salesd" style="font-weight: bold; font-family: Arial,Helvetica,sans-serif; font-size: 91%;color: #4a4a56;" value="本部" />
                        <div id="selectCheckId" style="margin-left: 19px;">
                            <div class="nav_1st" id="valId" title="" style="height: 19px;">
                                <!-- lighting升级 20230210 lt 多选框的样式不正确问题 add style="height: 19px;" -->
                                <p id="classification"  style="margin-top: -7px;"><span id="initial">--无--</span></p>
                            </div>
                            <ul class="nav" style="background-color: #FFFFFF;">
                                <div id="divId" style="display:">
                        <apex:outputPanel style="position:absolute; " id="S_bieBenBu">
                            <ul class="nav" id="nav_b" style="background-color: #FFFFFF;left:0px;">
                                <li id="classification_b" class="transparent_class" style="margin-left:0px;height:30px;" onclick="navClose_b();return false;">
                                    <span id="initial_b">--无--</span>
                                </li>
                                <li id="selectCheckId_b" style="margin-left:0px;display: none;">
                                    <ul style="margin-left:0px;">
                                    <apex:repeat value="{!bieBenBuOps}" var="orr" id="selSD">
                                        <li class="sdclass" style="margin-left:0px">
                                            <p class="ul-nav" name="cate_id[]" >
                                                <input type="checkbox" value="{!orr.value}" class="li-input" style="display: inline-block;vertical-align: middle;" />
                                                <font style="">{!orr.label}</font>
                                            </p>
                                        </li>
                                    <li class="sdclass" style="margin-left:0px">
                                        <p class="ul-nav" name="cate_id[]" >
                                            <input type="checkbox" value="{!orr.value}" onclick="selectBenBu(this,'{!orr.value}');"  class="li-input" style="display: inline-block;vertical-align: middle;"/>
                                            <font style="">{!orr.label}</font>
                                        </p>
                                    </li>
                                    </apex:repeat>
                                </div>
                                    </ul>
                                </li>
                            </ul>
                            <div class="nav_close"></div>
                        </div>
                    </apex:outputPanel>
                        </apex:outputPanel>
                    </apex:pageBlockSectionItem>
                    <apex:inputField rendered="{!!(parentObj.Demo_purpose1__c=='维修代用'||parentObj.Demo_purpose1__c=='协议借用')}" id="product_category" value="{!parentObj.Product_category_Sys__c}" />
                    <!-- 20220106 ljh 放开 服务培训/学会 parentObj.CampaignType__c=='服务培训/学会'|| -->
                </apex:pageBlockSection>
                <table style="width: 450px;margin: auto;float: left;margin-top: 1.5%;" >
                    <!-- <tr>
                        <td></td>
                    </tr> -->
                 <!-- 20230526 ljh lightning start-->
                <!-- <table style="width: 450px;margin: auto;float: left;margin-top: 1.5%;" > -->
                <table style="width: 450px;margin: auto;float: left;" >
                    <tr><td colspan="{!IF(parentObj.demo_purpose2__c == '学会展会'&&!(contains(parentObj.Salesdepartment__c,'MA本部')||contains(parentObj.Salesdepartment__c,'产品培训')),4,2)}">
                        &nbsp;</td>
                    </tr>
                    <tr>
                        <apex:outputPanel rendered="{!parentObj.demo_purpose2__c == '学会展会'&&!(contains(parentObj.Salesdepartment__c,'MA本部')||contains(parentObj.Salesdepartment__c,'产品培训'))}">
                            <td style="width:50px;font-weight: bold;font-family: Arial,Helvetica,sans-serif;font-size: 91%;color: #4a4a56;">
@@ -511,11 +439,17 @@
                                <apex:inputField id="campaignType" value="{!parentObj.CampaignType__c}" />
                            </td>
                        </apex:outputPanel>
                        <td colspan="2" style="text-align:end;">
                        <!-- 20230526 ljh lightning start-->
                        <!-- <td colspan="2" style="text-align:end;"> -->
                        <td style="text-align:end;">
                        <!-- 20230526 ljh lightning end-->
                            <apex:commandButton action="{!defaultScheduel}" disabled="{!parentObj.Demo_purpose1__c=='其他'||parentObj.Status__c!='已批准'}" onclick="if(!defualtconfirm()) return false;blockme();" oncomplete="unblockUI();"  value="默认排队" rerender="message,campaignType"/>
                            <!-- 20220105 ljh rerender add cmpid -->
                        </td>
                         <td style="width:190px;">
                        <!-- 20230526 ljh lightning start-->
                        <!-- <td style="width:190px;"> -->
                        <td>
                        <!-- 20230526 ljh lightning end-->
                            <apex:outputPanel rendered="{!!(parentObj.Demo_purpose1__c=='维修代用'||parentObj.Demo_purpose1__c=='协议借用'||parentObj.Status__c!='已批准')}">
                                <apex:commandButton style="margin-left:20px;" onclick="if(!confirmSpecial()) return false;blockme();"  action="{!specialScheduel}" disabled="{parentObj.Demo_purpose1__c=='维修代用'||parentObj.Demo_purpose1__c=='协议借用'||parentObj.Status__c!='已批准'}" value="特殊排队" rerender="cmpid,checEventFrame,message,campaignType" oncomplete="unblockUI();"  />
                            </apex:outputPanel>