浏览代码

Merge branch 'V0.0.5' of http://10.87.21.221:8000/jzyd_yyds/soc_app into V0.0.5

coys 1 年之前
父节点
当前提交
a9957d2e30

+ 14 - 0
src/assets/css/index.scss

@@ -70,3 +70,17 @@ pre{
   white-space: pre-wrap;
   text-align: justify;
 }
+
+.van-dialog{
+  .van-dialog__message{
+    -text-indent: 2em;
+    word-break: break-word;
+    white-space: pre-wrap;
+    text-align: justify;
+  }
+  .van-dialog__footer{
+    .van-dialog__confirm{
+      color:#0d65eb;
+    }
+  }
+}

+ 38 - 12
src/components/TopBar.vue

@@ -19,17 +19,17 @@
       </div>
     </div>
 
-
+  <!--  天气消息  -->
     <div v-if="showNotice" class="notice-box">
       <div>
-        <van-notice-bar  v-if="list.length>0" left-icon="volume-o" mode="closeable"  :color="color" :background="background">
+        <van-notice-bar v-if="lists.length > 0" left-icon="volume-o" mode="closeable"  :color="color" :background="background">
           <van-swipe
             @change="onChange"
             vertical
             class="notice-swipe"
             :autoplay="8000"
             :show-indicators="false">
-            <van-swipe-item v-for="item in list" :key="item.id" @click="clickHandler(item)" >
+            <van-swipe-item v-for="item in lists" :key="item.id" @click="clickHandler(item)" >
               {{item.alarmTitle}}
             </van-swipe-item>
           </van-swipe>
@@ -37,6 +37,13 @@
       </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">-->
@@ -55,7 +62,6 @@
 <script>
 import { Icon } from 'vant'
 import { mapGetters } from 'vuex'
-
 import { logout, getTheAreaWeather } from '@/api/public'
 export default {
   components: {
@@ -71,24 +77,40 @@ export default {
     return {
       show: false,
       info: '',
+      lists:[],
       active: this.defaultActive,
       color: '#ecf9ff',
       background: 'rgba(78,162,248,0.63)'
     }
   },
+  mounted() {
+    this.getList();
+  },
   computed: {
     ...mapGetters(['userName', 'orgName','roleList', 'orgId']),
+  },
+  methods: {
     //获取天气数据
-    list() {
+    getList() {
       if(!this.orgId)return [];
-      let lists = [];
       getTheAreaWeather(this.orgId).then(res => {
-       lists = res.data
+        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:"福建"
+        // }
+        // this.lists.push(str)
       })
-      return lists;
-    }
-  },
-  methods: {
+    },
     onChange(index){
       let alarmLevel = this.list[index].alarmLevel;
       switch (alarmLevel){
@@ -117,7 +139,8 @@ export default {
       })
     },
     clickHandler(item) {
-      this.info = item.alarmContent;
+      console.log(121212)
+      this.info = item;
       this.show = true;
     },
   }
@@ -153,6 +176,9 @@ export default {
     width: 100%;
   }
 }
+.dialog-title{
+  padding: 0 30px;
+}
 .top-box {
   display: flex;
   justify-content: space-between;

+ 13 - 0
src/router/index.js

@@ -22,6 +22,8 @@ Router.prototype.replace = function push(location, onResolve, onReject) {
   if (onResolve || onReject) return originalReplace.call(this, location, onResolve, onReject)
   return originalReplace.call(this, location).catch(err => err)
 }
+
+
 // 路由守卫
 router.beforeEach((to, from, next) => {
   //路由守卫控制登陆页面取消水印非登录页显示水印
@@ -34,6 +36,17 @@ router.beforeEach((to, from, next) => {
       document.querySelector('#water').style.display = 'block'
     }
   }
+  let object = {
+    to:{
+      name:to.name,
+      path:to.path
+    },
+    from:{
+      name:from.name,
+      path:from.path
+    }
+  }
+  sessionStorage.setItem('ROUTER',JSON.stringify(object));
   console.log('从' + from.path + '跳向' + to.path)
   //如果当前是工作台页面返回的时候判断当前是否是A标签跳转是进行重定向到works
   switch (to.path) {

+ 8 - 2
src/utils/globalMixins.js

@@ -7,6 +7,8 @@ import { imgUrl } from '@/utils/index'
 export default {
   data() {
     return {
+      fromPage:null,
+      toPage:null,
       globalLoading:false,
     }
   },
@@ -19,7 +21,11 @@ export default {
 
   methods: {
     ...mapActions(['setDict']),
-
+    getRouter(){
+      let router = JSON.parse(sessionStorage.getItem('ROUTER'));
+      this.fromPage = router.from;
+      this.toPage = router.to;
+    },
     setDicts() {
       this.dicts.forEach(item => {
         this.setDict(item)
@@ -175,6 +181,6 @@ export default {
       }
       return 3
     },
-    
+
   }
 }

+ 20 - 14
src/views/menu/resumption/detail.vue

@@ -103,9 +103,10 @@
           <van-col span="8">
             <van-cell>
               <div class="okAll">
-                <van-radio-group v-if="enable" v-model="selectRadio" @change="changeSwitch">
+                <van-button type="default" icon="checked" size="small" @click="changeSwitch">一键正常</van-button>
+                <!--<van-radio-group v-if="enable" v-model="selectRadio" @change="changeSwitch">
                   <van-radio name="1" icon-size="20px">一键正常</van-radio>
-                </van-radio-group>
+                </van-radio-group>-->
               </div>
             </van-cell>
           </van-col>
@@ -523,15 +524,15 @@ export default {
       let num = 0
       for (let i = 0; i < this.checks.length; i++) {
         for (let j = 0; j < this.checks[i].points.length; j++) {
-          this.checks[i].points[j].dataStatus = 2
-          num++
+          if(this.checks[i].areaId === this.areaId){
+            this.checks[i].points[j].dataStatus = 2
+            num++
+          }
         }
       }
       this.resumptionData.yesPointNums = num
       this.resumptionData.noPointNums = 0
-      this.areas.forEach((item, index) => {
-        this.validateArea(item.areaId)
-      })
+      this.validateAreaAll();
       this.openCollapseItems()
     },
     validateAreaAll() {
@@ -550,6 +551,7 @@ export default {
       let total = 0;
       //完成检查项数量
       let yes = 0;
+      let loading = 0
       //完成NFC扫描的数量
       let nfc_num = 0;
       let nfc_no = 0;
@@ -559,12 +561,11 @@ export default {
           if (item.areaId === areaId) {
             total++
             if (point.dataStatus === 2) {
+              yes++
               if(point.resValue === 1){
-                if(point.resRemark !== null && point.resRemark !== "" && point.rectificationDeadline !== null){
-                  yes++;
+                if(point.resRemark === null || point.resRemark === "" || point.rectificationDeadline === null){
+                  loading++;
                 }
-              }else{
-                yes++
               }
             }
           }
@@ -584,7 +585,10 @@ export default {
       if (total === yes &&  nfc_no === 0) {
         //检查项完成检查,nfc完成扫描,或者没有nfc扫描
         areaStatus = '1'
-      } else if (yes === 0 && nfc_no === nfc_num  ) {
+        if(loading > 0){
+          areaStatus = '2'
+        }
+      } else if ( yes === 0 && nfc_no === nfc_num  ) {
         //检查项完成检查项为0,nfc也没动
         areaStatus = '0'
       } else {
@@ -742,7 +746,6 @@ export default {
       data.checks = this.checks
       data.nfcs = this.nfcs
       data.subType = 1
-
       saveTask(data).then(res => {
         this.$toast('保存成功');
       })
@@ -952,7 +955,10 @@ export default {
   align-items: center;
   box-shadow: 0 2px 6px #ddd;
   position: relative;
-
+  height: 80px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
   .ysj {
     position: absolute;
     right: 5px;

+ 35 - 18
src/views/menu/safetyBook/detail.vue

@@ -1,18 +1,20 @@
 <template>
-  <div class="detail">
+  <div class="safetyBook-detail">
     <nav-bar></nav-bar>
     <div class="page-container">
-      <van-cell-group>
-        <van-cell class="item-cell" title="签署层级" :value="getDictLabel(dataInfo.signLevel,'sign_level')" ></van-cell>
-        <van-cell class="item-cell" title="签署责任书类型" :value="getDictLabel(dataInfo.type,'safety_book_type')" ></van-cell>
-        <van-cell class="item-cell" title="所属年度" :value="`${dataInfo.year}年`" ></van-cell>
-        <van-cell class="item-cell" title="甲方姓名" :value="dataInfo.partyA" ></van-cell>
-        <van-cell class="item-cell" title="甲方机构" :value="dataInfo.partyAOrgName"></van-cell>
-        <van-cell class="item-cell" title="乙方姓名" :value="dataInfo.partyB" ></van-cell>
-        <van-cell class="item-cell" title="乙方机构" :value="dataInfo.partyBOrgName" ></van-cell>
-        <van-cell class="item-cell" title="签署时间" :value="dayjs(dataInfo.time).format('YYYY-MM-DD HH:mm')"></van-cell>
-<!--        <van-cell class="item-cell" title="添加时间" :value="dayjs(dataInfo.createTime).format('YYYY-MM-DD HH:mm')"></van-cell>-->
-      </van-cell-group>
+      <div class="panel">
+        <van-cell-group>
+          <van-cell class="item-cell" title="签署层级" :value="getDictLabel(dataInfo.signLevel,'sign_level')" ></van-cell>
+          <van-cell class="item-cell" title="责任书类型" :value="getDictLabel(dataInfo.type,'safety_book_type')" ></van-cell>
+          <van-cell class="item-cell" title="所属年度" :value="`${dataInfo.year}年`" ></van-cell>
+          <van-cell class="item-cell" title="甲方姓名" :value="dataInfo.partyA" ></van-cell>
+          <van-cell class="item-cell" title="甲方机构" :value="dataInfo.partyAOrgName"></van-cell>
+          <van-cell class="item-cell" title="乙方姓名" :value="dataInfo.partyB" ></van-cell>
+          <van-cell class="item-cell" title="乙方机构" :value="dataInfo.partyBOrgName" ></van-cell>
+          <van-cell class="item-cell" title="签署时间" :value="dayjs(dataInfo.time).format('YYYY-MM-DD HH:mm')"></van-cell>
+          <!--        <van-cell class="item-cell" title="添加时间" :value="dayjs(dataInfo.createTime).format('YYYY-MM-DD HH:mm')"></van-cell>-->
+        </van-cell-group>
+      </div>
       <div class="book-list">
         <div class="card">
           <van-cell v-if="dataInfo.files && dataInfo.files.length > 0"  title="签署文件" >
@@ -64,25 +66,40 @@ export default {
   }
 }
 </script>
+<style lang="scss">
+  .safetyBook-detail{
+    .panel{
+      .van-cell__title{
+        flex: .3;
+      }
+      .van-cell__value{
+        flex: .7;
+      }
+    }
+  }
+</style>
 <style lang="scss" scoped>
-.detail {
+.safetyBook-detail {
 
 }
 .page-container {
 
 }
-.book-list{
-  height: calc(100vh - 846px);
-  overflow: auto;
-  padding: 20px;
+.panel{
+  padding: 20px 20px 0;
 }
-.card {
+.card{
   margin-bottom: 20px;
   box-shadow: 0 10px 10px #eaeaea;
   &:last-child {
     margin-bottom: 0;
   }
 }
+.book-list{
+  max-height: 400px;
+  overflow: auto;
+  padding: 20px;
+}
 .file-list{
   width: 100%;
   min-height: 40px;

+ 20 - 11
src/views/menu/securityCheckRegister/add.vue

@@ -264,7 +264,6 @@ export default {
     checkNFC(){
       //设置nfc调用后的回调
       window.openNFCScanCallBack = this.openNFCScanCallBack;
-
       //设置loading弹窗
       this.$toast.loading({
         duration: 0, // 持续展示 toast
@@ -446,11 +445,16 @@ export default {
       this.taskInfo.isSubmit = 0;
       registerSubmit(this.taskInfo).then(res => {
         this.$toast('保存成功');
-        this.$router.replace({
-          name:'securityCheckRegister',
-          path:'/securityCheckRegister',
-          params:{event:'refresh'}
-        });
+        this.getRouter();
+        if(this.fromPage.name === "works"){
+          this.$router.go(-1)
+        }else {
+          this.$router.replace({
+            name:'securityCheckRegister',
+            path:'/securityCheckRegister',
+            params:{event:'refresh'}
+          });
+        }
       })
     },
 //
@@ -481,11 +485,16 @@ export default {
       console.log(this.taskInfo,'taskInfo')
       registerSubmit(this.taskInfo).then(res => {
         this.$toast('提交成功')
-        this.$router.replace({
-          name:'securityCheckRegister',
-          path:'/securityCheckRegister',
-          params:{event:'refresh'}
-        });
+        this.getRouter();
+        if(this.fromPage.name === "works"){
+          this.$router.go(-1)
+        }else {
+          this.$router.replace({
+            name:'securityCheckRegister',
+            path:'/securityCheckRegister',
+            params:{event:'refresh'}
+          });
+        }
       })
     },
 

+ 5 - 1
src/views/menu/securityCheckRegister/addCheck.vue

@@ -112,7 +112,11 @@ export default {
         return;
       }
       let data = JSON.parse(JSON.stringify(this.query));
-      data.ruleId = this.query.ruleId || this.ruleIdList;
+      if(this.query.ruleId){
+        data.ruleId = [this.query.ruleId];
+      }else {
+        data.ruleId = this.ruleIdList;
+      }
       checkList(data).then(res=>{
         if(res.total === '0'){
           this.pullup = false;

+ 10 - 4
src/views/menu/visitRecord/add.vue

@@ -62,7 +62,7 @@
                 <uploader :maxCount="2" v-model="formData.checkImage"/>
               </van-cell>
             </div>
-            <date-cell required title="到达时间" :min-date="selectedUser.startTime"  :max-date="maxDate" v-model="formData.arrivalTime" date-type="datetime" />
+            <date-cell required title="到达时间" :min-date="selectedUser.minDate"  :max-date="maxDate" v-model="formData.arrivalTime" date-type="datetime" />
 <!--            <date-cell title="离开时间" :max-date="maxData" v-model="formData.departureTime" date-type="datetime" />-->
           </div>
           <div class="big-btn-box" >
@@ -118,8 +118,9 @@ import Uploader from "@/components/upload/gxuploader.vue";
 import {formatDate} from "@/filters/filter";
 import {mapGetters} from "vuex";
 import {imgUrl} from "@/utils";
-import { ImagePreview } from 'vant'
+import {ImagePreview } from 'vant'
 import {userList, userRegister} from './api'
+import dayjs from "dayjs";
 export default {
   components: {SearchSelectCell,Uploader, DateCell},
   data(){
@@ -155,7 +156,7 @@ export default {
     this.getUserList();
   },
   methods:{
-    imgUrl,formatDate,
+    dayjs, imgUrl,formatDate,
     onClick(){
       this.showPicker = true;
     },
@@ -178,7 +179,9 @@ export default {
       this.showPicker = false;
     },
     onSearchConfirm() {
+      this.onSelected.minDate = dayjs(this.onSelected.startTime).toDate() || new Date();
       this.selectedUser = this.onSelected;
+      this.formData.arrivalTime = null;
       this.showPicker = false;
     },
     inputSearchValue(query) {
@@ -225,8 +228,11 @@ export default {
         });
       })
     },
+    /* 失效*/
     getItemInfo(item){
-      item.startTime = new Date(item.startTime) || new Date();
+      console.log(dayjs(item.startTime).toDate(),'77777777')
+      item.maxDate = dayjs(item.startTime).toDate() || new Date();
+      console.log(item.maxDate,'77777777')
       this.selectedUser = item;
       this.formData.arrivalTime = null;
     },