reason.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <view>
  3. <view class="textarea-wrap white-wrap">
  4. <textarea placeholder="请输入驳回理由" v-model="reason" maxlength="-1"></textarea>
  5. </view>
  6. <view class="btns-wrap flex">
  7. <button class="confirm-btn" @click="handleSubmit">提交</button>
  8. <button class="cancel-btn" @click="handleCancel">取消</button>
  9. </view>
  10. </view>
  11. </template>
  12. <script>
  13. import {apiBusinessApplyApprove} from '@/api/businessTrip/index'
  14. export default {
  15. data() {
  16. return {
  17. reason: '',
  18. id:null,
  19. }
  20. },
  21. onLoad(options) {
  22. this.id=options.id
  23. },
  24. methods: {
  25. async handleSubmit() {
  26. if(!this.reason){
  27. uni.showToast({
  28. title:'请填写理由',
  29. icon:"none"
  30. })
  31. return
  32. }
  33. const res=await apiBusinessApplyApprove({
  34. BusinessApplyId:Number(this.id),
  35. ApproveStatus:2,
  36. RefuseReason: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. .textarea-wrap {
  59. padding: 17px;
  60. textarea {
  61. resize: none;
  62. display: block;
  63. box-sizing: border-box;
  64. width: 100%;
  65. height: 200px;
  66. border: none;
  67. font-size: 14px;
  68. /* no */
  69. }
  70. }
  71. .btns-wrap {
  72. justify-content: center;
  73. padding-top: 50px;
  74. padding-bottom: 50px;
  75. button {
  76. width: 90px;
  77. height: 28px;
  78. border-radius: 28px;
  79. border: none;
  80. margin: 0 10px;
  81. font-size: 14px;
  82. /* no */
  83. color: #fff;
  84. line-height: 28px;
  85. }
  86. .confirm-btn {
  87. background-color: #5890fb;
  88. }
  89. .cancel-btn {
  90. border: 1px solid #5890fb;
  91. color: #5890fb;
  92. background-color: #fff;
  93. }
  94. }
  95. </style>