story#6071,编辑车辆页面选择服务逻辑修改

This commit is contained in:
2025-01-17 11:49:13 +08:00
parent c93655976b
commit 81a3b4b7a4

View File

@ -78,7 +78,6 @@
id="mySelect"
class="mySelect"
v-model="selectedOption"
>
<option
v-for="item in typeList"
@ -190,6 +189,7 @@ export default {
watch: {
// 监听 selectedOption 的变化
selectedOption(newVal) {
console.log("newVal",newVal)
// 如果选中了“地库车”,则限制其他选项的选择
if (newVal.includes('地库车')) {
// 最多选择两个选项
@ -216,11 +216,13 @@ export default {
isOptionDisabled(item) {
// 如果选中了“地库车”
if (this.selectedOption.includes('地库车')) {
console.log(11111111111)
// 只有“牵引车”、“小修车”和“一般平板车”可选
const allowedOptions = ['牵引车', '小修车', '一般平板车'];
if (!allowedOptions.includes(item) && item !== '地库车') {
return true; // 禁用其他选项
}
console.log(222222222)
// 如果已经选中了两个选项,禁用未选中的选项
if (this.selectedOption.length >= 2 && !this.selectedOption.includes(item)) {
return true;