diff --git a/pages/myCar/carDetail.vue b/pages/myCar/carDetail.vue index 7ba0cf9..7ec8e32 100644 --- a/pages/myCar/carDetail.vue +++ b/pages/myCar/carDetail.vue @@ -208,9 +208,8 @@ export default { }, methods: { onchange(e) { - const value = e.detail.value; - console.log(e.detail.value,"detail") - console.log(this.$refs.songpicker.inputSelected,"value") + this.brandId = e.detail.value[0].id + this.brandName = e.detail.value[0].brandName }, onnodeclick(node) { console.log(node,"node") @@ -304,6 +303,7 @@ export default { }, // 新增 async submit() { + // bus.$emit('updateCarInfo', this.car) this.car.brandAndModel = [this.brandId, this.car.carModel] //将日期转为时间戳 @@ -322,6 +322,8 @@ export default { }else { this.car.carRegisterDate = undefined } + console.log(this.car,"car") + return if (this.car.id != null) { request({ url: '/admin-api/base/carMain/update', @@ -428,7 +430,7 @@ export default { //车辆品牌自动定位 this.brandList.forEach((item, index) => { if (item.brandName == res.data.brand) { - this.setCarBrand(item.brandName.id,item.brandName) + this.setCarBrand(item.id,item.brandName) } }) //车辆性质自动定位 @@ -449,9 +451,9 @@ export default { * @param name */ setCarBrand(id,name){ - this.brandId = id - this.brandName = name this.$nextTick(()=>{ + this.brandId = id + this.brandName = name this.$refs.songpicker.inputSelected=[{text:name,value:id}] }) }