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