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