|
|
@@ -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()
|
|
|
}
|
|
|
},
|
|
|
// 获取角色
|