为了便于车机的调试,去除所有发起任务的校验
批量复制的偏移量改为按实际坐标偏移
This commit is contained in:
parent
c349dcdbe3
commit
b5a5827f89
@ -62,6 +62,8 @@
|
|||||||
</template>
|
</template>
|
||||||
<div class="current-item-list">
|
<div class="current-item-list">
|
||||||
<!-- 楼层展开 -->
|
<!-- 楼层展开 -->
|
||||||
|
<!--
|
||||||
|
暂时去除所有发起任务的校验
|
||||||
<div
|
<div
|
||||||
v-for="(floor, floorIndex) in currentMapItemList"
|
v-for="(floor, floorIndex) in currentMapItemList"
|
||||||
:key="floorIndex"
|
:key="floorIndex"
|
||||||
@ -77,6 +79,16 @@
|
|||||||
? '#FFE2E2'
|
? '#FFE2E2'
|
||||||
: '#F6FFEF'
|
: '#F6FFEF'
|
||||||
}"
|
}"
|
||||||
|
> -->
|
||||||
|
<div
|
||||||
|
v-for="(floor, floorIndex) in currentMapItemList"
|
||||||
|
:key="floorIndex"
|
||||||
|
class="current-item"
|
||||||
|
:class="currentItem && currentItem.id == floor.id ? 'tool-active' : ''"
|
||||||
|
@click="chooseLocationPoint(floor)"
|
||||||
|
:style="{
|
||||||
|
background: '#F6FFEF'
|
||||||
|
}"
|
||||||
>
|
>
|
||||||
<div>层数: 第{{ floor.locationStorey }}层</div>
|
<div>层数: 第{{ floor.locationStorey }}层</div>
|
||||||
<div class="mt-4px">库位号: {{ floor.locationNo }}</div>
|
<div class="mt-4px">库位号: {{ floor.locationNo }}</div>
|
||||||
@ -343,26 +355,27 @@ const choosePoint = (item) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const chooseLocationPoint = (item) => {
|
const chooseLocationPoint = (item) => {
|
||||||
if (item.locationEnable === 0) {
|
// 暂时去除所有发起任务的校验
|
||||||
message.warning('该库位已被禁用')
|
// if (item.locationEnable === 0) {
|
||||||
return
|
// message.warning('该库位已被禁用')
|
||||||
}
|
// return
|
||||||
|
// }
|
||||||
|
|
||||||
if (item.locationLock === 0) {
|
// if (item.locationLock === 0) {
|
||||||
message.warning('该库位已被锁定')
|
// message.warning('该库位已被锁定')
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
|
|
||||||
// locationUseStatus 1占用 0空闲
|
// // locationUseStatus 1占用 0空闲
|
||||||
if (item.locationUseStatus === 1 && locationTypeStr.value === 'release') {
|
// if (item.locationUseStatus === 1 && locationTypeStr.value === 'release') {
|
||||||
message.warning('该库位已被占用')
|
// message.warning('该库位已被占用')
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (item.locationUseStatus === 0 && locationTypeStr.value === 'take') {
|
// if (item.locationUseStatus === 0 && locationTypeStr.value === 'take') {
|
||||||
message.warning('该库位没有货物')
|
// message.warning('该库位没有货物')
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
currentItem.value = item
|
currentItem.value = item
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,8 +7,8 @@
|
|||||||
class="batch-copying-dialog-form"
|
class="batch-copying-dialog-form"
|
||||||
@close="dialogClose"
|
@close="dialogClose"
|
||||||
>
|
>
|
||||||
<el-form :model="batchCopyingForm" label-width="100" ref="BatchCopyingFormRef" :rules="rules">
|
<el-form :model="batchCopyingForm" label-width="120" ref="BatchCopyingFormRef" :rules="rules">
|
||||||
<el-form-item label="X轴偏移量" prop="x" required>
|
<el-form-item label="X轴偏移量(实际点位)" prop="x" required>
|
||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="batchCopyingForm.x"
|
v-model="batchCopyingForm.x"
|
||||||
placeholder="请输入"
|
placeholder="请输入"
|
||||||
@ -18,7 +18,7 @@
|
|||||||
/>
|
/>
|
||||||
<el-text type="info" size="small">X轴往左为负值,往右为正值</el-text>
|
<el-text type="info" size="small">X轴往左为负值,往右为正值</el-text>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="Y轴偏移量" prop="y" required>
|
<el-form-item label="Y轴偏移量(实际点位)" prop="y" required>
|
||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="batchCopyingForm.y"
|
v-model="batchCopyingForm.y"
|
||||||
placeholder="请输入"
|
placeholder="请输入"
|
||||||
@ -60,8 +60,10 @@ const BatchCopyingFormRef = ref()
|
|||||||
const dialogFormVisible = ref(false) //列表的
|
const dialogFormVisible = ref(false) //列表的
|
||||||
|
|
||||||
const validateXValue = (rule, value, callback) => {
|
const validateXValue = (rule, value, callback) => {
|
||||||
let maxLeft = -Number(boundaryValue.value.left)
|
const { resolution, width } = props.imgBgObj
|
||||||
let maxRight = Number(props.imgBgObj.width) - Number(boundaryValue.value.right)
|
|
||||||
|
let maxLeft = -(Number(boundaryValue.value.left) / Number(resolution))
|
||||||
|
let maxRight = (Number(width) - Number(boundaryValue.value.right)) / Number(resolution)
|
||||||
if (value < maxLeft || value > maxRight) {
|
if (value < maxLeft || value > maxRight) {
|
||||||
callback(new Error(`不能超出地图宽度,可偏移范围为${maxLeft}至${maxRight}`))
|
callback(new Error(`不能超出地图宽度,可偏移范围为${maxLeft}至${maxRight}`))
|
||||||
} else {
|
} else {
|
||||||
@ -69,8 +71,10 @@ const validateXValue = (rule, value, callback) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const validateYValue = (rule, value, callback) => {
|
const validateYValue = (rule, value, callback) => {
|
||||||
let maxTop = -Number(boundaryValue.value.top)
|
const { resolution, height } = props.imgBgObj
|
||||||
let maxBottom = Number(props.imgBgObj.height) - Number(boundaryValue.value.bottom)
|
|
||||||
|
let maxTop = -(Number(boundaryValue.value.top) / Number(resolution))
|
||||||
|
let maxBottom = (Number(height) - Number(boundaryValue.value.bottom)) / Number(resolution)
|
||||||
if (value < maxTop || value > maxBottom) {
|
if (value < maxTop || value > maxBottom) {
|
||||||
callback(new Error(`不能超出地图宽度,可偏移范围为${maxTop}至${maxBottom}`))
|
callback(new Error(`不能超出地图宽度,可偏移范围为${maxTop}至${maxBottom}`))
|
||||||
} else {
|
} else {
|
||||||
@ -105,11 +109,23 @@ const submitLineLibraryForm = async () => {
|
|||||||
await BatchCopyingFormRef.value.validate(async (valid, fields) => {
|
await BatchCopyingFormRef.value.validate(async (valid, fields) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
dialogFormVisible.value = false
|
dialogFormVisible.value = false
|
||||||
emit('submitBatchCopyingFormSuccess', batchCopyingForm.value)
|
const x = roundToThree(
|
||||||
|
safeNumber(batchCopyingForm.value.x) / safeNumber(props.imgBgObj.resolution)
|
||||||
|
)
|
||||||
|
const y = roundToThree(
|
||||||
|
safeNumber(batchCopyingForm.value.y) / safeNumber(props.imgBgObj.resolution)
|
||||||
|
)
|
||||||
|
emit('submitBatchCopyingFormSuccess', {
|
||||||
|
x: x,
|
||||||
|
y: y
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const safeNumber = (value) => Number(value || 0)
|
||||||
|
const roundToThree = (num) => Math.round(Number(num) * 1000) / 1000
|
||||||
|
|
||||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -159,11 +159,20 @@
|
|||||||
placeholder="请选择"
|
placeholder="请选择"
|
||||||
@change="taskTypeChange(detailItem, index)"
|
@change="taskTypeChange(detailItem, index)"
|
||||||
>
|
>
|
||||||
|
<!--
|
||||||
|
暂时去除所有发起任务的校验
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in detailItem.taskTypeList"
|
v-for="item in detailItem.taskTypeList"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
:value="item.value"
|
:value="item.value"
|
||||||
|
/> -->
|
||||||
|
|
||||||
|
<el-option
|
||||||
|
v-for="item in allTaskTypeList"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -772,7 +781,7 @@
|
|||||||
<locationSelectionDialog
|
<locationSelectionDialog
|
||||||
:positionMapId="null"
|
:positionMapId="null"
|
||||||
ref="locationSelectionDialogRef"
|
ref="locationSelectionDialogRef"
|
||||||
@locationSelectionDialogSuccess="locationSelectionDialogSuccess"
|
@location-selection-dialog-success="locationSelectionDialogSuccess"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -783,13 +792,23 @@ import { RefreshRight, Position } from '@element-plus/icons-vue'
|
|||||||
import * as MapTaskAPi from '@/api/map/mapTask'
|
import * as MapTaskAPi from '@/api/map/mapTask'
|
||||||
import locationSelectionDialog from '../components/locationSelectionDialog.vue'
|
import locationSelectionDialog from '../components/locationSelectionDialog.vue'
|
||||||
|
|
||||||
defineOptions({ name: 'taskManagementCreateTask' })
|
defineOptions({ name: 'TaskManagementCreateTask' })
|
||||||
|
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
const { push } = useRouter()
|
const { push } = useRouter()
|
||||||
|
|
||||||
|
const allTaskTypeList = ref([
|
||||||
|
{ label: '取放货', value: 1 },
|
||||||
|
{ label: '停车', value: 2 },
|
||||||
|
{ label: '充电', value: 3 },
|
||||||
|
{ label: '移动', value: 4 },
|
||||||
|
{ label: '仅取货', value: 5 },
|
||||||
|
{ label: '仅放货', value: 6 },
|
||||||
|
{ label: '移动到点位', value: 9 }
|
||||||
|
])
|
||||||
|
|
||||||
const formData = ref({
|
const formData = ref({
|
||||||
montageTask: 1, //是否拼接任务(0:不拼接、1:拼接)
|
montageTask: 1, //是否拼接任务(0:不拼接、1:拼接)
|
||||||
montageNumber: 1, // 拼接任务数量
|
montageNumber: 1, // 拼接任务数量
|
||||||
@ -1101,118 +1120,122 @@ const montageTaskChange = (e) => {
|
|||||||
//搬空区域改变
|
//搬空区域改变
|
||||||
const doMoveAllChange = (e) => {
|
const doMoveAllChange = (e) => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
if (formData.value.doMoveAll === 1) {
|
|
||||||
if (formData.value.doCycle === 1) {
|
|
||||||
formData.value.taskDetailList.forEach((item, index) => {
|
|
||||||
item.taskTypeList = [
|
|
||||||
{ label: '取放货', value: 1 },
|
|
||||||
{ label: '移动', value: 4 },
|
|
||||||
{ label: '移动到点位', value: 9 }
|
|
||||||
]
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
formData.value.taskDetailList.forEach((item, index) => {
|
|
||||||
item.taskType = undefined
|
|
||||||
if (index === 0) {
|
|
||||||
item.taskTypeList = [
|
|
||||||
{ label: '取放货', value: 1 },
|
|
||||||
{ label: '停车', value: 2 },
|
|
||||||
{ label: '充电', value: 3 },
|
|
||||||
{ label: '移动', value: 4 },
|
|
||||||
{ label: '仅取货', value: 5 },
|
|
||||||
{ label: '仅放货', value: 6 },
|
|
||||||
{ label: '移动到点位', value: 9 }
|
|
||||||
]
|
|
||||||
} else {
|
|
||||||
item.taskTypeList = []
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
resolve(true)
|
resolve(true)
|
||||||
} else {
|
// 暂时去除所有发起任务的校验
|
||||||
try {
|
// if (formData.value.doMoveAll === 1) {
|
||||||
ElMessageBox.confirm('开启搬空所选线库/区域,任务类型只能选择取放货,是否切换?', '提示', {
|
// if (formData.value.doCycle === 1) {
|
||||||
confirmButtonText: '确定',
|
// formData.value.taskDetailList.forEach((item, index) => {
|
||||||
cancelButtonText: '取消',
|
// item.taskTypeList = [
|
||||||
type: 'warning'
|
// { label: '取放货', value: 1 },
|
||||||
})
|
// { label: '移动', value: 4 },
|
||||||
.then(async () => {
|
// { label: '移动到点位', value: 9 }
|
||||||
resolve(true)
|
// ]
|
||||||
formData.value.taskDetailList.forEach((item) => {
|
// })
|
||||||
item.taskType = undefined
|
// } else {
|
||||||
item.taskTypeList = [{ label: '取放货', value: 1 }]
|
// formData.value.taskDetailList.forEach((item, index) => {
|
||||||
})
|
// item.taskType = undefined
|
||||||
})
|
// if (index === 0) {
|
||||||
.catch(() => {
|
// item.taskTypeList = [
|
||||||
ElMessage({
|
// { label: '取放货', value: 1 },
|
||||||
type: 'info',
|
// { label: '停车', value: 2 },
|
||||||
message: '取消成功'
|
// { label: '充电', value: 3 },
|
||||||
})
|
// { label: '移动', value: 4 },
|
||||||
reject(false)
|
// { label: '仅取货', value: 5 },
|
||||||
})
|
// { label: '仅放货', value: 6 },
|
||||||
} catch (err) {
|
// { label: '移动到点位', value: 9 }
|
||||||
reject(false)
|
// ]
|
||||||
}
|
// } else {
|
||||||
}
|
// item.taskTypeList = []
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// resolve(true)
|
||||||
|
// } else {
|
||||||
|
// try {
|
||||||
|
// ElMessageBox.confirm('开启搬空所选线库/区域,任务类型只能选择取放货,是否切换?', '提示', {
|
||||||
|
// confirmButtonText: '确定',
|
||||||
|
// cancelButtonText: '取消',
|
||||||
|
// type: 'warning'
|
||||||
|
// })
|
||||||
|
// .then(async () => {
|
||||||
|
// resolve(true)
|
||||||
|
// formData.value.taskDetailList.forEach((item) => {
|
||||||
|
// item.taskType = undefined
|
||||||
|
// item.taskTypeList = [{ label: '取放货', value: 1 }]
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// .catch(() => {
|
||||||
|
// ElMessage({
|
||||||
|
// type: 'info',
|
||||||
|
// message: '取消成功'
|
||||||
|
// })
|
||||||
|
// reject(false)
|
||||||
|
// })
|
||||||
|
// } catch (err) {
|
||||||
|
// reject(false)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//任务循环切换
|
//任务循环切换
|
||||||
const doCycleChange = () => {
|
const doCycleChange = () => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
if (formData.value.doCycle === 1) {
|
|
||||||
formData.value.cycleNumber = 0 //循环次数
|
|
||||||
formData.value.taskDetailList.forEach((item, index) => {
|
|
||||||
item.taskType = undefined
|
|
||||||
if (index === 0) {
|
|
||||||
item.taskTypeList = [
|
|
||||||
{ label: '取放货', value: 1 },
|
|
||||||
{ label: '停车', value: 2 },
|
|
||||||
{ label: '充电', value: 3 },
|
|
||||||
{ label: '移动', value: 4 },
|
|
||||||
{ label: '仅取货', value: 5 },
|
|
||||||
{ label: '仅放货', value: 6 },
|
|
||||||
{ label: '移动到点位', value: 9 }
|
|
||||||
]
|
|
||||||
} else {
|
|
||||||
item.taskTypeList = []
|
|
||||||
}
|
|
||||||
})
|
|
||||||
resolve(true)
|
resolve(true)
|
||||||
} else {
|
// 暂时去除所有发起任务的校验
|
||||||
try {
|
// if (formData.value.doCycle === 1) {
|
||||||
ElMessageBox.confirm('开启循环任务,任务类型只能选择取放货和移动,是否切换?', '提示', {
|
// formData.value.cycleNumber = 0 //循环次数
|
||||||
confirmButtonText: '确定',
|
// formData.value.taskDetailList.forEach((item, index) => {
|
||||||
cancelButtonText: '取消',
|
// item.taskType = undefined
|
||||||
type: 'warning'
|
// if (index === 0) {
|
||||||
})
|
// item.taskTypeList = [
|
||||||
.then(async () => {
|
// { label: '取放货', value: 1 },
|
||||||
resolve(true)
|
// { label: '停车', value: 2 },
|
||||||
formData.value.cycleNumber = 1 //循环次数
|
// { label: '充电', value: 3 },
|
||||||
formData.value.taskDetailList.forEach((item) => {
|
// { label: '移动', value: 4 },
|
||||||
item.taskType = undefined
|
// { label: '仅取货', value: 5 },
|
||||||
if (formData.value.doMoveAll === 1) {
|
// { label: '仅放货', value: 6 },
|
||||||
item.taskTypeList = [{ label: '取放货', value: 1 }]
|
// { label: '移动到点位', value: 9 }
|
||||||
} else {
|
// ]
|
||||||
item.taskTypeList = [
|
// } else {
|
||||||
{ label: '取放货', value: 1 },
|
// item.taskTypeList = []
|
||||||
{ label: '移动', value: 4 },
|
// }
|
||||||
{ label: '移动到点位', value: 9 }
|
// })
|
||||||
]
|
// resolve(true)
|
||||||
}
|
// } else {
|
||||||
})
|
// try {
|
||||||
})
|
// ElMessageBox.confirm('开启循环任务,任务类型只能选择取放货和移动,是否切换?', '提示', {
|
||||||
.catch(() => {
|
// confirmButtonText: '确定',
|
||||||
ElMessage({
|
// cancelButtonText: '取消',
|
||||||
type: 'info',
|
// type: 'warning'
|
||||||
message: '取消成功'
|
// })
|
||||||
})
|
// .then(async () => {
|
||||||
reject(false)
|
// resolve(true)
|
||||||
})
|
// formData.value.cycleNumber = 1 //循环次数
|
||||||
} catch (err) {
|
// formData.value.taskDetailList.forEach((item) => {
|
||||||
reject(false)
|
// item.taskType = undefined
|
||||||
}
|
// if (formData.value.doMoveAll === 1) {
|
||||||
}
|
// item.taskTypeList = [{ label: '取放货', value: 1 }]
|
||||||
|
// } else {
|
||||||
|
// item.taskTypeList = [
|
||||||
|
// { label: '取放货', value: 1 },
|
||||||
|
// { label: '移动', value: 4 },
|
||||||
|
// { label: '移动到点位', value: 9 }
|
||||||
|
// ]
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// .catch(() => {
|
||||||
|
// ElMessage({
|
||||||
|
// type: 'info',
|
||||||
|
// message: '取消成功'
|
||||||
|
// })
|
||||||
|
// reject(false)
|
||||||
|
// })
|
||||||
|
// } catch (err) {
|
||||||
|
// reject(false)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user