team.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. <template>
  2. <view class="default_page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title='我的团队'></cus-header>
  4. <div class="list">
  5. <div class="list-item" v-for="(item,index) in list" :key="item.id">
  6. <image class="list-item-icon" :src="imgBase+'team_icon.png'"></image>
  7. <image class="list-item-edit" :src="imgBase+'team_edit.png'" @click="handleEdit(item)"></image>
  8. <div class="list-item-top">
  9. <div class="list-item-top-title">{{item.teamName}}</div>
  10. <div class="list-item-top-pre adf" style="margin-top: 36rpx;">
  11. <div class="list-item-top-pre-left">所属地区:</div>
  12. <div class="list-item-top-pre-right">{{item.provinceName+item.cityName}}</div>
  13. </div>
  14. <div class="list-item-top-pre adf">
  15. <div class="list-item-top-pre-left">所属行业:</div>
  16. <div class="list-item-top-pre-right">{{item.industryName||''}}</div>
  17. </div>
  18. <div class="list-item-top-pre adf">
  19. <div class="list-item-top-pre-left">团队职能类型:</div>
  20. <div class="list-item-top-pre-right">{{item.functionNames||''}}</div>
  21. </div>
  22. <div class="list-item-top-pre adf">
  23. <div class="list-item-top-pre-left">团队结构类型:</div>
  24. <div class="list-item-top-pre-right">{{item.orgNames||''}}</div>
  25. </div>
  26. <div class="list-item-top-pre adf">
  27. <div class="list-item-top-pre-left">团队规模:</div>
  28. <div class="list-item-top-pre-right">{{item.scaleName||''}}</div>
  29. </div>
  30. <div class="list-item-top-pre adf">
  31. <div class="list-item-top-pre-left">团队层级:</div>
  32. <div class="list-item-top-pre-right">{{item.hierarchyName||''}}</div>
  33. </div>
  34. </div>
  35. <!-- <div class="list-item-bottom adfacjb" @click="handleReivew">
  36. <div class="list-item-bottom-left">关联问卷:</div>
  37. <div class="list-item-bottom-right adfacjb">
  38. <div class="list-item-bottom-right-num">{{item.queNum||0}}条</div>
  39. <div class="list-item-bottom-right-review adfac">
  40. <text>查看</text>
  41. <image :src="imgBase+'my_arrow_right.png'"></image>
  42. </div>
  43. </div>
  44. </div> -->
  45. </div>
  46. </div>
  47. </view>
  48. </template>
  49. <script>
  50. export default {
  51. data(){
  52. return {
  53. list:[],
  54. query:{
  55. page:1,
  56. limit:10,
  57. coachId:''
  58. },
  59. isOver:false,
  60. scaleMap:new Map(),
  61. hierarchyMap:new Map()
  62. }
  63. },
  64. async onLoad() {
  65. this.query.coachId = uni.getStorageSync('userInfo')&&JSON.parse(uni.getStorageSync('userInfo')).id||'';
  66. await this.getTeamScaleData();
  67. await this.getTeamHierarchyData();
  68. this.getList()
  69. },
  70. onReachBottom() {
  71. if(this.isOver) return
  72. this.getList()
  73. },
  74. methods:{
  75. getTeamScaleData(){
  76. return new Promise((resolve,reject)=>{
  77. this.$api.get('/getListByType/team_scale').then(({data:res})=>{
  78. if(res.code!==0) return this.$showToast(res.msg)
  79. res.data.forEach(d=>{
  80. this.scaleMap.set(d.dictValue,d)
  81. })
  82. resolve()
  83. })
  84. })
  85. },
  86. getTeamHierarchyData(){
  87. return new Promise((resolve,reject)=>{
  88. this.$api.get('/getListByType/team_hierarchy').then(({data:res})=>{
  89. if(res.code!==0) return this.$showToast(res.msg)
  90. res.data.forEach(d=>{
  91. this.hierarchyMap.set(d.dictValue,d)
  92. })
  93. resolve()
  94. })
  95. })
  96. },
  97. getList(){
  98. this.$api.get('/core/user/team/page',this.query).then(({data:res})=>{
  99. if(res.code!==0) return this.$showToast(res.msg)
  100. this.list = [...this.list,...res.data.list]
  101. this.list.forEach(l=>{
  102. l.functionNames = l.functions.map(f=>f.functionName).join('、');
  103. l.orgNames = l.organizations.map(f=>f.orgName).join('、');
  104. l.scaleName = this.scaleMap.get(l.scale).dictLabel;
  105. l.hierarchyName = this.hierarchyMap.get(l.hierarchy).dictLabel;
  106. })
  107. this.query.page++;
  108. if(this.list.length>=res.data.total) this.isOver = true;
  109. })
  110. },
  111. handleEdit(item){
  112. uni.navigateTo({
  113. url:`/pagesMy/teamEdit?id=${item.id}&scaleName=${item.scaleName}&hierarchyName=${item.hierarchyName}`
  114. })
  115. }
  116. }
  117. }
  118. </script>
  119. <style scoped lang="scss">
  120. .default_page{
  121. background: #F7F7F7;
  122. padding: 0 24rpx 40rpx;
  123. box-sizing: border-box;
  124. .list{
  125. overflow: hidden;
  126. &-item{
  127. margin-top: 20rpx;
  128. background: #FFFFFF;
  129. border-radius: 24rpx;
  130. position: relative;
  131. padding-bottom: 20rpx;
  132. &-icon{
  133. width: 40rpx;
  134. height: 40rpx;
  135. position: absolute;
  136. top: 36rpx;
  137. left: 24rpx;
  138. }
  139. &-edit{
  140. width: 80rpx;
  141. height: 56rpx;
  142. position: absolute;
  143. top: 36rpx;
  144. right: 24rpx;
  145. }
  146. &-top{
  147. padding: 40rpx 80rpx 24rpx;
  148. &-title{
  149. padding-right: 100rpx;
  150. font-family: PingFang-SC, PingFang-SC;
  151. font-weight: bold;
  152. font-size: 32rpx;
  153. color: #002846;
  154. line-height: 32rpx;
  155. }
  156. &-pre{
  157. margin-top: 24rpx;
  158. &-left{
  159. width: 202rpx;
  160. font-family: PingFangSC, PingFang SC;
  161. font-weight: 400;
  162. font-size: 24rpx;
  163. color: #6B7280;
  164. line-height: 32rpx;
  165. }
  166. &-right{
  167. width: calc(100% - 202rpx);
  168. font-family: PingFangSC, PingFang SC;
  169. font-weight: 400;
  170. font-size: 24rpx;
  171. color: #6B7280;
  172. line-height: 32rpx;
  173. }
  174. }
  175. }
  176. &-bottom{
  177. padding: 24rpx 24rpx 24rpx 80rpx;
  178. border-top: 1rpx solid #E5E7EB;
  179. &-left{
  180. width: 202rpx;
  181. font-family: PingFangSC, PingFang SC;
  182. font-weight: 400;
  183. font-size: 24rpx;
  184. color: #393939;
  185. line-height: 32rpx;
  186. }
  187. &-right{
  188. width: calc(100% - 202rpx);
  189. &-num{
  190. font-family: PingFang-SC, PingFang-SC;
  191. font-weight: bold;
  192. font-size: 26rpx;
  193. color: #199C9C;
  194. line-height: 32rpx;
  195. }
  196. &-review{
  197. text{
  198. font-family: PingFangSC, PingFang SC;
  199. font-weight: 400;
  200. font-size: 24rpx;
  201. color: #A6A6A6;
  202. line-height: 32rpx;
  203. }
  204. image{
  205. width: 32rpx;
  206. height: 32rpx;
  207. margin-left: 8rpx;
  208. }
  209. }
  210. }
  211. }
  212. }
  213. }
  214. }
  215. </style>