|
|
@ -1,16 +1,20 @@ |
|
|
|
<!-- 害堤动物防护记录-堤防 --> |
|
|
|
<script> |
|
|
|
import { |
|
|
|
putDFMaintenancePlan, |
|
|
|
deleteDFMaintenancePlan, |
|
|
|
postDFMaintenancePlan, |
|
|
|
getDFMaintenancePlan, |
|
|
|
listUser, |
|
|
|
getDFPreventionControlPlan, |
|
|
|
postDFPreventionControlPlanList, |
|
|
|
} from "@/api/management"; |
|
|
|
|
|
|
|
import { getDikeAnimalRecordsList } from "@/api/dike"; |
|
|
|
import { |
|
|
|
getDikeAnimalRecordsList, |
|
|
|
addDikeAnimalRecordData, |
|
|
|
updateDikeAnimalRecordData, |
|
|
|
getDikeAnimalRecordDetails, |
|
|
|
deleteDikeAnimalRecordDetails, |
|
|
|
} from "@/api/dike"; |
|
|
|
|
|
|
|
export default { |
|
|
|
name: "InspectionItems", |
|
|
@ -41,7 +45,8 @@ export default { |
|
|
|
monthsList: [], // 月份字典 |
|
|
|
tableData: [], // 检查列表 |
|
|
|
workTable: [], // 工作内容表格 |
|
|
|
drugTable: [], |
|
|
|
locationList: [], // 施工地点列表字典 |
|
|
|
pestAnimalList: [], // 有害动物列表字典 |
|
|
|
pageData: { |
|
|
|
pageNum: 1, // 当前页 |
|
|
|
pageSize: 10, // 请求数量 |
|
|
@ -65,11 +70,13 @@ export default { |
|
|
|
reminderTime: "", |
|
|
|
}, |
|
|
|
recordForm: { |
|
|
|
constructionLocation: "", |
|
|
|
constructionSituation: "", |
|
|
|
harmfulOrganisms: "", |
|
|
|
id: null, |
|
|
|
location: "", |
|
|
|
constructionStatus: "", |
|
|
|
pest: null, |
|
|
|
image: "", |
|
|
|
notes: "", |
|
|
|
drugs: [{ drugName: "", concentration: "", dose: "" }], // 用药 |
|
|
|
}, |
|
|
|
planRules: { |
|
|
|
planId: [{ required: true, message: "请选择计划", trigger: "blur" }], |
|
|
@ -89,10 +96,10 @@ export default { |
|
|
|
], |
|
|
|
}, |
|
|
|
recordRules: { |
|
|
|
constructionLocation: [ |
|
|
|
location: [ |
|
|
|
{ required: true, message: "请选择施工地点", trigger: "blur" }, |
|
|
|
], |
|
|
|
constructionSituation: [ |
|
|
|
constructionStatus: [ |
|
|
|
{ required: true, message: "请输入检查施工情况", trigger: "blur" }, |
|
|
|
{ max: 100, message: "最长为100个字符", trigger: "blur" }, |
|
|
|
], |
|
|
@ -109,11 +116,29 @@ export default { |
|
|
|
methods: { |
|
|
|
// 删除对应防治计划 |
|
|
|
deleteTableItem(row) { |
|
|
|
deleteDFMaintenancePlan(row.id).then((res) => { |
|
|
|
deleteDikeAnimalRecordDetails(row.id).then(() => { |
|
|
|
this.getTableData(); |
|
|
|
this.$message.success("删除成功"); |
|
|
|
this.$message({ |
|
|
|
message: "删除成功", |
|
|
|
type: "success", |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 获取施工地点字典值 |
|
|
|
getDictValue(value) { |
|
|
|
const item = this.locationList.find((item) => item.dictValue === value); |
|
|
|
return item ? item.dictLabel : ""; |
|
|
|
}, |
|
|
|
// 获取有害动物字典值 |
|
|
|
getDictValue2(value) { |
|
|
|
const item = this.pestAnimalList.find((item) => item.dictValue === value); |
|
|
|
return item ? item.dictLabel : ""; |
|
|
|
}, |
|
|
|
// 打开新增弹窗 |
|
|
|
handleOpenDialog() { |
|
|
|
this.dialogVisible = true; |
|
|
|
this.recordForm.id = null; |
|
|
|
}, |
|
|
|
// 删除对应工作内容 |
|
|
|
deleteWorkTableItem(id) { |
|
|
|
const index = this.workTable.findIndex((item) => item.id === id); |
|
|
@ -140,16 +165,37 @@ export default { |
|
|
|
this.personnelList = res.records; |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 确认 |
|
|
|
handleConfirm(row) { |
|
|
|
this.$confirm("是否确认?", "提示", { |
|
|
|
confirmButtonText: "确定", |
|
|
|
cancelButtonText: "取消", |
|
|
|
type: "warning", |
|
|
|
}) |
|
|
|
.then(() => { |
|
|
|
// 确认 |
|
|
|
// this.$message({ |
|
|
|
// type: "success", |
|
|
|
// message: "确认成功!", |
|
|
|
// }); |
|
|
|
}) |
|
|
|
.catch(() => {}); |
|
|
|
}, |
|
|
|
// 查看或编辑计划详情 |
|
|
|
viewOrEditPlanDetails(row, edit = false) { |
|
|
|
if (!edit) { |
|
|
|
this.prohibitEditing = true; |
|
|
|
} |
|
|
|
getDFMaintenancePlan(row.id).then((res) => { |
|
|
|
console.log("🚀res🚀", res); |
|
|
|
this.planForm = res.data; |
|
|
|
// this.planForm.reminderCycle = res.data.instruction + res.data.month; // ?????? |
|
|
|
this.dialogVisible = true; |
|
|
|
if (res.data) { |
|
|
|
this.planForm = res.data; |
|
|
|
// this.planForm.reminderCycle = res.data.instruction + res.data.month; // ?????? |
|
|
|
this.dialogVisible = true; |
|
|
|
this.recordForm.id = row.id; |
|
|
|
} |
|
|
|
}); |
|
|
|
getDikeAnimalRecordDetails(row.id).then((res) => { |
|
|
|
this.recordForm = res.data || this.recordForm; |
|
|
|
}); |
|
|
|
}, |
|
|
|
handleRemove(file) { |
|
|
@ -164,10 +210,17 @@ export default { |
|
|
|
}, |
|
|
|
// 保存维修计划 |
|
|
|
submitForm(formName) { |
|
|
|
console.log("this.planForm >>>>> ", this.planForm); |
|
|
|
this.$refs[formName].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
if (this.planForm.id) { |
|
|
|
putDFMaintenancePlan(this.planForm).then(() => { |
|
|
|
updateDikeAnimalRecordData({ |
|
|
|
planId: this.planForm.planId, |
|
|
|
planName: this.planForm.name, |
|
|
|
id: this.$route.query.id, |
|
|
|
dikeCode: this.$route.query.dikeCode, |
|
|
|
...this.recordForm, |
|
|
|
}).then(() => { |
|
|
|
this.getTableData(); |
|
|
|
this.dialogVisible = false; |
|
|
|
this.$message({ |
|
|
@ -176,7 +229,14 @@ export default { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
postDFMaintenancePlan(this.planForm).then(() => { |
|
|
|
addDikeAnimalRecordData({ |
|
|
|
planId: this.planForm.planId, |
|
|
|
planName: this.planForm.name, |
|
|
|
id: null, |
|
|
|
status: "0", |
|
|
|
dikeCode: this.$route.query.dikeCode, |
|
|
|
...this.recordForm, |
|
|
|
}).then(() => { |
|
|
|
this.getTableData(); |
|
|
|
this.dialogVisible = false; |
|
|
|
this.$message({ |
|
|
@ -212,9 +272,8 @@ export default { |
|
|
|
}, |
|
|
|
// 添加工作项 |
|
|
|
addWorkItem() { |
|
|
|
this.drugTable.push({ |
|
|
|
id: this.workTable.length + 1, |
|
|
|
name: "", |
|
|
|
this.recordForm.drugs.push({ |
|
|
|
drugName: "", |
|
|
|
concentration: "", |
|
|
|
dose: "", |
|
|
|
}); |
|
|
@ -276,11 +335,13 @@ export default { |
|
|
|
this.planForm.dikeName = data.dikeName || data.dikeCode; |
|
|
|
this.planForm.planId = planId; |
|
|
|
this.planForm.planName = data.name; |
|
|
|
this.planForm.planTime = data.planTime; |
|
|
|
this.planForm.type = data.type; |
|
|
|
this.planForm.instruction = data.instruction; |
|
|
|
this.planForm.details = data.details; |
|
|
|
this.planForm.frequency = data.frequency; |
|
|
|
this.planForm.cycleType = data.cycleType; |
|
|
|
this.planForm.selectUser = data.otherConfig.selectUser; |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
@ -296,6 +357,12 @@ export default { |
|
|
|
this.getDicts("xs_cycle_type").then((res) => { |
|
|
|
this.patrolType = res.data; |
|
|
|
}); |
|
|
|
this.getDicts("df_an_location").then((res) => { |
|
|
|
this.locationList = res.data; |
|
|
|
}); |
|
|
|
this.getDicts("df_an_type").then((res) => { |
|
|
|
this.pestAnimalList = res.data; |
|
|
|
}); |
|
|
|
// 获取列表数据 |
|
|
|
this.getTableData(); |
|
|
|
}, |
|
|
@ -332,29 +399,43 @@ export default { |
|
|
|
class="search-btn" |
|
|
|
style="margin-right: 16px; margin-bottom: 8px; float: right" |
|
|
|
type="success" |
|
|
|
@click="dialogVisible = true" |
|
|
|
@click="handleOpenDialog" |
|
|
|
>添加</el-button |
|
|
|
> |
|
|
|
</div> |
|
|
|
<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="防治计划名称" /> |
|
|
|
<el-table-column prop="" align="center" label="防治堤防" /> |
|
|
|
<el-table-column prop="location" align="center" label="堤防级别" /> |
|
|
|
<el-table-column prop="content" align="center" label="堤防类型" /> |
|
|
|
<el-table-column prop="instruction" align="center" label="防治类型" /> |
|
|
|
<el-table-column |
|
|
|
prop="createTime" |
|
|
|
align="center" |
|
|
|
sortable |
|
|
|
label="创建时间" |
|
|
|
/> |
|
|
|
<el-table-column prop="name" align="center" label="上报时间" /> |
|
|
|
<el-table-column prop="location" align="center" label="施工地点"> |
|
|
|
<template #default="{ row }"> |
|
|
|
<span>{{ getDictValue(row.location) }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="updateTime" |
|
|
|
prop="constructionStatus" |
|
|
|
align="center" |
|
|
|
sortable |
|
|
|
label="更新时间" |
|
|
|
label="检查施工情况" |
|
|
|
/> |
|
|
|
<el-table-column prop="pest" align="center" label="动物类型"> |
|
|
|
<template #default="{ row }"> |
|
|
|
<span>{{ getDictValue2(row.pest) }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="status" align="center" label="状态"> |
|
|
|
<template #default="{ row }"> |
|
|
|
<el-tag |
|
|
|
v-if="row.status == '0'" |
|
|
|
type="info" |
|
|
|
effect="dark" |
|
|
|
size="mini" |
|
|
|
>已提交</el-tag |
|
|
|
> |
|
|
|
<el-tag v-else type="success" effect="dark" size="mini" |
|
|
|
>已确认</el-tag |
|
|
|
> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="createTime" align="center" label="创建时间" /> |
|
|
|
<el-table-column prop="address" align="center" label="操作"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button |
|
|
@ -369,7 +450,11 @@ export default { |
|
|
|
size="small" |
|
|
|
>编辑</el-button |
|
|
|
> |
|
|
|
<el-button style="margin-right: 9px" type="text" size="small" |
|
|
|
<el-button |
|
|
|
style="margin-right: 9px" |
|
|
|
type="text" |
|
|
|
size="small" |
|
|
|
@click="handleConfirm(scope.row)" |
|
|
|
>确认</el-button |
|
|
|
> |
|
|
|
<el-popconfirm |
|
|
@ -409,7 +494,7 @@ export default { |
|
|
|
title="新增/编辑防治记录" |
|
|
|
@close="closeDialog" |
|
|
|
:visible.sync="dialogVisible" |
|
|
|
width="720" |
|
|
|
width="720px" |
|
|
|
> |
|
|
|
<div style="display: flex; margin-bottom: 16px"> |
|
|
|
<div |
|
|
@ -492,15 +577,14 @@ export default { |
|
|
|
></div> |
|
|
|
<span style="font-weight: 600">工作内容</span> |
|
|
|
</div> |
|
|
|
<el-form-item label-width="120px" label="工作月份" prop="month"> |
|
|
|
<el-select v-model="planForm.month" placeholder="请输入" disabled> |
|
|
|
<el-option |
|
|
|
v-for="(item, index) in monthsList" |
|
|
|
:label="item.dictLabel" |
|
|
|
:value="item.dictValue" |
|
|
|
:key="index" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
<el-form-item label-width="120px" label="工作月份" prop="planTime"> |
|
|
|
<el-date-picker |
|
|
|
disabled |
|
|
|
v-model="planForm.planTime" |
|
|
|
type="month" |
|
|
|
placeholder="选择日期" |
|
|
|
> |
|
|
|
</el-date-picker> |
|
|
|
</el-form-item> |
|
|
|
<el-table |
|
|
|
style="margin-bottom: 22px" |
|
|
@ -690,42 +774,38 @@ export default { |
|
|
|
label-width="100px" |
|
|
|
> |
|
|
|
<div style="display: flex"> |
|
|
|
<el-form-item |
|
|
|
label-width="120px" |
|
|
|
label="施工地点" |
|
|
|
prop="constructionLocation" |
|
|
|
> |
|
|
|
<el-select |
|
|
|
v-model="recordForm.constructionLocation" |
|
|
|
placeholder="请选择" |
|
|
|
> |
|
|
|
<!-- <el-option v-for="(item, index) in 12 " :label="(index + 1) + '月'" :value="item" /> --> |
|
|
|
<el-form-item label-width="120px" label="施工地点" prop="location"> |
|
|
|
<el-select v-model="recordForm.location" placeholder="请选择"> |
|
|
|
<el-option |
|
|
|
v-for="item in locationList" |
|
|
|
:label="item.dictLabel" |
|
|
|
:value="item.dictValue" |
|
|
|
:key="item.dictValue" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item |
|
|
|
label-width="120px" |
|
|
|
label="检查施工情况" |
|
|
|
prop="constructionSituation" |
|
|
|
prop="constructionStatus" |
|
|
|
> |
|
|
|
<el-input v-model="recordForm.constructionSituation" /> |
|
|
|
<el-input v-model="recordForm.constructionStatus" /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item |
|
|
|
label-width="80px" |
|
|
|
label="有害生物" |
|
|
|
prop="harmfulOrganisms" |
|
|
|
> |
|
|
|
<el-select |
|
|
|
v-model="recordForm.harmfulOrganisms" |
|
|
|
placeholder="请输入" |
|
|
|
> |
|
|
|
<!-- <el-option v-for="(item, index) in 12 " :label="(index + 1) + '月'" :value="item" /> --> |
|
|
|
<el-form-item label-width="80px" label="有害生物" prop="pest"> |
|
|
|
<el-select v-model="recordForm.pest" placeholder="请输入"> |
|
|
|
<el-option |
|
|
|
v-for="(item, index) in pestAnimalList" |
|
|
|
:label="item.dictLabel" |
|
|
|
:value="item.dictValue" |
|
|
|
:key="index" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</div> |
|
|
|
<el-table |
|
|
|
style="margin-bottom: 22px" |
|
|
|
max-height="330" |
|
|
|
:data="drugTable" |
|
|
|
:data="recordForm.drugs" |
|
|
|
border |
|
|
|
> |
|
|
|
<el-table-column |
|
|
@ -770,7 +850,7 @@ export default { |
|
|
|
@confirm="deleteWorkTableItem(scope.row.id)" |
|
|
|
> |
|
|
|
<el-button |
|
|
|
v-if="drugTable.length > 1" |
|
|
|
v-if="recordForm.drugs.length > 1" |
|
|
|
style="color: red" |
|
|
|
type="text" |
|
|
|
size="small" |
|
|
|