buli
2023-07-14 e6068da47c1bef5517c9e5fdc8c726766867ad4e
force-app/main/default/pages/ConsumEquipmentSetShipment.page
@@ -1,4 +1,4 @@
<apex:page Controller="ConsumEquipmentSetShipmentController" showHeader="false" sidebar="false" id="allPage" action="{!init}" >
<apex:page Controller="ConsumEquipmentSetShipmentController" showHeader="false" sidebar="false" id="allPage" action="{!init}" lightningStylesheets="true" >
<head>
    <meta name="format-detection" content="telephone=no"/>
    <meta name="viewport" content="width=device-width,initial-scale=1"/>
@@ -7,8 +7,8 @@
<apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
<apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
<apex:includeScript value="{!URLFOR($Resource.RelationListPagingCmpJS)}"/>
<apex:includeScript value="/soap/ajax/46.0/connection.js"/>
<apex:includeScript value="/soap/ajax/46.0/apex.js"/>
<apex:includeScript value="{!URLFOR($Resource.connection20)}"/>
<apex:includeScript value="{!URLFOR($Resource.apex20)}"/>
<apex:stylesheet value="{!URLFOR($Resource.jquery_confirm, 'jquery-confirm.min.css')}"/>
<apex:includeScript value="{!URLFOR($Resource.jquery_confirm, 'jquery-confirm.min.js')}"/>
<style type="text/css">
@@ -41,6 +41,7 @@
.col_Scroll{display: none;}
.dataRow.col_Scroll{display: none;}
.col_ManagementCode__c{display: none;}
.col_boxbarcodeforReceipt__c{display: none;}
.modal 
{
@@ -422,6 +423,8 @@
            document.getElementById("bianma").innerHTML = bianma;    
            //给明细行赋管理编码
            //paobj[0].children[10].children[0].value = bianma; 
            j$("#havCode").val(maqCode);
            c = bianma;
        }else if(content250 !='' && content250 !=undefined && content250.substring(content250.length - 8,content250.length - 5) == '250'){
             //设置管理编码
@@ -430,8 +433,9 @@
            document.getElementById("bianma").innerHTML = bianma;    
            //给明细行赋管理编码
            //paobj[0].children[10].children[0].value = bianma; 
            c = bianma;
            j$("#havCode").val(content250);
            c = bianma;
        }
        //判断当前扫描是否换盒了
        if(c != null && c != '' && c != undefined){
@@ -551,14 +555,17 @@
                if(rowObj != null){
                    //获取当前扫的盒
                    var newHe = document.getElementById("bianma").innerHTML;
                    var newHe1 = document.getElementById("havCode").value;
                    //取得所有小码 放到备品管理码上
                    //注意:有两种情况,如果此次扫的小米的盒是已经扫过的,那么直接加就行,如果此次的盒没有扫过,而原来也有已经扫过的盒,那么就需要特殊处理
                    var tableId = document.getElementById("detailTb"); 
                    var str = '';
                    var str1 = '';
                    var str2 = '';
                    var numstr = 0;
                    var he = rowObj[0].children[10].children[0].value;
                    var xiaoma = rowObj[0].children[9].children[0].value;
                    var he1 = rowObj[0].children[11].children[0].value;
                    if(tableId.rows.length > 0){//判断此次扫的盒是否有小码
                        //首先判断当前明细原来是否已经扫过码
                        //如果没扫过 那么在原来的 备品管理码、管理编码和发货件数的值上都需要加上此次扫的小码
@@ -566,8 +573,11 @@
                        if(he != null && he != '' && he != undefined && xiaoma != null && xiaoma != '' && xiaoma != undefined){
                            var linshistr = '';//临时小码值
                            var linshistr1 = '';//临时盒的值
                            var linshistr2 = '';
                            var oldheArray = he.split(',');//获取原来的所有盒
                            var oldxiaomaArray = xiaoma.split(',');//获取原来的所有小码
                            var oldhe1Array = he1.split(',');
                            //循环原来明细的盒
                            for(var i = 0;i < oldheArray.length;i++){
                                if(oldheArray[i] != null && oldheArray[i] != '' && oldheArray[i] != undefined){
@@ -586,15 +596,18 @@
                                        //如果原来的盒不等于当前操作的盒,那么不需要做变化,值把现在循环的盒放到临时变量里面
                                        linshistr += oldxiaomaArray[i] + ',';
                                        linshistr1 += oldheArray[i] + ',';
                                        linshistr2 += oldhe1Array[i] + ',';
                                    }
                                    if(oldHe == '3'){
                                        linshistr += oldxiaomaArray[i] + ',';
                                        linshistr1 += oldheArray[i] + ',';
                                        linshistr2 += oldhe1Array[i] + ',';
                                    }
                                }
                            }
                            str = linshistr;
                            str1 = linshistr1;
                            str2 = linshistr2;
                            //由于以上的操作只能找到原来的盒和小码是否删除,那么一下的操作就是把最新操作的盒和小码追加到字符串的最后面
                            //循环弹出框的小码
                            for(var j=1;j<tableId.rows.length;j++) {
@@ -614,11 +627,15 @@
                                    //追加新的盒和小码
                                    str += tableId.rows[j].cells[1].innerHTML + ',';
                                    str1 += newHe + ',';
                                    str2 += newHe1 + ',';
                                }
                            }
                            if(str != '' && str1 != null){
                                str = str.substring(0,str.length-1);
                                str1 = str1.substring(0,str1.length-1);
                            }
                            if(str2 != '' ){
                                str2 = str2.substring(0,str2.length-1);
                            }
                            numstr = str == '' ? null : str.split(',').length;
@@ -627,10 +644,14 @@
                            for(var i=1;i<tableId.rows.length;i++) { 
                                str += tableId.rows[i].cells[1].innerHTML + ',';
                                str1 += document.getElementById("bianma").innerHTML + ',';//盒
                                str2 += document.getElementById("havCode").value + ',';
                            }  
                            if(str != '' && str1 != null){
                                str = str.substring(0,str.length-1);
                                str1 = str1.substring(0,str1.length-1);
                            }
                            if(str2 != '' ){
                                str2 = str2.substring(0,str2.length-1);
                            }
                            numstr = j$("#detailTb").find("tr").length-1;//发货件数
@@ -641,16 +662,21 @@
                        if(he != null && he != '' && he != undefined && xiaoma != null && xiaoma != '' && xiaoma != undefined){
                            var oldheArray = he.split(',');
                            var oldxiaomaArray = xiaoma.split(',');
                            var oldhe1Array = he1.split(',');
                            for(var i = 0;i < oldheArray.length;i++){
                                if(oldheArray[i] != newHe){
                                    str += oldxiaomaArray[i] + ',';
                                    str1 += oldheArray[i] + ',';
                                    str2 += oldhe1Array[i] + ',';
                                }
                            }
                            if(str != '' && str1 != null){
                                str = str.substring(0,str.length-1);
                                str1 = str1.substring(0,str1.length-1);
                            }
                            if(str2 != '' ){
                                str2 = str2.substring(0,str2.length-1);
                            }
                            numstr = str == '' ? null : str.split(',').length;//发货件数
@@ -667,6 +693,7 @@
                    rowObj[0].children[9].children[0].value = str; //备品管理码
                    rowObj[0].children[10].children[0].value = str1;//管理编码
                    numObj[0].innerText = numstr;//发货件数
                    rowObj[0].children[11].children[0].value =str2;
                }
                //update        wangweipeng            2022/02/21                   end
            }