From 99035941964810509e5037c7d9627b1801213335 Mon Sep 17 00:00:00 2001
From: Admin <978517621@qq.com>
Date: 星期三, 26 十月 2022 14:00:48 +0800
Subject: [PATCH] 默认更改列表
---
src/views/careabout/index.vue | 247 +++++++++++++++++++++++++++++++++++++------------
1 files changed, 186 insertions(+), 61 deletions(-)
diff --git a/src/views/careabout/index.vue b/src/views/careabout/index.vue
index 750e0e3..2332ccd 100644
--- a/src/views/careabout/index.vue
+++ b/src/views/careabout/index.vue
@@ -1,6 +1,6 @@
<template>
<div class="app-container">
- <el-form ref="form" :inline="true" class="inquire" :model="form" label-width="100px">
+ <el-form ref="form" :inline="true" class="inquire" :model="listQuery.form" label-width="100px">
<el-form-item label="编号">
<el-input v-model="listQuery.form.number" style="width:202px" placeholder="请输入内容"></el-input>
</el-form-item>
@@ -45,7 +45,7 @@
v-for="item in YHBMList"
:key="item.branch_id"
:label="item.branch_name"
- :value="item.branch_id">
+ :value="item.branch_name">
</el-option>
</el-select>
</el-form-item>
@@ -96,11 +96,11 @@
</el-select>
</el-form-item>
<el-form-item label="深入现场情况">
- <el-select v-model="listQuery.form.DTRisk_bankId" placeholder="请选择">
+ <el-select v-model="listQuery.form.class_situation" placeholder="请选择">
<el-option
v-for="item in reList"
:key="item.value"
- :label="item.label"
+ :label="item.value"
:value="item.value">
</el-option>
</el-select>
@@ -135,35 +135,59 @@
</el-form-item>
<el-form-item style="text-align:center;padding:0 50px">
<el-button type="primary" class="btns" size="small" icon="el-icon-search" @click="getPageList()">查询</el-button>
- <el-button type="primary" class="btns" size="small" @click="reset()">重置</el-button>
- <el-button type="primary" class="btns" size="small" icon="el-icon-upload2">导出excel</el-button>
+ <el-button type="primary" class="btns" size="small" icon="el-icon-refresh-right" @click="reset()">重置</el-button>
+ <el-button type="primary" class="btns" size="small" icon="el-icon-upload2" @click="exportData">导出excel</el-button>
</el-form-item>
</el-form>
<el-row class="title-center">
<el-col :span="10">
- <el-radio-group v-model="listQuery.type" @change="typeChange">
- <el-radio-button label="0">督查督办</el-radio-button>
- <el-radio-button label="1">特别关注</el-radio-button>
- <el-radio-button label="2">全部</el-radio-button>
+ <el-radio-group v-model="listQuery.tag" @change="typeChange">
+ <el-radio-button label="0"
+ v-for="item in tagList"
+ :label="item.value"
+ :key="item.value">
+ {{item.value}}
+ </el-radio-button>
+<!-- <el-radio-button label="1">特别关注</el-radio-button>-->
+<!-- <el-radio-button label="2">全部</el-radio-button>-->
</el-radio-group>
</el-col>
<div v-if="table1">
<el-col :span="14" style="text-align:right;">
- <el-button class="btns" type="primary" size="small" >特别关注</el-button>
- <el-button class="btns" type="primary" size="small" @click="sendBath()">管理关注</el-button>
+ <el-button class="btns" type="primary" size="small" @click="specialFocus()">{{focusDesc}}</el-button>
+<!-- <el-button class="btns" type="primary" size="small" @click="sendBath()">管理关注</el-button>-->
</el-col>
</div>
</el-row>
- <el-table :data="tableData" style="width: 100%" @selection-change="changeBox">
+ <el-table :data="tableData" style="width: 100%" @selection-change="handleSelectionChange" v-loading="listLoading">
<el-table-column type="selection" width="55" align="center"></el-table-column>
- <el-table-column prop="number" label="编号" align="center" width="120"></el-table-column>
+ <el-table-column prop="number" label="编号" align="center" width="120">
+ <template slot-scope="scope">
+ <div class="blue-font-color" @click="showDetails(scope.row)">{{ scope.row.number }}</div>
+ </template>
+ </el-table-column>
<el-table-column prop="check_branch" label="检查部门" align="center" width="120"></el-table-column>
<el-table-column prop="check_man" label="检查人" align="center" width="120"></el-table-column>
<el-table-column prop="checktype" label="检查类别" align="center"></el-table-column>
<el-table-column label="隐患项目" align="center">
- <el-table-column prop="check_date" label="检查时间" width="120" align="center"></el-table-column>
+ <el-table-column prop="check_date" label="检查时间" :formatter="formatColumnDate" width="120" align="center">
+ <template slot-scope="scope">
+ <label>{{ formatDate(scope.row.check_date) }}</label><br/>
+ <label>{{ scope.row.check_class }}</label>
+ </template>
+ </el-table-column>
<el-table-column prop="address" label="地点" align="center"> </el-table-column>
- <el-table-column prop="ht_content" label="内容" align="center"> </el-table-column>
+ <el-table-column prop="ht_content" label="内容" align="center">
+ <template slot-scope="scope">
+ <el-popover trigger="hover" placement="top">
+ <p>{{ scope.row.ht_content }}</p>
+ <div slot="reference" class="name-wrapper">{{
+ scope.row.ht_content != null && scope.row.ht_content.length > 10 ? scope.row.ht_content.substring(0, 8) + "...." : scope.row.ht_content
+ }}
+ </div>
+ </el-popover>
+ </template>
+ </el-table-column>
<el-table-column prop="ht_typesub" label="类别" align="center"> </el-table-column>
<el-table-column prop="ht_level" label="级别" align="center"> </el-table-column>
</el-table-column>
@@ -171,21 +195,21 @@
<el-table-column prop="measure" label="整改措施" align="center"> </el-table-column>
<el-table-column prop="ht_branch" label="隐患部门" align="center"> </el-table-column>
<el-table-column prop="duty_officer" label="责任人" align="center"> </el-table-column>
- <el-table-column prop="alter_time" label="限改时间" width="120" align="center"></el-table-column>
+ <el-table-column prop="alter_time" label="限改时间" :formatter="formatColumnDate" width="120" align="center"></el-table-column>
<el-table-column prop="ht_level" label="级别" align="center"> </el-table-column>
</el-table-column>
<el-table-column label="整改情况" align="center">
- <el-table-column prop="ACCOMPLISHTIME" label="完成时间" width="110px" align="center"> </el-table-column>
+ <el-table-column prop="ACCOMPLISHTIME" label="完成时间" :formatter="formatColumnDate" width="110px" align="center"> </el-table-column>
<el-table-column prop="CALLBACKRESULT" label="复查结果" align="center"> </el-table-column>
<el-table-column prop="CALLBACKPERSON" label="复查人" align="center"> </el-table-column>
- <el-table-column prop="CALLBACKTIME" label="复查时间" width="120" align="center"></el-table-column>
+ <el-table-column prop="CALLBACKTIME" label="复查时间" :formatter="formatColumnDate" width="120" align="center"></el-table-column>
</el-table-column>
<el-table-column label="隐患处理状态" align="center">
<template slot-scope="scope">
<span v-if="scope.row.step =='1'">初始状态</span>
<span v-if="scope.row.step =='2'">整改中</span>
<span v-if="scope.row.step =='3'">复查中</span>
- <span v-if="scope.row.step =='end'">处理结束</span>
+ <span v-if="scope.row.step =='END'">处理结束</span>
</template>
</el-table-column>
<el-table-column prop="DTRisk_bankId" label="是否关联" align="center">
@@ -226,8 +250,8 @@
</div>
</template>
<script>
- import { getPageList, analogy_export_do} from "@/api/sgyhpczl/oneFromanotherN"
- import {initJCBM, initYHLX, initJCLB, initYHJB} from "@/api/sgyhpczl/initSelect";
+import { getPageList, danger_focus_tag, analogy_export_do, focus_do} from "@/api/sgyhpczl/careabout"
+import {initJCBM ,initYHLX, initBC ,initJCLB ,initYHBM ,initYHJB,initLlr,initSrxcqk} from "@/api/sgyhpczl/initSelect";
export default{
data(){
@@ -235,22 +259,28 @@
listQuery:{
page:1,
limit:10,
- type: 0,
- form:{},
+ tag: '全部',
+ form:{
+ ht_community:'众泰煤焦化'
+ },
},
radio1:'待发送',
table1:true,
table2:false,
-
-
+ focusDesc: '特别关注',
currentPage: 1,
pageSize: 10,
recordTotal: 0,
- XFDWList:[],
- YHLBList:[],
- YHJBList:[],
+ JCDWList:[{label:"众泰煤焦化",value:0},{label:"上级单位",value:1}],
+ JCBMList:[],
+ YHLXList:[],
+ BCList:[],
+ reList:[],
JCLBList:[],
+ YHBMList:[],
+ YHJBList:[],
+ tagList:[],
tableData:[],
selectedList:[],
listLoading: false,
@@ -269,16 +299,20 @@
}
},
mounted() {
- this.getPageList();
- this.initJCLB();
- this.initXFDW();
+ this.initYHLX();
this.initYHJB();
- this.initYHLB();
+ this.initBC();
+ this.initJCLB();
+ this.initLlr();
+ this.initYHBM();
+ this.initSrxcqk();
+ this.initTags();
+ this.getPageList();
},
methods:{
sendBath(){
this.$router.push({
- path:'/existN'
+ path:'/managementConcerns'
})
},
handleClick(data,val){
@@ -288,31 +322,10 @@
})
}
},
- handoff(index){
- if(index==1){
- this.table1=false
- this.table2=true
- this.listQuery.type = 2
- console.log(this.listQuery.type)
- this.getPageList()
- }else{
- this.table1=true
- this.table2=false
- }
- },
- initXFDW(){
- initJCBM(1).then(res=>{
- if (res.data.ok==1){
- this.XFDWList=res.data.data
- } else{
- this.$message({type:'error', message:res.data.msg, duration:3000})
- }
- })
- },
- initYHLB(){
+ initYHLX(){
initYHLX().then(res=>{
if (res.data.ok==1){
- this.YHLBList=res.data.data
+ this.YHLXList=res.data.data
} else{
this.$message({type:'error', message:res.data.msg, duration:3000})
}
@@ -327,10 +340,64 @@
}
})
},
+ initBC(){
+ initBC().then(res=>{
+ if (res.data.ok==1){
+ this.BCList=res.data.data
+ } else{
+ this.$message({type:'error', message:res.data.msg, duration:3000})
+ }
+ })
+ },
initJCLB(){
initJCLB().then(res=>{
if (res.data.ok==1){
this.JCLBList=res.data.data
+ } else{
+ this.$message({type:'error', message:res.data.msg, duration:3000})
+ }
+ })
+ },
+ initYHBM(){
+ initYHBM().then(res=>{
+ if (res.data.ok==1){
+ this.YHBMList=res.data.data
+ } else{
+ this.$message({type:'error', message:res.data.msg, duration:3000})
+ }
+ })
+ },
+ initSrxcqk(){
+ initSrxcqk().then(res=>{
+ if (res.data.ok==1){
+ this.reList=res.data.data
+ } else{
+ this.$message({type:'error', message:res.data.msg, duration:3000})
+ }
+ })
+ },
+ initTags(){
+ danger_focus_tag().then(res=>{
+ if (res.data.ok==1){
+ this.tagList=res.data.data
+ } else{
+ this.$message({type:'error', message:res.data.msg, duration:3000})
+ }
+ })
+ },
+ initLlr(){
+ initLlr().then(res=>{
+ if (res.data.ok==1){
+ this.llrList=res.data.data
+ } else{
+ this.$message({type:'error', message:res.data.msg, duration:3000})
+ }
+ })
+ },
+ changeJCDW(val){
+ initJCBM(val).then(res=>{
+ if (res.data.ok==1){
+ this.JCBMList=res.data.data
} else{
this.$message({type:'error', message:res.data.msg, duration:3000})
}
@@ -356,8 +423,11 @@
//搜索
getPageList(){
this.listQuery.page=1
+ // this.listQuery.limit=10
this.checkTime()
+ this.listLoading = true
getPageList(this.listQuery).then(res=>{
+ this.listLoading = false
if (res.data.ok==1) {
this.tableData = res.data.data.items
this.recordTotal=res.data.data.total
@@ -368,7 +438,7 @@
},
//重置
reset(){
- this.listQuery.form={};
+ this.listQuery.form = {ht_community: "众泰煤焦化"}
this.getPageList()
},
handleSizeChange(val){
@@ -390,8 +460,19 @@
}
})
},
+ showDetails(row){
+ this.$router.push({
+ path: "/dangerDetails",
+ query:{"id":row.id}
+ })
+ },
typeChange(val){
- this.listQuery.type = val;
+ this.listQuery.tag = val;
+ if (val == '特别关注'){
+ this.focusDesc = '取消关注'
+ }else {
+ this.focusDesc = '特别关注'
+ }
this.getPageList()
},
handleSelectionChange(val){
@@ -401,16 +482,19 @@
})
},
exportData() {
- var requestData = this.listQuery;
+ this.listLoading = true
+ var requestData = JSON.parse(JSON.stringify(this.listQuery));
+ requestData.export_type = 7;
//删除分页参数
this.$delete(requestData, 'page')
this.$delete(requestData, 'limit')
analogy_export_do(requestData).then(res => {
+ this.listLoading = false
var blob = new Blob([res.data])
var downloadElement = document.createElement('a')
var href = window.URL.createObjectURL(blob) //创建下载的链接
downloadElement.href = href
- downloadElement.download = '内部举一反三.xlsx' //下载后文件名
+ downloadElement.download = '隐患信息一览.xlsx' //下载后文件名
document.body.appendChild(downloadElement)
downloadElement.click() //点击下载
document.body.removeChild(downloadElement) //下载完成移除元素
@@ -418,6 +502,38 @@
}).catch(err => {
console.log(err)
})
+ },
+ //特别关注/取消关注
+ specialFocus(){
+ if (this.selectedList == null || this.selectedList.length == 0) {
+ this.$message({type: 'warning', message: '至少选中一条数据', duration: 3000})
+ return
+ }
+ var type = this.listQuery.tag == '特别关注' ? 'del' : 'add'
+ var desc = this.listQuery.tag == '特别关注' ? '确认取消吗' : '确认关注吗'
+ this.$confirm(desc, '提示', {
+ confirmButtonText: '确认',
+ cancelButtonText: '取消',
+ type: 'warning'
+ }).then(() => {
+ var ids = this.selectedList.map((obj) => {
+ return obj.id
+ }).join(",")
+ let data = {
+ type: type,
+ ids: ids,
+ }
+ focus_do(data).then(() => {
+ this.getPageList()
+ this.$notify({
+ title: "成功",
+ message: "操作成功",
+ type: "success",
+ duration: 2000,
+ });
+ });
+ }).catch(error => {
+ });
},
//日期格式转换
formatColumnDate(row, column) {
@@ -429,6 +545,15 @@
let dt = new Date(data)
return dt.getFullYear() + '-' + (dt.getMonth() + 1) + '-' + dt.getDate() + ' '
},
+ //方法区
+ formatDate(data) {
+ // 获取单元格数据
+ if (data == null) {
+ return null
+ }
+ let dt = new Date(data)
+ return dt.getFullYear() + '-' + (dt.getMonth() + 1) + '-' + dt.getDate()
+ },
}
}
</script>
--
Gitblit v1.9.2