diff --git a/src/views/firstLevelDoor/freightVehiclesPort/freightVehicleMaintenance/components/carList.vue b/src/views/firstLevelDoor/freightVehiclesPort/freightVehicleMaintenance/components/carList.vue index a84c497..d92cb6d 100644 --- a/src/views/firstLevelDoor/freightVehiclesPort/freightVehicleMaintenance/components/carList.vue +++ b/src/views/firstLevelDoor/freightVehiclesPort/freightVehicleMaintenance/components/carList.vue @@ -63,7 +63,7 @@ - + @@ -396,33 +396,40 @@ export default{ } }, goCheckLicenceNoAdd() { - if (this.addForm.LICENCE_NO) { - const regex = /^([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1})$/ - const result = regex.test(this.addForm.LICENCE_NO) - if (result) { - console.log('格式校验通过') - requestFN( - '/mkmj/management/goCheckLicenceNo', - { - 'LICENCE_NO': this.addForm.LICENCE_NO - } - ).then((data) => { - if (data.result === 'success') { - this.$message.success('验证通过') - this.ISCHECK = true - } else { - this.$message.error('车牌号已存在,请重新输入') - this.ISCHECK = false - } - }).catch((e) => { - console.info(e) - this.listLoading = false - this.ISCHECK = false - }) - } else { - this.$message.success('车牌号不规范') - this.ISCHECK = false - } + // 检查是否输入了车牌号 + if (!this.addForm.LICENCE_NO) { + this.$message.error('车牌号不能为空'); // 提示车牌号不能为空 + this.ISCHECK = false; // 设置校验状态为 false + return; // 直接返回,不执行后续逻辑 + } + + // 车牌号格式校验 + const regex = /^([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1})$/; + const result = regex.test(this.addForm.LICENCE_NO); + + if (result) { + console.log('格式校验通过'); + requestFN( + '/mkmj/management/goCheckLicenceNo', + { + 'LICENCE_NO': this.addForm.LICENCE_NO + } + ).then((data) => { + if (data.result === 'success') { + this.$message.success('验证通过'); + this.ISCHECK = true; + } else { + this.$message.error('车牌号已存在,请重新输入'); + this.ISCHECK = false; + } + }).catch((e) => { + console.info(e); + this.listLoading = false; + this.ISCHECK = false; + }); + } else { + this.$message.error('车牌号不规范'); // 提示车牌号格式不正确 + this.ISCHECK = false; } }, // 打开新增弹窗的新增按钮 diff --git a/src/views/firstLevelDoor/freightVehiclesPort/freightVehiclesRecords/components/list.vue b/src/views/firstLevelDoor/freightVehiclesPort/freightVehiclesRecords/components/list.vue index 7ff584a..6580558 100644 --- a/src/views/firstLevelDoor/freightVehiclesPort/freightVehiclesRecords/components/list.vue +++ b/src/views/firstLevelDoor/freightVehiclesPort/freightVehiclesRecords/components/list.vue @@ -36,8 +36,16 @@ align="center"/> - - + + + + + + @@ -61,6 +69,21 @@ export default{ page: 1, limit: 10 }, + licenceTypeList: [ + // { ID: '', NAME: '请选择' }, + { ID: '0', NAME: '白牌' }, + { ID: '1', NAME: '蓝牌' }, + { ID: '2', NAME: '黄牌' }, + { ID: '3', NAME: '绿牌' }, + { ID: '4', NAME: '黑牌' } + ], + // 车辆类型列表 + vehicleTypeList: [ + // { ID: '', NAME: '请选择' }, + { ID: '0', NAME: '货车' }, + { ID: '1', NAME: '轿车' }, + { ID: '2', NAME: '大巴客车' } + ], areaList: [], // 省市县列表 placeList: [], listLoading: true, @@ -86,6 +109,16 @@ export default{ this.getList() }, methods: { + translateLicenceType(id) { + for (var i = 0; i < this.licenceTypeList.length; i++) { + if (this.licenceTypeList[i].ID == id) return this.licenceTypeList[i].NAME + } + }, + translateVehicleType(id) { + for (var i = 0; i < this.vehicleTypeList.length; i++) { + if (this.vehicleTypeList[i].ID == id) return this.vehicleTypeList[i].NAME + } + }, // 搜索 getQuery() { this.$refs.multipleTable.clearSelection() @@ -93,16 +126,7 @@ export default{ }, // 重置 reset() { - this.form = { - USER_NAME: '', - PHONE: '', - ID_CARD: '', - CORPINFO_NAME: '', - DEPARTMENT_NAME: '', - VISIT_START_TIME: '', - VISIT_END_TIME: '', - DOOR_NAME: '' - } + this.form.LICENCE_NO = '' this.getList() }, // 获取列表 diff --git a/src/views/firstLevelDoor/longCarPort/CarInfo/components/list.vue b/src/views/firstLevelDoor/longCarPort/CarInfo/components/list.vue index 6880402..23d619e 100644 --- a/src/views/firstLevelDoor/longCarPort/CarInfo/components/list.vue +++ b/src/views/firstLevelDoor/longCarPort/CarInfo/components/list.vue @@ -256,6 +256,7 @@ export default { varList: [], // 查询表单的数据 searchFrom: { + USER_NAME: '', IS_AUDIT: '', VEHICLE_ID: '', // 车辆ID(基础属性) LICENCE_NO: '', // 车牌号