reason.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. uni.$emit('sealApproveReject')
  45. setTimeout(()=>{
  46. uni.navigateBack({
  47. delta:1
  48. })
  49. },1000)
  50. }
  51. },
  52. handleCancel(){
  53. uni.navigateBack({
  54. delta:1
  55. })
  56. }
  57. },
  58. }
  59. </script>
  60. <style lang="scss">
  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>