|
|
@ -1,14 +1,21 @@ |
|
|
|
<!-- 巡查项目管理-水闸 --> |
|
|
|
<script> |
|
|
|
import { getDicts, postSZInspectionProjectList, postSZInspectionProject, putSZInspectionProject, deleteSZInspectionProject, getSZInspectionProject } from '@/api/management' |
|
|
|
import { |
|
|
|
getDicts, |
|
|
|
postSZInspectionProjectList, |
|
|
|
postSZInspectionProject, |
|
|
|
putSZInspectionProject, |
|
|
|
deleteSZInspectionProject, |
|
|
|
getSZInspectionProject, |
|
|
|
} from "@/api/management"; |
|
|
|
export default { |
|
|
|
name: 'InspectionItems', |
|
|
|
name: "InspectionItems", |
|
|
|
data() { |
|
|
|
return { |
|
|
|
searchInput: '', |
|
|
|
searchInput: "", |
|
|
|
searchType: 3, |
|
|
|
dialogVisible: false, |
|
|
|
ContentType: '', |
|
|
|
ContentType: "", |
|
|
|
firstType: [], // 一级检查内容类型 |
|
|
|
secondType: [], // 二级检查内容类型 |
|
|
|
examType: [], // 检查类型 |
|
|
@ -17,28 +24,27 @@ export default { |
|
|
|
pageNum: 1, // 当前页 |
|
|
|
pageSize: 10, // 请求数量 |
|
|
|
pageSizes: [10, 20, 50, 100], |
|
|
|
total: 0 // 总数量 |
|
|
|
total: 0, // 总数量 |
|
|
|
}, |
|
|
|
ruleForm: { |
|
|
|
name: '', |
|
|
|
type: '', |
|
|
|
checkContentType: '', |
|
|
|
items: [ |
|
|
|
], |
|
|
|
name: "", |
|
|
|
type: "", |
|
|
|
checkContentType: "", |
|
|
|
items: [], |
|
|
|
}, |
|
|
|
rules: { |
|
|
|
name: [ |
|
|
|
{ required: true, message: '请输入巡视检查名称', trigger: 'blur' }, |
|
|
|
{ max: 50, message: '名称最长为50个字符', trigger: 'blur' } |
|
|
|
{ required: true, message: "请输入巡视检查名称", trigger: "blur" }, |
|
|
|
{ max: 50, message: "名称最长为50个字符", trigger: "blur" }, |
|
|
|
], |
|
|
|
type: [ |
|
|
|
{ required: true, message: '请选择巡查类型', trigger: 'change' } |
|
|
|
{ required: true, message: "请选择巡查类型", trigger: "change" }, |
|
|
|
], |
|
|
|
checkContentType: [ |
|
|
|
{ required: true, message: '请选择巡视检查内容', trigger: 'change' } |
|
|
|
] |
|
|
|
} |
|
|
|
} |
|
|
|
{ required: true, message: "请选择巡视检查内容", trigger: "change" }, |
|
|
|
], |
|
|
|
}, |
|
|
|
}; |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 表格筛选 |
|
|
@ -46,97 +52,92 @@ export default { |
|
|
|
postSZInspectionProjectList({ |
|
|
|
data: { |
|
|
|
timeView: { |
|
|
|
timeField: "create_time" |
|
|
|
timeField: "create_time", |
|
|
|
}, |
|
|
|
type: this.searchType == 3 ? '' : this.searchType |
|
|
|
type: this.searchType == 3 ? "" : this.searchType, |
|
|
|
}, |
|
|
|
cv: { |
|
|
|
name: "name", |
|
|
|
type: "like", |
|
|
|
value: this.searchInput |
|
|
|
value: this.searchInput, |
|
|
|
}, |
|
|
|
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) |
|
|
|
}) |
|
|
|
console.log("🚀表格数据🚀", res); |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 重置搜索 |
|
|
|
resetSearch() { |
|
|
|
this.searchInput = '' |
|
|
|
this.searchType = 3 |
|
|
|
this.searchTableList() |
|
|
|
this.searchInput = ""; |
|
|
|
this.searchType = 3; |
|
|
|
this.searchTableList(); |
|
|
|
}, |
|
|
|
// 编辑巡查项目 |
|
|
|
editTableItem(row) { |
|
|
|
getSZInspectionProject(row.id).then((res) => { |
|
|
|
console.log('🚀res🚀', res.data) |
|
|
|
this.ruleForm = res.data |
|
|
|
this.ruleForm.checkContentType = res.data.items[0].parts[0] |
|
|
|
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 => { |
|
|
|
this.secondType = res.data; |
|
|
|
}); |
|
|
|
this.ruleForm.items.forEach((element) => { |
|
|
|
getDicts(element.parts[1]).then((res) => { |
|
|
|
this.$set(element, 'third', res.data) |
|
|
|
}) |
|
|
|
this.$set(element, "third", res.data); |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.dialogVisible = true |
|
|
|
console.log('🚀this.ruleForm🚀', this.ruleForm) |
|
|
|
}) |
|
|
|
this.dialogVisible = true; |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 删除对应巡查项目 |
|
|
|
deleteTableItem(row) { |
|
|
|
deleteSZInspectionProject(row.id).then((res) => { |
|
|
|
this.getTableData() |
|
|
|
this.$message.success('删除成功'); |
|
|
|
}) |
|
|
|
this.getTableData(); |
|
|
|
this.$message.success("删除成功"); |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 新增巡查内容 |
|
|
|
addPatrolItem(checkContentType) { |
|
|
|
console.log('🚀checkContentType🚀', checkContentType) |
|
|
|
this.ruleForm.items.push( |
|
|
|
{ |
|
|
|
content: '', |
|
|
|
parts: [checkContentType, '', ''] |
|
|
|
} |
|
|
|
) |
|
|
|
this.ruleForm.items.push({ |
|
|
|
content: "", |
|
|
|
parts: [checkContentType, "", ""], |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 删除对应巡查内容 |
|
|
|
deletePatrolItem(index) { |
|
|
|
this.ruleForm.items.splice(index, 1) |
|
|
|
this.ruleForm.items.splice(index, 1); |
|
|
|
}, |
|
|
|
// 改变一级巡视检查内容 |
|
|
|
changeContentType(dictValue) { |
|
|
|
getDicts(dictValue).then((res) => { |
|
|
|
this.secondType = res.data |
|
|
|
console.log('🚀一级🚀', res.data) |
|
|
|
}) |
|
|
|
this.secondType = res.data; |
|
|
|
console.log("🚀一级🚀", res.data); |
|
|
|
}); |
|
|
|
this.ruleForm.items = [ |
|
|
|
{ |
|
|
|
content: '', |
|
|
|
parts: [this.ruleForm.checkContentType] |
|
|
|
} |
|
|
|
] |
|
|
|
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) |
|
|
|
}) |
|
|
|
row.parts[2] = ""; |
|
|
|
this.$set(row, "third", res.data); |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 改变三级巡视检查内容 |
|
|
|
changeThirdType(row) { |
|
|
|
let value = row.third.find(item => item.dictValue == row.parts[2]).remark |
|
|
|
let value = row.third.find( |
|
|
|
(item) => item.dictValue == row.parts[2] |
|
|
|
).remark; |
|
|
|
if (value) { |
|
|
|
row.content = value |
|
|
|
row.content = value; |
|
|
|
} |
|
|
|
}, |
|
|
|
// 保存巡查项目 |
|
|
@ -146,106 +147,112 @@ export default { |
|
|
|
console.log(this.ruleForm); |
|
|
|
if (this.ruleForm.id) { |
|
|
|
putSZInspectionProject(this.ruleForm).then(() => { |
|
|
|
this.getTableData() |
|
|
|
this.dialogVisible = false |
|
|
|
this.$message.success('更新成功'); |
|
|
|
}) |
|
|
|
this.getTableData(); |
|
|
|
this.dialogVisible = false; |
|
|
|
this.$message.success("更新成功"); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
postSZInspectionProject(this.ruleForm).then(() => { |
|
|
|
this.getTableData() |
|
|
|
this.dialogVisible = false |
|
|
|
this.$message.success('添加成功'); |
|
|
|
}) |
|
|
|
this.getTableData(); |
|
|
|
this.dialogVisible = false; |
|
|
|
this.$message.success("添加成功"); |
|
|
|
}); |
|
|
|
} |
|
|
|
} else { |
|
|
|
console.log('校验不通过'); |
|
|
|
console.log("校验不通过"); |
|
|
|
return false; |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 关闭dialog |
|
|
|
closeDialog(ruleForm = 'ruleForm') { |
|
|
|
console.log('触发关闭dialog', ruleForm); |
|
|
|
closeDialog(ruleForm = "ruleForm") { |
|
|
|
console.log("触发关闭dialog", ruleForm); |
|
|
|
this.$refs[ruleForm].resetFields(); |
|
|
|
this.ruleForm = { |
|
|
|
name: '', |
|
|
|
type: '', |
|
|
|
checkContentType: '', |
|
|
|
name: "", |
|
|
|
type: "", |
|
|
|
checkContentType: "", |
|
|
|
items: [ |
|
|
|
{ |
|
|
|
content: '', |
|
|
|
parts: ['', '', ''] |
|
|
|
} |
|
|
|
] |
|
|
|
} |
|
|
|
content: "", |
|
|
|
parts: ["", "", ""], |
|
|
|
}, |
|
|
|
], |
|
|
|
}; |
|
|
|
}, |
|
|
|
// 获取列表数据 |
|
|
|
getTableData() { |
|
|
|
this.searchInput = '', |
|
|
|
this.searchType = 3, |
|
|
|
(this.searchInput = ""), |
|
|
|
(this.searchType = 3), |
|
|
|
postSZInspectionProjectList({ |
|
|
|
data: { |
|
|
|
timeView: { |
|
|
|
timeField: "create_time" |
|
|
|
timeField: "create_time", |
|
|
|
}, |
|
|
|
}, |
|
|
|
cv: { |
|
|
|
name: "name", |
|
|
|
type: "like" |
|
|
|
type: "like", |
|
|
|
}, |
|
|
|
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) |
|
|
|
}) |
|
|
|
} |
|
|
|
console.log("🚀表格数据🚀", res); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
// 获取列表数据 |
|
|
|
this.getTableData() |
|
|
|
this.getTableData(); |
|
|
|
// 获取巡查类型 |
|
|
|
getDicts('xs_classfy').then((res) => { |
|
|
|
if (res.data && Array.isArray(res.data)) { |
|
|
|
res.data.forEach(element => { |
|
|
|
element.dictValue = Number(element.dictValue) |
|
|
|
}); |
|
|
|
console.log('🚀res.data🚀', res.data) |
|
|
|
this.examType = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
getDicts("xs_classfy").then((res) => { |
|
|
|
this.examType = res.data; |
|
|
|
}); |
|
|
|
// 获取一级数据 |
|
|
|
getDicts('sz_xs_c_classfy').then((res) => { |
|
|
|
if (res.data && Array.isArray(res.data)) { |
|
|
|
this.firstType = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
getDicts("sz_xs_c_classfy").then((res) => { |
|
|
|
this.firstType = res.data || []; |
|
|
|
}); |
|
|
|
}, |
|
|
|
} |
|
|
|
}; |
|
|
|
</script> |
|
|
|
|
|
|
|
<template> |
|
|
|
<div class="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-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 |
|
|
|
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> |
|
|
|
<el-button class="search-btn" type="success" @click="searchTableList()" |
|
|
|
>搜索</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="dialogVisible = true">添加</el-button> |
|
|
|
<el-button |
|
|
|
class="search-btn" |
|
|
|
style="margin-right: 16px; margin-bottom: 8px; float: right" |
|
|
|
type="success" |
|
|
|
@click="dialogVisible = true" |
|
|
|
>添加</el-button |
|
|
|
> |
|
|
|
<el-table height="625" :data="tableData" border> |
|
|
|
<el-table-column type="index" align="center" label="序号" width="100"> |
|
|
|
</el-table-column> |
|
|
@ -253,98 +260,223 @@ export default { |
|
|
|
</el-table-column> |
|
|
|
<el-table-column align="center" label="巡查类型"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span v-if="examType.length > 0 && scope.row.type !== null">{{ examType.find(item => item.dictValue == |
|
|
|
scope.row.type).dictLabel || |
|
|
|
'' |
|
|
|
<span v-if="examType.length > 0 && scope.row.type !== null">{{ |
|
|
|
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 |
|
|
|
prop="createTime" |
|
|
|
align="center" |
|
|
|
sortable |
|
|
|
label="创建时间" |
|
|
|
> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="updateTime" align="center" sortable label="更新时间"> |
|
|
|
<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-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 |
|
|
|
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="closeDialog" :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> |
|
|
|
<el-dialog |
|
|
|
title="新增/编辑巡查项目" |
|
|
|
@close="closeDialog" |
|
|
|
: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"> |
|
|
|
<el-form |
|
|
|
:model="ruleForm" |
|
|
|
:rules="rules" |
|
|
|
ref="ruleForm" |
|
|
|
label-width="100px" |
|
|
|
> |
|
|
|
<el-form-item label-width="120px" label="巡视检查名称" prop="name"> |
|
|
|
<el-input style="width: 202px;" v-model="ruleForm.name"></el-input> |
|
|
|
<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-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-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-option label="其他" value="2"></el-option> |
|
|
|
</el-select> |
|
|
|
<span style="margin-left: 8px; color: red;">注意:切换选项后检查内容将会清空!</span> |
|
|
|
<span style="margin-left: 8px; color: red" |
|
|
|
>注意:切换选项后检查内容将会清空!</span |
|
|
|
> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-table height="350" :data="ruleForm.items" border> |
|
|
|
<el-table-column type="index" align="center" label="序号" center width="80"> |
|
|
|
<el-table-column |
|
|
|
type="index" |
|
|
|
align="center" |
|
|
|
label="序号" |
|
|
|
center |
|
|
|
width="80" |
|
|
|
> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column align="center" label="检查项目和内容" v-if="ruleForm.checkContentType != '2'"> |
|
|
|
<el-table-column |
|
|
|
align="center" |
|
|
|
label="检查项目和内容" |
|
|
|
v-if="ruleForm.checkContentType != '2'" |
|
|
|
> |
|
|
|
<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 |
|
|
|
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="检查部位" v-if="ruleForm.checkContentType != '2'"> |
|
|
|
<el-table-column |
|
|
|
align="center" |
|
|
|
label="检查部位" |
|
|
|
v-if="ruleForm.checkContentType != '2'" |
|
|
|
> |
|
|
|
<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 |
|
|
|
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="检查内容"> |
|
|
|
<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 && ruleForm.items.length < 50" |
|
|
|
@click="addPatrolItem(ruleForm.checkContentType)" type="text" size="small">添加</el-button> |
|
|
|
<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-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 |
|
|
|
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> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button size="mini" @click="dialogVisible = false">取 消</el-button> |
|
|
|
<el-button size="mini" type="primary" @click="submitForm('ruleForm')">保存</el-button> |
|
|
|
<el-button size="mini" type="primary" @click="submitForm('ruleForm')" |
|
|
|
>保存</el-button |
|
|
|
> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
@ -376,7 +508,6 @@ export default { |
|
|
|
width: 300px; |
|
|
|
margin-right: 10px; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.search-btn { |
|
|
@ -393,4 +524,4 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |
|
|
|
</style> |
|
|
|