|
|
|
|
@@ -1,5 +1,64 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div class="app-container">
|
|
|
|
|
<!-- 筛选区域 -->
|
|
|
|
|
<div class="filter-container">
|
|
|
|
|
<el-form :inline="true" :model="queryParams" class="filter-form">
|
|
|
|
|
<el-form-item :label="$t('basstandPosition.positionType') /* 点位类型 */ + ':'">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="queryParams.portType"
|
|
|
|
|
:placeholder="$t('basstandPosition.selectPositionType') /* 请选择点位类型 */"
|
|
|
|
|
clearable
|
|
|
|
|
@change="handleFilterChange"
|
|
|
|
|
style="width: 150px;"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in dict.type.port_type"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
>
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item :label="$t('basstandPosition.positionName') /* 点位名称 */ + ':'">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="queryParams.portName"
|
|
|
|
|
:placeholder="$t('basstandPosition.enterPositionName') /* 请输入点位名称 */"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter.native="handleFilterSearch"
|
|
|
|
|
style="width: 200px;"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item :label="$t('basstandPosition.positionStatus') /* 点位状态 */ + ':'">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="queryParams.agvStatus"
|
|
|
|
|
:placeholder="$t('basstandPosition.selectPositionStatus') /* 请选择点位状态 */"
|
|
|
|
|
clearable
|
|
|
|
|
@change="handleFilterChange"
|
|
|
|
|
style="width: 150px;"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in dict.type.agv_status"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
>
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-button type="primary" @click="handleFilterSearch" size="small">
|
|
|
|
|
<i class="el-icon-search"></i>
|
|
|
|
|
{{ $t('basstandPosition.search') /* 搜索 */ }}
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button @click="handleFilterReset" size="small">
|
|
|
|
|
<i class="el-icon-refresh"></i>
|
|
|
|
|
{{ $t('basstandPosition.reset') /* 重置 */ }}
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div v-loading="loading" class="position-grid">
|
|
|
|
|
<div
|
|
|
|
|
v-for="(item, index) in dataList"
|
|
|
|
|
@@ -28,8 +87,10 @@
|
|
|
|
|
<span class="value">{{ item.port.createMan || '-' }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="info-item">
|
|
|
|
|
<span class="label">{{ $t('basstandPosition.warehouseId') /* 仓库ID */ }}:</span>
|
|
|
|
|
<span class="value">{{ item.port.warehouseId || '-' }}</span>
|
|
|
|
|
<span class="label">{{ $t('basstandPosition.positionStatus') /* 点位状态 */ }}:</span>
|
|
|
|
|
<span class="value">
|
|
|
|
|
<dict-tag :options="dict.type.agv_status" :value="item.port.agvStatus"/>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
@@ -38,7 +99,7 @@
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
size="small"
|
|
|
|
|
:disabled="!hasContainers(item)"
|
|
|
|
|
:disabled="item.port.agvStatus === 1 || !hasContainers(item)"
|
|
|
|
|
@click="showContainerDetails(item)"
|
|
|
|
|
class="full-width-button"
|
|
|
|
|
v-hasPermi="['bas:basstandPosition:detail']"
|
|
|
|
|
@@ -50,7 +111,7 @@
|
|
|
|
|
<el-button
|
|
|
|
|
type="success"
|
|
|
|
|
size="small"
|
|
|
|
|
:disabled="hasContainers(item)"
|
|
|
|
|
:disabled="item.port.agvStatus === 1 || hasContainers(item)"
|
|
|
|
|
@click="callMaterialRack(item)"
|
|
|
|
|
class="half-width-button"
|
|
|
|
|
v-hasPermi="['bas:basstandPosition:call']"
|
|
|
|
|
@@ -60,7 +121,7 @@
|
|
|
|
|
<el-button
|
|
|
|
|
type="warning"
|
|
|
|
|
size="small"
|
|
|
|
|
:disabled="!hasContainers(item)"
|
|
|
|
|
:disabled="item.port.agvStatus === 1 || !hasContainers(item)"
|
|
|
|
|
@click="deliverContainer(item)"
|
|
|
|
|
class="half-width-button"
|
|
|
|
|
v-hasPermi="['bas:basstandPosition:deliver']"
|
|
|
|
|
@@ -104,8 +165,10 @@
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="detail-row">
|
|
|
|
|
<span class="detail-label">{{ $t('basstandPosition.warehouseId') /* 仓库ID */ }}:</span>
|
|
|
|
|
<span class="detail-value">{{ selectedPosition.port.warehouseId || '-' }}</span>
|
|
|
|
|
<span class="detail-label">{{ $t('basstandPosition.positionStatus') /* 点位状态 */ }}:</span>
|
|
|
|
|
<span class="detail-value">
|
|
|
|
|
<dict-tag :options="dict.type.agv_status" :value="selectedPosition.port.agvStatus"/>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</el-card>
|
|
|
|
|
@@ -277,7 +340,11 @@
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="port.portDesc" :label="$t('basstandPosition.positionDesc') /* 点位描述 */" min-width="150" />
|
|
|
|
|
<el-table-column prop="port.warehouseId" :label="$t('basstandPosition.warehouseId') /* 仓库ID */" width="120" align="center" />
|
|
|
|
|
<el-table-column prop="port.agvStatus" :label="$t('basstandPosition.positionStatus') /* 点位状态 */" width="120" align="center">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<dict-tag :options="dict.type.agv_status" :value="scope.row.port.agvStatus"/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="port.createMan" :label="$t('basstandPosition.creator') /* 创建人 */" width="120" align="center" />
|
|
|
|
|
<el-table-column :label="$t('basstandPosition.containerStatus') /* 容器状态 */" width="120" align="center">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
@@ -388,7 +455,13 @@
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="port.portDesc" :label="$t('basstandPosition.positionDesc') /* 点位描述 */" min-width="150" />
|
|
|
|
|
<el-table-column prop="port.warehouseId" :label="$t('basstandPosition.warehouseId') /* 仓库ID */" width="120" align="center" />
|
|
|
|
|
<!-- <el-table-column prop="port.warehouseId" :label="$t('basstandPosition.warehouseId') /* 仓库ID */" width="120" align="center" /> -->
|
|
|
|
|
<el-table-column prop="port.agvStatus" :label="$t('basstandPosition.positionStatus') /* 点位状态 */" width="120" align="center">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<dict-tag :options="dict.type.agv_status" :value="scope.row.port.agvStatus"/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
|
|
<el-table-column prop="port.createMan" :label="$t('basstandPosition.creator') /* 创建人 */" width="120" align="center" />
|
|
|
|
|
<el-table-column :label="$t('basstandPosition.containerStatus') /* 容器状态 */" width="120" align="center">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
@@ -439,12 +512,12 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { getPortType6List, getNoContainerList, getHasContainerList } from "@/api/bas/basstandPosition"
|
|
|
|
|
import { getPortType6List, getNoContainerList, getHasContainerList, pushAgvMoveJob } from "@/api/bas/basstandPosition"
|
|
|
|
|
import { getDicts } from "@/api/system/dict/data"
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "BasStandPosition",
|
|
|
|
|
dicts: ['port_type'],
|
|
|
|
|
dicts: ['port_type', 'agv_status'],
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
// 遮罩层
|
|
|
|
|
@@ -456,7 +529,10 @@ export default {
|
|
|
|
|
// 查询参数
|
|
|
|
|
queryParams: {
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
pageSize: 10
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
portType: null,
|
|
|
|
|
portName: null,
|
|
|
|
|
agvStatus: null
|
|
|
|
|
},
|
|
|
|
|
// 对话框显示状态
|
|
|
|
|
dialogVisible: false,
|
|
|
|
|
@@ -493,7 +569,10 @@ export default {
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
portType: null
|
|
|
|
|
},
|
|
|
|
|
currentCallPosition: null
|
|
|
|
|
currentCallPosition: null,
|
|
|
|
|
// 定时器相关
|
|
|
|
|
refreshTimer: null,
|
|
|
|
|
isPageVisible: true
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
@@ -505,6 +584,18 @@ export default {
|
|
|
|
|
this.getList()
|
|
|
|
|
this.getDictList()
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
// 启动定时器
|
|
|
|
|
this.startRefreshTimer()
|
|
|
|
|
// 监听页面可见性变化
|
|
|
|
|
this.addVisibilityListener()
|
|
|
|
|
},
|
|
|
|
|
beforeDestroy() {
|
|
|
|
|
// 清除定时器
|
|
|
|
|
this.clearRefreshTimer()
|
|
|
|
|
// 移除页面可见性监听
|
|
|
|
|
this.removeVisibilityListener()
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
/** 获取字典数据 */
|
|
|
|
|
getDictList() {
|
|
|
|
|
@@ -561,6 +652,45 @@ export default {
|
|
|
|
|
})
|
|
|
|
|
this.getList()
|
|
|
|
|
},
|
|
|
|
|
/** 启动定时器 */
|
|
|
|
|
startRefreshTimer() {
|
|
|
|
|
// 清除已存在的定时器
|
|
|
|
|
this.clearRefreshTimer()
|
|
|
|
|
// 只有在页面可见时才启动定时器
|
|
|
|
|
if (this.isPageVisible) {
|
|
|
|
|
this.refreshTimer = setInterval(() => {
|
|
|
|
|
if (this.isPageVisible) {
|
|
|
|
|
this.getList()
|
|
|
|
|
}
|
|
|
|
|
}, 10000) // 10秒
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
/** 清除定时器 */
|
|
|
|
|
clearRefreshTimer() {
|
|
|
|
|
if (this.refreshTimer) {
|
|
|
|
|
clearInterval(this.refreshTimer)
|
|
|
|
|
this.refreshTimer = null
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
/** 添加页面可见性监听 */
|
|
|
|
|
addVisibilityListener() {
|
|
|
|
|
document.addEventListener('visibilitychange', this.handleVisibilityChange)
|
|
|
|
|
},
|
|
|
|
|
/** 移除页面可见性监听 */
|
|
|
|
|
removeVisibilityListener() {
|
|
|
|
|
document.removeEventListener('visibilitychange', this.handleVisibilityChange)
|
|
|
|
|
},
|
|
|
|
|
/** 处理页面可见性变化 */
|
|
|
|
|
handleVisibilityChange() {
|
|
|
|
|
this.isPageVisible = !document.hidden
|
|
|
|
|
if (this.isPageVisible) {
|
|
|
|
|
// 页面变为可见时,启动定时器
|
|
|
|
|
this.startRefreshTimer()
|
|
|
|
|
} else {
|
|
|
|
|
// 页面变为隐藏时,暂停定时器
|
|
|
|
|
this.clearRefreshTimer()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
/** 获取无容器点位列表 */
|
|
|
|
|
getNoContainerList() {
|
|
|
|
|
this.noContainerLoading = true
|
|
|
|
|
@@ -607,6 +737,24 @@ export default {
|
|
|
|
|
this.noContainerQueryParams.pageNum = 1
|
|
|
|
|
this.getNoContainerList()
|
|
|
|
|
},
|
|
|
|
|
/** 主筛选区域 - 筛选条件变化处理 */
|
|
|
|
|
handleFilterChange() {
|
|
|
|
|
this.queryParams.pageNum = 1
|
|
|
|
|
this.getList()
|
|
|
|
|
},
|
|
|
|
|
/** 主筛选区域 - 搜索处理 */
|
|
|
|
|
handleFilterSearch() {
|
|
|
|
|
this.queryParams.pageNum = 1
|
|
|
|
|
this.getList()
|
|
|
|
|
},
|
|
|
|
|
/** 主筛选区域 - 重置处理 */
|
|
|
|
|
handleFilterReset() {
|
|
|
|
|
this.queryParams.portType = null
|
|
|
|
|
this.queryParams.portName = null
|
|
|
|
|
this.queryParams.agvStatus = null
|
|
|
|
|
this.queryParams.pageNum = 1
|
|
|
|
|
this.getList()
|
|
|
|
|
},
|
|
|
|
|
/** 呼叫料架弹框 - 点位类型变化处理 */
|
|
|
|
|
handleCallPortTypeChange() {
|
|
|
|
|
this.hasContainerQueryParams.pageNum = 1
|
|
|
|
|
@@ -639,20 +787,26 @@ export default {
|
|
|
|
|
if (this.currentDeliverPosition && this.currentDeliverPosition.containers && this.currentDeliverPosition.containers.length > 0) {
|
|
|
|
|
containerCode = this.currentDeliverPosition.containers[0].containerId
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 打印配送信息
|
|
|
|
|
console.log('当前点位名称:', currentPortName)
|
|
|
|
|
console.log('目标点位名称:', targetPortName)
|
|
|
|
|
console.log('容器编码:', containerCode)
|
|
|
|
|
// console.log('当前点位完整信息:', this.currentDeliverPosition)
|
|
|
|
|
// console.log('目标点位完整信息:', row)
|
|
|
|
|
|
|
|
|
|
this.$message({
|
|
|
|
|
type: 'success',
|
|
|
|
|
message: this.$t('basstandPosition.deliveringContainer', { containerCode, currentPortName, targetPortName }) /* 正在配送容器... */
|
|
|
|
|
// 调用AGV搬运接口
|
|
|
|
|
const agvMoveParam = {
|
|
|
|
|
startPoint: currentPortName,
|
|
|
|
|
endPoint: targetPortName,
|
|
|
|
|
containerCode: containerCode
|
|
|
|
|
}
|
|
|
|
|
// 配送容器
|
|
|
|
|
pushAgvMoveJob(agvMoveParam).then(response => {
|
|
|
|
|
this.$message({
|
|
|
|
|
type: 'success',
|
|
|
|
|
message: this.$t('basstandPosition.deliveringContainer', { containerCode, currentPortName, targetPortName }) /* 正在配送容器... */
|
|
|
|
|
})
|
|
|
|
|
this.deliverDialogVisible = false
|
|
|
|
|
this.refreshData() // 刷新列表
|
|
|
|
|
}).catch(error => {
|
|
|
|
|
this.$message({
|
|
|
|
|
type: 'error',
|
|
|
|
|
message: '配送失败: ' + (error.msg || error.message || '未知错误')
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
// 调用配送接口
|
|
|
|
|
this.deliverDialogVisible = false
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
this.$message({
|
|
|
|
|
type: 'info',
|
|
|
|
|
@@ -678,20 +832,26 @@ export default {
|
|
|
|
|
? row.containers[0].containerId
|
|
|
|
|
: '未知容器'
|
|
|
|
|
|
|
|
|
|
// 打印呼叫信息
|
|
|
|
|
console.log('=== 呼叫料架信息 ===')
|
|
|
|
|
console.log('当前点位名称:', currentPortName)
|
|
|
|
|
console.log('源点位名称:', sourcePortName)
|
|
|
|
|
console.log('容器编码:', containerCode)
|
|
|
|
|
console.log('==================')
|
|
|
|
|
|
|
|
|
|
// 这里添加实际的呼叫逻辑
|
|
|
|
|
this.$message({
|
|
|
|
|
type: 'success',
|
|
|
|
|
message: this.$t('basstandPosition.shelfCalledSuccess', { containerCode, sourcePortName, currentPortName }) /* 料架呼叫成功 */
|
|
|
|
|
// 调用AGV搬运接口
|
|
|
|
|
const agvMoveParam = {
|
|
|
|
|
startPoint: sourcePortName,
|
|
|
|
|
endPoint: currentPortName,
|
|
|
|
|
containerCode: containerCode
|
|
|
|
|
}
|
|
|
|
|
//呼叫料架
|
|
|
|
|
pushAgvMoveJob(agvMoveParam).then(response => {
|
|
|
|
|
this.$message({
|
|
|
|
|
type: 'success',
|
|
|
|
|
message: this.$t('basstandPosition.shelfCalledSuccess', { containerCode, sourcePortName, currentPortName }) /* 料架呼叫成功 */
|
|
|
|
|
})
|
|
|
|
|
this.callDialogVisible = false
|
|
|
|
|
this.refreshData() // 刷新列表
|
|
|
|
|
}).catch(error => {
|
|
|
|
|
this.$message({
|
|
|
|
|
type: 'error',
|
|
|
|
|
message: '呼叫失败: ' + (error.msg || error.message || '未知错误')
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
this.callDialogVisible = false
|
|
|
|
|
this.getHasContainerList() // 刷新列表
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
this.$message({
|
|
|
|
|
type: 'info',
|
|
|
|
|
@@ -987,21 +1147,59 @@ export default {
|
|
|
|
|
margin-bottom: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.filter-form .el-form-item {
|
|
|
|
|
margin-bottom: 0;
|
|
|
|
|
margin-right: 15px;
|
|
|
|
|
}
|
|
|
|
|
/* 主筛选区域样式 */
|
|
|
|
|
.filter-container {
|
|
|
|
|
margin-bottom: 20px;
|
|
|
|
|
padding: 20px;
|
|
|
|
|
background-color: #ffffff;
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
|
|
|
border: 1px solid #e4e7ed;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.filter-form .el-form-item__label {
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
color: #606266;
|
|
|
|
|
}
|
|
|
|
|
.filter-container .filter-form {
|
|
|
|
|
margin-bottom: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.filter-form .el-button {
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
}
|
|
|
|
|
.filter-container .el-form-item {
|
|
|
|
|
margin-bottom: 0;
|
|
|
|
|
margin-right: 20px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.filter-form .el-select {
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
}
|
|
|
|
|
.filter-container .el-form-item__label {
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
color: #606266;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.filter-container .el-button {
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.filter-container .el-button--primary {
|
|
|
|
|
background-color: #409eff;
|
|
|
|
|
border-color: #409eff;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.filter-container .el-button--primary:hover {
|
|
|
|
|
background-color: #66b1ff;
|
|
|
|
|
border-color: #66b1ff;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.filter-form .el-form-item {
|
|
|
|
|
margin-bottom: 0;
|
|
|
|
|
margin-right: 15px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.filter-form .el-form-item__label {
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
color: #606266;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.filter-form .el-button {
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.filter-form .el-select {
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|