closeReason.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <template>
  2. <view>
  3. <view class="intro-box">活动申请已审批通过,确定关闭该活动吗?若关闭,请选填关闭原因!</view>
  4. <view class="textarea-wrap white-wrap">
  5. <textarea placeholder="请输入关闭理由" v-model="reason" maxlength="-1"></textarea>
  6. </view>
  7. <view class="btns-wrap flex">
  8. <button class="confirm-btn" @click="handleSubmit">提交</button>
  9. <button class="cancel-btn" @click="handleCancel">取消</button>
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. import {apiCloseApply} from '@/api/businessTrip/index'
  15. export default {
  16. data() {
  17. return {
  18. reason: '',
  19. id:null,
  20. shouldCheck:false
  21. }
  22. },
  23. onLoad(options) {
  24. this.id=options.id
  25. this.shouldCheck = options.shouldCheck
  26. },
  27. methods: {
  28. async handleSubmit() {
  29. // if(!this.reason){
  30. // uni.showToast({
  31. // title:'请填写理由',
  32. // icon:"none"
  33. // })
  34. // return
  35. // }
  36. if(this.shouldCheck=='true'&&!this.reason){
  37. uni.showToast({
  38. title:'请填写理由',
  39. icon:"none"
  40. })
  41. return
  42. }
  43. const res=await apiCloseApply({
  44. BusinessApplyId:Number(this.id),
  45. CloseReason:this.reason
  46. })
  47. if(res.code===200){
  48. uni.showToast({
  49. title:"关闭成功",
  50. icon:'success'
  51. })
  52. uni.$emit('businessApproveListUpdate')
  53. setTimeout(()=>{
  54. this.handleCancel()
  55. },1000)
  56. }
  57. },
  58. handleCancel(){
  59. uni.navigateBack({
  60. delta:1
  61. })
  62. }
  63. },
  64. }
  65. </script>
  66. <style lang="scss">
  67. .intro-box{
  68. padding: 17px;
  69. }
  70. .textarea-wrap {
  71. padding: 17px;
  72. textarea {
  73. resize: none;
  74. display: block;
  75. box-sizing: border-box;
  76. width: 100%;
  77. height: 200px;
  78. border: none;
  79. font-size: 14px;
  80. /* no */
  81. }
  82. }
  83. .btns-wrap {
  84. justify-content: center;
  85. padding-top: 50px;
  86. padding-bottom: 50px;
  87. button {
  88. width: 90px;
  89. height: 28px;
  90. border-radius: 28px;
  91. border: none;
  92. margin: 0 10px;
  93. font-size: 14px;
  94. /* no */
  95. color: #fff;
  96. line-height: 28px;
  97. }
  98. .confirm-btn {
  99. background-color: #5890fb;
  100. }
  101. .cancel-btn {
  102. border: 1px solid #5890fb;
  103. color: #5890fb;
  104. background-color: #fff;
  105. }
  106. }
  107. </style>