Ver Fonte

今日查核

jiangniuniu há 4 anos atrás
pai
commit
3d182381cf

+ 83 - 268
pages/calendar/calendar.vue

@@ -4,8 +4,8 @@
       <image
         :src="
           messageType
-            ? '/static/mission/消息中心未读.png'
-            : '/static/mission/消息中心已读.png'
+            ? '/static/message-unread.png'
+            : '/static/message-read.png'
         "
         mode=""
       ></image>
@@ -24,27 +24,30 @@
           v-for="(items, index) in item"
           class="calendarCon"
           @click="dateClick(items, index)"
+          :style="items.greyFlag ? { color: '#B8BECC' } : { color: '#292C33' }"
         >
-          <view class="date">
-            {{
-              items.time
-                ? items.time.slice(9, 10) == "0"
-                  ? items.time.slice(10, 11)
-                  : items.time.slice(9, 11)
-                : ""
-            }}
+          <view :class="items.specificDate == changedDate ? 'date2' : 'date'">
+            {{ items.day ? items.day : "" }}
           </view>
-          <view class="yinDate">
-            {{ items.yinTime ? items.yinTime : "" }}
+          <view
+            class="yinDate"
+            :style="
+              items.greyFlag ? { color: '#B8BECC' } : { color: '#292C33' }
+            "
+          >
+            {{ items.chineseDay ? items.chineseDay : "" }}
           </view>
-          <view :class="items.work ? 'work' : ''">
-            <view class="sum">{{ items.work ? items.work : "" }}</view>
-            <view class="danwei">{{ items.work ? "单位" : "" }}</view>
+          <view :class="items.deptCount != '0' ? 'work' : ''">
+            <view class="sum">{{
+              items.deptCount != "0" ? items.deptCount : ""
+            }}</view>
+            <view class="danwei">{{
+              items.deptCount != "0" ? "单位" : ""
+            }}</view>
           </view>
         </view>
       </view>
     </view>
-    <!-- <view v-for=""></view> -->
     <change-calendar
       v-if="showCC"
       :changedYear="changedYear"
@@ -77,42 +80,32 @@ export default {
       dayOfWeek: "",
       str_nums: "",
       data1: [],
+      changedDate: moment().format("YYYY-MM-DD"),
     };
   },
   components: {
     changeCalendar,
   },
   created() {
-    // this.getMissionList();
-    // var data = '2021-02-19';
     this.changedDay = this.dayArray[new Date().getDay()];
     this.init(true);
     this.refTimer = setInterval(() => {
       this.isInitWs = websocket.ws ? false : true;
       this.init(this.isInitWs);
     }, 3 * 60 * 1000);
+	this.messStatus();
   },
   beforeDestroy() {
     // 关闭ws连接
     websocket.close();
     clearInterval(this.refTimer);
   },
-  mounted() {
-    this.days_per_month = new Array(
-      31,
-      28 + this.isLeap(this.changedYear),
-      31,
-      30,
-      31,
-      30,
-      31,
-      31,
-      30,
-      31,
-      30,
-      31
-    ); //创建月份数组
-    this.getCanList2();
+  watch:{
+	  "$route":{
+		  handler(route){
+			  this.messStatus();
+		  }
+	  }
   },
   methods: {
     getCanList() {
@@ -120,10 +113,9 @@ export default {
         .dispatch({
           type: "calendar/commActions",
           payload: {
-            key: "getDefault",
+            key: "getCalList",
             data: {
-              pageNum: 1,
-              pageSize: 10,
+              years: this.changedYear + "-" + this.changedMonth,
             },
           },
         })
@@ -133,6 +125,13 @@ export default {
             let user = uni.getStorageSync("id");
             let permission = uni.getStorageSync("nowPermission");
             this.isInitWs && this.initWebsocket(hiId, user, permission);
+            this.str_nums = Math.ceil(data.length / 7); //确定日期表格所需的行数
+            let data2 = [];
+            for (let i = 0; i < this.str_nums; i++) {
+              data2[i] = [];
+              data2[i] = data.splice(0, 7);
+            }
+            this.data1 = data2;
           }
         });
     },
@@ -147,10 +146,8 @@ export default {
     // 解析websocket返回数据
     resolverWsData(type) {
       let types = JSON.parse(type);
-      console.log(types, "iiiiiii");
       switch (types.type) {
         case "TO_READ":
-          alert("99999");
           this.messageType = true;
           break;
         default:
@@ -159,6 +156,7 @@ export default {
       }
     },
     toMessagePage() {
+      // this.messageType = false;
       uni.navigateTo({
         url: `/pages/messages/messages`,
       });
@@ -175,237 +173,42 @@ export default {
       this.changedMonth = month;
       let day = year + "-" + month + "-01";
       this.changedDay = this.dayArray[new Date(day).getDay()];
-      this.getCanList2();
-    },
-    isLeap(year) {
-      return year % 4 == 0
-        ? year % 100 != 0
-          ? 1
-          : year % 400 == 0
-          ? 1
-          : 0
-        : 0;
-    },
-    getMonth(m) {
-      console.log(m);
-      if (m.substr(0, 1) == "0") {
-        console.log(true);
-        return m.substr(1, 2);
-      } else {
-        return m;
-      }
-    },
-    //获取上个月的天数
-    getPreMonthCount(year, month) {
-      if (month === 0) {
-        return getMonthCount(year - 1, 11);
-      } else {
-        return getMonthCount(year, month - 1);
-      }
-    },
-    getCanList2() {
-      this.$store
-        .dispatch({
-          type: "calendar/commActions",
-          payload: {
-            key: "getDefault",
-            data: {
-              pageNum: 1,
-              pageSize: 10,
-            },
-          },
-        })
-        .then((data) => {
-          let data1 = [
-            {
-              time: "2021-02-03",
-              yinTime: "二十",
-              work: null,
-            },
-            {
-              time: "2021-02-03",
-              yinTime: "二十",
-              work: null,
-            },
-            {
-              time: "2021-02-03",
-              yinTime: "二十",
-              work: null,
-            },
-            {
-              time: "2021-02-03",
-              yinTime: "二十",
-              work: null,
-            },
-            {
-              time: "2021-02-03",
-              yinTime: "二十",
-              work: null,
-            },
-            {
-              time: "2021-02-03",
-              yinTime: "二十",
-              work: null,
-            },
-            {
-              time: "2021-02-03",
-              yinTime: "二十",
-              work: null,
-            },
-            {
-              time: "2021-02-03",
-              yinTime: "二十",
-              work: null,
-            },
-            {
-              time: "2021-02-03",
-              yinTime: "二十",
-              work: null,
-            },
-            {
-              time: "2021-02-03",
-              yinTime: "二十",
-              work: null,
-            },
-            {
-              time: "2021-02-03",
-              yinTime: "二十",
-              work: null,
-            },
-            {
-              time: "2021-02-03",
-              yinTime: "二十",
-              work: null,
-            },
-            {
-              time: "2021-02-03",
-              yinTime: "二十",
-              work: null,
-            },
-            {
-              time: "2021-02-03",
-              yinTime: "二十",
-              work: null,
-            },
-            {
-              time: "2021-02-03",
-              yinTime: "二十",
-              work: null,
-            },
-            {
-              time: "2021-02-03",
-              yinTime: "二十",
-              work: null,
-            },
-            {
-              time: "2021-02-03",
-              yinTime: "二十",
-              work: null,
-            },
-            {
-              time: "2021-02-03",
-              yinTime: "二十",
-              work: null,
-            },
-            {
-              time: "2021-02-03",
-              yinTime: "二十",
-              work: null,
-            },
-            {
-              time: "2021-02-03",
-              yinTime: "二十",
-              work: null,
-            },
-            {
-              time: "2021-02-03",
-              yinTime: "二十",
-              work: null,
-            },
-            {
-              time: "2021-02-03",
-              yinTime: "二十",
-              work: null,
-            },
-            {
-              time: "2021-02-03",
-              yinTime: "二十",
-              work: 5,
-            },
-            {
-              time: "2021-02-03",
-              yinTime: "二十",
-              work: null,
-            },
-            {
-              time: "2021-02-03",
-              yinTime: "二十",
-              work: null,
-            },
-            {
-              time: "2021-02-03",
-              yinTime: "二十",
-              work: null,
-            },
-            {
-              time: "2021-02-03",
-              yinTime: "二十",
-              work: null,
-            },
-            {
-              time: "2021-02-03",
-              yinTime: "二十",
-              work: null,
-            },
-          ];
-
-          this.firstday = new Date(
-            this.changedYear,
-            this.changedMonth.slice(0, 1) == "0"
-              ? this.changedMonth.slice(1, 2) - 1
-              : this.changedMonth - 1,
-            1
-          ); //获取每月第一天
-          this.dayOfWeek = this.firstday.getDay(); //判断第一天是星期几(返回[0-6]中的一个,0代表星期天,1代表星期一,以此类推)
-          this.str_nums = Math.ceil((this.dayOfWeek + data1.length) / 7); //确定日期表格所需的行数
-          let data2 = [];
-          for (let i = 0; i < this.str_nums; i++) {
-            data2[i] = [];
-            if (i == 0 && this.dayOfWeek != 0) {
-              for (let j = 0; j < this.dayOfWeek; j++) {
-                data2[i].push({});
-              }
-              let data3 = data1.splice(0, 7 - this.dayOfWeek);
-              for (let k = 0; k < data3.length; k++) {
-                data2[i].push(data3[k]);
-              }
-            } else if (i == 0 && this.dayOfWeek == 0) {
-              data2[i] = data1.splice(0, 7);
-            } else {
-              if (i == this.str_nums - 1 && data1.length < 7) {
-                data2[i] = data1.splice(0, 7);
-                for (let k = 1; k < 7 - data1.length; k++) {
-                  data2[i].push({});
-                }
-              } else if (i == this.str_nums - 1 && data1.length == 7) {
-                data2[i] = data1.splice(0, 7);
-              } else {
-                data2[i] = data1.splice(0, 7);
-              }
-            }
-          }
-          console.log(data2);
-          this.data1 = data2;
-        });
+      this.getCanList();
     },
     dateClick(data, i) {
-      console.log(data, i);
-      if (data && data.work) {
-        // uni.navigateTo({
-        //   url: `/pages/mission-details/mission-details?taskId=${data.businessId}`,
-        // });
+      if (data && data.specificDate) {
+        uni.navigateTo({
+          url: `/pages/todayCheck/todayCheck?date=${data.specificDate}`,
+        });
       }
     },
+	messStatus(){
+		let num = 1;
+		let timer = setInterval(()=>{
+		  this.$store.dispatch({
+			  type: "calendar/commActions",
+			  payload: {
+				key: "messagesList",
+				data: {
+				  pageNum: num,
+				  pageSize: 100,
+				},
+			  },
+			}).then((res)=>{
+				if(res && res.list.length == 0){
+					clearInterval(timer)
+				}else if(res && res.list.length != 0){
+					res.list.map((item)=>{
+						if(!item.readStatus){
+							this.messageType = true;
+							return;
+						}
+					})
+				}
+			})
+		  num++;
+		},100)
+	}
   },
 };
 </script>
@@ -459,8 +262,20 @@ export default {
     font-size: 35rpx;
     color: #292c33;
     .date {
-      padding-top: 25rpx;
-      padding-bottom: 15rpx;
+      margin: 16.25rpx auto 6.25rpx;
+      height: 52.5rpx;
+      width: 52.5rpx;
+      line-height: 52.5rpx;
+      border-radius: 50%;
+    }
+    .date2 {
+      margin: 16.25rpx auto 6.25rpx;
+      height: 52.5rpx;
+      width: 52.5rpx;
+      line-height: 52.5rpx;
+      border-radius: 50%;
+      background-color: #3377ff;
+      color: #fff;
     }
     .yinDate {
       color: #666e80;

+ 8 - 14
pages/calendar/server.js

@@ -1,22 +1,16 @@
 import { creatRequest } from '../../utils/request.js';
 
 const requestList = {
-	// 保存配置
-	postResultConfig: {
-		method: 'POST',
-		url: 'resultConfig'
-	},
-	//最新配置
-	getResultConfig:{
+	// 获取日历
+	getCalList: {
 		method: 'GET',
-		url: 'resultConfig'
+		url: 'checkTask/calendar'
+	},
+	//获取分页列表
+	messagesList: {
+	  method: 'GET',
+	  url: 'notice/page'
 	},
-	//默认配置列表
-	getDefault:{
-		method: 'GET',
-		url: 'notice/page'
-	}
-	
 };
 
 export const commServer = ({ key, data }) => {

+ 4 - 4
pages/messages/messages.vue

@@ -16,11 +16,11 @@
             :src="
               item.businessType == 1
                 ? item.readStatus
-                  ? '/static/橙色已读.png'
-                  : '/static/橙色未读.png'
+                  ? '/static/orange-read.png'
+                  : '/static/orange-noRead.png'
                 : item.readStatus
-                ? '/static/绿色已读.png'
-                : '/static/绿色未读.png'
+                  ? '/static/green-read.png'
+                  : '/static/green-noRead.png'
             "
           ></image>
         </view>

+ 39 - 2
pages/mission/mission.vue

@@ -90,12 +90,20 @@
 			    this.isInitWs = websocket.ws ? false : true;
 			    this.init(this.isInitWs);
 			}, 3 * 60 * 1000);
+			this.messStatus();
 		},
 		beforeDestroy() {
 		    // 关闭ws连接
 		    websocket.close();
 		    clearInterval(this.refTimer);
 		  },
+		  watch:{
+		  	  "$route":{
+		  		  handler(route){
+		  			  this.messStatus();
+		  		  }
+		  	  }
+		  },
 		methods: {
 			toggleBtn() {
 				let flag = !this.showCloseList;
@@ -138,7 +146,8 @@
 			},
 			// 解析websocket返回数据
 			resolverWsData(type) {
-			  switch (type) {
+			  let types = JSON.parse(type);
+			  switch (types.type) {
 			    case "TO_READ":
 			      this.messageType = true;
 			      break;
@@ -148,14 +157,42 @@
 			  }
 			},
 			toMessagePage(){
+				// this.messageType = false;
 				uni.navigateTo({
 				  url: `/pages/messages/messages`
 				});
+			},
+			messStatus(){
+				let num = 1;
+				let timer = setInterval(()=>{
+				  this.$store.dispatch({
+					  type: "calendar/commActions",
+					  payload: {
+						key: "messagesList",
+						data: {
+						  pageNum: num,
+						  pageSize: 100,
+						},
+					  },
+					}).then((res)=>{
+						if(res && res.list.length == 0){
+							clearInterval(timer)
+						}else if(res && res.list.length != 0){
+							res.list.map((item)=>{
+								if(!item.readStatus){
+									this.messageType = true;
+									return;
+								}
+							})
+						}
+					})
+				  num++;
+				},100)
 			}
 		},
 		components: {
 			listItem
-		}
+		},
 	}
 </script>
 

+ 3 - 3
pages/todayCheck/server.js

@@ -2,9 +2,9 @@ import { creatRequest } from '../../utils/request.js';
 
 const requestList = {
   //登录
-  login: {
-    method: 'POST',
-    url: 'login/in'
+  specificCheckTaskList: {
+    method: 'GET',
+    url: 'checkTask/specificCheckTaskList'
   },
 };
 export const commServer = ({ key, data }) => {

+ 183 - 0
pages/todayCheck/todayCheck.vue

@@ -1,8 +1,191 @@
 <template>
+	<view class="todayCheckPage">
+		<view class="content" v-for="item in list">
+			<view class="contTitle">
+				<text class="contTitleLeft">{{item.situationName}}</text>
+				<text class="contTitleRight">{{item.checkPlan}}</text>
+			</view>
+			<view class="contCon">
+				<view v-for="items in item.planDepListReps" class="conEveryCon" @click="goToPonitDetails(items)">
+					<view class="title">
+						<view class="name">{{items.deptName}}</view>	
+						<view class="buMen">
+							<image src="../../static/icon-map-dis.png" mode="" class="img"></image>
+							<view class="keshi">{{items.deptClassName}}</view>
+						</view>
+					</view>
+					<view class="status" >
+						<image :src="items.completeDes == '完成'?'../../static/top-img.png':items.completeDes == '查核中'?'../../static/hight-bg.png':'../../static/disabled-bg.png'" mode="" class="bgImg"></image>
+						<text class="statusType">{{items.completeDes}}</text>
+					</view>
+					<view class="points">{{items.decs}}</view>
+					<view class="pointsGK">要点概括:{{items.checkPointNames}}</view>
+					<view>
+						<view class="checkName">{{items.empName}}</view>
+						<view class="checkTime">{{items.startDate}}~{{items.endDate}}</view>
+					</view>
+				</view>
+			</view>
+		</view>
+	</view>
 </template>
 
 <script>
+	export default {
+		data() {
+		  return {
+			  list:[],
+			  date:'',
+		  }
+		},
+		mounted() {
+			this.getList();
+			
+		},
+		methods:{
+			getList(){
+				this.$store.dispatch({
+					type: "todayCheck/commActions",
+					payload: {
+					  key: "specificCheckTaskList",
+					  data: {
+					    specificDate:this.date
+					  },
+					},
+				}).then((res)=>{
+					if(res){
+						this.list =res;
+					}
+				})
+			},
+			goToPonitDetails(data){
+				// console.log(data)
+				// uni.navigateTo({
+				//   url: `/pages/messages/messages?id=${data.checkId}`,
+				// });
+			}
+		},
+		onLoad({ date }){
+		  this.date = date;
+		},
+	}
 </script>
 
 <style lang="less">
+	.todayCheckPage{
+		padding:0rpx 25rpx;
+		height: 100%;
+		width: 100%;
+		.content{
+			width: 100%;
+			.contTitle{
+				font-size: 22.5rpx;
+				color: #666F80;
+				height: 22.5rpx;
+				line-height: 22.5rpx;
+				margin: 25rpx 0rpx 15rpx;
+				.contTitleLeft{
+					display: inline-block;
+					width: 50%;
+					text-align: left;
+				}
+				.contTitleRight{
+					display: inline-block;
+					width: 50%;
+					text-align: right;
+				}
+			}
+			.contCon{
+				.conEveryCon{
+					margin-bottom: 25rpx;
+					padding:25rpx 25rpx 0rpx;
+					background-color: #fff;
+					height: 225rpx;
+					border-radius: 5rpx;
+					position: relative;
+					.title{
+						margin-bottom: 10rpx;
+						color: #292C33;
+						// vertical-align: top;
+						.name{
+							height: 35rpx;
+							display: inline-block;
+							font-size: 35rpx;
+							font-weight: 400;
+						}
+						.buMen{
+							margin-left: 20rpx;
+							display: inline-block;
+							// width: 117.5rpx;
+							height: 35rpx;
+							background-color: #EDF2FA;
+							border-radius: 17.5rpx;
+							line-height: 82.5rpx;
+							vertical-align: top;
+							.img{
+								vertical-align: top;
+								width: 35rpx;
+								height: 35rpx;
+							}
+							.keshi{
+								margin-left: 10rpx;
+								margin-right: 20rpx;
+								display: inline-block;
+								vertical-align: top;
+								font-size: 17.5rpx;
+								line-height: 35rpx;
+							}
+						}
+					}
+					.status{
+						width: 100rpx;
+						height: 35rpx;
+						position: absolute;
+						top: 0rpx;
+						right: 0rpx;
+						.bgImg{
+							width: 100rpx;
+							height: 35rpx;
+						}
+						.statusType{
+							position: absolute;
+							top:8.75rpx;
+							right:18.75rpx;
+							font-size: 17.5rpx;
+							line-height: 17.5rpx;
+							color: #fff;
+						}
+					}
+					.points{
+						font-size: 20rpx;
+						color: #292C33;
+						line-height: 50rpx;
+						font-weight: bold;
+					}
+					.pointsGK{
+						padding-bottom: 25rpx;
+						border-bottom: 0.62rpx solid #DADEE6;
+						font-size: 20rpx;
+						color: #666F80;
+					}
+					.checkName{
+						width: 50%;
+						display: inline-block;
+						color: #666E80;
+						text-align: left;
+						line-height: 57.5rpx;
+						font-size: 17.5rpx;
+					}
+					.checkTime{
+						width: 50%;
+						display: inline-block;
+						color: #666E80;
+						text-align: right;
+						line-height: 57.5rpx;
+						font-size: 17.5rpx;
+					}
+				}
+			}
+		}
+	}
 </style>

+ 0 - 0
static/绿色未读.png → static/green-noRead.png


+ 0 - 0
static/绿色已读.png → static/green-read.png


+ 0 - 0
static/橙色未读.png → static/orange-noRead.png


+ 0 - 0
static/橙色已读.png → static/orange-read.png