teamEdit.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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" :teamId="id" @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. onShow() {
  39. if (!this.id) return
  40. this.$nextTick(() => {
  41. const background = this.$refs.teamRef && this.$refs.teamRef.$refs.backgroundRef
  42. if (background) background.refreshFiles(this.id).catch(error => {
  43. this.$showToast(error && (error.message || error.msg) || '资料列表刷新失败')
  44. })
  45. })
  46. },
  47. methods:{
  48. getDetail(){
  49. this.$api.get(`/core/user/team/${this.id}`).then(({data:res})=>{
  50. if(res.code!==0) return this.$showToast(res.msg)
  51. this.teamInfo = res.data;
  52. this.$refs.teamRef.setTeamInfo(res.data)
  53. this.$refs.teamRef.teamInfo.functionIds = res.data.functions.map(f=>f.id);
  54. this.$refs.teamRef.teamInfo.orgIds = res.data.organizations.map(o=>o.id);
  55. this.$refs.teamRef.areaText = res.data.provinceName+res.data.cityName;
  56. this.$refs.teamRef.industryText = res.data.industryName;
  57. this.$refs.teamRef.functionTypeText = res.data.functions.map(f=>f.functionName).join('、');
  58. this.$refs.teamRef.architectureTypeText = res.data.organizations.map(f=>f.orgName).join('、');
  59. this.$refs.teamRef.teamScaleText = this.scaleName;
  60. this.$refs.teamRef.teamLevelText = this.hierarchyName;
  61. })
  62. },
  63. handleConfirm(data){
  64. this.submitDto = data;
  65. this.show = true;
  66. },
  67. editConfirm(){
  68. this.$api.put('/core/user/team',this.submitDto).then(({data:res})=>{
  69. if(res.code!==0) return this.$showToast(res.msg)
  70. this.$showToast('编辑成功')
  71. setTimeout(()=>{
  72. uni.redirectTo({
  73. url:'/pagesMy/team'
  74. })
  75. },1500)
  76. })
  77. }
  78. }
  79. }
  80. </script>
  81. <style scoped lang="scss">
  82. .default_page{
  83. box-sizing: border-box;
  84. }
  85. .dialog{
  86. position: fixed;
  87. left: 0;
  88. right: 0;
  89. top: 0;
  90. bottom: 0;
  91. background: rgba(0, 0, 0, .4);
  92. z-index: 1000;
  93. .dbox{
  94. width: calc(100% - 150rpx);
  95. background: #FFFFFF;
  96. border-radius: 32rpx;
  97. padding: 48rpx 30rpx;
  98. box-sizing: border-box;
  99. &-title{
  100. font-family: PingFang-SC, PingFang-SC;
  101. font-weight: bold;
  102. font-size: 34rpx;
  103. color: #002846;
  104. line-height: 48rpx;
  105. text-align: center;
  106. }
  107. &-content{
  108. padding: 0 14rpx;
  109. font-family: PingFangSC, PingFang SC;
  110. font-weight: 400;
  111. font-size: 32rpx;
  112. color: #002846;
  113. line-height: 54rpx;
  114. text-align: center;
  115. margin-top: 30rpx;
  116. span{
  117. font-weight: bold;
  118. }
  119. }
  120. &-btns{
  121. margin-top: 56rpx;
  122. &>view{
  123. width: calc(50% - 20rpx);
  124. }
  125. }
  126. }
  127. }
  128. </style>