approve.vue 3.4 KB

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