teamEdit.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. .dialog{
  75. position: fixed;
  76. left: 0;
  77. right: 0;
  78. top: 0;
  79. bottom: 0;
  80. background: rgba(0, 0, 0, .4);
  81. z-index: 1000;
  82. .dbox{
  83. width: calc(100% - 150rpx);
  84. background: #FFFFFF;
  85. border-radius: 32rpx;
  86. padding: 48rpx 30rpx;
  87. box-sizing: border-box;
  88. &-title{
  89. font-family: PingFang-SC, PingFang-SC;
  90. font-weight: bold;
  91. font-size: 34rpx;
  92. color: #002846;
  93. line-height: 48rpx;
  94. text-align: center;
  95. }
  96. &-content{
  97. padding: 0 14rpx;
  98. font-family: PingFangSC, PingFang SC;
  99. font-weight: 400;
  100. font-size: 32rpx;
  101. color: #002846;
  102. line-height: 54rpx;
  103. text-align: center;
  104. margin-top: 30rpx;
  105. span{
  106. font-weight: bold;
  107. }
  108. }
  109. &-btns{
  110. margin-top: 56rpx;
  111. &>view{
  112. width: calc(50% - 20rpx);
  113. }
  114. }
  115. }
  116. }
  117. </style>