5 changed files with 652 additions and 0 deletions
@ -0,0 +1,53 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
// 查询监管检查列表
|
|||
export function listInspections(query) { |
|||
return request({ |
|||
url: '/warn/inspections/list', |
|||
method: 'post', |
|||
data: query |
|||
}) |
|||
} |
|||
|
|||
// 查询监管检查详细
|
|||
export function getInspections(id) { |
|||
return request({ |
|||
url: '/warn/inspections/' + id, |
|||
method: 'get' |
|||
}) |
|||
} |
|||
|
|||
// 新增监管检查
|
|||
export function addInspections(data) { |
|||
return request({ |
|||
url: '/warn/inspections', |
|||
method: 'post', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 修改监管检查
|
|||
export function updateInspections(data) { |
|||
return request({ |
|||
url: '/warn/inspections', |
|||
method: 'put', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 删除监管检查
|
|||
export function delInspections(id) { |
|||
return request({ |
|||
url: '/warn/inspections/' + id, |
|||
method: 'delete' |
|||
}) |
|||
} |
|||
|
|||
// 导出监管检查
|
|||
export function exportInspections(query) { |
|||
return request({ |
|||
url: '/warn/inspections/export', |
|||
method: 'get', |
|||
params: query |
|||
}) |
|||
} |
@ -0,0 +1,81 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<el-timeline class="timeline"> |
|||
<el-timeline-item |
|||
class="lineitem" |
|||
v-for="(activity, index) in activities" |
|||
:key="index" |
|||
:icon="activity.icon" |
|||
:type="activity.type" |
|||
:color="activity.color" |
|||
:size="activity.size" |
|||
:timestamp="activity.timestamp" |
|||
> |
|||
{{ activity.content }} |
|||
</el-timeline-item> |
|||
</el-timeline> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
activities: [ |
|||
{ |
|||
content: "支持使用图标", |
|||
timestamp: "2018-04-12 20:46", |
|||
size: "large", |
|||
type: "primary", |
|||
icon: "el-icon-more", |
|||
}, |
|||
{ |
|||
content: "支持自定义颜色", |
|||
timestamp: "2018-04-03 20:46", |
|||
color: "#0bbd87", |
|||
}, |
|||
{ |
|||
content: "支持自定义尺寸", |
|||
timestamp: "2018-04-03 20:46", |
|||
size: "large", |
|||
}, |
|||
{ |
|||
content: "默认样式的节点", |
|||
timestamp: "2018-04-03 20:46", |
|||
}, |
|||
], |
|||
}; |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.timeline { |
|||
display: flex; |
|||
width: 95%; |
|||
margin: 40px auto; |
|||
.lineitem { |
|||
transform: translateX(50%); |
|||
width: 25%; |
|||
} |
|||
} |
|||
::v-deep { |
|||
.el-timeline-item__tail { |
|||
border-left: none; |
|||
border-top: 2px solid #e4e7ed; |
|||
width: 100%; |
|||
position: absolute; |
|||
top: 6px; |
|||
} |
|||
.el-timeline-item__wrapper { |
|||
padding-left: 0; |
|||
position: absolute; |
|||
top: 20px; |
|||
transform: translateX(-50%); |
|||
text-align: center; |
|||
} |
|||
.el-timeline-item__timestamp { |
|||
font-size: 14px; |
|||
} |
|||
} |
|||
</style> |
@ -0,0 +1,6 @@ |
|||
<template> |
|||
<!-- <div class="app-container"> --> |
|||
<div> |
|||
<router-view /> |
|||
</div> |
|||
</template> |
@ -0,0 +1,511 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<el-form |
|||
:model="queryParams" |
|||
ref="queryForm" |
|||
:inline="true" |
|||
v-show="showSearch" |
|||
label-width="68px" |
|||
> |
|||
<el-form-item |
|||
label="监督检查类型" |
|||
prop="inspectionTypes" |
|||
label-width="96px" |
|||
> |
|||
<el-select |
|||
v-model="queryParams.data.inspectionTypes" |
|||
placeholder="请选择监督检查类型" |
|||
clearable |
|||
size="small" |
|||
@change="handleQuery" |
|||
> |
|||
<el-option |
|||
v-for="dict in inspectionTypesOptions" |
|||
:key="dict.dictValue" |
|||
:label="dict.dictLabel" |
|||
:value="dict.dictValue" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="检查时间" prop="inspectionTime"> |
|||
<el-date-picker |
|||
clearable |
|||
size="small" |
|||
style="width: 200px" |
|||
v-model="queryParams.inspectionTime" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="选择检查时间" |
|||
@change="handleQuery" |
|||
> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
|
|||
<el-form-item> |
|||
<!-- <el-button |
|||
type="cyan" |
|||
icon="el-icon-search" |
|||
size="mini" |
|||
@click="handleQuery" |
|||
>搜索</el-button |
|||
> --> |
|||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery" |
|||
>重置</el-button |
|||
> |
|||
</el-form-item> |
|||
</el-form> |
|||
|
|||
<el-row :gutter="10" class="mb8"> |
|||
<el-col :span="1.5"> |
|||
<el-button |
|||
type="primary" |
|||
icon="el-icon-plus" |
|||
size="mini" |
|||
@click="handleAdd" |
|||
v-hasPermi="['warn:inspections:add']" |
|||
>新增</el-button |
|||
> |
|||
</el-col> |
|||
<el-col :span="1.5"> |
|||
<el-button |
|||
type="success" |
|||
icon="el-icon-edit" |
|||
size="mini" |
|||
:disabled="single" |
|||
@click="handleUpdate" |
|||
v-hasPermi="['warn:inspections:edit']" |
|||
>修改</el-button |
|||
> |
|||
</el-col> |
|||
<el-col :span="1.5"> |
|||
<el-button |
|||
type="danger" |
|||
icon="el-icon-delete" |
|||
size="mini" |
|||
:disabled="multiple" |
|||
@click="handleDelete" |
|||
v-hasPermi="['warn:inspections:remove']" |
|||
>删除</el-button |
|||
> |
|||
</el-col> |
|||
|
|||
<right-toolbar |
|||
:showSearch.sync="showSearch" |
|||
@queryTable="getList" |
|||
></right-toolbar> |
|||
</el-row> |
|||
|
|||
<el-table |
|||
v-loading="loading" |
|||
:data="inspectionsList" |
|||
@selection-change="handleSelectionChange" |
|||
> |
|||
<el-table-column type="selection" width="55" align="center" fixed /> |
|||
<el-table-column |
|||
label="序号" |
|||
type="index" |
|||
width="50" |
|||
align="center" |
|||
fixed |
|||
/> |
|||
|
|||
<el-table-column |
|||
label="监督检查类型" |
|||
align="center" |
|||
prop="inspectionTypes" |
|||
:formatter="inspectionTypesFormat" |
|||
min-width="120" |
|||
/> |
|||
<el-table-column |
|||
label="检查时间" |
|||
align="center" |
|||
prop="inspectionTime" |
|||
min-width="120" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<span>{{ parseTime(scope.row.inspectionTime, "{y}-{m}-{d}") }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
label="检查人" |
|||
align="center" |
|||
prop="inspectionPerson" |
|||
min-width="120" |
|||
/> |
|||
<el-table-column |
|||
label="通知文件" |
|||
align="center" |
|||
prop="noticeAttachment" |
|||
min-width="120" |
|||
/> |
|||
<el-table-column |
|||
label="检查表" |
|||
align="center" |
|||
prop="checklist" |
|||
min-width="120" |
|||
/> |
|||
<el-table-column |
|||
label="整改报告" |
|||
align="center" |
|||
prop="rectificationReport" |
|||
min-width="120" |
|||
/> |
|||
<el-table-column |
|||
label="操作" |
|||
align="center" |
|||
class-name="small-padding fixed-width" |
|||
width="180" |
|||
fixed="right" |
|||
> |
|||
<template slot-scope="scope"> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-edit" |
|||
@click="handleUpdate(scope.row)" |
|||
v-hasPermi="['warn:inspections:edit']" |
|||
>修改</el-button |
|||
> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-delete" |
|||
@click="handleDelete(scope.row)" |
|||
v-hasPermi="['warn:inspections:remove']" |
|||
>删除</el-button |
|||
> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
|
|||
<pagination |
|||
v-show="total > 0" |
|||
:total="total" |
|||
:page.sync="queryParams.pageNum" |
|||
:limit.sync="queryParams.pageSize" |
|||
@pagination="getList" |
|||
/> |
|||
|
|||
<!-- 添加或修改监管检查对话框 --> |
|||
<el-dialog |
|||
:title="title" |
|||
:visible.sync="open" |
|||
width="1200px" |
|||
append-to-body |
|||
:close-on-click-modal="false" |
|||
> |
|||
<el-form ref="form" :model="form" :rules="rules" label-width="110px"> |
|||
<el-form-item label="监督检查类型" prop="inspectionTypes"> |
|||
<el-select |
|||
v-model="form.inspectionTypes" |
|||
placeholder="请选择监督检查类型" |
|||
style="width: 100%" |
|||
> |
|||
<el-option |
|||
v-for="dict in inspectionTypesOptions" |
|||
:key="dict.dictValue" |
|||
:label="dict.dictLabel" |
|||
:value="dict.dictValue" |
|||
></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="检查时间" prop="inspectionTime"> |
|||
<el-date-picker |
|||
clearable |
|||
size="small" |
|||
style="width: 100%" |
|||
v-model="form.inspectionTime" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="选择检查时间" |
|||
> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label="检查人" prop="inspectionPerson"> |
|||
<el-input |
|||
v-model="form.inspectionPerson" |
|||
placeholder="请输入检查人" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="通知文件" prop="noticeAttachment"> |
|||
<el-input |
|||
v-model="form.noticeAttachment" |
|||
placeholder="请输入通知文件" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="检查表" prop="checklist"> |
|||
<el-input v-model="form.checklist" placeholder="请输入检查表" /> |
|||
</el-form-item> |
|||
<el-form-item label="整改报告" prop="rectificationReport"> |
|||
<el-input |
|||
v-model="form.rectificationReport" |
|||
placeholder="请输入整改报告" |
|||
/> |
|||
</el-form-item> |
|||
</el-form> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button type="primary" @click="submitForm">确 定</el-button> |
|||
<el-button @click="cancel">取 消</el-button> |
|||
</div> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
listInspections, |
|||
getInspections, |
|||
delInspections, |
|||
addInspections, |
|||
updateInspections, |
|||
exportInspections, |
|||
} from "@/api/warn/inspections"; |
|||
|
|||
export default { |
|||
name: "Inspections", |
|||
data() { |
|||
return { |
|||
// 遮罩层 |
|||
loading: true, |
|||
// 选中数组 |
|||
ids: [], |
|||
// 非单个禁用 |
|||
single: true, |
|||
// 非多个禁用 |
|||
multiple: true, |
|||
// 显示搜索条件 |
|||
showSearch: true, |
|||
// 总条数 |
|||
total: 0, |
|||
// 监管检查表格数据 |
|||
inspectionsList: [], |
|||
// 弹出层标题 |
|||
title: "", |
|||
// 是否显示弹出层 |
|||
open: false, |
|||
// 监督检查类型字典 |
|||
inspectionTypesOptions: [], |
|||
// 查询参数 |
|||
queryParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
ids: null, |
|||
data: { |
|||
inspectionTypes: null, |
|||
inspectionTime: null, |
|||
inspectionPerson: null, |
|||
noticeAttachment: null, |
|||
checklist: null, |
|||
rectificationReport: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
owerDept: null, |
|||
proCode: null, |
|||
proNo: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sortBy: "desc", |
|||
}, |
|||
}, |
|||
// 表单参数 |
|||
form: {}, |
|||
// 表单校验 |
|||
rules: {}, |
|||
}; |
|||
}, |
|||
created() { |
|||
this.getList(); |
|||
this.getDicts("supervisory_inspection_type").then((response) => { |
|||
this.inspectionTypesOptions = response.data; |
|||
}); |
|||
}, |
|||
methods: { |
|||
/** 查询监管检查列表 */ |
|||
getList() { |
|||
this.loading = true; |
|||
listInspections(this.queryParams).then((response) => { |
|||
this.inspectionsList = response.records; |
|||
this.total = response.total; |
|||
this.loading = false; |
|||
}); |
|||
}, |
|||
// 监督检查类型字典翻译 |
|||
inspectionTypesFormat(row, column) { |
|||
return this.selectDictLabel( |
|||
this.inspectionTypesOptions, |
|||
row.inspectionTypes |
|||
); |
|||
}, |
|||
// 取消按钮 |
|||
cancel() { |
|||
this.open = false; |
|||
this.reset(); |
|||
}, |
|||
// 表单重置 |
|||
reset() { |
|||
this.form = { |
|||
id: null, |
|||
inspectionTypes: null, |
|||
inspectionTime: null, |
|||
inspectionPerson: null, |
|||
noticeAttachment: null, |
|||
checklist: null, |
|||
rectificationReport: null, |
|||
createTime: null, |
|||
updateTime: null, |
|||
remark: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
owerDept: null, |
|||
proCode: null, |
|||
proNo: null, |
|||
}; |
|||
this.resetForm("form"); |
|||
}, |
|||
// 查询表单重置 |
|||
resetQueryForm() { |
|||
this.queryParams = { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
data: { |
|||
id: null, |
|||
inspectionTypes: null, |
|||
inspectionTime: null, |
|||
inspectionPerson: null, |
|||
noticeAttachment: null, |
|||
checklist: null, |
|||
rectificationReport: null, |
|||
createTime: null, |
|||
updateTime: null, |
|||
remark: null, |
|||
createUid: null, |
|||
updateUid: null, |
|||
owerDept: null, |
|||
proCode: null, |
|||
proNo: null, |
|||
}, |
|||
// 排序方式 |
|||
params: { |
|||
// 按哪个字段排序 |
|||
orderBy: "create_time", |
|||
// desc降序,升序asc |
|||
sort: "desc", |
|||
}, |
|||
}; |
|||
this.resetForm("form"); |
|||
}, |
|||
/** 搜索按钮操作 */ |
|||
handleQuery() { |
|||
this.queryParams.pageNum = 1; |
|||
this.getList(); |
|||
}, |
|||
/** 重置按钮操作 */ |
|||
resetQuery() { |
|||
this.resetQueryForm(); |
|||
this.handleQuery(); |
|||
}, |
|||
// 多选框选中数据 |
|||
handleSelectionChange(selection) { |
|||
this.ids = selection.map((item) => item.id); |
|||
this.single = selection.length !== 1; |
|||
this.multiple = !selection.length; |
|||
}, |
|||
/** 新增按钮操作 */ |
|||
handleAdd() { |
|||
this.reset(); |
|||
this.open = true; |
|||
this.title = "添加监管检查"; |
|||
}, |
|||
/** 修改按钮操作 */ |
|||
handleUpdate(row) { |
|||
this.reset(); |
|||
const id = row.id || this.ids; |
|||
getInspections(id).then((response) => { |
|||
this.form = response.data; |
|||
this.open = true; |
|||
this.title = "修改监管检查"; |
|||
}); |
|||
}, |
|||
/** 提交按钮 */ |
|||
submitForm() { |
|||
this.$refs["form"].validate((valid) => { |
|||
if (valid) { |
|||
if (this.form.id != null) { |
|||
updateInspections(this.form).then((response) => { |
|||
if (response.code === 200) { |
|||
this.msgSuccess("修改成功"); |
|||
this.open = false; |
|||
this.getList(); |
|||
} |
|||
}); |
|||
} else { |
|||
addInspections(this.form).then((response) => { |
|||
if (response.code === 200) { |
|||
this.msgSuccess("新增成功"); |
|||
this.open = false; |
|||
this.getList(); |
|||
} |
|||
}); |
|||
} |
|||
} |
|||
}); |
|||
}, |
|||
/** 删除按钮操作 */ |
|||
handleDelete(row) { |
|||
const ids = row.id || this.ids; |
|||
if (ids) { |
|||
this.$confirm("是否删除选中的数据?", "警告", { |
|||
confirmButtonText: "确定", |
|||
cancelButtonText: "取消", |
|||
type: "warning", |
|||
}) |
|||
.then(function () { |
|||
return delInspections(ids); |
|||
}) |
|||
.then(() => { |
|||
this.getList(); |
|||
this.msgSuccess("删除成功"); |
|||
}) |
|||
.catch(function () {}); |
|||
} else { |
|||
this.$message.warning("请选择要删除的数据!!"); |
|||
} |
|||
}, |
|||
/** 导出按钮操作 */ |
|||
handleExport() { |
|||
const queryParams = this.queryParams; |
|||
let message = "是否确认导出所有的数据项?"; |
|||
if (this.ids) { |
|||
message = "是否确认导出选中的数据项?"; |
|||
queryParams.ids = this.ids; |
|||
} |
|||
this.$confirm(message, "警告", { |
|||
confirmButtonText: "确定", |
|||
cancelButtonText: "取消", |
|||
type: "warning", |
|||
}) |
|||
.then(function () { |
|||
return exportInspections(queryParams); |
|||
}) |
|||
.then((response) => { |
|||
this.downloadFile(response, true, response.msg); |
|||
// this.download(response.msg); |
|||
}) |
|||
.catch(function () {}); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
@import "@/assets/css/dialog.scss"; |
|||
//::v-deep { |
|||
// .el-dialog { |
|||
// margin-top: 10vh !important; |
|||
// } |
|||
//} |
|||
</style> |
Loading…
Reference in new issue