From f877ea29a3363133b7dc30d8adc477544a1eaf7f Mon Sep 17 00:00:00 2001
From: cqf <2252655793@qq.com>
Date: 星期四, 26 五月 2022 14:21:58 +0800
Subject: [PATCH] 文件名称如果不以a62b结尾,补上a62b

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

diff --git a/src/views/careabout/index.vue b/src/views/careabout/index.vue
index 416f99c..07ba8a8 100644
--- a/src/views/careabout/index.vue
+++ b/src/views/careabout/index.vue
@@ -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>
@@ -100,7 +100,7 @@
                     <el-option
                         v-for="item in reList"
                         :key="item.value"
-                        :label="item.label"
+                        :label="item.value"
                         :value="item.value">
                     </el-option>
                 </el-select>
@@ -136,21 +136,26 @@
             <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" @click="exportData()">导出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">
             <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" @click="specialFocus()">{{focusDesc}}</el-button>
-                <el-button class="btns" type="primary" size="small" @click="sendBath()">管理关注</el-button>
+<!--                <el-button class="btns" type="primary" size="small" @click="sendBath()">管理关注</el-button>-->
             </el-col>
             </div>
         </el-row>
@@ -230,8 +235,8 @@
     </div>
 </template>
 <script>
-import { getPageList, analogy_export_do, focus_do} from "@/api/sgyhpczl/careabout"
-import {initJCBM ,initYHLX, initBC ,initJCLB ,initYHBM ,initYHJB,initLlr} 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(){
@@ -239,7 +244,7 @@
                 listQuery:{
                     page:1,
                     limit:10,
-                    type: 0,
+                    tag: '全部',
                     form:{
                         ht_community:'众泰煤焦化'
                     },
@@ -256,10 +261,11 @@
                 JCBMList:[],
                 YHLXList:[],
                 BCList:[],
-                reList:[{label:"值班",value:"值班"},{label:"带班",value:"带班"}],
+                reList:[],
                 JCLBList:[],
                 YHBMList:[],
                 YHJBList:[],
+                tagList:[],
                 tableData:[],
                 selectedList:[],
                 listLoading: false,
@@ -278,13 +284,15 @@
             }
         },
         mounted() {
-            this.getPageList();
             this.initYHLX();
             this.initYHJB();
             this.initBC();
             this.initJCLB();
             this.initLlr();
             this.initYHBM();
+            this.initSrxcqk();
+            this.initTags();
+            this.getPageList();
         },
         methods:{
             sendBath(){
@@ -297,18 +305,6 @@
                     this.$router.push({
                         path:'/exist'
                     })
-                }
-            },
-            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
                 }
             },
             initYHLX(){
@@ -356,6 +352,24 @@
                     }
                 })
             },
+            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){
@@ -394,6 +408,7 @@
             //搜索
             getPageList(){
                 this.listQuery.page=1
+                // this.listQuery.limit=10
                 this.checkTime()
                 this.listLoading = true
                 getPageList(this.listQuery).then(res=>{
@@ -437,8 +452,8 @@
                 })
             },
             typeChange(val){
-                this.listQuery.type = val;
-                if (val == 1){
+                this.listQuery.tag = val;
+                if (val == '特别关注'){
                     this.focusDesc = '取消关注'
                 }else {
                     this.focusDesc = '特别关注'
@@ -452,16 +467,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) //下载完成移除元素
@@ -476,22 +494,30 @@
                     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,
+                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 => {
                 });
             },
             //日期格式转换

--
Gitblit v1.9.2