removeQuestionDig.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <template>
  2. <van-popup
  3. :show="show"
  4. position="bottom"
  5. :close-on-click-overlay="true"
  6. closeable
  7. @close="handleClose"
  8. round
  9. >
  10. <view class="remove-question-wrap">
  11. <view class="title">转移问题</view>
  12. <view class="main-box">
  13. <view class="left">
  14. <view
  15. :class="['item',index==fIndex&&'active']"
  16. v-for="(item,index) in opts"
  17. :key="item.classify_id"
  18. @click="fIndex=index"
  19. >{{item.classify_name}}</view>
  20. </view>
  21. <view class="center">
  22. <view
  23. :class="['item',index==secIndex&&'active']"
  24. v-for="(item,index) in opts[fIndex].tags"
  25. :key="item.tag_id"
  26. @click="secIndex=index"
  27. >{{item.tag_name}}</view>
  28. </view>
  29. <view class="right">
  30. <view
  31. :class="['item',item.admin_id==adminId&&'active',!item.allow_select&&'disabled']"
  32. v-for="item in opts[fIndex].tags[secIndex].researcher_list"
  33. :key="item.admin_id"
  34. @click="handleSelectAdmin(item)"
  35. >{{item.admin_name}}</view>
  36. </view>
  37. </view>
  38. <view class="btn" @click="handleConfirmTrans">确定</view>
  39. </view>
  40. </van-popup>
  41. </template>
  42. <script>
  43. import {apiGetTagTree} from '@/api/common'
  44. import {apiQuestionTransfer} from '@/api/question'
  45. export default {
  46. props:{
  47. qid:{
  48. default:0
  49. },
  50. show:{
  51. type:Boolean,
  52. default:false
  53. }
  54. },
  55. watch:{
  56. qid(){
  57. this.getOpts()
  58. }
  59. },
  60. data() {
  61. return {
  62. opts:[],
  63. fIndex:0,
  64. secIndex:0,
  65. adminId:0,//选择的人id
  66. }
  67. },
  68. methods: {
  69. async getOpts(){
  70. const res=await apiGetTagTree({
  71. community_question_id:this.qid||0
  72. })
  73. if(res.code===200){
  74. this.opts=res.data||[]
  75. }
  76. },
  77. // 选择转移人
  78. handleSelectAdmin(item){
  79. if(!item.allow_select) return
  80. this.adminId=item.admin_id
  81. },
  82. //确认转移
  83. async handleConfirmTrans(){
  84. if(!this.adminId){
  85. uni.showToast({
  86. title:"请选择转移人",
  87. icon:'none'
  88. })
  89. return
  90. }
  91. const res=await apiQuestionTransfer({
  92. community_question_id:Number(this.qid),
  93. variety_classify_id:
  94. })
  95. },
  96. handleClose(){
  97. this.$emit('close')
  98. }
  99. },
  100. }
  101. </script>
  102. <style lang="scss">
  103. .remove-question-wrap{
  104. .title{
  105. padding: 30rpx 0 10rpx 0;
  106. font-size: 32rpx;
  107. text-align: center;
  108. }
  109. .main-box{
  110. height: 30vh;
  111. display: flex;
  112. .left,.center,.right{
  113. flex: 1;
  114. height: 100%;
  115. overflow-y: auto;
  116. &::-webkit-scrollbar{
  117. width: 0;
  118. height: 0;
  119. display: none;
  120. }
  121. .item{
  122. padding: 20rpx 10rpx;
  123. font-size: 32rpx;
  124. }
  125. .active{
  126. color: #E3B377;
  127. }
  128. .disabled{
  129. color: #999;
  130. }
  131. }
  132. .center{
  133. border-left: 1px solid #ededed;
  134. border-right: 1px solid #ededed;
  135. }
  136. }
  137. .btn{
  138. margin-top: 20rpx;
  139. width: 80%;
  140. text-align: center;
  141. background: #333333;
  142. border-radius: 40px;
  143. margin-left: auto;
  144. margin-right: auto;
  145. color: #E3B377;
  146. line-height: 80rpx;
  147. font-size: 32rpx;
  148. }
  149. }
  150. </style>