approve.vue 3.8 KB

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