parent
330322d473
commit
74765a232a
|
@ -405,25 +405,31 @@ export default {
|
|||
this.detailDialogVisible = false
|
||||
},
|
||||
deleteSingleDataDeleteBtn(BLACK_LIST_ID, VEHICLE_ID) {
|
||||
requestFN(
|
||||
'blackListManage/delBlackList',
|
||||
{
|
||||
'BLACK_LIST_ID': BLACK_LIST_ID,
|
||||
'VEHICLE_ID': VEHICLE_ID
|
||||
}
|
||||
).then((data) => {
|
||||
if (data.result === 'success') {
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.getPageList()
|
||||
} else {
|
||||
this.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
})
|
||||
}
|
||||
this.$confirm('是否移除黑名单?', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
requestFN(
|
||||
'blackListManage/delBlackList',
|
||||
{
|
||||
'BLACK_LIST_ID': BLACK_LIST_ID,
|
||||
'VEHICLE_ID': VEHICLE_ID
|
||||
}
|
||||
).then((data) => {
|
||||
if (data.result === 'success') {
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.getPageList()
|
||||
} else {
|
||||
this.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
// 检查车牌号是否规范
|
||||
|
|
|
@ -94,36 +94,26 @@
|
|||
<!-- 添加车辆违规信息 -->
|
||||
<el-dialog :visible.sync="addDialogVisible" title="添加车辆违规信息" width="600px">
|
||||
<el-form v-if="addDialogVisible" ref="addForm" :rules="addFormRules" :model="addForm" label-width="170px" style="padding:0 20px; width: 500px;">
|
||||
<el-form-item :rules="[{required: true}]" label="车牌号" label-width="110px">
|
||||
<el-form-item label="车牌号" label-width="110px" prop="LICENCE_NO">
|
||||
<el-input v-model="addForm.LICENCE_NO" :autosize="{ minRows: 1}" type="text" maxlength="300" placeholder="这里输入车牌号..." @blur="goCheckLicenceNo()"/>
|
||||
</el-form-item>
|
||||
<!-- 白牌、蓝牌、黄牌、绿牌、黑牌 下拉框-->
|
||||
<el-form-item :rules="[{required: true}]" label="车牌类型" label-width="110px" prop="LICENCE_TYPE">
|
||||
<SelectTree
|
||||
ref="selectTree_add2"
|
||||
:clearable="false"
|
||||
:options="licenceTypeList"
|
||||
:props="oneselfDefaultProps"
|
||||
v-model="addForm.LICENCE_TYPE"
|
||||
placeholder="请选择车牌类型"
|
||||
style="width: 300px"/>
|
||||
<el-form-item label="车牌类型" label-width="110px" prop="LICENCE_TYPE">
|
||||
<el-select v-model="addForm.LICENCE_TYPE" label-width="110px">
|
||||
<el-option v-for="item in licenceTypeList" :key="item.ID" :label="item.NAME" :value="item.ID" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- 货车、轿车、大巴客车 下拉框-->
|
||||
<el-form-item :rules="[{required: true}]" label="车辆类型" label-width="110px" prop="VEHICLE_TYPE">
|
||||
<SelectTree
|
||||
ref="selectTree_add3"
|
||||
:clearable="false"
|
||||
:options="vehicleTypeList"
|
||||
:props="oneselfDefaultProps"
|
||||
v-model="addForm.VEHICLE_TYPE"
|
||||
placeholder="请选择车辆类型"
|
||||
style="width: 300px"/>
|
||||
<el-form-item label="车辆类型" label-width="110px" prop="VEHICLE_TYPE">
|
||||
<el-select v-model="addForm.VEHICLE_TYPE" label-width="110px">
|
||||
<el-option v-for="item in vehicleTypeList" :key="item.ID" :label="item.NAME" :value="item.ID" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :rules="[{required: true}]" label="违规时间" label-width="110px">
|
||||
<el-form-item label="违规时间" label-width="110px" prop="VIOLATIONTIME">
|
||||
<el-date-picker id="VIOLATIONTIME" ref="VIOLATIONTIME" v-model="addForm.VIOLATIONTIME" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd HH:mm:ss" style="width: 100%" type="datetime" placeholder="请选择" />
|
||||
</el-form-item>
|
||||
<!-- 违规类型:(0-未按规定车道行驶,1-违规停车) 下拉框-->
|
||||
<el-form-item :rules="[{required: true}]" label="违规类型" label-width="110px" prop="VIOLATION_TYPE">
|
||||
<el-form-item label="违规类型" label-width="110px" prop="VIOLATION_TYPE">
|
||||
<SelectTree
|
||||
ref="selectTree_add3"
|
||||
:clearable="false"
|
||||
|
@ -133,10 +123,10 @@
|
|||
placeholder="请选择违规类型"
|
||||
style="width: 300px"/>
|
||||
</el-form-item>
|
||||
<el-form-item :rules="[{required: true}]" label="违规区域" label-width="110px" prop="LOCATION">
|
||||
<el-form-item label="违规区域" label-width="110px" prop="LOCATION">
|
||||
<el-input :rows="3" v-model="addForm.LOCATION" type="textarea" placeholder="违规区域需明确车辆在港口内的具体违规位置如某一口门附近、某一码头区域、某一仓库通道等..."/>
|
||||
</el-form-item>
|
||||
<el-form-item :rules="[{required: true}]" label="违规图片" label-width="110px" prop="FFILE">
|
||||
<el-form-item label="违规图片" label-width="110px" prop="FFILE">
|
||||
<el-upload
|
||||
ref="violationImageUpload"
|
||||
:class="{hide:violationUpload}"
|
||||
|
@ -163,7 +153,7 @@
|
|||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="addDialogCancelBtn">取 消</el-button>
|
||||
<el-button type="primary" @click="addDialogConfirmBtn">确 定</el-button>
|
||||
<el-button type="primary" @click="addDialogConfirmBtn('addForm')">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
@ -233,9 +223,14 @@ export default {
|
|||
},
|
||||
// 添加表单的验证规则
|
||||
addFormRules: {
|
||||
LICENCE_NO: [{ required: true, message: '车牌号不能为空', trigger: 'blur' }],
|
||||
LICENCE_NO: [
|
||||
{ required: true, message: '车牌号不能为空', trigger: 'blur' },
|
||||
{ pattern: /^([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1})$/, message: '请填写正确的车牌号', trigger: 'blur' }
|
||||
],
|
||||
VIOLATION_TYPE: [{ required: true, message: '请选择违规类型', trigger: 'blur' }],
|
||||
FFILE: [{ required: true, message: '违规图片不能为空', trigger: 'blur' }],
|
||||
LOCATION: [{ required: true, message: '违规区域不能为空', trigger: 'blur' }],
|
||||
VIOLATIONTIME: [{ required: true, message: '违规时间不能为空', trigger: 'blur' }],
|
||||
LICENCE_TYPE: [{ required: true, message: '请选择车牌类型', trigger: 'blur' }],
|
||||
VEHICLE_TYPE: [{ required: true, message: '请选择车辆类型', trigger: 'blur' }]
|
||||
},
|
||||
|
@ -408,59 +403,15 @@ export default {
|
|||
}
|
||||
},
|
||||
// 添加弹窗的确定按钮
|
||||
addDialogConfirmBtn() {
|
||||
if (this.addForm.LICENCE_NO !== null && this.addForm.LICENCE_NO === '') {
|
||||
this.$message({
|
||||
message: '车牌号不能为空',
|
||||
type: 'error'
|
||||
addDialogConfirmBtn(formName) {
|
||||
this.addForm.FFILE = this.violation_files
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false
|
||||
}
|
||||
this.$refs.addForm.validate(valid => {
|
||||
this.addRequest(valid) // 同时保存多张图片
|
||||
})
|
||||
return false
|
||||
}
|
||||
if (this.addForm.LICENCE_TYPE !== null && this.addForm.LICENCE_TYPE === '') {
|
||||
this.$message({
|
||||
message: '请选择车牌类型',
|
||||
type: 'error'
|
||||
})
|
||||
return false
|
||||
}
|
||||
if (this.addForm.VEHICLE_TYPE !== null && this.addForm.VEHICLE_TYPE === '') {
|
||||
this.$message({
|
||||
message: '请选择车辆类型',
|
||||
type: 'error'
|
||||
})
|
||||
return false
|
||||
}
|
||||
if (this.addForm.VIOLATIONTIME !== null && this.addForm.VIOLATIONTIME === '') {
|
||||
this.$message({
|
||||
message: '请选择违规时间',
|
||||
type: 'error'
|
||||
})
|
||||
return false
|
||||
}
|
||||
if (this.addForm.VIOLATION_TYPE !== null && this.addForm.VIOLATION_TYPE === '') {
|
||||
this.$message({
|
||||
message: '请选择违规类型',
|
||||
type: 'error'
|
||||
})
|
||||
return false
|
||||
}
|
||||
if (this.addForm.LOCATION !== null && this.addForm.LOCATION === '') {
|
||||
this.$message({
|
||||
message: '请填写违规区域',
|
||||
type: 'error'
|
||||
})
|
||||
return false
|
||||
}
|
||||
if (this.$refs.violationImageUpload.uploadFiles.length < 1) {
|
||||
this.$message({
|
||||
message: '请上传违规图片',
|
||||
type: 'error'
|
||||
})
|
||||
this.loading = false
|
||||
return false
|
||||
}
|
||||
this.$refs.addForm.validate(valid => {
|
||||
this.addRequest(valid) // 同时保存多张图片
|
||||
})
|
||||
},
|
||||
addRequest(valid) {
|
||||
|
@ -545,18 +496,20 @@ export default {
|
|||
// 检查车牌号是否规范
|
||||
goCheckLicenceNo() {
|
||||
if (this.addForm.LICENCE_NO === '') {
|
||||
this.$message.success('请输入车牌号')
|
||||
this.ISCHECK = false
|
||||
} else {
|
||||
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) {
|
||||
this.$message.success('验证通过')
|
||||
this.ISCHECK = true
|
||||
} else {
|
||||
this.$message.success('车牌号不规范')
|
||||
this.ISCHECK = 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) {
|
||||
requestFN(
|
||||
'/vehiclemessage/licenceNo',
|
||||
{
|
||||
'licenceNo': this.addForm.LICENCE_NO
|
||||
}
|
||||
).then((data) => {
|
||||
this.addForm.LICENCE_TYPE = String(data.res.LICENCE_TYPE)
|
||||
this.addForm.VEHICLE_TYPE = String(data.res.VEHICLE_TYPE)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue