closeReason.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. }
  21. },
  22. onLoad(options) {
  23. this.id=options.id
  24. },
  25. methods: {
  26. async handleSubmit() {
  27. // if(!this.reason){
  28. // uni.showToast({
  29. // title:'请填写理由',
  30. // icon:"none"
  31. // })
  32. // return
  33. // }
  34. const res=await apiCloseApply({
  35. BusinessApplyId:Number(this.id),
  36. CloseReason:this.reason
  37. })
  38. if(res.code===200){
  39. uni.showToast({
  40. title:"关闭成功",
  41. icon:'success'
  42. })
  43. uni.$emit('businessApproveListUpdate')
  44. setTimeout(()=>{
  45. this.handleCancel()
  46. },1000)
  47. }
  48. },
  49. handleCancel(){
  50. uni.navigateBack({
  51. delta:1
  52. })
  53. }
  54. },
  55. }
  56. </script>
  57. <style lang="scss">
  58. .intro-box{
  59. padding: 17px;
  60. }
  61. .textarea-wrap {
  62. padding: 17px;
  63. textarea {
  64. resize: none;
  65. display: block;
  66. box-sizing: border-box;
  67. width: 100%;
  68. height: 200px;
  69. border: none;
  70. font-size: 14px;
  71. /* no */
  72. }
  73. }
  74. .btns-wrap {
  75. justify-content: center;
  76. padding-top: 50px;
  77. padding-bottom: 50px;
  78. button {
  79. width: 90px;
  80. height: 28px;
  81. border-radius: 28px;
  82. border: none;
  83. margin: 0 10px;
  84. font-size: 14px;
  85. /* no */
  86. color: #fff;
  87. line-height: 28px;
  88. }
  89. .confirm-btn {
  90. background-color: #5890fb;
  91. }
  92. .cancel-btn {
  93. border: 1px solid #5890fb;
  94. color: #5890fb;
  95. background-color: #fff;
  96. }
  97. }
  98. </style>