chenrui 4 years ago
parent
commit
7a98284560

+ 5 - 3
src/store/modules/user.js

@@ -12,7 +12,7 @@ const user = {
     avatar: '',
     roles: { permissionList: [] },
     info: {},
-	nowRouteName: '' // 当前路由名称
+    nowRouteName: '' // 当前路由名称
   },
 
   mutations: {
@@ -37,9 +37,9 @@ const user = {
     SET_MUSTCHANGEPWD: (state, status) => {
       state.mustChangePwd = status
     },
-	SET_NOWROUTENAME: (state, name) => {
+    SET_NOWROUTENAME: (state, name) => {
 	  state.nowRouteName = name
-	}
+    }
   },
 
   actions: {
@@ -55,6 +55,7 @@ const user = {
               const users = res.auth_user
               Vue.ls.set('hasError', 0)
               commit('SET_TOKEN', res.access_token)
+              commit('SET_INFO', users)
               commit('SET_NAME', { name: users.userNameCN, welcome: welcome() })
               commit('SET_MUSTCHANGEPWD', users.mustChangePwd)
               Vue.ls.set('rolesAccess', { permissionList: users.permCodes }, 7 * 24 * 60 * 60 * 1000)
@@ -96,6 +97,7 @@ const user = {
         }).catch((error) => {
           resolve(error)
         }).finally(() => {
+          commit('SET_INFO', {})
           commit('SET_NAME', { name: '', welcome: '' })
           commit('SET_MUSTCHANGEPWD', '')
           commit('SET_AVATAR', '')

+ 4 - 1
src/views/market/giftCard/addCardModal.vue

@@ -114,7 +114,10 @@ export default {
       if (!newValue) {
         this.$emit('close')
       } else {
-        this.$refs.ruleForm.resetFields()
+        const _this = this
+        setTimeout(() => {
+          _this.$refs.ruleForm.resetFields()
+        }, 100)
       }
     }
   }

+ 4 - 1
src/views/market/giftCard/editCardModal.vue

@@ -113,7 +113,10 @@ export default {
       if (!newValue) {
         this.$emit('close')
       } else {
-        this.$refs.ruleForm.resetFields()
+        const _this = this
+        setTimeout(() => {
+          _this.$refs.ruleForm.resetFields()
+        }, 100)
       }
     },
     cardId (newValue, oldValue) {

+ 4 - 2
src/views/market/giftCard/giftCard.vue

@@ -34,8 +34,8 @@
           <a-col :md="6" :sm="24">
             <a-form-item label="是否已充值" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
               <v-select
-                ref="giftCardState"
-                code="GIFT_CARD_STATE"
+                ref="booleanState"
+                code="BOOLEAN_STATE"
                 v-model="searchData.state"
                 allowClear
                 placeholder="请选择"
@@ -240,6 +240,8 @@ export default {
     },
     // 重置
     resetForm () {
+      this.time = []
+      this.rechargeTime = []
       this.searchData.startTime = null
       this.searchData.endTime = null
       this.searchData.goldNum = null