reason.vue 1.8 KB

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