New file |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form-item label="运维人员" prop="peopleId"> |
| | | <el-input |
| | | v-model="queryParams.peopleId" |
| | | placeholder="运维人员姓名" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="点位" prop="pointId"> |
| | | <el-input |
| | | v-model="queryParams.pointId" |
| | | placeholder="点位" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="报备时间"> |
| | | <el-date-picker |
| | | v-model="daterangeCreateTime" |
| | | style="width: 240px" |
| | | value-format="yyyy-MM-dd" |
| | | type="daterange" |
| | | range-separator="-" |
| | | start-placeholder="开始日期" |
| | | end-placeholder="结束日期" |
| | | ></el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" 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" |
| | | plain |
| | | icon="el-icon-plus" |
| | | size="mini" |
| | | @click="handleAdd" |
| | | >新增</el-button> |
| | | </el-col> |
| | | <!-- <el-col :span="1.5">--> |
| | | <!-- <el-button--> |
| | | <!-- type="success"--> |
| | | <!-- plain--> |
| | | <!-- icon="el-icon-edit"--> |
| | | <!-- size="mini"--> |
| | | <!-- :disabled="single"--> |
| | | <!-- @click="handleUpdate"--> |
| | | <!-- >修改</el-button>--> |
| | | <!-- </el-col>--> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | icon="el-icon-delete" |
| | | size="mini" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | >删除</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | icon="el-icon-download" |
| | | size="mini" |
| | | @click="handleExport" |
| | | >导出</el-button> |
| | | </el-col> |
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <el-table v-loading="loading" :data="reportList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="运维单位" align="center" prop="unitName" /> |
| | | <el-table-column label="报备人员" align="center" prop="peopleName" /> |
| | | <el-table-column label="点位" align="center" prop="pointName" /> |
| | | <el-table-column label="报备内容" align="center" prop="reportContent" /> |
| | | <el-table-column label="上报材料" align="center" prop="reportMaterials" /> |
| | | <el-table-column label="故障类型" align="center" prop="errorType" /> |
| | | <el-table-column label="审核时间" align="center" prop="auditingTime" width="180"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ parseTime(scope.row.auditingTime, '{y}-{m}-{d}') }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | | <!-- <el-button--> |
| | | <!-- size="mini"--> |
| | | <!-- type="text"--> |
| | | <!-- icon="el-icon-edit"--> |
| | | <!-- @click="handleUpdate(scope.row)"--> |
| | | <!-- v-hasPermi="['system:report:edit']"--> |
| | | <!-- >修改</el-button>--> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleAuditing(scope.row)" |
| | | v-hasPermi="['system:report:auditing']" |
| | | >审核</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['system:report: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="600px" append-to-body> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
| | | <el-form-item label="点位" prop="pointId"> |
| | | <el-select |
| | | v-model="form.pointId" |
| | | filterable |
| | | remote |
| | | reserve-keyword |
| | | placeholder="请选择点位" |
| | | :remote-method="remoteGetPoints" |
| | | :loading="selectLoading"> |
| | | <el-option |
| | | v-for="item in pointList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="故障类型" prop="errorType"> |
| | | <el-select v-model="form.errorType"> |
| | | <el-option label="市政施工" value="市政施工"/> |
| | | <el-option label="设备故障" value="设备故障"/> |
| | | <el-option label="设备遗失" value="设备遗失"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="报备内容" prop="reportContent"> |
| | | <editor v-model="form.reportContent" :min-height="192"/> |
| | | </el-form-item> |
| | | <el-form-item label="上报材料" prop="reportMaterials"> |
| | | <file-upload v-model="form.reportMaterials"/> |
| | | </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> |
| | | |
| | | |
| | | <!-- 审核报备 --> |
| | | <el-dialog title="报备审核" :visible.sync="auditingOpen" width="500px" append-to-body> |
| | | <el-form ref="form" :model="auditingForm" :rules="auditingRules" label-width="80px"> |
| | | <el-form-item label="点位"> |
| | | <el-input v-model="auditingForm.pointName" disabled /> |
| | | </el-form-item> |
| | | <el-form-item label="运维单位"> |
| | | <el-input v-model="auditingForm.unitName" disabled /> |
| | | </el-form-item> |
| | | <el-form-item label="报备人员"> |
| | | <el-input v-model="auditingForm.peopleName" disabled /> |
| | | </el-form-item> |
| | | <el-form-item label="故障类型"> |
| | | <el-input v-model="auditingForm.errorType" disabled /> |
| | | </el-form-item> |
| | | <el-form-item label="报备内容"> |
| | | <el-input v-model="auditingForm.pointName" disabled /> |
| | | </el-form-item> |
| | | <el-form-item label="审核结果" prop="auditing"> |
| | | <el-radio v-model="auditingForm.auditing" label="pass">通过</el-radio> |
| | | <el-radio v-model="auditingForm.auditing" label="reject">驳回</el-radio> |
| | | </el-form-item> |
| | | <el-form-item label="审核意见" prop="suggest"> |
| | | <el-input v-model="auditingForm.suggest"/> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary">确 定</el-button> |
| | | <el-button @click="auditingCancel">取 消</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { listReport, getReport, delReport, addReport, updateReport } from "@/api/platform/report"; |
| | | import { pointSelectData } from "@/api/platform/point"; |
| | | |
| | | export default { |
| | | name: "Report", |
| | | data() { |
| | | return { |
| | | // 点位list |
| | | pointList: [], |
| | | // 遮罩层 |
| | | loading: true, |
| | | // 下拉加载 |
| | | selectLoading: false, |
| | | // 选中数组 |
| | | ids: [], |
| | | // 非单个禁用 |
| | | single: true, |
| | | // 非多个禁用 |
| | | multiple: true, |
| | | // 显示搜索条件 |
| | | showSearch: true, |
| | | // 总条数 |
| | | total: 0, |
| | | // 报备表格数据 |
| | | reportList: [], |
| | | // 弹出层标题 |
| | | title: "", |
| | | // 是否显示弹出层 |
| | | open: false, |
| | | // 故障类型时间范围 |
| | | daterangeCreateTime: [], |
| | | // 故障类型时间范围 |
| | | daterangeAuditingTime: [], |
| | | auditingOpen: false, |
| | | auditingForm: { |
| | | id: null, |
| | | unitName: "", |
| | | pointName: "", |
| | | peopleName: "", |
| | | errorType: "", |
| | | reportContent: "", |
| | | auditing: "", |
| | | suggest: "" |
| | | }, |
| | | // 查询参数 |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | unitId: null, |
| | | peopleId: null, |
| | | pointId: null, |
| | | createTime: null, |
| | | auditingTime: null, |
| | | errorType: null |
| | | }, |
| | | // 表单参数 |
| | | form: {}, |
| | | auditingRules: { |
| | | auditing: [ |
| | | { required: true, message: "请做出审核结果", trigger: "blur" } |
| | | ], |
| | | }, |
| | | // 表单校验 |
| | | rules: { |
| | | pointId: [ |
| | | { required: true, message: "点位不能为空", trigger: "blur" } |
| | | ], |
| | | reportContent: [ |
| | | { required: true, message: "报备内容不能为空", trigger: "blur" } |
| | | ], |
| | | reportMaterials: [ |
| | | { required: true, message: "上报材料不能为空", trigger: "blur" } |
| | | ], |
| | | } |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getList(); |
| | | }, |
| | | methods: { |
| | | auditingCancel() { |
| | | this.auditingOpen = false |
| | | }, |
| | | handleAuditing(row) { |
| | | this.auditingOpen = true; |
| | | this.auditingForm.id =row.id |
| | | this.auditingForm.pointName =row.pointName |
| | | this.auditingForm.unitName =row.unitName |
| | | this.auditingForm.peopleName =row.peopleName |
| | | this.auditingForm.errorType =row.errorType |
| | | this.auditingForm.reportContent =row.reportContent |
| | | }, |
| | | // 远程搜索点位 |
| | | remoteGetPoints(query) { |
| | | if (query !== '') { |
| | | this.selectLoading = true; |
| | | let data = { |
| | | "keyword": query |
| | | } |
| | | pointSelectData(data).then(res => { |
| | | this.pointList = res.data; |
| | | this.selectLoading = false; |
| | | }) |
| | | } else { |
| | | this.pointList = []; |
| | | } |
| | | }, |
| | | /** 查询报备列表 */ |
| | | getList() { |
| | | this.loading = true; |
| | | if (null != this.daterangeCreateTime && '' != this.daterangeCreateTime) { |
| | | this.queryParams["beginCreateTime"] = this.daterangeCreateTime[0]; |
| | | this.queryParams["endCreateTime"] = this.daterangeCreateTime[1]; |
| | | } |
| | | if (null != this.daterangeAuditingTime && '' != this.daterangeAuditingTime) { |
| | | this.queryParams["beginAuditingTime"] = this.daterangeAuditingTime[0]; |
| | | this.queryParams["endAuditingTime"] = this.daterangeAuditingTime[1]; |
| | | } |
| | | listReport(this.queryParams).then(response => { |
| | | this.reportList = response.data; |
| | | this.total = response.total; |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | // 取消按钮 |
| | | cancel() { |
| | | this.open = false; |
| | | this.reset(); |
| | | }, |
| | | // 表单重置 |
| | | reset() { |
| | | this.form = { |
| | | id: null, |
| | | unitId: null, |
| | | peopleId: null, |
| | | pointId: null, |
| | | createTime: null, |
| | | updateTime: null, |
| | | auditingTime: null, |
| | | reportContent: null, |
| | | reportMaterials: null, |
| | | deleted: null, |
| | | errorType: null |
| | | }; |
| | | this.resetForm("form"); |
| | | }, |
| | | /** 搜索按钮操作 */ |
| | | handleQuery() { |
| | | this.queryParams.pageNum = 1; |
| | | this.getList(); |
| | | }, |
| | | /** 重置按钮操作 */ |
| | | resetQuery() { |
| | | this.daterangeCreateTime = []; |
| | | this.daterangeAuditingTime = []; |
| | | this.resetForm("queryForm"); |
| | | 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 |
| | | getReport(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) { |
| | | updateReport(this.form).then(response => { |
| | | this.$modal.msgSuccess("修改成功"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } else { |
| | | addReport(this.form).then(response => { |
| | | this.$modal.msgSuccess("新增成功"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | /** 删除按钮操作 */ |
| | | handleDelete(row) { |
| | | const ids = row.id || this.ids; |
| | | this.$modal.confirm('是否确认删除报备编号为"' + ids + '"的数据项?').then(function() { |
| | | return delReport(ids); |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.$modal.msgSuccess("删除成功"); |
| | | }).catch(() => {}); |
| | | }, |
| | | /** 导出按钮操作 */ |
| | | handleExport() { |
| | | this.download('system/report/export', { |
| | | ...this.queryParams |
| | | }, `report_${new Date().getTime()}.xlsx`) |
| | | } |
| | | } |
| | | }; |
| | | </script> |