teamEdit.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <template>
  2. <view class="default_page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title='编辑团队'></cus-header>
  4. <cus-team-info-fill ref="teamRef" @handleConfirm="handleConfirm" :confirmText="confirmText"></cus-team-info-fill>
  5. <view class="dialog adffcacjc" v-if="show">
  6. <view class="dbox">
  7. <view class="dbox-title">温馨提示</view>
  8. <view class="dbox-content">本次团队配置修改将在本团队<span>所有激活状态下的PERILL问卷中</span>生效,确定提交吗?</view>
  9. <view class="dbox-btns adfacjb">
  10. <view class="zt_btn" @click="editConfirm">确定</view>
  11. <view class="qx_btn" @click="show=false">取消</view>
  12. </view>
  13. </view>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. import CusTeamInfoFill from '@/components/CusTeamInfoFill/index.vue'
  19. export default {
  20. components:{ CusTeamInfoFill },
  21. data(){
  22. return {
  23. id:'',
  24. teamInfo:null,
  25. confirmText:'确定',
  26. scaleName:'',
  27. hierarchyName:'',
  28. submitDto:null,
  29. show:false
  30. }
  31. },
  32. onLoad(options) {
  33. this.id = options.id;
  34. this.scaleName = options.scaleName;
  35. this.hierarchyName = options.hierarchyName;
  36. this.getDetail()
  37. },
  38. methods:{
  39. getDetail(){
  40. this.$api.get(`/core/user/team/${this.id}`).then(({data:res})=>{
  41. if(res.code!==0) return this.$showToast(res.msg)
  42. this.teamInfo = res.data;
  43. this.$refs.teamRef.setTeamInfo(res.data)
  44. this.$refs.teamRef.teamInfo.functionIds = res.data.functions.map(f=>f.id);
  45. this.$refs.teamRef.teamInfo.orgIds = res.data.organizations.map(o=>o.id);
  46. this.$refs.teamRef.areaText = res.data.provinceName+res.data.cityName;
  47. this.$refs.teamRef.industryText = res.data.industryName;
  48. this.$refs.teamRef.functionTypeText = res.data.functions.map(f=>f.functionName).join('、');
  49. this.$refs.teamRef.architectureTypeText = res.data.organizations.map(f=>f.orgName).join('、');
  50. this.$refs.teamRef.teamScaleText = this.scaleName;
  51. this.$refs.teamRef.teamLevelText = this.hierarchyName;
  52. })
  53. },
  54. handleConfirm(data){
  55. data.coachId = JSON.parse(uni.getStorageSync('userInfo')).id;
  56. this.submitDto = data;
  57. this.show = true;
  58. },
  59. editConfirm(){
  60. this.$api.put('/core/user/team',this.submitDto).then(({data:res})=>{
  61. if(res.code!==0) return this.$showToast(res.msg)
  62. this.$showToast('编辑成功')
  63. setTimeout(()=>{
  64. uni.redirectTo({
  65. url:'/pagesMy/team'
  66. })
  67. },1500)
  68. })
  69. }
  70. }
  71. }
  72. </script>
  73. <style scoped lang="scss">
  74. .default_page{
  75. box-sizing: border-box;
  76. }
  77. .dialog{
  78. position: fixed;
  79. left: 0;
  80. right: 0;
  81. top: 0;
  82. bottom: 0;
  83. background: rgba(0, 0, 0, .4);
  84. z-index: 1000;
  85. .dbox{
  86. width: calc(100% - 150rpx);
  87. background: #FFFFFF;
  88. border-radius: 32rpx;
  89. padding: 48rpx 30rpx;
  90. box-sizing: border-box;
  91. &-title{
  92. font-family: PingFang-SC, PingFang-SC;
  93. font-weight: bold;
  94. font-size: 34rpx;
  95. color: #002846;
  96. line-height: 48rpx;
  97. text-align: center;
  98. }
  99. &-content{
  100. padding: 0 14rpx;
  101. font-family: PingFangSC, PingFang SC;
  102. font-weight: 400;
  103. font-size: 32rpx;
  104. color: #002846;
  105. line-height: 54rpx;
  106. text-align: center;
  107. margin-top: 30rpx;
  108. span{
  109. font-weight: bold;
  110. }
  111. }
  112. &-btns{
  113. margin-top: 56rpx;
  114. &>view{
  115. width: calc(50% - 20rpx);
  116. }
  117. }
  118. }
  119. }
  120. </style>