代码补正
This commit is contained in:
parent
8dc907e992
commit
b49c27c10f
@ -362,7 +362,10 @@ export default {
|
|||||||
this.buttonLoading = true
|
this.buttonLoading = true
|
||||||
try{
|
try{
|
||||||
const data = this.formData.carInfo;
|
const data = this.formData.carInfo;
|
||||||
debugger
|
const brand = data.brandAndModel
|
||||||
|
if (typeof brand === 'string'){
|
||||||
|
data.brandAndModel = [brand, data?.carModel]
|
||||||
|
}
|
||||||
const res = await CarMainApi.compute(data);
|
const res = await CarMainApi.compute(data);
|
||||||
const result = res.data;
|
const result = res.data;
|
||||||
this.formData.carInfo.insuranceExpiryDate = result.insuranceExpiryDate
|
this.formData.carInfo.insuranceExpiryDate = result.insuranceExpiryDate
|
||||||
@ -376,7 +379,10 @@ export default {
|
|||||||
async submitForm(){
|
async submitForm(){
|
||||||
await this.$refs["formRef"].validate();
|
await this.$refs["formRef"].validate();
|
||||||
this.formLoading = true
|
this.formLoading = true
|
||||||
this.formData.carInfo.brandAndModel = [this.formData.carInfo.brandAndModel, this.formData.carInfo.carModel]
|
const brand = this.formData.carInfo.brandAndModel
|
||||||
|
if (typeof brand === 'string'){
|
||||||
|
this.formData.carInfo.brandAndModel = [brand, this.formData.carInfo?.carModel]
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
await updateCustomerAndCar(this.formData)
|
await updateCustomerAndCar(this.formData)
|
||||||
this.$modal.msgSuccess(this.formData?.userInfo?.id ? "修改成功" : "新增成功")
|
this.$modal.msgSuccess(this.formData?.userInfo?.id ? "修改成功" : "新增成功")
|
||||||
|
Loading…
Reference in New Issue
Block a user