|
@@ -0,0 +1,721 @@
|
|
|
+<template>
|
|
|
+ <div class="app-container">
|
|
|
+ <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
+ <el-form-item label="装置名称" prop="plantCode">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.plantCode"
|
|
|
+ placeholder="请输入装置名称"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="检查日期" prop="checkDate">
|
|
|
+ <el-date-picker clearable size="small" style="width: 200px"
|
|
|
+ v-model="queryParams.checkDate"
|
|
|
+ type="date"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ placeholder="选择检查日期">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="人员" prop="cPerson">
|
|
|
+ <el-select v-model="queryParams.cPerson" placeholder="请选择人员" clearable size="small">
|
|
|
+ <el-option label="请选择字典生成" value="" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="设备本体" prop="cDevice">
|
|
|
+ <el-select v-model="queryParams.cDevice" placeholder="请选择设备本体" clearable size="small">
|
|
|
+ <el-option label="√" value="√" />
|
|
|
+ <el-option label="×" value="×" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="安全附件" prop="cSafety">
|
|
|
+ <el-select v-model="queryParams.cSafety" placeholder="请选择安全附件" clearable size="small">
|
|
|
+ <el-option label="请选择字典生成" value="" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="环境" prop="cEnv">
|
|
|
+ <el-select v-model="queryParams.cEnv" placeholder="请选择环境" clearable size="small">
|
|
|
+ <el-option label="请选择字典生成" value="" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="政府" prop="cGov">
|
|
|
+ <el-select v-model="queryParams.cGov" placeholder="请选择政府" clearable size="small">
|
|
|
+ <el-option label="请选择字典生成" value="" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="投诉举报" prop="cComplaint">
|
|
|
+ <el-select v-model="queryParams.cComplaint" placeholder="请选择投诉举报" clearable size="small">
|
|
|
+ <el-option label="请选择字典生成" value="" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="舆情信息" prop="cOpinion">
|
|
|
+ <el-select v-model="queryParams.cOpinion" placeholder="请选择舆情信息" clearable size="small">
|
|
|
+ <el-option label="请选择字典生成" value="" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="其他" prop="cOther">
|
|
|
+ <el-select v-model="queryParams.cOther" placeholder="请选择其他" clearable size="small">
|
|
|
+ <el-option label="请选择字典生成" value="" />
|
|
|
+ </el-select>
|
|
|
+ </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="['safecheck:dailycheck: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="['safecheck:dailycheck: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="['safecheck:dailycheck:remove']"
|
|
|
+ >删除</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="info"
|
|
|
+ icon="el-icon-upload2"
|
|
|
+ size="mini"
|
|
|
+ @click="handleImport"
|
|
|
+ v-hasPermi="['safecheck:dailycheck:edit']"
|
|
|
+ >导入</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="warning"
|
|
|
+ icon="el-icon-download"
|
|
|
+ size="mini"
|
|
|
+ @click="handleExport"
|
|
|
+ v-hasPermi="['safecheck:dailycheck:export']"
|
|
|
+ >导出</el-button>
|
|
|
+ </el-col>
|
|
|
+ <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-table v-loading="loading" :data="dailycheckList" @selection-change="handleSelectionChange" :height="clientHeight" border>
|
|
|
+ <el-table-column type="selection" width="55" align="center" />
|
|
|
+ <el-table-column label="装置名称" align="center" prop="plantCode" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column label="检查日期" align="center" prop="checkDate" width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ parseTime(scope.row.checkDate, '{y}-{m}-{d}') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="安全员" align="center" prop="checkerName" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column label="人员" align="center" prop="cPerson" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column label="设备本体" align="center" prop="cDevice" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column label="安全附件" align="center" prop="cSafety" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column label="环境" align="center" prop="cEnv" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column label="政府" align="center" prop="cGov" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column label="投诉举报" align="center" prop="cComplaint" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column label="舆情信息" align="center" prop="cOpinion" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column label="其他" align="center" prop="cOther" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column label="说明" align="center" prop="explain" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column label="操作" align="center" fixed="right" width="120" 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="['safecheck:dailycheck:edit']"
|
|
|
+ >修改</el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ @click="handleDelete(scope.row)"
|
|
|
+ v-hasPermi="['safecheck:dailycheck:remove']"
|
|
|
+ >删除</el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-document"
|
|
|
+ @click="wordView(scope.row)"
|
|
|
+ >预览
|
|
|
+ </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="900px" append-to-body>
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
+ <el-form-item :label="$t('装置')" prop="plantCode">
|
|
|
+ <el-select v-model="form.plantCode" :placeholder="$t('请选择')+ $t('装置')" filterable clearable size="small"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="dict in plantOptions"
|
|
|
+ :key="dict.name"
|
|
|
+ :label="dict.name"
|
|
|
+ :value="dict.name"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="检查日期" prop="checkDate">
|
|
|
+ <el-date-picker clearable size="small" style="width: 200px"
|
|
|
+ v-model="form.checkDate"
|
|
|
+ type="date"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ placeholder="选择检查日期">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <div class="checklist-table">
|
|
|
+ <table cellpadding="10" cellspacing="0" border="1" style="width:100%">
|
|
|
+ <tr>
|
|
|
+ <th>序号</th>
|
|
|
+ <th>检查项目</th>
|
|
|
+ <th>检查内容</th>
|
|
|
+ <th>检查结果</th>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td>1</td>
|
|
|
+ <td>人员</td>
|
|
|
+ <td>按检查项目细化,如:人员配备、违章作业、安全教育等</td>
|
|
|
+ <td >
|
|
|
+ <el-radio-group v-model="form.cPerson">
|
|
|
+ <el-radio label="√">√</el-radio>
|
|
|
+ <el-radio label="×">X</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td>2</td>
|
|
|
+ <td>设备本体</td>
|
|
|
+ <td>设备定期检验、自行检查、设备本体、安全附件、安全保护装置、有无事故隐患等</td>
|
|
|
+ <td style="width: 150px;">
|
|
|
+ <div class="radio-group-horizontal">
|
|
|
+ <el-radio-group v-model="form.cDevice">
|
|
|
+ <el-radio label="√">√</el-radio>
|
|
|
+ <el-radio label="×">X</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td>3</td>
|
|
|
+ <td>安全附件或安全保护装置</td>
|
|
|
+ <td>安全阀、爆破片、紧急切断阀、压力表、液位计、壁温测试仪表、阻火器等</td>
|
|
|
+ <td>
|
|
|
+ <el-radio-group v-model="form.cSafety">
|
|
|
+ <el-radio label="√">√</el-radio>
|
|
|
+ <el-radio label="×">X</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td>4</td>
|
|
|
+ <td>环境</td>
|
|
|
+ <td>安全通道、照明、防火、防雷、防风、防雨、防冻、防腐设施以及警示标志、排放口、的设置等</td>
|
|
|
+ <td>
|
|
|
+ <el-radio-group v-model="form.cEnv">
|
|
|
+ <el-radio label="√">√</el-radio>
|
|
|
+ <el-radio label="×">X</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td>5</td>
|
|
|
+ <td>政府监督、通报、预警</td>
|
|
|
+ <td>发现不合格项</td>
|
|
|
+ <td>
|
|
|
+ <el-radio-group v-model="form.cGov">
|
|
|
+ <el-radio label="√">√</el-radio>
|
|
|
+ <el-radio label="×">X</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td>6</td>
|
|
|
+ <td>投诉举报</td>
|
|
|
+ <td>发现不合格项</td>
|
|
|
+ <td>
|
|
|
+ <el-radio-group v-model="form.cComplaint">
|
|
|
+ <el-radio label="√">√</el-radio>
|
|
|
+ <el-radio label="×">X</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td>7</td>
|
|
|
+ <td>舆情信息</td>
|
|
|
+ <td>发现不合格项</td>
|
|
|
+ <td>
|
|
|
+ <el-radio-group v-model="form.cOpinion">
|
|
|
+ <el-radio label="√">√</el-radio>
|
|
|
+ <el-radio label="×">X</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td>8</td>
|
|
|
+ <td>其它</td>
|
|
|
+ <td>锅炉、压力容器、压力管道、电梯、起重机械场车六大类特种设备可能危及安全的其它情况</td>
|
|
|
+ <td>
|
|
|
+ <el-radio-group v-model="form.cOther">
|
|
|
+ <el-radio label="√">√</el-radio>
|
|
|
+ <el-radio label="×">X</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+<!-- <td colspan="4">-->
|
|
|
+<!-- 不合格情况说明及采取的防范措施:-->
|
|
|
+<!-- <el-form-item label="不合格情况说明及采取的防范措施:" prop="explain">-->
|
|
|
+<!-- <el-input v-model="form.explain" type="textarea" placeholder="请输入内容" />-->
|
|
|
+<!-- </el-form-item>-->
|
|
|
+<!-- </td>-->
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ <el-form-item label="不合格情况说明及采取的防范措施" prop="explain">
|
|
|
+ <el-input v-model="form.explain" :rows="5" type="textarea" 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>
|
|
|
+ <!-- 用户导入对话框 -->
|
|
|
+ <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
|
|
+ <el-upload
|
|
|
+ ref="upload"
|
|
|
+ :limit="1"
|
|
|
+ accept=".xlsx, .xls"
|
|
|
+ :headers="upload.headers"
|
|
|
+ :action="upload.url + '?updateSupport=' + upload.updateSupport"
|
|
|
+ :disabled="upload.isUploading"
|
|
|
+ :on-progress="handleFileUploadProgress"
|
|
|
+ :on-success="handleFileSuccess"
|
|
|
+ :auto-upload="false"
|
|
|
+ drag
|
|
|
+ >
|
|
|
+ <i class="el-icon-upload"></i>
|
|
|
+ <div class="el-upload__text">
|
|
|
+ 将文件拖到此处,或
|
|
|
+ <em>点击上传</em>
|
|
|
+ </div>
|
|
|
+ <div class="el-upload__tip" slot="tip">
|
|
|
+ <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
|
|
|
+ <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
|
|
|
+ </div>
|
|
|
+ <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
|
|
|
+ </el-upload>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitFileForm">确 定</el-button>
|
|
|
+ <el-button @click="upload.open = false">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog :close-on-click-modal="false" v-loading="loadingFlash" element-loading-background="rgba(0,0,0,0.2)" v-dialogDrag :title="pdf.title"
|
|
|
+ :visible.sync="pdf.open" width="1300px" :center="true" append-to-body>
|
|
|
+ <div style="margin-top: -60px;float: right;margin-right: 40px;">
|
|
|
+ <el-button size="mini" type="text" @click="openPdf">{{ $t('新页面打开PDF') }}</el-button>
|
|
|
+ </div>
|
|
|
+ <div style="margin-top: -30px">
|
|
|
+ <iframe id="iFrame" class="iframe-html" :src="pdf.pdfUrl" frameborder="0" width="100%" height="700px"
|
|
|
+ v-if="ppt"></iframe>
|
|
|
+ </div>
|
|
|
+ <div style="padding: 30px; width: 100%; height: 100%;">
|
|
|
+ <el-carousel class="" ref="carousel" arrow="always" v-if="pptView"
|
|
|
+ height="700px" trigger="click" :autoplay="false" indicator-position="outside">
|
|
|
+ <el-carousel-item class="lun_img" v-for="item in imgs" v-bind:key="item">
|
|
|
+ <img :src="item" width="100%" height="100%" object-fit="cover"/>
|
|
|
+ </el-carousel-item>
|
|
|
+ </el-carousel>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import {wordView, listDailycheck, getDailycheck, delDailycheck, addDailycheck, updateDailycheck, exportDailycheck, importTemplate} from "@/api/sems/safecheck/dailycheck";
|
|
|
+import { treeselect } from "@/api/system/dept";
|
|
|
+import { getToken } from "@/utils/auth";
|
|
|
+import Treeselect from "@riophae/vue-treeselect";
|
|
|
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
+import {mylistPlant} from "@/api/system/plant";
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: "Dailycheck",
|
|
|
+ components: { Treeselect },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ // 遮罩层
|
|
|
+ loading: true,
|
|
|
+ // 选中数组
|
|
|
+ ids: [],
|
|
|
+ // 非单个禁用
|
|
|
+ single: true,
|
|
|
+ // 非多个禁用
|
|
|
+ multiple: true,
|
|
|
+ // 显示搜索条件
|
|
|
+ showSearch: false,
|
|
|
+ // 总条数
|
|
|
+ total: 0,
|
|
|
+ // 每日安全检查表格数据
|
|
|
+ dailycheckList: [],
|
|
|
+ // 弹出层标题
|
|
|
+ title: "",
|
|
|
+ pptView: false,
|
|
|
+ ppt: false,
|
|
|
+ loadingFlash: false,
|
|
|
+ // 部门树选项
|
|
|
+ deptOptions: undefined,
|
|
|
+ plantOptions: [],
|
|
|
+ clientHeight:300,
|
|
|
+ // 是否显示弹出层
|
|
|
+ open: false,
|
|
|
+ // 用户导入参数
|
|
|
+ upload: {
|
|
|
+ // 是否显示弹出层(用户导入)
|
|
|
+ open: false,
|
|
|
+ // 弹出层标题(用户导入)
|
|
|
+ title: "",
|
|
|
+ // 是否禁用上传
|
|
|
+ isUploading: false,
|
|
|
+ // 是否更新已经存在的用户数据
|
|
|
+ updateSupport: 0,
|
|
|
+ // 设置上传的请求头部
|
|
|
+ headers: { Authorization: "Bearer " + getToken() },
|
|
|
+ // 上传的地址
|
|
|
+ url: process.env.VUE_APP_BASE_API + "/safecheck/dailycheck/importData"
|
|
|
+ },
|
|
|
+ pdf: {
|
|
|
+ title: '',
|
|
|
+ pdfUrl: '',
|
|
|
+ numPages: null,
|
|
|
+ open: false,
|
|
|
+ pageNum: 1,
|
|
|
+ pageTotalNum: 1,
|
|
|
+ loadedRatio: 0,
|
|
|
+ },
|
|
|
+ // 查询参数
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 20,
|
|
|
+ plantCode: null,
|
|
|
+ checkDate: null,
|
|
|
+ cPerson: null,
|
|
|
+ cDevice: null,
|
|
|
+ cSafety: null,
|
|
|
+ cEnv: null,
|
|
|
+ cGov: null,
|
|
|
+ cComplaint: null,
|
|
|
+ cOpinion: null,
|
|
|
+ cOther: null,
|
|
|
+ explain: null
|
|
|
+ },
|
|
|
+ // 表单参数
|
|
|
+ form: {},
|
|
|
+ // 表单校验
|
|
|
+ rules: {
|
|
|
+ plantCode: [
|
|
|
+ { required: true, message: "装置名称不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ // 根据名称筛选部门树
|
|
|
+ deptName(val) {
|
|
|
+ this.$refs.tree.filter(val);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ //设置表格高度对应屏幕高度
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.clientHeight = document.body.clientHeight -250
|
|
|
+ })
|
|
|
+ this.getList();
|
|
|
+ this.getTreeselect();
|
|
|
+ let plantParams = {
|
|
|
+ pType: 1
|
|
|
+ }
|
|
|
+ mylistPlant(plantParams).then(response => {
|
|
|
+ this.plantOptions = response.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ /** 查询每日安全检查列表 */
|
|
|
+ getList() {
|
|
|
+ this.loading = true;
|
|
|
+ listDailycheck(this.queryParams).then(response => {
|
|
|
+ this.dailycheckList = response.rows;
|
|
|
+ this.total = response.total;
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 查询部门下拉树结构 */
|
|
|
+ getTreeselect() {
|
|
|
+ treeselect().then(response => {
|
|
|
+ this.deptOptions = response.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 取消按钮
|
|
|
+ cancel() {
|
|
|
+ this.open = false;
|
|
|
+ this.reset();
|
|
|
+ },
|
|
|
+ // 表单重置
|
|
|
+ reset() {
|
|
|
+ this.form = {
|
|
|
+ id: null,
|
|
|
+ plantCode: null,
|
|
|
+ delFlag: null,
|
|
|
+ createrCode: null,
|
|
|
+ createdate: null,
|
|
|
+ updaterCode: null,
|
|
|
+ updatedate: null,
|
|
|
+ checkDate: null,
|
|
|
+ checkerId: null,
|
|
|
+ cPerson: "0",
|
|
|
+ cDevice: "0",
|
|
|
+ cSafety: "0",
|
|
|
+ cEnv: "0",
|
|
|
+ cGov: "0",
|
|
|
+ cComplaint: "0",
|
|
|
+ cOpinion: "0",
|
|
|
+ cOther: "0",
|
|
|
+ explain: null
|
|
|
+ };
|
|
|
+ this.resetForm("form");
|
|
|
+ },
|
|
|
+ /** 搜索按钮操作 */
|
|
|
+ handleQuery() {
|
|
|
+ this.queryParams.pageNum = 1;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ /** 重置按钮操作 */
|
|
|
+ resetQuery() {
|
|
|
+ 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
|
|
|
+ getDailycheck(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) {
|
|
|
+ updateDailycheck(this.form).then(response => {
|
|
|
+ this.msgSuccess("修改成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ addDailycheck(this.form).then(response => {
|
|
|
+ this.msgSuccess("新增成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 删除按钮操作 */
|
|
|
+ handleDelete(row) {
|
|
|
+ const ids = row.id || this.ids;
|
|
|
+ this.$confirm('是否确认删除?', "警告", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(function() {
|
|
|
+ return delDailycheck(ids);
|
|
|
+ }).then(() => {
|
|
|
+ this.getList();
|
|
|
+ this.msgSuccess("删除成功");
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /** 导出按钮操作 */
|
|
|
+ handleExport() {
|
|
|
+ const queryParams = this.queryParams;
|
|
|
+ this.$confirm('是否确认导出所有每日安全检查数据项?', "警告", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(function() {
|
|
|
+ return exportDailycheck(queryParams);
|
|
|
+ }).then(response => {
|
|
|
+ this.download(response.msg);
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /** 导入按钮操作 */
|
|
|
+ handleImport() {
|
|
|
+ this.upload.title = "用户导入";
|
|
|
+ this.upload.open = true;
|
|
|
+ },
|
|
|
+ /** 下载模板操作 */
|
|
|
+ importTemplate() {
|
|
|
+ importTemplate().then(response => {
|
|
|
+ this.download(response.msg);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 文件上传中处理
|
|
|
+ handleFileUploadProgress(event, file, fileList) {
|
|
|
+ this.upload.isUploading = true;
|
|
|
+ },
|
|
|
+ // 文件上传成功处理
|
|
|
+ handleFileSuccess(response, file, fileList) {
|
|
|
+ this.upload.open = false;
|
|
|
+ this.upload.isUploading = false;
|
|
|
+ this.$refs.upload.clearFiles();
|
|
|
+ this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ // 提交上传文件
|
|
|
+ submitFileForm() {
|
|
|
+ this.$refs.upload.submit();
|
|
|
+ },
|
|
|
+ wordView(row) {
|
|
|
+ wordView(row.id).then(response => {
|
|
|
+ console.log(response.msg)
|
|
|
+ this.handleSee("每日检查记录", response.msg)
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleSee(fileName, url) {
|
|
|
+ //office预览
|
|
|
+ this.loadingFlash = true
|
|
|
+ this.pdf.open = true
|
|
|
+ this.pdf.title = fileName
|
|
|
+ this.pdf.pdfUrl = ""
|
|
|
+ this.pptView = false
|
|
|
+ this.ppt = true
|
|
|
+ //如果是PDF等直接可以打开的就不调接口,否则调用接口
|
|
|
+ if (fileName.endsWith('pdf')) {
|
|
|
+ this.pdf.pdfUrl = process.env.VUE_APP_BASE_API + '/pdf/web/viewer.html?file=' + process.env.VUE_APP_BASE_API + url
|
|
|
+ this.loadingFlash = false
|
|
|
+ } else {
|
|
|
+ const formatDate = new FormData();
|
|
|
+ formatDate.append("filepath", url)
|
|
|
+ //调用文件预览api
|
|
|
+ let res = this.officeConvert.bookConvertCommon(formatDate)
|
|
|
+ //查看接受全局方法的返回结果 console.log(res)
|
|
|
+ //利用.then方法接受Promise对象
|
|
|
+ res.then((result) => {
|
|
|
+ //关闭加载中
|
|
|
+ this.loadingFlash = false
|
|
|
+ if (result.msg.includes("csv")) {
|
|
|
+ this.pdf.pdfUrl = process.env.VUE_APP_BASE_API + result.data
|
|
|
+ this.$alert(result.msg, this.$t('检查乱码'), {dangerouslyUseHTMLString: true});
|
|
|
+ // this.$message({message: result.msg, center: true,type:'warning', offset:400, });
|
|
|
+ } else if (result.msg.includes("不存在")) {
|
|
|
+ //文件不存在时提示
|
|
|
+ this.pdf.pdfUrl = ""
|
|
|
+ this.$alert(result.msg, this.$t('预览失败'), {dangerouslyUseHTMLString: true});
|
|
|
+ // this.$message({message: result.msg, center: true,type:'warning', offset:400, });
|
|
|
+ this.pdf.open = false
|
|
|
+ } else if (result.msg.includes("不支持此格式")) {
|
|
|
+ this.pdf.pdfUrl = ""
|
|
|
+ this.$alert(result.msg, this.$t('预览失败'), {dangerouslyUseHTMLString: true});
|
|
|
+ // this.$message({message: result.msg, center: true,type:'warning', offset:400, });
|
|
|
+ this.pdf.open = false
|
|
|
+ } else {
|
|
|
+ //成功时直接给地址
|
|
|
+ this.pdf.pdfUrl = process.env.VUE_APP_BASE_API + result.data
|
|
|
+ }
|
|
|
+ }).catch(result => {
|
|
|
+ //请求失败,关闭loading,pdf地址直接为为空,不显示
|
|
|
+ this.pdf.pdfUrl = ""
|
|
|
+ this.loadingFlash = false;
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //文件预览
|
|
|
+ openPdf() {
|
|
|
+ //ppt就跳路由预览,office就直接打开文件新页面
|
|
|
+ const didi = {imgs: this.imgs}
|
|
|
+ if (this.pptView == true && this.ppt == false) {
|
|
|
+ let routeUrl = this.$router.resolve({
|
|
|
+ path: "/cpms/index.html#/pptyulan",
|
|
|
+ query: didi
|
|
|
+ });
|
|
|
+ window.open("/cpms/index.html#/pptyulan?id=" + this.pdf.pdfUrl, '_blank')
|
|
|
+ console.log(this.imgs)
|
|
|
+ } else {
|
|
|
+ window.open(this.pdf.pdfUrl)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style scoped>
|
|
|
+
|
|
|
+.checklist-table {
|
|
|
+ margin-top: 20px;
|
|
|
+ margin-bottom: 20px;
|
|
|
+}
|
|
|
+
|
|
|
+.checklist-table table {
|
|
|
+ width: 100%;
|
|
|
+ border-collapse: collapse;
|
|
|
+}
|
|
|
+
|
|
|
+.checklist-table th,
|
|
|
+.checklist-table td {
|
|
|
+ padding: 10px;
|
|
|
+ border: 1px solid #ccc;
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+
|
|
|
+.checklist-table th {
|
|
|
+ background-color: #f5f5f5;
|
|
|
+}
|
|
|
+.radio-group-horizontal {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-around;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+</style>
|