diff --git a/src/views/longtermvehicleinputportmessage/auditChronicallyCar/components/list.vue b/src/views/longtermvehicleinputportmessage/auditChronicallyCar/components/list.vue index f20bf16..02c2426 100644 --- a/src/views/longtermvehicleinputportmessage/auditChronicallyCar/components/list.vue +++ b/src/views/longtermvehicleinputportmessage/auditChronicallyCar/components/list.vue @@ -18,15 +18,14 @@ placeholder="请选择车辆类型"/> - - - + + + + + + + + @@ -77,6 +76,7 @@ {{ translateVehicleType(row.VEHICLE_TYPE) }} + @@ -195,7 +195,8 @@ export default { VEHICLE_ID: '', // 车辆ID(基础属性) LICENCE_NO: '', // 车牌号 VEHICLE_TYPE: '', // 车辆类型 - VEHICLE_DEPARTMENT_ID: '' // 车辆所属部门ID + VEHICLE_DEPARTMENT_NAME: '', // 车辆所属部门 + RELEVANT_UNIT_NAME: '' }, // 添加表单的数据 addForm: { diff --git a/src/views/longtermvehicleinputportmessage/auditChronicallyCar/components/sendUtil.vue b/src/views/longtermvehicleinputportmessage/auditChronicallyCar/components/sendUtil.vue index e1737ce..e1e6f20 100644 --- a/src/views/longtermvehicleinputportmessage/auditChronicallyCar/components/sendUtil.vue +++ b/src/views/longtermvehicleinputportmessage/auditChronicallyCar/components/sendUtil.vue @@ -107,6 +107,8 @@ export default { this.loading = true this.visible = true this.VEHICLE_ID = e.VEHICLE_ID + this.form.STATUS = '' + this.form.OPINION = '' this.loading = false }, handleClose() { @@ -127,24 +129,28 @@ export default { this.$parent.activeName = 'List' }, sendMessage() { - this.$refs.form.validate((valid) => { - if (!valid) { + this.$refs.form.validate(valid => { + if (valid) { + requestFN( + '/vehiclemessage/auditChronicallyCar', + { + FIRST_AUDIT_USER_ID: JSON.parse(sessionStorage.getItem('user')).USER_ID, + IS_AUDIT: this.form.STATUS, + VEHICLE_ID: this.VEHICLE_ID, + REMARK: this.form.OPINION + } + ).then((data) => { + this.visible = false + this.$emit('refresh', '') + this.$message.success('操作成功') // 成功提示 + }).catch((e) => { + this.loading = false + this.$message.error('操作失败,请重试') // 失败提示 + }) + } else { + this.$message.warning('请填写完整信息') // 表单验证失败提示 return false } - requestFN( - '/vehiclemessage/auditChronicallyCar', - { - FIRST_AUDIT_USER_ID: JSON.parse(sessionStorage.getItem('user')).USER_ID, - IS_AUDIT: this.form.STATUS, - VEHICLE_ID: this.VEHICLE_ID, - REMARK: this.form.OPINION - } - ).then((data) => { - this.visible = false - this.$emit('refresh', '') - }).catch((e) => { - this.loading = false - }) }) } } diff --git a/src/views/longtermvehicleinputportmessage/vehiclemessage/components/list.vue b/src/views/longtermvehicleinputportmessage/vehiclemessage/components/list.vue index 49f77c0..90d0f97 100644 --- a/src/views/longtermvehicleinputportmessage/vehiclemessage/components/list.vue +++ b/src/views/longtermvehicleinputportmessage/vehiclemessage/components/list.vue @@ -96,12 +96,12 @@ - - + + - + - + - + - + { + const reg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼][A-HJ-NP-Z][A-HJ-NP-Z0-9]{4,5}[A-HJ-NP-Z0-9挂学警港澳]$/ + if (!reg.test(value)) { + callback(new Error('车牌号格式不正确')) + } else { + callback() + } + }, + trigger: 'blur' + } + ], + LICENCE_TYPE: [ + { required: true, message: '车牌类型不能为空', trigger: 'change' } + ], + VEHICLE_TYPE: [ + { required: true, message: '车辆类型不能为空', trigger: 'change' } + ], + VEHICLE_BELONG_TYPE: [ + { required: true, message: '车辆所属类型不能为空', trigger: 'change' } + ], + VEHICLE_DEPARTMENT_ID: [ + { required: true, message: '车辆所属部门不能为空', trigger: 'change' } + ], + VISIT_START_TIME: [ + { required: true, message: '访问起始时间不能为空', trigger: 'change' } + ], + VISIT_END_TIME: [ + { required: true, message: '访问结束时间不能为空', trigger: 'change' } + ] + }, ISCHECK: false, userInfo: JSON.parse(sessionStorage.getItem('user')), listLoading: true, @@ -471,85 +505,29 @@ export default { }, // 添加弹窗的确定按钮 addDialogConfirmBtn() { - if (this.addForm.LICENCE_NO !== null && this.addForm.LICENCE_NO === '') { - this.$message({ - message: '车牌号不能为空', - type: 'error' - }) - 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.VEHICLE_BELONG_TYPE !== null && this.addForm.VEHICLE_BELONG_TYPE === '') { - this.$message({ - message: '请选择车辆所属类型', - type: 'error' - }) - return false - } - if (this.roleName !== '普通用户角色') { - if (this.addForm.VEHICLE_DEPARTMENT_ID !== null && this.addForm.VEHICLE_DEPARTMENT_ID === '') { - this.$message({ - message: '请选择车辆所属部门', - type: 'error' + this.$refs.addForm.validate(valid => { + if (valid) { + requestFN( + 'vehiclemessage/addVehicleMessage', + { + ...this.addForm, + 'CORPINFO_ID': this.corpInfoId, + 'loginUserId': this.loginUserId + } + ).then((data) => { + if (data.result === 'fail') { + this.$message({ + message: data.msg, + type: 'error' + }) + } else { + this.$message.success('车辆信息添加成功') + this.getPageList() // 重新加载列表 + this.addDialogVisible = false + } + }).catch((e) => { }) - return false } - if (this.addForm.USER_ID !== null && this.addForm.USER_ID === '') { - this.$message({ - message: '请选择车辆责任人', - type: 'error' - }) - return false - } - } else { - this.addForm.VEHICLE_DEPARTMENT_ID = this.loginDepartmentId // 车辆所属部门id - this.addForm.VEHICLE_DEPARTMENT_NAME = this.loginDepartmentName // 车辆所属部门名称 - this.addForm.USER_ID = this.loginUserId // 车辆责任人id - this.addForm.USER_NAME = this.loginUserName // 车辆责任人姓名 - } - - if (this.addForm.VEHICLE_BELONG_TYPE === '0') { // 员工车辆(责任人和所属人都需要添加) - this.addForm.EMPLOYEE_VEHICLE_USER_ID = this.addForm.USER_ID // 车辆所属人id - this.addForm.EMPLOYEE_VEHICLE_USER_NAME = this.addForm.USER_NAME // 车辆所属人姓名 - } else { // 单位车辆(只需添加责任人,无需添加所属人) - this.addForm.EMPLOYEE_VEHICLE_USER_ID = '' // 车辆所属人id - this.addForm.EMPLOYEE_VEHICLE_USER_NAME = '' // 车辆所属人姓名 - } - this.addRequest() - }, - addRequest() { - requestFN( - 'vehiclemessage/addVehicleMessage', - { - ...this.addForm, - 'CORPINFO_ID': this.corpInfoId, - 'loginUserId': this.loginUserId - } - ).then((data) => { - if (data.result === 'fail') { - this.$message({ - message: data.msg, - type: 'error' - }) - } else { - this.$message.success('车辆信息添加成功') - this.getPageList() // 重新加载列表 - this.addDialogVisible = false - } - }).catch((e) => { }) }, // 打开编辑弹窗的编辑按钮 @@ -858,7 +836,7 @@ export default { this.ISCHECK = false }) } else { - this.$message.success('车牌号不规范') + this.$message.error('车牌号格式不正确') this.ISCHECK = false } } diff --git a/src/views/peopleinputportmanage/branchcompanypeoplemessage/components/list.vue b/src/views/peopleinputportmanage/branchcompanypeoplemessage/components/list.vue index 802cb11..6cf2f72 100644 --- a/src/views/peopleinputportmanage/branchcompanypeoplemessage/components/list.vue +++ b/src/views/peopleinputportmanage/branchcompanypeoplemessage/components/list.vue @@ -7,11 +7,11 @@ - - - - - + + + + + @@ -45,7 +45,7 @@ - +