新建任务时 选择车辆 提示机器人错误信息
This commit is contained in:
parent
5d682da707
commit
0494d9477e
@ -43,7 +43,13 @@
|
|||||||
>
|
>
|
||||||
<el-input-number v-model="form.layersNumber" :min="1" :max="3" />
|
<el-input-number v-model="form.layersNumber" :min="1" :max="3" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="排序" prop="locationNumber" v-if="form.type === 2" required>
|
<el-form-item
|
||||||
|
label="排序"
|
||||||
|
prop="locationNumber"
|
||||||
|
v-if="form.type === 2"
|
||||||
|
required
|
||||||
|
:rules="{ required: true, message: '请输入排序', trigger: 'change' }"
|
||||||
|
>
|
||||||
<el-input-number v-model="form.locationNumber" :min="1" :max="10000000" />
|
<el-input-number v-model="form.locationNumber" :min="1" :max="10000000" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
@ -173,7 +179,8 @@ const rules = reactive({
|
|||||||
locationX: [{ required: true, message: '请输入X', trigger: 'blur' }],
|
locationX: [{ required: true, message: '请输入X', trigger: 'blur' }],
|
||||||
locationY: [{ required: true, message: '请输入Y', trigger: 'blur' }],
|
locationY: [{ required: true, message: '请输入Y', trigger: 'blur' }],
|
||||||
type: [{ required: true, message: '请选择类型', trigger: 'blur' }],
|
type: [{ required: true, message: '请选择类型', trigger: 'blur' }],
|
||||||
layersNumber: [{ required: true, message: '请输入层数', trigger: 'blur' }]
|
layersNumber: [{ required: true, message: '请输入层数', trigger: 'blur' }],
|
||||||
|
locationNumber: [{ required: true, message: '请输入排序', trigger: 'blur' }]
|
||||||
})
|
})
|
||||||
|
|
||||||
const emit = defineEmits(['submitNodeSuccess', 'addEventListener'])
|
const emit = defineEmits(['submitNodeSuccess', 'addEventListener'])
|
||||||
@ -274,22 +281,40 @@ const typeChange = (type) => {
|
|||||||
form.value.inDirection = null
|
form.value.inDirection = null
|
||||||
form.value.outDirection = null
|
form.value.outDirection = null
|
||||||
form.value.locationNumber = null
|
form.value.locationNumber = null
|
||||||
form.value.locationDeep = 50
|
form.value.locationDeep = 40
|
||||||
form.value.locationWide = 50
|
form.value.locationWide = 40
|
||||||
form.value.locationDeepPx = 10
|
form.value.locationDeepPx = 8
|
||||||
form.value.locationWidePx = 10
|
form.value.locationWidePx = 8
|
||||||
} else if (type === 2) {
|
} else if (type === 2) {
|
||||||
form.value.locationNumber = 1
|
form.value.locationNumber = null
|
||||||
|
if (!form.value.id) {
|
||||||
|
form.value.locationDeep = 150
|
||||||
|
form.value.locationWide = 150
|
||||||
|
form.value.locationDeepPx = 30
|
||||||
|
form.value.locationWidePx = 30
|
||||||
|
}
|
||||||
} else if (type === 3) {
|
} else if (type === 3) {
|
||||||
form.value.direction = null
|
form.value.direction = null
|
||||||
form.value.inDirection = null
|
form.value.inDirection = null
|
||||||
form.value.outDirection = null
|
form.value.outDirection = null
|
||||||
form.value.locationNumber = null
|
form.value.locationNumber = null
|
||||||
|
if (!form.value.id) {
|
||||||
|
form.value.locationDeep = 150
|
||||||
|
form.value.locationWide = 150
|
||||||
|
form.value.locationDeepPx = 30
|
||||||
|
form.value.locationWidePx = 30
|
||||||
|
}
|
||||||
} else if (type === 4) {
|
} else if (type === 4) {
|
||||||
form.value.direction = null
|
form.value.direction = null
|
||||||
form.value.inDirection = null
|
form.value.inDirection = null
|
||||||
form.value.outDirection = null
|
form.value.outDirection = null
|
||||||
form.value.locationNumber = null
|
form.value.locationNumber = null
|
||||||
|
if (!form.value.id) {
|
||||||
|
form.value.locationDeep = 150
|
||||||
|
form.value.locationWide = 150
|
||||||
|
form.value.locationDeepPx = 30
|
||||||
|
form.value.locationWidePx = 30
|
||||||
|
}
|
||||||
} else if (type === 5) {
|
} else if (type === 5) {
|
||||||
form.value.layersNumber = null
|
form.value.layersNumber = null
|
||||||
form.value.direction = null
|
form.value.direction = null
|
||||||
|
@ -1974,6 +1974,13 @@ const clickDrawSelectionArea = () => {
|
|||||||
message.warning('至少框选三个点')
|
message.warning('至少框选三个点')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
let isHaveId = routeList.every((item) => {
|
||||||
|
return item.id
|
||||||
|
})
|
||||||
|
if (!isHaveId) {
|
||||||
|
message.warning('您选择的路径点存在未保存的')
|
||||||
|
return
|
||||||
|
}
|
||||||
const list = mapPointsToLine(routeList)
|
const list = mapPointsToLine(routeList)
|
||||||
const idNameMap = {}
|
const idNameMap = {}
|
||||||
list.forEach((item) => {
|
list.forEach((item) => {
|
||||||
|
@ -298,7 +298,11 @@
|
|||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="指定车辆">
|
<el-form-item label="指定车辆">
|
||||||
<el-select v-model="detailItem.robotNo" placeholder="请选择车辆">
|
<el-select
|
||||||
|
v-model="detailItem.robotNo"
|
||||||
|
placeholder="请选择车辆"
|
||||||
|
@change="chooseCarErrorMsg"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="car in robotList"
|
v-for="car in robotList"
|
||||||
:key="car.id"
|
:key="car.id"
|
||||||
@ -320,7 +324,11 @@
|
|||||||
:prop="`taskDetailList[${index}].robotNo`"
|
:prop="`taskDetailList[${index}].robotNo`"
|
||||||
:rules="{ required: true, message: '车辆不能为空', trigger: 'change' }"
|
:rules="{ required: true, message: '车辆不能为空', trigger: 'change' }"
|
||||||
>
|
>
|
||||||
<el-select v-model="detailItem.robotNo" placeholder="请选择车辆">
|
<el-select
|
||||||
|
v-model="detailItem.robotNo"
|
||||||
|
placeholder="请选择车辆"
|
||||||
|
@change="chooseCarErrorMsg"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="car in robotList"
|
v-for="car in robotList"
|
||||||
:key="car.id"
|
:key="car.id"
|
||||||
@ -390,7 +398,11 @@
|
|||||||
:prop="`taskDetailList[${index}].robotNo`"
|
:prop="`taskDetailList[${index}].robotNo`"
|
||||||
:rules="{ required: true, message: '车辆不能为空', trigger: 'change' }"
|
:rules="{ required: true, message: '车辆不能为空', trigger: 'change' }"
|
||||||
>
|
>
|
||||||
<el-select v-model="detailItem.robotNo" placeholder="请选择车辆">
|
<el-select
|
||||||
|
v-model="detailItem.robotNo"
|
||||||
|
placeholder="请选择车辆"
|
||||||
|
@change="chooseCarErrorMsg"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="car in robotList"
|
v-for="car in robotList"
|
||||||
:key="car.id"
|
:key="car.id"
|
||||||
@ -501,7 +513,11 @@
|
|||||||
:prop="`taskDetailList[${index}].robotNo`"
|
:prop="`taskDetailList[${index}].robotNo`"
|
||||||
:rules="{ required: true, message: '车辆不能为空', trigger: 'change' }"
|
:rules="{ required: true, message: '车辆不能为空', trigger: 'change' }"
|
||||||
>
|
>
|
||||||
<el-select v-model="detailItem.robotNo" placeholder="请选择车辆">
|
<el-select
|
||||||
|
v-model="detailItem.robotNo"
|
||||||
|
placeholder="请选择车辆"
|
||||||
|
@change="chooseCarErrorMsg"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="car in robotList"
|
v-for="car in robotList"
|
||||||
:key="car.id"
|
:key="car.id"
|
||||||
@ -577,7 +593,11 @@
|
|||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item required label="指定车辆" prop="montageTask">
|
<el-form-item required label="指定车辆" prop="montageTask">
|
||||||
<el-select v-model="detailItem.robotNo" placeholder="请选择车辆">
|
<el-select
|
||||||
|
v-model="detailItem.robotNo"
|
||||||
|
placeholder="请选择车辆"
|
||||||
|
@change="chooseCarErrorMsg"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="car in robotList"
|
v-for="car in robotList"
|
||||||
:key="car.id"
|
:key="car.id"
|
||||||
@ -828,10 +848,14 @@ const getCanUseRobotList = async () => {
|
|||||||
|
|
||||||
//车辆切换
|
//车辆切换
|
||||||
const robotNoChange = (e, detailItem) => {
|
const robotNoChange = (e, detailItem) => {
|
||||||
let car = robotList.value.filter((item) => {
|
let car = robotList.value.find((item) => {
|
||||||
return item.robotNo == e
|
return item.robotNo == e
|
||||||
})
|
})
|
||||||
detailItem.electricity = car[0].electricity
|
detailItem.electricity = car.electricity
|
||||||
|
|
||||||
|
if (car?.errorMsg) {
|
||||||
|
message.warning(car.errorMsg)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//任务类型切换
|
//任务类型切换
|
||||||
@ -1073,6 +1097,15 @@ const releaseTypeChange = (item) => {
|
|||||||
item.releaseId = undefined
|
item.releaseId = undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//选择车辆
|
||||||
|
const chooseCarErrorMsg = (e) => {
|
||||||
|
let carItem = robotList.value.find((item) => item.robotNo === e)
|
||||||
|
|
||||||
|
if (carItem?.errorMsg) {
|
||||||
|
message.warning(carItem.errorMsg)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//提交表单
|
//提交表单
|
||||||
const formRef = ref()
|
const formRef = ref()
|
||||||
const formLoading = ref(false)
|
const formLoading = ref(false)
|
||||||
|
Loading…
Reference in New Issue
Block a user