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.

188 lines
4.5 KiB

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