|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<view class="planList-page">
|
|
|
<scroll-view class="list-box" scroll-y="true" :style="{'height':listHeight+'rpx'}">
|
|
|
- <view class="item-box" v-for="(item,index) in planList" @click="gotoCheckList(false,item)">
|
|
|
+ <view class="item-box" v-for="(item,index) in planList" @click="gotoCheckList(false,item)" :key="index">
|
|
|
<view class="row1">
|
|
|
<text class="title">{{item.name}}</text>
|
|
|
<view class="compeleted-box" v-if="item.isCompeleted">
|
|
@@ -26,6 +26,7 @@
|
|
|
|
|
|
<script>
|
|
|
import modal from './components/modal.vue'
|
|
|
+ import moment from 'moment';
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -52,11 +53,11 @@
|
|
|
}
|
|
|
}).then((data) => {
|
|
|
if (data) {
|
|
|
+ this.compareTime(data);
|
|
|
this.planList=data.map((item,index)=>{
|
|
|
if(item.empList.length!=item.toDistribute){
|
|
|
this.firstFlag=0;
|
|
|
}
|
|
|
- this.compareTime(item.startDate);
|
|
|
return {
|
|
|
id:item.id,
|
|
|
name:item.name,
|
|
@@ -76,15 +77,20 @@
|
|
|
});
|
|
|
},
|
|
|
methods: {
|
|
|
- compareTime(time){
|
|
|
- let myDate=new Date();
|
|
|
- let startDate=time.replace(/-/g,"/");
|
|
|
- startDate=Date.parse(startDate);
|
|
|
- if(myDate>startDate){
|
|
|
- this.listHeight=1200;
|
|
|
- }else{
|
|
|
- this.isShowDistribution=true;
|
|
|
- }
|
|
|
+ compareTime(planList){
|
|
|
+ this.$store.dispatch({
|
|
|
+ type: "commActions",
|
|
|
+ key: "getDateStr" ,
|
|
|
+ }).then((dateStr) => {
|
|
|
+ if (dateStr) {
|
|
|
+ if(planList.some((item)=>moment(item.startDate).valueOf()<moment(dateStr).valueOf())){
|
|
|
+ this.listHeight=1200;
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ this.isShowDistribution=true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
/**
|
|
|
* 跳转页面-查核列表
|