parent
681f3cf93c
commit
bf7387a6ba
|
@ -63,11 +63,19 @@
|
|||
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList"/>
|
||||
</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
|
||||
v-if="addDialogVisible"
|
||||
ref="addForm"
|
||||
:model="addForm"
|
||||
label-width="170px"
|
||||
style="padding:0 20px; width: 500px;">
|
||||
<el-form-item :rules="[{required: true ,message: '车牌号不能为空',trigger: 'blur'}]" label="车牌号" prop="LICENCE_NO">
|
||||
<el-input v-model="addForm.LICENCE_NO" type="text" maxlength="300" placeholder="这里输入车牌号..."
|
||||
@blur="goCheckLicenceNoAdd()"/>
|
||||
<el-input
|
||||
v-model="addForm.LICENCE_NO"
|
||||
type="text"
|
||||
maxlength="300"
|
||||
placeholder="这里输入车牌号..."
|
||||
@blur="goCheckLicenceNoAdd()"/>
|
||||
</el-form-item>
|
||||
<!-- 白牌、蓝牌、黄牌、绿牌、黑牌 下拉框-->
|
||||
<el-form-item :rules="[{required: true,message: '车牌类型不能为空',trigger: 'blur'}]" label="车牌类型" prop="LICENCE_TYPE">
|
||||
|
@ -102,66 +110,66 @@
|
|||
placeholder="请选择是否危化车辆"
|
||||
style="width: 300px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="负责人" prop="CONTACT" :rules="[{ required: true, message: '请填写负责人姓名', trigger: 'blur' }]">
|
||||
<el-form-item :rules="[{ required: true, message: '请填写负责人姓名', trigger: 'blur' }]" label="负责人" prop="CONTACT">
|
||||
<el-input v-model="addForm.CONTACT" type="text" maxlength="300" placeholder="这里输入负责人名称..."/>
|
||||
</el-form-item>
|
||||
<el-form-item label="负责人手机号" prop="PHONE" :rules="[{ required: true, message: '请填写负责人手机号', trigger: 'blur' },{ pattern: /^1[3-9]\d{9}$/, message: '手机号格式不正确', trigger: 'blur' }]">
|
||||
<el-form-item :rules="[{ required: true, message: '请填写负责人手机号', trigger: 'blur' },{ pattern: /^1[3-9]\d{9}$/, message: '手机号格式不正确', trigger: 'blur' }]" label="负责人手机号" prop="PHONE">
|
||||
<el-input v-model="addForm.PHONE" type="text" maxlength="11" placeholder="这里输入负责人手机号..."/>
|
||||
</el-form-item>
|
||||
<el-form-item label="排放标准" prop="EMISSION_STANDARDS" :rules="[{ required: true, message: '请填写排放标准', trigger: 'blur' }]">
|
||||
<el-form-item :rules="[{ required: true, message: '请填写排放标准', trigger: 'blur' }]" label="排放标准" prop="EMISSION_STANDARDS">
|
||||
<el-input v-model="addForm.EMISSION_STANDARDS" type="text" maxlength="300" placeholder="这里输入排放标准..."/>
|
||||
</el-form-item>
|
||||
<!-- 驾驶证 -->
|
||||
<el-form-item label="驾驶证" prop="DRIVING_LICENSE" :rules="[{ required: true, message: '请上传驾驶证', trigger: 'blur' }]">
|
||||
<el-form-item :rules="[{ required: true, message: '请上传驾驶证', trigger: 'blur' }]" label="驾驶证" prop="DRIVING_LICENSE">
|
||||
<el-upload
|
||||
action="http://127.0.0.1:8199/mkmj/management/fileUpload"
|
||||
:on-success="handleDrivingLicenseSuccess"
|
||||
:before-upload="beforeUpload"
|
||||
:limit="1">
|
||||
:limit="1"
|
||||
action="http://127.0.0.1:8199/mkmj/management/fileUpload">
|
||||
<el-button type="primary">点击上传</el-button>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 绿本 -->
|
||||
<el-form-item label="绿本" prop="GREEN_BOOK" :rules="[{ required: true, message: '请上传绿本', trigger: 'blur' }]">
|
||||
<el-form-item :rules="[{ required: true, message: '请上传绿本', trigger: 'blur' }]" label="绿本" prop="GREEN_BOOK">
|
||||
<el-upload
|
||||
action="http://127.0.0.1:8199/mkmj/management/fileUpload"
|
||||
:on-success="handleGreenBookSuccess"
|
||||
:before-upload="beforeUpload"
|
||||
:limit="1">
|
||||
:limit="1"
|
||||
action="http://127.0.0.1:8199/mkmj/management/fileUpload">
|
||||
<el-button type="primary">点击上传</el-button>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 环保随车清单 -->
|
||||
<el-form-item label="环保随车清单" prop="ECO_FRIENDLY_CHECKLIST" :rules="[{ required: true, message: '请上传环保随车清单', trigger: 'blur' }]">
|
||||
<el-form-item :rules="[{ required: true, message: '请上传环保随车清单', trigger: 'blur' }]" label="环保随车清单" prop="ECO_FRIENDLY_CHECKLIST">
|
||||
<el-upload
|
||||
action="http://127.0.0.1:8199/mkmj/management/fileUpload"
|
||||
:on-success="handleEcoFriendlyChecklistSuccess"
|
||||
:before-upload="beforeUpload"
|
||||
:limit="1">
|
||||
:limit="1"
|
||||
action="http://127.0.0.1:8199/mkmj/management/fileUpload">
|
||||
<el-button type="primary">点击上传</el-button>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 出厂合格证 -->
|
||||
<el-form-item label="出厂合格证" prop="FACTORY_CERTIFICATE" :rules="[{ required: true, message: '请上传出厂合格证', trigger: 'blur' }]">
|
||||
<el-form-item :rules="[{ required: true, message: '请上传出厂合格证', trigger: 'blur' }]" label="出厂合格证" prop="FACTORY_CERTIFICATE">
|
||||
<el-upload
|
||||
action="http://127.0.0.1:8199/mkmj/management/fileUpload"
|
||||
:on-success="handleFactoryCertificateSuccess"
|
||||
:before-upload="beforeUpload"
|
||||
:limit="1">
|
||||
:limit="1"
|
||||
action="http://127.0.0.1:8199/mkmj/management/fileUpload">
|
||||
<el-button type="primary">点击上传</el-button>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 环保信息截图 -->
|
||||
<el-form-item label="环保信息截图" prop="ENVIRONMENTAL_SCREENSHOTS" :rules="[{ required: true, message: '请上传环保信息截图', trigger: 'blur' }]">
|
||||
<el-form-item :rules="[{ required: true, message: '请上传环保信息截图', trigger: 'blur' }]" label="环保信息截图" prop="ENVIRONMENTAL_SCREENSHOTS">
|
||||
<el-upload
|
||||
action="http://127.0.0.1:8199/mkmj/management/fileUpload"
|
||||
:on-success="handleEnvironmentalScreenshotsSuccess"
|
||||
:before-upload="beforeUpload"
|
||||
:limit="1">
|
||||
:limit="1"
|
||||
action="http://127.0.0.1:8199/mkmj/management/fileUpload">
|
||||
<el-button type="primary">点击上传</el-button>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
|
@ -173,11 +181,19 @@
|
|||
</el-dialog>
|
||||
<!--编辑-->
|
||||
<el-dialog :visible.sync="editDialogVisible" title="编辑车辆信息" width="600px">
|
||||
<el-form v-if="editDialogVisible" ref="editForm" :model="addForm" label-width="170px"
|
||||
style="padding:0 20px; width: 500px;">
|
||||
<el-form
|
||||
v-if="editDialogVisible"
|
||||
ref="editForm"
|
||||
:model="addForm"
|
||||
label-width="170px"
|
||||
style="padding:0 20px; width: 500px;">
|
||||
<el-form-item :rules="[{required: true ,message: '车牌号不能为空',trigger: 'blur'}]" label="车牌号" prop="LICENCE_NO">
|
||||
<el-input v-model="addForm.LICENCE_NO" type="text" maxlength="300" placeholder="这里输入车牌号..."
|
||||
@blur="goCheckLicenceNoAdd()"/>
|
||||
<el-input
|
||||
v-model="addForm.LICENCE_NO"
|
||||
type="text"
|
||||
maxlength="300"
|
||||
placeholder="这里输入车牌号..."
|
||||
@blur="goCheckLicenceNoAdd()"/>
|
||||
</el-form-item>
|
||||
<!-- 白牌、蓝牌、黄牌、绿牌、黑牌 下拉框-->
|
||||
<el-form-item :rules="[{required: true,message: '车牌类型不能为空',trigger: 'blur'}]" label="车牌类型" prop="LICENCE_TYPE">
|
||||
|
@ -212,66 +228,66 @@
|
|||
placeholder="请选择是否危化车辆"
|
||||
style="width: 300px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="负责人" prop="CONTACT" :rules="[{ required: true, message: '请填写负责人姓名', trigger: 'blur' }]">
|
||||
<el-form-item :rules="[{ required: true, message: '请填写负责人姓名', trigger: 'blur' }]" label="负责人" prop="CONTACT">
|
||||
<el-input v-model="addForm.CONTACT" type="text" maxlength="300" placeholder="这里输入负责人名称..."/>
|
||||
</el-form-item>
|
||||
<el-form-item label="负责人手机号" prop="PHONE" :rules="[{ required: true, message: '请填写负责人手机号', trigger: 'blur' },{ pattern: /^1[3-9]\d{9}$/, message: '手机号格式不正确', trigger: 'blur' }]">
|
||||
<el-form-item :rules="[{ required: true, message: '请填写负责人手机号', trigger: 'blur' },{ pattern: /^1[3-9]\d{9}$/, message: '手机号格式不正确', trigger: 'blur' }]" label="负责人手机号" prop="PHONE">
|
||||
<el-input v-model="addForm.PHONE" type="text" maxlength="11" placeholder="这里输入负责人手机号..."/>
|
||||
</el-form-item>
|
||||
<el-form-item label="排放标准" prop="EMISSION_STANDARDS" :rules="[{ required: true, message: '请填写排放标准', trigger: 'blur' }]">
|
||||
<el-form-item :rules="[{ required: true, message: '请填写排放标准', trigger: 'blur' }]" label="排放标准" prop="EMISSION_STANDARDS">
|
||||
<el-input v-model="addForm.EMISSION_STANDARDS" type="text" maxlength="300" placeholder="这里输入排放标准..."/>
|
||||
</el-form-item>
|
||||
<!-- 驾驶证 -->
|
||||
<el-form-item label="驾驶证" prop="DRIVING_LICENSE" :rules="[{ required: true, message: '请上传驾驶证', trigger: 'blur' }]">
|
||||
<el-form-item :rules="[{ required: true, message: '请上传驾驶证', trigger: 'blur' }]" label="驾驶证" prop="DRIVING_LICENSE">
|
||||
<el-upload
|
||||
action="http://127.0.0.1:8199/mkmj/management/fileUpload"
|
||||
:on-success="handleDrivingLicenseSuccess"
|
||||
:before-upload="beforeUpload"
|
||||
:limit="1">
|
||||
:limit="1"
|
||||
action="http://127.0.0.1:8199/mkmj/management/fileUpload">
|
||||
<el-button type="primary">点击上传</el-button>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 绿本 -->
|
||||
<el-form-item label="绿本" prop="GREEN_BOOK" :rules="[{ required: true, message: '请上传绿本', trigger: 'blur' }]">
|
||||
<el-form-item :rules="[{ required: true, message: '请上传绿本', trigger: 'blur' }]" label="绿本" prop="GREEN_BOOK">
|
||||
<el-upload
|
||||
action="http://127.0.0.1:8199/mkmj/management/fileUpload"
|
||||
:on-success="handleGreenBookSuccess"
|
||||
:before-upload="beforeUpload"
|
||||
:limit="1">
|
||||
:limit="1"
|
||||
action="http://127.0.0.1:8199/mkmj/management/fileUpload">
|
||||
<el-button type="primary">点击上传</el-button>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 环保随车清单 -->
|
||||
<el-form-item label="环保随车清单" prop="ECO_FRIENDLY_CHECKLIST" :rules="[{ required: true, message: '请上传环保随车清单', trigger: 'blur' }]">
|
||||
<el-form-item :rules="[{ required: true, message: '请上传环保随车清单', trigger: 'blur' }]" label="环保随车清单" prop="ECO_FRIENDLY_CHECKLIST">
|
||||
<el-upload
|
||||
action="http://127.0.0.1:8199/mkmj/management/fileUpload"
|
||||
:on-success="handleEcoFriendlyChecklistSuccess"
|
||||
:before-upload="beforeUpload"
|
||||
:limit="1">
|
||||
:limit="1"
|
||||
action="http://127.0.0.1:8199/mkmj/management/fileUpload">
|
||||
<el-button type="primary">点击上传</el-button>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 出厂合格证 -->
|
||||
<el-form-item label="出厂合格证" prop="FACTORY_CERTIFICATE" :rules="[{ required: true, message: '请上传出厂合格证', trigger: 'blur' }]">
|
||||
<el-form-item :rules="[{ required: true, message: '请上传出厂合格证', trigger: 'blur' }]" label="出厂合格证" prop="FACTORY_CERTIFICATE">
|
||||
<el-upload
|
||||
action="http://127.0.0.1:8199/mkmj/management/fileUpload"
|
||||
:on-success="handleFactoryCertificateSuccess"
|
||||
:before-upload="beforeUpload"
|
||||
:limit="1">
|
||||
:limit="1"
|
||||
action="http://127.0.0.1:8199/mkmj/management/fileUpload">
|
||||
<el-button type="primary">点击上传</el-button>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 环保信息截图 -->
|
||||
<el-form-item label="环保信息截图" prop="ENVIRONMENTAL_SCREENSHOTS" :rules="[{ required: true, message: '请上传环保信息截图', trigger: 'blur' }]">
|
||||
<el-form-item :rules="[{ required: true, message: '请上传环保信息截图', trigger: 'blur' }]" label="环保信息截图" prop="ENVIRONMENTAL_SCREENSHOTS">
|
||||
<el-upload
|
||||
action="http://127.0.0.1:8199/mkmj/management/fileUpload"
|
||||
:on-success="handleEnvironmentalScreenshotsSuccess"
|
||||
:before-upload="beforeUpload"
|
||||
:limit="1">
|
||||
:limit="1"
|
||||
action="http://127.0.0.1:8199/mkmj/management/fileUpload">
|
||||
<el-button type="primary">点击上传</el-button>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
|
@ -281,7 +297,7 @@
|
|||
<el-button type="primary" @click="editDialogConfirmBtn">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<div style="margin-left: 20px;"></div>
|
||||
<div style="margin-left: 20px;"/>
|
||||
<div class="bottom-btn-group" style="margin-top: 20px;">
|
||||
<el-button size="mini" @click="goBack">返回</el-button>
|
||||
</div>
|
||||
|
@ -290,11 +306,11 @@
|
|||
|
||||
<script>
|
||||
import Pagination from '@/components/Pagination' // 通过 el-pagination二次打包
|
||||
import {requestFN} from '@/utils/request'
|
||||
import { requestFN } from '@/utils/request'
|
||||
import SelectTree from '@/components/SelectTree'
|
||||
|
||||
export default {
|
||||
components: {Pagination, SelectTree},
|
||||
components: { Pagination, SelectTree },
|
||||
data() {
|
||||
return {
|
||||
listQuery: {
|
||||
|
@ -344,22 +360,22 @@ export default {
|
|||
},
|
||||
// 车牌类型列表
|
||||
licenceTypeList: [
|
||||
{ID: '0', NAME: '白牌'},
|
||||
{ID: '1', NAME: '蓝牌'},
|
||||
{ID: '2', NAME: '黄牌'},
|
||||
{ID: '3', NAME: '绿牌'},
|
||||
{ID: '4', 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: '大巴客车'}
|
||||
{ ID: '0', NAME: '货车' },
|
||||
{ ID: '1', NAME: '轿车' },
|
||||
{ ID: '2', NAME: '大巴客车' }
|
||||
],
|
||||
DANGEROUS_CAR_LIST: [
|
||||
{ID: '0', NAME: '否'},
|
||||
{ID: '1', NAME: '是'},
|
||||
{ ID: '0', NAME: '否' },
|
||||
{ ID: '1', NAME: '是' }
|
||||
],
|
||||
// 车辆下拉树默认属性
|
||||
vehicleDefaultProps: {
|
||||
|
@ -412,17 +428,17 @@ export default {
|
|||
goCheckLicenceNoAdd() {
|
||||
// 检查是否输入了车牌号
|
||||
if (!this.addForm.LICENCE_NO) {
|
||||
this.$message.error('车牌号不能为空'); // 提示车牌号不能为空
|
||||
this.ISCHECK = false; // 设置校验状态为 false
|
||||
return; // 直接返回,不执行后续逻辑
|
||||
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);
|
||||
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('格式校验通过');
|
||||
console.log('格式校验通过')
|
||||
requestFN(
|
||||
'/mkmj/management/goCheckLicenceNo',
|
||||
{
|
||||
|
@ -430,20 +446,20 @@ export default {
|
|||
}
|
||||
).then((data) => {
|
||||
if (data.result === 'success') {
|
||||
this.$message.success('验证通过');
|
||||
this.ISCHECK = true;
|
||||
this.$message.success('验证通过')
|
||||
this.ISCHECK = true
|
||||
} else {
|
||||
this.$message.error('车牌号已存在,请重新输入');
|
||||
this.ISCHECK = false;
|
||||
this.$message.error('车牌号已存在,请重新输入')
|
||||
this.ISCHECK = false
|
||||
}
|
||||
}).catch((e) => {
|
||||
console.info(e);
|
||||
this.listLoading = false;
|
||||
this.ISCHECK = false;
|
||||
});
|
||||
console.info(e)
|
||||
this.listLoading = false
|
||||
this.ISCHECK = false
|
||||
})
|
||||
} else {
|
||||
this.$message.error('车牌号不规范'); // 提示车牌号格式不正确
|
||||
this.ISCHECK = false;
|
||||
this.$message.error('车牌号不规范') // 提示车牌号格式不正确
|
||||
this.ISCHECK = false
|
||||
}
|
||||
},
|
||||
// 打开新增弹窗的新增按钮
|
||||
|
@ -454,44 +470,48 @@ export default {
|
|||
},
|
||||
reSetAddDialog() {
|
||||
this.addForm.VEHICLE_ID = '',
|
||||
this.addForm.LICENCE_NO = '',
|
||||
this.addForm.LICENCE_TYPE = '',
|
||||
this.addForm.VEHICLE_TYPE = '',
|
||||
this.addForm.CONTACT = '',
|
||||
this.addForm.PHONE = '',
|
||||
this.addForm.EMISSION_STANDARDS = '',
|
||||
this.addForm.IS_DANGEROUS_CAR = '',
|
||||
this.addForm.DRIVING_LICENSE = '',
|
||||
this.addForm.GREEN_BOOK = '',
|
||||
this.addForm.ECO_FRIENDLY_CHECKLIST = '',
|
||||
this.addForm.FACTORY_CERTIFICATE = '',
|
||||
this.addForm.ENVIRONMENTAL_SCREENSHOTS = ''
|
||||
this.addForm.LICENCE_NO = '',
|
||||
this.addForm.LICENCE_TYPE = '',
|
||||
this.addForm.VEHICLE_TYPE = '',
|
||||
this.addForm.CONTACT = '',
|
||||
this.addForm.PHONE = '',
|
||||
this.addForm.EMISSION_STANDARDS = '',
|
||||
this.addForm.IS_DANGEROUS_CAR = '',
|
||||
this.addForm.DRIVING_LICENSE = '',
|
||||
this.addForm.GREEN_BOOK = '',
|
||||
this.addForm.ECO_FRIENDLY_CHECKLIST = '',
|
||||
this.addForm.FACTORY_CERTIFICATE = '',
|
||||
this.addForm.ENVIRONMENTAL_SCREENSHOTS = ''
|
||||
},
|
||||
handleDrivingLicenseSuccess(response, file) {
|
||||
this.addForm.DRIVING_LICENSE = response.uploadPath;
|
||||
this.addForm.DRIVING_LICENSE = response.uploadPath
|
||||
},
|
||||
handleGreenBookSuccess(response, file) {
|
||||
this.addForm.GREEN_BOOK = response.uploadPath;
|
||||
this.addForm.GREEN_BOOK = response.uploadPath
|
||||
},
|
||||
handleEcoFriendlyChecklistSuccess(response, file) {
|
||||
this.addForm.ECO_FRIENDLY_CHECKLIST = response.uploadPath;
|
||||
this.addForm.ECO_FRIENDLY_CHECKLIST = response.uploadPath
|
||||
},
|
||||
handleFactoryCertificateSuccess(response, file) {
|
||||
this.addForm.FACTORY_CERTIFICATE = response.uploadPath;
|
||||
this.addForm.FACTORY_CERTIFICATE = response.uploadPath
|
||||
},
|
||||
handleEnvironmentalScreenshotsSuccess(response, file) {
|
||||
this.addForm.ENVIRONMENTAL_SCREENSHOTS = response.uploadPath;
|
||||
this.addForm.ENVIRONMENTAL_SCREENSHOTS = response.uploadPath
|
||||
},
|
||||
beforeUpload(file) {
|
||||
// 文件上传前的校验逻辑
|
||||
const isLt2M = file.size / 1024 / 1024 < 2;
|
||||
if (!isLt2M) {
|
||||
this.$message.error('上传文件大小不能超过 2MB!');
|
||||
const isJPG = file.type === 'image/jpeg' || file.type === 'image/jpg' || file.type === 'image/png'
|
||||
if (!isJPG) {
|
||||
this.$message.error('上传头像图片只能是 jpg/jpeg/png 格式!')
|
||||
}
|
||||
return isLt2M;
|
||||
// 文件上传前的校验逻辑
|
||||
const isLt2M = file.size / 1024 / 1024 < 2
|
||||
if (!isLt2M) {
|
||||
this.$message.error('上传文件大小不能超过 2MB!')
|
||||
}
|
||||
return isJPG && isLt2M
|
||||
},
|
||||
addDialogCancelBtn() {
|
||||
this.addDialogVisible = false;
|
||||
this.addDialogVisible = false
|
||||
},
|
||||
addDialogConfirmBtn() {
|
||||
this.$refs.addForm.validate(valid => {
|
||||
|
@ -533,7 +553,7 @@ export default {
|
|||
},
|
||||
goEdit(row) {
|
||||
this.editDialogVisible = true
|
||||
this.addForm = {...row};
|
||||
this.addForm = { ...row }
|
||||
},
|
||||
editDialogCancelBtn() {
|
||||
this.editDialogVisible = false
|
||||
|
|
|
@ -50,11 +50,11 @@
|
|||
</el-table-column>
|
||||
<el-table-column prop="AUDIT_STATE" label="审核状态" >
|
||||
<template slot-scope="{row}">
|
||||
<el-tag v-if="row.QY_AUDITOR == null && row.GA_AUDITOR == null" type="success">待申请</el-tag>
|
||||
<el-tag v-if="(row.IS_AUDIT === '0' || row.IS_AUDIT === null) && row.GA_AUDITOR != null" type="success">待公安审批</el-tag>
|
||||
<el-tag v-if="row.IS_AUDIT === '1' && row.QY_AUDITOR != null" type="success">待企业审批</el-tag>
|
||||
<el-tag v-if="row.IS_AUDIT === '2'" type="success">企业审批通过</el-tag>
|
||||
<el-tag v-if="row.IS_AUDIT === '3'" type="error">审批驳回</el-tag>
|
||||
<el-tag v-if="row.QY_AUDITOR == null && row.GA_AUDITOR == null" type="success">待申请</el-tag>
|
||||
<el-tag v-if="(row.IS_AUDIT === '0' || row.IS_AUDIT === null) && row.GA_AUDITOR != null" type="success">待公安审批</el-tag>
|
||||
<el-tag v-if="row.IS_AUDIT === '1' && row.QY_AUDITOR != null" type="success">待企业审批</el-tag>
|
||||
<el-tag v-if="row.IS_AUDIT === '2'" type="success">企业审批通过</el-tag>
|
||||
<el-tag v-if="row.IS_AUDIT === '3'" type="error">审批驳回</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="left" width="300">
|
||||
|
@ -72,87 +72,84 @@
|
|||
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
|
||||
</div>
|
||||
<el-dialog
|
||||
title="申请信息"
|
||||
:visible.sync="dialogVisible"
|
||||
width="30%"
|
||||
:before-close="handleClose">
|
||||
<el-form ref="auditForm" :model="auditForm" label-width="120px">
|
||||
<el-form-item label="访问起始时间">
|
||||
:before-close="handleClose"
|
||||
title="申请信息"
|
||||
width="30%">
|
||||
<el-form ref="auditForm" :model="auditForm" :rules="rules" label-width="120px">
|
||||
<el-form-item label="访问起始时间" prop="VISIT_START_TIME">
|
||||
<el-date-picker
|
||||
v-model="auditForm.VISIT_START_TIME"
|
||||
type="datetime"
|
||||
placeholder="选择日期时间">
|
||||
</el-date-picker>
|
||||
placeholder="选择日期时间"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="访问结束时间">
|
||||
<el-form-item label="访问结束时间" prop="VISIT_END_TIME">
|
||||
<el-date-picker
|
||||
v-model="auditForm.VISIT_END_TIME"
|
||||
type="datetime"
|
||||
placeholder="选择日期时间">
|
||||
</el-date-picker>
|
||||
placeholder="选择日期时间"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="审核人公司" v-if="showCorpSelect">
|
||||
<el-form-item v-if="showCorpSelect" label="审核人公司" prop="CORPINFO_ID">
|
||||
<el-select
|
||||
v-model="auditForm.CORPINFO_ID"
|
||||
placeholder="请选择公司"
|
||||
filterable
|
||||
@change="handleCorpChange">
|
||||
<el-option
|
||||
v-for="corp in corpList"
|
||||
:key="corp.CORPINFO_ID"
|
||||
:label="corp.CORP_NAME"
|
||||
:value="corp.CORPINFO_ID">
|
||||
</el-option>
|
||||
:value="corp.CORPINFO_ID"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="审核人">
|
||||
<el-form-item label="审核人" prop="AUDITOR_ID">
|
||||
<el-select
|
||||
v-model="auditForm.AUDITOR_ID"
|
||||
filterable
|
||||
placeholder="请选择审核人">
|
||||
<el-option
|
||||
v-for="auditor in personList"
|
||||
:key="auditor.USER_ID"
|
||||
:label="auditor.USERNAME"
|
||||
:value="auditor.USER_ID">
|
||||
</el-option>
|
||||
:value="auditor.USER_ID"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="访问地">
|
||||
<el-form-item label="访问地" prop="VISIT_PLACE">
|
||||
<el-select
|
||||
v-model="auditForm.VISIT_PLACE"
|
||||
filterable
|
||||
placeholder="请选择访问口门">
|
||||
<el-option
|
||||
v-for="place in doorList"
|
||||
:key="place.DOOR_ID"
|
||||
:label="place.DOOR_NAME"
|
||||
:value="place.DOOR_ID">
|
||||
</el-option>
|
||||
:value="place.DOOR_ID"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitAudit">确 定</el-button>
|
||||
</span>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitAudit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
title="驳回原因"
|
||||
:visible.sync="remarkDialogVisible"
|
||||
width="30%"
|
||||
:before-close="handleRemarkClose">
|
||||
:before-close="handleRemarkClose"
|
||||
title="驳回原因"
|
||||
width="30%">
|
||||
<el-form>
|
||||
<el-form-item label="驳回原因">
|
||||
<el-input
|
||||
v-model="remarkText"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
readonly>
|
||||
</el-input>
|
||||
type="textarea"
|
||||
readonly/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="remarkDialogVisible = false">关闭</el-button>
|
||||
</span>
|
||||
<el-button @click="remarkDialogVisible = false">关闭</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -162,7 +159,7 @@ import Pagination from '@/components/Pagination' // 通过 el-pagination二次
|
|||
import { requestFN } from '@/utils/request'
|
||||
import SelectTree from '@/components/SelectTree'
|
||||
export default{
|
||||
components: { Pagination, SelectTree},
|
||||
components: { Pagination, SelectTree },
|
||||
data() {
|
||||
return {
|
||||
listQuery: {
|
||||
|
@ -186,7 +183,7 @@ export default{
|
|||
VEHICLE_TYPE: '',
|
||||
CONTACT: '',
|
||||
PHONE: '',
|
||||
EMISSION_STANDARDS:'',
|
||||
EMISSION_STANDARDS: ''
|
||||
},
|
||||
form: {
|
||||
MOTORCADE_NAME: '',
|
||||
|
@ -233,6 +230,32 @@ export default{
|
|||
value: 'ID',
|
||||
label: 'NAME',
|
||||
children: 'nodes'
|
||||
},
|
||||
rules: {
|
||||
VISIT_START_TIME: [
|
||||
{ required: true, message: '访问起始时间不能为空', trigger: 'blur' },
|
||||
{ validator: (rule, value, callback) => {
|
||||
if (value !== '') {
|
||||
if (this.auditForm.VISIT_START_TIME !== '') {
|
||||
this.$refs.auditForm.validateField('VISIT_END_TIME')
|
||||
}
|
||||
callback()
|
||||
}
|
||||
}, trigger: 'change' }
|
||||
],
|
||||
VISIT_END_TIME: [
|
||||
{ required: true, message: '访问结束时间不能为空', trigger: 'blur' },
|
||||
{ validator: (rule, value, callback) => {
|
||||
if (value !== '' && this.auditForm.VISIT_START_TIME &&
|
||||
this.auditForm.VISIT_START_TIME >= this.auditForm.VISIT_END_TIME) {
|
||||
callback(new Error('起始时间不能大于结束时间'))
|
||||
}
|
||||
callback()
|
||||
}, trigger: 'change' }
|
||||
],
|
||||
CORPINFO_ID: [{ required: true, message: '审核公司不能为空', trigger: 'blur' }],
|
||||
AUDITOR_ID: [{ required: true, message: '审核人不能为空', trigger: 'blur' }],
|
||||
VISIT_PLACE: [{ required: true, message: '访问地不能为空', trigger: 'blur' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -240,12 +263,12 @@ export default{
|
|||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
getButton(row){
|
||||
if (row.IS_DANGEROUS_CAR === '0' && row.IS_AUDIT === '1' && row.QY_AUDITOR == null){
|
||||
getButton(row) {
|
||||
if (row.IS_DANGEROUS_CAR === '0' && row.IS_AUDIT === '1' && row.QY_AUDITOR == null) {
|
||||
return true
|
||||
}else if (row.IS_DANGEROUS_CAR === '1' && row.IS_AUDIT === '0' && row.GA_AUDITOR == null){
|
||||
} else if (row.IS_DANGEROUS_CAR === '1' && row.IS_AUDIT === '0' && row.GA_AUDITOR == null) {
|
||||
return true
|
||||
}else {
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
},
|
||||
|
@ -255,11 +278,11 @@ export default{
|
|||
this.getList()
|
||||
},
|
||||
remark(row) {
|
||||
this.remarkText = row.QY_REMARK || row.GA_REMARK; // 假设驳回原因存储在 row.REJECT_REASON 中
|
||||
this.remarkDialogVisible = true; // 显示弹窗
|
||||
this.remarkText = row.QY_REMARK || row.GA_REMARK // 假设驳回原因存储在 row.REJECT_REASON 中
|
||||
this.remarkDialogVisible = true // 显示弹窗
|
||||
},
|
||||
handleRemarkClose() {
|
||||
this.remarkDialogVisible = false; // 关闭弹窗
|
||||
this.remarkDialogVisible = false // 关闭弹窗
|
||||
},
|
||||
translateLicenceType(id) {
|
||||
for (var i = 0; i < this.licenceTypeList.length; i++) {
|
||||
|
@ -293,76 +316,81 @@ export default{
|
|||
})
|
||||
},
|
||||
apply(row) {
|
||||
this.dialogVisible = true;
|
||||
this.dialogVisible = true
|
||||
this.auditForm = {
|
||||
VISIT_START_TIME: '',
|
||||
VISIT_END_TIME: '',
|
||||
CORPINFO_ID: '',
|
||||
AUDITOR_ID: '',
|
||||
VISIT_PLACE: ''
|
||||
};
|
||||
}
|
||||
this.VEHICLE_ID = row.VEHICLE_ID
|
||||
this.IS_DANGEROUS_CAR = row.IS_DANGEROUS_CAR
|
||||
this.showCorpSelect = row.IS_DANGEROUS_CAR !== '1';
|
||||
this.showCorpSelect = row.IS_DANGEROUS_CAR !== '1'
|
||||
// 这里可以调用接口获取公司列表、审核人列表和访问地列表
|
||||
this.getCorpList();
|
||||
this.getPlaceList();
|
||||
if (!this.showCorpSelect){
|
||||
this.getAuditorList();
|
||||
this.getCorpList()
|
||||
this.getPlaceList()
|
||||
if (!this.showCorpSelect) {
|
||||
this.getAuditorList()
|
||||
}
|
||||
},
|
||||
handleCorpChange(corpId) {
|
||||
// 根据选择的公司ID获取审核人列表
|
||||
this.getAuditorList(corpId);
|
||||
this.getAuditorList(corpId)
|
||||
},
|
||||
getCorpList() {
|
||||
// 调用接口获取公司列表
|
||||
requestFN('/mkmj/management/getCorpList').then(response => {
|
||||
this.corpList = response.corpList;
|
||||
});
|
||||
this.corpList = response.corpList
|
||||
})
|
||||
},
|
||||
getAuditorList(corpId) {
|
||||
// 调用接口获取审核人列表
|
||||
requestFN('/mkmj/management/getPersonList',
|
||||
{ CORPINFO_ID: corpId }
|
||||
).then(response => {
|
||||
this.personList = response.personList;
|
||||
});
|
||||
this.personList = response.personList
|
||||
})
|
||||
},
|
||||
getPlaceList() {
|
||||
// 调用接口获取访问地列表
|
||||
requestFN('/mkmj/management/getPlaceList').then(response => {
|
||||
this.doorList = response.doorList;
|
||||
});
|
||||
this.doorList = response.doorList
|
||||
})
|
||||
},
|
||||
submitAudit() {
|
||||
// 提交审核信息
|
||||
requestFN('/mkmj/management/intoPortApplication',
|
||||
{
|
||||
VEHICLE_ID: this.VEHICLE_ID,
|
||||
IS_DANGEROUS_CAR: this.IS_DANGEROUS_CAR,
|
||||
VISIT_START_TIME: this.auditForm.VISIT_START_TIME,
|
||||
VISIT_END_TIME: this.auditForm.VISIT_END_TIME,
|
||||
AUDITOR: this.auditForm.AUDITOR_ID,
|
||||
DOOR_ID: this.auditForm.VISIT_PLACE
|
||||
this.$refs.auditForm.validate(valid => {
|
||||
if (!valid) {
|
||||
return false
|
||||
}
|
||||
).then(response => {
|
||||
this.$message.success('申请提交成功');
|
||||
this.dialogVisible = false;
|
||||
this.getList()
|
||||
});
|
||||
// 提交审核信息
|
||||
requestFN('/mkmj/management/intoPortApplication',
|
||||
{
|
||||
VEHICLE_ID: this.VEHICLE_ID,
|
||||
IS_DANGEROUS_CAR: this.IS_DANGEROUS_CAR,
|
||||
VISIT_START_TIME: this.auditForm.VISIT_START_TIME,
|
||||
VISIT_END_TIME: this.auditForm.VISIT_END_TIME,
|
||||
AUDITOR: this.auditForm.AUDITOR_ID,
|
||||
DOOR_ID: this.auditForm.VISIT_PLACE
|
||||
}
|
||||
).then(response => {
|
||||
this.$message.success('申请提交成功')
|
||||
this.dialogVisible = false
|
||||
this.getList()
|
||||
})
|
||||
})
|
||||
},
|
||||
handleClose(){
|
||||
this.dialogVisible = false;
|
||||
handleClose() {
|
||||
this.dialogVisible = false
|
||||
this.auditForm = {
|
||||
VISIT_START_TIME: '',
|
||||
VISIT_END_TIME: '',
|
||||
CORPINFO_ID: '',
|
||||
AUDITOR_ID: '',
|
||||
VISIT_PLACE: ''
|
||||
};
|
||||
}
|
||||
},
|
||||
returnBtn(){
|
||||
returnBtn() {
|
||||
this.$parent.activeName = 'List'
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue