Browse Source

OKR-项目功能版本-2.0

guojy 1 year ago
parent
commit
f54bae59cf

+ 3 - 0
src/App.vue

@@ -194,6 +194,7 @@
         if (window.plus) {
           plus.navigator.setStatusBarStyle('light');
           var str = window.plus.device.model;
+          // console.log("iPhone",str)
           if (str.indexOf('iPhone') >= 0) {
             if (
               str === 'iPhone4' ||
@@ -232,6 +233,8 @@
     created() {
       document.documentElement.style.backgroundColor = '#26A2FF';
       FastClick.attach(document.body); //300毫秒点击问题
+      window.sessionStorage.setItem('__VCKEEPALIVE__', JSON.stringify(['/','/home']))
+      window.sessionStorage.setItem('routers', '/');
       this.init()
     }
   };

+ 12 - 12
src/components/DateCell.vue

@@ -1,10 +1,10 @@
 <template>
-    <van-cell :title="title" :value="value" :label="label" :icon="icon" :url="url" :border="border" :required="required" @click="show=true">
+    <van-cell :title="title" :value="value" :label="label" :icon="icon" :url="url" :border="border" :required="required" @click="openDate()">
       {{ date_value }}
       <template slot="right-icon">
         <van-icon name="underway-o" class="blue iconBox" />
       </template>
-      <van-calendar v-model="show" @confirm="onConfirm" :min-date="minDate1" :max-date="maxDate1" color="#238dfa" :get-container="getContainer" />
+      <van-calendar ref="calender" v-model="show" @confirm="onConfirm" :min-date="minDate1" :max-date="maxDate1" color="#238dfa" :get-container="getContainer" />
     </van-cell>
 </template>
 
@@ -74,8 +74,8 @@ export default {
   data() {
     return {
       show: false,
-      minDate1: new Date(2010, 0, 1),
-      maxDate1: new Date(2050, 0, 1),
+      minDate1:new Date(2010, 0, 1),
+      maxDate1:new Date(2050, 0, 1),
     };
   },
   methods: {
@@ -85,16 +85,16 @@ export default {
     onConfirm(data) {
       this.show = false;
       this.$emit('value', this.$moment(data).format('YYYY-MM-DD'));
+    },
+    openDate(){
+      this.minDate1=this.minDate;
+      this.maxDate1=this.maxDate;
+      this.show=true;
+      this.$nextTick(()=>{
+         this.show=true;
+      })
     }
   },
-  watch:{
-    show(val){
-      if(val){
-        this.minDate1=this.minDate;
-        this.maxDate1=this.maxDate;
-      }
-    }
-  }
 };
 </script>
 

+ 1 - 0
src/examine/view/examine/examineList.vue

@@ -91,6 +91,7 @@ import Vue from 'vue'
 import { ActionSheet,Collapse,CollapseItem } from 'vant';
 Vue.use(ActionSheet).use(Collapse).use(CollapseItem)
 export default {
+  name:'examineList',
   data() {
     return {
       id:0,

+ 0 - 1
src/okr/view/okrHome.vue

@@ -166,7 +166,6 @@ export default {
     this.getTargetList();
     this.getTaskList();
     this.getProjectList();
-    console.log(window.sessionStorage.getItem('__VCKEEPALIVE__'))
   },
   methods: {
     getUnitList(){

+ 13 - 2
src/point/view/integral/integral_application.vue

@@ -57,7 +57,7 @@
             </van-cell>
 
             <!--发生时间  -->
-            <DateCell required  title="发生时间"  name="日期"  v-model="item.event_time"></DateCell>
+            <DateCell required  title="发生时间"  name="日期" :maxDate="maxDate"  v-model="item.event_time"></DateCell>
             <!--选择递交审批人  -->
             <div>
               <van-cell v-if="change_reviewer" is-link required title="审批人" class="noInput" :value="userName" ></van-cell>
@@ -172,7 +172,7 @@ export default {
 
       itemRule:[],//规则数组
       rule_switch:true,
-      maxDate: new Date(2050, 12, 30),
+      maxDate: new Date(),
 
       // 长连接结果
       results: [], //提交的返回结果集合
@@ -239,6 +239,12 @@ export default {
   },
   mounted() {
     this.initializesReviewer(this.employeeid);
+    if (window.plus) { //针对IOS 11的优化
+      var str = window.plus.device.model;
+       if (str.indexOf('11') >= 0) {
+         this.maxDate=new Date(2050,12,30);
+       }
+    }
   },
   methods: {
     openText(){
@@ -343,6 +349,11 @@ export default {
           str='第' + (i + 1) + '条申请,请选择审批人';
           return true;
         }
+        if(item.event_time>moment().format('YYYY-MM-DD')){
+          isError=true;
+          str='第' + (i + 1) + '条申请,发生时间不能大于今天';
+          return true;
+        }
 
       })
       if(isError){