signupList.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673
  1. <template>
  2. <div class="sigup-container">
  3. <div class="topWrap">
  4. <div>
  5. <h2>
  6. <div class="squrt"></div>
  7. {{ teamName }}报名详情
  8. </h2>
  9. <div class="btnList">
  10. <div class='newBand close'>停止乐团</div>
  11. <div class='newBand' @click="paymentStatus = true"
  12. v-if="status=='APPLY'">开始缴费</div>
  13. <div class='newBand' @click="onGoHome"
  14. v-if="status=='PAY'">确认开团</div>
  15. <div class='newBand'
  16. v-if="status=='PAY'">延长缴费</div>
  17. <div class='newBand' @click="onCreateQRCode" >生成二维码</div>
  18. </div>
  19. </div>
  20. <p class='msg'> <img src="@/assets/images/base/clock.png"
  21. alt=""> {{ status=='APPLY'?'报名中':'缴费中' }}</p>
  22. </div>
  23. <div class="searchList">
  24. <el-form :inline="true"
  25. :model="searchFrom">
  26. <el-form-item label="专业">
  27. <el-select v-model="searchFrom.subject"
  28. clearable>
  29. <el-option v-for="(item,index) in soundList"
  30. :key='index'
  31. :label="item.name"
  32. :value="item.id"></el-option>
  33. </el-select>
  34. </el-form-item>
  35. <el-form-item label="是否允许调剂">
  36. <el-select v-model="searchFrom.isAllowAdjust"
  37. clearable>
  38. <el-option label="允许调剂"
  39. value="1"></el-option>
  40. <el-option label="不允许调剂"
  41. value="0"></el-option>
  42. </el-select>
  43. </el-form-item>
  44. <el-form-item label="用户名或手机号">
  45. <el-input v-model="searchFrom.name"></el-input>
  46. </el-form-item>
  47. <!-- 专业actualSubjectId 调剂isAllowAdjust 手机号name -->
  48. <el-form-item>
  49. <div class='searchBtn'
  50. @click='getList'>搜索</div>
  51. </el-form-item>
  52. </el-form>
  53. </div>
  54. <div class="sigup-core">
  55. <div class="left">
  56. <el-table :data='leftList'
  57. :header-cell-style="{background:'#EDEEF0',color:'#444'}">
  58. <el-table-column label="乐团声部"
  59. prop="subjectName"
  60. align='center'>
  61. </el-table-column>
  62. <el-table-column label="计划招生"
  63. prop="expectedStudentNum"
  64. align='center'>
  65. </el-table-column>
  66. <el-table-column label="已报名"
  67. prop='applyStudentNum'
  68. align='center'>
  69. </el-table-column>
  70. </el-table>
  71. </div>
  72. <div class="right">
  73. <el-table :data='rightList' ref="multipleTable"
  74. :header-cell-style="{background:'#EDEEF0',color:'#444'}"
  75. @selection-change="handleSelectionChange">
  76. <el-table-column
  77. type="selection"
  78. width="55">
  79. </el-table-column>
  80. <el-table-column label="学员姓名"
  81. prop="studentName"
  82. align='center'>
  83. </el-table-column>
  84. <el-table-column label="家长姓名"
  85. prop="parentsName"
  86. align='center'>
  87. </el-table-column>
  88. <el-table-column label="年级班级"
  89. align='center'>
  90. <template slot-scope="scope">
  91. <div>
  92. {{scope.row.currentGrade+scope.row.currentClass}}
  93. </div>
  94. </template>
  95. </el-table-column>
  96. <el-table-column label="性别"
  97. prop="gender"
  98. align='center'>
  99. <template slot-scope="scope">
  100. <div>
  101. {{scope.row.gender | sex}}
  102. </div>
  103. </template>
  104. </el-table-column>
  105. <el-table-column label="服从调剂"
  106. prop="isAllowAdjust"
  107. align='center'>
  108. <template slot-scope="scope">
  109. <div>
  110. {{ scope.row.isAllowAdjust | isAllowAdjust}}
  111. </div>
  112. </template>
  113. </el-table-column>
  114. <el-table-column label="报名专业"
  115. prop="subjectName"
  116. align='center'>
  117. </el-table-column>
  118. <el-table-column label="调剂专业"
  119. prop="actualSubjectName"
  120. align='center'>
  121. </el-table-column>
  122. <el-table-column label="联系电话"
  123. prop="parentsPhone"
  124. align='center'>
  125. </el-table-column>
  126. <!-- v-if='status == "PAY"' -->
  127. <el-table-column label="学员状态"
  128. prop="paymentStatus"
  129. align='center'>
  130. <template slot-scope="scope">
  131. <div>
  132. {{ scope.row.paymentStatus | paymentStatus }}
  133. </div>
  134. </template>
  135. </el-table-column>
  136. <el-table-column label="操作"
  137. align='center'>
  138. <template slot-scope="scope">
  139. <div>
  140. <el-button type='text'
  141. @click='resetSubject(scope.row)'>修改专业</el-button>
  142. <!-- APPLY -->
  143. <el-popover v-if='status == "APPLY" || scope.row.remark'
  144. placement="top-start"
  145. title="备注"
  146. width="200"
  147. trigger="hover"
  148. :content="scope.row.remark">
  149. <el-button type="text" slot="reference">备注</el-button>
  150. </el-popover>
  151. <!-- PAY -->
  152. <el-button type='text'
  153. v-if='status == "PAY"&&scope.row.paymentStatus==1'
  154. @click='lookdetail(scope.row)'>查看</el-button>
  155. </div>
  156. </template>
  157. </el-table-column>
  158. </el-table>
  159. <div style="margin-top: 10px; margin-bottom: 10px;" v-if="status=='APPLY'">
  160. <el-button @click="onSelectAll">全选/取消</el-button>
  161. <el-button style="background-color: #14928a;border: 1px solid #14928a;" @click="onPartPayment" type="primary">提前缴费</el-button>
  162. <!-- <div class='newBand' v-if="status=='APPLY'">允许缴费</div> -->
  163. </div>
  164. <pagination :total="rules.total"
  165. :page.sync="rules.page"
  166. :limit.sync="rules.limit"
  167. :page-sizes="rules.page_size"
  168. @pagination="getList" />
  169. </div>
  170. </div>
  171. <el-dialog title="修改专业"
  172. :visible.sync="subjectVisible"
  173. width="400px">
  174. <el-form :model="maskForm">
  175. <el-form-item label="选择专业">
  176. <el-select v-model="maskForm.subject"
  177. clearable>
  178. <el-option v-for="(item,index) in soundList"
  179. :key='index'
  180. :label="item.name"
  181. :value="item.id"></el-option>
  182. </el-select>
  183. </el-form-item>
  184. </el-form>
  185. <div slot="footer"
  186. class="dialog-footer">
  187. <el-button @click="subjectVisible = false">取 消</el-button>
  188. <el-button type="primary" @click="okReset">确 定</el-button>
  189. </div>
  190. </el-dialog>
  191. <el-dialog title="订单详情"
  192. :visible.sync="orderVisible"
  193. width="600px">
  194. <el-form :model="orderForm"
  195. :inline="true">
  196. <!-- name: '',
  197. totalAmount: '',
  198. subject: '',
  199. subjectFee: '',
  200. axe: '',
  201. axePrice: '',
  202. others: '',
  203. othersPrice: '' -->
  204. <el-form-item label="学员姓名">
  205. <el-input v-model="orderForm.name"
  206. disabled=""></el-input>
  207. </el-form-item>
  208. <el-form-item label="实缴金额">
  209. <el-input v-model="orderForm.totalAmount"
  210. disabled=""></el-input>
  211. </el-form-item>
  212. <el-form-item label="实际专业">
  213. <el-input v-model="orderForm.subject"
  214. disabled=""></el-input>
  215. </el-form-item>
  216. <el-form-item label="课程费用">
  217. <el-input v-model="orderForm.subjectFee"
  218. disabled=""></el-input>
  219. </el-form-item>
  220. <el-form-item label="选择乐器">
  221. <el-input v-model="orderForm.axe"
  222. disabled=""></el-input>
  223. </el-form-item>
  224. <el-form-item label="乐器价格">
  225. <el-input v-model="orderForm.axePrice"
  226. disabled=""></el-input>
  227. </el-form-item>
  228. <el-form-item label="教辅组合">
  229. <el-input v-model="orderForm.others"
  230. disabled=""></el-input>
  231. </el-form-item>
  232. <el-form-item label="组合价格">
  233. <el-input v-model="orderForm.othersPrice"
  234. disabled=""></el-input>
  235. </el-form-item>
  236. </el-form>
  237. <div slot="footer"
  238. class="dialog-footer">
  239. <!-- <el-button>取 消</el-button> -->
  240. <el-button type="primary"
  241. @click="orderVisible = false">确 定</el-button>
  242. </div>
  243. </el-dialog>
  244. <el-dialog title="开始缴费"
  245. :visible.sync="paymentStatus"
  246. width="400px">
  247. <el-form ref="paymentForm" :model="paymentForm" label-position="top" :rules="paymentRules">
  248. <el-form-item label="请设置缴费截止日期" prop="paymentExpireDate">
  249. <el-date-picker
  250. v-model="paymentForm.paymentExpireDate"
  251. type="date"
  252. value-format="yyyy-MM-dd"
  253. style="width: 100%"
  254. placeholder="选择日期">
  255. </el-date-picker>
  256. </el-form-item>
  257. </el-form>
  258. <div slot="footer" class="dialog-footer">
  259. <el-button @click="paymentStatus = false">取 消</el-button>
  260. <el-button type="primary" @click="onStartPayment('paymentForm')">确 定</el-button>
  261. </div>
  262. </el-dialog>
  263. <el-dialog title="报名二维码"
  264. :visible.sync="qrcodeStatus"
  265. width="500px">
  266. <div class="left-code">
  267. <h2>学员报名连接</h2>
  268. <div id="qrcode" class="qrcode code"
  269. ref="qrCodeUrl"></div>
  270. <p class="code-url" v-if="codeUrl">{{ codeUrl }}</p>
  271. </div>
  272. <div class="right-code">
  273. <h2>报名缴费详情</h2>
  274. <div id="qrcode2" class="qrcode code"
  275. ref="qrCodeUrl"></div>
  276. <p class="code-url" v-if="codeUrl2">{{ codeUrl2 }}</p>
  277. </div>
  278. </el-dialog>
  279. </div>
  280. </template>
  281. <script>
  282. import pagination from '@/components/Pagination/index'
  283. import { getTeamRecruit, getintoClass, getStudentList, findSound, musicGroupOpenPay, openPayment, musicGroupFound } from '@/api/buildTeam'
  284. import { resetStudentSubject, getStudentFeeDetail } from '@/api/studentManager'
  285. import QRCode from 'qrcodejs2'
  286. export default {
  287. components: {
  288. pagination
  289. },
  290. data () {
  291. return {
  292. multipleSelection: [], //
  293. subjectVisible: false,
  294. orderVisible: false,
  295. leftList: [],
  296. rightList: [],
  297. searchFrom: {
  298. name: '',
  299. subject: '', // 专业
  300. isAllowAdjust: '' // 是否允许调剂
  301. },
  302. status: '',
  303. id: '',
  304. rules: {
  305. // 分页规则
  306. limit: 10, // 限制显示条数
  307. page: 1, // 当前页
  308. total: 0, // 总条数
  309. page_size: [10, 20, 30, 40] // 选择限制显示条数
  310. },
  311. teamName: '',
  312. maskForm: {
  313. subject: ''
  314. },
  315. activeId: '',
  316. soundList: [],
  317. orderForm: {
  318. name: '',
  319. totalAmount: '',
  320. subject: '',
  321. subjectFee: '',
  322. axe: '',
  323. axePrice: '',
  324. others: '',
  325. othersPrice: ''
  326. },
  327. paymentStatus: false,
  328. paymentForm: {
  329. paymentExpireDate: null,
  330. },
  331. paymentRules: {
  332. paymentExpireDate: [{ required: true, message: '请设置缴费截止日期', trigger: 'blur' }]
  333. },
  334. qrcodeStatus: false, // 生成二维码
  335. qrcodes: true,
  336. qrcode: null,
  337. codeUrl: null,
  338. qrcode2: null,
  339. codeUrl2: null,
  340. }
  341. },
  342. created () {
  343. // 通过乐团状态判断显示隐藏的东西
  344. this.status = this.$route.query.status;
  345. // 通过乐团id 获取乐团招生状态
  346. this.id = this.$route.query.id;
  347. this.teamName = this.$route.query.name
  348. },
  349. mounted () {
  350. // 根据乐团id获取学团情况
  351. getintoClass({ musicGroupId: this.id }).then(res => {
  352. if (res.code == 200) {
  353. this.leftList = res.data;
  354. }
  355. })
  356. // 根据乐团id获乐团声部
  357. findSound({ musicGroupId: this.id }).then(res => {
  358. if (res.code == 200) {
  359. this.soundList = res.data;
  360. }
  361. })
  362. // 通过乐团id获取乐团学生列表
  363. this.getList()
  364. },
  365. methods: {
  366. getList () {
  367. let obj = {
  368. musicGroupId: this.id,
  369. actualSubjectId: this.searchFrom.subject || null,
  370. isAllowAdjust: this.searchFrom.isAllowAdjust || null,
  371. name: this.searchFrom.name || null
  372. }
  373. getStudentList(obj).then(res => {
  374. if (res.code == 200) {
  375. this.rightList = res.data.rows
  376. this.rules.total = res.data.total;
  377. }
  378. })
  379. },
  380. onStartPayment(formName) { // 开启缴费
  381. this.$refs[formName].validate((valid) => {
  382. if (valid) {
  383. musicGroupOpenPay({
  384. musicGroupId: this.id,
  385. expireDate: this.paymentForm.paymentExpireDate
  386. }).then(res => {
  387. if(res.code == 200) {
  388. this.$message({
  389. type: 'success',
  390. message: '开启成功'
  391. })
  392. this.paymentStatus = false
  393. this.$router.push({
  394. path: '/business/signupList',
  395. query: {
  396. status: 'PAY',
  397. id: this.$route.query.id,
  398. name: this.$route.query.name
  399. }
  400. })
  401. this.status = 'PAY'
  402. }
  403. })
  404. } else {
  405. console.log('error submit!!');
  406. return false;
  407. }
  408. })
  409. // this.id
  410. },
  411. onSelectAll() { // 选中全部
  412. this.$refs.multipleTable.toggleAllSelection()
  413. },
  414. onPartPayment() { // 部分缴费
  415. let selection = this.multipleSelection
  416. if(selection.length <= 0) {
  417. this.$message({
  418. message: '您还没有选择学生',
  419. type: 'warning'
  420. })
  421. return false
  422. }
  423. let ids = []
  424. selection.forEach(item => {
  425. ids.push(item.id)
  426. })
  427. openPayment({
  428. ids: ids.join(',')
  429. }).then(res => {
  430. if(res.code == 200) {
  431. this.$message({
  432. message: '开启成功',
  433. type: 'success'
  434. })
  435. this.getList()
  436. } else {
  437. this.$message.error(res.msg)
  438. }
  439. })
  440. },
  441. onCreateQRCode() { // 生成报名二维码
  442. this.qrcodeStatus = true
  443. let id = this.$route.query.id
  444. if(this.qrcodes) {
  445. this.qrcodes = false
  446. setTimeout(() => {
  447. this.qrcode = new QRCode('qrcode', {
  448. width: 200,
  449. height: 200,
  450. colorDark: '#000000',
  451. colorLight: '#ffffff',
  452. correctLevel: QRCode.CorrectLevel.H
  453. })
  454. this.qrcode.makeCode('http://mstudev.dayaedu.com/#/login?musicGroupId=' + id)
  455. this.codeUrl = 'http://mstudev.dayaedu.com/#/login?musicGroupId=' + id
  456. this.qrcode2 = new QRCode('qrcode2', {
  457. width: 200,
  458. height: 200,
  459. colorDark: '#000000',
  460. colorLight: '#ffffff',
  461. correctLevel: QRCode.CorrectLevel.H
  462. })
  463. this.qrcode2.makeCode('http://mstudev.dayaedu.com/#/login?musicGroupId=' + id)
  464. this.codeUrl2 = 'http://mstudev.dayaedu.com/#/login?musicGroupId=' + id
  465. }, 500)
  466. }
  467. },
  468. onGoHome() { // 确认开团
  469. musicGroupFound({
  470. musicGroupId: this.$route.query.id
  471. }).then(res => {
  472. if(res.code == 200) {
  473. this.$message({
  474. type: 'success',
  475. message: '开启成功'
  476. })
  477. this.$router.push({
  478. path: '/business/teamDetails',
  479. query: {
  480. status: 'PROGRESS',
  481. id: this.$route.query.id,
  482. name: this.$route.query.name
  483. }
  484. })
  485. }
  486. })
  487. },
  488. handleSelectionChange(val) {
  489. this.multipleSelection = val;
  490. },
  491. // 修改专业
  492. resetSubject (row) {
  493. this.activeId = row.studentId
  494. this.subjectVisible = true;
  495. // resetStudentSubject().then(res=>{]})
  496. },
  497. // 确认修改
  498. okReset () {
  499. if (!this.maskForm.subject) {
  500. this.$message.error('请选择调剂专业');
  501. return
  502. }
  503. resetStudentSubject({ musicGroupId: this.id, userId: this.activeId, subId: this.maskForm.subject }).then(res => {
  504. if (res.code == 200) {
  505. this.$message.success('修改成功');
  506. this.subjectVisible = false;
  507. this.maskForm.subject = '';
  508. this.getList();
  509. }
  510. })
  511. },
  512. lookdetail (row) {
  513. console.log(row);
  514. this.orderVisible = true;
  515. this.activeId = row.studentId;
  516. this.orderForm.name = row.studentName;
  517. this.orderForm.subject = row.subjectName;
  518. getStudentFeeDetail({ musicGroupId: this.id, studentId: row.studentId }).then(res => {
  519. if (res.code == 200) {
  520. this.orderForm.totalAmount = res.data.totalAmount;
  521. this.orderForm.subjectFee = res.data.courseFee;
  522. for (let i in res.data.goods) {
  523. if (res.data.goods[i].goodsType == 'ACCESSORIES') {
  524. this.orderForm.axe = res.data.goods[i].goodsName;
  525. this.orderForm.axePrice = res.data.goods[i].musicalFee;
  526. } else if (res.data.goods[i].goodsType == 'INSTRUMENT') {
  527. this.orderForm.others = res.data.goods[i].goodsName;
  528. this.orderForm.othersPrice = res.data.goods[i].musicalFee;
  529. }
  530. }
  531. }
  532. })
  533. }
  534. },
  535. }
  536. </script>
  537. <style lang="scss">
  538. .sigup-container {
  539. margin-left: 12px;
  540. .topWrap {
  541. padding: 18px 58px;
  542. height: 136px;
  543. background-color: #fff;
  544. display: flex;
  545. flex-direction: row;
  546. justify-content: space-between;
  547. .msg {
  548. text-align: right;
  549. color: #f97215;
  550. font-size: 32px;
  551. font-weight: bold;
  552. padding-top: 30px;
  553. box-sizing: border-box;
  554. img {
  555. width: 36px;
  556. height: 36px;
  557. position: relative;
  558. top: 5px;
  559. margin-right: 8px;
  560. }
  561. }
  562. h2 {
  563. height: 48px;
  564. line-height: 48px;
  565. position: relative;
  566. // padding-left: 30px;
  567. font-size: 32px;
  568. font-weight: 600;
  569. margin-bottom: 10px;
  570. display: flex;
  571. flex-direction: row;
  572. justify-content: flex-start;
  573. align-items: center;
  574. .term {
  575. height: 32px;
  576. line-height: 32px;
  577. border-radius: 24px;
  578. width: 100px;
  579. color: #14928a;
  580. border: 1px solid rgba(20, 146, 138, 1);
  581. font-size: 14px;
  582. text-align: center;
  583. margin-right: 12px;
  584. &:nth-child(1) {
  585. margin-left: 47px;
  586. }
  587. }
  588. .term.active {
  589. color: #fff;
  590. background-color: #14928a;
  591. }
  592. .squrt {
  593. position: absolute;
  594. left: -25px;
  595. top: 8px;
  596. height: 34px;
  597. width: 8px;
  598. background-color: #14928a;
  599. }
  600. }
  601. .btnList {
  602. display: flex;
  603. flex-direction: row;
  604. justify-content: flex-start;
  605. align-items: center;
  606. div {
  607. margin-right: 15px;
  608. }
  609. }
  610. .newBand.close {
  611. background-color: #777;
  612. border: 1px solid #777;
  613. }
  614. }
  615. .searchList {
  616. background-color: #fff;
  617. padding: 0 58px;
  618. }
  619. .sigup-core {
  620. margin-top: 12px;
  621. display: flex;
  622. flex-direction: row;
  623. justify-content: flex-start;
  624. .left {
  625. width: 304px;
  626. background-color: #fff;
  627. height: 80vh;
  628. overflow: auto;
  629. }
  630. .right {
  631. margin-left: 12px;
  632. flex-grow: 1;
  633. }
  634. }
  635. }
  636. .el-dialog__body {
  637. overflow: hidden;
  638. }
  639. .left-code, .right-code {
  640. width: 50%;
  641. float: left;
  642. h2 {
  643. font-size: 18px;
  644. text-align: center;
  645. padding-bottom: 8px;
  646. }
  647. .qrcode {
  648. img {
  649. width: 200px;
  650. height: 200px;
  651. margin: 0 auto;
  652. }
  653. }
  654. .code-url {
  655. font-size: 18px;
  656. text-align: center;
  657. padding: 15px 15px 0 15px;
  658. }
  659. }
  660. </style>