reason.vue 2.0 KB

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