team.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. <template>
  2. <view class="default_page adffc" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title='我的团队'></cus-header>
  4. <div class="list" v-if="list.length">
  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 class="empty adffcacjc" v-else>
  48. <page-empty text="暂无团队"></page-empty>
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. import PageEmpty from '@/components/pageEmpty/index.vue'
  54. export default {
  55. components:{ PageEmpty },
  56. data(){
  57. return {
  58. list:[],
  59. query:{
  60. page:1,
  61. limit:10,
  62. coachId:''
  63. },
  64. isOver:false,
  65. scaleMap:new Map(),
  66. hierarchyMap:new Map()
  67. }
  68. },
  69. async onLoad() {
  70. this.query.coachId = uni.getStorageSync('userInfo')&&JSON.parse(uni.getStorageSync('userInfo')).id||'';
  71. await this.getTeamScaleData();
  72. await this.getTeamHierarchyData();
  73. this.getList()
  74. },
  75. onReachBottom() {
  76. if(this.isOver) return
  77. this.getList()
  78. },
  79. methods:{
  80. getTeamScaleData(){
  81. return new Promise((resolve,reject)=>{
  82. this.$api.get('/getListByType/team_scale').then(({data:res})=>{
  83. if(res.code!==0) return this.$showToast(res.msg)
  84. res.data.forEach(d=>{
  85. this.scaleMap.set(d.dictValue,d)
  86. })
  87. resolve()
  88. })
  89. })
  90. },
  91. getTeamHierarchyData(){
  92. return new Promise((resolve,reject)=>{
  93. this.$api.get('/getListByType/team_hierarchy').then(({data:res})=>{
  94. if(res.code!==0) return this.$showToast(res.msg)
  95. res.data.forEach(d=>{
  96. this.hierarchyMap.set(d.dictValue,d)
  97. })
  98. resolve()
  99. })
  100. })
  101. },
  102. getList(){
  103. this.$api.get('/core/user/team/page',this.query).then(({data:res})=>{
  104. if(res.code!==0) return this.$showToast(res.msg)
  105. this.list = [...this.list,...res.data.list]
  106. this.list.forEach(l=>{
  107. l.functionNames = l.functions.map(f=>f.functionName).join('、');
  108. l.orgNames = l.organizations.map(f=>f.orgName).join('、');
  109. l.scaleName = this.scaleMap.get(l.scale).dictLabel;
  110. l.hierarchyName = this.hierarchyMap.get(l.hierarchy).dictLabel;
  111. })
  112. this.query.page++;
  113. if(this.list.length>=res.data.total) this.isOver = true;
  114. })
  115. },
  116. handleEdit(item){
  117. uni.navigateTo({
  118. url:`/pagesMy/teamEdit?id=${item.id}&scaleName=${item.scaleName}&hierarchyName=${item.hierarchyName}`
  119. })
  120. }
  121. }
  122. }
  123. </script>
  124. <style scoped lang="scss">
  125. .default_page{
  126. background: #F7F7F7;
  127. padding: 0 24rpx 40rpx;
  128. box-sizing: border-box;
  129. .list{
  130. overflow: hidden;
  131. &-item{
  132. margin-top: 20rpx;
  133. background: #FFFFFF;
  134. border-radius: 24rpx;
  135. position: relative;
  136. padding-bottom: 20rpx;
  137. &-icon{
  138. width: 40rpx;
  139. height: 40rpx;
  140. position: absolute;
  141. top: 36rpx;
  142. left: 24rpx;
  143. }
  144. &-edit{
  145. width: 80rpx;
  146. height: 56rpx;
  147. position: absolute;
  148. top: 36rpx;
  149. right: 24rpx;
  150. }
  151. &-top{
  152. padding: 40rpx 80rpx 24rpx;
  153. &-title{
  154. padding-right: 100rpx;
  155. font-family: PingFang-SC, PingFang-SC;
  156. font-weight: bold;
  157. font-size: 32rpx;
  158. color: #002846;
  159. line-height: 32rpx;
  160. }
  161. &-pre{
  162. margin-top: 24rpx;
  163. &-left{
  164. width: 202rpx;
  165. font-family: PingFangSC, PingFang SC;
  166. font-weight: 400;
  167. font-size: 24rpx;
  168. color: #6B7280;
  169. line-height: 32rpx;
  170. }
  171. &-right{
  172. width: calc(100% - 202rpx);
  173. font-family: PingFangSC, PingFang SC;
  174. font-weight: 400;
  175. font-size: 24rpx;
  176. color: #6B7280;
  177. line-height: 32rpx;
  178. }
  179. }
  180. }
  181. &-bottom{
  182. padding: 24rpx 24rpx 24rpx 80rpx;
  183. border-top: 1rpx solid #E5E7EB;
  184. &-left{
  185. width: 202rpx;
  186. font-family: PingFangSC, PingFang SC;
  187. font-weight: 400;
  188. font-size: 24rpx;
  189. color: #393939;
  190. line-height: 32rpx;
  191. }
  192. &-right{
  193. width: calc(100% - 202rpx);
  194. &-num{
  195. font-family: PingFang-SC, PingFang-SC;
  196. font-weight: bold;
  197. font-size: 26rpx;
  198. color: #199C9C;
  199. line-height: 32rpx;
  200. }
  201. &-review{
  202. text{
  203. font-family: PingFangSC, PingFang SC;
  204. font-weight: 400;
  205. font-size: 24rpx;
  206. color: #A6A6A6;
  207. line-height: 32rpx;
  208. }
  209. image{
  210. width: 32rpx;
  211. height: 32rpx;
  212. margin-left: 8rpx;
  213. }
  214. }
  215. }
  216. }
  217. }
  218. }
  219. .empty{
  220. flex: 1;
  221. }
  222. }
  223. </style>