|
@@ -17,6 +17,7 @@
|
|
|
|
|
|
<!-- 筛选条件 -->
|
|
|
<query-conditions
|
|
|
+ v-if="btnSelected === 2 || btnSelected === 3"
|
|
|
:formItems="formItems"
|
|
|
:propFormData="propFormData"
|
|
|
:defaultEmit="true"
|
|
@@ -30,8 +31,25 @@
|
|
|
:listData="listData"
|
|
|
:tableItems="tableItems"
|
|
|
:shows="tableShows"
|
|
|
- :height="475"
|
|
|
+ :height="600"
|
|
|
>
|
|
|
+ <template #right>
|
|
|
+ <template v-if="btnSelected === 1">
|
|
|
+ <el-button size="mini" @click="add" type="primary">新增车辆</el-button>
|
|
|
+ <el-button size="mini" @click="btnSelected = 5" type="success">查看白名单</el-button>
|
|
|
+ <el-button size="mini" @click="btnSelected = 6" type="warning">查看黑名单</el-button>
|
|
|
+ </template>
|
|
|
+ <template v-if="btnSelected === 5">
|
|
|
+ <el-button size="mini" type="success" @click="addWhite(1)">添加白名单</el-button>
|
|
|
+ <el-button size="mini" @click="btnSelected = 1" type="primary">查看车辆档案</el-button>
|
|
|
+ <el-button size="mini" @click="btnSelected = 6" type="warning">查看黑名单</el-button>
|
|
|
+ </template>
|
|
|
+ <template v-if="btnSelected === 6">
|
|
|
+ <el-button size="mini" type="success" @click="addWhite(2)">添加黑名单</el-button>
|
|
|
+ <el-button size="mini" @click="btnSelected = 1" type="primary">查看车辆档案</el-button>
|
|
|
+ <el-button size="mini" @click="btnSelected = 5" type="success">查看白名单</el-button>
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
<!-- <template v-slot:right>
|
|
|
<template>
|
|
|
<div>共{{ total }}辆车</div>
|
|
@@ -47,9 +65,25 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</template> -->
|
|
|
+ <!-- 白名单操作 -->
|
|
|
+ <template #whiteHandle="scope">
|
|
|
+ <el-button size="mini" type="primary" @click="del(scope.row, 1)">移出白名单</el-button>
|
|
|
+ </template>
|
|
|
+ <template #blackHandle="scope">
|
|
|
+ <el-button size="mini" type="primary" @click="del(scope.row, 2)">移出黑名单</el-button>
|
|
|
+ </template>
|
|
|
+ <!-- 车辆档案操作 -->
|
|
|
+ <template #handle="scope">
|
|
|
+<!-- <el-button size="mini" type="success" @click="onJoin(scope.row, 1)">加入白名单</el-button>-->
|
|
|
+<!-- <el-button size="mini" type="warning" @click="onJoin(scope.row, 2)">加入黑名单</el-button>-->
|
|
|
+ <el-button size="mini" type="danger" @click="onJoin(scope.row, 3)">删除</el-button>
|
|
|
+ </template>
|
|
|
<template v-slot:carNum="slotProps">
|
|
|
{{ slotProps.row.carNum ? slotProps.row.carNum : "未识别" }}
|
|
|
</template>
|
|
|
+ <template #carHandle="scope">
|
|
|
+ <el-button v-if="scope.row.carNum" size="mini" @click="addBase(scope.row.carNum)">添加到车辆档案</el-button>
|
|
|
+ </template>
|
|
|
<template v-slot:originalPicPath="slotProps">
|
|
|
<img
|
|
|
:src="slotProps.row.originalPicPath"
|
|
@@ -86,6 +120,22 @@
|
|
|
@pageChange="pageChange"
|
|
|
>
|
|
|
</table-footer>
|
|
|
+ <el-dialog :title="'车辆档案新增'" :visible.sync="isFile" width="50%">
|
|
|
+ <el-form :model="form" :rules="rules" ref="ruleForm" label-width="100px">
|
|
|
+ <el-form-item prop="carId" label="车辆编号" v-if="showType">
|
|
|
+ <el-input v-model="form.carId" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="carNum" label="车牌号">
|
|
|
+ <el-input v-model="form.carNum"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="reset">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submitForm('ruleForm')">
|
|
|
+ 确 定
|
|
|
+ </el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
<el-dialog title="车辆图片" :visible.sync="dialogVisible" width="50%">
|
|
|
<img :src="imgUrl" alt="车辆通行" width="100%" />
|
|
|
<span slot="footer" class="dialog-footer">
|
|
@@ -124,6 +174,18 @@
|
|
|
</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
+ <el-dialog :title="showType ? '添加黑名单' : '添加白名单' " :visible.sync="isWhite" width="50%">
|
|
|
+ <new-table :title="''"
|
|
|
+ :listData="abList"
|
|
|
+ :tableItems="abItems"
|
|
|
+ :shows="abShows" @selectionChange="selectionChange"></new-table>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="isWhite = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="clickCar">
|
|
|
+ 确 定
|
|
|
+ </el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -144,6 +206,7 @@ import {
|
|
|
getCarWashVideo,
|
|
|
getCarDrying,
|
|
|
getCarDryingTemp,
|
|
|
+ getCarList, addCarWhite, addCarBlack, showCarWhite, addCarBase, showCarBlack, delCarWhite, delCarBlack, delCarBase, addWandB
|
|
|
} from "../../utils/chenApi";
|
|
|
import { timeDate } from "../../utils/index";
|
|
|
import { mapState } from "vuex";
|
|
@@ -164,9 +227,10 @@ export default {
|
|
|
return {
|
|
|
btnNames: [
|
|
|
// 按钮情况
|
|
|
- { id: 1, name: "车辆通行" },
|
|
|
- { id: 2, name: "车辆洗消" },
|
|
|
- { id: 3, name: "车辆烘干" },
|
|
|
+ { id: 1, name: '车辆档案'},
|
|
|
+ { id: 2, name: "车辆通行" },
|
|
|
+ { id: 3, name: "车辆洗消" },
|
|
|
+ { id: 4, name: "车辆烘干" },
|
|
|
],
|
|
|
btnSelected: 1, // 选中的按钮
|
|
|
formItems: [], // 传给 QueryCondition 组件的 formItems
|
|
@@ -187,42 +251,82 @@ export default {
|
|
|
rtsp: "", // 车辆回放的地址
|
|
|
tempVisible: false, // 车辆烘干 - 查看温度详情
|
|
|
tempChartData: {},
|
|
|
+ isFile: false,
|
|
|
+ form: {
|
|
|
+ carId: '',
|
|
|
+ carNum: '',
|
|
|
+ },
|
|
|
+ rules: {
|
|
|
+ carId: [{ required: true, message: '请输入车辆编号', trigger: 'blur' }],
|
|
|
+ carNum: [{ required: true, message: '请输入车牌号', trigger: 'blur' }]
|
|
|
+ },
|
|
|
+ showType: false,
|
|
|
+ isWhite: false,
|
|
|
+ // 白黑名单
|
|
|
+ abList: [],
|
|
|
+ abItems: [
|
|
|
+ {
|
|
|
+ prop: 'carId',
|
|
|
+ label: '车辆编号',
|
|
|
+ minWidth: '120',
|
|
|
+ slotName: 'carId'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'carNum',
|
|
|
+ label: '车牌号',
|
|
|
+ minWidth: '120',
|
|
|
+ slotName: 'carNum'
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ abShows: {
|
|
|
+ showIndex: false,
|
|
|
+ showSelect: true
|
|
|
+ },
|
|
|
+ selectList: [],
|
|
|
};
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ btnSelected(newVal) {
|
|
|
+ this.pageNum = 1;
|
|
|
+ this.listData = [];
|
|
|
+ this.formItems = formItems[this.btnSelected - 1];
|
|
|
+ this.propFormData = propFormData[this.btnSelected - 1];
|
|
|
+ this.title = titles[this.btnSelected - 1];
|
|
|
+ this.tableItems = tableItems[this.btnSelected - 1];
|
|
|
+ if (newVal === 1) {
|
|
|
+ // 档案
|
|
|
+ this.getCarList()
|
|
|
+ } else if (newVal === 2) {
|
|
|
+ // 车辆通行
|
|
|
+ this.carPassage();
|
|
|
+ } else if (newVal === 3) {
|
|
|
+ // 车辆洗消
|
|
|
+ this.carWash();
|
|
|
+ } else if(newVal=== 4){
|
|
|
+ // 车辆烘干
|
|
|
+ this.carDrying();
|
|
|
+ } else if(newVal === 5) {
|
|
|
+ // 白名单
|
|
|
+ this.ShowCarWhite()
|
|
|
+ } else {
|
|
|
+ // 黑名单
|
|
|
+ this.ShowCarBlack()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
mounted() {
|
|
|
this.formItems = formItems[this.btnSelected - 1];
|
|
|
this.propFormData = propFormData[this.btnSelected - 1];
|
|
|
- console.log(this.propFormData);
|
|
|
this.title = titles[this.btnSelected - 1];
|
|
|
this.tableItems = tableItems[this.btnSelected - 1];
|
|
|
this.tableShows = tableShows;
|
|
|
- if (this.btnSelected === 1) {
|
|
|
- this.carPassage();
|
|
|
- } else if (this.btnSelected === 2) {
|
|
|
- this.carWash();
|
|
|
- } else {
|
|
|
- this.carDrying();
|
|
|
- }
|
|
|
+ // 档案
|
|
|
+ this.getCarList()
|
|
|
+
|
|
|
},
|
|
|
methods: {
|
|
|
getBtnSelected(id) {
|
|
|
this.btnSelected = id;
|
|
|
- this.formItems = formItems[id - 1];
|
|
|
- this.propFormData = propFormData[id - 1];
|
|
|
- this.title = titles[id - 1];
|
|
|
- this.tableItems = tableItems[id - 1];
|
|
|
- this.pageNum = 1;
|
|
|
- this.listData = [];
|
|
|
- this.params = {};
|
|
|
- console.log("1111");
|
|
|
- if (this.btnSelected === 1) {
|
|
|
- this.carPassage();
|
|
|
- } else if (this.btnSelected === 2) {
|
|
|
- this.carWash();
|
|
|
- this.carWashTotal();
|
|
|
- } else {
|
|
|
- this.carDrying();
|
|
|
- }
|
|
|
},
|
|
|
// 获取查询条件
|
|
|
handleQuery(params) {
|
|
@@ -231,12 +335,23 @@ export default {
|
|
|
|
|
|
this.listData = [];
|
|
|
if (this.btnSelected === 1) {
|
|
|
- this.carPassage();
|
|
|
+ // 档案
|
|
|
+ this.getCarList()
|
|
|
} else if (this.btnSelected === 2) {
|
|
|
+ // 车辆通行
|
|
|
+ this.carPassage();
|
|
|
+ } else if (this.btnSelected === 3) {
|
|
|
+ // 车辆洗消
|
|
|
this.carWash();
|
|
|
- this.carWashTotal();
|
|
|
- } else {
|
|
|
+ } else if(this.btnSelected === 4){
|
|
|
+ // 车辆烘干
|
|
|
this.carDrying();
|
|
|
+ } else if(this.btnSelected === 5) {
|
|
|
+ // 白名单
|
|
|
+ this.ShowCarWhite()
|
|
|
+ } else {
|
|
|
+ // 黑名单
|
|
|
+ this.ShowCarBlack()
|
|
|
}
|
|
|
},
|
|
|
// 修改size
|
|
@@ -245,22 +360,46 @@ export default {
|
|
|
this.pageNum = 1;
|
|
|
this.listData = [];
|
|
|
if (this.btnSelected === 1) {
|
|
|
- this.carPassage();
|
|
|
+ // 档案
|
|
|
+ this.getCarList()
|
|
|
} else if (this.btnSelected === 2) {
|
|
|
+ // 车辆通行
|
|
|
+ this.carPassage();
|
|
|
+ } else if (this.btnSelected === 3) {
|
|
|
+ // 车辆洗消
|
|
|
this.carWash();
|
|
|
- } else {
|
|
|
+ } else if(this.btnSelected === 4){
|
|
|
+ // 车辆烘干
|
|
|
this.carDrying();
|
|
|
+ } else if(this.btnSelected === 5) {
|
|
|
+ // 白名单
|
|
|
+ this.ShowCarWhite();
|
|
|
+ } else {
|
|
|
+ // 黑名单
|
|
|
+ this.ShowCarBlack();
|
|
|
}
|
|
|
},
|
|
|
// 修改页数
|
|
|
pageChange(val) {
|
|
|
this.pageNum = val;
|
|
|
if (this.btnSelected === 1) {
|
|
|
- this.carPassage();
|
|
|
+ // 档案
|
|
|
+ this.getCarList()
|
|
|
} else if (this.btnSelected === 2) {
|
|
|
+ // 车辆通行
|
|
|
+ this.carPassage();
|
|
|
+ } else if (this.btnSelected === 3) {
|
|
|
+ // 车辆洗消
|
|
|
this.carWash();
|
|
|
- } else {
|
|
|
+ } else if(this.btnSelected === 4){
|
|
|
+ // 车辆烘干
|
|
|
this.carDrying();
|
|
|
+ } else if(this.btnSelected === 5) {
|
|
|
+ // 白名单
|
|
|
+ this.ShowCarWhite();
|
|
|
+ } else {
|
|
|
+ // 黑名单
|
|
|
+ this.ShowCarBlack();
|
|
|
}
|
|
|
},
|
|
|
// 车辆通行 查询
|
|
@@ -285,6 +424,227 @@ export default {
|
|
|
this.dialogVisible = true;
|
|
|
this.imgUrl = url;
|
|
|
},
|
|
|
+ // 车辆档案
|
|
|
+ getCarList() {
|
|
|
+ let params = {
|
|
|
+ pageNum: this.pageNum,
|
|
|
+ pageSize: this.size
|
|
|
+ }
|
|
|
+ getCarList(params).then(res => {
|
|
|
+ if(res.code == 200) {
|
|
|
+ const result = JSON.parse(res.result);
|
|
|
+ this.total = parseInt(result.data.totalRows);
|
|
|
+ this.listData = result.data.pageData;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 档案操作
|
|
|
+ onJoin(row, num) {
|
|
|
+ if(num === 1) {
|
|
|
+ addCarWhite({carId: row.carId}).then(res => {
|
|
|
+ if(res.code == 200) {
|
|
|
+ this.$message.success('加入白名单成功');
|
|
|
+ this.getCarList();
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.errMsg);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else if(num === 2) {
|
|
|
+ addCarBlack({carId: row.carId}).then(res => {
|
|
|
+ if(res.code == 200) {
|
|
|
+ this.$message.success('加入黑名单成功');
|
|
|
+ this.getCarList();
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.errMsg);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else if(num === 3) {
|
|
|
+ // 删除
|
|
|
+ let params = {
|
|
|
+ carIdList: [row.carId]
|
|
|
+ }
|
|
|
+ delCarBase(params).then(res => {
|
|
|
+ if(res.code == 200) {
|
|
|
+ this.$message.success('删除成功');
|
|
|
+ this.getCarList()
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.errMsg);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 新增车辆
|
|
|
+ add() {
|
|
|
+ this.isFile = true;
|
|
|
+ this.showType = false;
|
|
|
+ },
|
|
|
+
|
|
|
+ // 添加白名单
|
|
|
+ addWhite(num) {
|
|
|
+ this.isWhite = true;
|
|
|
+ let params = {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 200
|
|
|
+ }
|
|
|
+ if(num === 1) {
|
|
|
+ params.draw = 4;
|
|
|
+ this.showType = false;
|
|
|
+ } else {
|
|
|
+ this.showType = true;
|
|
|
+ params.draw = 5;
|
|
|
+ }
|
|
|
+ addWandB(params).then(res => {
|
|
|
+ if(res.code == 200) {
|
|
|
+ const result = JSON.parse(res.result);
|
|
|
+ this.abList = result.data.pageData;
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.errMsg);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ clickCar() {
|
|
|
+ if(this.selectList.length > 0) {
|
|
|
+ let params = {};
|
|
|
+ let arr = [];
|
|
|
+ this.selectList.forEach(item => {
|
|
|
+ arr.push(item.carId)
|
|
|
+ })
|
|
|
+ params.carIdList = arr;
|
|
|
+ if(this.showType) {
|
|
|
+ // 黑名单
|
|
|
+ addCarBlack(params).then(res => {
|
|
|
+ if(res.code == 200) {
|
|
|
+ this.$message.success('添加成功!');
|
|
|
+ this.ShowCarBlack();
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.errMsg)
|
|
|
+ }
|
|
|
+ this.isWhite = false;
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ addCarWhite(params).then(res => {
|
|
|
+ if(res.code == 200) {
|
|
|
+ this.$message.success('添加成功!');
|
|
|
+ this.ShowCarWhite();
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.errMsg)
|
|
|
+ }
|
|
|
+ this.isWhite = false;
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$message.error('请选择要添加的车辆!');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 选择
|
|
|
+ selectionChange(item) {
|
|
|
+ this.selectList = item;
|
|
|
+ },
|
|
|
+ // 档案编辑
|
|
|
+ submitForm(formName) {
|
|
|
+ this.$refs[formName].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ if(this.showType) {
|
|
|
+ // 编辑
|
|
|
+
|
|
|
+ } else {
|
|
|
+ let params = {
|
|
|
+ carNum: this.form.carNum
|
|
|
+ }
|
|
|
+ addCarBase(params).then(res => {
|
|
|
+ if(res.code == 200) {
|
|
|
+ this.reset();
|
|
|
+ this.$message.success('添加成功');
|
|
|
+ this.getCarList();
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.errMsg);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ console.log('error submit!!');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 重置
|
|
|
+ reset() {
|
|
|
+ this.isFile = false;
|
|
|
+ this.showType = false;
|
|
|
+ this.form = {
|
|
|
+ carNum: '',
|
|
|
+ carId: ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 白名单列表
|
|
|
+ ShowCarWhite() {
|
|
|
+ let params = {
|
|
|
+ pageNum: this.pageNum,
|
|
|
+ pageSize: this.size
|
|
|
+ }
|
|
|
+ showCarWhite(params).then(res => {
|
|
|
+ if(res.code == 200) {
|
|
|
+ const result = JSON.parse(res.result);
|
|
|
+ this.total = parseInt(result.data.totalRows);
|
|
|
+ this.listData = result.data.pageData;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 黑名单列表
|
|
|
+ ShowCarBlack() {
|
|
|
+ let params = {
|
|
|
+ pageNum: this.pageNum,
|
|
|
+ pageSize: this.size
|
|
|
+ }
|
|
|
+ showCarBlack(params).then(res => {
|
|
|
+ if(res.code == 200) {
|
|
|
+ const result = JSON.parse(res.result);
|
|
|
+ this.total = parseInt(result.data.totalRows);
|
|
|
+ this.listData = result.data.pageData;
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.errMsg);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 移除黑白名单
|
|
|
+ del(row, num) {
|
|
|
+ let params = {
|
|
|
+ carIdList: [row.carId]
|
|
|
+ }
|
|
|
+ if(num === 1) {
|
|
|
+ delCarWhite(params).then(res => {
|
|
|
+ if(res.code == 200) {
|
|
|
+ this.$message.success('移出白名单成功!');
|
|
|
+ this.ShowCarWhite();
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.errMsg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ delCarBlack(params).then(res => {
|
|
|
+ if(res.code == 200) {
|
|
|
+ this.$message.success('移出黑名单成功!');
|
|
|
+ this.ShowCarBlack();
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.errMsg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 车辆通行添加到车辆档案
|
|
|
+ addBase(id) {
|
|
|
+ let params = {
|
|
|
+ carNum: id
|
|
|
+ }
|
|
|
+ addCarBase(params).then(res => {
|
|
|
+ if(res.code == 200) {
|
|
|
+ this.$message.success('添加成功!');
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.errMsg);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 车辆洗消
|
|
|
carWash() {
|
|
|
if (!this.params.time) {
|