list.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <template>
  2. <div>
  3. <el-button
  4. type="primary"
  5. :disabled="disabled"
  6. @click="openPay"
  7. v-permission="'musicGroupPaymentCalenderDetail/openPayment?page=ArrearageStudents'"
  8. >开启缴费</el-button>
  9. <el-button
  10. type="primary"
  11. :disabled="disabled"
  12. @click="removeUser"
  13. v-permission="'musicGroupPaymentCalenderDetail/batchDel?page=ArrearageStudents'"
  14. >删除学员</el-button>
  15. <el-table
  16. :data="list"
  17. style="width: 100%;margin-top: 20px;"
  18. max-height="400px"
  19. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  20. @selection-change="handleSelectionChange"
  21. >
  22. <el-table-column type="selection"
  23. :selectable="checkSelect"
  24. width="55"
  25. />
  26. <el-table-column
  27. prop="id"
  28. label="缴费编号"
  29. >
  30. <copy-text slot-scope="scope">
  31. {{ scope.row.id }}
  32. </copy-text>
  33. </el-table-column>
  34. <el-table-column
  35. prop="startPaymentDateMgpc"
  36. label="缴费开始日期"
  37. >
  38. <div slot-scope="scope">
  39. {{ scope.row.startPaymentDateMgpc | formatTimer }}
  40. </div>
  41. </el-table-column>
  42. <el-table-column
  43. prop="deadlinePaymentDateMgpc"
  44. label="缴费截止日期"
  45. >
  46. <div slot-scope="scope">
  47. {{ scope.row.deadlinePaymentDateMgpc | formatTimer }}
  48. </div>
  49. </el-table-column>
  50. <el-table-column
  51. prop="expectAmount"
  52. label="预计缴费金额"
  53. >
  54. <div slot-scope="scope">
  55. {{ scope.row.expectAmount | moneyFormat }}
  56. </div>
  57. </el-table-column>
  58. <el-table-column
  59. prop="open"
  60. label="是否开启缴费"
  61. >
  62. <div slot-scope="scope">
  63. {{ scope.row.open ? '是' : '否' }}
  64. </div>
  65. </el-table-column>
  66. <el-table-column
  67. prop="paymentStatus"
  68. label="缴费类型"
  69. >
  70. <div slot-scope="scope">
  71. {{ scope.row.paymentType | userPaymentTypeFormat }}
  72. </div>
  73. </el-table-column>
  74. <el-table-column
  75. prop="paymentStatus"
  76. label="缴费状态"
  77. >
  78. <div slot-scope="scope">
  79. {{ scope.row.paymentStatus | paymentStatusDetall }}
  80. </div>
  81. </el-table-column>
  82. <el-table-column
  83. prop="payTime"
  84. label="支付时间"
  85. >
  86. <div slot-scope="scope">
  87. {{ scope.row.payTime | dateForMinFormat }}
  88. </div>
  89. </el-table-column>
  90. <el-table-column
  91. prop="ctrls"
  92. label="操作"
  93. >
  94. <template slot-scope="scope">
  95. <el-button v-if="scope.row.paymentStatus == 'NON_PAYMENT'" type="text" @click="openCode(scope.row)">查看二维码</el-button>
  96. </template>
  97. </el-table-column>
  98. </el-table>
  99. <pagination
  100. :total.sync="rules.total"
  101. :page.sync="rules.page"
  102. :limit.sync="rules.limit"
  103. :page-sizes="rules.page_size"
  104. @pagination="FetchList"
  105. />
  106. <qr-code v-model="codeStatus" :codeUrl="codeUrl" />
  107. <div slot="footer" class="dialog-footer" style="text-align: right;">
  108. <el-button @click="$emit('close')">关闭</el-button>
  109. </div>
  110. </div>
  111. </template>
  112. <script>
  113. import { vaildStudentUrl } from '@/utils/validate'
  114. import qrCode from '@/components/QrCode/index';
  115. import pagination from "@/components/Pagination/index";
  116. import {
  117. getmusicGroupPaymentCalenderDetail,
  118. openMusicGroupPaymentCalenderDetailPayment,
  119. delMusicGroupPaymentCalenderStudent
  120. } from '@/api/buildTeam'
  121. export default {
  122. props: ['userId', 'musicGroupId'],
  123. components: { pagination, qrCode },
  124. data() {
  125. return {
  126. list: [],
  127. activeChiose: [],
  128. codeStatus: false,
  129. codeUrl: '',
  130. rules: {
  131. // 分页规则
  132. limit: 10, // 限制显示条数
  133. page: 1, // 当前页
  134. total: 0, // 总条数
  135. page_size: [10, 20, 40, 50], // 选择限制显示条数
  136. },
  137. }
  138. },
  139. computed: {
  140. disabled() {
  141. return !this.activeChiose.length
  142. }
  143. },
  144. mounted() {
  145. this.FetchList()
  146. },
  147. methods: {
  148. handleSelectionChange (val) {
  149. this.activeChiose = val
  150. },
  151. checkSelect (val) {
  152. return val.paymentStatus == 'NON_PAYMENT'
  153. },
  154. openCode(row) {
  155. this.codeStatus = true
  156. this.codeUrl = vaildStudentUrl() + '/#/musicGroupRenew?calenderId=' + row.musicGroupPaymentCalenderId + '&id=' + this.musicGroupId
  157. },
  158. async removeUser() {
  159. try {
  160. await this.$confirm('是否确认删除学员?', '提示', {
  161. type: 'warning'
  162. })
  163. await delMusicGroupPaymentCalenderStudent({
  164. musicGroupPaymentCalenderDetailIds: this.activeChiose.map(item => item.id).join(',')
  165. })
  166. this.$message.success('删除成功')
  167. this.FetchList()
  168. } catch (error) {}
  169. },
  170. async openPay() {
  171. try {
  172. await this.$confirm('是否确认开启缴费?', '提示', {
  173. type: 'warning'
  174. })
  175. await openMusicGroupPaymentCalenderDetailPayment({
  176. ids: this.activeChiose.map(item => item.id).join(',')
  177. })
  178. this.$message.success('开启成功')
  179. this.FetchList()
  180. } catch (error) {}
  181. },
  182. async FetchList() {
  183. try {
  184. const res = await getmusicGroupPaymentCalenderDetail({
  185. musicGroupId: this.musicGroupId,
  186. userId: this.userId,
  187. page: this.rules.page,
  188. rows: this.rules.limit,
  189. })
  190. this.rules.total = res.data.total;
  191. this.list = res.data.rows
  192. } catch (error) {}
  193. }
  194. }
  195. }
  196. </script>