parent
0b56dd74d0
commit
4287fd4860
|
@ -63,7 +63,7 @@
|
|||
</div>
|
||||
<el-dialog :visible.sync="addDialogVisible" title="添加车辆信息" width="600px">
|
||||
<el-form v-if="addDialogVisible" ref="addForm" :model="addForm" label-width="170px" style="padding:0 20px; width: 500px;">
|
||||
<el-form-item :rules="[{required: true}]" label="车牌号" prop="LICENCE_NO">
|
||||
<el-form-item :rules="[{required: true ,message: '车牌号不能为空'}]" label="车牌号" prop="LICENCE_NO">
|
||||
<el-input v-model="addForm.LICENCE_NO" type="text" maxlength="300" placeholder="这里输入车牌号..." @blur="goCheckLicenceNoAdd()"/>
|
||||
</el-form-item>
|
||||
<!-- 白牌、蓝牌、黄牌、绿牌、黑牌 下拉框-->
|
||||
|
@ -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;
|
||||
}
|
||||
},
|
||||
// 打开新增弹窗的新增按钮
|
||||
|
|
|
@ -36,8 +36,16 @@
|
|||
align="center"/>
|
||||
<el-table-column type="index" label="序号" width="50" align="center" />
|
||||
<el-table-column prop="LICENCE_NO" label="车牌号"/>
|
||||
<el-table-column prop="LICENCE_TYPE" label="车牌类型"/>
|
||||
<el-table-column prop="VEHICLE_TYPE" label="车辆类型"/>
|
||||
<el-table-column label="车牌类型" align="center">
|
||||
<template slot-scope="{row}">
|
||||
{{ translateLicenceType(row.LICENCE_TYPE) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="车辆类型" align="center">
|
||||
<template slot-scope="{row}">
|
||||
{{ translateVehicleType(row.VEHICLE_TYPE) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="vehicle_arrival_barrier" label="车辆入港闸口"/>
|
||||
<el-table-column prop="vehicle_arrival_time" label="车辆入港时间"/>
|
||||
<el-table-column prop="vehicle_departure_barrier" label="车辆离岗闸口"/>
|
||||
|
@ -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()
|
||||
},
|
||||
// 获取列表
|
||||
|
|
|
@ -256,6 +256,7 @@ export default {
|
|||
varList: [],
|
||||
// 查询表单的数据
|
||||
searchFrom: {
|
||||
USER_NAME: '',
|
||||
IS_AUDIT: '',
|
||||
VEHICLE_ID: '', // 车辆ID(基础属性)
|
||||
LICENCE_NO: '', // 车牌号
|
||||
|
|
Loading…
Reference in New Issue