|  |  |  | 
|---|
|  |  |  | <head> | 
|---|
|  |  |  | <meta charset="UTF-8"> | 
|---|
|  |  |  | <title>库位地图</title> | 
|---|
|  |  |  | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> | 
|---|
|  |  |  | <link rel="stylesheet" href="../../static/css/admin.css?v=318" media="all"> | 
|---|
|  |  |  | <link rel="stylesheet" href="../../static/css/cool.css" media="all"> | 
|---|
|  |  |  | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> | 
|---|
|  |  |  | <script type="text/javascript" src="../../static/layui/layui.js"></script> | 
|---|
|  |  |  | <script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script> | 
|---|
|  |  |  | <script type="text/javascript" src="../../static/js/common.js"></script> | 
|---|
|  |  |  | <script type="text/javascript" src="../../static/js/vue.min.js"></script> | 
|---|
|  |  |  | <link rel="stylesheet" href="../../static/wms/layui/css/layui.css" media="all"> | 
|---|
|  |  |  | <link rel="stylesheet" href="../../static/wms/css/admin.css?v=318" media="all"> | 
|---|
|  |  |  | <link rel="stylesheet" href="../../static/wms/css/cool.css" media="all"> | 
|---|
|  |  |  | <link rel="stylesheet" href="../../static/wcs/css/element.css"> | 
|---|
|  |  |  | <script type="text/javascript" src="../../static/wms/js/jquery/jquery-3.3.1.min.js"></script> | 
|---|
|  |  |  | <script type="text/javascript" src="../../static/wms/layui/layui.js"></script> | 
|---|
|  |  |  | <script type="text/javascript" src="../../static/wms/js/handlebars/handlebars-v4.5.3.js"></script> | 
|---|
|  |  |  | <script type="text/javascript" src="../../static/wms/js/common.js"></script> | 
|---|
|  |  |  | <script type="text/javascript" src="../../static/wcs/js/vue.min.js"></script> | 
|---|
|  |  |  | <script type="text/javascript" src="../../static/wcs/js/element.js"></script> | 
|---|
|  |  |  | <style> | 
|---|
|  |  |  | .pointContainer { | 
|---|
|  |  |  | display: flex; | 
|---|
|  |  |  | justify-content: center; | 
|---|
|  |  |  | margin-top: 1px; | 
|---|
|  |  |  | /*margin-top: 1px;*/ | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .pointBox { | 
|---|
|  |  |  | background: #bababa; | 
|---|
|  |  |  | width: 40px; | 
|---|
|  |  |  | height: 40px; | 
|---|
|  |  |  | margin-right: 1px; | 
|---|
|  |  |  | /*margin-right: 1px;*/ | 
|---|
|  |  |  | display: flex; | 
|---|
|  |  |  | justify-content: center; | 
|---|
|  |  |  | align-items: center; | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /*滑动卡片start*/ | 
|---|
|  |  |  | .hoverCard { | 
|---|
|  |  |  | width: 160px; | 
|---|
|  |  |  | width: 150px; | 
|---|
|  |  |  | height: 224px; | 
|---|
|  |  |  | border-radius: 20px; | 
|---|
|  |  |  | background: #f5f5f5; | 
|---|
|  |  |  | 
|---|
|  |  |  | </head> | 
|---|
|  |  |  | <body> | 
|---|
|  |  |  | <div id="app" style="display: flex;justify-content: space-around;margin-top: 50px;flex-wrap: wrap;" @click="bgClick()"> | 
|---|
|  |  |  | <div style="flex: 12;scale: 0.85;"> | 
|---|
|  |  |  | <div style="margin-top: -110px;"> | 
|---|
|  |  |  | <div style="flex: 18;display: flex;justify-content: center;" :style="{zoom:showScale/100.0,marginTop:(showScale)*2 + 'px'}"> | 
|---|
|  |  |  | <div style="margin-top: 10px;"> | 
|---|
|  |  |  | <div class="pointContainer" v-for="(x,index) in map" :key="index"> | 
|---|
|  |  |  | <div v-if="index != 0 && (index != map.length-1)" v-for="(y,idx) in x" :key="idx"> | 
|---|
|  |  |  | <div v-if="idx != 0 && (idx != map[index].length-1)"> | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!--库位--> | 
|---|
|  |  |  | <div v-else-if="map[index][idx].value  == 0" @contextmenu.prevent="rightEvent(index,idx,$event)"> | 
|---|
|  |  |  | <div v-if="map[index][idx].locSts == 'O'" class="pointBox pointBoxBlue">{{ map[index][idx].locSts }}</div> | 
|---|
|  |  |  | <div v-else-if="map[index][idx].locSts == 'F'" @click.left.stop="selectLoc(index,idx)" :class="{'pointBoxSelected':map[index][idx].locOutSelected,'pointBoxSearch':map[index][idx].searchStatus}" class="pointBox pointBoxRed">{{ map[index][idx].locSts }}</div> | 
|---|
|  |  |  | <div v-else-if="map[index][idx].locSts == 'D'" class="pointBox pointBoxEmpty">{{ map[index][idx].locSts }}</div> | 
|---|
|  |  |  | <div v-else-if="map[index][idx].locSts == 'P'" class="pointBox pointBoxOut">{{ map[index][idx].locSts }}</div> | 
|---|
|  |  |  | <div v-if="map[index][idx].locSts == 'O'" :class="{'pointBoxSearch':map[index][idx].searchStatus}" class="pointBox pointBoxBlue">{{ map[index][idx].locSts }}</div> | 
|---|
|  |  |  | <div v-else-if="map[index][idx].locSts == 'F'" @click.left="selectLoc(index,idx)" :class="{'pointBoxSelected':map[index][idx].locOutSelected,'pointBoxSearch':map[index][idx].searchStatus}" class="pointBox pointBoxRed">{{ map[index][idx].locSts }}</div> | 
|---|
|  |  |  | <div v-else-if="map[index][idx].locSts == 'D'" :class="{'pointBoxSearch':map[index][idx].searchStatus}" class="pointBox pointBoxEmpty">{{ map[index][idx].locSts }}</div> | 
|---|
|  |  |  | <div v-else-if="map[index][idx].locSts == 'P'" :class="{'pointBoxSearch':map[index][idx].searchStatus}" class="pointBox pointBoxOut">{{ map[index][idx].locSts }}</div> | 
|---|
|  |  |  | <div v-else-if="map[index][idx].locSts == 'R'" :class="{'pointBoxSearch':map[index][idx].searchStatus}" class="pointBox pointBoxOutYy">{{ map[index][idx].locSts }}</div> | 
|---|
|  |  |  | <div v-else-if="map[index][idx].locSts == 'S'" class="pointBox pointBoxInYy">{{ map[index][idx].locSts }}</div> | 
|---|
|  |  |  | <div v-else class="pointBox pointBoxDefault">{{ map[index][idx].locSts }}</div> | 
|---|
|  |  |  | <div v-else class="pointBox pointBoxDefault" :class="{'pointBoxSearch':map[index][idx].searchStatus}">{{ map[index][idx].locSts }}</div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!--母轨道--> | 
|---|
|  |  |  | <!--堆垛机--> | 
|---|
|  |  |  | <div v-else-if="map[index][idx].value  == 3"> | 
|---|
|  |  |  | <div class="pointBox" style="visibility: hidden;"></div> | 
|---|
|  |  |  | <div v-if="idx == 1" class="crnLine" style="width: 100vh"> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!--站点--> | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <div style="width: 40px;display: flex;justify-content: center;align-items: center;"> | 
|---|
|  |  |  | {{ getRealRowByX(index) }} | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <div> | 
|---|
|  |  |  | <div style="margin-top: 20px;"><button class="layui-btn" @click="currentLev = 1" :style="{background: currentLev==1?'red':''}">1F</button></div> | 
|---|
|  |  |  | <div style="margin-top: 20px;"><button class="layui-btn" @click="currentLev = 2" :style="{background: currentLev==2?'red':''}">2F</button></div> | 
|---|
|  |  |  | <div style="margin-top: 20px;"><button class="layui-btn" @click="currentLev = 3" :style="{background: currentLev==3?'red':''}">3F</button></div> | 
|---|
|  |  |  | <div style="margin-top: 20px;"><button class="layui-btn" @click="currentLev = 4" :style="{background: currentLev==4?'red':''}">4F</button></div> | 
|---|
|  |  |  | <div style="margin-top: 20px;"><button class="layui-btn" @click="currentLev = 5" :style="{background: currentLev==5?'red':''}">5F</button></div> | 
|---|
|  |  |  | <div style="margin-top: 20px;"><button class="layui-btn" @click="currentLev = 6" :style="{background: currentLev==6?'red':''}">6F</button></div> | 
|---|
|  |  |  | <div style="margin-top: 20px;"><button class="layui-btn" @click="currentLev = 7" :style="{background: currentLev==7?'red':''}">7F</button></div> | 
|---|
|  |  |  | <div style="margin-top: 20px;"><button class="layui-btn" @click="currentLev = 8" :style="{background: currentLev==8?'red':''}">8F</button></div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div style="padding: 20px;flex: 5;margin-top: -70px;"> | 
|---|
|  |  |  | <div style="padding: 40px 20px 10px 10px;" :style="window.innerWidth < 2100 ? 'margin-top: 0px;' : 'flex: 5;margin-top: -70px;'" v-if="false"> | 
|---|
|  |  |  | <el-slider v-model="showScale" :marks="showScaleMarks"></el-slider> | 
|---|
|  |  |  | <div style="display: flex;justify-content: space-between;flex-wrap: wrap;"> | 
|---|
|  |  |  | <div class="hoverCard" style="width: 100%;"> | 
|---|
|  |  |  | <div class="card-details" style="place-content: normal;height: auto;"> | 
|---|
|  |  |  | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <button style="width: 100%;margin-top: 10px;" @click="searchLoc" class="layui-btn layui-btn-sm">搜索</button> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <!--                        <div>--> | 
|---|
|  |  |  | <!--                            <button @click="locToLoc2" class="layui-btn layui-btn-sm">侧边移库</button>--> | 
|---|
|  |  |  | <!--                        </div>--> | 
|---|
|  |  |  | <div v-if="!locOutStatus"> | 
|---|
|  |  |  | <!--                        <div>--> | 
|---|
|  |  |  | <!--                            <button @click="locToLoc2" class="layui-btn layui-btn-sm">侧边移库</button>--> | 
|---|
|  |  |  | <!--                        </div>--> | 
|---|
|  |  |  | <div> | 
|---|
|  |  |  | <button @click="init" class="layui-btn layui-btn-sm">刷新</button> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div style="margin-left: 10px;"> | 
|---|
|  |  |  | <button @click="resetSearch" class="layui-btn layui-btn-sm">重置</button> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div v-if="!locOutStatus" style="margin-left: 10px;"> | 
|---|
|  |  |  | <button @click="locOutStatus = true" class="layui-btn layui-btn-sm">出库选择</button> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div v-else style="margin-left: 10px;border: 1px red solid;display: flex;"> | 
|---|
|  |  |  | 
|---|
|  |  |  | <div style="font-size: 10px;">在库</div><div class="pointBox pointBoxRed">F</div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div style="flex: 1;margin-top: 10px;"> | 
|---|
|  |  |  | <div style="font-size: 10px;">空板</div><div class="pointBox pointBoxEmpty">D</div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div style="flex: 1;margin-top: 10px;"> | 
|---|
|  |  |  | <div style="font-size: 10px;">出库中</div><div class="pointBox pointBoxOut">P</div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div style="flex: 1;margin-top: 10px;"> | 
|---|
|  |  |  | <div style="font-size: 10px;">出库预约</div><div class="pointBox pointBoxOutYy">R</div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div style="flex: 1;margin-top: 10px;"> | 
|---|
|  |  |  | <div style="font-size: 10px;">入库预约</div><div class="pointBox pointBoxInYy">S</div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div style="flex: 1;margin-top: 10px;"> | 
|---|
|  |  |  | <div style="font-size: 10px;">搜索结果</div><div class="pointBox pointBoxSearch"></div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div style="flex: 1;margin-top: 10px;"> | 
|---|
|  |  |  | <div style="font-size: 10px;">选择结果</div><div class="pointBox pointBoxSelected"></div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div style="flex: 1;margin-top: 10px;"> | 
|---|
|  |  |  | <div style="font-size: 10px;">其他</div><div class="pointBox pointBoxDefault">其他</div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | 
|---|
|  |  |  | <button class="card-button">库位状态</button> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <div class="hoverCard"> | 
|---|
|  |  |  | <div class="card-details"> | 
|---|
|  |  |  | <p class="text-title" style="text-align: center;">楼层 {{currentLev}}F</p> | 
|---|
|  |  |  | <div class="text-body" style="display: flex;"> | 
|---|
|  |  |  | <div class="floorSelect"> | 
|---|
|  |  |  | <label for="01">1F</label> | 
|---|
|  |  |  | <input id="01" type="radio" name="r" v-model="currentLev" value="1" checked=""> | 
|---|
|  |  |  | <label for="02">2F</label> | 
|---|
|  |  |  | <input id="02" type="radio" v-model="currentLev" name="r" value="2"> | 
|---|
|  |  |  | <label for="03">3F</label> | 
|---|
|  |  |  | <input id="03" type="radio" v-model="currentLev" name="r" value="3"> | 
|---|
|  |  |  | <label for="04">4F</label> | 
|---|
|  |  |  | <input id="04" type="radio" v-model="currentLev" name="r" value="4"> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <button class="card-button">楼层 {{currentLev}}F</button> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <!--            <div class="hoverCard">--> | 
|---|
|  |  |  | <!--                <div class="card-details">--> | 
|---|
|  |  |  | <!--                    <p class="text-title" style="text-align: center;">楼层 {{currentLev}}F</p>--> | 
|---|
|  |  |  | <!--                    <div class="text-body" style="display: flex;">--> | 
|---|
|  |  |  | <!--                        <div class="floorSelect">--> | 
|---|
|  |  |  | <!--                            <label for="01">1F</label>--> | 
|---|
|  |  |  | <!--                            <input id="01" type="radio" name="r" v-model="currentLev" value="1" checked="">--> | 
|---|
|  |  |  | <!--                            <label for="02">2F</label>--> | 
|---|
|  |  |  | <!--                            <input id="02" type="radio" v-model="currentLev" name="r" value="2">--> | 
|---|
|  |  |  | <!--                            <label for="03">3F</label>--> | 
|---|
|  |  |  | <!--                            <input id="03" type="radio" v-model="currentLev" name="r" value="3">--> | 
|---|
|  |  |  | <!--                            <label for="04">4F</label>--> | 
|---|
|  |  |  | <!--                            <input id="04" type="radio" v-model="currentLev" name="r" value="4">--> | 
|---|
|  |  |  | <!--                        </div>--> | 
|---|
|  |  |  | <!--                    </div>--> | 
|---|
|  |  |  | <!--                </div>--> | 
|---|
|  |  |  | <!--                <button class="card-button">楼层 {{currentLev}}F</button>--> | 
|---|
|  |  |  | <!--            </div>--> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | 
|---|
|  |  |  | 库位号: {{ map[mapI][mapJ].locNo }} | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div style="margin-top: 10px;"> | 
|---|
|  |  |  | 库位状态: {{ map[mapI][mapJ].locSts$ }} | 
|---|
|  |  |  | 库位状态: {{ getLocSts(map[mapI][mapJ].locSts) }} | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div style="margin-top: 10px;"> | 
|---|
|  |  |  | 托盘号: {{ map[mapI][mapJ].barcode }} | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div style="margin-top: 10px;display: flex;justify-content: space-between;flex-wrap: wrap;"> | 
|---|
|  |  |  | <div style="margin-top: 5px;"> | 
|---|
|  |  |  | <div style="margin-top: 5px;display: none;"> | 
|---|
|  |  |  | <button class="layui-btn layui-btn-sm" @click="openLocDetail(map[mapI][mapJ].locNo)">库位详情</button> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div style="margin-top: 5px;"> | 
|---|
|  |  |  | <button v-if="map[mapI][mapJ].locSts == 'F'" class="layui-btn layui-btn-sm" @click="locMove(map[mapI][mapJ].locNo)">库位移转</button> | 
|---|
|  |  |  | <button v-else-if="map[mapI][mapJ].locSts == 'D'" class="layui-btn layui-btn-sm" @click="locMove(map[mapI][mapJ].locNo)">库位移转</button> | 
|---|
|  |  |  | <button v-else class="layui-btn layui-btn-sm layui-btn-disabled" disabled>库位移转</button> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <!--                    <div style="margin-top: 5px;">--> | 
|---|
|  |  |  | <!--                        <button v-if="map[mapI][mapJ].locSts == 'F'" class="layui-btn layui-btn-sm" @click="locMove(map[mapI][mapJ].locNo)">库位移转</button>--> | 
|---|
|  |  |  | <!--                        <button v-else-if="map[mapI][mapJ].locSts == 'D'" class="layui-btn layui-btn-sm" @click="locMove(map[mapI][mapJ].locNo)">库位移转</button>--> | 
|---|
|  |  |  | <!--                        <button v-else class="layui-btn layui-btn-sm layui-btn-disabled" disabled>库位移转</button>--> | 
|---|
|  |  |  | <!--                    </div>--> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | 
|---|
|  |  |  | searchLocNo: "", | 
|---|
|  |  |  | outSite: null, | 
|---|
|  |  |  | outSites: null, | 
|---|
|  |  |  | showScale: 65, //控制地图显示大小比例 | 
|---|
|  |  |  | showScaleMarks: {//比例滑动条显示标记 | 
|---|
|  |  |  | 0: "0%", | 
|---|
|  |  |  | 50: { | 
|---|
|  |  |  | style: { | 
|---|
|  |  |  | color: '#1989FA' | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | label: "50%" | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 100: "100%", | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | locStsList: [],//库位状态列表 | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | created(){ | 
|---|
|  |  |  | this.init() | 
|---|
|  |  |  |  | 
|---|
|  |  |  | this.getOutSite() | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // setInterval((that) => { | 
|---|
|  |  |  | //     //定时获取堆垛机数据 | 
|---|
|  |  |  | //     that.getCrnData() | 
|---|
|  |  |  | // },1000,this) | 
|---|
|  |  |  | // this.getOutSite() | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | watch: { | 
|---|
|  |  |  | map: { | 
|---|
|  |  |  | 
|---|
|  |  |  | deep: true, | 
|---|
|  |  |  | handler(val) { | 
|---|
|  |  |  | this.init() | 
|---|
|  |  |  | if (this.searchMatnr != "" | 
|---|
|  |  |  | || this.searchOrderNo != "" | 
|---|
|  |  |  | || this.searchSpecs != "" | 
|---|
|  |  |  | || this.searchMaktx != "" | 
|---|
|  |  |  | || this.searchLocNo != "") { | 
|---|
|  |  |  | this.searchLoc() | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | this.locOutStatus = false | 
|---|
|  |  |  | this.locOutLocNo = [] | 
|---|
|  |  |  |  | 
|---|
|  |  |  | this.getLocStsList();//获取库位状态列表 | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | resetSearch(){ | 
|---|
|  |  |  | this.searchMatnr = "" | 
|---|
|  |  |  | this.searchOrderNo = "" | 
|---|
|  |  |  | this.searchSpecs = "" | 
|---|
|  |  |  | this.searchMaktx = "" | 
|---|
|  |  |  | this.searchLocNo = "" | 
|---|
|  |  |  | this.searchLoc() | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | printData() { | 
|---|
|  |  |  | this.mapData = JSON.stringify(this.map) | 
|---|
|  |  |  | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.map = data | 
|---|
|  |  |  | this.printData() | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | getRealRowByX(x) { | 
|---|
|  |  |  | //获取真实库位行号,通过坐标x | 
|---|
|  |  |  | let data = this.map | 
|---|
|  |  |  | let rowData = data[x] | 
|---|
|  |  |  | for (var i = 1; i < rowData.length; i++) { | 
|---|
|  |  |  | if (rowData[i].locNo != undefined) { | 
|---|
|  |  |  | let locNo = rowData[i].locNo; | 
|---|
|  |  |  | return "#" + parseInt(locNo.substr(0, 2)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return ""; | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | rightEvent(x, y, e) { | 
|---|
|  |  |  | this.rightBox = true | 
|---|
|  |  |  | 
|---|
|  |  |  | success: function(layero, index){ | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | getLocStsList() { | 
|---|
|  |  |  | //获取库位状态列表 | 
|---|
|  |  |  | let that = this | 
|---|
|  |  |  | $.ajax({ | 
|---|
|  |  |  | url: baseUrl + "/basLocSts/list/auth", | 
|---|
|  |  |  | headers: {'token': localStorage.getItem('token')}, | 
|---|
|  |  |  | method: "get", | 
|---|
|  |  |  | success: (res) => { | 
|---|
|  |  |  | that.locStsList = res.data.records | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | getLocSts(locSts) { | 
|---|
|  |  |  | //获取库位状态 | 
|---|
|  |  |  | let locStsList = this.locStsList | 
|---|
|  |  |  | let locDesc = "" | 
|---|
|  |  |  | locStsList.forEach((item,index) => { | 
|---|
|  |  |  | if (item.locSts == locSts) { | 
|---|
|  |  |  | locDesc = item.locDesc | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | return locDesc | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | locMove(locNo) { | 
|---|
|  |  |  | //库位移转 | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // let result = true;//最终结果 | 
|---|
|  |  |  | // //检测库位是否缺少选择导致不完整 | 
|---|
|  |  |  | // bayList.forEach((item,index) => { | 
|---|
|  |  |  | //     //搜索当前巷道有效在库list | 
|---|
|  |  |  | //     //上半部分,巷道 | 
|---|
|  |  |  | //     let topList = [] | 
|---|
|  |  |  | //     for (var i = 8; i >= 3; i--) { | 
|---|
|  |  |  | //         let obj = { | 
|---|
|  |  |  | //             x: i, | 
|---|
|  |  |  | //             y: index, | 
|---|
|  |  |  | //             status: false, | 
|---|
|  |  |  | //             locNo: map[i][index].locNo | 
|---|
|  |  |  | //         } | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //         if (map[i][index].locSts == 'F') { | 
|---|
|  |  |  | //             //在库状态,存入巷道在库list | 
|---|
|  |  |  | //             topList.push(obj) | 
|---|
|  |  |  | //         } | 
|---|
|  |  |  | //     } | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //     //下半部分,巷道 | 
|---|
|  |  |  | //     let bottomList = [] | 
|---|
|  |  |  | //     for (var i = 9; i < 14; i++) { | 
|---|
|  |  |  | //         let obj = { | 
|---|
|  |  |  | //             x: i, | 
|---|
|  |  |  | //             y: index, | 
|---|
|  |  |  | //             status: false, | 
|---|
|  |  |  | //             locNo: map[i][index].locNo | 
|---|
|  |  |  | //         } | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //         if (map[i][index].locSts == 'F') { | 
|---|
|  |  |  | //             //在库状态,存入巷道在库list | 
|---|
|  |  |  | //             bottomList.push(obj) | 
|---|
|  |  |  | //         } | 
|---|
|  |  |  | //     } | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //     // if (topList.length == 0 && bottomList.length == 0) { | 
|---|
|  |  |  | //     //     result = false; | 
|---|
|  |  |  | //     // } | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //     for (var i = 0; i < item.length; i++) { | 
|---|
|  |  |  | //         if (item[i].x > 8) { | 
|---|
|  |  |  | //             //下半部分数据 | 
|---|
|  |  |  | //             let index = this.searchDataIndex(item[i],bottomList) | 
|---|
|  |  |  | //             // console.log(item[i],bottomList,index) | 
|---|
|  |  |  | //             if (index == -1) { | 
|---|
|  |  |  | //                 continue | 
|---|
|  |  |  | //             } | 
|---|
|  |  |  | //             bottomList[index].status = true | 
|---|
|  |  |  | //         }else { | 
|---|
|  |  |  | //             //上半部分数据 | 
|---|
|  |  |  | //             let index = this.searchDataIndex(item[i],topList) | 
|---|
|  |  |  | //             // console.log(item[i],topList,index) | 
|---|
|  |  |  | //             if (index == -1) { | 
|---|
|  |  |  | //                 continue | 
|---|
|  |  |  | //             } | 
|---|
|  |  |  | //             topList[index].status = true | 
|---|
|  |  |  | //         } | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //     } | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //     let tmp1 = [] | 
|---|
|  |  |  | //     let tmp2 = [] | 
|---|
|  |  |  | //     for (var i = item.length - 1; i >= 0; i--) { | 
|---|
|  |  |  | //         if (item[i].x < 9) { | 
|---|
|  |  |  | //             tmp1.push(item[i]); | 
|---|
|  |  |  | //         } | 
|---|
|  |  |  | //     } | 
|---|
|  |  |  | //     for (var i = 0; i < item.length; i++) { | 
|---|
|  |  |  | //         if (item[i].x > 8) { | 
|---|
|  |  |  | //             tmp2.push(item[i]); | 
|---|
|  |  |  | //         } | 
|---|
|  |  |  | //     } | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //     if (tmp1.length > 0) { | 
|---|
|  |  |  | //         //判断上半部分出库是否选择完整 | 
|---|
|  |  |  | //         let topIndex = this.searchDataIndex(tmp1[0],topList); | 
|---|
|  |  |  | //         if (topIndex != -1) { | 
|---|
|  |  |  | //             for (var i = topIndex; i < topList.length; i++) { | 
|---|
|  |  |  | //                 if (topList[i].status != true) { | 
|---|
|  |  |  | //                     result = false; | 
|---|
|  |  |  | //                 } | 
|---|
|  |  |  | //             } | 
|---|
|  |  |  | //         } | 
|---|
|  |  |  | //     } | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //     if (tmp2.length > 0) { | 
|---|
|  |  |  | //         //判断下半部分出库是否选择完整 | 
|---|
|  |  |  | //         let bottomIndex = this.searchDataIndex(tmp2[0],bottomList) | 
|---|
|  |  |  | //         if (bottomIndex != -1) { | 
|---|
|  |  |  | //             for (var i = bottomIndex; i < bottomList.length; i++) { | 
|---|
|  |  |  | //                 if (bottomList[i].status != true) { | 
|---|
|  |  |  | //                     result = false; | 
|---|
|  |  |  | //                 } | 
|---|
|  |  |  | //             } | 
|---|
|  |  |  | //             console.log(tmp2[0],bottomList,bottomIndex) | 
|---|
|  |  |  | //         } | 
|---|
|  |  |  | //     } | 
|---|
|  |  |  | // }) | 
|---|
|  |  |  | // | 
|---|
|  |  |  | // if (!result) { | 
|---|
|  |  |  | //     $layui.layer.msg("出库路径选择有误"); | 
|---|
|  |  |  | //     return; | 
|---|
|  |  |  | // } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //准备出库 | 
|---|
|  |  |  | if (this.outSite == null) { | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | data.forEach((item,index) => { | 
|---|
|  |  |  | let locNo = item.locNo | 
|---|
|  |  |  | let y = parseInt(locNo.substr(2,3)) | 
|---|
|  |  |  | let x = parseInt(locNo.substr(0,2)) | 
|---|
|  |  |  | if (x >= 2 && x <= 12) { | 
|---|
|  |  |  | x += 1; | 
|---|
|  |  |  | }else if (x == 13) { | 
|---|
|  |  |  | x += 2; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | tmp[x][y].searchStatus = true//搜索标记 | 
|---|
|  |  |  | data.forEach((item,i) => { | 
|---|
|  |  |  | let locNo = item.locNo | 
|---|
|  |  |  | tmp.forEach((item,index) => { | 
|---|
|  |  |  | item.forEach((val,idx) => { | 
|---|
|  |  |  | if (tmp[index][idx].locNo == locNo) { | 
|---|
|  |  |  | tmp[index][idx].searchStatus = true//搜索标记 | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | that.map = tmp | 
|---|
|  |  |  | $layui.layer.msg("搜索成功"); | 
|---|