reason.vue 1.8 KB

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