strudentPayInfo.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479
  1. <!-- -->
  2. <template>
  3. <div class="m-container">
  4. <el-page-header @back="goBack"
  5. content="学员缴费记录">
  6. </el-page-header>
  7. <!-- this.info = {
  8. paymentStatus: res.data.calender.paymentStatus,
  9. startPaymentDate: res.data.calender.startPaymentDate,
  10. deadlinePaymentDate: res.data.calender.deadlinePaymentDate,
  11. expectNum: res.data.calender.expectNum,
  12. actualNum: res.data.calender.actualNum,
  13. sumActualAmount: res.data.sumActualAmount
  14. } -->
  15. <div class="infoMsg">
  16. <div class="left">
  17. <p class="title">状态</p>
  18. <p class="status"
  19. style="color:#ff6a6a"
  20. v-if="info.paymentStatus == 1">{{'已开启'}}</p>
  21. <p class="status"
  22. style="color:#5ccdb8"
  23. v-if="info.paymentStatus == 2">{{'已完成'}}</p>
  24. </div>
  25. <div class="right">
  26. <div class="expectBox first">
  27. <p class="title">预计缴费日期</p>
  28. <p class="status">{{info.startPaymentDate|formatTimer}}~{{info.deadlinePaymentDate|formatTimer}}</p>
  29. </div>
  30. <div class='expectBox'>
  31. <p class="title">预计缴费人数</p>
  32. <p class="status">{{info.expectNum?info.expectNum:0}}</p>
  33. </div>
  34. <div class='expectBox'>
  35. <p class="title">实际缴费人数</p>
  36. <p class="status">{{info.actualNum?info.actualNum:0}}</p>
  37. </div>
  38. <div class='expectBox'>
  39. <p class="title">收款金额</p>
  40. <p class="status">{{info.sumActualAmount?info.sumActualAmount:0}}</p>
  41. </div>
  42. </div>
  43. </div>
  44. <div class="m-core">
  45. <el-form :inline="true"
  46. :model="searchForm">
  47. <el-form-item>
  48. <el-input v-model.trim="searchForm.userId"
  49. @keyup.enter.native="search"
  50. placeholder='学生编号'></el-input>
  51. </el-form-item>
  52. <el-form-item>
  53. <el-select v-model.trim="searchForm.subjectId"
  54. style="width:180px"
  55. clearable
  56. filterable
  57. placeholder="请选择声部">
  58. <el-option v-for="(item,index) in soundList"
  59. :key="index"
  60. :label="item.name"
  61. :value="item.id"></el-option>
  62. </el-select>
  63. </el-form-item>
  64. <el-form-item>
  65. <el-select v-model.trim="searchForm.paymentStatus"
  66. style="width:180px"
  67. clearable
  68. filterable
  69. placeholder="请选择状态">
  70. <el-option label="未缴费"
  71. value="0"></el-option>
  72. <el-option label="缴费中"
  73. value="1"></el-option>
  74. <el-option label="已缴费"
  75. value="2"></el-option>
  76. </el-select>
  77. </el-form-item>
  78. <el-form-item>
  79. <el-button @click="search"
  80. type="danger">搜索</el-button>
  81. <el-button @click="onReSet"
  82. type="primary">重置</el-button>
  83. </el-form-item>
  84. </el-form>
  85. <div class="wrap">
  86. <div class="newBand"
  87. @click="resetPay"
  88. v-permission="'musicGroupPaymentCalenderDetail/updateExpectAmount'">修改缴费金额</div>
  89. <div class="newBand"
  90. @click="startPay"
  91. v-permission="'musicGroupPaymentCalenderDetail/openPayment'">开启缴费</div>
  92. </div>
  93. <div class="tableWrap">
  94. <el-table style="width: 100%"
  95. :header-cell-style="{background:'#EDEEF0',color:'#444'}"
  96. :data="tableList"
  97. @selection-change="handleSelectionChange">
  98. <el-table-column type="selection"
  99. width="55">
  100. </el-table-column>
  101. <el-table-column align="center"
  102. prop="userId"
  103. label="学员编号"></el-table-column>
  104. <el-table-column align="center"
  105. prop="studentId"
  106. label="学员姓名">
  107. <template slot-scope="scope">
  108. <div v-if="scope.row.sysUser">
  109. {{scope.row.sysUser.username}}
  110. </div>
  111. </template>
  112. </el-table-column>
  113. <el-table-column align="center"
  114. label="学员声部">
  115. <template slot-scope="scope">
  116. <div v-if="scope.row.studentRegistration">
  117. {{scope.row.studentRegistration.subjectName}}
  118. </div>
  119. </template>
  120. </el-table-column>
  121. <el-table-column align="center"
  122. prop="expectAmount"
  123. label="预计缴费金额"></el-table-column>
  124. <el-table-column align="center"
  125. label="缴费开始日期">
  126. <template slot-scope="scope">
  127. <div>
  128. {{scope.row.startPaymentDate | formatTimer}}
  129. </div>
  130. </template>
  131. </el-table-column>
  132. <el-table-column align="center"
  133. label="缴费截止日期">
  134. <template slot-scope="scope">
  135. <div>
  136. {{scope.row.deadlinePaymentDate | formatTimer}}
  137. </div>
  138. </template>
  139. </el-table-column>
  140. <el-table-column align="center"
  141. label="是否开启缴费">
  142. <template slot-scope="scope">
  143. <div>
  144. {{scope.row.open?'是':'否'}}
  145. </div>
  146. </template>
  147. </el-table-column>
  148. <el-table-column align="center"
  149. label="缴费状态">
  150. <template slot-scope="scope">
  151. <div>
  152. {{scope.row.paymentStatus | paymentStatusDetall}}
  153. </div>
  154. </template>
  155. </el-table-column>
  156. <el-table-column align="center"
  157. prop="studentId"
  158. label="支付时间">
  159. <template slot-scope="scope">
  160. <div>
  161. {{scope.row.payTime | dateForMinFormat}}
  162. </div>
  163. </template>
  164. </el-table-column>
  165. <!-- <el-table-column align="center"
  166. label="操作">
  167. <template slot-scope="scope">
  168. <div>
  169. <el-button type="text"
  170. @click="resetPay(scope.row)">修改金额</el-button>
  171. <el-button type="text"
  172. @click="startPay(scope.row)">开启缴费</el-button>
  173. </div>
  174. </template>
  175. </el-table-column> -->
  176. </el-table>
  177. <pagination :total="rules.total"
  178. :page.sync="rules.page"
  179. :limit.sync="rules.limit"
  180. :page-sizes="rules.page_size"
  181. @pagination="getList" />
  182. </div>
  183. </div>
  184. <el-dialog :visible.sync="payVisible"
  185. width="500px"
  186. title="修改缴费时间">
  187. <el-form :model="payForm"
  188. ref='payForm'>
  189. <el-form-item label="缴费开始日期"
  190. :rules="[{ required: true, message: '请设置缴费开始日期',trigger: 'blur'}]"
  191. prop="startDate">
  192. <el-date-picker v-model.trim="payForm.startDate"
  193. type="date"
  194. :picker-options="pickerOptions"
  195. value-format="yyyy-MM-dd"
  196. placeholder="开始日期"></el-date-picker>
  197. </el-form-item>
  198. </el-form>
  199. <div slot="footer"
  200. class="dialog-footer">
  201. <el-button @click="payVisible = false">取 消</el-button>
  202. <el-button type="primary"
  203. @click="">确 定</el-button>
  204. </div>
  205. </el-dialog>
  206. <el-dialog :visible.sync="resetPayVisible"
  207. width="500px"
  208. title="修改缴费金额">
  209. <el-form :model="resetPayForm"
  210. :inline="true"
  211. label-width="120px"
  212. label-position="right"
  213. ref='resetPayForm'>
  214. <!-- <el-form-item label="学生姓名"
  215. :rules="[{ required: true, message: '学生姓名',trigger: 'blur'}]"
  216. prop="startDate">
  217. <el-input disabled
  218. value="张三"></el-input>
  219. </el-form-item> -->
  220. <el-form-item label="预计缴费金额"
  221. :rules="[{ required: true, message: '请输入预计缴费金额',trigger: 'blur'},{pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/, message: '请输入正确的金额',trigger: 'blur' }]"
  222. prop="momey">
  223. <el-input v-model="resetPayForm.momey"></el-input>
  224. </el-form-item>
  225. </el-form>
  226. <div slot="footer"
  227. class="dialog-footer">
  228. <el-button @click="resetPayVisible = false">取 消</el-button>
  229. <el-button type="primary"
  230. @click="submitReset">确 定</el-button>
  231. </div>
  232. </el-dialog>
  233. </div>
  234. </template>
  235. <script>
  236. import axios from "axios";
  237. import { getToken } from "@/utils/auth";
  238. import pagination from "@/components/Pagination/index";
  239. import load from "@/utils/loading";
  240. import { findSound, getmusicGroupPaymentCalenderDetail, openMusicGroupPaymentCalenderDetailPayment, resetMusicGroupPaymentCalenderDetail, getMusicGroupPaymentCalenderDetail } from "@/api/buildTeam";
  241. export default {
  242. components: { pagination },
  243. data () {
  244. return {
  245. searchForm: {
  246. userId: null,
  247. subjectId: null,
  248. paymentStatus: null
  249. },
  250. teacherList: [],
  251. soundList: [],
  252. tableList: [{ studentId: 111 }],
  253. rules: {
  254. // 分页规则
  255. limit: 10, // 限制显示条数
  256. page: 1, // 当前页
  257. total: 0, // 总条数
  258. page_size: [10, 20, 40, 50] // 选择限制显示条数
  259. },
  260. payVisible: false,
  261. resetPayVisible: false,
  262. pickerOptions: {
  263. disabledDate (time) {
  264. return time.getTime() + 86400000 <= new Date().getTime();
  265. }
  266. },
  267. payForm: {
  268. startDate: null
  269. },
  270. resetPayForm: {
  271. momey: null
  272. },
  273. activeChiose: [],
  274. id: null,
  275. ids: null,
  276. info: {
  277. paymentStatus: null,
  278. startPaymentDate: null,
  279. deadlinePaymentDate: null,
  280. expectNum: null,
  281. actualNum: null,
  282. sumActualAmount: null
  283. }
  284. };
  285. },
  286. //生命周期 - 创建完成(可以访问当前this实例)
  287. created () { },
  288. //生命周期 - 挂载完成(可以访问DOM元素)
  289. mounted () {
  290. // 获取声部
  291. this.teamid = this.$route.query.id;
  292. findSound({ musicGroupId: this.teamid }).then(res => {
  293. if (res.code == 200) {
  294. this.soundList = res.data;
  295. }
  296. });
  297. // 获取分部
  298. this.init();
  299. },
  300. activated () {
  301. this.init();
  302. },
  303. methods: {
  304. init () {
  305. this.id = this.$route.query.paymentId
  306. // 获取缴费状态
  307. getMusicGroupPaymentCalenderDetail({ id: this.id }).then(res => {
  308. if (res.code == 200) {
  309. this.info = {
  310. paymentStatus: res.data.calender.paymentStatus,
  311. startPaymentDate: res.data.calender.startPaymentDate,
  312. deadlinePaymentDate: res.data.calender.deadlinePaymentDate,
  313. expectNum: res.data.calender.expectNum,
  314. actualNum: res.data.calender.actualNum,
  315. sumActualAmount: res.data.sumActualAmount
  316. }
  317. this.getList()
  318. }
  319. })
  320. },
  321. getList () {
  322. this.searchForm.id = this.id;
  323. this.searchForm.page = this.rules.page;
  324. this.searchForm.rows = this.rules.limit
  325. getmusicGroupPaymentCalenderDetail(this.searchForm).then(res => {
  326. if (res.code == 200) {
  327. this.rules.total = res.data.total;
  328. this.tableList = res.data.rows;
  329. if (this.info.paymentStatus == 1) {
  330. this.tableList = this.tableList.map(item => {
  331. item.startPaymentDate = this.info.startPaymentDate
  332. item.deadlinePaymentDate = this.info.deadlinePaymentDate
  333. item.open = 1;
  334. return item;
  335. })
  336. }
  337. }
  338. })
  339. },
  340. search () {
  341. this.rules.page = 1;
  342. this.getList()
  343. },
  344. onReSet () {
  345. this.searchForm = {
  346. userId: null,
  347. subjectId: null,
  348. paymentStatus: null
  349. }
  350. this.search()
  351. },
  352. startPay () {
  353. if (this.activeChiose.length < 1) {
  354. this.$message.error('请至少选择一名学生')
  355. return
  356. }
  357. },
  358. resetPay () {
  359. // this.activeRow = row;
  360. if (this.activeChiose.length < 1) {
  361. this.$message.error('请至少选择一名学生')
  362. return
  363. }
  364. let ids = this.activeChiose.map(item => {
  365. return item.id
  366. })
  367. this.ids = ids.join(',')
  368. this.resetPayVisible = true
  369. },
  370. // resetTime () {
  371. // this.payVisible = true;
  372. // },
  373. goBack () {
  374. let query = this.$route.query
  375. sessionStorage.setItem('resetCode', 3)
  376. this.$router.push({ path: '/business/resetTeaming', query })
  377. },
  378. handleSelectionChange (val) {
  379. this.activeChiose = val;
  380. },
  381. startPay () {
  382. if (this.activeChiose.length < 1) {
  383. this.$message.error('请至少选择一名学生')
  384. return
  385. }
  386. // console.log(this.activeChiose)
  387. let ids = this.activeChiose.map(item => {
  388. return item.id
  389. })
  390. ids = ids.join(',')
  391. // console.log(ids)
  392. openMusicGroupPaymentCalenderDetailPayment({ ids }).then(res => {
  393. if (res.code == 200) {
  394. this.$message.success('开启成功')
  395. this.getList();
  396. }
  397. })
  398. },
  399. submitReset () {
  400. let obj = {};
  401. obj.expectAmount = this.resetPayForm.momey;
  402. obj.ids = this.ids;
  403. resetMusicGroupPaymentCalenderDetail(obj).then(res => {
  404. if (res.code == 200) {
  405. this.$message.success('修改成功')
  406. this.resetPayVisible = false;
  407. this.getList();
  408. }
  409. })
  410. }
  411. }, watch: {
  412. payVisible (val) {
  413. if (!val) {
  414. this.payForm = {
  415. startDate: null
  416. }
  417. this.$refs['payForm'].resetFields()
  418. }
  419. }
  420. }
  421. };
  422. </script>
  423. <style lang='scss' scoped>
  424. .infoMsg {
  425. margin: 30px 0;
  426. display: flex;
  427. flex-direction: row;
  428. justify-content: flex-start;
  429. text-align: center;
  430. .title {
  431. color: #999;
  432. font-size: 14px;
  433. line-height: 30px;
  434. }
  435. .status {
  436. font-size: 20px;
  437. }
  438. .left {
  439. width: 200px;
  440. display: flex;
  441. flex-direction: column;
  442. justify-content: center;
  443. height: 60px;
  444. margin-right: 200px;
  445. }
  446. .right {
  447. text-align: center;
  448. height: 60px;
  449. line-height: 30px;
  450. display: flex;
  451. flex-direction: row;
  452. justify-content: flex-start;
  453. .expectBox {
  454. width: 220px;
  455. border-right: 1px solid #ccc;
  456. &:nth-last-child(1) {
  457. border-right: none !important;
  458. }
  459. }
  460. .expectBox.first {
  461. width: 300px;
  462. }
  463. }
  464. }
  465. .wrap {
  466. display: flex;
  467. flex-direction: row;
  468. div {
  469. margin-right: 20px;
  470. }
  471. }
  472. </style>