兴安优化-车辆还原

This commit is contained in:
zc
2026-01-05 15:18:02 +08:00
parent de553b5e55
commit 757abb26f9
4 changed files with 250 additions and 3 deletions

View File

@@ -42,3 +42,12 @@ export function delCarInfo(customerId) {
method: 'delete'
})
}
// 删除车辆信息
export function restore(customerIds) {
return request({
url: '/system/carInfo/restore',
method: 'post',
data: customerIds
})
}

View File

@@ -40,7 +40,7 @@
/>
</el-form-item>
<el-form-item label="所属单位" prop="unit">
<el-select v-model="queryParams.unit" placeholder="请选择所属单位">
<el-select v-model="queryParams.unit" placeholder="请选择所属单位" clearable>
<el-option
v-for="dict in dict.type.car_unit"
:key="dict.value"
@@ -431,6 +431,7 @@ export default {
queryParams: {
pageNum: 1,
pageSize: 10,
delFlag: '0',
enableTime: null,
overdueTime: null,
enable: null,

View File

@@ -0,0 +1,237 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="所属车场" prop="parkId">
<el-select v-model="queryParams.parkId" placeholder="请输入所属车场" clearable >
<el-option
v-for="dict in parkOptions"
:key="dict.id"
:label="dict.name"
:value="dict.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="车牌号" prop="plate">
<el-input
v-model="queryParams.plate"
placeholder="请输入车牌号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="所属单位" prop="unit">
<el-select v-model="queryParams.unit" placeholder="请选择所属单位" clearable>
<el-option
v-for="dict in dict.type.car_unit"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="所属人员" prop="peopleName">
<el-input
v-model="queryParams.peopleName"
placeholder="请输入所属人员"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="multiple"
@click="handleRestore"
v-hasPermi="['system:delCarInfo:edit']"
>还原</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:delCarInfo:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="carInfoList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="所属车场" align="center" prop="parkName" />
<el-table-column label="车牌号" align="center" prop="plate" />
<el-table-column label="生效时间" align="center" prop="enableTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.enableTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="失效时间" align="center" prop="overdueTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.overdueTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="是否启动" align="center" prop="enable" >
<template slot-scope="scope">
<span v-if="scope.row.enable=='1'"></span>
<span v-if="scope.row.enable=='0'"></span>
</template>
</el-table-column>
<el-table-column label="是否启用时间段" align="center" prop="timeSegEnable" >
<template slot-scope="scope">
<span v-if="scope.row.timeSegEnable=='1'"></span>
<span v-if="scope.row.timeSegEnable=='0'"></span>
</template>
</el-table-column>
<el-table-column label="时间段" align="center" prop="segTime" width="180">
</el-table-column>
<el-table-column label="是否报警" align="center" prop="needAlarm" >
<template slot-scope="scope">
<span v-if="scope.row.needAlarm=='1'"></span>
<span v-if="scope.row.needAlarm=='0'"></span>
</template>
</el-table-column>
<el-table-column label="所属单位" align="center" prop="unit">
<template slot-scope="scope">
<dict-tag :options="dict.type.car_unit" :value="scope.row.unit"/>
</template>
</el-table-column>
<el-table-column label="所属人员" align="center" prop="peopleName" />
<el-table-column label="联系电话" align="center" prop="phone" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleRestore(scope.row)"
v-hasPermi="['system:delCarInfo:restore']"
>还原</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import {listCarInfo, restore} from "@/api/vehicle/carInfo";
import {listCarPark} from "@/api/vehicle/carPark";
export default {
name: "DelCarInfo",
dicts: ['car_unit'],
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
showNum: false,
// 总条数
total: 0,
// 车辆信息表格数据
carInfoList: [],
peopleOptions: [],
parkOptions: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
delFlag: '2',
parkId: null,
plate: null,
peopleId: null,
},
// 表单参数
form: {},
};
},
created() {
this.getList();
this.getOptions()
},
methods: {
/** 查询车辆信息列表 */
getList() {
this.loading = true;
listCarInfo(this.queryParams).then(response => {
this.carInfoList = response.rows;
this.total = response.total;
this.loading = false;
});
},
getOptions() {
this.parkOptions = []
listCarPark().then(response => {
this.parkOptions = response.rows
})
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.customerId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 修改按钮操作 */
handleRestore(row) {
const customerIds = row.customerId ? [row.customerId] : this.ids;
this.$modal.confirm('是否确认还原车辆信息编号为"' + customerIds + '"的数据项?').then(function() {
return restore(customerIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("还原成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/carInfo/export', {
...this.queryParams
}, `carInfo_${new Date().getTime()}.xlsx`)
},
}
};
</script>

View File

@@ -39,9 +39,9 @@ module.exports = {
proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
// target: `http://127.0.0.1:6609`, //本地
target: `http://127.0.0.1:6609`, //本地
//target: `http://192.168.1.183:6609`, //测试
target: `http://113.26.248.155:33966/`, //正式环境
// target: `http://113.26.248.155:33966/`, //正式环境
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''