From c819024e241b9f7c54cc3786373ad0d2998f2190 Mon Sep 17 00:00:00 2001 From: 马宇豪 <978517621@qq.com> Date: 星期五, 05 五月 2023 08:55:46 +0800 Subject: [PATCH] 修改 --- src/views/doublePreventAction/riskLevelManage/riskSourceManage/index.vue | 45 ++++++++++++++++++++++++++++++--------------- 1 files changed, 30 insertions(+), 15 deletions(-) diff --git a/src/views/doublePreventAction/riskLevelManage/riskSourceManage/index.vue b/src/views/doublePreventAction/riskLevelManage/riskSourceManage/index.vue index b8c42f1..d8d178c 100644 --- a/src/views/doublePreventAction/riskLevelManage/riskSourceManage/index.vue +++ b/src/views/doublePreventAction/riskLevelManage/riskSourceManage/index.vue @@ -16,7 +16,7 @@ </div> <div class="basic_search"> <span>风险等级:</span> - <el-select v-model="listQuery.level"> + <el-select v-model="listQuery.riskLevel"> <el-option v-for="item in levelList" :key="item.id" @@ -56,7 +56,7 @@ <el-button class="filter-item" style="margin-left: 10px;margin-top: 10px" type="primary" icon="el-icon-refresh" @click="refreshHandle">搜索</el-button> <el-button class="filter-item" style="margin-left: 10px;margin-top: 10px" type="primary" icon="el-icon-plus" @click="showRiskSourceForm('','新增')">新增</el-button> <el-button class="filter-item" style="margin-left: 10px;margin-top: 10px" type="primary" @click="showImportDialog()">导入</el-button> - <el-button class="filter-item" style="margin-left: 10px;margin-top: 10px" type="primary" @click="exportToExcel()">导出</el-button> +<!-- <el-button class="filter-item" style="margin-left: 10px;margin-top: 10px" type="primary" @click="exportToExcel()">导出</el-button>--> </div> <div class="table_content"> <el-table @@ -378,14 +378,22 @@ cancelButtonText:'取消', type:'warning', }).then(()=> { - deleteRiskSource({id:val.id}).then( ()=>{ - this.getRiskSourceData() - this.$notify({ - title:'成功', - message:'删除成功', - type:'success', - duration:2000, - }) + deleteRiskSource({id:val.id}).then( (res)=>{ + if(res.data.code === '200'){ + this.getRiskSourceData() + this.$notify({ + title:'成功', + message:'删除成功', + type:'success', + duration:2000, + }) + }else{ + this.$message({ + type:'warning', + message:res.data.message + }) + } + }) }) }, @@ -432,21 +440,28 @@ }) } else{ - let allData = res.data.result + let allData = res.data.result.map(item => { + return { + name:item.name, + level:this.levelList.find(i =>i.id === item.level).name, + depName:item.depName, + location:item.location, + } + }) import('@/vendor/Export2Excel').then((excel) => { const tHeader = [ '生产装置名称', '风险等级', - '可能导致的事故描述', - '区域位置', '所属部门名称', + '区域位置', + ] const filterVal = [ 'name', 'level', - 'accidentDesc', - 'location', 'depName', + 'location', + ] const data = this.formatJson(filterVal, allData) excel.export_json_to_excel({ -- Gitblit v1.9.2