From 239be21a25f04e6418b3487b4b618c37c6df611c Mon Sep 17 00:00:00 2001
From: cqf
Date: 星期五, 20 五月 2022 18:00:17 +0800
Subject: [PATCH] 隐患排查会议-列表

---
 src/views/careabout/index.vue |   66 ++++++++++++++++++++++-----------
 1 files changed, 44 insertions(+), 22 deletions(-)

diff --git a/src/views/careabout/index.vue b/src/views/careabout/index.vue
index 6d72984..36f9185 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>
@@ -136,7 +136,7 @@
             <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" icon="el-icon-refresh-right" @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-upload2" @click="exportData()">导出excel</el-button>
             </el-form-item>
         </el-form>
      <el-row class="title-center">
@@ -149,12 +149,12 @@
             </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="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">
             <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="check_branch" label="检查部门" align="center" width="120"></el-table-column>
@@ -226,7 +226,7 @@
     </div>
 </template>
 <script>
-import { getPageList, analogy_export_do} from "@/api/sgyhpczl/careabout"
+import { getPageList, analogy_export_do, focus_do} from "@/api/sgyhpczl/careabout"
 import {initJCBM ,initYHLX, initBC ,initJCLB ,initYHBM ,initYHJB,initLlr} from "@/api/sgyhpczl/initSelect";
 
     export default{
@@ -236,14 +236,15 @@
                     page:1,
                     limit:10,
                     type: 0,
-                    form:{},
+                    form:{
+                        ht_community:'众泰煤焦化'
+                    },
                 },
                 radio1:'待发送',
                 table1:true,
                 table2:false,
 
-
-
+                focusDesc: '特别关注',
                 currentPage: 1,
                 pageSize: 10,
                 recordTotal: 0,
@@ -251,6 +252,7 @@
                 JCBMList:[],
                 YHLXList:[],
                 BCList:[],
+                reList:[{label:"值班",value:"值班"},{label:"带班",value:"带班"}],
                 JCLBList:[],
                 YHBMList:[],
                 YHJBList:[],
@@ -283,7 +285,7 @@
         methods:{
             sendBath(){
                 this.$router.push({
-                    path:'/existN'
+                    path:'/managementConcerns'
                 })
             },
             handleClick(data,val){
@@ -305,10 +307,10 @@
                     this.table2=false
                 }
             },
-            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})
                     }
@@ -318,15 +320,6 @@
                 initYHJB().then(res=>{
                     if (res.data.ok==1){
                         this.YHJBList=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})
                     }
@@ -409,7 +402,7 @@
             },
             //重置
             reset(){
-                this.listQuery.form={};
+                this.listQuery.form = {ht_community: "众泰煤焦化"}
                 this.getPageList()
             },
             handleSizeChange(val){
@@ -433,6 +426,11 @@
             },
             typeChange(val){
                 this.listQuery.type = val;
+                if (val == 1){
+                    this.focusDesc = '取消关注'
+                }else {
+                    this.focusDesc = '特别关注'
+                }
                 this.getPageList()
             },
             handleSelectionChange(val){
@@ -451,7 +449,7 @@
                     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) //下载完成移除元素
@@ -460,6 +458,30 @@
                     console.log(err)
                 })
             },
+            //特别关注/取消关注
+            specialFocus(){
+                if (this.selectedList == null || this.selectedList.length == 0) {
+                    this.$message({type: 'warning', message: '至少选中一条数据', duration: 3000})
+                    return
+                }
+                var ids = this.selectedList.map((obj) => {
+                    return obj.id
+                }).join(",")
+                var type = this.listQuery.type == '1' ? 'del' : 'add'
+                let data = {
+                    type: type,
+                    ids: ids,
+                }
+                focus_do(data).then(() => {
+                    this.getPageList()
+                    this.$notify({
+                        title: "成功",
+                        message: "操作成功",
+                        type: "success",
+                        duration: 2000,
+                    });
+                });
+            },
             //日期格式转换
             formatColumnDate(row, column) {
                 // 获取单元格数据

--
Gitblit v1.9.2