reason.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. uni.$emit('updateSealDetail',{msg:'用印详情页面更新'})
  44. setTimeout(()=>{
  45. uni.navigateBack({
  46. delta:1
  47. })
  48. },1000)
  49. }
  50. },
  51. handleCancel(){
  52. uni.navigateBack({
  53. delta:1
  54. })
  55. }
  56. },
  57. }
  58. </script>
  59. <style lang="scss">
  60. .textarea-wrap {
  61. padding: 17px;
  62. textarea {
  63. resize: none;
  64. display: block;
  65. box-sizing: border-box;
  66. width: 100%;
  67. height: 200px;
  68. border: none;
  69. font-size: 14px;
  70. /* no */
  71. }
  72. }
  73. .btns-wrap {
  74. justify-content: center;
  75. padding-top: 50px;
  76. padding-bottom: 50px;
  77. button {
  78. width: 90px;
  79. height: 28px;
  80. border-radius: 28px;
  81. border: none;
  82. margin: 0 10px;
  83. font-size: 14px;
  84. /* no */
  85. color: #fff;
  86. line-height: 28px;
  87. }
  88. .confirm-btn {
  89. background-color: #5890fb;
  90. }
  91. .cancel-btn {
  92. border: 1px solid #5890fb;
  93. color: #5890fb;
  94. background-color: #fff;
  95. }
  96. }
  97. </style>