You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

226 lines
4.8 KiB

8 months ago
5 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
5 months ago
8 months ago
8 months ago
8 months ago
  1. <template>
  2. <view class="pageBg">
  3. <view class="bgImg">
  4. <!-- <view class="status_bar"></view> -->
  5. <topNavbar title="学员退款"></topNavbar>
  6. <view class="pad">
  7. <view class="navBox">
  8. <cardNav :navData="navData" :currentNav="params.status" @changeNav="changeNav" />
  9. </view>
  10. </view>
  11. </view>
  12. <view class="pad con">
  13. <view class="list">
  14. <view class="card" v-for="(item,index) in list" :key="index">
  15. <refundItem :item="item">
  16. <template>
  17. <view class="btn_row" v-if="item.auditStatus==0">
  18. <view class="btnBg" @click="passFn(item)">审核通过</view>
  19. <view class="btnBg" @click="noPassClick(item)">审核不通过</view>
  20. </view>
  21. </template>
  22. </refundItem>
  23. </view>
  24. </view>
  25. </view>
  26. <view style="padding-bottom: 20rpx;" v-if="list.length">
  27. <u-loadmore :status="status" />
  28. </view>
  29. <nodata v-if="!list.length&&status=='nomore'"></nodata>
  30. <u-popup :show="show" :round="16" mode="center" @close="show=false" @open="show=true" closeable>
  31. <view class="popCon">
  32. <view class="inputBox">
  33. <!-- <input type="text" placeholder="请输入不通过原因" > -->
  34. <!-- <u--textarea v-model="value3" placeholder="请输入内容" autoHeight ></u--textarea> -->
  35. <textarea placeholder="请输入不通过原因" maxlength="40" v-model.trim="schoolFailReason"></textarea>
  36. </view>
  37. <view class="footBox">
  38. <view class="btn">取消</view>
  39. <view class="btn blue" @click="noPass">确定</view>
  40. </view>
  41. </view>
  42. </u-popup>
  43. </view>
  44. </template>
  45. <script>
  46. import refundItem from './comp/item'
  47. import {
  48. headmasterPage,
  49. updateRefundStatusOpend,
  50. updateRefundStatusOut
  51. } from '@/config/api.js'
  52. export default {
  53. components: {
  54. refundItem
  55. },
  56. data() {
  57. return {
  58. show: false,
  59. navData: [{
  60. text: '待审核',
  61. id: 0
  62. },
  63. {
  64. text: '已审核',
  65. id: 1
  66. }
  67. ],
  68. params: {
  69. pageNo: 1,
  70. pageSize: 20,
  71. status: 0,
  72. },
  73. status: 'loading',
  74. list: [],
  75. schoolFailReason: '',
  76. curRefundId: '',
  77. }
  78. },
  79. onLoad() {
  80. this.headmasterPageFn()
  81. },
  82. methods: {
  83. changeNav(val) {
  84. if (this.params.status == val) return
  85. this.params.status = val
  86. this.listInit()
  87. },
  88. async headmasterPageFn() {
  89. const {
  90. data: res
  91. } = await headmasterPage(this.params)
  92. this.params.pageNo++
  93. this.list.push(...res.list)
  94. this.total = res.total
  95. if (this.list.length >= this.total) {
  96. this.status = 'nomore'
  97. } else {
  98. this.status = 'loading'
  99. }
  100. console.log(res)
  101. },
  102. listInit() {
  103. this.list = []
  104. this.params.pageNo = 1
  105. this.headmasterPageFn()
  106. },
  107. // 点击不通过
  108. noPassClick(item) {
  109. this.schoolFailReason = ''
  110. this.show = true
  111. this.curRefundId = item.refundId
  112. },
  113. // 不通过
  114. async noPass() {
  115. console.log(this.schoolFailReason)
  116. if (!this.schoolFailReason) return this.$u.toast('请输入不通过原因')
  117. const res = await updateRefundStatusOut({
  118. id: this.curRefundId,
  119. schoolFailReason: this.schoolFailReason
  120. })
  121. if (res.code == 0) {
  122. this.$u.toast('已驳回')
  123. this.schoolFailReason = ''
  124. this.show = false
  125. this.listInit()
  126. }
  127. console.log(res)
  128. },
  129. // 审核通过
  130. passFn(item) {
  131. let _this = this
  132. uni.showModal({
  133. title: '审核通过',
  134. content: `学员${item.studentName}的申请确定审通过吗?`,
  135. success: async function(res) {
  136. if (res.confirm) {
  137. const reslut = await updateRefundStatusOpend({
  138. id: item.refundId
  139. })
  140. if (reslut.code == 0) _this.$u.toast('已通过')
  141. _this.listInit()
  142. } else if (res.cancel) {
  143. console.log('用户点击取消');
  144. }
  145. }
  146. });
  147. }
  148. }
  149. }
  150. </script>
  151. <style lang="scss" scoped>
  152. .pageBg {
  153. height: auto;
  154. padding-bottom: 110rpx;
  155. }
  156. .navBox {
  157. padding: 0 0 24rpx 0;
  158. }
  159. .card {
  160. padding: 0 28rpx;
  161. margin-bottom: 24rpx;
  162. }
  163. .con {
  164. // transform: translateY(-100rpx);
  165. margin-top: -100rpx;
  166. }
  167. .popCon {
  168. width: calc(100vw - 100rpx);
  169. .inputBox {
  170. width: 100%;
  171. // height: 200rpx;
  172. padding: 90rpx 44rpx 24rpx 44rpx;
  173. textarea {
  174. border: 1rpx solid #eee;
  175. border-radius: 20rpx;
  176. display: block;
  177. width: 100%;
  178. height: 180rpx;
  179. padding: 20rpx 20rpx 0 20rpx;
  180. box-sizing: border-box;
  181. font-size: 30rpx;
  182. }
  183. }
  184. .footBox {
  185. width: 100%;
  186. height: 112rpx;
  187. display: flex;
  188. border-top: 1rpx solid #eee;
  189. .btn {
  190. flex: 1;
  191. text-align: center;
  192. line-height: 112rpx;
  193. font-size: 34rpx;
  194. color: #999;
  195. &.blue {
  196. color: $themC;
  197. border-left: 1rpx solid #eeeeee;
  198. }
  199. }
  200. }
  201. }
  202. .btn_row {
  203. display: flex;
  204. justify-content: center;
  205. padding: 10rpx 0 30rpx 0;
  206. .btnBg {
  207. width: 188rpx;
  208. margin: 0 26rpx;
  209. &:first-child {
  210. width: 168rpx;
  211. }
  212. }
  213. }
  214. </style>