teamList.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  1. <template>
  2. <view>
  3. <u-navbar title="团队成员" title-color="#101010" ></u-navbar>
  4. <view class="top">
  5. <view class="search">
  6. <view class="searchBox">
  7. <u-search shape="square" placeholder="搜索授权用户" maxlength="12" v-model="testName" :show-action="false"
  8. :animation="true"></u-search>
  9. <u-button type="primary" size="mini" @click="testBtn">搜素</u-button>
  10. </view>
  11. </view>
  12. </view>
  13. <view class="bodyMain">
  14. <view class="list" >
  15. <view class="item"
  16. v-for="(item,index) in list"
  17. v-show="showqueryName(item) "
  18. @click="gotoUrl('/pages/team/teamInfo?id='+item.id)"
  19. :key="index">
  20. <view class="icon">
  21. <image class="img" v-if="item.image" :src="item.image" mode=""></image>
  22. <image class="img" v-else src="@/assets/img/默认头像.png" mode=""></image>
  23. </view>
  24. <view class="body">
  25. <view class="line1">
  26. <view class="title">
  27. {{item.name}}
  28. <span class="tag" v-for="(o,ind) in item.roleList"
  29. :class="'role'+o.role">{{o.roleName}}</span>
  30. </view>
  31. </view>
  32. <view class="line2">
  33. <view class="value">
  34. {{item.phone}}
  35. </view>
  36. </view>
  37. </view>
  38. <view class="openId":class="{
  39. openIdOk:item.openId
  40. }">
  41. {{item.openId?'已登录':'未登录'}}
  42. <u-icon name="arrow-right" size="24" color="#BBBBBB" ></u-icon>
  43. </view>
  44. </view>
  45. </view>
  46. <u-divider :isnone="list.length==0" nonetext="没有找到相关内容" border-color="#CFD2D5">已经到底了</u-divider>
  47. </view>
  48. <view class="floating-button">
  49. <view class="button" @click="gotoUrl('/pages/team/teamAdd')" >
  50. <image class="img" src="@/assets/img/team/index0.svg" mode=""></image>
  51. 添加人员
  52. </view>
  53. </view>
  54. </view>
  55. </template>
  56. <script>
  57. import * as API from '@/apis/pagejs/pagesTeam.js'
  58. export default {
  59. data() {
  60. return {
  61. list:[],
  62. listForm:{
  63. pageIndex: 1,
  64. pageSize: 99,
  65. recordsTotal: 1,
  66. status:0,
  67. roleName:"XJ,XJADMIN",
  68. roleName:"XJ",
  69. },
  70. testName: "",
  71. queryName: "",
  72. lockId:"",
  73. lockName:"",
  74. current:0,
  75. tabslist:[
  76. {
  77. name: '待处理'
  78. }, {
  79. name: '已处理'
  80. }
  81. ]
  82. };
  83. },
  84. onLoad(op) {
  85. },
  86. onShow(){
  87. this.getList()
  88. },
  89. methods: {
  90. showqueryName(item){
  91. if(this.queryName){
  92. var name=item.name
  93. return name.indexOf(this.queryName)!=-1
  94. }else{
  95. return true
  96. }
  97. },
  98. roleNamesShow(str){
  99. var sz=str.split(",")
  100. var rsz=[]
  101. sz.forEach(item=>{
  102. if(item.indexOf('巡检')!=-1){
  103. rsz.push(item)
  104. }
  105. })
  106. return rsz.join(',')
  107. },
  108. submit(){
  109. },
  110. testBtn() {
  111. this.queryName = this.testName
  112. },
  113. getList(bl) {
  114. if(bl){
  115. this.listForm.pageIndex = 1
  116. }
  117. uni.showLoading({
  118. title: "加载中",
  119. mask: true,
  120. })
  121. API.teamMembers(this.listForm).then((res) => {
  122. var list = res.data.memberList
  123. // list=list.sort((item1,item2)=>{
  124. // if(item1.role<item2.role){
  125. // return -1
  126. // }else {
  127. // return 1
  128. // }
  129. // })
  130. list.forEach(item=>{
  131. item.roleList=[]
  132. if(item.role&&item.roleName){
  133. var szA=item.role.split(',')
  134. var szB=item.roleName.split(',')
  135. for(var i in szA){
  136. var key1=szA[i]
  137. var key2=szB[i]
  138. item.roleList.push({
  139. role:key1,
  140. roleName:key2
  141. })
  142. }
  143. }
  144. })
  145. this.list= list
  146. uni.hideLoading();
  147. }).catch(error => {
  148. uni.hideLoading();
  149. uni.showToast({
  150. title: error,
  151. icon: "none"
  152. })
  153. })
  154. },
  155. }
  156. }
  157. </script>
  158. <style lang="scss" scoped>
  159. .bodyMain{
  160. padding-bottom: 120rpx;
  161. }
  162. .list {
  163. padding: 0rpx 32rpx;
  164. background-color: rgba(255,255,255,1);
  165. .item {
  166. display: flex;
  167. border-bottom: 2rpx solid rgba(232, 232, 232, 1);
  168. padding: 12rpx 0;
  169. margin: 12rpx 0;
  170. .icon{
  171. display: flex;
  172. align-items: center;
  173. margin-right: 8rpx;
  174. }
  175. .img {
  176. width: 72rpx;
  177. height: 72rpx;
  178. }
  179. .openId{
  180. display: flex;
  181. white-space: pre;
  182. align-items: center;
  183. color: red;
  184. }
  185. .openIdOk{
  186. color: #19be6b;
  187. }
  188. .body {
  189. margin: 0 12rpx;
  190. width: 100%;
  191. .line1,
  192. .line2 {
  193. display: flex;
  194. justify-content: space-between;
  195. }
  196. .line2 {
  197. color: rgba(119,119,119,1);
  198. font-size: 24rpx;
  199. margin-top: 8rpx;
  200. }
  201. .line1 {
  202. .title {
  203. color: rgba(51, 51, 51, 1);
  204. font-size: 32rpx;
  205. font-weight: bold;
  206. }
  207. .status {
  208. background-color: rgba(255, 61, 0, 1);
  209. font-size: 24rpx;
  210. color:#fff;
  211. padding: 2rpx 8rpx;
  212. //border-radius: 8rpx;
  213. }
  214. .status0 {
  215. background-color: rgba(255, 61, 0, 1);
  216. }
  217. .status1 {
  218. background-color: #007aff;
  219. }
  220. .status2 {
  221. background-color: #ff9900;
  222. }
  223. .status3 {
  224. background-color: #19be6b;
  225. }
  226. .status4 {
  227. border: 2rpx solid rgba(255, 61, 0, 1);
  228. color: rgba(255, 61, 0, 1);
  229. }
  230. }
  231. .errorDesc{
  232. margin: 8rpx 0;
  233. width: 480rpx;
  234. color: #777777;
  235. font-size: 24rpx;
  236. overflow: hidden;
  237. text-overflow: ellipsis;
  238. white-space: nowrap; /* 禁止换行,强制单行 */
  239. }
  240. }
  241. }
  242. .item:last-child {
  243. border-bottom:0px solid rgba(232,232,232,1);
  244. }
  245. }
  246. .top{
  247. border-bottom: 2rpx solid #e8e8e8;
  248. }
  249. .search {
  250. padding: 16rpx 32rpx;
  251. background: #fff;
  252. .searchBox {
  253. display: flex;
  254. align-items: center;
  255. background: #F2F2F2;
  256. padding: 2rpx 16rpx;
  257. border-radius: 16rpx;
  258. justify-content: space-between;
  259. }
  260. }
  261. .floating-button {
  262. z-index: 999;
  263. position: fixed;
  264. bottom: 0;
  265. width: 100%;
  266. display: flex;
  267. height: 120rpx;
  268. justify-content: center;
  269. background-color: rgba(255,255,255,1);
  270. .button{
  271. margin-top: 24rpx;
  272. border-radius: 50px;
  273. height: 80rpx;
  274. width: 80%;
  275. display: flex;
  276. align-items: center;
  277. justify-content: center;
  278. padding:12rpx;
  279. background-color: rgba(22,119,255,1);
  280. color: rgba(255,255,255,1);
  281. font-size: 36rpx;
  282. }
  283. .img{
  284. width: 40rpx;
  285. height: 40rpx;
  286. margin-right: 8rpx;
  287. }
  288. }
  289. .tag{
  290. border-radius: 2pt;
  291. background-color: #8bc34a;
  292. color: rgba(255,255,255,1);
  293. font-size: 24rpx;
  294. line-height: 24rpx;
  295. padding:2rpx 8rpx;
  296. margin-left: 8rpx;
  297. }
  298. .role0{
  299. background-color: #FFC107;
  300. }
  301. .role1{
  302. background-color: rgba(22,119,255,1);
  303. }
  304. .role2{
  305. background-color: #19be6b;
  306. }
  307. .role3{
  308. background-color: #9E9E9E;
  309. }
  310. .role4{
  311. background-color: #9C27B0;
  312. }
  313. .role5{
  314. background-color: #8BC34A;
  315. }
  316. </style>