team.vue 7.2 KB

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