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 => { Object.keys(warehouseData.storageRack[storageRackId].freightSpace).map(freightSpaceId => {
let freightSpace = warehouseData.storageRack[storageRackId].freightSpace[freightSpaceId] let freightSpace = warehouseData.storageRack[storageRackId].freightSpace[freightSpaceId]
Object.keys(freightSpaceStateDictionary).map(tileStateKey => { Object.keys(freightSpaceStateDictionary).map(tileStateKey => {
if (freightSpace.state.toString() === tileStateKey) { if (freightSpace.state && freightSpace.state.toString() === tileStateKey) {
if (!freightSpaceStateDictionary[tileStateKey].nodeIds) { if (!freightSpaceStateDictionary[tileStateKey].nodeIds) {
freightSpaceStateDictionary[tileStateKey].nodeIds = [] freightSpaceStateDictionary[tileStateKey].nodeIds = []
} }

@ -8,6 +8,21 @@ export function listLocation(query) {
params: 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 // 查询货位信息详细lo
export function getLocation(id) { export function getLocation(id) {

@ -55,7 +55,7 @@ var arr=[
[1,12,2,"011202",1,0,120,380,100], [1,12,2,"011202",1,0,120,380,100],
[1,12,3,"011203",1,0,120,380,100], [1,12,3,"011203",1,0,120,380,100],
[1,12,4,"011204",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,2,"011302",1,0,120,380,100],
[1,13,3,"011303",1,0,120,380,100], [1,13,3,"011303",1,0,120,380,100],
[1,13,4,"011304",1,0,120,380,100], [1,13,4,"011304",1,0,120,380,100],
@ -310,31 +310,95 @@ var arrRe=[
// color: '#cccccc' // color: '#cccccc'
// } // }
// }, // },
// 0:空(无盒子)
// 1:禁止
// 2:实(有盒子)
// 3:实(BCR 异常的盒子)
// 4:实(BCR 重复 ID 的既存盒子)
// 5:实(双重搬入时的现有的盒子)
// 6:输送目的地预约中
// 7: 源目标
// 8: 切离禁用空的状态
// 9: 切离禁用实的状态
freightSpaceStateDictionary: { freightSpaceStateDictionary: {
'0': { '0': {
//无色
describe: '空', describe: '空',
color: '#ecf0f1' color: '#ecf0f1'
}, },
'1': { '1': {
describe: '满位', //红色
describe: '禁止',
color: '#ff4757'
},
'2': {
//淡蓝
describe: '实(有盒子)',
color: '#3742fa' color: '#3742fa'
}, },
'2': { '3': {
describe: '半满', describe: '实(BCR 异常的盒子)',
color: '#70a1ff' color: '#3742fa'
}, },
'3': { '4': {
describe: '托盘出库中', describe: '实(BCR 重复 ID 的既存盒子)',
color: '#ffa502' color: '#74b9ff'
}, },
'4': { '5': {
describe: '模具出库中', describe: '实(双重搬入时的现有的盒子)',
color: '#ff4757' color: '#3742fa'
}, },
'5':{ '6': {
describe: '只有空托盘', describe: '输送目的地预约中',
color: '#8670ff' 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: { pilerStateDictionary: {

@ -81,7 +81,7 @@
@click="doUpdateFreightSpaceState()" @click="doUpdateFreightSpaceState()"
>更新货位状态</Button> >更新货位状态</Button>
</div> </div>
<!-- <div <div
class="dataContainer" class="dataContainer"
v-show="rightStatus" v-show="rightStatus"
> >
@ -94,10 +94,11 @@
style="width: 30px;height: 30px;float: right;cursor: pointer;" style="width: 30px;height: 30px;float: right;cursor: pointer;"
> >
<Table <Table
:height="550"
:columns="columns" :columns="columns"
:data="tableData" :data="tableData"
></Table> ></Table>
</div> --> </div>
<div <div
id="mapContainer" id="mapContainer"
class="map-container" class="map-container"
@ -461,7 +462,8 @@
<script> <script>
import MapDrawing from '@/api/util/mapDrawing.js' import MapDrawing from '@/api/util/mapDrawing.js'
import sysConfig from '../config.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' // import { getLocationMoldByLocationCode } from '@/api/tool/dataScreen'
export default { export default {
name: 'HelloWorld', name: 'HelloWorld',
@ -580,27 +582,31 @@ export default {
}, },
columns: [ columns: [
{ {
title: 111, title: '货位',
key: 'locationCode' key: 'locationName'
}, },
{ {
title: 222, title: '盒子信息',
key: 'moldNo', key: 'boxId'
width: 150
}, },
{ {
title: 333, title: '备注',
key: 'model' key: 'remark',
}, width: 150
{
title: 444,
key: 'moldName'
},
{
title: 555,
key: 'inTime',
width: 140
} }
// {
// title: 333,
// key: 'model'
// },
// {
// title: 444,
// key: 'moldName'
// },
// {
// title: 555,
// key: 'inTime',
// width: 140
// }
], ],
tableData: [], tableData: [],
latticeForPiler1: [], latticeForPiler1: [],
@ -610,13 +616,13 @@ export default {
mounted() { mounted() {
// //
// console.log(window.systemConfig) // console.log(window.systemConfig)
// getLocationDataList({ pageNum: 1, pageSize: 999 }).then((res) => { listLocation({ pageNum: 1, pageSize: 9999 }).then((res) => {
// console.log(res) // console.log(res)
// this.latticeForPiler1 = res.rows this.latticeForPiler1 = res.rows
// }) })
// this.doUpdateFreightSpaceState() // this.doUpdateFreightSpaceState()
this.init('piler') this.init('piler')
// clearInterval(timer) clearInterval(timer)
var timer = setInterval(() => { var timer = setInterval(() => {
this.doUpdateFreightSpaceState() this.doUpdateFreightSpaceState()
// console.log(2222) // console.log(2222)
@ -932,57 +938,65 @@ export default {
this.locationCodeList = [] this.locationCodeList = []
self.tableData = [] self.tableData = []
await getLocationMoldByLocationCode({ locationCode: eventData.all[0].nodeId }).then((res) => { // await containerList({ locationId: eventData.all[0].nodeId }).then((res) => {
this.locationCodeList = res.data // this.locationCodeList = res.data
}) // })
// let resultDatas = eventData.all // let resultDatas = eventData.all
self.tableData.length = 0 self.tableData.length = 0
this.locationCodeList.map((data) => {
let rowData = { this.latticeForPiler1.forEach((item) => {
locationCode: eventData.all[0].nodeId, if (item.locationCode === eventData.all[0].nodeId) {
moldNo: data.moldNo, self.tableData.push(item)
model: data.model,
moldName: data.moldName,
inTime: data.inTime
} }
})
console.log(self.tableData)
let storageRack, freightSpace // this.locationCodeList.map((data) => {
// switch (data.customDataType) { // let rowData = {
// case 'storageRack': // locationCode: eventData.all[0].nodeId,
// storageRack = self.warehouseInfo.storageRack[data.nodeId] // moldNo: data.moldNo,
// let freightSpaces = [] // model: data.model,
// Object.keys(storageRack.freightSpace).map((freightSpaceId) => { // moldName: data.moldName,
// let freightSpace = storageRack.freightSpace[freightSpaceId] // inTime: data.inTime
// 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.forEach((item) => { // let storageRack, freightSpace
// // console.log(item) // switch (data.customDataType) {
// freightSpace = item.moldNo + '|' + item.model + (item.moldName ? '|' + item.moldName : item.moldName) // case 'storageRack':
// // console.log(freightSpace) // storageRack = self.warehouseInfo.storageRack[data.nodeId]
// freightSpacess.push(freightSpace) // 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) // this.locationCodeList.forEach((item) => {
// rowData.detail = '' + storageRack.id + '; (' + freightSpacess.join('') + ')' // // console.log(item)
// break // freightSpace = item.moldNo + '|' + item.model + (item.moldName ? '|' + item.moldName : item.moldName)
// case 'piler': // // console.log(freightSpace)
// break // freightSpacess.push(freightSpace)
// case 'cargo': // })
// let cargo = this.cargo[data.nodeId]
// rowData.detail = '' + cargo.name + '' + cargo.id + '' // // console.log(this.locationCodeList, freightSpacess)
// break // rowData.detail = '' + storageRack.id + '; (' + freightSpacess.join('') + ')'
// } // break
self.tableData.push(rowData) // 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() { carPlay() {
let road = this.warehouseInfo.pilerInfo.road[this.carModel.pilerId.replace('piler-', '')] 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.carModel.pathPoints = [...this.warehouseInfo.carModel.carHeadPathPoints, [road.startPoint.x, 0, road.startPoint.y]]
this.mapControl.updateCar(this.carModel) this.mapControl.updateCar(this.carModel)
}, },
@ -1152,12 +1166,11 @@ export default {
// console.log(this.lattice) // console.log(this.lattice)
Object.keys(this.lattice).map((tileKey) => { Object.keys(this.lattice).map((tileKey) => {
if (['interactionPoint', 'storageRack'].indexOf(this.lattice[tileKey].tileType.type) > -1) { 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) => { this.latticeForPiler1.forEach((item) => {
// console.log(item) // console.log(item)
if (item.locationName === tileKey) { if (item.locationName === tileKey) {
// console.log(tileKey)
dacKeysList.push(item.locationStatus) dacKeysList.push(item.locationStatus)
freightSpaceState[tileKey] = item.locationStatus freightSpaceState[tileKey] = item.locationStatus
} }
@ -1341,10 +1354,10 @@ export default {
.dataContainer { .dataContainer {
position: absolute; position: absolute;
right: 10px; right: 10px;
top: 10px; top: 60px;
width: 520px; width: 520px;
height: 800px; height: 560px;
background-color: aliceblue; background-color: aliceblue;
padding-top: 10px; padding-top: 5px;
} }
</style> </style>

Loading…
Cancel
Save