|
|
@ -1,20 +1,23 @@ |
|
|
|
<!-- 害堤动物防护计划管理-堤防 --> |
|
|
|
<script> |
|
|
|
import { putDFMaintenancePlan, deleteDFMaintenancePlan, |
|
|
|
postDFNewPreventionControlPlan, postDFPreventionControlPlanList, |
|
|
|
getDFMaintenancePlan, listUser, getDicts } from '@/api/management' |
|
|
|
import { |
|
|
|
listDikeInfo |
|
|
|
} from "@/api/yg/dikeInfo" |
|
|
|
putDFPreventionControlPlan, |
|
|
|
deleteDFMaintenancePlan, |
|
|
|
postDFNewPreventionControlPlan, |
|
|
|
postDFPreventionControlPlanList, |
|
|
|
getDFPreventionControlPlan, |
|
|
|
listUser, |
|
|
|
} from "@/api/management"; |
|
|
|
import { listDikeInfo } from "@/api/yg/dikeInfo"; |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'InspectionItems', |
|
|
|
name: "InspectionItems", |
|
|
|
data() { |
|
|
|
return { |
|
|
|
searchInput: '', |
|
|
|
controlInput: '', |
|
|
|
selectLevel: '', |
|
|
|
selectType: '', |
|
|
|
searchInput: "", |
|
|
|
controlInput: "", |
|
|
|
selectLevel: "", |
|
|
|
selectType: "", |
|
|
|
dialogVisible: false, |
|
|
|
prohibitEditing: false, |
|
|
|
personnelList: [], // 人员列表 |
|
|
@ -28,98 +31,99 @@ export default { |
|
|
|
pageNum: 1, // 当前页 |
|
|
|
pageSize: 10, // 请求数量 |
|
|
|
pageSizes: [10, 20, 50, 100], |
|
|
|
total: 0 // 总数量 |
|
|
|
total: 0, // 总数量 |
|
|
|
}, |
|
|
|
ruleForm: { |
|
|
|
dikeCode: '', |
|
|
|
name: '', |
|
|
|
type: '', |
|
|
|
instruction: '', |
|
|
|
month: '', |
|
|
|
dikeCode: "", |
|
|
|
name: "", |
|
|
|
type: "", |
|
|
|
instruction: "", |
|
|
|
month: "", |
|
|
|
details: [], |
|
|
|
cycleType: '', |
|
|
|
frequency: '', |
|
|
|
cycleType: "", |
|
|
|
frequency: "", |
|
|
|
operators: [], |
|
|
|
isReminder: 1, |
|
|
|
otherConfig: { |
|
|
|
selectUser: [], |
|
|
|
week: '', |
|
|
|
day: '' |
|
|
|
week: "", |
|
|
|
day: "", |
|
|
|
}, |
|
|
|
reminderTime: '', |
|
|
|
reminderTime: "", |
|
|
|
}, |
|
|
|
rules: { |
|
|
|
dikeCode: [ |
|
|
|
{ required: true, message: '请选择堤防名称', trigger: 'blur' } |
|
|
|
{ required: true, message: "请选择堤防名称", trigger: "blur" }, |
|
|
|
], |
|
|
|
name: [ |
|
|
|
{ required: true, message: '请输入防治计划名称', trigger: 'blur' }, |
|
|
|
{ max: 100, message: '名称最长为100个字符', trigger: 'blur' } |
|
|
|
{ required: true, message: "请输入防治计划名称", trigger: "blur" }, |
|
|
|
{ max: 100, message: "名称最长为100个字符", trigger: "blur" }, |
|
|
|
], |
|
|
|
type: [ |
|
|
|
{ required: true, message: '请选择防治类型', trigger: 'change' } |
|
|
|
{ required: true, message: "请选择防治类型", trigger: "change" }, |
|
|
|
], |
|
|
|
instruction: [ |
|
|
|
{ required: true, message: '请输入防治说明', trigger: 'change' } |
|
|
|
{ required: true, message: "请输入防治说明", trigger: "change" }, |
|
|
|
], |
|
|
|
month: [ |
|
|
|
{ required: true, message: '请选择工作月份', trigger: 'change' } |
|
|
|
{ required: true, message: "请选择工作月份", trigger: "change" }, |
|
|
|
], |
|
|
|
cycleType: [ |
|
|
|
{ required: true, message: '请选择提醒日期', trigger: 'change' } |
|
|
|
{ required: true, message: "请选择提醒日期", trigger: "change" }, |
|
|
|
], |
|
|
|
frequency: [ |
|
|
|
{ required: true, message: '请输入次数', trigger: 'change' } |
|
|
|
{ required: true, message: "请输入次数", trigger: "change" }, |
|
|
|
], |
|
|
|
'otherConfig.selectUser': [ |
|
|
|
{ required: true, message: '请选择责任人', trigger: 'change' } |
|
|
|
"otherConfig.selectUser": [ |
|
|
|
{ required: true, message: "请选择责任人", trigger: "change" }, |
|
|
|
], |
|
|
|
'otherConfig.week': [ |
|
|
|
{ required: true, message: '请选择星期', trigger: 'change' } |
|
|
|
"otherConfig.week": [ |
|
|
|
{ required: true, message: "请选择星期", trigger: "change" }, |
|
|
|
], |
|
|
|
'otherConfig.day': [ |
|
|
|
{ required: true, message: '请输入', trigger: 'change' } |
|
|
|
"otherConfig.day": [ |
|
|
|
{ required: true, message: "请输入", trigger: "change" }, |
|
|
|
], |
|
|
|
reminderTime: [ |
|
|
|
{ required: true, message: '请选择提醒时间', trigger: 'change' } |
|
|
|
{ required: true, message: "请选择提醒时间", trigger: "change" }, |
|
|
|
], |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}; |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
dialogVisible(newVal, oldVal) { |
|
|
|
if (oldVal) { |
|
|
|
this.prohibitEditing = false |
|
|
|
this.prohibitEditing = false; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 打开新增弹窗 |
|
|
|
openAddDialog() { |
|
|
|
// 获取字典数据 |
|
|
|
getDicts('xc_w_month').then((res) => { |
|
|
|
this.workMonth = res.data |
|
|
|
console.log('🏝️this.workMonth🏝️', this.workMonth) |
|
|
|
}) |
|
|
|
getDicts('xs_cycle_type').then((res) => { |
|
|
|
this.patrolType = res.data |
|
|
|
console.log('🏝️this.patrolType🏝️', this.patrolType) |
|
|
|
}) |
|
|
|
this.getDicts("xc_w_month").then((res) => { |
|
|
|
this.workMonth = res.data; |
|
|
|
}); |
|
|
|
this.getDicts("xs_cycle_type").then((res) => { |
|
|
|
this.patrolType = res.data; |
|
|
|
}); |
|
|
|
if (this.ruleForm.details.length <= 0) { |
|
|
|
this.ruleForm.details.push({ |
|
|
|
constructionDate: '', |
|
|
|
jobContent: '', |
|
|
|
planDays: 0 |
|
|
|
}) |
|
|
|
constructionDate: "", |
|
|
|
jobContent: "", |
|
|
|
planDays: 0, |
|
|
|
}); |
|
|
|
} |
|
|
|
this.dialogVisible = true |
|
|
|
this.dialogVisible = true; |
|
|
|
setTimeout(() => { |
|
|
|
this.$refs.ruleForm.resetFields(); |
|
|
|
}, 0); |
|
|
|
}, |
|
|
|
// 删除对应防治计划 |
|
|
|
deleteTableItem(row) { |
|
|
|
deleteDFMaintenancePlan(row.id).then((res) => { |
|
|
|
this.getTableData() |
|
|
|
this.$message.success('删除成功'); |
|
|
|
}) |
|
|
|
this.getTableData(); |
|
|
|
this.$message.success("删除成功"); |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 删除对应工作内容 |
|
|
|
deleteWorkTableItem(id) { |
|
|
@ -133,70 +137,75 @@ export default { |
|
|
|
listUser({ |
|
|
|
data: { |
|
|
|
timeView: { |
|
|
|
timeField: "create_time" |
|
|
|
timeField: "create_time", |
|
|
|
}, |
|
|
|
}, |
|
|
|
cv: { |
|
|
|
name: "nickName", |
|
|
|
type: "like", |
|
|
|
value: e |
|
|
|
value: e, |
|
|
|
}, |
|
|
|
pageSize: 100, |
|
|
|
pageNum: 1 |
|
|
|
pageNum: 1, |
|
|
|
}).then((res) => { |
|
|
|
this.personnelList = res.records |
|
|
|
}) |
|
|
|
this.personnelList = res.records; |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 查看或编辑计划详情 |
|
|
|
viewOrEditPlanDetails(row, edit = false) { |
|
|
|
if (!edit) { |
|
|
|
this.prohibitEditing = true |
|
|
|
this.prohibitEditing = true; |
|
|
|
} |
|
|
|
getDFPreventionControlPlan(row.id).then((res) => { |
|
|
|
this.ruleForm = res.data; |
|
|
|
this.ruleForm.reminderCycle = res.data.instruction + res.data.month; |
|
|
|
this.dialogVisible = true; |
|
|
|
}); |
|
|
|
}, |
|
|
|
changeOtherConfigSelectUser(idsArr) { |
|
|
|
if (idsArr?.length) { |
|
|
|
this.ruleForm.operators = |
|
|
|
this.personnelList |
|
|
|
.filter((v) => idsArr.includes(v.nickName)) |
|
|
|
?.map((v) => ({ |
|
|
|
name: v.nickName, |
|
|
|
uid: v.id, |
|
|
|
})) || []; |
|
|
|
} else { |
|
|
|
this.ruleForm.operators = []; |
|
|
|
} |
|
|
|
getDFMaintenancePlan(row.id).then((res) => { |
|
|
|
console.log('🚀res🚀', res) |
|
|
|
this.ruleForm = res.data |
|
|
|
this.ruleForm.reminderCycle = res.data.instruction + res.data.month |
|
|
|
this.dialogVisible = true |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 保存维修计划 |
|
|
|
submitForm(formName) { |
|
|
|
this.$refs[formName].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
console.log('🏝️this.ruleForm🏝️', this.ruleForm) |
|
|
|
this.ruleForm.cycleType = parseFloat(this.ruleForm.cycleType) |
|
|
|
this.ruleForm.frequency = parseFloat(this.ruleForm.frequency) |
|
|
|
this.ruleForm.month = parseFloat(this.ruleForm.month) |
|
|
|
this.ruleForm.type = parseFloat(this.ruleForm.type) |
|
|
|
this.ruleForm.otherConfig.selectUser.forEach((item) => { |
|
|
|
this.ruleForm.operators.push({ |
|
|
|
name: item.userName, |
|
|
|
uid: item.id |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.dialogVisible = false |
|
|
|
this.ruleForm.cycleType = parseFloat(this.ruleForm.cycleType); |
|
|
|
this.ruleForm.frequency = parseFloat(this.ruleForm.frequency); |
|
|
|
this.ruleForm.month = parseFloat(this.ruleForm.month); |
|
|
|
this.ruleForm.type = parseFloat(this.ruleForm.type); |
|
|
|
this.dialogVisible = false; |
|
|
|
if (this.ruleForm.id) { |
|
|
|
putDFMaintenancePlan(this.ruleForm).then(() => { |
|
|
|
this.getTableData() |
|
|
|
this.dialogVisible = false |
|
|
|
putDFPreventionControlPlan(this.ruleForm).then(() => { |
|
|
|
this.getTableData(); |
|
|
|
this.dialogVisible = false; |
|
|
|
this.$message({ |
|
|
|
message: '保存成功', |
|
|
|
type: 'success' |
|
|
|
}) |
|
|
|
}) |
|
|
|
message: "保存成功", |
|
|
|
type: "success", |
|
|
|
}); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
postDFNewPreventionControlPlan(this.ruleForm).then(() => { |
|
|
|
console.log('保存成功'); |
|
|
|
this.getTableData() |
|
|
|
this.dialogVisible = false |
|
|
|
console.log("保存成功"); |
|
|
|
this.getTableData(); |
|
|
|
this.dialogVisible = false; |
|
|
|
this.$message({ |
|
|
|
message: '保存成功', |
|
|
|
type: 'success' |
|
|
|
}) |
|
|
|
}) |
|
|
|
message: "保存成功", |
|
|
|
type: "success", |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} else { |
|
|
|
console.log('校验不通过'); |
|
|
|
console.log("校验不通过"); |
|
|
|
return false; |
|
|
|
} |
|
|
|
}); |
|
|
@ -204,70 +213,73 @@ export default { |
|
|
|
// 重置校验 |
|
|
|
resetForm(formName) { |
|
|
|
this.$refs[formName].resetFields(); |
|
|
|
this.dialogVisible = false |
|
|
|
this.dialogVisible = false; |
|
|
|
}, |
|
|
|
// 关闭dialog |
|
|
|
closeDialog(ruleForm = 'ruleForm') { |
|
|
|
console.log('触发关闭dialog', ruleForm); |
|
|
|
closeDialog(ruleForm = "ruleForm") { |
|
|
|
console.log("触发关闭dialog", ruleForm); |
|
|
|
this.$refs[ruleForm].resetFields(); |
|
|
|
this.ruleForm = { |
|
|
|
dikeCode: '', |
|
|
|
name: '', |
|
|
|
dikeCode: "", |
|
|
|
name: "", |
|
|
|
type: 0, |
|
|
|
instruction: '', |
|
|
|
month: '', |
|
|
|
instruction: "", |
|
|
|
month: "", |
|
|
|
details: [], |
|
|
|
cycleType: '', |
|
|
|
cycleType: "", |
|
|
|
isReminder: true, |
|
|
|
selectUser: [], |
|
|
|
week: 1, |
|
|
|
date: 1, |
|
|
|
reminderTime: '', |
|
|
|
} |
|
|
|
reminderTime: "", |
|
|
|
}; |
|
|
|
}, |
|
|
|
// 添加工作项 |
|
|
|
addWorkItem() { |
|
|
|
this.ruleForm.details.push({ |
|
|
|
jobContent: '', |
|
|
|
constructionDate: '', |
|
|
|
planDays: '', |
|
|
|
}) |
|
|
|
jobContent: "", |
|
|
|
constructionDate: "", |
|
|
|
planDays: "", |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 获取数据 |
|
|
|
getTableData(value = '') { |
|
|
|
// 获取列表数据 |
|
|
|
getTableData() { |
|
|
|
postDFPreventionControlPlanList({ |
|
|
|
data: { |
|
|
|
timeView: { |
|
|
|
timeField: "create_time" |
|
|
|
timeField: "create_time", |
|
|
|
}, |
|
|
|
}, |
|
|
|
cv: { |
|
|
|
name: "name", |
|
|
|
type: "like", |
|
|
|
value |
|
|
|
value: this.searchInput, |
|
|
|
}, |
|
|
|
params: { |
|
|
|
orderBy: "create_time", |
|
|
|
sort: "desc", |
|
|
|
}, |
|
|
|
pageSize: this.pageData.pageSize, |
|
|
|
pageNum: this.pageData.pageNum |
|
|
|
pageNum: this.pageData.pageNum, |
|
|
|
}).then((res) => { |
|
|
|
if (res) { |
|
|
|
this.tableData = res.records |
|
|
|
this.pageData.total = res.total |
|
|
|
this.tableData = res.records; |
|
|
|
this.pageData.total = res.total; |
|
|
|
} |
|
|
|
console.log('🚀表格数据🚀', res) |
|
|
|
}) |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 重置搜索 |
|
|
|
resetSearch() { |
|
|
|
this.searchInput = '' |
|
|
|
this.selectStatus = '2' |
|
|
|
this.getTableData() |
|
|
|
this.searchInput = ""; |
|
|
|
this.selectStatus = "2"; |
|
|
|
this.getTableData(); |
|
|
|
}, |
|
|
|
// 打开地图 |
|
|
|
handleOpenMap(){}, |
|
|
|
handleOpenMap() {}, |
|
|
|
// 打开详情 |
|
|
|
handleOpenDetail(){}, |
|
|
|
handleOpenDetail() {}, |
|
|
|
// 获取堤防列表信息 |
|
|
|
getEmbData(){ |
|
|
|
getEmbData() { |
|
|
|
listDikeInfo({ |
|
|
|
pageNum: 1, |
|
|
|
pageSize: 20, |
|
|
@ -284,56 +296,79 @@ export default { |
|
|
|
// desc降序,升序asc |
|
|
|
sort: "desc", |
|
|
|
}, |
|
|
|
}).then(res=> { |
|
|
|
this.embankmentList = res?.records || [] |
|
|
|
}) |
|
|
|
}).then((res) => { |
|
|
|
this.embankmentList = res?.records || []; |
|
|
|
}); |
|
|
|
}, |
|
|
|
handleChangeDike(value){ |
|
|
|
this.ruleForm.name = this.ruleForm.dikeCode |
|
|
|
handleChangeDike(value) { |
|
|
|
this.ruleForm.name = this.ruleForm.dikeCode; |
|
|
|
// let res = this.embankmentList.find(v=> v.dikeCode === value) |
|
|
|
// this.dikeDetailsDialog.id = res?.id || '' |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
// 获取列表数据 |
|
|
|
// this.getTableData() |
|
|
|
this.getEmbData() |
|
|
|
getDicts('embankment_level').then((res) => { |
|
|
|
this.dikeLevel = res.data |
|
|
|
}) |
|
|
|
getDicts('dh_jh_type').then((res) => { |
|
|
|
this.controlType = res.data |
|
|
|
}) |
|
|
|
this.getTableData(); |
|
|
|
this.getEmbData(); |
|
|
|
this.getDicts("embankment_level").then((res) => { |
|
|
|
this.dikeLevel = res.data; |
|
|
|
}); |
|
|
|
this.getDicts("dh_jh_type").then((res) => { |
|
|
|
this.controlType = res.data; |
|
|
|
}); |
|
|
|
}, |
|
|
|
} |
|
|
|
}; |
|
|
|
</script> |
|
|
|
|
|
|
|
<template> |
|
|
|
<div class="body slider-right"> |
|
|
|
<div class="top-title"> |
|
|
|
基础信息管理 |
|
|
|
</div> |
|
|
|
<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-input |
|
|
|
class="search-input" |
|
|
|
v-model="searchInput" |
|
|
|
placeholder="请输入" |
|
|
|
/> |
|
|
|
<span>防治堤防:</span> |
|
|
|
<el-input class="search-input" v-model="controlInput" placeholder="请输入" /> |
|
|
|
<el-input |
|
|
|
class="search-input" |
|
|
|
v-model="controlInput" |
|
|
|
placeholder="请输入" |
|
|
|
/> |
|
|
|
<span>堤防级别:</span> |
|
|
|
<el-select v-model="selectLevel" placeholder="请选择"> |
|
|
|
<el-option label="全部" value="0" /> |
|
|
|
<el-option v-for="item in dikeLevel" :label="item.dictLabel" :value="item.dictValue" :key="item.id" /> |
|
|
|
<el-option |
|
|
|
v-for="item in dikeLevel" |
|
|
|
:label="item.dictLabel" |
|
|
|
:value="item.dictValue" |
|
|
|
:key="item.id" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
<span style="margin-left: 10px;">防治类型:</span> |
|
|
|
<span style="margin-left: 10px">防治类型:</span> |
|
|
|
<el-select v-model="selectType" placeholder="请选择"> |
|
|
|
<el-option label="全部" value="3" /> |
|
|
|
<el-option v-for="item in controlType" :label="item.dictLabel" :value="item.dictValue" :key="item.id" /> |
|
|
|
<el-option |
|
|
|
v-for="item in controlType" |
|
|
|
:label="item.dictLabel" |
|
|
|
:value="item.dictValue" |
|
|
|
:key="item.id" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
<el-button class="search-btn" type="success" @click="getTableData(searchInput)">搜索</el-button> |
|
|
|
<el-button class="search-btn" type="success" @click="getTableData()" |
|
|
|
>搜索</el-button |
|
|
|
> |
|
|
|
<el-button @click="resetSearch()">重置</el-button> |
|
|
|
</div> |
|
|
|
<el-button class="search-btn" style=" margin-right: 16px;margin-bottom: 8px; float: right;" type="success" |
|
|
|
@click="openAddDialog()">添加</el-button> |
|
|
|
<el-button |
|
|
|
class="search-btn" |
|
|
|
style="margin-right: 16px; margin-bottom: 8px; float: right" |
|
|
|
type="success" |
|
|
|
@click="openAddDialog()" |
|
|
|
>添加</el-button |
|
|
|
> |
|
|
|
<el-table class="table" height="640" :data="tableData" border> |
|
|
|
<el-table-column type="index" align="center" label="序号" width="100" /> |
|
|
|
<el-table-column prop="name" align="center" label="防治计划名称" /> |
|
|
@ -341,120 +376,323 @@ export default { |
|
|
|
<el-table-column prop="location" align="center" label="堤防级别" /> |
|
|
|
<el-table-column prop="content" align="center" label="堤防类型" /> |
|
|
|
<el-table-column prop="type" align="center" label="防治类型" /> |
|
|
|
<el-table-column prop="createTime" align="center" sortable label="创建时间" /> |
|
|
|
<el-table-column prop="updateTime" align="center" sortable label="更新时间" /> |
|
|
|
<el-table-column |
|
|
|
prop="createTime" |
|
|
|
align="center" |
|
|
|
sortable |
|
|
|
label="创建时间" |
|
|
|
/> |
|
|
|
<el-table-column |
|
|
|
prop="updateTime" |
|
|
|
align="center" |
|
|
|
sortable |
|
|
|
label="更新时间" |
|
|
|
/> |
|
|
|
<el-table-column prop="address" align="center" label="操作"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button @click="viewOrEditPlanDetails(scope.row)" type="text" size="small">查看</el-button> |
|
|
|
<el-button @click="viewOrEditPlanDetails(scope.row, true)" type="text" size="small">编辑</el-button> |
|
|
|
<el-button style=" margin-right: 9px;" 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-button |
|
|
|
@click="viewOrEditPlanDetails(scope.row)" |
|
|
|
type="text" |
|
|
|
size="small" |
|
|
|
>查看</el-button |
|
|
|
> |
|
|
|
<el-button |
|
|
|
@click="viewOrEditPlanDetails(scope.row, true)" |
|
|
|
type="text" |
|
|
|
size="small" |
|
|
|
>编辑</el-button |
|
|
|
> |
|
|
|
<el-button style="margin-right: 9px" 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 |
|
|
|
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="新增/编辑防治计划" @close="" :visible.sync="dialogVisible" width="720px"> |
|
|
|
<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> |
|
|
|
<el-dialog |
|
|
|
title="新增/编辑防治计划" |
|
|
|
@close="" |
|
|
|
:visible.sync="dialogVisible" |
|
|
|
:close-on-click-modal="false" |
|
|
|
width="720px" |
|
|
|
> |
|
|
|
<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"> |
|
|
|
<el-form |
|
|
|
:model="ruleForm" |
|
|
|
:rules="rules" |
|
|
|
ref="ruleForm" |
|
|
|
label-width="100px" |
|
|
|
> |
|
|
|
<el-form-item label-width="120px" label="堤防名称" prop="dikeCode"> |
|
|
|
<!-- <el-input style="width: 202px;" v-model="ruleForm.dikeCode" placeholder="请输入" :disabled="prohibitEditing" /> --> |
|
|
|
<el-select v-model="ruleForm.dikeCode" placeholder="请选择" @change="handleChangeDike" |
|
|
|
:disabled="prohibitEditing"> |
|
|
|
<el-option v-for="item in embankmentList" :label="item.dikeName" :value="item.dikeCode" :key="item.id"></el-option> |
|
|
|
<el-select |
|
|
|
v-model="ruleForm.dikeCode" |
|
|
|
placeholder="请选择" |
|
|
|
@change="handleChangeDike" |
|
|
|
:disabled="prohibitEditing" |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="item in embankmentList" |
|
|
|
:label="item.dikeName" |
|
|
|
:value="item.dikeCode" |
|
|
|
:key="item.id" |
|
|
|
></el-option> |
|
|
|
</el-select> |
|
|
|
<el-button :disabled="!ruleForm.dikeCode" class="!m-6" type="success" size="small" @click="handleOpenDetail">详情</el-button> |
|
|
|
<el-button :disabled="!ruleForm.dikeCode" class="!ml-6" type="success" size="small" @click="handleOpenMap">打开地图</el-button> |
|
|
|
<el-button |
|
|
|
:disabled="!ruleForm.dikeCode" |
|
|
|
class="!m-6" |
|
|
|
type="success" |
|
|
|
size="small" |
|
|
|
@click="handleOpenDetail" |
|
|
|
>详情</el-button |
|
|
|
> |
|
|
|
<el-button |
|
|
|
:disabled="!ruleForm.dikeCode" |
|
|
|
class="!ml-6" |
|
|
|
type="success" |
|
|
|
size="small" |
|
|
|
@click="handleOpenMap" |
|
|
|
>打开地图</el-button |
|
|
|
> |
|
|
|
</el-form-item> |
|
|
|
<div style="display: flex;"> |
|
|
|
<div style="display: flex"> |
|
|
|
<el-form-item label-width="120px" label="防治计划名称" prop="name"> |
|
|
|
<el-input style="width: 202px;" v-model="ruleForm.name" placeholder="请输入" :disabled="prohibitEditing" /> |
|
|
|
<el-input |
|
|
|
style="width: 202px" |
|
|
|
v-model="ruleForm.name" |
|
|
|
placeholder="请输入" |
|
|
|
:disabled="prohibitEditing" |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label-width="120px" label="防治类型" prop="type"> |
|
|
|
<el-select v-model="ruleForm.type" placeholder="请选择" :disabled="prohibitEditing"> |
|
|
|
<el-option v-for="item in controlType" :key="item.id" :label="item.dictLabel" :value="item.dictValue"> |
|
|
|
<el-select |
|
|
|
v-model="ruleForm.type" |
|
|
|
placeholder="请选择" |
|
|
|
:disabled="prohibitEditing" |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="item in controlType" |
|
|
|
:key="item.id" |
|
|
|
:label="item.dictLabel" |
|
|
|
:value="item.dictValue" |
|
|
|
> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</div> |
|
|
|
<el-form-item label-width="120px" label="防治说明" prop="instruction"> |
|
|
|
<el-input v-model="ruleForm.instruction" type="textarea" placeholder=" 请输入" :disabled="prohibitEditing" /> |
|
|
|
<el-input |
|
|
|
v-model="ruleForm.instruction" |
|
|
|
type="textarea" |
|
|
|
placeholder=" 请输入" |
|
|
|
:disabled="prohibitEditing" |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
<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 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-item label-width="120px" label="工作月份" prop="month"> |
|
|
|
<el-select v-model="ruleForm.month" placeholder="请选择" :disabled="prohibitEditing"> |
|
|
|
<el-option v-for="item in workMonth" :label="item.dictLabel" :value="item.dictValue" :key="item.id" /> |
|
|
|
<el-select |
|
|
|
v-model="ruleForm.month" |
|
|
|
placeholder="请选择" |
|
|
|
:disabled="prohibitEditing" |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="item in workMonth" |
|
|
|
:label="item.dictLabel" |
|
|
|
:value="item.dictValue" |
|
|
|
:key="item.id" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-table style="margin-bottom: 22px;" max-height="330" :data="ruleForm.details" border> |
|
|
|
<el-table-column type="index" align="center" label="序号" width="50" /> |
|
|
|
<el-table |
|
|
|
style="margin-bottom: 22px" |
|
|
|
max-height="330" |
|
|
|
:data="ruleForm.details" |
|
|
|
border |
|
|
|
> |
|
|
|
<el-table-column |
|
|
|
type="index" |
|
|
|
align="center" |
|
|
|
label="序号" |
|
|
|
width="50" |
|
|
|
/> |
|
|
|
<el-table-column prop="jobContent" align="center" label="工作内容"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input v-model="scope.row.jobContent" placeholder="请输入工作内容" /> |
|
|
|
<el-input |
|
|
|
v-model="scope.row.jobContent" |
|
|
|
placeholder="请输入工作内容" |
|
|
|
/> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="constructionDate" align="center" label="施工日期"> |
|
|
|
<el-table-column |
|
|
|
prop="constructionDate" |
|
|
|
align="center" |
|
|
|
label="施工日期" |
|
|
|
> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input v-model="scope.row.constructionDate" placeholder="请输入施工日期" /> |
|
|
|
<el-input |
|
|
|
v-model="scope.row.constructionDate" |
|
|
|
placeholder="请输入施工日期" |
|
|
|
/> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="planDays" align="center" label="计划工日" width="80"> |
|
|
|
<el-table-column |
|
|
|
prop="planDays" |
|
|
|
align="center" |
|
|
|
label="计划工日" |
|
|
|
width="80" |
|
|
|
> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input v-model="scope.row.planDays" placeholder="请输入计划工日" /> |
|
|
|
<el-input |
|
|
|
v-model="scope.row.planDays" |
|
|
|
placeholder="请输入计划工日" |
|
|
|
/> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column align="center" label="操作" width="100"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button style=" margin-right: 9px;" type="text" size="small" @click="addWorkItem">添加</el-button> |
|
|
|
<el-popconfirm confirm-button-text='确定' cancel-button-text='取消' icon="el-icon-info" icon-color="red" |
|
|
|
title="确定删除吗?" @confirm="deleteWorkTableItem(scope.row.id)"> |
|
|
|
<el-button v-if="ruleForm.details.length > 1" style="color: red;" type="text" size="small" |
|
|
|
slot="reference">删除</el-button> |
|
|
|
<el-button |
|
|
|
style="margin-right: 9px" |
|
|
|
type="text" |
|
|
|
size="small" |
|
|
|
@click="addWorkItem" |
|
|
|
>添加</el-button |
|
|
|
> |
|
|
|
<el-popconfirm |
|
|
|
confirm-button-text="确定" |
|
|
|
cancel-button-text="取消" |
|
|
|
icon="el-icon-info" |
|
|
|
icon-color="red" |
|
|
|
title="确定删除吗?" |
|
|
|
@confirm="deleteWorkTableItem(scope.row.id)" |
|
|
|
> |
|
|
|
<el-button |
|
|
|
v-if="ruleForm.details.length > 1" |
|
|
|
style="color: red" |
|
|
|
type="text" |
|
|
|
size="small" |
|
|
|
slot="reference" |
|
|
|
>删除</el-button |
|
|
|
> |
|
|
|
</el-popconfirm> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
<div style="display: flex;"> |
|
|
|
<div style="display: flex"> |
|
|
|
<el-form-item label-width="120px" label="提醒周期" prop="frequency"> |
|
|
|
<el-input style="width: 90px;" v-model="ruleForm.frequency" placeholder="请输入" /> |
|
|
|
<el-input |
|
|
|
style="width: 90px" |
|
|
|
v-model="ruleForm.frequency" |
|
|
|
placeholder="请输入" |
|
|
|
/> |
|
|
|
/次 |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label-width="10px" prop="cycleType"> |
|
|
|
<el-select style="width: 90px;" 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-select |
|
|
|
style="width: 90px" |
|
|
|
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 label-width="100px" label="责任人" prop="otherConfig.selectUser"> |
|
|
|
<el-select v-model="ruleForm.otherConfig.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-form-item |
|
|
|
label-width="100px" |
|
|
|
label="责任人" |
|
|
|
prop="otherConfig.selectUser" |
|
|
|
> |
|
|
|
<el-select |
|
|
|
v-model="ruleForm.otherConfig.selectUser" |
|
|
|
multiple |
|
|
|
filterable |
|
|
|
remote |
|
|
|
:remote-method="searchUser" |
|
|
|
value-key="id" |
|
|
|
placeholder="请输入关键词搜索用户" |
|
|
|
prop="selectUser" |
|
|
|
@change="changeOtherConfigSelectUser" |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="item in personnelList" |
|
|
|
:key="item.id" |
|
|
|
:label="item.nickName" |
|
|
|
:value="item.nickName" |
|
|
|
> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</div> |
|
|
|
<div style="display: flex;"> |
|
|
|
<div style="display: flex"> |
|
|
|
<el-form-item label-width="120px" label="消息提醒" prop="isReminder"> |
|
|
|
<el-switch v-model="ruleForm.isReminder" :active-value="1" :inactive-value="0" active-color="#31a08e" |
|
|
|
inactive-color="#dcdfe6"> |
|
|
|
<el-switch |
|
|
|
v-model="ruleForm.isReminder" |
|
|
|
:active-value="1" |
|
|
|
:inactive-value="0" |
|
|
|
active-color="#31a08e" |
|
|
|
inactive-color="#dcdfe6" |
|
|
|
> |
|
|
|
</el-switch> |
|
|
|
</el-form-item> |
|
|
|
<div style="display: flex;flex-direction: column;"> |
|
|
|
<el-form-item v-if="ruleForm.isReminder && ruleForm.cycleType === '1'" label-width="120px" label="提醒时间" |
|
|
|
prop="otherConfig.week"> |
|
|
|
<div style="display: flex; flex-direction: column"> |
|
|
|
<el-form-item |
|
|
|
v-if="ruleForm.isReminder && ruleForm.cycleType === '1'" |
|
|
|
label-width="120px" |
|
|
|
label="提醒时间" |
|
|
|
prop="otherConfig.week" |
|
|
|
> |
|
|
|
<el-radio-group v-model="ruleForm.otherConfig.week"> |
|
|
|
<el-radio :label="1">星期一</el-radio> |
|
|
|
<el-radio :label="2">星期二</el-radio> |
|
|
@ -465,20 +703,42 @@ export default { |
|
|
|
<el-radio :label="7">星期日</el-radio> |
|
|
|
</el-radio-group> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item v-if="ruleForm.isReminder && ruleForm.cycleType === '0'" label-width="120px" label="提醒时间" |
|
|
|
prop="otherConfig.day"> |
|
|
|
<div>每月<el-input style="width: 202px;" v-model="ruleForm.otherConfig.day" />号 |
|
|
|
<el-form-item |
|
|
|
v-if="ruleForm.isReminder && ruleForm.cycleType === '0'" |
|
|
|
label-width="120px" |
|
|
|
label="提醒时间" |
|
|
|
prop="otherConfig.day" |
|
|
|
> |
|
|
|
<div> |
|
|
|
每月<el-input |
|
|
|
style="width: 202px" |
|
|
|
v-model="ruleForm.otherConfig.day" |
|
|
|
/>号 |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label-width="120px" :label="ruleForm.cycleType === '2' ? '提醒时间' : ''" prop="reminderTime"> |
|
|
|
<el-time-picker v-model="ruleForm.reminderTime" value-format="yyyy-MM-dd hh:mm:ss" placeholder="选择时间" /> |
|
|
|
<el-form-item |
|
|
|
label-width="120px" |
|
|
|
:label="ruleForm.cycleType === '2' ? '提醒时间' : ''" |
|
|
|
prop="reminderTime" |
|
|
|
> |
|
|
|
<el-time-picker |
|
|
|
v-model="ruleForm.reminderTime" |
|
|
|
value-format="yyyy-MM-dd hh:mm:ss" |
|
|
|
placeholder="选择时间" |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-form> |
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button size="mini" @click="resetForm('ruleForm')">取 消</el-button> |
|
|
|
<el-button v-if="!prohibitEditing" size="mini" type="primary" @click="submitForm('ruleForm')">保存</el-button> |
|
|
|
<el-button |
|
|
|
v-if="!prohibitEditing" |
|
|
|
size="mini" |
|
|
|
type="primary" |
|
|
|
@click="submitForm('ruleForm')" |
|
|
|
>保存</el-button |
|
|
|
> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
@ -513,10 +773,8 @@ export default { |
|
|
|
width: 202px; |
|
|
|
margin-right: 10px; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.table { |
|
|
|
height: calc(680px - 34px); |
|
|
|
} |
|
|
@ -534,8 +792,6 @@ export default { |
|
|
|
&:active { |
|
|
|
background-color: #2b8070; |
|
|
|
} |
|
|
|
|
|
|
|
; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|