team.vue 7.8 KB

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