master
Mr.sun 2 years ago
parent 37e85a4a33
commit a9b421d08e
  1. 2
      src/api/util/mapDrawing.js
  2. 15
      src/api/wcs/location.js
  3. 96
      src/config.js
  4. 161
      src/views/index.vue

@ -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 = []
}

@ -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) {

@ -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: {

@ -81,7 +81,7 @@
@click="doUpdateFreightSpaceState()"
>更新货位状态</Button>
</div>
<!-- <div
<div
class="dataContainer"
v-show="rightStatus"
>
@ -94,10 +94,11 @@
style="width: 30px;height: 30px;float: right;cursor: pointer;"
>
<Table
:height="550"
:columns="columns"
:data="tableData"
></Table>
</div> -->
</div>
<div
id="mapContainer"
class="map-container"
@ -461,7 +462,8 @@
<script>
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;
}
</style>

Loading…
Cancel
Save