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.

234 lines
4.9 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
4 months ago
8 months ago
5 months ago
4 months ago
8 months ago
8 months ago
4 months ago
8 months ago
4 months ago
4 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.schoolAuditStatus==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" @click="show=false">取消</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. console.log(val)
  85. if (this.params.status == val) return
  86. this.params.status = val
  87. this.listInit()
  88. },
  89. async headmasterPageFn() {
  90. const {
  91. data: res
  92. } = await headmasterPage(this.params)
  93. this.params.pageNo++
  94. this.list.push(...res.list)
  95. this.total = res.total
  96. if (this.list.length >= this.total) {
  97. this.status = 'nomore'
  98. } else {
  99. this.status = 'loading'
  100. }
  101. console.log(res)
  102. },
  103. listInit() {
  104. this.list = []
  105. this.params.pageNo = 1
  106. this.headmasterPageFn()
  107. },
  108. // 点击不通过
  109. noPassClick(item) {
  110. this.schoolFailReason = ''
  111. this.show = true
  112. this.curRefundId = item.refundId
  113. },
  114. // 不通过
  115. async noPass() {
  116. console.log(this.schoolFailReason)
  117. if (!this.schoolFailReason) return this.$u.toast('请输入不通过原因')
  118. const res = await updateRefundStatusOut({
  119. id: this.curRefundId,
  120. schoolFailReason: this.schoolFailReason
  121. })
  122. if (res.code == 0) {
  123. this.$u.toast('已驳回')
  124. this.schoolFailReason = ''
  125. this.show = false
  126. this.listInit()
  127. }
  128. console.log(res)
  129. },
  130. // 审核通过
  131. passFn(item) {
  132. let _this = this
  133. uni.showModal({
  134. title: '审核通过',
  135. content: `学员${item.studentName}的申请确定审通过吗?`,
  136. success: async function(res) {
  137. if (res.confirm) {
  138. const reslut = await updateRefundStatusOpend({
  139. id: item.refundId
  140. })
  141. if (reslut.code == 0) _this.$u.toast('已通过')
  142. _this.listInit()
  143. } else if (res.cancel) {
  144. console.log('用户点击取消');
  145. }
  146. }
  147. });
  148. }
  149. }
  150. }
  151. </script>
  152. <style lang="scss" scoped>
  153. .pageBg {
  154. height: auto;
  155. padding-bottom: 110rpx;
  156. }
  157. .bgImg {
  158. width: 100%;
  159. height: auto;
  160. padding: 0 0 1rpx 0;
  161. }
  162. .navBox {
  163. padding: 0 0 24rpx 0;
  164. }
  165. .card {
  166. padding: 0 28rpx;
  167. margin-top: 24rpx;
  168. }
  169. .con {
  170. // transform: translateY(-100rpx);
  171. // margin-top: -100rpx;
  172. }
  173. .popCon {
  174. width: calc(100vw - 100rpx);
  175. .inputBox {
  176. width: 100%;
  177. // height: 200rpx;
  178. padding: 90rpx 44rpx 24rpx 44rpx;
  179. textarea {
  180. border: 1rpx solid #eee;
  181. border-radius: 20rpx;
  182. display: block;
  183. width: 100%;
  184. height: 180rpx;
  185. padding: 20rpx 20rpx 0 20rpx;
  186. box-sizing: border-box;
  187. font-size: 30rpx;
  188. }
  189. }
  190. .footBox {
  191. width: 100%;
  192. height: 112rpx;
  193. display: flex;
  194. border-top: 1rpx solid #eee;
  195. .btn {
  196. flex: 1;
  197. text-align: center;
  198. line-height: 112rpx;
  199. font-size: 34rpx;
  200. color: #999;
  201. &.blue {
  202. color: $themC;
  203. border-left: 1rpx solid #eeeeee;
  204. }
  205. }
  206. }
  207. }
  208. .btn_row {
  209. display: flex;
  210. justify-content: center;
  211. padding: 10rpx 0 30rpx 0;
  212. .btnBg {
  213. width: 188rpx;
  214. margin: 0 26rpx;
  215. &:first-child {
  216. width: 168rpx;
  217. }
  218. }
  219. }
  220. </style>