15 changed files with 1246 additions and 16 deletions
@ -0,0 +1,112 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
// 获取字典类型列表
|
|||
export function getDictionaryList(dictType) { |
|||
return request({ |
|||
url: `/system/dict/data/type/${dictType}`, |
|||
method: 'get' |
|||
}) |
|||
} |
|||
|
|||
// 巡查项目管理-查询堤防巡视检查列表
|
|||
export function postEmbankmentInspectionChecklist(data) { |
|||
return request({ |
|||
url: '/run/df/checking/list', |
|||
method: 'post', |
|||
data |
|||
}) |
|||
} |
|||
|
|||
// 巡查项目管理-堤防巡视检查详情
|
|||
export function getEmbankmentInspectionCheck(id) { |
|||
return request({ |
|||
url: `/run/df/checking/${id}`, |
|||
method: 'get', |
|||
}) |
|||
} |
|||
|
|||
// 巡查项目管理-新增堤防巡视检查
|
|||
export function postEmbankmentInspection(data) { |
|||
return request({ |
|||
url: '/run/df/checking', |
|||
method: 'post', |
|||
data |
|||
}) |
|||
} |
|||
|
|||
// 巡查项目管理-修改堤防巡视检查
|
|||
export function putEmbankmentInspection(data) { |
|||
return request({ |
|||
url: '/run/df/checking', |
|||
method: 'put', |
|||
data |
|||
}) |
|||
} |
|||
|
|||
// 巡查项目管理-删除堤防巡视检查
|
|||
export function deleteEmbankmentInspection(id) { |
|||
return request({ |
|||
url: `/run/df/checking/${id}`, |
|||
method: 'delete', |
|||
}) |
|||
} |
|||
|
|||
// 巡查计划管理-查询堤防巡视检查列表
|
|||
export function postInspectionPlanlist(data) { |
|||
return request({ |
|||
url: '/run/df/plan/list', |
|||
method: 'post', |
|||
data |
|||
}) |
|||
} |
|||
|
|||
// 巡查计划管理-堤防巡视检查详情
|
|||
export function getInspectionPlan(id) { |
|||
return request({ |
|||
url: `/run/df/plan/${id}`, |
|||
method: 'get', |
|||
}) |
|||
} |
|||
|
|||
// 巡查计划管理-新增堤防巡视检查
|
|||
export function postInspectionPlan(data) { |
|||
return request({ |
|||
url: '/run/df/plan', |
|||
method: 'post', |
|||
data |
|||
}) |
|||
} |
|||
|
|||
// 巡查计划管理-修改堤防巡视检查
|
|||
export function putInspectionPlan(data) { |
|||
return request({ |
|||
url: '/run/df/plan', |
|||
method: 'put', |
|||
data |
|||
}) |
|||
} |
|||
|
|||
// 巡查计划管理-删除堤防巡视检查
|
|||
export function deleteInspectionPlan(id) { |
|||
return request({ |
|||
url: `/run/df/plan/${id}`, |
|||
method: 'delete', |
|||
}) |
|||
} |
|||
|
|||
// 巡查计划管理-获取人员信息
|
|||
export function getPersonnelInformation(id) { |
|||
return request({ |
|||
url: `/system/user/${id}`, |
|||
method: 'get', |
|||
}) |
|||
} |
|||
|
|||
// 巡查计划管理-获取用户列表
|
|||
export function postUserList(data) { |
|||
return request({ |
|||
url: '/system/user/list', |
|||
method: 'post', |
|||
data |
|||
}) |
|||
} |
@ -0,0 +1,19 @@ |
|||
const state = { |
|||
/** |
|||
* selectTab = 0 水库运行管理; |
|||
* selectTab = 1 水闸运行管理; |
|||
* selectTab = 2 堤防运行管理; |
|||
*/ |
|||
selectTab: 0 |
|||
} |
|||
const mutations = { |
|||
SET_SELECT_TAB: (state, select) => { |
|||
state.selectTab = select |
|||
} |
|||
} |
|||
|
|||
export default { |
|||
namespaced: true, |
|||
state, |
|||
mutations, |
|||
} |
@ -0,0 +1,3 @@ |
|||
<template > |
|||
<router-view /> |
|||
</template> |
@ -0,0 +1,393 @@ |
|||
<!-- 巡查项目管理-堤防 --> |
|||
<script> |
|||
import { getDictionaryList, postEmbankmentInspectionChecklist, postEmbankmentInspection, putEmbankmentInspection, deleteEmbankmentInspection, getEmbankmentInspectionCheck } from '@/api/management' |
|||
export default { |
|||
name: 'InspectionItems', |
|||
data() { |
|||
return { |
|||
searchInput: '', |
|||
searchType: 3, |
|||
dialogVisible: false, |
|||
ContentType: '', |
|||
firstType: [], // 一级检查内容类型 |
|||
secondType: [], // 二级检查内容类型 |
|||
examType: [], // 检查类型 |
|||
tableData: [], // 检查列表 |
|||
pageData: { |
|||
pageNum: 1, // 当前页 |
|||
pageSize: 10, // 请求数量 |
|||
pageSizes: [10, 20, 50, 100], |
|||
total: 0 // 总数量 |
|||
}, |
|||
ruleForm: { |
|||
name: '', |
|||
type: '0', |
|||
checkContentType: '', |
|||
items: [ |
|||
], |
|||
}, |
|||
rules: { |
|||
name: [ |
|||
{ required: true, message: '请输入巡视检查名称', trigger: 'blur' }, |
|||
{ max: 50, message: '名称最长为50个字符', trigger: 'blur' } |
|||
], |
|||
type: [ |
|||
{ required: true, message: '请选择巡查类型', trigger: 'change' } |
|||
], |
|||
checkContentType: [ |
|||
{ required: true, message: '请选择巡视检查内容', trigger: 'change' } |
|||
] |
|||
} |
|||
} |
|||
}, |
|||
methods: { |
|||
// 表格筛选 |
|||
searchTableList() { |
|||
postEmbankmentInspectionChecklist({ |
|||
data: { |
|||
timeView: { |
|||
timeField: "create_time" |
|||
}, |
|||
type: this.searchType == 3 ? '' : this.searchType |
|||
}, |
|||
cv: { |
|||
name: "name", |
|||
type: "like", |
|||
value: this.searchInput |
|||
}, |
|||
pageSize: this.pageData.pageSize, |
|||
pageNum: this.pageData.pageNum |
|||
}).then((res) => { |
|||
if (res) { |
|||
this.tableData = res.records |
|||
this.pageData.total = res.total |
|||
} |
|||
console.log('🚀表格数据🚀', res) |
|||
}) |
|||
}, |
|||
// 编辑巡查项目 |
|||
editTableItem(row) { |
|||
getEmbankmentInspectionCheck(row.id).then((res) => { |
|||
console.log('🚀res🚀', res) |
|||
this.ruleForm.name = res.data.name |
|||
this.ruleForm.type = res.data.type |
|||
this.ruleForm.items = res.data.items |
|||
this.ruleForm.checkContentType = res.data.items[0].parts[0] |
|||
getDictionaryList(res.data.items[0].parts[0]).then((res) => { |
|||
this.secondType = res.data |
|||
console.log('🚀一级🚀', res.data) |
|||
}) |
|||
this.ruleForm.items.forEach(element => { |
|||
getDictionaryList(element.parts[1]).then((res) => { |
|||
this.$set(element, 'third', res.data) |
|||
}) |
|||
}); |
|||
this.dialogVisible = true |
|||
}) |
|||
}, |
|||
// 删除对应巡查项目 |
|||
deleteTableItem(row) { |
|||
deleteEmbankmentInspection(row.id).then((res) => { |
|||
console.log('🚀res🚀', res) |
|||
this.getTableData() |
|||
}) |
|||
}, |
|||
// 新增巡查内容 |
|||
addPatrolItem(checkContentType) { |
|||
console.log('🚀checkContentType🚀', checkContentType) |
|||
this.ruleForm.items.push( |
|||
{ |
|||
content: '', |
|||
parts: [checkContentType, '', ''] |
|||
} |
|||
) |
|||
}, |
|||
// 新增巡查项目 |
|||
newInspectionItems() { |
|||
this.dialogVisible = true |
|||
this.ruleForm = { |
|||
name: '', |
|||
type: '', |
|||
checkContentType: '', |
|||
items: [ |
|||
{ |
|||
content: '', |
|||
parts: ['', '', ''] |
|||
} |
|||
] |
|||
} |
|||
}, |
|||
// 删除对应巡查内容 |
|||
deletePatrolItem(row) { |
|||
console.log('🚀row🚀', row) |
|||
}, |
|||
// 改变一级巡视检查内容 |
|||
changeContentType(dictValue) { |
|||
getDictionaryList(dictValue).then((res) => { |
|||
this.secondType = res.data |
|||
console.log('🚀一级🚀', res.data) |
|||
}) |
|||
this.ruleForm.items = [ |
|||
{ |
|||
content: '', |
|||
parts: [this.ruleForm.checkContentType] |
|||
} |
|||
] |
|||
}, |
|||
// 改变二级巡视检查内容 |
|||
changeSecondType(row) { |
|||
getDictionaryList(row.parts[1]).then((res) => { |
|||
console.log('🚀二级🚀', res.data) |
|||
row.parts[2] = '' |
|||
this.$set(row, 'third', res.data) |
|||
}) |
|||
}, |
|||
// 改变三级巡视检查内容 |
|||
changeThirdType(row) { |
|||
let value = row.third.find(item => item.dictValue == row.parts[2]).remark |
|||
if (value) { |
|||
row.content = value |
|||
} |
|||
}, |
|||
// 保存巡查项目 |
|||
submitForm(formName) { |
|||
this.$refs[formName].validate((valid) => { |
|||
if (valid) { |
|||
console.log(this.ruleForm); |
|||
postEmbankmentInspection(this.ruleForm).then((res) => { |
|||
this.getTableData() |
|||
this.dialogVisible = false |
|||
}) |
|||
} else { |
|||
console.log('校验不通过'); |
|||
return false; |
|||
} |
|||
}); |
|||
}, |
|||
resetForm(formName) { |
|||
this.$refs[formName].resetFields(); |
|||
this.dialogVisible = false |
|||
}, |
|||
// 添加巡查项目 |
|||
addInspectionItems() { |
|||
|
|||
}, |
|||
getTableData() { |
|||
this.searchInput = '', |
|||
this.searchType = 3, |
|||
postEmbankmentInspectionChecklist({ |
|||
data: { |
|||
timeView: { |
|||
timeField: "create_time" |
|||
}, |
|||
}, |
|||
cv: { |
|||
name: "name", |
|||
type: "like" |
|||
}, |
|||
pageSize: this.pageData.pageSize, |
|||
pageNum: this.pageData.pageNum |
|||
}).then((res) => { |
|||
if (res) { |
|||
this.tableData = res.records |
|||
this.pageData.total = res.total |
|||
} |
|||
console.log('🚀表格数据🚀', res) |
|||
}) |
|||
} |
|||
}, |
|||
mounted() { |
|||
// 获取列表数据 |
|||
this.getTableData() |
|||
// 获取巡查类型 |
|||
getDictionaryList('xs_classfy').then((res) => { |
|||
if (res.data && Array.isArray(res.data)) { |
|||
res.data.forEach(element => { |
|||
element.dictValue = Number(element.dictValue) |
|||
}); |
|||
this.examType = res.data |
|||
} |
|||
}) |
|||
// 获取一级数据 |
|||
getDictionaryList('df_xs_c_classfy').then((res) => { |
|||
if (res.data && Array.isArray(res.data)) { |
|||
this.firstType = res.data |
|||
} |
|||
}) |
|||
}, |
|||
} |
|||
</script> |
|||
|
|||
<template> |
|||
<div class="body"> |
|||
<div class="top-title"> |
|||
基础信息管理 |
|||
</div> |
|||
<div class="table-box"> |
|||
<div class="top-search"> |
|||
<span>巡视检查名称:</span> |
|||
<el-input class="search-input" v-model="searchInput" placeholder="请输入巡视检查名称" /> |
|||
<span>巡查类型:</span> |
|||
<el-select v-model="searchType" placeholder="请选择"> |
|||
<el-option v-for="item in examType" :label="item.dictLabel" :value="item.dictValue" :key="item.id"></el-option> |
|||
<el-option label="全部" :value="3"></el-option> |
|||
</el-select> |
|||
<el-button class="search-btn" type="success" @click="searchTableList()">搜索</el-button> |
|||
</div> |
|||
<el-button class="search-btn" style=" margin-right: 16px;margin-bottom: 8px; float: right;" type="success" |
|||
@click="newInspectionItems()">添加</el-button> |
|||
<el-table class="table" :data="tableData" border> |
|||
<el-table-column type="index" align="center" label="序号" width="100"> |
|||
</el-table-column> |
|||
<el-table-column prop="name" align="center" label="巡视检查名称"> |
|||
</el-table-column> |
|||
<el-table-column align="center" label="巡查类型"> |
|||
<template slot-scope="scope"> |
|||
<span v-if="examType.length > 0">{{ examType.find(item => item.dictValue == scope.row.type).dictLabel || |
|||
'' |
|||
}}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="createTime" align="center" sortable label="创建时间"> |
|||
</el-table-column> |
|||
<el-table-column prop="updateTime" align="center" sortable label="更新时间"> |
|||
</el-table-column> |
|||
<el-table-column prop="address" align="center" label="操作"> |
|||
<template slot-scope="scope"> |
|||
<el-button style=" margin-right: 16px;" @click="editTableItem(scope.row)" type="text" |
|||
size="small">编辑</el-button> |
|||
<el-popconfirm confirm-button-text='确定' cancel-button-text='取消' icon="el-icon-info" icon-color="red" |
|||
title="确定删除吗?" @confirm="deleteTableItem(scope.row)"> |
|||
<el-button style="color: red;" type="text" size="small" slot="reference">删除</el-button> |
|||
</el-popconfirm> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-pagination background class="pagination" style="margin-top: 16px;margin-right: 16px;float: right;" |
|||
:current-page="pageData.pageNum" :page-sizes="pageData.pageSizes" layout="total, prev, pager, next, sizes, jumper" |
|||
:total="pageData.total" @size-change="getTableData()"> |
|||
</el-pagination> |
|||
</div> |
|||
<el-dialog title="新增/编辑巡查项目" :visible.sync="dialogVisible" width="50%"> |
|||
<div style="display: flex; margin-bottom: 16px;"> |
|||
<div style="width: 5px; height: 16px; background-color: #31a08e; margin-right: 8px;"></div><span |
|||
style="font-weight: 600;">基础信息</span> |
|||
</div> |
|||
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm"> |
|||
<el-form-item label-width="120px" label="巡视检查名称" prop="name"> |
|||
<el-input style="width: 202px;" v-model="ruleForm.name"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label-width="120px" label="巡查类型" prop="type"> |
|||
<el-select v-model="ruleForm.type" placeholder="请选择巡查类型"> |
|||
<el-option v-for="item in examType" :label="item.dictLabel" :value="item.dictValue" |
|||
:key="item.id"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label-width="120px" label="巡视检查内容" prop="checkContentType"> |
|||
<el-select v-model="ruleForm.checkContentType" @change="changeContentType(ruleForm.checkContentType)" |
|||
placeholder="请选择巡视检查内容"> |
|||
<el-option v-for="item in firstType" :label="item.dictLabel" :value="item.dictValue" |
|||
:key="item.id"></el-option> |
|||
</el-select> |
|||
<span style="margin-left: 8px; color: red;">注意:切换选项后检查内容将会清空!</span> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-table class="table" height="350" :data="ruleForm.items" border> |
|||
<el-table-column type="index" align="center" label="序号" center width="80"> |
|||
</el-table-column> |
|||
<el-table-column align="center" label="检查项目和内容"> |
|||
<template slot-scope="scope"> |
|||
<el-select v-model="scope.row.parts[1]" @change="changeSecondType(scope.row)" placeholder="请选择检查项目和内容"> |
|||
<el-option v-for="item in secondType" :label="item.dictLabel" :value="item.dictValue" |
|||
:key="item.id"></el-option> |
|||
</el-select> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column align="center" label="检查部位"> |
|||
<template slot-scope="scope"> |
|||
<el-select v-model="scope.row.parts[2]" @change="changeThirdType(scope.row)" placeholder="请选择检查部位"> |
|||
<el-option v-for="item in scope.row.third" :label="item.dictLabel" :value="item.dictValue" |
|||
:key="item.id"></el-option> |
|||
</el-select> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column align="center" prop="inspectionContent" label="检查内容"> |
|||
<template slot-scope="scope"> |
|||
<el-input maxlength="500" v-model="scope.row.content"></el-input> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="address" align="center" label="操作"> |
|||
<template slot-scope="scope"> |
|||
<el-button style="margin-right: 8px;" v-if="scope.$index == ruleForm.items.length - 1" |
|||
@click="addPatrolItem(ruleForm.checkContentType)" type="text" size="small">添加</el-button> |
|||
<el-popconfirm confirm-button-text='确定' cancel-button-text='取消' icon="el-icon-info" icon-color="red" |
|||
title="确定删除吗?" @confirm="deletePatrolItem(scope.row)"> |
|||
<el-button slot="reference" style="color: red;" type="text" size="small">删除</el-button> |
|||
</el-popconfirm> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button size="mini" @click="resetForm('ruleForm')">取 消</el-button> |
|||
<el-button size="mini" type="primary" @click="submitForm('ruleForm')">保存</el-button> |
|||
</div> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<style scoped lang="less"> |
|||
.body { |
|||
width: 100%; |
|||
min-height: calc(100vh - 56px); |
|||
margin-left: 24px; |
|||
|
|||
.top-title { |
|||
height: 40px; |
|||
background-color: white; |
|||
display: flex; |
|||
padding-left: 16px; |
|||
align-items: center; |
|||
font-weight: 600; |
|||
} |
|||
|
|||
.table-box { |
|||
width: 100%; |
|||
min-height: calc(100vh - 56px - 64px); |
|||
margin-top: 24px; |
|||
padding: 16px; |
|||
background-color: white; |
|||
|
|||
.top-search { |
|||
display: flex; |
|||
align-items: center; |
|||
margin-bottom: 8px; |
|||
|
|||
.search-input { |
|||
width: 300px; |
|||
margin-right: 10px; |
|||
} |
|||
|
|||
} |
|||
|
|||
.search-btn { |
|||
margin-left: 10px; |
|||
background-color: #37b29e; |
|||
border: none; |
|||
|
|||
&:hover { |
|||
background-color: #5ac6b9; |
|||
} |
|||
|
|||
&:active { |
|||
background-color: #2b8070; |
|||
} |
|||
|
|||
; |
|||
} |
|||
|
|||
.table { |
|||
height: calc(680px - 34px); |
|||
} |
|||
} |
|||
} |
|||
</style> |
@ -0,0 +1,22 @@ |
|||
<!-- 巡查项目管理-水库 --> |
|||
<script> |
|||
export default { |
|||
name: '', |
|||
data() { |
|||
return { |
|||
|
|||
} |
|||
}, |
|||
methods: { |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<template> |
|||
<div> |
|||
水库 |
|||
</div> |
|||
</template> |
|||
|
|||
<style scoped lang="less"></style> |
@ -0,0 +1,22 @@ |
|||
<!-- 巡查项目管理-水闸 --> |
|||
<script> |
|||
export default { |
|||
name: '', |
|||
data() { |
|||
return { |
|||
|
|||
} |
|||
}, |
|||
methods: { |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<template> |
|||
<div> |
|||
水闸 |
|||
</div> |
|||
</template> |
|||
|
|||
<style scoped lang="less"></style> |
@ -0,0 +1,29 @@ |
|||
<!-- 巡查项目管理 --> |
|||
<script> |
|||
import Dike from './Dike.vue' |
|||
import Reservoir from './Reservoir.vue' |
|||
import Sluice from './Sluice.vue' |
|||
export default { |
|||
name: 'InspectionItems', |
|||
components: { |
|||
Reservoir, // 水库 |
|||
Sluice, // 水闸 |
|||
Dike, // 堤防 |
|||
}, |
|||
computed: { |
|||
selectTab() { |
|||
return this.$store.state.topTab.selectTab |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<template> |
|||
<div> |
|||
<Reservoir v-if="selectTab == 0"></Reservoir> |
|||
<Sluice v-if="selectTab == 1"></Sluice> |
|||
<Dike v-if="selectTab == 2"></Dike> |
|||
</div> |
|||
</template> |
|||
|
|||
<style scoped lang="less"></style> |
@ -0,0 +1,410 @@ |
|||
<!-- 巡查计划管理-堤防 --> |
|||
<script> |
|||
import { getDictionaryList, postInspectionPlanlist, postInspectionPlan, putEmbankmentInspection, deleteEmbankmentInspection, postEmbankmentInspectionChecklist, getInspectionPlan, deleteInspectionPlan, postUserList } from '@/api/management' |
|||
export default { |
|||
name: 'InspectionItems', |
|||
data() { |
|||
return { |
|||
searchInput: '', |
|||
dialogVisible: false, |
|||
ContentType: '', |
|||
loading: false, |
|||
patrolType: [], // 巡查周期类型 |
|||
personnelList: [], // 人员列表 |
|||
examType: [], // 检查类型 |
|||
tableData: [], // 检查列表 |
|||
patrolTableData: [], // 巡查项目列表 |
|||
pageData: { |
|||
pageNum: 1, // 当前页 |
|||
pageSize: 10, // 请求数量 |
|||
pageSizes: [10, 20, 50, 100], |
|||
total: 0 // 总数量 |
|||
}, |
|||
ruleForm: { |
|||
name: '', |
|||
type: '', |
|||
xcId: '', |
|||
frequency: '', |
|||
cycleType: '', |
|||
reminderTime: '', |
|||
selectUser: [], |
|||
operators: [], |
|||
otherConfig: { |
|||
week: '', |
|||
time: '' |
|||
} |
|||
}, |
|||
rules: { |
|||
name: [ |
|||
{ required: true, message: '请输入计划名称', trigger: 'blur' }, |
|||
{ max: 50, message: '名称最长为50个字符', trigger: 'blur' } |
|||
], |
|||
type: [ |
|||
{ required: true, message: '请选择巡查类型', trigger: 'change' } |
|||
], |
|||
xcId: [ |
|||
{ required: true, message: '请选择巡查项目名称', trigger: 'change' } |
|||
], |
|||
selectUser: [ |
|||
{ required: true, message: '请选择巡查人员', trigger: 'change' } |
|||
], |
|||
cycleType: [ |
|||
{ required: true, message: '请选择巡查周期', trigger: 'change' } |
|||
] |
|||
} |
|||
} |
|||
}, |
|||
methods: { |
|||
// 编辑巡查项目 |
|||
editTableItem(row) { |
|||
getInspectionPlan(row.id).then((res) => { |
|||
console.log('🚀res🚀', res) |
|||
this.ruleForm = res.data |
|||
this.ruleForm.type = res.data.type.toString() |
|||
this.dialogVisible = true |
|||
this.changePatrolType(res) |
|||
}) |
|||
// putEmbankmentInspection({ id: row.id }).then((res) => { |
|||
// console.log('🚀res🚀', res) |
|||
// this.ruleForm.name = res.data.name |
|||
// this.ruleForm.type = res.data.type |
|||
// this.dialogVisible = true |
|||
// console.log(this.examType); |
|||
// }) |
|||
}, |
|||
// 删除对应巡查项目 |
|||
deleteTableItem(row) { |
|||
console.log('🚀row🚀', row.id) |
|||
deleteInspectionPlan(row.id).then((res) => { |
|||
console.log('🚀res🚀', res) |
|||
this.getTableData() |
|||
}) |
|||
}, |
|||
// 新增巡查内容 |
|||
addPatrolItem() { |
|||
this.ruleForm.items.push( |
|||
{ |
|||
content: '', |
|||
parts: ['', '', ''] |
|||
} |
|||
) |
|||
}, |
|||
// 新增巡查计划 |
|||
newInspectionItems() { |
|||
this.dialogVisible = true |
|||
getDictionaryList('xs_cycle_type').then((res) => { |
|||
this.patrolType = res.data |
|||
}) |
|||
this.ruleForm = { |
|||
name: '', |
|||
type: '', |
|||
xcId: '', |
|||
frequency: '', |
|||
cycleType: '', |
|||
reminderTime: '', |
|||
selectUser: [], |
|||
operators: [], |
|||
otherConfig: { |
|||
week: '', |
|||
time: '' |
|||
} |
|||
} |
|||
}, |
|||
// 保存巡查项目 |
|||
submitForm(formName) { |
|||
this.$refs[formName].validate((valid) => { |
|||
if (valid) { |
|||
let user = [] |
|||
this.ruleForm.selectUser.forEach(element => { |
|||
let a = { |
|||
name: element.nickName, |
|||
uid: element.id |
|||
} |
|||
user.push(a) |
|||
}); |
|||
console.log('🚀user🚀', user) |
|||
this.ruleForm.operators = user |
|||
postInspectionPlan(this.ruleForm).then((res) => { |
|||
console.log('🚀res🚀', res) |
|||
this.getTableData() |
|||
this.dialogVisible = false |
|||
}) |
|||
} else { |
|||
console.log('校验不通过'); |
|||
return false; |
|||
} |
|||
}); |
|||
}, |
|||
resetForm(formName) { |
|||
this.$refs[formName].resetFields(); |
|||
this.dialogVisible = false |
|||
}, |
|||
// 更改巡查类型 |
|||
changePatrolType(ruleForm) { |
|||
this.$set(ruleForm, 'xcId', '') |
|||
postEmbankmentInspectionChecklist({ |
|||
data: { |
|||
timeView: { |
|||
timeField: "create_time" |
|||
}, |
|||
type: ruleForm.type |
|||
}, |
|||
cv: { |
|||
name: "name", |
|||
type: "like" |
|||
}, |
|||
pageSize: 999, |
|||
pageNum: 1 |
|||
}).then((res) => { |
|||
this.patrolTableData = res.records |
|||
}) |
|||
}, |
|||
// 搜索用户 |
|||
searchUser(e) { |
|||
console.log(this.ruleForm.selectUser); |
|||
postUserList({ |
|||
data: { |
|||
timeView: { |
|||
timeField: "create_time" |
|||
}, |
|||
}, |
|||
cv: { |
|||
name: "nickName", |
|||
type: "like", |
|||
value: e |
|||
}, |
|||
pageSize: 100, |
|||
pageNum: 1 |
|||
}).then((res) => { |
|||
this.personnelList = res.records |
|||
console.log('🚀用户数据🚀', res) |
|||
console.log('🚀用户数据🚀', this.ruleForm.operators) |
|||
}) |
|||
}, |
|||
getTableData() { |
|||
postInspectionPlanlist({ |
|||
data: { |
|||
timeView: { |
|||
timeField: "create_time" |
|||
} |
|||
}, |
|||
cv: { |
|||
name: "name", |
|||
type: "like" |
|||
}, |
|||
pageSize: this.pageData.pageSize, |
|||
pageNum: this.pageData.pageNum |
|||
}).then((res) => { |
|||
if (res) { |
|||
this.tableData = res.records |
|||
this.pageData.total = res.total |
|||
} |
|||
console.log('🚀res1🚀', res) |
|||
}) |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.pageData.total = this.tableData.length |
|||
getDictionaryList('xs_classfy').then((res) => { |
|||
console.log('🚀检查类型🚀', res) |
|||
if (res.data && Array.isArray(res.data)) { |
|||
res.data.forEach(element => { |
|||
element.dictValue = element.dictValue |
|||
}); |
|||
this.examType = res.data |
|||
console.log('🚀this.examType🚀', this.examType) |
|||
} |
|||
}) |
|||
getDictionaryList('df_xs_c_classfy').then((res) => { |
|||
if (res.data && Array.isArray(res.data)) { |
|||
console.log('🚀res.data🚀', res.data) |
|||
} |
|||
}) |
|||
// 获取列表数据 |
|||
postInspectionPlanlist({ |
|||
data: { |
|||
timeView: { |
|||
timeField: "create_time" |
|||
} |
|||
}, |
|||
cv: { |
|||
name: "name", |
|||
type: "like", |
|||
value: this.searchInput |
|||
}, |
|||
pageSize: this.pageData.pageSize, |
|||
pageNum: this.pageData.pageNum |
|||
}).then((res) => { |
|||
if (res) { |
|||
this.tableData = res.records |
|||
this.pageData.total = res.total |
|||
} |
|||
console.log('🚀res1🚀', res) |
|||
}) |
|||
}, |
|||
} |
|||
</script> |
|||
|
|||
<template> |
|||
<div class="body"> |
|||
<div class="top-title"> |
|||
基础信息管理 |
|||
</div> |
|||
<div class="table-box"> |
|||
<div class="top-search"> |
|||
<span>计划名称:</span> |
|||
<el-input class="search-input" v-model="searchInput" placeholder="请输入计划名称" /> |
|||
<el-button class="search-btn" type="success">搜索</el-button> |
|||
</div> |
|||
<el-button class="search-btn" style=" margin-right: 16px;margin-bottom: 8px; float: right;" type="success" |
|||
@click="newInspectionItems()">添加</el-button> |
|||
<el-table class="table" :data="tableData" border> |
|||
<el-table-column type="index" align="center" label="序号" width="100"> |
|||
</el-table-column> |
|||
<el-table-column prop="name" align="center" label="计划名称"> |
|||
</el-table-column> |
|||
<el-table-column align="center" label="巡查类型"> |
|||
<template slot-scope="scope"> |
|||
<span v-if="examType.length > 0">{{ examType.find(item => item.dictValue == scope.row.type).dictLabel || |
|||
'' |
|||
}}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="createTime" align="center" sortable label="最近巡查时间"> |
|||
</el-table-column> |
|||
<el-table-column prop="createTime" align="center" sortable label="创建时间"> |
|||
</el-table-column> |
|||
<el-table-column prop="updateTime" align="center" sortable label="更新时间"> |
|||
</el-table-column> |
|||
<el-table-column prop="address" align="center" label="操作"> |
|||
<template slot-scope="scope"> |
|||
<el-button style=" margin-right: 16px;" @click="editTableItem(scope.row)" type="text" |
|||
size="small">编辑</el-button> |
|||
<el-popconfirm confirm-button-text='确定' cancel-button-text='取消' icon="el-icon-info" icon-color="red" |
|||
title="确定删除吗?" @confirm="deleteTableItem(scope.row)"> |
|||
<el-button style="color: red;margin-right: 16px;" type="text" size="small" slot="reference">删除</el-button> |
|||
</el-popconfirm> |
|||
<el-button @click="editTableItem(scope.row)" type="text" size="small">路线设置</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-pagination background class="pagination" style="margin-top: 16px;margin-right: 16px;float: right;" |
|||
:current-page="pageData.pageNum" :page-sizes="pageData.pageSizes" layout="total, prev, pager, next, sizes, jumper" |
|||
:total="pageData.total" @size-change="getTableData()"> |
|||
</el-pagination> |
|||
</div> |
|||
<el-dialog title="新增/编辑巡查计划" destroy-on-close :visible.sync="dialogVisible" width="50%"> |
|||
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" class="demo-ruleForm"> |
|||
<el-form-item label-width="120px" label="计划名称" prop="name"> |
|||
<el-input style="width: 202px;" v-model="ruleForm.name"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label-width="120px" label="巡查类型" prop="type"> |
|||
<el-select v-model="ruleForm.type" placeholder="请选择巡查类型" @change="changePatrolType(ruleForm)"> |
|||
<el-option v-for="item in examType" :label="item.dictLabel" :value="item.dictValue" |
|||
:key="item.id"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label-width="120px" label="巡查项目名称" prop="xcId"> |
|||
<el-select v-model="ruleForm.xcId" placeholder="请选择巡查项目名称"> |
|||
<el-option v-for="item in patrolTableData" :label="item.name" :value="item.id" :key="item.id"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item v-if="ruleForm.type == 0" label-width="120px" label="巡查周期" prop="cycleType"> |
|||
<el-input style="width: 202px;" v-model="ruleForm.frequency"></el-input> |
|||
/次 |
|||
<el-select v-model="ruleForm.cycleType" placeholder="请选择日期"> |
|||
<el-option v-for="item in patrolType" :label="item.dictLabel" :value="item.dictValue" |
|||
:key="item.id"></el-option> |
|||
</el-select>/日期 |
|||
</el-form-item> |
|||
<el-form-item v-else label-width="120px" label="检查日期" prop="reminderTime"> |
|||
<el-date-picker v-model="ruleForm.otherConfig.time" type="date" value-format="yyyy-MM-dd" placeholder="选择日期"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label-width="120px" label="消息提醒" prop="reminderTime"> |
|||
<el-radio-group v-if="ruleForm.cycleType == 1 && ruleForm.type == 0" v-model="ruleForm.otherConfig.week"> |
|||
<el-radio :label="1">星期一</el-radio> |
|||
<el-radio :label="2">星期二</el-radio> |
|||
<el-radio :label="3">星期三</el-radio> |
|||
<el-radio :label="4">星期四</el-radio> |
|||
<el-radio :label="5">星期五</el-radio> |
|||
<el-radio :label="6">星期六</el-radio> |
|||
<el-radio :label="7">星期日</el-radio> |
|||
</el-radio-group> |
|||
<el-time-picker v-if="ruleForm.cycleType != 2 && ruleForm.type == 0" v-model="ruleForm.reminderTime" |
|||
value-format="hh:mm:ss" placeholder="请选择时间点" /> |
|||
<el-date-picker v-if="ruleForm.cycleType == 2 || ruleForm.type != 0" v-model="ruleForm.reminderTime" |
|||
value-format="yyyy-MM-dd hh:mm:ss" type="datetime" placeholder="选择日期时间" /> |
|||
</el-form-item> |
|||
<el-form-item label-width="120px" label="巡查人员" prop="operators"> |
|||
<el-select v-model="ruleForm.selectUser" multiple filterable remote :remote-method="searchUser" value-key="id" |
|||
placeholder="请输入关键词搜索用户" prop="selectUser"> |
|||
<el-option v-for="item in personnelList" :key="item.id" :label="item.nickName" :value="item"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-form> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button size="mini" @click="resetForm('ruleForm')">取 消</el-button> |
|||
<el-button size="mini" type="primary" @click="submitForm('ruleForm')">保存</el-button> |
|||
</div> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<style scoped lang="less"> |
|||
.body { |
|||
width: 100%; |
|||
min-height: calc(100vh - 56px); |
|||
margin-left: 24px; |
|||
|
|||
.top-title { |
|||
height: 40px; |
|||
background-color: white; |
|||
display: flex; |
|||
padding-left: 16px; |
|||
align-items: center; |
|||
font-weight: 600; |
|||
} |
|||
|
|||
.table-box { |
|||
width: 100%; |
|||
min-height: calc(100vh - 56px - 64px); |
|||
margin-top: 24px; |
|||
padding: 16px; |
|||
background-color: white; |
|||
|
|||
.top-search { |
|||
display: flex; |
|||
align-items: center; |
|||
margin-bottom: 8px; |
|||
|
|||
.search-input { |
|||
width: 300px; |
|||
margin-right: 10px; |
|||
} |
|||
|
|||
} |
|||
|
|||
.search-btn { |
|||
margin-left: 10px; |
|||
background-color: #37b29e; |
|||
border: none; |
|||
|
|||
&:hover { |
|||
background-color: #5ac6b9; |
|||
} |
|||
|
|||
&:active { |
|||
background-color: #2b8070; |
|||
} |
|||
|
|||
; |
|||
} |
|||
|
|||
.table { |
|||
height: calc(680px - 34px); |
|||
} |
|||
} |
|||
} |
|||
</style> |
@ -0,0 +1,22 @@ |
|||
<!-- 巡查项目管理-水库 --> |
|||
<script> |
|||
export default { |
|||
name: '', |
|||
data() { |
|||
return { |
|||
|
|||
} |
|||
}, |
|||
methods: { |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<template> |
|||
<div> |
|||
水库 |
|||
</div> |
|||
</template> |
|||
|
|||
<style scoped lang="less"></style> |
@ -0,0 +1,22 @@ |
|||
<!-- 巡查项目管理-水闸 --> |
|||
<script> |
|||
export default { |
|||
name: '', |
|||
data() { |
|||
return { |
|||
|
|||
} |
|||
}, |
|||
methods: { |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<template> |
|||
<div> |
|||
水闸 |
|||
</div> |
|||
</template> |
|||
|
|||
<style scoped lang="less"></style> |
@ -0,0 +1,29 @@ |
|||
<!-- 巡查计划管理 --> |
|||
<script> |
|||
import Dike from './Dike.vue' |
|||
import Reservoir from './Reservoir.vue' |
|||
import Sluice from './Sluice.vue' |
|||
export default { |
|||
name: 'InspectionItems', |
|||
components: { |
|||
Reservoir, // 水库 |
|||
Sluice, // 水闸 |
|||
Dike, // 堤防 |
|||
}, |
|||
computed: { |
|||
selectTab() { |
|||
return this.$store.state.topTab.selectTab |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<template> |
|||
<div> |
|||
<Reservoir v-if="selectTab == 0"></Reservoir> |
|||
<Sluice v-if="selectTab == 1"></Sluice> |
|||
<Dike v-if="selectTab == 2"></Dike> |
|||
</div> |
|||
</template> |
|||
|
|||
<style scoped lang="less"></style> |
@ -0,0 +1,72 @@ |
|||
<!-- 工程巡查 --> |
|||
<script lang="ts"> |
|||
export default { |
|||
name: 'IconSelect', |
|||
data() { |
|||
return { |
|||
name: '', |
|||
} |
|||
}, |
|||
methods: { |
|||
searchData() { |
|||
console.log('搜索内容', this.name); |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<template> |
|||
<div class="body"> |
|||
<div class="top-title"> |
|||
基础信息管理 |
|||
</div> |
|||
<div class="table-box"> |
|||
<div class="top-search"> |
|||
<span>计划名称:</span> |
|||
<el-input class="search-input" v-model="this.name" placeholder="请输入计划名称" @input="this.searchData" /> |
|||
<el-button class="search-btn" type="success">搜索</el-button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<style scoped lang="less"> |
|||
.body { |
|||
width: 100%; |
|||
min-height: calc(100vh - 56px); |
|||
margin-left: 24px; |
|||
.top-title { |
|||
height: 40px; |
|||
background-color: white; |
|||
display: flex; |
|||
padding-left: 16px; |
|||
align-items: center; |
|||
font-weight: 600; |
|||
} |
|||
.table-box { |
|||
width: 100%; |
|||
min-height: calc(100vh - 56px - 64px); |
|||
margin-top: 24px; |
|||
padding: 16px; |
|||
background-color: white; |
|||
.top-search{ |
|||
display: flex; |
|||
align-items: center; |
|||
.search-input{ |
|||
width: 300px; |
|||
margin-right: 10px; |
|||
} |
|||
.search-btn{ |
|||
background-color: #37b29e; |
|||
border: none; |
|||
&:hover{ |
|||
background-color: #5ac6b9; |
|||
}; |
|||
&:active{ |
|||
background-color: #2b8070; |
|||
}; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
</style> |
Loading…
Reference in new issue