story#6071,编辑车辆页面选择服务逻辑修改
This commit is contained in:
@ -30,10 +30,10 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<script src="https://webapi.amap.com/maps?v=1.4.15&key=2560bbf04daef66c810c5e6a97e8c508&plugin=AMap.Polyline"></script>
|
<script src="https://webapi.amap.com/maps?v=1.4.15&key=2560bbf04daef66c810c5e6a97e8c508&plugin=AMap.Polyline"></script>
|
||||||
<!-- <script src="https://unpkg.com/vconsole@latest/dist/vconsole.min.js"></script>-->
|
<script src="https://unpkg.com/vconsole@latest/dist/vconsole.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
// VConsole 默认会挂载到 `window.VConsole` 上
|
// VConsole 默认会挂载到 `window.VConsole` 上
|
||||||
// let vConsole = new window.VConsole();
|
let vConsole = new window.VConsole();
|
||||||
(function (doc, win) {
|
(function (doc, win) {
|
||||||
console.log("==window.location.pathname===",window.location.pathname)
|
console.log("==window.location.pathname===",window.location.pathname)
|
||||||
let docEl = doc.documentElement
|
let docEl = doc.documentElement
|
||||||
|
@ -74,8 +74,9 @@
|
|||||||
<img class="startImg" src="@/assets/start.png" />
|
<img class="startImg" src="@/assets/start.png" />
|
||||||
<span>车辆类型</span>
|
<span>车辆类型</span>
|
||||||
</div>
|
</div>
|
||||||
<select id="mySelect" class="mySelect" v-model="selectedOption" multiple :multiple-limit="isMultiple ? 2 : 1">
|
<select id="mySelect" class="mySelect" v-model="selectedOption" multiple
|
||||||
<option v-for="(item,index) in typeList" :key="index" :value="index" :disabled="!item.disabled ? false : true">{{item}}</option>
|
:multiple-limit="isMultiple ? 2 : 1">
|
||||||
|
<option v-for="(item,index) in typeList" :key="index" :value="index" :disabled="!item.disabled ? false : true">{{item.name}}</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="lineBot"></div>
|
<div class="lineBot"></div>
|
||||||
@ -171,30 +172,29 @@ export default {
|
|||||||
isMultiple: false, // 是否支持多选
|
isMultiple: false, // 是否支持多选
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch:{
|
||||||
typeList: {
|
typeList(newVal){
|
||||||
handler(newVal) {
|
console.log("1111",newVal)
|
||||||
if (newVal == 4) {
|
if(newVal == 4){
|
||||||
this.isMultiple = true;
|
this.isMultiple = true
|
||||||
this.$set(this.typeList, 2, { ...this.typeList[2], disabled: true });
|
this.typeList[2].disabled=true
|
||||||
this.$set(this.typeList, 5, { ...this.typeList[5], disabled: true });
|
this.typeList[5].disabled=true
|
||||||
this.$set(this.typeList, 6, { ...this.typeList[6], disabled: true });
|
this.typeList[6].disabled=true
|
||||||
this.$set(this.typeList, 7, { ...this.typeList[7], disabled: true });
|
this.typeList[7].disabled=true
|
||||||
this.$set(this.typeList, 8, { ...this.typeList[8], disabled: true });
|
this.typeList[8].disabled=true
|
||||||
this.$set(this.typeList, 9, { ...this.typeList[9], disabled: true });
|
this.typeList[9].disabled=true
|
||||||
} else {
|
}else{
|
||||||
this.isMultiple = false;
|
this.isMultiple = false
|
||||||
this.$set(this.typeList, 2, { ...this.typeList[2], disabled: false });
|
this.typeList[2].disabled=false
|
||||||
this.$set(this.typeList, 5, { ...this.typeList[5], disabled: false });
|
this.typeList[5].disabled=false
|
||||||
this.$set(this.typeList, 6, { ...this.typeList[6], disabled: false });
|
this.typeList[6].disabled=false
|
||||||
this.$set(this.typeList, 7, { ...this.typeList[7], disabled: false });
|
this.typeList[7].disabled=false
|
||||||
this.$set(this.typeList, 8, { ...this.typeList[8], disabled: false });
|
this.typeList[8].disabled=false
|
||||||
this.$set(this.typeList, 9, { ...this.typeList[9], disabled: false });
|
this.typeList[9].disabled=false
|
||||||
}
|
}
|
||||||
},
|
|
||||||
deep: true, // 深度监听
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
async mounted() {
|
async mounted() {
|
||||||
this.id=this.$route.params?.id
|
this.id=this.$route.params?.id
|
||||||
const selectElement = document.getElementById('mySelect');
|
const selectElement = document.getElementById('mySelect');
|
||||||
@ -312,8 +312,12 @@ export default {
|
|||||||
},
|
},
|
||||||
async getTypeList() {
|
async getTypeList() {
|
||||||
let result=await vehicleTypeList();
|
let result=await vehicleTypeList();
|
||||||
|
this.typeList=[]
|
||||||
if(result.code === 200){
|
if(result.code === 200){
|
||||||
this.typeList=result.data
|
for (const key in result.data){
|
||||||
|
// console.log("keys",result.data[key])
|
||||||
|
this.typeList.push({name:result.data[key],disabled:false})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async getSupplierServiceTree(){
|
async getSupplierServiceTree(){
|
||||||
|
Reference in New Issue
Block a user