diff --git a/pages/index/Staffmanagement.vue b/pages/index/Staffmanagement.vue index 89c8e2a..e4ebc39 100644 --- a/pages/index/Staffmanagement.vue +++ b/pages/index/Staffmanagement.vue @@ -38,16 +38,17 @@ - {{ item.nickname }} - 电话:{{ item.mobile }} + {{ item.nickname || item.username }} + 岗位:{{item.roleName}} + 电话:{{ item.mobile || item.username }} - + 电话 @@ -138,7 +139,7 @@ export default { gwindex: 0, gwid: 0, roleId:undefined, - addRoleId:undefined + addRoleId:undefined, } }, onLoad() { @@ -170,8 +171,9 @@ export default { }, methods: { gettel(num) { + const value = num.mobile || num.username uni.makePhoneCall({ - phoneNumber: num //仅为示例 + phoneNumber: value //仅为示例 }); }, xgang(index, id) { @@ -239,7 +241,18 @@ export default { let total = res.total this.totalPages = Math.ceil(total / this.pageSize); } - + const newUsers = this.goodsList.filter(item => !item.roleName) + if (newUsers && newUsers.length > 0){ + const ids = newUsers.map(item => item.id) + request({ + url: '/inspection/util/getRoleNameByIds?ids=' + ids, + method: 'get' + }).then(res => { + this.goodsList.filter(item => !item.roleName).map(item => { + this.$set(item, "roleName", res.data[item.id]) + }) + }) + } }, // 去编辑 getedit(id) {