瀏覽代碼

计划列表批量分配按钮显示修改

“yst 4 年之前
父節點
當前提交
82c3f95545

+ 17 - 11
pages/planList/planList.vue

@@ -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;
+						}
+				  }
+				});
       },
     	/**
 			* 跳转页面-查核列表

+ 1 - 1
pages/role-switching/role-switching.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="role-page">
 		<view class="row-box">
-			<view class="role-list" v-for="(item,index) in permissionList">
+			<view class="role-list" v-for="(item,index) in permissionList" :key="index">
 				<text class="role-name">{{item.label}}</text>
 				<view class="radio-item" @click="toggleSelect(item,index)">
 					<image class="icon" :src="`/static/${item.isChecked ? 'check-radio' : 'check-no'}.png`"></image>

+ 1 - 1
pages/situationDetail/components/bottom-popup.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="popup-page" v-show="showModalStatus">
 		<view class="popup-box" v-show="showModalStatus">
-			<view class="item-box" v-for="(item,index) in planList">
+			<view class="item-box" v-for="(item,index) in planList" :key="index">
 				<view class="radio-item" @click="toggleSelect(item,index)">
 					<image class="icon" :src="`/static/${item.isChecked ? 'check-radio' : 'check-no'}.png`"></image>
 				</view>