Compare commits

...

3 Commits

Author SHA1 Message Date
yyy
dbc960d4a1 Merge branch 'xhf' of http://git.znkjfw.com/ak/zn-admin-vue3-wcs into xhf 2025-03-19 10:03:28 +08:00
yyy
d3499c3794 复制节点清空排序 让用户自己输入排序 2025-03-19 10:03:23 +08:00
yyy
3399d9d3bb 标记 2025-03-19 09:36:08 +08:00
2 changed files with 87 additions and 29 deletions

View File

@ -7,7 +7,7 @@
class="equipment-form-dialog"
@close="dialogClose"
>
<el-form :model="form" label-width="110" ref="ruleFormRef">
<el-form :model="form" label-width="110" ref="ruleFormRef" :rules="rules">
<el-form-item label="物料区域名称" prop="skuInfo" required>
<el-input v-model="form.skuInfo" placeholder="请输入物料区域名称" />
</el-form-item>

View File

@ -161,6 +161,7 @@
trigger="click"
v-else-if="item.switchType === 'marker'"
width="220"
:visible="state.popoverVisible"
>
<template #reference>
<div
@ -201,6 +202,12 @@
<el-input v-model="state.markForm.originalNode" style="width: 240px" disabled />
</el-form-item>
<div style="text-align: right">
<el-button
size="small"
style="width: 64px; height: 30px; background: #efefef"
@click="markFormCancel()"
>取消</el-button
>
<el-button
size="small"
style="width: 64px; height: 30px; background: #00329f"
@ -355,7 +362,7 @@
v-if="item.type === 2 && item.layerSelectionShow"
src="https://api.znkjfw.com/admin-api/infra/file/4/get/库位库存_png_179_1739326653035.png"
alt=""
:style="nodeStyle(item, index)"
:style="binLocationStyle(item, index)"
/>
<!-- 3 设备点 -->
<img
@ -742,6 +749,7 @@ const inputBoxRef = ref() //文字输入框
const message = useMessage() //
//
const nodeStyle = (item, index) => {
return {
verticalAlign: 'top',
@ -750,6 +758,20 @@ const nodeStyle = (item, index) => {
border: state.currentItemIndex === index ? '1px dashed #000' : 'none'
}
}
//
const binLocationStyle = (item, index) => {
return {
verticalAlign: 'top',
width: item.locationWidePx + 'px',
height: item.locationDeepPx + 'px',
border:
state.currentItemIndex === index
? '1px dashed #000'
: state.noLocationNumberList.includes(index)
? '1px dashed red'
: 'none'
}
}
//
const interfaceRefreshed = ref(true)
@ -1023,6 +1045,14 @@ const submitNodeSuccess = (form) => {
}
})
addEditHistory()
//
state.noLocationNumberList = state.allMapPointInfo.reduce((invalidIndexes, item, index) => {
if (item.type === 2 && !item.locationNumber) {
invalidIndexes.push(index) //
}
return invalidIndexes
}, [])
}
//
@ -1254,7 +1284,9 @@ const state = reactive({
originalNode: '', //
robotNo: '' //AGV
}, //
mapMarkCarList: [] //
mapMarkCarList: [], //
popoverVisible: false, //
noLocationNumberList: [] //index
})
const toolbarClick = async (item) => {
@ -1553,7 +1585,7 @@ const replicationNode = () => {
mapImageUrl: copyMapItem.mapImageUrl,
locationYaw: copyMapItem.locationYaw,
areaId: null,
locationNumber: copyMapItem.locationNumber || null
locationNumber: null
}
message.success('复制成功')
}
@ -1600,6 +1632,7 @@ const mapMark = async () => {
state.markForm.markProperty = ''
state.markForm.originalNode = ''
}
state.popoverVisible = true
}
//
const macAddressChange = (e) => {
@ -1608,6 +1641,15 @@ const macAddressChange = (e) => {
state.markForm.robotNo = targetItem.robotNo
}
}
//
const markFormCancel = () => {
state.popoverVisible = false
state.markForm.markProperty = ''
state.markForm.originalNode = ''
state.markForm.macAddress = ''
state.markForm.robotNo = ''
}
//
const markFormSubmit = async () => {
if (!state.markForm.macAddress) {
message.warning('请选择车辆')
@ -1649,34 +1691,35 @@ const markFormSubmit = async () => {
addEditHistory()
} else {
message.warning('未采集到该AGV点位信息')
//
state.allMapPointInfo.push({
positionMapId: imgBgObj.positionMapId, //id
layerSelectionShow: true,
locationX: pointPx.x,
locationY: pointPx.y,
actualLocationX: actualPoint.actualLocationX,
actualLocationY: actualPoint.actualLocationY,
locationDeep: 40,
locationWide: 40,
locationDeepPx: 8,
locationWidePx: 8,
angle: 0,
draggable: true,
resizable: true,
rotatable: false,
lockAspectRatio: false, //
mapImageUrl: '',
type: 1, //1
dataList: [], //
dataObj: {}, //
locationYaw: 0 //
})
addEditHistory()
}
} else {
//
state.allMapPointInfo.push({
positionMapId: imgBgObj.positionMapId, //id
layerSelectionShow: true,
locationX: pointPx.x,
locationY: pointPx.y,
actualLocationX: actualPoint.actualLocationX,
actualLocationY: actualPoint.actualLocationY,
locationDeep: 40,
locationWide: 40,
locationDeepPx: 8,
locationWidePx: 8,
angle: 0,
draggable: true,
resizable: true,
rotatable: false,
lockAspectRatio: false, //
mapImageUrl: '',
type: 1, //1
dataList: [], //
dataObj: {}, //
locationYaw: 0 //
})
addEditHistory()
message.warning('未采集到该AGV点位信息')
}
state.popoverVisible = false
}
//
@ -2498,6 +2541,20 @@ const getAllMapRoute = async () => {
}
//
const saveMap = async () => {
//
state.noLocationNumberList = state.allMapPointInfo.reduce((invalidIndexes, item, index) => {
if (item.type === 2 && !item.locationNumber) {
invalidIndexes.push(index) //
}
return invalidIndexes
}, [])
if (state.noLocationNumberList.length !== 0) {
state.currentItemIndex = -1
message.error('存在库位未填写排序号')
return
}
const loading = ElLoading.service({
lock: true,
text: '保存中',
@ -2521,6 +2578,7 @@ const saveMap = async () => {
//
const saveNodeList = async () => {
let list = state.allMapPointInfo
list.forEach((item) => {
if (item.type === 2) {
//