Browse Source

feat: 维修计划管理新增功能完成

feature-sy-v1.0.0
易浩轩 1 year ago
parent
commit
d2db88a10c
  1. 18
      src/api/management/dike.js
  2. 1
      src/assets/icons/svg/icon-wxjhgl.svg
  3. 1
      src/assets/icons/svg/icon-wxjl.svg
  4. 1
      src/assets/icons/svg/icon-wxyh.svg
  5. 24
      src/store/modules/permission.js
  6. 19
      src/views/runManage/engineering/inspectionItems/Dike.vue
  7. 8
      src/views/runManage/engineering/inspectionPlan/Dike.vue
  8. 2
      src/views/runManage/engineering/inspectionPlan/Reservoir.vue
  9. 2
      src/views/runManage/engineering/inspectionPlan/Sluice.vue
  10. 2
      src/views/runManage/engineering/inspectionRecords/Dike.vue
  11. 2
      src/views/runManage/engineering/inspectionRecords/Reservoir.vue
  12. 2
      src/views/runManage/engineering/inspectionRecords/Sluice.vue
  13. 3
      src/views/runManage/maintenance/index.vue
  14. 363
      src/views/runManage/maintenance/maintenancePlan/Dike.vue
  15. 22
      src/views/runManage/maintenance/maintenancePlan/Reservoir.vue
  16. 22
      src/views/runManage/maintenance/maintenancePlan/Sluice.vue
  17. 29
      src/views/runManage/maintenance/maintenancePlan/index.vue
  18. 399
      src/views/runManage/maintenance/maintenanceRecords/Dike.vue
  19. 22
      src/views/runManage/maintenance/maintenanceRecords/Reservoir.vue
  20. 22
      src/views/runManage/maintenance/maintenanceRecords/Sluice.vue
  21. 29
      src/views/runManage/maintenance/maintenanceRecords/index.vue

18
src/api/management/dike.js

@ -138,3 +138,21 @@ export function postInspectionRecordsTrajectoryList(data) {
data
})
}
// 维修计划管理-维修计划列表
export function postMaintenancePlanList(data) {
return request({
url: '/run/df/yh/plan/list',
method: 'post',
data
})
}
// 维修计划管理-新增维修计划
export function postNewMaintenancePlan(data) {
return request({
url: '/run/df/yh/plan',
method: 'post',
data
})
}

1
src/assets/icons/svg/icon-wxjhgl.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="14" height="14" viewBox="0 0 14 14"><defs><clipPath id="master_svg0_31_00426"><rect x="0" y="0" width="14" height="14" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_31_00426)"><g><path d="M4.0835,0.875L4.0835,1.458336L4.0835,1.75L2.04167,1.75Q1.558417,1.75,1.216709,2.09171Q0.875,2.43342,0.875,2.91667L0.875,11.9583Q0.875,12.4416,1.216711,12.7833Q1.558417,13.125,2.04167,13.125L11.9583,13.125Q12.4416,13.125,12.7833,12.7833Q13.125,12.4416,13.125,11.9583L13.125,2.91667Q13.125,2.43342,12.7833,2.09171Q12.4416,1.75,11.9583,1.75L9.91667,1.75L9.91667,1.458336L9.91667,0.875L8.75,0.875L8.75,1.458336L8.75,1.75L5.25017,1.75L5.25017,1.458336L5.25017,0.875L4.0835,0.875ZM11.9583,2.91667L11.9583,4.95831L2.04167,4.95831L2.04167,2.91667L4.0835,2.91667L4.0835,3.79167L4.0835,4.37501L5.25017,4.37501L5.25017,3.79167L5.25017,2.91667L8.75,2.91667L8.75,3.79167L8.75,4.37501L9.91667,4.37501L9.91667,3.79167L9.91667,2.91667L11.9583,2.91667ZM6.82931,11.2041C6.71991,11.3135,6.57154,11.375,6.41683,11.375C6.26212,11.375,6.11375,11.3135,6.00435,11.2041L4.2543500000000005,9.45413C4.14495,9.34473,4.0835,9.19636,4.0835,9.04165C4.0835,8.88694,4.14495,8.73856,4.2543500000000005,8.62917C4.36375,8.519770000000001,4.5121199999999995,8.45831,4.66683,8.45831C4.821540000000001,8.45831,4.96991,8.519770000000001,5.07931,8.62917L6.41683,9.96669L9.50413,6.87939C9.61375,6.76977,9.76212,6.70831,9.91683,6.70831C10.06892,6.70831,10.215,6.76772,10.32393,6.87386C10.32427,6.87419,10.32897,6.87883,10.32897,6.87883C10.4387,6.98856,10.50016,7.13694,10.50016,7.29165C10.50016,7.44636,10.4387,7.59473,10.32931,7.70413L6.82931,11.2041Z" fill-rule="evenodd" fill="#262626" fill-opacity="1"/></g></g></svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

1
src/assets/icons/svg/icon-wxjl.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="14" height="14" viewBox="0 0 14 14"><defs><clipPath id="master_svg0_31_01230"><rect x="0" y="0" width="14" height="14" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_31_01230)"><g><path d="M10.1379,0.965517L12.069,0.965517C12.2978,0.965517,12.5517,1.21848,12.5517,1.44828L12.5517,2.89655L0,2.89655L0,1.44828C0.000965521,1.21848,0.254414,0.965517,0.482759,0.965517L2.41379,0.965517L2.41379,2.41379L4.34483,2.41379L4.34483,0.965517L8.2069,0.965517L8.2069,2.41379L10.1379,2.41379L10.1379,0.965517ZM2.89655,0L3.86207,0L3.86207,1.93103L2.89655,1.93103L2.89655,0ZM8.68966,0L9.65517,0L9.65517,1.93103L8.68965,1.93103L8.68966,0ZM12.5517,5.95628C12.2465,5.77963,11.9227,5.63716,11.5862,5.53145L11.5862,4.34483L9.65517,4.34483L9.65517,5.33448C9.32743,5.36687,9.00389,5.43287,8.68965,5.53145L8.68965,4.34483L6.75862,4.34483L6.75862,6.27586L7.2409,6.27586C6.62587,6.73781,6.1296,7.33949,5.7931,8.03117L5.7931,7.24138L3.86207,7.24138L3.86207,9.17241L5.4069,9.17241C5.34366,9.48428,5.31034,9.80724,5.31034,10.1379L3.86207,10.1379L3.86207,12.069L5.712,12.069C5.94576,12.603,6.27417,13.0904,6.68138,13.5076L0.545517,13.4979C0.244276,13.4979,-3.67165e-7,13.2469,-3.67165e-7,12.936L-3.67165e-7,3.37931L12.5517,3.37931L12.5517,5.95628ZM0.965517,4.34483L0.965517,6.27586L2.89655,6.27586L2.89655,4.34483L0.965517,4.34483ZM0.965517,7.24138L0.965517,9.17241L2.89655,9.17241L2.89655,7.24138L0.965517,7.24138ZM0.965517,10.1379L0.965517,12.069L2.89655,12.069L2.89655,10.1379L0.965517,10.1379ZM3.86207,4.34483L3.86207,6.27586L5.7931,6.27586L5.7931,4.34483L3.86207,4.34483Z" fill="#000000" fill-opacity="1"/></g><g><path d="M10.13794890625,13.999988388671875C8.00498890625,13.999988388671875,6.27587890625,12.270878388671875,6.27587890625,10.137918388671874C6.27587890625,8.004958388671875,8.00498890625,6.275848388671875,10.13794890625,6.275848388671875C12.27090890625,6.275848388671875,14.00001890625,8.004958388671875,14.00001890625,10.137918388671874C14.00001890625,12.270878388671875,12.27090890625,13.999988388671875,10.13794890625,13.999988388671875ZM11.043118906250001,10.741368388671875C11.87586890625,10.740298388671874,12.550678906249999,10.065488388671875,12.55173890625,9.232748388671876C12.55173890625,9.100948388671874,12.53146890625,8.968678388671876,12.48704890625,8.816128388671874C12.47206890625,8.765158388671875,12.43165890625,8.725658388671874,12.380358906249999,8.711848388671875C12.32879890625,8.697958388671875,12.273748906249999,8.712688388671875,12.236018906249999,8.750468388671875L11.446708906249999,9.521918388671875L10.86932890625,9.406058388671875L10.75442890625,8.831088388671875L11.55242890625,8.050948388671875C11.63456890625,7.971448388671875,11.601678906250001,7.833018388671875,11.49256890625,7.7989483886718745C11.34743890625,7.751258388671875,11.19586890625,7.726018388671875,11.043118906250001,7.7241283886718755C10.21036890625,7.725188388671875,9.53555890625,8.399998388671875,9.53449890625,9.232748388671876C9.53449890625,9.330258388671876,9.54608890625,9.428748388671874,9.57021890625,9.537368388671876C9.400288906250001,9.677368388671875,9.23952890625,9.798058388671874,9.05704890625,9.934198388671875C8.79587890625,10.128748388671875,8.499948906250001,10.349368388671875,8.096848906249999,10.690198388671874C7.86214890625,10.892388388671876,7.7262689062500005,11.186138388671875,7.7241589062500005,11.495918388671875C7.72494890625,12.078688388671875,8.19717890625,12.550908388671875,8.77994890625,12.551708388671875C9.08794890625,12.551708388671875,9.38146890625,12.414128388671875,9.58325890625,12.174678388671875C9.85036890625,11.860948388671876,10.10638890625,11.537948388671875,10.35084890625,11.206258388671875C10.48456890625,11.027638388671875,10.60187890625,10.870748388671874,10.73801890625,10.705158388671876C10.83794890625,10.728818388671876,10.94077890625,10.740878388671874,11.043118906250001,10.741368388671875Z" fill="#000000" fill-opacity="1"/></g></g></svg>

After

Width:  |  Height:  |  Size: 3.9 KiB

1
src/assets/icons/svg/icon-wxyh.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="14" height="14" viewBox="0 0 14 14"><defs><clipPath id="master_svg0_31_00458"><rect x="0" y="0" width="14" height="14" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_31_00458)"><g><path d="M12.9706,6.02625C13.9738,5.00758,14.277,3.49122,13.7327,2.16927L11.8664,4.03555C11.3221,4.54878,10.4745,4.51768,9.96127,3.97334C9.47137,3.45234,9.47137,2.6514,9.96127,2.13039L11.8276,0.264113C10.5056,-0.272443,8.98925,0.0230518,7.9628,1.0184C6.95189,2.0293,6.6564,3.55343,7.20851,4.8676L5.91766,6.15845L2.65167,2.89246L2.87718,2.42589L1.11199,1.22058L0,2.34035L1.16643,4.08221L1.6952,3.81782L4.98452,7.08381L1.16642,10.9019C0.925364,11.143,0.917588,11.5318,1.15865,11.7728L1.16642,11.7806L2.33285,12.9548C2.57391,13.1959,2.9705,13.1959,3.21156,12.9548L7.02965,9.1445L7.57399,9.68883L7.42624,9.83658C7.21628,9.98432,7.16185,10.272,7.3096,10.4898C7.32515,10.5131,7.3407,10.5364,7.36403,10.552L9.95349,13.1337C10.1712,13.3592,10.5289,13.3825,10.7778,13.1803L11.9831,11.975C12.2008,11.7262,12.2008,11.3607,11.9831,11.1196L9.39361,8.53795C9.18365,8.32022,8.86483,8.41354,8.63932,8.63904L8.53046,8.74791L7.98612,8.21136L9.33918,6.85053C10.6067,7.28599,12.0142,6.96717,12.9706,6.02625Z" fill="#262626" fill-opacity="1"/></g></g></svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

24
src/store/modules/permission.js

@ -67,6 +67,30 @@ const permission = {
path: "/inspectionRecords"
},
],
},
{
component: "runManage/maintenance",
alwaysShow: true,
hidden: false,
meta: { title: "维修养护", icon: "icon-wxyh" },
name: "Maintenance",
path: "/maintenance",
children: [
{
component: "runManage/maintenance/maintenancePlan",
hidden: false,
meta: { title: "维修计划管理", icon: "icon-wxjhgl" },
name: "MaintenancePlan",
path: "/maintenancePlan"
},
{
component: "runManage/maintenance/maintenanceRecords",
hidden: false,
meta: { title: "维修记录", icon: "icon-wxjl" },
name: "MaintenanceRecords",
path: "/maintenanceRecords"
},
]
}
]
}

19
src/views/runManage/engineering/inspectionItems/Dike.vue

@ -117,8 +117,8 @@ export default {
}
},
//
deletePatrolItem(row) {
console.log('🚀row🚀', row)
deletePatrolItem(index) {
this.ruleForm.items.splice(index, 1)
},
//
changeContentType(dictValue) {
@ -157,11 +157,17 @@ export default {
putEmbankmentInspection(this.ruleForm).then(() => {
this.getTableData()
this.dialogVisible = false
this.$message.success('更新成功');
}).catch((err) => {
this.$message.error(err);
})
} else {
postEmbankmentInspection(this.ruleForm).then(() => {
this.getTableData()
this.dialogVisible = false
this.$message.success('添加成功');
}).catch((err) => {
this.$message.error(err);
})
}
} else {
@ -274,7 +280,7 @@ export default {
:total="pageData.total" @size-change="getTableData()">
</el-pagination>
</div>
<el-dialog title="新增/编辑巡查项目" :visible.sync="dialogVisible" width="50%">
<el-dialog title="新增/编辑巡查项目" destroy-on-close :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>
@ -324,10 +330,11 @@ export default {
</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"
<el-button style="margin-right: 8px;"
v-if="scope.$index == ruleForm.items.length - 1 && ruleForm.items.length < 50"
@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-popconfirm v-if="ruleForm.items.length >= 2" confirm-button-text='确定' cancel-button-text='取消'
icon="el-icon-info" icon-color="red" title="确定删除吗?" @confirm="deletePatrolItem(scope.$index)">
<el-button slot="reference" style="color: red;" type="text" size="small">删除</el-button>
</el-popconfirm>
</template>

8
src/views/runManage/engineering/inspectionPlan/Dike.vue

@ -141,12 +141,18 @@ export default {
console.log('🚀res🚀', res)
this.getTableData()
this.dialogVisible = false
this.$message.success('更新成功');
}).catch((err) => {
this.$message.error(err);
})
} else {
postInspectionPlan(this.ruleForm).then((res) => {
console.log('🚀res🚀', res)
this.getTableData()
this.dialogVisible = false
this.$message.success('添加成功');
}).catch((err) => {
this.$message.error(err);
})
}
} else {
@ -285,7 +291,7 @@ export default {
:total="pageData.total" @size-change="getTableData()">
</el-pagination>
</div>
<el-dialog title="新增/编辑巡查计划" :visible.sync="dialogVisible" width="50%">
<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>

2
src/views/runManage/engineering/inspectionPlan/Reservoir.vue

@ -1,4 +1,4 @@
<!-- 巡查项目管理-水库 -->
<!-- 巡查计划管理-水库 -->
<script>
export default {
name: '',

2
src/views/runManage/engineering/inspectionPlan/Sluice.vue

@ -1,4 +1,4 @@
<!-- 巡查项目管理-水闸 -->
<!-- 巡查计划管理-水闸 -->
<script>
export default {
name: '',

2
src/views/runManage/engineering/inspectionRecords/Dike.vue

@ -65,7 +65,7 @@ export default {
<el-input class="search-input" v-model="searchInput" placeholder="请输入巡检记录" />
<el-button class="search-btn" type="success" @click="getTableData(searchInput)">搜索</el-button>
</div>
<el-table class="table" height="650" :data="tableData" border>
<el-table class="table" height="690" :data="tableData" border>
<el-table-column type="index" align="center" label="序号" width="100" />
<el-table-column prop="name" align="center" label="巡检记录" />
<el-table-column align="center" label="有无异常">

2
src/views/runManage/engineering/inspectionRecords/Reservoir.vue

@ -1,4 +1,4 @@
<!-- 巡查项目管理-水库 -->
<!-- 巡查记录-水库 -->
<script>
export default {
name: '',

2
src/views/runManage/engineering/inspectionRecords/Sluice.vue

@ -1,4 +1,4 @@
<!-- 巡查项目管理-水闸 -->
<!-- 巡查记录-水闸 -->
<script>
export default {
name: '',

3
src/views/runManage/maintenance/index.vue

@ -0,0 +1,3 @@
<template >
<router-view />
</template>

363
src/views/runManage/maintenance/maintenancePlan/Dike.vue

@ -0,0 +1,363 @@
<!-- 维修计划管理-堤防 -->
<script>
import { getDicts, postEmbankmentInspectionChecklist, postEmbankmentInspection, putEmbankmentInspection, deleteEmbankmentInspection, getEmbankmentInspectionCheck, postNewMaintenancePlan, postMaintenancePlanList } from '@/api/management'
export default {
name: 'InspectionItems',
data() {
return {
searchInput: '',
dialogVisible: false,
embankmentList: [
{
label: '堤防1',
value: '1',
id: '1',
},
{
label: '堤防2',
value: '2',
id: '2',
},
{
label: '堤防3',
value: '3',
id: '3',
}
], //
ContentType: '',
firstType: [], //
secondType: [], //
examType: [], //
tableData: [], //
pageData: {
pageNum: 1, //
pageSize: 10, //
pageSizes: [10, 20, 50, 100],
total: 0 //
},
ruleForm: {
dikeCode: '',
name: '',
planTime: '',
nationalSupplement: 0,
selfSupplement: 0,
loaction: '',
budget: 0,
content: '',
},
rules: {
dikeCode: [
{ required: true, message: '请选择堤防名称', trigger: 'blur' }
],
name: [
{ required: true, message: '请输入维养计划名称', trigger: 'blur' },
{ max: 100, message: '名称最长为100个字符', trigger: 'blur' }
],
planTime: [
{ required: true, message: '请选计划时间', trigger: 'change' }
],
nationalSupplement: [
{ required: true, message: '请输入资金', trigger: 'change' }
],
selfSupplement: [
{ required: true, message: '请输入资金', trigger: 'change' }
],
loaction: [
{ required: true, message: '请输入具体地点', trigger: 'change' }
],
content: [
{ required: true, message: '请输入维修养护内容', trigger: 'change' }
],
}
}
},
methods: {
//
searchTableList() {
postEmbankmentInspectionChecklist({
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('🚀表格数据🚀', res)
})
},
//
editTableItem(row) {
getEmbankmentInspectionCheck(row.id).then((res) => {
console.log('🚀res🚀', res.data)
this.ruleForm = res.data
this.ruleForm.checkContentType = res.data.items[0].parts[0]
getDicts(res.data.items[0].parts[0]).then((res) => {
this.secondType = res.data
console.log('🚀一级🚀', res.data)
})
this.ruleForm.items.forEach(element => {
getDicts(element.parts[1]).then((res) => {
this.$set(element, 'third', res.data)
})
});
this.dialogVisible = true
console.log('🚀this.ruleForm🚀', this.ruleForm)
})
},
//
deleteTableItem(row) {
deleteEmbankmentInspection(row.id).then((res) => {
console.log('🚀res🚀', res)
this.getTableData()
})
},
//
newInspectionItems() {
this.dialogVisible = true
this.ruleForm = {
dikeCode: '',
name: '',
planTime: '',
nationalSupplement: 0,
selfSupplement: 0,
loaction: '',
budget: 0,
content: '',
}
},
//
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
console.log(this.ruleForm);
if (this.ruleForm.id) {
// this.dikeCode = this.dikeCode.value
putEmbankmentInspection(this.ruleForm).then(() => {
this.getTableData()
this.dialogVisible = false
})
} else {
// this.dikeCode = this.dikeCode.value
postEmbankmentInspection(this.ruleForm).then(() => {
this.getTableData()
this.dialogVisible = false
})
}
} else {
console.log('校验不通过');
return false;
}
});
},
resetForm(formName) {
this.$refs[formName].resetFields();
this.dialogVisible = false
},
//
addInspectionItems() {
},
//
calculateBudget() {
this.ruleForm.budget = Number(this.ruleForm.selfSupplement) + Number(this.ruleForm.nationalSupplement)
},
getTableData(value = '') {
postMaintenancePlanList({
data: {
timeView: {
timeField: "create_time"
},
},
cv: {
name: "name",
type: "like",
value
},
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()
},
}
</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" @click="getTableData(searchInput)">搜索</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 prop="name" align="center" label="维养计划名称" />
<el-table-column prop="name" align="center" label="堤防等级" />
<el-table-column prop="name" align="center" label="具体地点" />
<el-table-column prop="name" align="center" label="维修养护内容" />
<el-table-column prop="name" align="center" label="国补" />
<el-table-column prop="name" align="center" label="自筹" />
<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 @click="editTableItem(scope.row)" type="text" size="small">查看</el-button>
<el-button @click="editTableItem(scope.row)" type="text" size="small">编辑</el-button>
<el-button style=" margin-right: 9px;" @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="新增/编辑维养计划" destroy-on-close :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="dikeCode">
<el-select v-model="ruleForm.dikeCode" placeholder="请选择" @change="ruleForm.name = ruleForm.dikeCode.label"
value-key="id">
<el-option v-for="item in embankmentList" :label="item.label" :value="item" :key="item.id"></el-option>
</el-select>
<el-button button class="search-btn" type="success" size="small">详情</el-button>
<el-button button class="search-btn" type="success" size="small">打开地图</el-button>
</el-form-item>
<div style="display: flex;">
<el-form-item label-width="120px" label="维养计划名称" prop="name">
<el-input style="width: 202px;" v-model="ruleForm.name" placeholder="请输入" />
</el-form-item>
<el-form-item label-width="120px" label="计划时间" prop="planTime">
<el-date-picker v-model="ruleForm.planTime" type="month" placeholder="选择月">
</el-date-picker>
</el-form-item>
</div>
<div style="display: flex;">
<el-form-item label-width="120px" label="国补资金" prop="nationalSupplement">
<el-input style="width: 100px;" v-model="ruleForm.nationalSupplement" type="number" @input="calculateBudget()"
placeholder="请输入" /> 万元
</el-form-item>
<el-form-item label-width="120px" label="自筹资金" prop="selfSupplement">
<el-input style="width: 100px;" v-model="ruleForm.selfSupplement" type="number" @input="calculateBudget()"
placeholder="请输入" /> 万元
</el-form-item>
<el-form-item label-width="120px" label="项目预算">
<el-input style="width: 100px;" v-model="ruleForm.budget" disabled />
</el-form-item>
</div>
<el-form-item label-width="120px" label="具体地点" prop="loaction">
<el-input style="width: 500px;" :autosize="{ minRows: 5 }" type="textarea" maxlength="500" show-word-limit
v-model="ruleForm.loaction" placeholder="请输入" />
</el-form-item>
<el-form-item label-width="120px" label="维修养护内容" prop="content">
<el-input style="width: 500px;" :autosize="{ minRows: 5 }" type="textarea" maxlength="500" show-word-limit
v-model="ruleForm.content" placeholder="请输入" />
</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;
}
}
.table {
height: calc(680px - 34px);
}
}
.search-btn {
margin-left: 10px;
background-color: #37b29e;
border: none;
&:hover {
background-color: #5ac6b9;
}
&:active {
background-color: #2b8070;
}
;
}
}
/deep/.el-input__count {
height: 15px;
line-height: 15px;
margin-right: 10px;
margin-bottom: -4px;
}
</style>

22
src/views/runManage/maintenance/maintenancePlan/Reservoir.vue

@ -0,0 +1,22 @@
<!-- 维修计划管理-水库 -->
<script>
export default {
name: '',
data() {
return {
}
},
methods: {
}
}
</script>
<template>
<div>
水库
</div>
</template>
<style scoped lang="less"></style>

22
src/views/runManage/maintenance/maintenancePlan/Sluice.vue

@ -0,0 +1,22 @@
<!-- 维修计划管理-水闸 -->
<script>
export default {
name: '',
data() {
return {
}
},
methods: {
}
}
</script>
<template>
<div>
水闸
</div>
</template>
<style scoped lang="less"></style>

29
src/views/runManage/maintenance/maintenancePlan/index.vue

@ -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>

399
src/views/runManage/maintenance/maintenanceRecords/Dike.vue

@ -0,0 +1,399 @@
<!-- 维修记录-堤防 -->
<script>
import { getDicts, 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.data)
this.ruleForm = res.data
this.ruleForm.checkContentType = res.data.items[0].parts[0]
getDicts(res.data.items[0].parts[0]).then((res) => {
this.secondType = res.data
console.log('🚀一级🚀', res.data)
})
this.ruleForm.items.forEach(element => {
getDicts(element.parts[1]).then((res) => {
this.$set(element, 'third', res.data)
})
});
this.dialogVisible = true
console.log('🚀this.ruleForm🚀', this.ruleForm)
})
},
//
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) {
getDicts(dictValue).then((res) => {
this.secondType = res.data
console.log('🚀一级🚀', res.data)
})
this.ruleForm.items = [
{
content: '',
parts: [this.ruleForm.checkContentType]
}
]
},
//
changeSecondType(row) {
getDicts(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);
if (this.ruleForm.id) {
putEmbankmentInspection(this.ruleForm).then(() => {
this.getTableData()
this.dialogVisible = false
})
} else {
postEmbankmentInspection(this.ruleForm).then(() => {
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()
//
getDicts('xs_classfy').then((res) => {
if (res.data && Array.isArray(res.data)) {
res.data.forEach(element => {
element.dictValue = Number(element.dictValue)
});
this.examType = res.data
}
})
//
getDicts('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>

22
src/views/runManage/maintenance/maintenanceRecords/Reservoir.vue

@ -0,0 +1,22 @@
<!-- 维修记录-水库 -->
<script>
export default {
name: '',
data() {
return {
}
},
methods: {
}
}
</script>
<template>
<div>
水库
</div>
</template>
<style scoped lang="less"></style>

22
src/views/runManage/maintenance/maintenanceRecords/Sluice.vue

@ -0,0 +1,22 @@
<!-- 维修记录-水闸 -->
<script>
export default {
name: '',
data() {
return {
}
},
methods: {
}
}
</script>
<template>
<div>
水闸
</div>
</template>
<style scoped lang="less"></style>

29
src/views/runManage/maintenance/maintenanceRecords/index.vue

@ -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>
Loading…
Cancel
Save