approve.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <!-- 不通过原因 -->
  2. <template>
  3. <view id="approve">
  4. <view class="approve-title">驳回原因</view>
  5. <textarea v-model="rejectCause" placeholder="请输入未通过原因" maxlength="50"></textarea>
  6. <view class="button-view" @click="accessButtonClick">提交</view>
  7. </view>
  8. </template>
  9. <script>
  10. import { laboratoryApply } from '@/api/apiDemo/index.js'
  11. export default {
  12. data() {
  13. return {
  14. itemData:{},
  15. rejectCause:"",
  16. checkList:[],
  17. }
  18. },
  19. onLoad(option) {
  20. let self = this;
  21. console.log(this.itemData)
  22. this.itemData = JSON.parse(decodeURIComponent(option.item));
  23. for(let i=0;i<self.itemData.rejectCause.length;i++){
  24. self.itemData.rejectCause[i].type = false
  25. }
  26. // this.itemData = JSON.parse(decodeURIComponent(option.item));
  27. },
  28. methods: {
  29. accessButtonClick(){
  30. let self = this;
  31. let num = 0;
  32. this.$set(this,'checkList',[])
  33. for(let i=0;i<self.itemData.rejectCause.length;i++){
  34. if(self.itemData.rejectCause[i].type){
  35. num++
  36. this.checkList.push(self.itemData.rejectCause[i].materialId);
  37. }
  38. }
  39. if(!self.rejectCause){
  40. uni.showToast({
  41. title: '请输入驳回原因',
  42. icon:"none",
  43. mask:true,
  44. duration: 2000
  45. });
  46. return
  47. }
  48. uni.showModal({
  49. content: '确认拒绝通过吗?',
  50. cancelColor:"#999",
  51. confirmColor:"#0183FA",
  52. success: function (res) {
  53. if (res.confirm) {
  54. self.laboratoryApply();
  55. console.log('用户点击确定');
  56. } else if (res.cancel) {
  57. console.log('用户点击取消');
  58. }
  59. }
  60. });
  61. },
  62. //审核接口
  63. async laboratoryApply(){
  64. let obj = {
  65. applyId:this.itemData.applyId,
  66. auditStatus:1,
  67. rejectCause:this.rejectCause,
  68. rejectMaterial:this.checkList + '',
  69. };
  70. const {data} = await laboratoryApply(obj)
  71. if(data.code == 200){
  72. uni.showToast({
  73. title: '审核成功',
  74. icon:"none",
  75. mask:true,
  76. duration: 2000
  77. });
  78. setTimeout(function(){
  79. uni.navigateBack({
  80. delta: 2
  81. });
  82. },2000);
  83. }
  84. },
  85. checkItem(item){
  86. item.type = !item.type;
  87. this.$forceUpdate();
  88. },
  89. }
  90. }
  91. </script>
  92. <style lang="stylus" scoped>
  93. #approve{
  94. height:100%;
  95. background #fff
  96. overflow hidden
  97. textarea{
  98. width:670rpx;
  99. height:200rpx;
  100. margin:20rpx 30rpx 0;
  101. font-size:28rpx;
  102. border: 1rpx solid #E0E0E0;
  103. border-radius:10rpx;
  104. padding:20rpx;
  105. }
  106. .approve-title{
  107. font-weight:700;
  108. color:#333;
  109. font-size:30rpx;
  110. font-weight:700;
  111. margin:20rpx 30rpx ;
  112. }
  113. .approve-for-box{
  114. display flex;
  115. height:60rpx;
  116. padding-left:40rpx;
  117. img{
  118. width:30rpx;
  119. height:30rpx;
  120. margin:15rpx;
  121. }
  122. view{
  123. font-size:28rpx;
  124. height:60rpx;
  125. line-height:60rpx;
  126. }
  127. }
  128. .button-view{
  129. width: 600rpx;
  130. height: 80rpx;
  131. background: #0183FA;
  132. border-radius: 20rpx;
  133. font-size:30rpx;
  134. line-height:80rpx;
  135. text-align center;
  136. color: #fff;
  137. margin:90rpx auto;
  138. }
  139. }
  140. </style>