2024-10-15 13:14:38 +08:00
|
|
|
<!--
|
|
|
|
|
* @Author: SunTao 328867980@qq.com
|
|
|
|
|
* @Date: 2024-10-14 09:48:43
|
|
|
|
|
* @LastEditors: SunTao 328867980@qq.com
|
2024-10-25 17:29:08 +08:00
|
|
|
* @LastEditTime: 2024-10-25 13:59:25
|
2024-10-15 13:14:38 +08:00
|
|
|
* @FilePath: \znxjxt-ui\src\views\xj\inspection\task-management\index.vue
|
|
|
|
|
* @Description: 巡检管理-巡检任务
|
|
|
|
|
-->
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<div class="app-container">
|
|
|
|
|
<!-- 搜索表单 -->
|
|
|
|
|
<el-form
|
|
|
|
|
:model="queryParams"
|
|
|
|
|
ref="queryForm"
|
|
|
|
|
size="small"
|
|
|
|
|
:inline="true"
|
|
|
|
|
label-width="100px"
|
|
|
|
|
>
|
2024-10-25 17:29:08 +08:00
|
|
|
<el-form-item label="任务id" prop="taskId">
|
2024-10-15 13:14:38 +08:00
|
|
|
<el-autocomplete
|
2024-10-25 17:29:08 +08:00
|
|
|
v-model="queryParams.taskId"
|
2024-10-15 13:14:38 +08:00
|
|
|
:fetch-suggestions="querySearchAsync"
|
|
|
|
|
placeholder="请输入任务id"
|
|
|
|
|
@select="handleSelect"
|
|
|
|
|
></el-autocomplete>
|
|
|
|
|
</el-form-item>
|
2024-10-25 17:29:08 +08:00
|
|
|
<el-form-item label="车牌号码" prop="plateNo">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="queryParams.plateNo"
|
|
|
|
|
placeholder="请输入车牌号码"
|
|
|
|
|
clearable=""
|
|
|
|
|
></el-input>
|
2024-10-15 13:14:38 +08:00
|
|
|
</el-form-item>
|
2024-10-25 17:29:08 +08:00
|
|
|
<el-form-item label="巡检路段" prop="segmentId">
|
2024-10-15 13:14:38 +08:00
|
|
|
<el-select
|
2024-10-25 17:29:08 +08:00
|
|
|
v-model="queryParams.segmentId"
|
2024-10-15 13:14:38 +08:00
|
|
|
placeholder="请选择巡检路段"
|
|
|
|
|
clearable
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in segmentList"
|
|
|
|
|
:key="item.value"
|
|
|
|
|
:label="item.label"
|
|
|
|
|
:value="item.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="巡检时间" prop="dateTime">
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="dateTime"
|
|
|
|
|
type="daterange"
|
|
|
|
|
start-placeholder="开始日期"
|
|
|
|
|
end-placeholder="结束日期"
|
|
|
|
|
format="yyyy-MM-dd"
|
|
|
|
|
value-format="yyyy-MM-dd"
|
|
|
|
|
clearable
|
|
|
|
|
/>
|
|
|
|
|
</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-table
|
|
|
|
|
ref="roadTable"
|
|
|
|
|
v-loading="loading"
|
|
|
|
|
:data="roadList"
|
|
|
|
|
@selection-change="handleSelectionChange"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
>
|
|
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
|
|
<el-table-column label="巡检路段" align="center" prop="segmentName" />
|
2024-10-25 17:29:08 +08:00
|
|
|
<el-table-column label="巡检路段编码" align="center" prop="segmentCode">
|
2024-10-15 13:14:38 +08:00
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="巡检开始时间" align="center" prop="startTime">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<span>{{
|
|
|
|
|
scope.row.startTime
|
|
|
|
|
? new Date(scope.row.startTime).toLocaleString()
|
|
|
|
|
: ""
|
|
|
|
|
}}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="巡检起点" align="center" prop="stakeStart" />
|
|
|
|
|
<el-table-column label="巡检终点" align="center" prop="stakeEnd" />
|
2024-10-25 17:29:08 +08:00
|
|
|
<el-table-column label="车牌号码" align="center" prop="plateNo">
|
2024-10-15 13:14:38 +08:00
|
|
|
</el-table-column>
|
2024-10-25 17:29:08 +08:00
|
|
|
<el-table-column label="任务id" align="center" prop="extId" />
|
2024-10-15 13:14:38 +08:00
|
|
|
<el-table-column
|
|
|
|
|
label="操作"
|
|
|
|
|
align="center"
|
|
|
|
|
class-name="small-padding fixed-width"
|
|
|
|
|
>
|
2024-11-25 15:40:46 +08:00
|
|
|
<!-- slot-scope="scope" -->
|
|
|
|
|
<template>
|
|
|
|
|
<el-button size="mini" type="text" icon="el-icon-s-flag">
|
|
|
|
|
<!-- @click="viewDefect(scope.row)" -->
|
2024-10-15 13:14:38 +08:00
|
|
|
</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
<!-- 分页组件 -->
|
|
|
|
|
<div class="pagination-part">
|
|
|
|
|
<el-pagination
|
|
|
|
|
background
|
|
|
|
|
:current-page.sync="pagination.page"
|
|
|
|
|
@current-change="handleCurrentChange"
|
|
|
|
|
:page-sizes="[10, 20, 30, 40]"
|
|
|
|
|
:page-size.sync="pagination.size"
|
|
|
|
|
@size-change="handleSizeChange"
|
|
|
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
|
:total="tableTotal"
|
|
|
|
|
>
|
|
|
|
|
</el-pagination>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 查看弹窗 -->
|
|
|
|
|
<el-dialog
|
|
|
|
|
title="路径查看"
|
|
|
|
|
:visible.sync="viewVisible"
|
|
|
|
|
width="90rem"
|
|
|
|
|
append-to-body
|
|
|
|
|
:close-on-click-modal="false"
|
|
|
|
|
destroy-on-close
|
|
|
|
|
@close="viewCancel"
|
|
|
|
|
>
|
|
|
|
|
<task-view @cancel="viewCancel" :dialogItem="dialogItem"></task-view>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import TaskView from "./components/task-view.vue";
|
2024-10-25 17:29:08 +08:00
|
|
|
import {
|
|
|
|
|
getTaskTable,
|
|
|
|
|
getSegment,
|
|
|
|
|
getRoadType,
|
|
|
|
|
getTaskIdList,
|
|
|
|
|
} from "@/api/xj/task";
|
2024-10-15 13:14:38 +08:00
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
components: { TaskView },
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
// 查询表单
|
|
|
|
|
queryParams: {
|
|
|
|
|
// 任务id
|
2024-10-25 17:29:08 +08:00
|
|
|
taskId: "",
|
2024-10-15 13:14:38 +08:00
|
|
|
// 车牌号码
|
2024-10-25 17:29:08 +08:00
|
|
|
plateNo: "",
|
2024-10-15 13:14:38 +08:00
|
|
|
// 巡检路段
|
2024-10-25 17:29:08 +08:00
|
|
|
segmentId: "",
|
2024-10-15 13:14:38 +08:00
|
|
|
},
|
|
|
|
|
// 巡检时间
|
|
|
|
|
dateTime: [],
|
|
|
|
|
// 传查询接口表单
|
|
|
|
|
searchForm: {},
|
|
|
|
|
// 巡检路段下拉
|
|
|
|
|
segmentList: [],
|
|
|
|
|
// 路产类型下拉
|
|
|
|
|
roadType: [],
|
|
|
|
|
// 列表数据绑定
|
|
|
|
|
roadList: [],
|
|
|
|
|
// 列表加载状态
|
|
|
|
|
loading: false,
|
|
|
|
|
// 列表已选数组
|
|
|
|
|
checkIds: [],
|
|
|
|
|
// 非单个禁用
|
|
|
|
|
single: true,
|
|
|
|
|
// 非多个禁用
|
|
|
|
|
multiple: true,
|
|
|
|
|
// 分页-列表总数
|
|
|
|
|
tableTotal: 0,
|
|
|
|
|
// 分页-页数页码
|
|
|
|
|
pagination: {
|
|
|
|
|
page: 1,
|
|
|
|
|
size: 10,
|
|
|
|
|
},
|
|
|
|
|
// 传弹窗的数据
|
|
|
|
|
dialogItem: {},
|
|
|
|
|
// 查看弹窗显隐控制
|
|
|
|
|
viewVisible: false,
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.getTaskList();
|
|
|
|
|
this.getSegmentList();
|
|
|
|
|
this.getRoadTypeList();
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
/* 任务id远程搜索 结果 */
|
2024-10-25 17:29:08 +08:00
|
|
|
querySearchAsync(item, cb) {
|
|
|
|
|
getTaskIdList({ name: item }).then(({ data, code }) => {
|
|
|
|
|
if (code === 200) {
|
|
|
|
|
let list = [];
|
|
|
|
|
data.map((item) => {
|
|
|
|
|
list.push({
|
|
|
|
|
value: item.label,
|
|
|
|
|
id: item.value,
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
cb(list);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
2024-10-15 13:14:38 +08:00
|
|
|
/* 任务id选择事件 */
|
|
|
|
|
handleSelect() {},
|
|
|
|
|
/* 获取巡检路段下拉数据 */
|
|
|
|
|
getSegmentList() {
|
|
|
|
|
getSegment().then(({ code, data }) => {
|
|
|
|
|
if (code === 200) {
|
|
|
|
|
this.segmentList = data;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
/* 获取路产类型下拉数据 */
|
|
|
|
|
getRoadTypeList() {
|
|
|
|
|
getRoadType().then(({ code, data }) => {
|
|
|
|
|
if (code === 200) {
|
|
|
|
|
this.roadType = data;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
/* 点击搜索事件 */
|
|
|
|
|
handleQuery() {
|
2024-10-25 17:29:08 +08:00
|
|
|
this.pagination.page = 1;
|
|
|
|
|
this.searchForm = JSON.parse(JSON.stringify(this.queryParams));
|
|
|
|
|
this.getTaskList();
|
2024-10-15 13:14:38 +08:00
|
|
|
},
|
|
|
|
|
/* 点击重置事件 */
|
|
|
|
|
resetQuery() {
|
|
|
|
|
this.searchForm = {};
|
|
|
|
|
this.queryParams = {
|
2024-10-25 17:29:08 +08:00
|
|
|
taskId: "",
|
|
|
|
|
plateNo: "",
|
|
|
|
|
segmentId: "",
|
2024-10-15 13:14:38 +08:00
|
|
|
};
|
|
|
|
|
this.dateTime = [];
|
|
|
|
|
this.getTaskList();
|
|
|
|
|
},
|
|
|
|
|
/* 获取列表数据 */
|
|
|
|
|
getTaskList() {
|
|
|
|
|
const params = {
|
|
|
|
|
...this.pagination,
|
|
|
|
|
...this.searchForm,
|
|
|
|
|
startTime: this.dateTime ? this.dateTime[0] : "",
|
|
|
|
|
endTime: this.dateTime ? this.dateTime[1] : "",
|
|
|
|
|
};
|
|
|
|
|
getTaskTable(params).then(({ code, rows, total }) => {
|
|
|
|
|
if (code === 200) {
|
|
|
|
|
this.roadList = rows;
|
|
|
|
|
this.tableTotal = total;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
/* 列表选择改变事件 */
|
|
|
|
|
handleSelectionChange(selection) {
|
2024-10-25 17:29:08 +08:00
|
|
|
this.checkIds = selection.map((item) => item.taskId);
|
2024-10-15 13:14:38 +08:00
|
|
|
this.single = selection.length !== 1;
|
|
|
|
|
this.multiple = !selection.length;
|
|
|
|
|
},
|
|
|
|
|
/* 点击路径事件 */
|
|
|
|
|
viewDefect(item) {
|
|
|
|
|
this.viewVisible = true;
|
|
|
|
|
this.dialogItem = item;
|
|
|
|
|
},
|
|
|
|
|
/* 切换分页 */
|
|
|
|
|
handleCurrentChange(arg) {
|
|
|
|
|
this.pagination.page = arg;
|
|
|
|
|
this.getTaskList();
|
|
|
|
|
},
|
|
|
|
|
/* 切换每条/页 */
|
|
|
|
|
handleSizeChange(arg) {
|
|
|
|
|
this.pagination.size = arg;
|
|
|
|
|
this.getTaskList();
|
|
|
|
|
},
|
|
|
|
|
/* 关闭查看弹窗 */
|
|
|
|
|
viewCancel() {
|
|
|
|
|
this.viewVisible = false;
|
|
|
|
|
this.dialogItem = {};
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.app-container {
|
|
|
|
|
padding: 20px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.mb8 {
|
|
|
|
|
margin-bottom: 8px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.small-padding {
|
|
|
|
|
padding: 0 5px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.fixed-width {
|
|
|
|
|
width: 120px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 分页样式 */
|
|
|
|
|
.pagination-part {
|
|
|
|
|
width: 100%;
|
|
|
|
|
display: flex;
|
|
|
|
|
padding-top: 1rem;
|
|
|
|
|
justify-content: flex-end;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 新增弹窗/编辑弹窗 */
|
|
|
|
|
.addForm {
|
|
|
|
|
.el-select,
|
|
|
|
|
.el-cascader {
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/* 新增地图框样式 */
|
|
|
|
|
.no-hand-cursor {
|
|
|
|
|
cursor: default !important;
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 20rem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 上传文件列表样式 */
|
|
|
|
|
::v-deep .el-upload-list {
|
|
|
|
|
img {
|
|
|
|
|
width: auto;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 查看弹窗-图片框样式 */
|
|
|
|
|
.view-carousel {
|
|
|
|
|
height: 15rem;
|
|
|
|
|
// .el-carousel__item{
|
|
|
|
|
// height: 12rem;
|
|
|
|
|
|
|
|
|
|
img {
|
|
|
|
|
max-height: 15rem;
|
|
|
|
|
max-width: 25rem;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|