approve.vue 3.1 KB

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