This commit is contained in:
Vinjor 2024-11-04 14:06:18 +08:00
parent 431482c08d
commit 83830c1ba4

View File

@ -208,9 +208,8 @@ export default {
}, },
methods: { methods: {
onchange(e) { onchange(e) {
const value = e.detail.value; this.brandId = e.detail.value[0].id
console.log(e.detail.value,"detail") this.brandName = e.detail.value[0].brandName
console.log(this.$refs.songpicker.inputSelected,"value")
}, },
onnodeclick(node) { onnodeclick(node) {
console.log(node,"node") console.log(node,"node")
@ -304,6 +303,7 @@ export default {
}, },
// //
async submit() { async submit() {
// bus.$emit('updateCarInfo', this.car) // bus.$emit('updateCarInfo', this.car)
this.car.brandAndModel = [this.brandId, this.car.carModel] this.car.brandAndModel = [this.brandId, this.car.carModel]
// //
@ -322,6 +322,8 @@ export default {
}else { }else {
this.car.carRegisterDate = undefined this.car.carRegisterDate = undefined
} }
console.log(this.car,"car")
return
if (this.car.id != null) { if (this.car.id != null) {
request({ request({
url: '/admin-api/base/carMain/update', url: '/admin-api/base/carMain/update',
@ -428,7 +430,7 @@ export default {
// //
this.brandList.forEach((item, index) => { this.brandList.forEach((item, index) => {
if (item.brandName == res.data.brand) { 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 * @param name
*/ */
setCarBrand(id,name){ setCarBrand(id,name){
this.brandId = id
this.brandName = name
this.$nextTick(()=>{ this.$nextTick(()=>{
this.brandId = id
this.brandName = name
this.$refs.songpicker.inputSelected=[{text:name,value:id}] this.$refs.songpicker.inputSelected=[{text:name,value:id}]
}) })
} }