Compare commits

..

4 Commits

Author SHA1 Message Date
huangyuxuan 757fe7ba29 [问题修复](pet_门口门禁):
- bug修复
2025-02-08 10:28:31 +08:00
huangyuxuan 7798fc0f87 [问题修复](pet_门口门禁):
- bug修复
2025-02-08 10:16:27 +08:00
huangyuxuan 074c8b983d [问题修复](pet_门口门禁):
- bug修复
2025-02-07 14:11:02 +08:00
huangyuxuan b3b82dbf09 [问题修复](hyx_门口门禁):
- bug修复
2025-02-06 14:41:15 +08:00
6 changed files with 453 additions and 368 deletions

View File

@ -1,33 +1,66 @@
<template> <template>
<div v-loading="listLoading"> <div v-loading="listLoading">
<div style="padding:20px"> <div style="padding:20px">
<el-form ref="form" :model="form" :rules="rules" label-width="210px"> <el-form ref="form" :model="form" label-width="210px">
<!-- 动态生成表单项 --> <el-form-item label="智能口门管理系统账号申请单" prop="REQUISITION_FILE" :rules="[{ required: true, message: '智能口门管理系统账号申请单', trigger: 'blur' }]">
<el-row v-for="(item, index) in uploadConfig" :key="index"> <el-upload
<el-col :span="12"> :action="uploadUrl"
<el-form-item v-if="dialogType !== 'savePhoto' && form[item.prop]" :label="`已上传${item.label}`"> :on-success="REQUISITION_FILESuccess"
<div> :on-remove="REQUISITION_FILERemove"
<img :src="config.fileUrl + form[item.prop]" width="100" height="100"> :before-upload="beforeUpload"
</div> :limit="1">
</el-form-item> <el-button type="primary">点击上传</el-button>
<el-form-item :label="item.label" :prop="item.prop"> </el-upload>
<el-upload <img v-if="form.REQUISITION_FILE" :src="config.fileUrl + form.REQUISITION_FILE" alt="智能口门管理系统账号申请单" style="margin-top: 10px; max-width: 20%;"/>
ref="photoUpload" </el-form-item>
:file-list="form[item.prop]"
:multiple="false" <el-form-item label="智能口门管理系统使用承诺书" prop="REQUISITION_FILE" :rules="[{ required: true, message: '智能口门管理系统使用承诺书', trigger: 'blur' }]">
:limit="1" <el-upload
:class="{hide: form[item.prop] && form[item.prop].length > 0}" :action="uploadUrl"
:auto-upload="false" :on-success="COMMITMENT_FILESuccess"
:on-remove="(file, fileList) => handleRemove(file, fileList, item.prop)" :on-remove="COMMITMENT_FILERemove"
:on-change="(file, fileList) => handleChange(file, fileList, item.prop)" :before-upload="beforeUpload"
action="#" :limit="1">
accept=".jpg,.jpeg,.png" <el-button type="primary">点击上传</el-button>
list-type="picture-card"> </el-upload>
<i class="el-icon-plus"/> <img v-if="form.COMMITMENT_FILE" :src="config.fileUrl + form.COMMITMENT_FILE" alt="智能口门管理系统使用承诺书" style="margin-top: 10px; max-width: 20%;"/>
</el-upload> </el-form-item>
</el-form-item>
</el-col> <el-form-item label="营业执照" prop="LICENSE_FILE" :rules="[{ required: true, message: '营业执照', trigger: 'blur' }]">
</el-row> <el-upload
:action="uploadUrl"
:on-success="LICENSE_FILESuccess"
:on-remove="LICENSE_FILERemove"
:before-upload="beforeUpload"
:limit="1">
<el-button type="primary">点击上传</el-button>
</el-upload>
<img v-if="form.LICENSE_FILE" :src="config.fileUrl + form.LICENSE_FILE" alt="营业执照" style="margin-top: 10px; max-width: 20%;"/>
</el-form-item>
<el-form-item label="道路运输经营许可证" prop="TRANSPORT_PERMIT_FILE" :rules="[{ required: true, message: '道路运输经营许可证', trigger: 'blur' }]">
<el-upload
:action="uploadUrl"
:on-success="TRANSPORT_PERMIT_FILESuccess"
:on-remove="TRANSPORT_PERMIT_FILERemove"
:before-upload="beforeUpload"
:limit="1">
<el-button type="primary">点击上传</el-button>
</el-upload>
<img v-if="form.TRANSPORT_PERMIT_FILE" :src="config.fileUrl + form.TRANSPORT_PERMIT_FILE" alt="道路运输经营许可证" style="margin-top: 10px; max-width: 20%;"/>
</el-form-item>
<el-form-item label="危险化学品经营许可证" prop="HAZARDOUS_CHEMICALS_FILE" :rules="[{ required: true, message: '危险化学品经营许可证', trigger: 'blur' }]">
<el-upload
:action="uploadUrl"
:on-success="HAZARDOUS_CHEMICALS_FILESuccess"
:on-remove="HAZARDOUS_CHEMICALS_FILERemove"
:before-upload="beforeUpload"
:limit="1">
<el-button type="primary">点击上传</el-button>
</el-upload>
<img v-if="form.HAZARDOUS_CHEMICALS_FILE" :src="config.fileUrl + form.HAZARDOUS_CHEMICALS_FILE" alt="危险化学品经营许可证" style="margin-top: 10px; max-width: 20%;"/>
</el-form-item>
</el-form> </el-form>
</div> </div>
<div class="ui-height"/> <div class="ui-height"/>
@ -40,18 +73,19 @@
<script> <script>
import Pagination from '@/components/Pagination' // el-pagination import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request' import {requestFN} from '@/utils/request'
import SelectTree from '@/components/SelectTree' import SelectTree from '@/components/SelectTree'
import { upload } from '../../../../../utils/upload' import {upload} from "../../../../../utils/upload";
export default { export default {
components: { Pagination, SelectTree }, components: {Pagination, SelectTree},
data() { data() {
return { return {
listQuery: { listQuery: {
page: 1, page: 1,
limit: 10 limit: 10
}, },
uploadUrl: config.httpurl + '/mkmj/management/fileUpload',
config: config, config: config,
areaList: [], // areaList: [], //
placeList: [], placeList: [],
@ -70,7 +104,7 @@ export default {
VEHICLE_TYPE: '', VEHICLE_TYPE: '',
CONTACT: '', CONTACT: '',
PHONE: '', PHONE: '',
EMISSION_STANDARDS: '' EMISSION_STANDARDS: '',
}, },
form: { form: {
CORPINFO_ID: JSON.parse(sessionStorage.getItem('user')).CORPINFO_ID, CORPINFO_ID: JSON.parse(sessionStorage.getItem('user')).CORPINFO_ID,
@ -81,24 +115,18 @@ export default {
TRANSPORT_PERMIT_FILE: '', TRANSPORT_PERMIT_FILE: '',
HAZARDOUS_CHEMICALS_FILE: '' HAZARDOUS_CHEMICALS_FILE: ''
}, },
rules: {
REQUISITION_FILE: [{ required: true, message: '请上传智能口门管理系统账号申请单', trigger: 'blur' }],
COMMITMENT_FILE: [{ required: true, message: '请上传智能口门管理系统使用承诺书', trigger: 'blur' }],
LICENSE_FILE: [{ required: true, message: '请上传营业执照', trigger: 'blur' }]
},
uploadConfig: [ uploadConfig: [
{ label: '智能口门管理系统账号申请单', prop: 'REQUISITION_FILE', hideUpload: false }, {label: '智能口门管理系统账号申请单', prop: 'REQUISITION_FILE', hideUpload: false},
{ label: '智能口门管理系统使用承诺书', prop: 'COMMITMENT_FILE', hideUpload: false }, {label: '智能口门管理系统使用承诺书', prop: 'COMMITMENT_FILE', hideUpload: false},
{ label: '营业执照', prop: 'LICENSE_FILE', hideUpload: false }, {label: '营业执照', prop: 'LICENSE_FILE', hideUpload: false},
{ label: '道路运输经营许可证', prop: 'TRANSPORT_PERMIT_FILE', hideUpload: false }, {label: '道路运输经营许可证', prop: 'TRANSPORT_PERMIT_FILE', hideUpload: false},
{ label: '危险化学品经营许可证', prop: 'HAZARDOUS_CHEMICALS_FILE', hideUpload: false } {label: '危险化学品经营许可证', prop: 'HAZARDOUS_CHEMICALS_FILE', hideUpload: false}
], ],
urlfromdsfe: {} urlfromdsfe:{}
} }
}, },
async created() { async created() {
this.getList() this.getList()
this.getUploadedFiles()
}, },
methods: { methods: {
// //
@ -120,111 +148,102 @@ export default {
} }
this.getList() this.getList()
}, },
beforeUpload(file) {
//
const isJPG = file.type === 'image/jpeg';
const isPNG = file.type === 'image/png';
if (!isJPG && !isPNG) {
this.$message.error('上传图片只能是 JPG 或 PNG 格式!');
return false;
}
//
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isLt2M) {
this.$message.error('上传文件大小不能超过 2MB!');
}
return isLt2M;
},
REQUISITION_FILESuccess(response, file) {
this.form.REQUISITION_FILE = response.uploadPath;
},
REQUISITION_FILERemove(){
this.form.REQUISITION_FILE = ''
},
COMMITMENT_FILESuccess(response, file) {
this.form.COMMITMENT_FILE = response.uploadPath;
},
COMMITMENT_FILERemove(){
this.form.COMMITMENT_FILE = ''
},
LICENSE_FILESuccess(response, file) {
this.form.LICENSE_FILE = response.uploadPath;
},
LICENSE_FILERemove(){
this.form.LICENSE_FILE = ''
},
TRANSPORT_PERMIT_FILESuccess(response, file) {
this.form.TRANSPORT_PERMIT_FILE = response.uploadPath;
},
TRANSPORT_PERMIT_FILERemove(){
this.form.TRANSPORT_PERMIT_FILE = ''
},
HAZARDOUS_CHEMICALS_FILESuccess(response, file) {
this.form.HAZARDOUS_CHEMICALS_FILE = response.uploadPath;
},
HAZARDOUS_CHEMICALS_FILERemove() {
this.form.HAZARDOUS_CHEMICALS_FILE = ''
},
// //
getList() { getList() {
this.listLoading = true this.listLoading = true
requestFN( requestFN(
'/mkmj/management/carInfoList?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page, this.form '/mkmj/management/carInfoList?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page, this.form
).then((data) => { ).then((data) => {
console.log(data) console.log(data)
this.listLoading = false this.listLoading = false
this.varList = data.carInfoList this.varList = data.carInfoList
this.total = data.page.totalResult this.total = data.page.totalResult
this.hasButton()
this.pd = data.pd this.pd = data.pd
this.form.REQUISITION_FILE = data.motorcadeList[0].REQUISITION_FILE
this.form.COMMITMENT_FILE = data.motorcadeList[0].COMMITMENT_FILE
this.form.LICENSE_FILE = data.motorcadeList[0].LICENSE_FILE
this.form.TRANSPORT_PERMIT_FILE = data.motorcadeList[0].TRANSPORT_PERMIT_FILE
this.form.HAZARDOUS_CHEMICALS_FILE = data.motorcadeList[0].HAZARDOUS_CHEMICALS_FILE
console.log('------------------------')
console.log(this.form.REQUISITION_FILE)
this.hasButton()
}).catch((e) => { }).catch((e) => {
this.listLoading = false this.listLoading = false
}) })
}, },
// //
handleRemove(file, fileList, prop) { handleRemove(file, fileList, prop) {
this.form[prop] = fileList this.form[prop] = fileList;
const configItem = this.uploadConfig.find(item => item.prop === prop) const configItem = this.uploadConfig.find(item => item.prop === prop);
if (configItem) { if (configItem) {
configItem.hideUpload = fileList.length >= 1 configItem.hideUpload = fileList.length >= 1;
}
},
//
handleChange(file, fileList, prop) {
const types = ['image/jpeg', 'image/jpg', 'image/png']
const isImage = types.includes(file.raw.type)
if (!isImage) {
this.$message.error('上传图片只能是 JPG、JPEG、PNG 格式!')
fileList.pop()
this.form[prop] = []
return
}
this.form[prop] = []
this.form[prop].push(file)
const configItem = this.uploadConfig.find(item => item.prop === prop)
if (configItem) {
configItem.hideUpload = fileList.length >= 1
}
},
getUploadedFiles() {
try {
this.listLoading = true
requestFN(
'/mkmj/management/getUploadedFiles', {
MOTORCADE_ID: this.form.MOTORCADE_ID
}
).then((data) => {
console.log(data)
console.info(data)
this.urlfromdsfe = data.corpFilingApplicationEntity
console.info(this.urlfromdsfe)
if (this.urlfromdsfe) {
this.uploadConfig.forEach(item => {
if (this.urlfromdsfe[item.prop]) {
this.form[item.prop] = [{
url: this.config.fileUrl + this.urlfromdsfe[item.prop],
name: this.urlfromdsfe[item.prop].split('/').pop()
}]
}
})
}
this.listLoading = false
}).catch((e) => {
this.listLoading = false
})
} catch (error) {
console.error('获取已上传文件失败', error)
} }
}, },
confirm() { confirm() {
this.$refs.form.validate((valid) => { this.$refs.form.validate(valid => {
if (!valid) { if (valid) {
return false requestFN(
'/mkmj/management/fleetFilingApply',
this.form
).then((data) => {
console.log(data)
this.goBack()
this.listLoading = false
}).catch((e) => {
this.listLoading = false
})
} }
this.listLoading = true
console.log(this.form)
const formData = new FormData()
formData.append('CORPINFO_ID', this.form.CORPINFO_ID)
formData.append('MOTORCADE_ID', this.form.MOTORCADE_ID)
formData.append('REQUISITION_FILE', this.form.REQUISITION_FILE[0].raw)
formData.append('COMMITMENT_FILE', this.form.COMMITMENT_FILE[0].raw)
formData.append('LICENSE_FILE', this.form.LICENSE_FILE[0].raw)
formData.append('TRANSPORT_PERMIT_FILE', this.form.TRANSPORT_PERMIT_FILE[0].raw)
formData.append('HAZARDOUS_CHEMICALS_FILE', this.form.HAZARDOUS_CHEMICALS_FILE[0].raw)
console.log(formData) // FormData
upload(
'/mkmj/management/fleetFilingApply',
formData
).then(response => {
console.log('上传成功', response)
this.listLoading = false
this.goBack()
}).catch(error => {
console.error('上传失败', error)
this.listLoading = false
})
}) })
}, },
goBack() { goBack() {
this.$parent.activeName = 'List' this.$parent.activeName = 'List'
window.location.reload();
} }
} }
} }

View File

@ -36,6 +36,7 @@
align="center"/> align="center"/>
<el-table-column type="index" label="序号" width="50" align="center" /> <el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column prop="MOTORCADE_NAME" label="车队名称"/> <el-table-column prop="MOTORCADE_NAME" label="车队名称"/>
<el-table-column prop="CREATE_DATE" label="车队创建时间"/>
<el-table-column label="审核状态" align="center"> <el-table-column label="审核状态" align="center">
<template slot-scope="{row}"> <template slot-scope="{row}">
{{ getAuditType(row.IS_AUDIT) }} {{ getAuditType(row.IS_AUDIT) }}
@ -44,7 +45,7 @@
<el-table-column label="操作" align="left" width="300"> <el-table-column label="操作" align="left" width="300">
<template slot-scope="{row}"> <template slot-scope="{row}">
<el-button type="primary" icon="el-icon-view" size="mini" @click="handleEdit(row)"></el-button> <el-button type="primary" icon="el-icon-view" size="mini" @click="handleEdit(row)"></el-button>
<el-button type="primary" icon="el-icon-view" size="mini" @click="getAuditInfo(row)"></el-button> <el-button v-if="row.IS_AUDIT !== '2'" type="primary" icon="el-icon-view" size="mini" @click="getAuditInfo(row)"></el-button>
<el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDelete(row)"></el-button> <el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDelete(row)"></el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -69,9 +70,9 @@
</div> </div>
</el-dialog> </el-dialog>
<!--编辑--> <!--编辑-->
<el-dialog :visible.sync="editLoading" width="600px"> <el-dialog :visible.sync="editLoading" width="600px">
<el-form ref="form" :model="form" label-width="110px" style="width: 500px;"> <el-form ref="form" :model="form" :rules="rules" label-width="110px" style="width: 500px;">
<el-form-item label="车队名称:"> <el-form-item label="车队名称:" prop="ADD_MOTORCADE_NAME">
<el-input v-model="form.ADD_MOTORCADE_NAME" placeholder="请输入车队名称" class="filter-item" style="width: 200px;"/> <el-input v-model="form.ADD_MOTORCADE_NAME" placeholder="请输入车队名称" class="filter-item" style="width: 200px;"/>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -128,11 +129,15 @@ export default{
this.getList() this.getList()
}, },
methods: { methods: {
getAuditType(IS_AUDIT) { getAuditType(IS_AUDIT){
if (IS_AUDIT === '1') { if (IS_AUDIT === '1'){
return '待审核'
}else if (IS_AUDIT === '2'){
return '审核通过' return '审核通过'
} else { }else if (IS_AUDIT === '0'){
return '未审核' return '审核驳回'
}else {
return '待申请'
} }
}, },
// //
@ -161,11 +166,11 @@ export default{
this.listLoading = false this.listLoading = false
}) })
}, },
handleAdd() { handleAdd(){
this.form.ADD_MOTORCADE_NAME = '' this.form.ADD_MOTORCADE_NAME = ''
this.addLoading = true this.addLoading = true
}, },
saveMotorcade() { saveMotorcade(){
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
requestFN( requestFN(
@ -182,29 +187,33 @@ export default{
this.addLoading = false this.addLoading = false
}) })
} else { } else {
this.$message.error('请填写完整信息') this.$message.error('请填写完整信息');
} }
}) })
}, },
handleEdit(row) { handleEdit(row){
this.form.MOTORCADE_ID = row.MOTORCADE_ID this.form.MOTORCADE_ID = row.MOTORCADE_ID
this.form.ADD_MOTORCADE_NAME = row.MOTORCADE_NAME this.form.ADD_MOTORCADE_NAME = row.MOTORCADE_NAME
this.editLoading = true this.editLoading = true
}, },
editMotorcade() { editMotorcade(){
requestFN( this.$refs.form.validate((valid) => {
'/mkmj/management/motorcadeInfoManagement', if (valid) {
{ requestFN(
MOTORCADE_ID: this.form.MOTORCADE_ID, '/mkmj/management/motorcadeInfoManagement',
MOTORCADE_NAME: this.form.ADD_MOTORCADE_NAME, {
CORPINFO_ID: JSON.parse(sessionStorage.getItem('user')).CORPINFO_ID MOTORCADE_ID : this.form.MOTORCADE_ID,
MOTORCADE_NAME: this.form.ADD_MOTORCADE_NAME,
CORPINFO_ID: JSON.parse(sessionStorage.getItem('user')).CORPINFO_ID
}
).then((data) => {
this.editLoading = false
this.form.MOTORCADE_NAME = ''
this.getQuery()
}).catch((e) => {
this.editLoading = false
})
} }
).then((data) => {
this.editLoading = false
this.form.MOTORCADE_NAME = ''
this.getQuery()
}).catch((e) => {
this.editLoading = false
}) })
}, },
handleDelete(row) { handleDelete(row) {
@ -216,15 +225,27 @@ export default{
requestFN( requestFN(
'/mkmj/management/deleteMotorCade', '/mkmj/management/deleteMotorCade',
{ {
MOTORCADE_ID: row.MOTORCADE_ID MOTORCADE_ID : row.MOTORCADE_ID
} }
).then((data) => { ).then((data) => {
this.listLoading = false this.listLoading = false
this.getList() this.getList()
this.$message({
type: 'success',
message: '删除成功!'
})
}).catch((e) => { }).catch((e) => {
this.listLoading = false this.listLoading = false
this.$message({
type: 'error',
message: '删除失败!'
})
}) })
}).catch(() => { }).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
}) })
}, },
getAuditInfo(row) { getAuditInfo(row) {

View File

@ -63,19 +63,11 @@
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList"/> <pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList"/>
</div> </div>
<el-dialog :visible.sync="addDialogVisible" title="添加车辆信息" width="600px"> <el-dialog :visible.sync="addDialogVisible" title="添加车辆信息" width="600px">
<el-form <el-form v-if="addDialogVisible" ref="addForm" :model="addForm" label-width="170px"
v-if="addDialogVisible" style="padding:0 20px; width: 500px;">
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-form-item :rules="[{required: true ,message: '车牌号不能为空',trigger: 'blur'}]" label="车牌号" prop="LICENCE_NO">
<el-input <el-input v-model="addForm.LICENCE_NO" type="text" maxlength="300" placeholder="这里输入车牌号..."
v-model="addForm.LICENCE_NO" @blur="goCheckLicenceNoAdd()"/>
type="text"
maxlength="300"
placeholder="这里输入车牌号..."
@blur="goCheckLicenceNoAdd()"/>
</el-form-item> </el-form-item>
<!-- 白牌蓝牌黄牌绿牌黑牌 下拉框--> <!-- 白牌蓝牌黄牌绿牌黑牌 下拉框-->
<el-form-item :rules="[{required: true,message: '车牌类型不能为空',trigger: 'blur'}]" label="车牌类型" prop="LICENCE_TYPE"> <el-form-item :rules="[{required: true,message: '车牌类型不能为空',trigger: 'blur'}]" label="车牌类型" prop="LICENCE_TYPE">
@ -110,68 +102,78 @@
placeholder="请选择是否危化车辆" placeholder="请选择是否危化车辆"
style="width: 300px"/> style="width: 300px"/>
</el-form-item> </el-form-item>
<el-form-item :rules="[{ required: true, message: '请填写负责人姓名', trigger: 'blur' }]" label="负责人" prop="CONTACT"> <el-form-item label="负责人" prop="CONTACT" :rules="[{ required: true, message: '请填写负责人姓名', trigger: 'blur' }]">
<el-input v-model="addForm.CONTACT" type="text" maxlength="300" placeholder="这里输入负责人名称..."/> <el-input v-model="addForm.CONTACT" type="text" maxlength="300" placeholder="这里输入负责人名称..."/>
</el-form-item> </el-form-item>
<el-form-item :rules="[{ required: true, message: '请填写负责人手机号', trigger: 'blur' },{ pattern: /^1[3-9]\d{9}$/, message: '手机号格式不正确', trigger: 'blur' }]" label="负责人手机号" prop="PHONE"> <el-form-item label="负责人手机号" prop="PHONE" :rules="[{ required: true, message: '请填写负责人手机号', trigger: 'blur' },{ pattern: /^1[3-9]\d{9}$/, message: '手机号格式不正确', trigger: 'blur' }]">
<el-input v-model="addForm.PHONE" type="text" maxlength="11" placeholder="这里输入负责人手机号..."/> <el-input v-model="addForm.PHONE" type="text" maxlength="11" placeholder="这里输入负责人手机号..."/>
</el-form-item> </el-form-item>
<el-form-item :rules="[{ required: true, message: '请填写排放标准', trigger: 'blur' }]" label="排放标准" prop="EMISSION_STANDARDS"> <el-form-item label="排放标准" prop="EMISSION_STANDARDS" :rules="[{ required: true, message: '请填写排放标准', trigger: 'blur' }]">
<el-input v-model="addForm.EMISSION_STANDARDS" type="text" maxlength="300" placeholder="这里输入排放标准..."/> <el-input v-model="addForm.EMISSION_STANDARDS" type="text" maxlength="300" placeholder="这里输入排放标准..."/>
</el-form-item> </el-form-item>
<!-- 驾驶证 --> <!-- 驾驶证 -->
<el-form-item :rules="[{ required: true, message: '请上传驾驶证', trigger: 'blur' }]" label="驾驶证" prop="DRIVING_LICENSE"> <el-form-item label="驾驶证" prop="DRIVING_LICENSE" :rules="[{ required: true, message: '请上传驾驶证', trigger: 'blur' }]">
<el-upload <el-upload
:action="uploadUrl"
:on-success="handleDrivingLicenseSuccess" :on-success="handleDrivingLicenseSuccess"
:on-remove="handleDrivingLicenseRemove"
:before-upload="beforeUpload" :before-upload="beforeUpload"
:limit="1" :limit="1">
action="http://127.0.0.1:8199/mkmj/management/fileUpload">
<el-button type="primary">点击上传</el-button> <el-button type="primary">点击上传</el-button>
</el-upload> </el-upload>
<img v-if="addForm.DRIVING_LICENSE" :src="config.fileUrl + addForm.DRIVING_LICENSE" alt="驾驶证" style="margin-top: 10px; max-width: 100%;"/>
</el-form-item> </el-form-item>
<!-- 绿本 --> <!-- 绿本 -->
<el-form-item :rules="[{ required: true, message: '请上传绿本', trigger: 'blur' }]" label="绿本" prop="GREEN_BOOK"> <el-form-item label="绿本" prop="GREEN_BOOK" :rules="[{ required: true, message: '请上传绿本', trigger: 'blur' }]">
<el-upload <el-upload
:action="uploadUrl"
:on-success="handleGreenBookSuccess" :on-success="handleGreenBookSuccess"
:on-remove="handleGreenBookRemove"
:before-upload="beforeUpload" :before-upload="beforeUpload"
:limit="1" :limit="1">
action="http://127.0.0.1:8199/mkmj/management/fileUpload">
<el-button type="primary">点击上传</el-button> <el-button type="primary">点击上传</el-button>
</el-upload> </el-upload>
<img v-if="addForm.GREEN_BOOK" :src="config.fileUrl + addForm.GREEN_BOOK" alt="绿本" style="margin-top: 10px; max-width: 100%;"/>
</el-form-item> </el-form-item>
<!-- 环保随车清单 --> <!-- 环保随车清单 -->
<el-form-item :rules="[{ required: true, message: '请上传环保随车清单', trigger: 'blur' }]" label="环保随车清单" prop="ECO_FRIENDLY_CHECKLIST"> <el-form-item label="环保随车清单" prop="ECO_FRIENDLY_CHECKLIST" :rules="[{ required: true, message: '请上传环保随车清单', trigger: 'blur' }]">
<el-upload <el-upload
:action="uploadUrl"
:on-success="handleEcoFriendlyChecklistSuccess" :on-success="handleEcoFriendlyChecklistSuccess"
:on-remove="handleEcoFriendlyChecklistRemove"
:before-upload="beforeUpload" :before-upload="beforeUpload"
:limit="1" :limit="1">
action="http://127.0.0.1:8199/mkmj/management/fileUpload">
<el-button type="primary">点击上传</el-button> <el-button type="primary">点击上传</el-button>
</el-upload> </el-upload>
<img v-if="addForm.ECO_FRIENDLY_CHECKLIST" :src="config.fileUrl + addForm.ECO_FRIENDLY_CHECKLIST" alt="环保随车清单" style="margin-top: 10px; max-width: 100%;"/>
</el-form-item> </el-form-item>
<!-- 出厂合格证 --> <!-- 出厂合格证 -->
<el-form-item :rules="[{ required: true, message: '请上传出厂合格证', trigger: 'blur' }]" label="出厂合格证" prop="FACTORY_CERTIFICATE"> <el-form-item label="出厂合格证" prop="FACTORY_CERTIFICATE" :rules="[{ required: true, message: '请上传出厂合格证', trigger: 'blur' }]">
<el-upload <el-upload
:action="uploadUrl"
:on-success="handleFactoryCertificateSuccess" :on-success="handleFactoryCertificateSuccess"
:on-remove="handleFactoryCertificateRemove"
:before-upload="beforeUpload" :before-upload="beforeUpload"
:limit="1" :limit="1">
action="http://127.0.0.1:8199/mkmj/management/fileUpload">
<el-button type="primary">点击上传</el-button> <el-button type="primary">点击上传</el-button>
</el-upload> </el-upload>
<img v-if="addForm.FACTORY_CERTIFICATE" :src="config.fileUrl + addForm.FACTORY_CERTIFICATE" alt="出厂合格证" style="margin-top: 10px; max-width: 100%;"/>
</el-form-item> </el-form-item>
<!-- 环保信息截图 --> <!-- 环保信息截图 -->
<el-form-item :rules="[{ required: true, message: '请上传环保信息截图', trigger: 'blur' }]" label="环保信息截图" prop="ENVIRONMENTAL_SCREENSHOTS"> <el-form-item label="环保信息截图" prop="ENVIRONMENTAL_SCREENSHOTS" :rules="[{ required: true, message: '请上传环保信息截图', trigger: 'blur' }]">
<el-upload <el-upload
:action="uploadUrl"
:on-success="handleEnvironmentalScreenshotsSuccess" :on-success="handleEnvironmentalScreenshotsSuccess"
:on-remove="handleEnvironmentalScreenshotsRemove"
:before-upload="beforeUpload" :before-upload="beforeUpload"
:limit="1" :limit="1">
action="http://127.0.0.1:8199/mkmj/management/fileUpload">
<el-button type="primary">点击上传</el-button> <el-button type="primary">点击上传</el-button>
</el-upload> </el-upload>
<img v-if="addForm.ENVIRONMENTAL_SCREENSHOTS" :src="config.fileUrl + addForm.ENVIRONMENTAL_SCREENSHOTS" alt="环保信息截图" style="margin-top: 10px; max-width: 100%;"/>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
@ -181,21 +183,12 @@
</el-dialog> </el-dialog>
<!--编辑--> <!--编辑-->
<el-dialog :visible.sync="editDialogVisible" title="编辑车辆信息" width="600px"> <el-dialog :visible.sync="editDialogVisible" title="编辑车辆信息" width="600px">
<el-form <el-form v-if="editDialogVisible" ref="editForm" :model="addForm" label-width="170px"
v-if="editDialogVisible" style="padding:0 20px; width: 500px;">
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-form-item :rules="[{required: true ,message: '车牌号不能为空',trigger: 'blur'}]" label="车牌号" prop="LICENCE_NO">
<el-input <el-input v-model="addForm.LICENCE_NO" type="text" maxlength="300" placeholder="这里输入车牌号..."
v-model="addForm.LICENCE_NO" @blur="goCheckLicenceNoAdd()"/>
type="text"
maxlength="300"
placeholder="这里输入车牌号..."
@blur="goCheckLicenceNoAdd()"/>
</el-form-item> </el-form-item>
<!-- 白牌蓝牌黄牌绿牌黑牌 下拉框-->
<el-form-item :rules="[{required: true,message: '车牌类型不能为空',trigger: 'blur'}]" label="车牌类型" prop="LICENCE_TYPE"> <el-form-item :rules="[{required: true,message: '车牌类型不能为空',trigger: 'blur'}]" label="车牌类型" prop="LICENCE_TYPE">
<SelectTree <SelectTree
ref="selectTree_add2" ref="selectTree_add2"
@ -228,68 +221,78 @@
placeholder="请选择是否危化车辆" placeholder="请选择是否危化车辆"
style="width: 300px"/> style="width: 300px"/>
</el-form-item> </el-form-item>
<el-form-item :rules="[{ required: true, message: '请填写负责人姓名', trigger: 'blur' }]" label="负责人" prop="CONTACT"> <el-form-item label="负责人" prop="CONTACT" :rules="[{ required: true, message: '请填写负责人姓名', trigger: 'blur' }]">
<el-input v-model="addForm.CONTACT" type="text" maxlength="300" placeholder="这里输入负责人名称..."/> <el-input v-model="addForm.CONTACT" type="text" maxlength="300" placeholder="这里输入负责人名称..."/>
</el-form-item> </el-form-item>
<el-form-item :rules="[{ required: true, message: '请填写负责人手机号', trigger: 'blur' },{ pattern: /^1[3-9]\d{9}$/, message: '手机号格式不正确', trigger: 'blur' }]" label="负责人手机号" prop="PHONE"> <el-form-item label="负责人手机号" prop="PHONE" :rules="[{ required: true, message: '请填写负责人手机号', trigger: 'blur' },{ pattern: /^1[3-9]\d{9}$/, message: '手机号格式不正确', trigger: 'blur' }]">
<el-input v-model="addForm.PHONE" type="text" maxlength="11" placeholder="这里输入负责人手机号..."/> <el-input v-model="addForm.PHONE" type="text" maxlength="11" placeholder="这里输入负责人手机号..."/>
</el-form-item> </el-form-item>
<el-form-item :rules="[{ required: true, message: '请填写排放标准', trigger: 'blur' }]" label="排放标准" prop="EMISSION_STANDARDS"> <el-form-item label="排放标准" prop="EMISSION_STANDARDS" :rules="[{ required: true, message: '请填写排放标准', trigger: 'blur' }]">
<el-input v-model="addForm.EMISSION_STANDARDS" type="text" maxlength="300" placeholder="这里输入排放标准..."/> <el-input v-model="addForm.EMISSION_STANDARDS" type="text" maxlength="300" placeholder="这里输入排放标准..."/>
</el-form-item> </el-form-item>
<!-- 驾驶证 --> <!-- 驾驶证 -->
<el-form-item :rules="[{ required: true, message: '请上传驾驶证', trigger: 'blur' }]" label="驾驶证" prop="DRIVING_LICENSE"> <el-form-item label="驾驶证" prop="DRIVING_LICENSE" :rules="[{ required: true, message: '请上传驾驶证', trigger: 'blur' }]">
<el-upload <el-upload
:action="uploadUrl"
:on-success="handleDrivingLicenseSuccess" :on-success="handleDrivingLicenseSuccess"
:on-remove="handleDrivingLicenseRemove"
:before-upload="beforeUpload" :before-upload="beforeUpload"
:limit="1" :limit="1">
action="http://127.0.0.1:8199/mkmj/management/fileUpload">
<el-button type="primary">点击上传</el-button> <el-button type="primary">点击上传</el-button>
</el-upload> </el-upload>
<img v-if="addForm.DRIVING_LICENSE" :src="config.fileUrl + addForm.DRIVING_LICENSE" alt="驾驶证" style="margin-top: 10px; max-width: 100%;"/>
</el-form-item> </el-form-item>
<!-- 绿本 --> <!-- 绿本 -->
<el-form-item :rules="[{ required: true, message: '请上传绿本', trigger: 'blur' }]" label="绿本" prop="GREEN_BOOK"> <el-form-item label="绿本" prop="GREEN_BOOK" :rules="[{ required: true, message: '请上传绿本', trigger: 'blur' }]">
<el-upload <el-upload
:action="uploadUrl"
:on-success="handleGreenBookSuccess" :on-success="handleGreenBookSuccess"
:on-remove="handleGreenBookRemove"
:before-upload="beforeUpload" :before-upload="beforeUpload"
:limit="1" :limit="1">
action="http://127.0.0.1:8199/mkmj/management/fileUpload">
<el-button type="primary">点击上传</el-button> <el-button type="primary">点击上传</el-button>
</el-upload> </el-upload>
<img v-if="addForm.GREEN_BOOK" :src="config.fileUrl + addForm.GREEN_BOOK" alt="绿本" style="margin-top: 10px; max-width: 100%;"/>
</el-form-item> </el-form-item>
<!-- 环保随车清单 --> <!-- 环保随车清单 -->
<el-form-item :rules="[{ required: true, message: '请上传环保随车清单', trigger: 'blur' }]" label="环保随车清单" prop="ECO_FRIENDLY_CHECKLIST"> <el-form-item label="环保随车清单" prop="ECO_FRIENDLY_CHECKLIST" :rules="[{ required: true, message: '请上传环保随车清单', trigger: 'blur' }]">
<el-upload <el-upload
:action="uploadUrl"
:on-success="handleEcoFriendlyChecklistSuccess" :on-success="handleEcoFriendlyChecklistSuccess"
:on-remove="handleEcoFriendlyChecklistRemove"
:before-upload="beforeUpload" :before-upload="beforeUpload"
:limit="1" :limit="1">
action="http://127.0.0.1:8199/mkmj/management/fileUpload">
<el-button type="primary">点击上传</el-button> <el-button type="primary">点击上传</el-button>
</el-upload> </el-upload>
<img v-if="addForm.ECO_FRIENDLY_CHECKLIST" :src="config.fileUrl + addForm.ECO_FRIENDLY_CHECKLIST" alt="环保随车清单" style="margin-top: 10px; max-width: 100%;"/>
</el-form-item> </el-form-item>
<!-- 出厂合格证 --> <!-- 出厂合格证 -->
<el-form-item :rules="[{ required: true, message: '请上传出厂合格证', trigger: 'blur' }]" label="出厂合格证" prop="FACTORY_CERTIFICATE"> <el-form-item label="出厂合格证" prop="FACTORY_CERTIFICATE" :rules="[{ required: true, message: '请上传出厂合格证', trigger: 'blur' }]">
<el-upload <el-upload
:action="uploadUrl"
:on-success="handleFactoryCertificateSuccess" :on-success="handleFactoryCertificateSuccess"
:on-remove="handleFactoryCertificateRemove"
:before-upload="beforeUpload" :before-upload="beforeUpload"
:limit="1" :limit="1">
action="http://127.0.0.1:8199/mkmj/management/fileUpload">
<el-button type="primary">点击上传</el-button> <el-button type="primary">点击上传</el-button>
</el-upload> </el-upload>
<img v-if="addForm.FACTORY_CERTIFICATE" :src="config.fileUrl + addForm.FACTORY_CERTIFICATE" alt="出厂合格证" style="margin-top: 10px; max-width: 100%;"/>
</el-form-item> </el-form-item>
<!-- 环保信息截图 --> <!-- 环保信息截图 -->
<el-form-item :rules="[{ required: true, message: '请上传环保信息截图', trigger: 'blur' }]" label="环保信息截图" prop="ENVIRONMENTAL_SCREENSHOTS"> <el-form-item label="环保信息截图" prop="ENVIRONMENTAL_SCREENSHOTS" :rules="[{ required: true, message: '请上传环保信息截图', trigger: 'blur' }]">
<el-upload <el-upload
:action="uploadUrl"
:on-success="handleEnvironmentalScreenshotsSuccess" :on-success="handleEnvironmentalScreenshotsSuccess"
:on-remove="handleEnvironmentalScreenshotsRemove"
:before-upload="beforeUpload" :before-upload="beforeUpload"
:limit="1" :limit="1">
action="http://127.0.0.1:8199/mkmj/management/fileUpload">
<el-button type="primary">点击上传</el-button> <el-button type="primary">点击上传</el-button>
</el-upload> </el-upload>
<img v-if="addForm.ENVIRONMENTAL_SCREENSHOTS" :src="config.fileUrl + addForm.ENVIRONMENTAL_SCREENSHOTS" alt="环保信息截图" style="margin-top: 10px; max-width: 100%;"/>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
@ -297,7 +300,7 @@
<el-button type="primary" @click="editDialogConfirmBtn"> </el-button> <el-button type="primary" @click="editDialogConfirmBtn"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
<div style="margin-left: 20px;"/> <div style="margin-left: 20px;"></div>
<div class="bottom-btn-group" style="margin-top: 20px;"> <div class="bottom-btn-group" style="margin-top: 20px;">
<el-button size="mini" @click="goBack"></el-button> <el-button size="mini" @click="goBack"></el-button>
</div> </div>
@ -306,13 +309,15 @@
<script> <script>
import Pagination from '@/components/Pagination' // el-pagination import Pagination from '@/components/Pagination' // el-pagination
import { requestFN } from '@/utils/request' import {requestFN} from '@/utils/request'
import SelectTree from '@/components/SelectTree' import SelectTree from '@/components/SelectTree'
export default { export default {
components: { Pagination, SelectTree }, components: {Pagination, SelectTree},
data() { data() {
return { return {
config: config,
uploadUrl: config.httpurl + '/mkmj/management/fileUpload',
listQuery: { listQuery: {
page: 1, page: 1,
limit: 10 limit: 10
@ -360,28 +365,27 @@ export default {
}, },
// //
licenceTypeList: [ licenceTypeList: [
{ ID: '0', NAME: '白牌' }, {ID: '0', NAME: '白牌'},
{ ID: '1', NAME: '蓝牌' }, {ID: '1', NAME: '蓝牌'},
{ ID: '2', NAME: '黄牌' }, {ID: '2', NAME: '黄牌'},
{ ID: '3', NAME: '绿牌' }, {ID: '3', NAME: '绿牌'},
{ ID: '4', NAME: '黑牌' } {ID: '4', NAME: '黑牌'}
], ],
// //
vehicleTypeList: [ vehicleTypeList: [
// { ID: '', NAME: '' }, // { ID: '', NAME: '' },
{ ID: '0', NAME: '货车' }, {ID: '0', NAME: '货车'},
{ ID: '1', NAME: '轿车' }, {ID: '1', NAME: '轿车'},
{ ID: '2', NAME: '大巴客车' } {ID: '2', NAME: '大巴客车'}
], ],
DANGEROUS_CAR_LIST: [ DANGEROUS_CAR_LIST: [
{ ID: '0', NAME: '否' }, {ID: '0', NAME: '否'},
{ ID: '1', NAME: '是' } {ID: '1', NAME: '是'},
], ],
// //
vehicleDefaultProps: { vehicleDefaultProps: {
value: 'ID', value: 'ID',
label: 'NAME', label: 'NAME'
children: 'nodes'
} }
} }
}, },
@ -428,17 +432,17 @@ export default {
goCheckLicenceNoAdd() { goCheckLicenceNoAdd() {
// //
if (!this.addForm.LICENCE_NO) { if (!this.addForm.LICENCE_NO) {
this.$message.error('车牌号不能为空') // this.$message.error('车牌号不能为空'); //
this.ISCHECK = false // false this.ISCHECK = false; // false
return // return; //
} }
// //
const regex = /^([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1})$/ 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 result = regex.test(this.addForm.LICENCE_NO);
if (result) { if (result) {
console.log('格式校验通过') console.log('格式校验通过');
requestFN( requestFN(
'/mkmj/management/goCheckLicenceNo', '/mkmj/management/goCheckLicenceNo',
{ {
@ -446,20 +450,20 @@ export default {
} }
).then((data) => { ).then((data) => {
if (data.result === 'success') { if (data.result === 'success') {
this.$message.success('验证通过') this.$message.success('验证通过');
this.ISCHECK = true this.ISCHECK = true;
} else { } else {
this.$message.error('车牌号已存在,请重新输入') this.$message.error('车牌号已存在,请重新输入');
this.ISCHECK = false this.ISCHECK = false;
} }
}).catch((e) => { }).catch((e) => {
console.info(e) console.info(e);
this.listLoading = false this.listLoading = false;
this.ISCHECK = false this.ISCHECK = false;
}) });
} else { } else {
this.$message.error('车牌号不规范') // this.$message.error('车牌号不规范'); //
this.ISCHECK = false this.ISCHECK = false;
} }
}, },
// //
@ -470,48 +474,67 @@ export default {
}, },
reSetAddDialog() { reSetAddDialog() {
this.addForm.VEHICLE_ID = '', this.addForm.VEHICLE_ID = '',
this.addForm.LICENCE_NO = '', this.addForm.LICENCE_NO = '',
this.addForm.LICENCE_TYPE = '', this.addForm.LICENCE_TYPE = '',
this.addForm.VEHICLE_TYPE = '', this.addForm.VEHICLE_TYPE = '',
this.addForm.CONTACT = '', this.addForm.CONTACT = '',
this.addForm.PHONE = '', this.addForm.PHONE = '',
this.addForm.EMISSION_STANDARDS = '', this.addForm.EMISSION_STANDARDS = '',
this.addForm.IS_DANGEROUS_CAR = '', this.addForm.IS_DANGEROUS_CAR = '',
this.addForm.DRIVING_LICENSE = '', this.addForm.DRIVING_LICENSE = '',
this.addForm.GREEN_BOOK = '', this.addForm.GREEN_BOOK = '',
this.addForm.ECO_FRIENDLY_CHECKLIST = '', this.addForm.ECO_FRIENDLY_CHECKLIST = '',
this.addForm.FACTORY_CERTIFICATE = '', this.addForm.FACTORY_CERTIFICATE = '',
this.addForm.ENVIRONMENTAL_SCREENSHOTS = '' this.addForm.ENVIRONMENTAL_SCREENSHOTS = ''
}, },
handleDrivingLicenseSuccess(response, file) { handleDrivingLicenseSuccess(response, file) {
this.addForm.DRIVING_LICENSE = response.uploadPath this.addForm.DRIVING_LICENSE = response.uploadPath;
},
handleDrivingLicenseRemove(){
this.addForm.DRIVING_LICENSE = ''
}, },
handleGreenBookSuccess(response, file) { handleGreenBookSuccess(response, file) {
this.addForm.GREEN_BOOK = response.uploadPath this.addForm.GREEN_BOOK = response.uploadPath;
},
handleGreenBookRemove(){
this.addForm.GREEN_BOOK = ''
}, },
handleEcoFriendlyChecklistSuccess(response, file) { handleEcoFriendlyChecklistSuccess(response, file) {
this.addForm.ECO_FRIENDLY_CHECKLIST = response.uploadPath this.addForm.ECO_FRIENDLY_CHECKLIST = response.uploadPath;
},
handleEcoFriendlyChecklistRemove(){
this.addForm.ECO_FRIENDLY_CHECKLIST = ''
}, },
handleFactoryCertificateSuccess(response, file) { handleFactoryCertificateSuccess(response, file) {
this.addForm.FACTORY_CERTIFICATE = response.uploadPath this.addForm.FACTORY_CERTIFICATE = response.uploadPath;
},
handleFactoryCertificateRemove(){
this.addForm.FACTORY_CERTIFICATE = ''
}, },
handleEnvironmentalScreenshotsSuccess(response, file) { handleEnvironmentalScreenshotsSuccess(response, file) {
this.addForm.ENVIRONMENTAL_SCREENSHOTS = response.uploadPath this.addForm.ENVIRONMENTAL_SCREENSHOTS = response.uploadPath;
},
handleEnvironmentalScreenshotsRemove() {
this.addForm.ENVIRONMENTAL_SCREENSHOTS = ''
}, },
beforeUpload(file) { beforeUpload(file) {
const isJPG = file.type === 'image/jpeg' || file.type === 'image/jpg' || file.type === 'image/png' //
if (!isJPG) { const isJPG = file.type === 'image/jpeg';
this.$message.error('上传图片只能是 jpg/jpeg/png 格式!') const isPNG = file.type === 'image/png';
if (!isJPG && !isPNG) {
this.$message.error('上传图片只能是 JPG 或 PNG 格式!');
return false;
} }
// //
const isLt2M = file.size / 1024 / 1024 < 2 const isLt2M = file.size / 1024 / 1024 < 2;
if (!isLt2M) { if (!isLt2M) {
this.$message.error('上传文件大小不能超过 2MB!') this.$message.error('上传文件大小不能超过 2MB!');
} }
return isJPG && isLt2M return isLt2M;
}, },
addDialogCancelBtn() { addDialogCancelBtn() {
this.addDialogVisible = false this.addDialogVisible = false;
}, },
addDialogConfirmBtn() { addDialogConfirmBtn() {
this.$refs.addForm.validate(valid => { this.$refs.addForm.validate(valid => {
@ -553,7 +576,7 @@ export default {
}, },
goEdit(row) { goEdit(row) {
this.editDialogVisible = true this.editDialogVisible = true
this.addForm = { ...row } this.addForm = {...row};
}, },
editDialogCancelBtn() { editDialogCancelBtn() {
this.editDialogVisible = false this.editDialogVisible = false

View File

@ -50,11 +50,11 @@
</el-table-column> </el-table-column>
<el-table-column prop="AUDIT_STATE" label="审核状态" > <el-table-column prop="AUDIT_STATE" label="审核状态" >
<template slot-scope="{row}"> <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.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 === '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 === '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 === '2'" type="success"></el-tag>
<el-tag v-if="row.IS_AUDIT === '3'" type="error"></el-tag> <el-tag v-if="row.IS_AUDIT === '3'" type="error"></el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="left" width="300"> <el-table-column label="操作" align="left" width="300">
@ -72,46 +72,50 @@
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" /> <pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
</div> </div>
<el-dialog <el-dialog
:visible.sync="dialogVisible"
:before-close="handleClose"
title="申请信息" title="申请信息"
width="30%"> :visible.sync="dialogVisible"
width="30%"
:before-close="handleClose">
<el-form ref="auditForm" :model="auditForm" :rules="rules" label-width="120px"> <el-form ref="auditForm" :model="auditForm" :rules="rules" label-width="120px">
<el-form-item label="访问起始时间" prop="VISIT_START_TIME"> <el-form-item label="访问起始时间" prop="VISIT_START_TIME">
<el-date-picker <el-date-picker
v-model="auditForm.VISIT_START_TIME" v-model="auditForm.VISIT_START_TIME"
type="datetime" type="datetime"
placeholder="选择日期时间"/> placeholder="选择日期时间">
</el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="访问结束时间" prop="VISIT_END_TIME"> <el-form-item label="访问结束时间" prop="VISIT_END_TIME">
<el-date-picker <el-date-picker
v-model="auditForm.VISIT_END_TIME" v-model="auditForm.VISIT_END_TIME"
type="datetime" type="datetime"
placeholder="选择日期时间"/> placeholder="选择日期时间">
</el-date-picker>
</el-form-item> </el-form-item>
<el-form-item v-if="showCorpSelect" label="审核人公司" prop="CORPINFO_ID"> <el-form-item label="审核人公司" prop="CORPINFO_ID" v-if="showCorpSelect">
<el-select <el-select
filterable
v-model="auditForm.CORPINFO_ID" v-model="auditForm.CORPINFO_ID"
placeholder="请选择公司" placeholder="请选择公司"
filterable
@change="handleCorpChange"> @change="handleCorpChange">
<el-option <el-option
v-for="corp in corpList" v-for="corp in corpList"
:key="corp.CORPINFO_ID" :key="corp.CORPINFO_ID"
:label="corp.CORP_NAME" :label="corp.CORP_NAME"
:value="corp.CORPINFO_ID"/> :value="corp.CORPINFO_ID">
</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="审核人" prop="AUDITOR_ID"> <el-form-item label="审核人" prop="AUDITOR_ID">
<el-select <el-select
v-model="auditForm.AUDITOR_ID"
filterable filterable
v-model="auditForm.AUDITOR_ID"
placeholder="请选择审核人"> placeholder="请选择审核人">
<el-option <el-option
v-for="auditor in personList" v-for="auditor in personList"
:key="auditor.USER_ID" :key="auditor.USER_ID"
:label="auditor.USERNAME" :label="auditor.USERNAME"
:value="auditor.USER_ID"/> :value="auditor.USER_ID">
</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="访问地" prop="VISIT_PLACE"> <el-form-item label="访问地" prop="VISIT_PLACE">
@ -123,33 +127,35 @@
v-for="place in doorList" v-for="place in doorList"
:key="place.DOOR_ID" :key="place.DOOR_ID"
:label="place.DOOR_NAME" :label="place.DOOR_NAME"
:value="place.DOOR_ID"/> :value="place.DOOR_ID">
</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button> <el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="submitAudit"> </el-button> <el-button type="primary" @click="submitAudit"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog <el-dialog
:visible.sync="remarkDialogVisible"
:before-close="handleRemarkClose"
title="驳回原因" title="驳回原因"
width="30%"> :visible.sync="remarkDialogVisible"
width="30%"
:before-close="handleRemarkClose">
<el-form> <el-form>
<el-form-item label="驳回原因"> <el-form-item label="驳回原因">
<el-input <el-input
v-model="remarkText" v-model="remarkText"
:rows="4"
type="textarea" type="textarea"
readonly/> :rows="4"
readonly>
</el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="remarkDialogVisible = false">关闭</el-button> <el-button @click="remarkDialogVisible = false">关闭</el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
@ -159,9 +165,37 @@ import Pagination from '@/components/Pagination' // 通过 el-pagination二次
import { requestFN } from '@/utils/request' import { requestFN } from '@/utils/request'
import SelectTree from '@/components/SelectTree' import SelectTree from '@/components/SelectTree'
export default{ export default{
components: { Pagination, SelectTree }, components: { Pagination, SelectTree},
data() { data() {
const validateTime = (rule, value, callback) => {
if (!this.auditForm.VISIT_START_TIME || !this.auditForm.VISIT_END_TIME) {
callback();
} else if (this.auditForm.VISIT_START_TIME > this.auditForm.VISIT_END_TIME) {
callback(new Error('访问起始时间不能大于访问结束时间'));
} else {
callback();
}
}
return { return {
rules: {
VISIT_START_TIME: [
{ required: true, message: '请选择访问起始时间', trigger: 'blur' },
{ validator: validateTime, trigger: 'blur' }
],
VISIT_END_TIME: [
{ required: true, message: '请选择访问结束时间', trigger: 'blur' },
{ validator: validateTime, trigger: 'blur' }
],
CORPINFO_ID: [
{ required: true, message: '请选择审核人公司', trigger: 'change' }
],
AUDITOR_ID: [
{ required: true, message: '请选择审核人', trigger: 'change' }
],
VISIT_PLACE: [
{ required: true, message: '请选择访问地', trigger: 'change' }
]
},
listQuery: { listQuery: {
page: 1, page: 1,
limit: 10 limit: 10
@ -230,32 +264,6 @@ export default{
value: 'ID', value: 'ID',
label: 'NAME', label: 'NAME',
children: 'nodes' 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' }]
} }
} }
}, },
@ -263,12 +271,12 @@ export default{
this.getList() this.getList()
}, },
methods: { methods: {
getButton(row) { getButton(row){
if (row.IS_DANGEROUS_CAR === '0' && row.IS_AUDIT === '1' && row.QY_AUDITOR == null) { if (row.IS_DANGEROUS_CAR === '0' && row.IS_AUDIT === '1' && row.QY_AUDITOR == null){
return true 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 return true
} else { }else {
return false return false
} }
}, },
@ -278,11 +286,11 @@ export default{
this.getList() this.getList()
}, },
remark(row) { remark(row) {
this.remarkText = row.QY_REMARK || row.GA_REMARK // row.REJECT_REASON this.remarkText = row.QY_REMARK || row.GA_REMARK; // row.REJECT_REASON
this.remarkDialogVisible = true // this.remarkDialogVisible = true; //
}, },
handleRemarkClose() { handleRemarkClose() {
this.remarkDialogVisible = false // this.remarkDialogVisible = false; //
}, },
translateLicenceType(id) { translateLicenceType(id) {
for (var i = 0; i < this.licenceTypeList.length; i++) { for (var i = 0; i < this.licenceTypeList.length; i++) {
@ -316,81 +324,80 @@ export default{
}) })
}, },
apply(row) { apply(row) {
this.dialogVisible = true this.dialogVisible = true;
this.auditForm = { this.auditForm = {
VISIT_START_TIME: '', VISIT_START_TIME: '',
VISIT_END_TIME: '', VISIT_END_TIME: '',
CORPINFO_ID: '', CORPINFO_ID: '',
AUDITOR_ID: '', AUDITOR_ID: '',
VISIT_PLACE: '' VISIT_PLACE: ''
} };
this.VEHICLE_ID = row.VEHICLE_ID this.VEHICLE_ID = row.VEHICLE_ID
this.IS_DANGEROUS_CAR = row.IS_DANGEROUS_CAR 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.getCorpList();
this.getPlaceList() this.getPlaceList();
if (!this.showCorpSelect) { if (!this.showCorpSelect){
this.getAuditorList() this.getAuditorList();
} }
}, },
handleCorpChange(corpId) { handleCorpChange(corpId) {
// ID // ID
this.getAuditorList(corpId) this.getAuditorList(corpId);
}, },
getCorpList() { getCorpList() {
// //
requestFN('/mkmj/management/getCorpList').then(response => { requestFN('/mkmj/management/getCorpList').then(response => {
this.corpList = response.corpList this.corpList = response.corpList;
}) });
}, },
getAuditorList(corpId) { getAuditorList(corpId) {
// //
requestFN('/mkmj/management/getPersonList', requestFN('/mkmj/management/getPersonList',
{ CORPINFO_ID: corpId } { CORPINFO_ID: corpId }
).then(response => { ).then(response => {
this.personList = response.personList this.personList = response.personList;
}) });
}, },
getPlaceList() { getPlaceList() {
// 访 // 访
requestFN('/mkmj/management/getPlaceList').then(response => { requestFN('/mkmj/management/getPlaceList').then(response => {
this.doorList = response.doorList this.doorList = response.doorList;
}) });
}, },
submitAudit() { submitAudit() {
//
this.$refs.auditForm.validate(valid => { this.$refs.auditForm.validate(valid => {
if (!valid) { if (valid) {
return false 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()
})
} }
//
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() { handleClose(){
this.dialogVisible = false this.dialogVisible = false;
this.auditForm = { this.auditForm = {
VISIT_START_TIME: '', VISIT_START_TIME: '',
VISIT_END_TIME: '', VISIT_END_TIME: '',
CORPINFO_ID: '', CORPINFO_ID: '',
AUDITOR_ID: '', AUDITOR_ID: '',
VISIT_PLACE: '' VISIT_PLACE: ''
} };
}, },
returnBtn() { returnBtn(){
this.$parent.activeName = 'List' this.$parent.activeName = 'List'
} }

View File

@ -231,14 +231,14 @@
:clearable="false" :clearable="false"
:options="departmentTreeData" :options="departmentTreeData"
:props="defaultProps" :props="defaultProps"
v-model="reapplyForm.DEPARTMENT_ID" v-model="reapplyForm.DEPT_NAME"
placeholder="请选择车辆所属部门" placeholder="请选择车辆所属部门"
style="width: 300px" style="width: 300px"
@change="handleCorpChange"/> @change="handleCorpChange"/>
</el-form-item> </el-form-item>
<el-form-item label="负责人" prop="U_NAME"> <el-form-item label="负责人" prop="U_NAME">
<el-select <el-select
v-model="reapplyForm.USER_ID" v-model="reapplyForm.U_NAME"
placeholder="请选择负责人"> placeholder="请选择负责人">
<el-option <el-option
v-for="user in personList" v-for="user in personList"
@ -283,7 +283,18 @@ export default {
return { return {
rules: { rules: {
LICENCE_NO: [ LICENCE_NO: [
{ required: true, message: '车牌号不能为空', trigger: 'blur' } { required: true, message: '车牌号不能为空', trigger: 'blur' },
{
validator: (rule, value, callback) => {
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: [ LICENCE_TYPE: [
{ required: true, message: '车牌类型不能为空', trigger: 'change' } { required: true, message: '车牌类型不能为空', trigger: 'change' }
@ -422,6 +433,7 @@ export default {
}, },
reapplyDialogVisible: false, // reapplyDialogVisible: false, //
reapplyForm: { // reapplyForm: { //
VEHICLE_DEPARTMENT_ID: '',
LICENCE_NO: '', LICENCE_NO: '',
LICENCE_TYPE: '', LICENCE_TYPE: '',
VEHICLE_TYPE: '', VEHICLE_TYPE: '',
@ -611,7 +623,7 @@ export default {
this.ISCHECK = false this.ISCHECK = false
}) })
} else { } else {
this.$message.success('车牌号不规范') this.$message.error('车牌号不规范')
this.ISCHECK = false this.ISCHECK = false
} }
} }
@ -627,8 +639,10 @@ export default {
}, },
apply(row) { apply(row) {
console.log(row)
this.reapplyForm = { ...row }; // reapplyForm this.reapplyForm = { ...row }; // reapplyForm
this.reapplyForm.DEPT_NAME = row.DEPT_NAME this.reapplyForm.DEPT_NAME = row.DEPT_NAME
this.reapplyForm.DEPARTMENT_ID = row.VEHICLE_DEPARTMENT_ID
this.reapplyForm.U_NAME = row.U_NAME this.reapplyForm.U_NAME = row.U_NAME
this.reapplyDialogVisible = true; // this.reapplyDialogVisible = true; //
console.log(this.reapplyForm) console.log(this.reapplyForm)
@ -637,6 +651,7 @@ export default {
this.reapplyDialogVisible = false; // this.reapplyDialogVisible = false; //
}, },
reapplyDialogConfirmBtn() { reapplyDialogConfirmBtn() {
console.log()
// //
this.$refs.reapplyForm.validate(valid => { this.$refs.reapplyForm.validate(valid => {
if (valid) { if (valid) {

View File

@ -30,7 +30,7 @@
<el-table-column prop="personType" label="人员身份"/> <el-table-column prop="personType" label="人员身份"/>
<el-table-column prop="personType" label="人员身份"/> <el-table-column prop="personType" label="人员身份"/>
<el-table-column prop="regionName" label="区域名称"/> <el-table-column prop="regionName" label="区域名称"/>
<el-table-column prop="reportTime" label="上报时间"/> <el-table-column prop="syncTime" label="上报时间"/>
</el-table> </el-table>
<div class="page-btn-group"> <div class="page-btn-group">
<div/><div/> <div/><div/>