| | |
| | | <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 :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"> |
| | | <el-form-item label="关键字" prop="peopleId"> |
| | | <el-input v-model="queryParams.keyword" placeholder="点位名搜索" clearable @keyup.enter.native="handleQuery" @clear="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 label="报备类型" prop="reportType"> |
| | | <el-select v-model="queryParams.reportType" @change="handleQuery" placeholder="报备类型" clearable> |
| | | <el-option label="事前报备" value="事前报备" /> |
| | | <el-option label="事后报备" value="事后报备" /> |
| | | </el-select> |
| | | </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 label="故障类型" prop="errorTypeList"> |
| | | <el-select v-model="queryParams.errorTypeList" multiple @change="handleQuery" clearable> |
| | | <el-option v-for="dict in dict.type.report_error_type" :value="dict.value" :key="dict.value" :label="dict.label" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="审核状态"> |
| | | <el-select v-model="queryParams.status" @change="handleQuery" placeholder="审核状态" clearable> |
| | | <el-option label="全部" value="" /> |
| | | <el-option label="审核中" :value="0" /> |
| | | <el-option label="审核未通过" :value="2" /> |
| | | <el-option label="审核通过" :value="1" /> |
| | | </el-select> |
| | | </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-button type="primary" icon="el-icon-search" size="small" @click="handleQuery">搜索</el-button> |
| | | <el-button icon="el-icon-refresh" size="small" @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-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" |
| | | v-hasPermi="['system:report:add']">单次报备</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-button type="success" plain icon="el-icon-upload" size="mini" @click="handleImport" |
| | | v-hasPermi="['system:report:add']">批量报备</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" |
| | | v-hasPermi="['system:report:remove']">删除</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" |
| | | v-hasPermi="['system:report:export']">导出</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="reportType" /> |
| | | <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"> |
| | | <el-table-column type="expand"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ parseTime(scope.row.auditingTime, '{y}-{m}-{d}') }}</span> |
| | | <div class="info-container"> |
| | | <div class="info-item"> |
| | | <div class="info-label">报备内容</div> |
| | | <div class="info-text" v-html="scope.row.reportContent"></div> |
| | | </div> |
| | | <div class="info-item"> |
| | | <div class="info-label">报备材料</div> |
| | | <div class="info-list"> |
| | | <div style="margin-bottom: 8px" v-for="file in scope.row.reportMaterials!=null ? scope.row.reportMaterials.split(',') : scope.row.reportMaterials" :key="file"> |
| | | <el-image |
| | | v-if="isImageFile(file)" |
| | | :src="getPreview(file)" |
| | | :preview-src-list="[getPreview(file)]" |
| | | fit="cover" |
| | | class="material-preview" |
| | | style="width: 100px; height: 100px; margin: 5px;" |
| | | > |
| | | </el-image> |
| | | <el-link v-else type="primary" @click="handleDownload(file)"> |
| | | {{file.match(/\/([^\/]*)$/)[1]}} |
| | | </el-link> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="报备单位" width="200" align="center" prop="unitName" /> |
| | | <!-- <el-table-column label="报备人员" align="center" prop="peopleName" />--> |
| | | <el-table-column label="点位" width="250" align="center" prop="pointName" /> |
| | | <el-table-column label="报备类型" align="center" prop="reportType" /> |
| | | <el-table-column label="报备时间" width="200" align="center" prop="createTime" /> |
| | | <el-table-column label="故障类型" width="250" align="center" prop="errorType" /> |
| | | <el-table-column label="有效时间" width="250" align="center"> |
| | | <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> |
| | | {{scope.row.beginCreateTime}}至{{scope.row.endCreateTime}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="审核结果" align="center" prop="status" :formatter="formatStatus" /> |
| | | <el-table-column label="操作" fixed="right" width="250" 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']" v-if="scope.row.status === 2 || scope.row.status === 0">修改</el-button> |
| | | <el-button size="mini" type="text" icon="el-icon-edit" @click="handleAuditing(scope.row)" |
| | | v-hasPermi="['system:report:auditing']" v-if="scope.row.status === 0 || scope.row.status === 2">审核</el-button> |
| | | <el-button size="mini" type="text" icon="el-icon-s-check" @click="handleAuditingRecord(scope.row.id)" |
| | | v-hasPermi="['system:report:record']">审核记录</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" |
| | | /> |
| | | <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="reportType"> |
| | | <el-select v-model="form.reportType"> |
| | | <el-option label="事前报备" value="事前报备"/> |
| | | <el-option label="事后报备" value="事后报备"/> |
| | | </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> |
| | | <el-dialog :title="title" :visible.sync="open" width="980px" :close-on-click-modal="false" append-to-body> |
| | | <div style="display: flex;flex-direction: row"> |
| | | <div style="flex: 5"> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
| | | <el-form-item label="点位" prop="pointId" v-if="addOrImport === 'add'"> |
| | | <el-select v-model="form.pointId" @change="pointChange" filterable remote reserve-keyword placeholder="名称/国标搜索点位" |
| | | :remote-method="remoteGetPoints" :loading="selectLoading"> |
| | | <el-option v-for="item in pointList" :key="item.id" :label="item.value" :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="点位导入" v-if="addOrImport === 'import'"> |
| | | <el-upload accept=".xlsx, .xls" :limit="1" :action="url" drag :before-upload="beforeUpload" :file-list="fileList"> |
| | | <i class="el-icon-upload"></i> |
| | | <div class="el-upload__text"> |
| | | 将文件拖到此处,或<em>点击上传</em> |
| | | </div> |
| | | <div class="el-upload__tip" slot="tip"> |
| | | <span>仅允许导入xls、xlsx格式文件。</span> |
| | | <el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline" |
| | | @click="importTemplate">下载模板</el-link> |
| | | </div> |
| | | </el-upload> |
| | | </el-form-item> |
| | | <el-form-item label="报备类型" prop="reportType"> |
| | | <el-select v-model="form.reportType"> |
| | | <el-option label="事前报备" value="事前报备" /> |
| | | <el-option label="事后报备" value="事后报备" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="故障类型" prop="errorTypeList"> |
| | | <el-select v-model="form.errorTypeList" multiple> |
| | | <el-option v-for="dict in dict.type.report_error_type" :value="dict.value" :key="dict.value" :label="dict.label" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="报备时间" prop="daterangeCreateTime"> |
| | | <el-date-picker v-model="form.daterangeCreateTime" |
| | | type="datetimerange" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | format="yyyy-MM-dd HH:mm:ss" |
| | | range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" |
| | | ></el-date-picker> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div style="flex: 5"> |
| | | <el-form :rules="rules"> |
| | | <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" :fileType='fileType' /> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | </div> |
| | | |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">确 定</el-button> |
| | | <el-button @click="cancel">取 消</el-button> |
| | | <el-button type="primary" @click="submitForm">提交审核</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | |
| | | <!-- 查看审核记录 --> |
| | | <el-dialog title="报备审核记录" :visible.sync="recordOpen" :close-on-click-modal="false" width="900px"> |
| | | <div slot="footer" class="dialog-footer" style="max-height: 500px;overflow-y: auto;"> |
| | | <div v-if="auditingRecordList && auditingRecordList.length > 0"> |
| | | <el-timeline v-for="record in auditingRecordList" :key="record.id"> |
| | | <el-timeline-item :timestamp="record.auditingTime" placement="top"> |
| | | <el-card> |
| | | <el-descriptions title="提交数据" :column="3" border> |
| | | <el-descriptions-item label="点位" label-class-name="my-label" content-class-name="my-content">{{ |
| | | record.pointName }}</el-descriptions-item> |
| | | <el-descriptions-item label="报备类型">{{ record.reportType }}</el-descriptions-item> |
| | | <el-descriptions-item label="审核结果"><el-tag :type="record.result ? 'success' : 'danger'">{{ record.result ? "通过" : "未通过" }}</el-tag></el-descriptions-item> |
| | | <el-descriptions-item label="审核意见">{{ record.resultRemark ? record.resultRemark : "无" }}</el-descriptions-item> |
| | | <el-descriptions-item label="报备内容"> |
| | | <div class="content" v-html="getHtmlContent(record.reportContent)"></div> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="报备材料"> |
| | | <div |
| | | v-for="item in record.reportMaterials != null ? record.reportMaterials.split(',') : record.reportMaterials" |
| | | :key="item"> |
| | | <el-image |
| | | v-if="isImageFile(item)" |
| | | :src="getPreview(item)" |
| | | :preview-src-list="[getPreview(item)]" |
| | | fit="cover" |
| | | style="width: 100px; height: 100px; margin: 5px;"> |
| | | </el-image> |
| | | <el-link |
| | | v-else |
| | | :underline="false" type="primary" @click="handleDownload(item)"> |
| | | {{ item.substring(item.lastIndexOf("/") + 1) }} |
| | | </el-link> |
| | | </div> |
| | | </el-descriptions-item> |
| | | </el-descriptions> |
| | | </el-card> |
| | | </el-timeline-item> |
| | | </el-timeline> |
| | | </div> |
| | | <div v-else> |
| | | <el-empty description="无审核记录"></el-empty> |
| | | </div> |
| | | |
| | | <el-button type="primary" @click="recordOpen = false">关闭</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.reportType" 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> |
| | | <el-dialog title="报备审核" :visible.sync="auditingOpen" :close-on-click-modal="false" width="1100px" append-to-body> |
| | | <div style="display: flex;flex-direction: row"> |
| | | <div style="flex: 6; border-right: 1px solid #d2d1d1; padding-right: 20px"> |
| | | <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.reportType" disabled /> |
| | | </el-form-item> |
| | | <el-form-item label="故障类型"> |
| | | <el-input v-model="auditingForm.errorType" disabled /> |
| | | </el-form-item> |
| | | <el-form-item label="生效时间"> |
| | | <el-date-picker v-model="auditingForm.beginCreateTime" format="yyyy-MM-dd HH:mm:ss" disabled /> |
| | | </el-form-item> |
| | | <el-form-item label="失效时间"> |
| | | <el-date-picker v-model="auditingForm.endCreateTime" format="yyyy-MM-dd HH:mm:ss" disabled /> |
| | | </el-form-item> |
| | | <el-form-item label="审核结果"> |
| | | <el-radio-group v-model="auditingForm.auditingResult"> |
| | | <el-radio :label="true">通过</el-radio> |
| | | <el-radio :label="false">驳回</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item label="审核意见" prop="auditOpinion"> |
| | | <el-input v-model="auditingForm.auditOpinion" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div style="flex: 5; border-right: 1px solid #d2d1d1; padding-right: 20px; padding-left: 20px"> |
| | | <div>同一批次号的报备</div> |
| | | <div style="margin-top: 20px"> |
| | | <el-checkbox-group v-if="togetherList && togetherList.length > 0" v-model="selectedTo"> |
| | | <el-checkbox v-for="item in togetherList" :label="item.id">{{item.pointName}}</el-checkbox> |
| | | </el-checkbox-group> |
| | | <span v-else>无</span> |
| | | </div> |
| | | </div> |
| | | <div style="flex: 5; padding-left: 20px"> |
| | | <el-form> |
| | | <el-form-item label="报备内容"> |
| | | <span v-html="auditingForm.reportContent"></span> |
| | | </el-form-item> |
| | | <el-form-item label="报备材料"> |
| | | <!-- 添加空行 --> |
| | | <div class="material-spacer">{{''}}</div> |
| | | <div |
| | | v-for="item in auditingForm.reportMaterials != null ? auditingForm.reportMaterials.split(',') : auditingForm.reportMaterials" |
| | | :key="item"> |
| | | <el-image |
| | | v-if="isImageFile(item)" |
| | | :src="getPreview(item)" |
| | | :preview-src-list="[getPreview(item)]" |
| | | fit="cover" |
| | | style="width: 100px; height: 100px; margin: 5px;"> |
| | | </el-image> |
| | | <el-link |
| | | v-else |
| | | :underline="false" type="primary" @click="handleDownload(item)"> |
| | | {{ item.substring(item.lastIndexOf("/") + 1) }} |
| | | </el-link> |
| | | </div> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | </div> |
| | | |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary">确 定</el-button> |
| | | <el-button @click="auditingCancel">取 消</el-button> |
| | | <el-button type="primary" @click="auditingSubmit">审 核</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { listReport, getReport, delReport, addReport, updateReport } from "@/api/platform/report"; |
| | | import { listReport, getReport, delReport, addReport, updateReport, auditing, audit, importReport, getTogether } from "@/api/platform/report"; |
| | | import { pointSelectData } from "@/api/platform/point"; |
| | | |
| | | export default { |
| | | dicts: ['report_error_type'], |
| | | name: "Report", |
| | | data() { |
| | | return { |
| | | // 选中的同一批次号报备 |
| | | selectedTo: [], |
| | | // 同一批次号的报备 |
| | | togetherList: [], |
| | | fileList: [], |
| | | url: process.env.VUE_APP_BASE_API + '/report/import', |
| | | addOrImport: 'add', |
| | | fileType: ["doc", "xls", "xlsx", "ppt", "txt", "pdf", "png", "jpg"], |
| | | auditingRecordList: [], |
| | | // 点位list |
| | | pointList: [], |
| | | // 遮罩层 |
| | |
| | | title: "", |
| | | // 是否显示弹出层 |
| | | open: false, |
| | | // 故障类型时间范围 |
| | | daterangeCreateTime: [], |
| | | // 故障类型时间范围 |
| | | daterangeAuditingTime: [], |
| | | recordOpen: false, |
| | | expirTime: [], |
| | | auditingOpen: false, |
| | | auditingForm: { |
| | | id: null, |
| | | unitName: "", |
| | | pointName: "", |
| | | peopleName: "", |
| | | errorType: "", |
| | | errorTypeList: [], |
| | | reportContent: "", |
| | | auditing: "", |
| | | suggest: "", |
| | | auditOpinion: "", |
| | | reportType: "", |
| | | beginCreateTime: null, |
| | | endCreateTime: null, |
| | | auditingResult: false, |
| | | daterangeCreateTime: [] |
| | | }, |
| | | // 查询参数 |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | unitId: null, |
| | | peopleId: null, |
| | | pointId: null, |
| | | createTime: null, |
| | | auditingTime: null, |
| | | errorType: null |
| | | keyword: null, |
| | | errorType: null, |
| | | status: '', |
| | | reportType: null, |
| | | errorTypeList: [] |
| | | }, |
| | | // 表单参数 |
| | | form: {}, |
| | |
| | | { required: true, message: "报备内容不能为空", trigger: "blur" } |
| | | ], |
| | | reportMaterials: [ |
| | | { required: true, message: "上报材料不能为空", trigger: "blur" } |
| | | { required: true, message: "报备材料不能为空", trigger: "blur" } |
| | | ], |
| | | reportType: [ |
| | | { required: true, message: "请选择报备类型", trigger: "blur" } |
| | | ], |
| | | errorTypeList: [ |
| | | { required: true, message: "请选择故障类型", trigger: "blur" } |
| | | ], |
| | | // 报备时间范围 |
| | | daterangeCreateTime: [ |
| | | { required: true, message: "请选择报备时间", trigger: "blur" } |
| | | ], |
| | | } |
| | | }; |
| | |
| | | this.getList(); |
| | | }, |
| | | methods: { |
| | | getPreview(url) { |
| | | // 使用全局配置的图片前缀 |
| | | return this.$img + url; |
| | | }, |
| | | isImageFile(url) { |
| | | const imageExtensions = ['.jpg', '.jpeg', '.png', '.gif', '.webp']; |
| | | return imageExtensions.some(ext => |
| | | url.toLowerCase().endsWith(ext) |
| | | ); |
| | | }, |
| | | getHtmlContent(content) { |
| | | if (content) { |
| | | return content |
| | | } else { |
| | | return "无" |
| | | } |
| | | }, |
| | | formatStatus(item) { |
| | | if (item.result === 0) { |
| | | return '审核中' |
| | | } else if (item.status === 1) { |
| | | return '通过' |
| | | } else if (item.status === 2) { |
| | | return '未通过' |
| | | } |
| | | }, |
| | | auditingCancel() { |
| | | this.auditingOpen = false |
| | | }, |
| | | // 获取审核记录 |
| | | handleAuditingRecord(reportId) { |
| | | auditing(reportId).then(res => { |
| | | this.auditingRecordList = res.data; |
| | | this.recordOpen = true |
| | | }) |
| | | }, |
| | | handleAuditing(row) { |
| | | if (row.importBatchNumber) { |
| | | getTogether(row.importBatchNumber).then(res => { |
| | | this.togetherList = res.data; |
| | | if (this.togetherList && this.togetherList.length > 0) { |
| | | this.togetherList = this.togetherList.filter(item => item.id != row.id) |
| | | this.selectedTo = this.togetherList.map(item => item.id) |
| | | } |
| | | }) |
| | | } |
| | | 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 |
| | | this.auditingForm.reportType =row.reportType |
| | | this.auditingForm.id = row.id |
| | | this.auditingForm.pointId = row.pointId |
| | | 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 |
| | | this.auditingForm.reportType = row.reportType |
| | | this.auditingForm.endCreateTime = row.endCreateTime |
| | | this.auditingForm.beginCreateTime = row.beginCreateTime |
| | | this.auditingForm.reportMaterials = row.reportMaterials |
| | | }, |
| | | pointChange(value) { |
| | | // this.remoteGetPoints(value) |
| | | }, |
| | | // 远程搜索点位 |
| | | remoteGetPoints(query) { |
| | |
| | | /** 查询报备列表 */ |
| | | 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]; |
| | | } |
| | | // if (this.form.daterangeCreateTime && this.form.daterangeCreateTime.length > 0) { |
| | | // this.queryParams["beginCreateTime"] = this.form.daterangeCreateTime[0]; |
| | | // this.queryParams["endCreateTime"] = this.form.daterangeCreateTime[1]; |
| | | // } else { |
| | | // this.queryParams["beginCreateTime"] = null; |
| | | // this.queryParams["endCreateTime"] = null; |
| | | // } |
| | | listReport(this.queryParams).then(response => { |
| | | this.reportList = response.data; |
| | | this.reportList = response.data.records; |
| | | this.total = response.total; |
| | | this.loading = false; |
| | | }); |
| | |
| | | // 表单重置 |
| | | reset() { |
| | | this.form = { |
| | | daterangeCreateTime: [], |
| | | id: null, |
| | | unitId: null, |
| | | peopleId: null, |
| | |
| | | reportContent: null, |
| | | reportMaterials: null, |
| | | deleted: null, |
| | | errorType: null |
| | | errorTypeList: [], |
| | | }; |
| | | this.resetForm("form"); |
| | | // this.resetForm("form"); |
| | | }, |
| | | /** 搜索按钮操作 */ |
| | | handleQuery() { |
| | |
| | | }, |
| | | /** 重置按钮操作 */ |
| | | resetQuery() { |
| | | this.daterangeCreateTime = []; |
| | | this.daterangeAuditingTime = []; |
| | | this.queryParams["beginCreateTime"] = null; |
| | | this.queryParams["endCreateTime"] = null; |
| | | this.resetForm("queryForm"); |
| | | this.handleQuery(); |
| | | }, |
| | | // 多选框选中数据 |
| | | handleSelectionChange(selection) { |
| | | this.ids = selection.map(item => item.id) |
| | | this.single = selection.length!==1 |
| | | this.single = selection.length !== 1 |
| | | this.multiple = !selection.length |
| | | }, |
| | | /** 新增按钮操作 */ |
| | | handleAdd() { |
| | | this.reset(); |
| | | this.addOrImport = 'add'; |
| | | this.open = true; |
| | | this.title = "添加报备"; |
| | | this.title = "少量报备"; |
| | | }, |
| | | /** 导入按钮操作 */ |
| | | handleImport() { |
| | | this.reset(); |
| | | this.addOrImport = 'import'; |
| | | this.open = true; |
| | | this.title = "批量报备"; |
| | | }, |
| | | beforeUpload(file) { |
| | | this.fileList = [file]; |
| | | return false; |
| | | }, |
| | | /** 修改按钮操作 */ |
| | | handleUpdate(row) { |
| | |
| | | const id = row.id || this.ids |
| | | getReport(id).then(response => { |
| | | this.form = response.data; |
| | | this.form.daterangeCreateTime = [this.form.beginCreateTime, this.form.endCreateTime] |
| | | this.remoteGetPoints(this.form.pointId) |
| | | this.addOrImport = 'add'; |
| | | this.open = true; |
| | | this.title = "修改报备"; |
| | | }); |
| | | }, |
| | | /** 审核按钮操作 */ |
| | | auditingSubmit() { |
| | | this.auditingForm.auditingTime = new Date(); |
| | | this.auditingForm.togetherList = this.selectedTo |
| | | audit(this.auditingForm).then(response => { |
| | | this.$modal.msgSuccess("审核成功"); |
| | | this.auditingOpen = false |
| | | this.getList(); |
| | | this.auditingForm = { |
| | | id: null, |
| | | unitName: "", |
| | | pointName: "", |
| | | peopleName: "", |
| | | errorTypeList: [], |
| | | reportContent: "", |
| | | auditing: "", |
| | | auditOpinion: "", |
| | | reportType: "", |
| | | beginCreateTime: null, |
| | | endCreateTime: null, |
| | | auditingResult: false, |
| | | daterangeCreateTime: [] |
| | | } |
| | | }); |
| | | }, |
| | | /** 提交按钮 */ |
| | | submitForm() { |
| | | // todo 判断是事前报备 |
| | | |
| | | this.form.pointId = this.form.pointId ? this.form.pointId : this.form.serialNumber; |
| | | 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.form.beginCreateTime = this.form.daterangeCreateTime[0] |
| | | this.form.endCreateTime = this.form.daterangeCreateTime[1] |
| | | if (this.addOrImport === 'import') { |
| | | let formData = new FormData(); |
| | | formData.append("importPointId", this.fileList[0]); |
| | | formData.append("pointId", this.form.importPointId); |
| | | formData.append("reportType", this.form.reportType); |
| | | formData.append("errorTypeList", this.form.errorTypeList); |
| | | formData.append("reportContent", this.form.reportContent); |
| | | formData.append("reportMaterials", this.form.reportMaterials); |
| | | formData.append("beginCreateTimeStr", this.form.daterangeCreateTime[0]); |
| | | formData.append("endCreateTimeStr", this.form.daterangeCreateTime[1]); |
| | | importReport(formData).then(() => { |
| | | this.$modal.msgSuccess("成功提交报备"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } else { |
| | | if (this.form.id != null) { |
| | | updateReport(this.form).then(() => { |
| | | this.$modal.msgSuccess("修改成功"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } else { |
| | | addReport(this.form).then(() => { |
| | | this.$modal.msgSuccess("成功提交报备"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | /** 下载模板操作 */ |
| | | importTemplate() { |
| | | this.download("report/importTemplate", {}, `报备-点位导入模板.xlsx`); |
| | | }, |
| | | /** 删除按钮操作 */ |
| | | handleDelete(row) { |
| | | const ids = row.id || this.ids; |
| | | this.$modal.confirm('是否确认删除报备编号为"' + ids + '"的数据项?').then(function() { |
| | | this.$modal.confirm('是否确认删除报备编号为"' + ids + '"的数据项?').then(function () { |
| | | return delReport(ids); |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.$modal.msgSuccess("删除成功"); |
| | | }).catch(() => {}); |
| | | }).catch(() => { }); |
| | | }, |
| | | /** 导出按钮操作 */ |
| | | handleExport() { |
| | | this.download('system/report/export', { |
| | | this.download('report/export', { |
| | | ...this.queryParams |
| | | }, `report_${new Date().getTime()}.xlsx`) |
| | | }, |
| | | /** 下载按钮操作 */ |
| | | handleDownload(data) { |
| | | this.$download.resource(data); |
| | | }, |
| | | |
| | | formatFileList(data) { |
| | | if (!data) return []; |
| | | return data.split(',').map(item => process.env.VUE_APP_BASE_API + item); |
| | | }, |
| | | showFile(filePath) { |
| | | console.log(process.env.VUE_APP_BASE_API + filePath); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .material-spacer { |
| | | height: 50px; /* 可以调整空行的高度 */ |
| | | } |
| | | .content { |
| | | height: 100px; |
| | | max-height: 300px; |
| | | overflow-y: auto; |
| | | } |
| | | |
| | | .info-container { |
| | | width: 100%; |
| | | max-height: 400px; |
| | | overflow-y: scroll; |
| | | } |
| | | |
| | | .info-item { |
| | | display: flex; |
| | | margin-bottom: 20px; |
| | | |
| | | .info-label { |
| | | font-size: 14px; |
| | | font-weight: bold; |
| | | margin-right: 20px; |
| | | } |
| | | |
| | | .info-text { |
| | | width: 30%; |
| | | padding: 20px; |
| | | border-radius: 10px; |
| | | border: 1px solid #c0c0c0; |
| | | } |
| | | |
| | | .info-list { |
| | | width: 30%; |
| | | |
| | | .list-item { |
| | | width: 100%; |
| | | border-radius: 5px; |
| | | border: 1px solid #c0c0c0; |
| | | padding: 10px 10px; |
| | | display: flex; |
| | | align-items: center; |
| | | margin-bottom: 10px; |
| | | cursor: pointer; |
| | | |
| | | .item-icon { |
| | | flex-shrink: 0; |
| | | margin-right: 5px; |
| | | } |
| | | |
| | | .item-text { |
| | | flex-grow: 1; |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | } |
| | | |
| | | &:hover { |
| | | border-color: #1890ff; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </style> |