|
|
@@ -8,7 +8,7 @@
|
|
|
<!--列表-->
|
|
|
<div class="mobile-fix-content mobile-centerfix-content" id="mobile-staff-center">
|
|
|
<!--列表-->
|
|
|
- <div v-if="activeTab == 0">
|
|
|
+ <div v-if="activeTab === 0">
|
|
|
<div class="staff-head">
|
|
|
<span class="inline-block" :class="{'active': switchType === 'info'}" @click="setSwitchType('info')">员工信息</span>
|
|
|
<span v-show="isAdmin" class="inline-block" :class="{'active': switchType === 'Audit'}" @click="setSwitchType('Audit')">审核绑定</span>
|
|
|
@@ -73,7 +73,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<!--编辑角色-->
|
|
|
- <div v-if="activeTab == 1">
|
|
|
+ <div v-if="activeTab === 1">
|
|
|
<div v-for="(role, index) in rolesList">
|
|
|
<div class="staff-role">
|
|
|
<div class="staff-header"><span :class="'active_0' + role.color"><b></b>{{role.desc}}</span></div>
|
|
|
@@ -173,34 +173,26 @@
|
|
|
'staffData': {
|
|
|
handler: function (val) {
|
|
|
if (this.isChange) {
|
|
|
- this.staffDataList = val.content
|
|
|
+ this.staffDataList = []
|
|
|
this.isChange = false
|
|
|
- } else {
|
|
|
- this.staffDataList = [...this.staffDataList, ...val.content]
|
|
|
}
|
|
|
+ this.staffDataList = [...this.staffDataList, ...val.content]
|
|
|
},
|
|
|
immediate: true
|
|
|
},
|
|
|
'auditBind': {
|
|
|
handler: function (val) {
|
|
|
if (this.hasChange) {
|
|
|
- this.AuditList = val.content
|
|
|
+ this.AuditList = []
|
|
|
this.hasChange = false
|
|
|
- } else {
|
|
|
- this.AuditList = [...this.AuditList, ...val.content]
|
|
|
}
|
|
|
+ this.AuditList = [...this.AuditList, ...val.content]
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- mounted () {
|
|
|
- // 获取角色
|
|
|
- this.$nextTick(() => {
|
|
|
- this.getRoles()
|
|
|
- })
|
|
|
- },
|
|
|
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
|
|
|
@@ -209,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
|
|
|
@@ -227,6 +219,8 @@
|
|
|
this.timeoutCount++
|
|
|
},
|
|
|
setSwitchType (type) {
|
|
|
+ this.staffSearch = ''
|
|
|
+ this.auditSearch = ''
|
|
|
this.switchType = type
|
|
|
this.page = 1
|
|
|
if ( type === 'info') {
|
|
|
@@ -246,9 +240,8 @@
|
|
|
},
|
|
|
// 员工列表搜索
|
|
|
staffRecord () {
|
|
|
- this.role = '全部角色'
|
|
|
this.showRole = false
|
|
|
- this.$store.dispatch('staff/loadStaffList', {count: this.count, page: this.page, enuu: this.user.data.enterprise.uu, keyword: this.staffSearch})
|
|
|
+ this.rolesEvent()
|
|
|
},
|
|
|
// 员工列表删除员工
|
|
|
openDelete (item) {
|
|
|
@@ -279,27 +272,28 @@
|
|
|
},
|
|
|
// 选择性搜索
|
|
|
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.$store.commit('infoList/REQUEST_INFO_LIST')
|
|
|
+ this.isChange = true
|
|
|
+ this.$store.commit('staff/infoList/REQUEST_INFO_LIST')
|
|
|
this.$http.get('/basic/user/enterprise/keywordinfo', {params})
|
|
|
.then(response => {
|
|
|
this.$store.commit('staff/infoList/GET_INFO_LIST_SUCCESS', response.data ? response.data : {})
|
|
|
}, err => {
|
|
|
this.$store.commit('staff/infoList/GET_INFO_LIST_FAILURE', err)
|
|
|
})
|
|
|
- } else {
|
|
|
- this.role = '全部角色'
|
|
|
- this.staffRecord()
|
|
|
}
|
|
|
},
|
|
|
// 获取角色
|
|
|
@@ -353,10 +347,10 @@
|
|
|
},
|
|
|
// 申请绑定搜索
|
|
|
auditRecord () {
|
|
|
- console.log(this.user.data.enterprise.uu)
|
|
|
+ this.hasChange = true
|
|
|
this.$store.dispatch('staff/loadBindAudit', {count: this.count, page: this.page, speaceUU: this.user.data.enterprise.uu, status: 311, keyword: this.auditSearch})
|
|
|
},
|
|
|
- // 申请绑定下拉更多
|
|
|
+ // 绑定下拉
|
|
|
onPullUpAudit () {
|
|
|
this.page++
|
|
|
this.auditRecord()
|
|
|
@@ -364,7 +358,8 @@
|
|
|
// 申请绑定操作事件 (同意和拒绝)
|
|
|
agreeEvent (type, flag) {
|
|
|
this.$http.get(`/basic/enterprise/auditApply?id=${type.id}&status=${Number(flag)}&userUU=${type.userUU}`)
|
|
|
- this.auditSearch = null
|
|
|
+ this.onRemind('操作成功!')
|
|
|
+ this.auditSearch = ''
|
|
|
this.page = 1
|
|
|
this.auditRecord()
|
|
|
}
|