Browse Source

Merge remote-tracking branch 'origin/release-201821-wangcz' into release-201821-wangcz

yangc 7 years ago
parent
commit
9308239298

+ 2 - 2
components/mobile/staffManagement/StaffAdd.vue

@@ -243,8 +243,8 @@
       background: #fff;
       span {
         font-size: .29rem;
-        &:first-child {
-          margin-right: 2.6rem;
+        &:last-child {
+          margin-left: 2.6rem;
         }
         &.active {
           color: $base-color;

+ 10 - 10
components/mobile/staffManagement/StaffList.vue

@@ -192,7 +192,7 @@
     },
     computed: {
       staffData () {
-        return this.$store.state.staff.infoList.info.data
+        return this.$store.state.staff.infoList.info.data.content ? this.$store.state.staff.infoList.info.data : {content:[]}
       },
       fetching () {
         return this.staffData.fetching
@@ -201,7 +201,7 @@
         return Math.floor(this.staffData.totalElements / this.staffData.size) + Math.floor(this.staffData.totalElements % this.staffData.size > 0 ? 1 : 0)
       },
       auditBind () {
-        return this.$store.state.staff.infoList.audit.data || {content:[]}
+        return this.$store.state.staff.infoList.audit.data.content ? this.$store.state.staff.infoList.audit.data : {content:[]}
       },
       fetch () {
         return this.$store.state.staff.infoList.audit.fetching
@@ -240,10 +240,8 @@
       },
       // 员工列表搜索
       staffRecord () {
-        this.role = '全部角色'
         this.showRole = false
-        this.isChange = true
-        this.$store.dispatch('staff/loadStaffList', {count: this.count, page: this.page, enuu: this.user.data.enterprise.uu, keyword: this.staffSearch})
+        this.rolesEvent()
       },
       // 员工列表删除员工
       openDelete (item) {
@@ -274,16 +272,19 @@
       },
       // 选择性搜索
       rolesEvent (type) {
+        this.isChange = true
         this.showRole = !this.showRole
+        this.role = type ? type.desc : '全部角色'
         this.page = 1
-        if (type) {
-          this.role = type.desc
+        if (!type && !this.staffSearch) {
+          this.$store.dispatch('staff/loadStaffList', {count: this.count, page: this.page, enuu: this.user.data.enterprise.uu, keyword: this.staffSearch})
+        } else {
           let params = {
             count: this.count,
             page: this.page,
             enuu: this.user.data.enterprise.uu,
             keyword: this.staffSearch,
-            roleId: type.id
+            roleId: type ? type.id : null
           }
           this.isChange = true
           this.$store.commit('staff/infoList/REQUEST_INFO_LIST')
@@ -293,8 +294,6 @@
             }, err => {
               this.$store.commit('staff/infoList/GET_INFO_LIST_FAILURE', err)
             })
-        } else {
-          this.staffRecord()
         }
       },
       // 获取角色
@@ -359,6 +358,7 @@
       // 申请绑定操作事件 (同意和拒绝)
       agreeEvent (type, flag) {
         this.$http.get(`/basic/enterprise/auditApply?id=${type.id}&status=${Number(flag)}&userUU=${type.userUU}`)
+        this.onRemind('操作成功!')
         this.auditSearch = ''
         this.page = 1
         this.auditRecord()

+ 2 - 2
store/staff/infoList.js

@@ -1,11 +1,11 @@
 export const state = () => ({
   info: {
     fetching: false,
-    data: []
+    data: {}
   },
   audit: {
     fetching: false,
-    data: []
+    data: {}
   },
   edit: {
     fetching: false,