reason.vue 2.2 KB

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