Переглянути джерело

修改nfc管理中机构类型

凉纪 1 рік тому
батько
коміт
2915414154

+ 4 - 4
src/components/OrgPicker/index.vue

@@ -18,7 +18,7 @@
       <div class="lists">
         <tree
           v-bind="$attrs"
-          :data="commonTree"
+          :data="orgTree"
           v-model='selected'
           :filter="searchValue"
           :options="options"
@@ -66,16 +66,16 @@ export default {
         keyboardNavigation:false,
         deletion: false,
         propertyNames:{
-          text:'name'
+          text:'shortName'
         }
       }
     }
   },
   computed:{
-    ...mapGetters(['commonTree']),
+    ...mapGetters(['orgTree']),
   },
   created() {
-    this.$store.dispatch('getCommonTree')
+    this.$store.dispatch('getOrgTree')
   },
   methods:{
     clickOverlay(){

+ 4 - 145
src/components/TopBar.vue

@@ -19,136 +19,19 @@
       </div>
     </div>
 
-  <!--  天气消息  -->
-    <div v-if="showNotice" class="notice-box">
-      <div>
-        <van-notice-bar v-if="lists.length > 0" left-icon="volume-o" mode="closeable"  :color="color" :background="background">
-          <van-swipe
-            @change="changeColor"
-            vertical
-            class="notice-swipe"
-            :autoplay="8000"
-            :show-indicators="false">
-            <van-swipe-item v-for="item in lists" :key="item.id" @click="clickHandler(item)" >
-              {{item.alarmTitle}}
-            </van-swipe-item>
-          </van-swipe>
-        </van-notice-bar>
-      </div>
-    </div>
-
-    <!-- 弹窗 -->
-    <van-dialog v-model="show" title="标题" :message="info.alarmContent" messageAlign="left">
-      <template #title>
-        <p class="dialog-title" :style="{color:background}">{{info.alarmTitle}}</p>
-      </template>
-    </van-dialog>
-
-
-<!--    &lt;!&ndash; 天气预警 &ndash;&gt;-->
-<!--    <van-swipe v-if="list.length > 0" style="height: 50px" vertical autoplay="2000">-->
-<!--      <van-swipe-item v-for="item in list" :key="item.id" @click="clickHandler(item)">-->
-<!--        <div class="color" :style="{ color: item.bgc, backgroundColor: '#fff' }">-->
-<!--          <van-icon name="warn-o" /> {{ item.alarmTitle }}-->
-<!--        </div>-->
-<!--      </van-swipe-item>-->
-
-<!--      <template #indicator>-->
-<!--        <div class="custom-indicator"></div>-->
-<!--      </template>-->
-<!--    </van-swipe>-->
   </div>
 </template>
 <script>
-import { Icon } from 'vant'
 import { mapGetters } from 'vuex'
-import { logout, getTheAreaWeather } from '@/api/public'
+import { logout } from '@/api/public'
 export default {
-  components: {
-    [Icon.name]: Icon
-  },
-  props:{
-    showNotice:{
-      type:Boolean,
-      default:true
-    },
-  },
   data() {
-    return {
-      show: false,
-      info: '',
-      lists:[],
-      active: this.defaultActive,
-      color: '#ecf9ff',
-      background: null
-    }
-  },
-  mounted() {
-    this.getList();
+    return {}
   },
   computed: {
     ...mapGetters(['userName', 'orgName','roleList', 'orgId']),
   },
   methods: {
-    //获取天气数据
-    getList() {
-      if(!this.orgId)return [];
-      getTheAreaWeather(this.orgId).then(res => {
-        this.lists = res.data || [];
-        //模拟数据
-        // let str = [
-        //   {
-        //     alarmContent:"周宁县气象台2023年12月13日10时27分继续发布大雾黄色预警信号:预计未来12小时,我县部分乡镇将出现能见度小于500米的雾。请注意防范!(预警信息来源:国家预警信息发布中心)",
-        //     alarmLevel:"黄色",
-        //     alarmTime:"2023-12-13 14:00:10",
-        //     alarmTitle:"周宁县气象台2023年12月13日10时27分继续发布大雾黄色预警信号",
-        //     alarmType:"大雾",
-        //     area:"周宁",
-        //     city:"宁德",
-        //     code:"101230305",
-        //     createTime:"2023-12-13 10:27:00",
-        //     id:"8",
-        //     province:"福建"
-        //   },
-        //   {
-        //     alarmContent:"YY县气象台2023年12月13日10时27分继续发布大雾黄色预警信号:预计未来12小时,我县部分乡镇将出现能见度小于500米的雾。请注意防范!(预警信息来源:国家预警信息发布中心)",
-        //     alarmLevel:"红色",
-        //     alarmTime:"2023-12-13 14:00:10",
-        //     alarmTitle:"YY县气象台2023年12月13日10时27分继续发布大雾黄色预警信号",
-        //     alarmType:"大雾",
-        //     area:"周宁",
-        //     city:"宁德",
-        //     code:"101230305",
-        //     createTime:"2023-12-13 10:27:00",
-        //     id:"9",
-        //     province:"福建"
-        //   },
-        // ]
-        //this.lists = str;
-        this.changeColor(0);
-      })
-    },
-    changeColor(index){
-      console.log(this.lists,'alarmLevel')
-      let alarmLevel = this.lists[index].alarmLevel;
-      switch (alarmLevel){
-        case '蓝色':
-          this.background = 'rgba(78,162,248,0.62)';
-          //this.color = '#fff';
-          break;
-        case '黄色':
-          this.background = 'rgba(238,227,103,0.63)';
-          //this.color = '#fdb0b1';
-          break;
-        case '橙色':
-          this.background = 'rgba(246,181,104,0.62)';
-          //this.color = '#fff';
-          break;
-        case '红色':
-          this.background = 'rgba(239,70,74,0.65)';
-          //this.color = '#fff';
-      }
-    },
     clickOutLogin() {
       logout().then(res => {
         sessionStorage.clear();
@@ -156,26 +39,10 @@ export default {
         this.$toast('退出登录');
       })
     },
-    clickHandler(item) {
-      this.info = item;
-      this.show = true;
-    },
   }
 }
 </script>
-<style lang="scss">
-.van-notice-bar{
-  line-height:60px;
-  height: 60px;
-}
-.notice-swipe {
-  height: 30px;
-  line-height: 30px;
-}
-.van-swipe-item{
-  text-shadow: 0 0 3px #888;
-}
-</style>
+
 <style scoped lang="scss">
 .top-bar-box{
   position: relative;
@@ -193,9 +60,7 @@ export default {
     width: 100%;
   }
 }
-.dialog-title{
-  padding: 0 30px;
-}
+
 .top-box {
   display: flex;
   justify-content: space-between;
@@ -204,12 +69,6 @@ export default {
     font-size: 40px;
   }
 }
-.notice-box{
-  width: 100%;
-  position: absolute;
-  bottom: -80;
-  z-index: 1000;
-}
 .bottom-box {
   padding-top: 30px;
   > div {

+ 152 - 0
src/components/weatherBox/index.vue

@@ -0,0 +1,152 @@
+<template>
+  <div>
+    <!--  天气消息  -->
+    <div v-if="showNotice" class="notice-box">
+      <div>
+        <van-notice-bar v-if="lists.length > 0" left-icon="volume-o" mode="closeable"  :color="color" :background="background">
+          <van-swipe
+            @change="changeColor"
+            vertical
+            class="notice-swipe"
+            :autoplay="8000"
+            :show-indicators="false">
+            <van-swipe-item v-for="item in lists" :key="item.id" @click="clickHandler(item)" >
+              {{item.alarmTitle}}
+            </van-swipe-item>
+          </van-swipe>
+        </van-notice-bar>
+      </div>
+    </div>
+
+    <!-- 弹窗 -->
+    <van-dialog v-model="show" title="标题" :message="info.alarmContent" messageAlign="left">
+      <template #title>
+        <p class="dialog-title" :style="{color:info.color}">
+          {{info.alarmTitle}}
+        </p>
+      </template>
+    </van-dialog>
+
+  </div>
+</template>
+
+<script >
+import { mapGetters } from 'vuex'
+import { getTheAreaWeather } from '@/api/public'
+export default {
+  props:{
+    showNotice:{
+      type:Boolean,
+      default:true
+    },
+  },
+  data() {
+    return {
+      show: false,
+      info: '',
+      lists:[],
+      active: this.defaultActive,
+      color: '#ecf9ff',
+      background: null
+    }
+  },
+  mounted() {
+    this.getList();
+  },
+  computed: {
+    ...mapGetters(['orgId']),
+  },
+  methods: {
+    //获取天气数据
+    getList() {
+      if(!this.orgId)return [];
+      getTheAreaWeather(this.orgId).then(res => {
+        this.lists = res.data || [];
+        //模拟数据
+        // let str = [
+        //   {
+        //     alarmContent:"周宁县气象台2023年12月13日10时27分继续发布大雾黄色预警信号:预计未来12小时,我县部分乡镇将出现能见度小于500米的雾。请注意防范!(预警信息来源:国家预警信息发布中心)",
+        //     alarmLevel:"黄色",
+        //     alarmTime:"2023-12-13 14:00:10",
+        //     alarmTitle:"周宁县气象台2023年12月13日10时27分继续发布大雾黄色预警信号",
+        //     alarmType:"大雾",
+        //     area:"周宁",
+        //     city:"宁德",
+        //     code:"101230305",
+        //     createTime:"2023-12-13 10:27:00",
+        //     id:"8",
+        //     province:"福建"
+        //   },
+        //   {
+        //     alarmContent:"YY县气象台2023年12月13日10时27分继续发布大雾黄色预警信号:预计未来12小时,我县部分乡镇将出现能见度小于500米的雾。请注意防范!(预警信息来源:国家预警信息发布中心)",
+        //     alarmLevel:"红色",
+        //     alarmTime:"2023-12-13 14:00:10",
+        //     alarmTitle:"YY县气象台2023年12月13日10时27分继续发布大雾黄色预警信号",
+        //     alarmType:"大雾",
+        //     area:"周宁",
+        //     city:"宁德",
+        //     code:"101230305",
+        //     createTime:"2023-12-13 10:27:00",
+        //     id:"9",
+        //     province:"福建"
+        //   },
+        // ]
+        //this.lists = str;
+        this.changeColor(0);
+      })
+    },
+    changeColor(index){
+      console.log(this.lists,'alarmLevel')
+      let alarmLevel = this.lists[index].alarmLevel;
+      switch (alarmLevel){
+        case '蓝色':
+          this.background = 'rgba(78,162,248,0.62)';
+          //this.color = '#fff';
+          break;
+        case '黄色':
+          this.background = 'rgba(238,227,103,0.63)';
+          //this.color = '#fdb0b1';
+          break;
+        case '橙色':
+          this.background = 'rgba(246,181,104,0.62)';
+          //this.color = '#fff';
+          break;
+        case '红色':
+          this.background = 'rgba(239,70,74,0.65)';
+        //this.color = '#fff';
+      }
+    },
+    clickHandler(item) {
+      this.info = item;
+      this.info.color = this.background;
+      this.show = true;
+    },
+  }
+}
+</script>
+
+<style lang="scss">
+.van-notice-bar{
+  line-height:60px;
+  height: 60px;
+}
+.notice-swipe {
+  height: 30px;
+  line-height: 30px;
+}
+.van-swipe-item{
+  text-shadow: 0 0 3px #888;
+}
+</style>
+<style scoped lang="scss">
+
+.dialog-title{
+  padding: 0 30px;
+}
+.notice-box{
+  width: 100%;
+  position: absolute;
+  bottom: -80;
+  z-index: 1000;
+}
+</style>

+ 9 - 9
src/views/home/works.vue

@@ -1,8 +1,7 @@
 <template>
   <div class="index-container">
-    
     <nav-bar :leftArrow="false"></nav-bar>
-
+    <weather-box></weather-box>
     <!-- 步骤条 -->
     <van-tabs class="tab-tabs" color="#008cd6" @click="tabClickHandler" v-if="workList && workList.length > 0">
       <van-tab
@@ -78,6 +77,7 @@
 <script>
 import scandialog from '@/components/nfcPopup/alone.vue'
 import TopBar from '@/components/TopBar'
+import WeatherBox from "@/components/weatherBox/index.vue";
 import { Toast, Dialog } from 'vant'
 import { base64ToBlob } from '@/utils/base64TurnImg.js'
 import { registration, resetTask } from '@/api/toConsult.js'
@@ -85,7 +85,7 @@ import { upload } from '@/api/public'
 import { getPanelList } from '@/api/drillTask.js'
 export default {
   name: 'works',
-  components: { TopBar, scandialog },
+  components: { TopBar, scandialog ,WeatherBox},
   data() {
     return {
       big_box: 'big_box',
@@ -205,7 +205,7 @@ export default {
           str = '/lfsp'
           strName = '待审批'
           path = '/visitCheck'
-          pathInfo = '/visitCheckDetail?id=' + id 
+          pathInfo = '/visitCheckDetail?id=' + id
           break
       }
 
@@ -251,7 +251,7 @@ export default {
           strName = '待整改'
         } else if (val == 9 && taskType == 1) {
           strName = '待审批'
-        } 
+        }
         return strName
       } else if (type == 3) {
         //返回列表路径
@@ -264,12 +264,12 @@ export default {
           strName = '待审批'
           // pathInfo = '/consultInfo/' + id + '_1'
           pathInfo = '/problemDetail?id=' + id + '&type=confirmDissent'
-          
+
         }
         if (val == 9 && taskType == 10) {
           strName = '待整改'
           pathInfo = '/problemDetail?id=' + id + '&type=reform'
-        
+
         }
         //监控调阅
         if (val == 3 && taskType == 1) {
@@ -400,8 +400,8 @@ export default {
 }
 .cellMargin {
   margin: 20px;
-  margin-top: 0px;
-  height: calc(100vh - 380px);
+  -margin-top: 0px;
+  height: calc(100vh - 376px);
   box-shadow: 0 1px 4px #ccc;
   background-color: #fff;
   overflow-y: scroll;

+ 23 - 10
src/views/menu/visitCheck/detail.vue

@@ -116,15 +116,28 @@ export default {
         }
         visitCheck(data).then(res=>{
           this.$toast('操作成功');
-          this.$router.replace({
-            name:'visitCheck',
-            path:'/visitCheck',
-            params:{event:'refresh'}
-          });
+          this.toPagesFcn();
+        }).catch(error=>{
+          if( error === '任务已完成'){
+            this.toPagesFcn();
+          }
         })
       }
       this.showInput = true;
     },
+    //页面跳转逻辑
+    toPagesFcn(){
+      this.getRouter();
+      if(this.fromPage.name === "works"){
+        this.$router.go(-1)
+      }else {
+        this.$router.replace({
+          name:'visitCheck',
+          path:'/visitCheck',
+          params:{event:'refresh'}
+        });
+      }
+    },
     // 同意
     accredit(){
       let data = {
@@ -133,11 +146,11 @@ export default {
       }
       visitCheck(data).then(res=>{
         this.$toast('操作成功');
-        this.$router.replace({
-          name:'visitCheck',
-          path:'/visitCheck',
-          params:{event:'refresh'}
-        });
+        this.toPagesFcn();
+      }).catch(error=>{
+        if( error === '任务已完成'){
+          this.toPagesFcn();
+        }
       })
     },
     getState(state){