team.vue 7.2 KB

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