approve.vue 3.1 KB

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