|
@@ -82,7 +82,6 @@ export default {
|
|
this.ind = 0;
|
|
this.ind = 0;
|
|
this.active = 0;
|
|
this.active = 0;
|
|
this.carType = index;
|
|
this.carType = index;
|
|
-
|
|
|
|
if (this.carType == '1') {
|
|
if (this.carType == '1') {
|
|
this.numArr = [
|
|
this.numArr = [
|
|
this.numArr[0],
|
|
this.numArr[0],
|
|
@@ -105,6 +104,7 @@ export default {
|
|
this.numArr[6],
|
|
this.numArr[6],
|
|
];
|
|
];
|
|
}
|
|
}
|
|
|
|
+ this.vehicleNumber = this.numArr.toString().replace(/,/g, '')
|
|
},
|
|
},
|
|
// 唤起键盘
|
|
// 唤起键盘
|
|
clickShowKeyboard(index) {
|
|
clickShowKeyboard(index) {
|
|
@@ -168,29 +168,32 @@ export default {
|
|
vehicleNo: this.vehicleNumber,
|
|
vehicleNo: this.vehicleNumber,
|
|
};
|
|
};
|
|
if(this.carInfo?.id) {
|
|
if(this.carInfo?.id) {
|
|
- // 修改
|
|
|
|
- const res = await editVehicles(this.carInfo?.id, {
|
|
|
|
- id: this.carInfo?.id,
|
|
|
|
- ...params
|
|
|
|
- })
|
|
|
|
- if(res.id) {
|
|
|
|
- Toast({
|
|
|
|
- message: '修改车牌成功',
|
|
|
|
- position: 'top',
|
|
|
|
- onClose: () => {
|
|
|
|
- // this.$router.replace({
|
|
|
|
- // path: `vehicleManagement`,
|
|
|
|
- // });
|
|
|
|
- setTimeout(() => {
|
|
|
|
- this.$router.go(-1)
|
|
|
|
- }, 300)
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- } else {
|
|
|
|
- const message = res.langMessage || '修改车牌失败';
|
|
|
|
- Toast({
|
|
|
|
- message: message,
|
|
|
|
- });
|
|
|
|
|
|
+ try {
|
|
|
|
+ // 修改
|
|
|
|
+ const res = await editVehicles(this.carInfo?.id, {
|
|
|
|
+ id: this.carInfo?.id,
|
|
|
|
+ ...params
|
|
|
|
+ })
|
|
|
|
+ if(res.id) {
|
|
|
|
+ Toast({
|
|
|
|
+ message: '修改车牌成功',
|
|
|
|
+ position: 'top',
|
|
|
|
+ onClose: () => {
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ this.$router.go(-1)
|
|
|
|
+ }, 300)
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ const message = res.langMessage || '修改车牌失败';
|
|
|
|
+ Toast({
|
|
|
|
+ message: message,
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ } catch (err) {
|
|
|
|
+ if(err.code === 'FOUND_DUPLICATE') {
|
|
|
|
+ Toast('当前车牌已经存在,请勿重复绑定');
|
|
|
|
+ }
|
|
}
|
|
}
|
|
return
|
|
return
|
|
}
|
|
}
|