From a9b421d08ee53b040a53d6788e51e9eed2c4de4e Mon Sep 17 00:00:00 2001
From: "Mr.sun" <2290907227@qq.com>
Date: Thu, 11 Jan 2024 00:03:31 +0800
Subject: [PATCH] =?UTF-8?q?=E5=9C=B0=E5=9B=BE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/util/mapDrawing.js | 2 +-
src/api/wcs/location.js | 15 ++++
src/config.js | 96 ++++++++++++++++++----
src/views/index.vue | 161 ++++++++++++++++++++-----------------
4 files changed, 183 insertions(+), 91 deletions(-)
diff --git a/src/api/util/mapDrawing.js b/src/api/util/mapDrawing.js
index 034998b..6cea087 100644
--- a/src/api/util/mapDrawing.js
+++ b/src/api/util/mapDrawing.js
@@ -1575,7 +1575,7 @@ class MapDrawing extends EventEmitter {
Object.keys(warehouseData.storageRack[storageRackId].freightSpace).map(freightSpaceId => {
let freightSpace = warehouseData.storageRack[storageRackId].freightSpace[freightSpaceId]
Object.keys(freightSpaceStateDictionary).map(tileStateKey => {
- if (freightSpace.state.toString() === tileStateKey) {
+ if (freightSpace.state && freightSpace.state.toString() === tileStateKey) {
if (!freightSpaceStateDictionary[tileStateKey].nodeIds) {
freightSpaceStateDictionary[tileStateKey].nodeIds = []
}
diff --git a/src/api/wcs/location.js b/src/api/wcs/location.js
index 4f115b7..84a45ef 100644
--- a/src/api/wcs/location.js
+++ b/src/api/wcs/location.js
@@ -8,6 +8,21 @@ export function listLocation(query) {
params: query
})
}
+export function containerList(data) {
+ return request({
+ url: '/wcs/container/list',
+ method: 'get',
+ params: data
+ })
+}
+
+// export function listLocation(query) {
+// return request({
+// url: '/wcs/location/list',
+// method: 'get',
+// params: query
+// })
+// }
// 查询货位信息详细lo
export function getLocation(id) {
diff --git a/src/config.js b/src/config.js
index 5b0542c..52db4fb 100644
--- a/src/config.js
+++ b/src/config.js
@@ -55,7 +55,7 @@ var arr=[
[1,12,2,"011202",1,0,120,380,100],
[1,12,3,"011203",1,0,120,380,100],
[1,12,4,"011204",1,0,120,380,100],
- [1,13,1,"011301",1,0,100,380,100],
+ [1,13,1,"011301",1,0,120,380,100],
[1,13,2,"011302",1,0,120,380,100],
[1,13,3,"011303",1,0,120,380,100],
[1,13,4,"011304",1,0,120,380,100],
@@ -310,31 +310,95 @@ var arrRe=[
// color: '#cccccc'
// }
// },
+// 0:空(无盒子)
+// 1:禁止
+// 2:实(有盒子)
+// 3:实(BCR 异常的盒子)
+// 4:实(BCR 重复 ID 的既存盒子)
+// 5:实(双重搬入时的现有的盒子)
+// 6:输送目的地预约中
+// 7: 源目标
+// 8: 切离禁用空的状态
+// 9: 切离禁用实的状态
freightSpaceStateDictionary: {
'0': {
+ //无色
describe: '空',
color: '#ecf0f1'
+
},
- '1': {
- describe: '满位',
+ '1': {
+ //红色
+ describe: '禁止',
+ color: '#ff4757'
+ },
+ '2': {
+ //淡蓝
+ describe: '实(有盒子)',
color: '#3742fa'
},
- '2': {
- describe: '半满',
- color: '#70a1ff'
+ '3': {
+ describe: '实(BCR 异常的盒子)',
+ color: '#3742fa'
},
- '3': {
- describe: '托盘出库中',
- color: '#ffa502'
+ '4': {
+ describe: '实(BCR 重复 ID 的既存盒子)',
+ color: '#74b9ff'
},
- '4': {
- describe: '模具出库中',
- color: '#ff4757'
+ '5': {
+ describe: '实(双重搬入时的现有的盒子)',
+ color: '#3742fa'
},
- '5':{
- describe: '只有空托盘',
- color: '#8670ff'
- }
+ '6': {
+ describe: '输送目的地预约中',
+ color: '#3742fa'
+ },
+ '7': {
+ describe: '源目标',
+ color: '#3742fa'
+ },
+ // 8: 切离禁用空的状态
+ // 9: 切离禁用实的状态
+ '8': {
+ describe: '切离禁用空的状态',
+ color: '#3742fa'
+ },
+ '9': {
+ describe: '切离禁用实的状态',
+ color: '#3742fa'
+ },
+ // '1': {
+ // describe: '满位',
+ // color: '#3742fa'
+ // },
+ // '1': {
+ // describe: '满位',
+ // color: '#3742fa'
+ // },
+ // '1': {
+ // describe: '满位',
+ // color: '#3742fa'
+ // },
+ // '1': {
+ // describe: '满位',
+ // color: '#3742fa'
+ // },
+ // '2': {
+ // describe: '半满',
+ // color: '#70a1ff'
+ // },
+ // '3': {
+ // describe: '托盘出库中',
+ // color: '#ffa502'
+ // },
+ // '4': {
+ // describe: '模具出库中',
+ // color: '#ff4757'
+ // },
+ // '5':{
+ // describe: '只有空托盘',
+ // color: '#8670ff'
+ // }
},
// 堆垛机状态
pilerStateDictionary: {
diff --git a/src/views/index.vue b/src/views/index.vue
index 412f3d1..4f8c998 100644
--- a/src/views/index.vue
+++ b/src/views/index.vue
@@ -81,7 +81,7 @@
@click="doUpdateFreightSpaceState()"
>更新货位状态
-
+
import MapDrawing from '@/api/util/mapDrawing.js'
import sysConfig from '../config.js'
-// import { getLocationDataList } from '@/api/wms/basicData/locationData'
+import { listLocation, containerList } from '@/api/wcs/location.js'
+// import { getLocationMoldByLocationCode } from '@/api/tool/dataScreen'
// import { getLocationMoldByLocationCode } from '@/api/tool/dataScreen'
export default {
name: 'HelloWorld',
@@ -580,27 +582,31 @@ export default {
},
columns: [
{
- title: 111,
- key: 'locationCode'
+ title: '货位',
+ key: 'locationName'
},
{
- title: 222,
- key: 'moldNo',
- width: 150
+ title: '盒子信息',
+ key: 'boxId'
},
{
- title: 333,
- key: 'model'
- },
- {
- title: 444,
- key: 'moldName'
- },
- {
- title: 555,
- key: 'inTime',
- width: 140
+ title: '备注',
+ key: 'remark',
+ width: 150
}
+ // {
+ // title: 333,
+ // key: 'model'
+ // },
+ // {
+ // title: 444,
+ // key: 'moldName'
+ // },
+ // {
+ // title: 555,
+ // key: 'inTime',
+ // width: 140
+ // }
],
tableData: [],
latticeForPiler1: [],
@@ -610,13 +616,13 @@ export default {
mounted() {
//
// console.log(window.systemConfig)
- // getLocationDataList({ pageNum: 1, pageSize: 999 }).then((res) => {
- // console.log(res)
- // this.latticeForPiler1 = res.rows
- // })
+ listLocation({ pageNum: 1, pageSize: 9999 }).then((res) => {
+ // console.log(res)
+ this.latticeForPiler1 = res.rows
+ })
// this.doUpdateFreightSpaceState()
this.init('piler')
- // clearInterval(timer)
+ clearInterval(timer)
var timer = setInterval(() => {
this.doUpdateFreightSpaceState()
// console.log(2222)
@@ -932,57 +938,65 @@ export default {
this.locationCodeList = []
self.tableData = []
- await getLocationMoldByLocationCode({ locationCode: eventData.all[0].nodeId }).then((res) => {
- this.locationCodeList = res.data
- })
+ // await containerList({ locationId: eventData.all[0].nodeId }).then((res) => {
+ // this.locationCodeList = res.data
+ // })
// let resultDatas = eventData.all
self.tableData.length = 0
- this.locationCodeList.map((data) => {
- let rowData = {
- locationCode: eventData.all[0].nodeId,
- moldNo: data.moldNo,
- model: data.model,
- moldName: data.moldName,
- inTime: data.inTime
+
+ this.latticeForPiler1.forEach((item) => {
+ if (item.locationCode === eventData.all[0].nodeId) {
+ self.tableData.push(item)
}
+ })
+ console.log(self.tableData)
- let storageRack, freightSpace
- // switch (data.customDataType) {
- // case 'storageRack':
- // storageRack = self.warehouseInfo.storageRack[data.nodeId]
- // let freightSpaces = []
- // Object.keys(storageRack.freightSpace).map((freightSpaceId) => {
- // let freightSpace = storageRack.freightSpace[freightSpaceId]
- // freightSpaces.push(freightSpace.id)
- // })
- // rowData.detail = '当前货架包含货位:' + freightSpaces.join('、')
- // break
- // case 'freightSpace':
- // storageRack = self.warehouseInfo.storageRack[data.nodeInfo.parentId]
- // // freightSpace = storageRack.freightSpace[data.nodeId]
- // // freightSpace.freight.name + '(' + freightSpace.freight.id +
- // let freightSpacess = []
+ // this.locationCodeList.map((data) => {
+ // let rowData = {
+ // locationCode: eventData.all[0].nodeId,
+ // moldNo: data.moldNo,
+ // model: data.model,
+ // moldName: data.moldName,
+ // inTime: data.inTime
+ // }
- // this.locationCodeList.forEach((item) => {
- // // console.log(item)
- // freightSpace = item.moldNo + '|' + item.model + (item.moldName ? '|' + item.moldName : item.moldName)
- // // console.log(freightSpace)
- // freightSpacess.push(freightSpace)
- // })
+ // let storageRack, freightSpace
+ // switch (data.customDataType) {
+ // case 'storageRack':
+ // storageRack = self.warehouseInfo.storageRack[data.nodeId]
+ // let freightSpaces = []
+ // Object.keys(storageRack.freightSpace).map((freightSpaceId) => {
+ // let freightSpace = storageRack.freightSpace[freightSpaceId]
+ // freightSpaces.push(freightSpace.id)
+ // })
+ // rowData.detail = '当前货架包含货位:' + freightSpaces.join('、')
+ // break
+ // case 'freightSpace':
+ // storageRack = self.warehouseInfo.storageRack[data.nodeInfo.parentId]
+ // // freightSpace = storageRack.freightSpace[data.nodeId]
+ // // freightSpace.freight.name + '(' + freightSpace.freight.id +
+ // let freightSpacess = []
- // // console.log(this.locationCodeList, freightSpacess)
- // rowData.detail = '所属货架:' + storageRack.id + '; 存放货物:(' + freightSpacess.join('、') + ')'
- // break
- // case 'piler':
- // break
- // case 'cargo':
- // let cargo = this.cargo[data.nodeId]
- // rowData.detail = '货物:' + cargo.name + '(' + cargo.id + ')'
- // break
- // }
- self.tableData.push(rowData)
- })
+ // this.locationCodeList.forEach((item) => {
+ // // console.log(item)
+ // freightSpace = item.moldNo + '|' + item.model + (item.moldName ? '|' + item.moldName : item.moldName)
+ // // console.log(freightSpace)
+ // freightSpacess.push(freightSpace)
+ // })
+
+ // // console.log(this.locationCodeList, freightSpacess)
+ // rowData.detail = '所属货架:' + storageRack.id + '; 存放货物:(' + freightSpacess.join('、') + ')'
+ // break
+ // case 'piler':
+ // break
+ // case 'cargo':
+ // let cargo = this.cargo[data.nodeId]
+ // rowData.detail = '货物:' + cargo.name + '(' + cargo.id + ')'
+ // break
+ // }
+
+ // })
},
/**
* 地图点击事件处理
@@ -1093,7 +1107,7 @@ export default {
*/
carPlay() {
let road = this.warehouseInfo.pilerInfo.road[this.carModel.pilerId.replace('piler-', '')]
- console.log(road, this.warehouseInfo, this.carModel)
+ // console.log(road, this.warehouseInfo, this.carModel)
this.carModel.pathPoints = [...this.warehouseInfo.carModel.carHeadPathPoints, [road.startPoint.x, 0, road.startPoint.y]]
this.mapControl.updateCar(this.carModel)
},
@@ -1152,12 +1166,11 @@ export default {
// console.log(this.lattice)
Object.keys(this.lattice).map((tileKey) => {
if (['interactionPoint', 'storageRack'].indexOf(this.lattice[tileKey].tileType.type) > -1) {
- let stateIndex = Math.round(Math.random() * (dicKeys.length - 1))
+ // let stateIndex = Math.round(Math.random() * (dicKeys.length - 1))
this.latticeForPiler1.forEach((item) => {
// console.log(item)
if (item.locationName === tileKey) {
- // console.log(tileKey)
dacKeysList.push(item.locationStatus)
freightSpaceState[tileKey] = item.locationStatus
}
@@ -1341,10 +1354,10 @@ export default {
.dataContainer {
position: absolute;
right: 10px;
- top: 10px;
+ top: 60px;
width: 520px;
- height: 800px;
+ height: 560px;
background-color: aliceblue;
- padding-top: 10px;
+ padding-top: 5px;
}