lilei 3 years ago
parent
commit
83471b3726

+ 5 - 0
src/components/tools/UserMenu.vue

@@ -1,6 +1,11 @@
 <template>
   <div class="user-wrapper">
     <div class="content-box">
+      <a-alert
+        style="display: inline-block;"
+        type="error"
+        v-if="$store.state.app.isLastDayForMonth"
+        message="快到月底了,请尽快处理未完成的单据!" />
       <p class="help-cont" v-if="showHelp" @click="showVideo">
         <img style="width: 22px;height: 22px;vertical-align: middle;margin: 0 5px;" src="../../assets/icon_movie.png"/>
         <span style="vertical-align: middle;">帮助</span>

+ 9 - 0
src/layouts/BasicLayout.vue

@@ -77,6 +77,7 @@
 </template>
 
 <script>
+import moment from 'moment'
 import { triggerWindowResizeEvent } from '@/utils/util'
 import { mapState, mapActions, mapGetters } from 'vuex'
 import { mixin, mixinDevice } from '@/utils/mixin'
@@ -202,6 +203,14 @@ export default {
     // dark
     // this.$store.dispatch('ToggleColor', '#f30f30')
     this.$store.dispatch('ToggleTheme', 'dark')
+    this.$store.state.app.isLastDayForMonth = moment().daysInMonth() - moment().date() < 7
+    // 判断是否是当月最后一天
+    if (this.$store.state.app.isLastDayForMonth) {
+      this.$notification.warning({
+        message: '提示',
+        description: `快到月底了,请尽快处理未完成的单据!`
+      })
+    }
   },
   mounted () {
     const userAgent = navigator.userAgent

+ 2 - 1
src/store/modules/app.js

@@ -33,7 +33,8 @@ const app = {
     updateList: false,
     loadingStatus: false,
     winHeight: 0 ,//  窗口高度
-    isHomeNav: false // 是否从首页流程导航打开的页面
+    isHomeNav: false ,// 是否从首页流程导航打开的页面
+    isLastDayForMonth: false, // 是否是当月最后一天
   },
   mutations: {
     SET_SIDEBAR_TYPE: (state, type) => {

+ 1 - 7
src/views/user/Login.vue

@@ -326,13 +326,7 @@ export default {
       // console.log(res)
       // check res.homePage define, set $router.push name res.homePage
       // Why not enter onComplete
-      this.$router.push({ name: 'index' }, () => {
-        console.log('onComplete')
-        this.$notification.success({
-          message: '欢迎',
-          description: `${timeFix()},欢迎回来`
-        })
-      })
+      this.$router.push({ name: 'home' })
       this.isLoginError = false
     },
     requestFailed (err) {