Browse Source

添加tabs小红点,修复作息bug,修改隐患时间显示格式

凉纪 1 year ago
parent
commit
ca3ac175bb

+ 9 - 0
src/api/public.js

@@ -66,6 +66,15 @@ export function userInfo() {
   })
 }
 
+// 获取用户详细信息
+export function getDot() {
+  return request({
+    url: '/core/center/haveRead',
+    method: 'get'
+  })
+}
+
+
 // 退出方法
 export function logout() {
   return request({

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

@@ -88,3 +88,34 @@ pre{
 .van-tabs__line{
   background-color:#008cd6;
 }
+
+.cell-item28 {
+  .van-cell__title{
+    flex:.2;
+  }
+  .van-cell__value{
+    flex:.8;
+  }
+}
+.cell-item25 {
+  .van-cell__title{
+    flex:.25;
+  }
+  .van-cell__value{
+    flex:.75;
+  }
+}
+.cell-item37 {
+  .van-cell__title{
+    flex:.3;
+  }
+  .van-cell__value{
+    flex:.7;
+  }
+}
+.van-info {
+  background-color: #008cd6;
+}
+.van-info--dot{
+  background-color:#ee0a24;
+}

+ 14 - 9
src/components/layouts/index.vue

@@ -14,7 +14,7 @@
 
 <script>
 import TabBar from '@/components/TabBar'
-import { userInfo } from '@/api/public'
+import { userInfo,getDot } from '@/api/public'
 export default {
   data() {
     return {
@@ -26,14 +26,15 @@ export default {
           to: {
             name: 'works'
           },
-          icon: 'home-o'
+          icon: 'home-o',
         },
         {
           title: '消息',
           to: {
             name: 'message'
           },
-          icon: 'comment-o'
+          icon: 'comment-o',
+          dot:false
         },
         {
           title: '菜单',
@@ -56,7 +57,8 @@ export default {
     TabBar
   },
   created() {
-    this.getUserInfo()
+    this.getUserInfo();
+    this.getDotData();
   },
   watch: {
     $route(to, from) {
@@ -80,6 +82,11 @@ export default {
     }
   },
   methods: {
+    getDotData(){
+      getDot().then(res=>{
+        this.tabTars[1].dot = res.data;
+      })
+    },
     getUserInfo() {
       userInfo().then(info => {
         console.log(info, 'info')
@@ -90,17 +97,15 @@ export default {
         this.$store.commit('SET_USER_ORGNAME', info.user.orgName)
         this.$store.commit('SET_USER_ORGTYPE', info.user.orgType)
         //登陆之后手动触发一次水印数据刷新
-        
-
           this.$parent.$refs.watercom.getWater(1)
-          
-       
       })
-
       this.$store.dispatch('getOrgTree')
       this.$store.dispatch('getOrgTreeHangshe')
     },
     handleChange(v) {
+      if(v == 1){
+        this.getDotData();
+      }
       console.log('tab value:', v)
     }
   }

+ 0 - 1
src/views/home/works.vue

@@ -364,7 +364,6 @@ export default {
 <style>
 .van-info {
   right: -12px;
-  background-color: #008cd6;
 }
 </style>
 <style lang="scss" scoped>

+ 1 - 1
src/views/menu/message/index.vue

@@ -254,7 +254,7 @@ export default {
   display: none;
   &.active{
     display: block;
-    background-color: #D7000F;
+    background-color: #ee0a24;
   }
 }
 .message-detail{

+ 0 - 3
src/views/menu/resumption/list.vue

@@ -289,9 +289,6 @@ export default {
   .van-tabs__line{
     background-color: #008cd6;
   }
-  .van-info {
-    background-color: #008cd6;
-  }
 }
 </style>
 <style lang="scss" scoped>

+ 6 - 6
src/views/menu/securityCheckRegister/add.vue

@@ -12,9 +12,9 @@
               </span>
             </template>
           </van-cell>
-          <van-cell title="日期时间" :value="formatTime(taskInfo.planStartTime,taskInfo.planEndTime)" />
-          <van-cell title="受检机构" :value="taskInfo.beCheckedOrgName" />
-          <van-cell v-if="!enable" title="检查组成员" :value="taskInfo.checkTeam || '无'" />
+          <van-cell class="cell-item28" title="日期时间" :value="formatTime(taskInfo.planStartTime,taskInfo.planEndTime)" />
+          <van-cell class="cell-item28" title="受检机构" :value="taskInfo.beCheckedOrgName" />
+          <van-cell class="cell-item28" v-if="!enable" title="检查组成员" :value="taskInfo.checkTeam || '无'" />
           <van-field
             v-else
             v-model="taskInfo.checkTeam"
@@ -140,7 +140,7 @@
             <div v-if="unmetList.length > 0" class="nfc-list">
               <van-cell v-for="item in unmetList" :title="item.nfcName" :key="item.nfcCode">
                 <!-- <img :src="require('../../../assets/svg/NFC.svg')" class="nfc-icon"/>-->
-                <span >{{item.pointScan === 1?'必扫':'可选'}}</span>
+                <span >{{item.pointScan == 1?'必扫':'可选'}}</span>
               </van-cell>
             </div>
             <van-empty v-else description="" />
@@ -148,7 +148,7 @@
           <van-tab title="已扫描" name="a">
             <div v-if="fullList.length > 0" class="nfc-list">
               <van-cell v-for="item in fullList" :title="item.nfcName" :key="item.nfcCode">
-                <span style="color: green"> {{item.scanMethod === 1?'NFC扫描':'拍照上传'}}</span>
+                <span style="color: green"> {{item.scanMethod == 0?'NFC扫描':'拍照上传'}}</span>
               </van-cell>
             </div>
             <van-empty v-else description="" />
@@ -377,7 +377,7 @@ export default {
 
     //格式化时间范围
     formatTime(start,end,format){
-      format = format || 'YYYY-MM-DD'
+      format = format || 'YYYY-MM-DD'
       return `${this.dayjs(start).format(format)} ~ ${this.dayjs(end).format(format)}`;
     },
     //插入检查项

+ 6 - 6
src/views/menu/securityCheckRegister/detail.vue

@@ -12,9 +12,9 @@
               </span>
             </template>
           </van-cell>
-          <van-cell title="日期时间" :value="formatTime(taskInfo.planStartTime,taskInfo.planEndTime)" />
-          <van-cell title="受检机构" :value="taskInfo.beCheckedOrgName" />
-          <van-cell title="检查组成员" :value="taskInfo.checkTeam || '无'" />
+          <van-cell class="cell-item28" title="日期时间" :value="formatTime(taskInfo.planStartTime,taskInfo.planEndTime)" />
+          <van-cell class="cell-item28" title="受检机构" :value="taskInfo.beCheckedOrgName" />
+          <van-cell class="cell-item28" title="检查组成员" :value="taskInfo.checkTeam || '无'" />
         </van-cell-group>
       </div>
       <!--  检查项目    -->
@@ -96,7 +96,7 @@
             <div v-if="unmetList.length > 0" class="nfc-list">
               <van-cell v-for="item in unmetList" :title="item.nfcName" :key="item.nfcCode">
                 <!-- <img :src="require('../../../assets/svg/NFC.svg')" class="nfc-icon"/>-->
-                <span >{{item.pointScan === 1?'必扫':'可选'}}</span>
+                <span >{{item.pointScan == 1?'必扫':'可选'}}</span>
               </van-cell>
             </div>
             <van-empty v-else description="" />
@@ -104,7 +104,7 @@
           <van-tab title="已扫描" name="a">
             <div v-if="fullList.length > 0" class="nfc-list">
               <van-cell v-for="item in fullList" :title="item.nfcName" :key="item.nfcCode">
-                <span style="color: green"> {{item.scanMethod === 1?'NFC扫描':'拍照上传'}}</span>
+                <span style="color: green"> {{item.scanMethod == 0?'NFC扫描':'拍照上传'}}</span>
               </van-cell>
             </div>
             <van-empty v-else description="" />
@@ -289,7 +289,7 @@ export default {
 
     //格式化时间范围
     formatTime(start,end,format){
-      format = format || 'YYYY-MM-DD'
+      format = format || 'YYYY-MM-DD'
       return `${this.dayjs(start).format(format)} ~ ${this.dayjs(end).format(format)}`;
     },
 

+ 6 - 1
src/views/menu/securityCheckRegister/index.vue

@@ -30,7 +30,7 @@
           <empty v-if="!dataList || dataList.length === 0" />
           <card class="list-item" v-for="(v,i) in dataList" :key="v.planId+i">
             <div class="item-title">
-              <van-cell :title="v.taskName" :border="false" :label="rangDate(formatDate(v.planStartTime,'DATE'),formatDate(v.planEndTime,'DATE'))" ></van-cell>
+              <van-cell :title="v.taskName" :border="false" :label="formatTime(v.planStartTime,v.planEndTime)" ></van-cell>
               <div class="collapse-title">
                 <div :class="{'active':v.active==2}" @click.stop="changeList(v,2)">
                   <p>{{v.uncompleted.length}}</p>
@@ -135,6 +135,11 @@ export default {
   },
   methods: {
     formatDate,
+    //格式化时间范围
+    formatTime(start,end,format){
+      format = format || 'YYYY年-MM月-DD日'
+      return `${this.dayjs(start).format(format)} ~ ${this.dayjs(end).format(format)}`;
+    },
     clickItem(item){
       if(item.status == 3 || item.status == 4){
         this.$router.push(

+ 17 - 9
src/views/menu/workTime/index.vue

@@ -126,6 +126,15 @@ export default {
     },
     copyMouth(){
       if(!this.formData.ymdDate) return this.$toast('请选择日期');
+      if(this.formData.isEnable === null) return this.$toast('请选择营业状态');
+      if(this.formData.isEnable == '1'){
+        if(!this.formData.openTime) return this.$toast('请选择开始时间');
+        if(!this.formData.closeTime) return this.$toast('请选择结束时间');
+        if(!this.formData.workTime) return this.$toast('请选择上班时间');
+        if(!this.formData.workOffTime) return this.$toast('请选择下班时间');
+        if(!timeCheck([this.formData.openTime,this.formData.closeTime])) return this.$toast('开始时间不能大于结束时间');
+        if(!timeCheck([this.formData.workTime,this.formData.workOffTime])) return this.$toast('上班时间不能大于下班时间');
+      }
       this.$refs.calendar.copyMouth(this.formData);
       this.isCopy = true;
     },
@@ -146,15 +155,14 @@ export default {
       }else {
         if(this.formData.isEnable === null){
           return this.$toast('请选择营业状态');
-        }else {
-          if(this.formData.isEnable == '1'){
-            if(!this.formData.openTime) return this.$toast('请选择开始时间');
-            if(!this.formData.closeTime) return this.$toast('请选择结束时间');
-            if(!this.formData.workTime) return this.$toast('请选择上班时间');
-            if(!this.formData.workOffTime) return this.$toast('请选择下班时间');
-            if(!timeCheck([this.formData.openTime,this.formData.closeTime])) return this.$toast('开始时间不能大于结束时间');
-            if(!timeCheck([this.formData.workTime,this.formData.workOffTime])) return this.$toast('上班时间不能大于下班时间');
-          }
+        }
+        if(this.formData.isEnable == '1'){
+          if(!this.formData.openTime) return this.$toast('请选择开始时间');
+          if(!this.formData.closeTime) return this.$toast('请选择结束时间');
+          if(!this.formData.workTime) return this.$toast('请选择上班时间');
+          if(!this.formData.workOffTime) return this.$toast('请选择下班时间');
+          if(!timeCheck([this.formData.openTime,this.formData.closeTime])) return this.$toast('开始时间不能大于结束时间');
+          if(!timeCheck([this.formData.workTime,this.formData.workOffTime])) return this.$toast('上班时间不能大于下班时间');
         }
         let data = {
           orgIdList:[this.formData.orgId],