signupList.vue 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968
  1. <template>
  2. <div class="sigup-container">
  3. <div class="topWrap">
  4. <div>
  5. <h2>
  6. <!-- <div class="squrt"></div> -->
  7. <el-page-header @back="onCancel"
  8. :content="teamName + '报名详情'">
  9. </el-page-header>
  10. <!-- {{ teamName }}报名详情 -->
  11. </h2>
  12. <p style="margin-bottom:15px; font-size:18px;
  13. font-weight:400">报名缴费截止时间:{{ applyExpireDate | formatTimer }}</p>
  14. <div class="btnList">
  15. <div class='newBand close'
  16. v-permission="'musicGroup/cancelMusicGroup'"
  17. @click="onClose">停止乐团</div>
  18. <div class='newBand'
  19. @click="payStart"
  20. v-permission="'musicGroup/openPay'"
  21. v-if="status=='APPLY'">开始缴费</div>
  22. <!-- v-if="status=='PAY'" -->
  23. <div class='newBand'
  24. v-permission="'musicGroup/found'"
  25. @click="onGoHome">确认开团</div>
  26. <div class='newBand'
  27. v-permission="'musicGroup/extensionPayment'"
  28. @click="extendPaymentStatus = true"
  29. v-if="status=='PAY'">延长缴费</div>
  30. <div class='newBand'
  31. @click="onCreateQRCode">报名链接</div>
  32. <div class='newBand'
  33. @click="onCreateQRCode2">缴费详情</div>
  34. <div class='newBand'
  35. v-if="rightList.length > 0"
  36. v-permission="'studentRegistration/queryStudentApplyDetailExport'"
  37. @click='onDownLoadExecl'>报表导出</div>
  38. </div>
  39. </div>
  40. <!-- stepImgs: {
  41. APPLY: require('@/assets/images/base/clock.png'),
  42. PAY: require('@/assets/images/base/pay.png')
  43. }, -->
  44. <p class='msg'
  45. :class="status=='PAY'? 'pay' : '' "> <img :src="status=='APPLY'?stepImgs.APPLY:stepImgs.PAY"
  46. alt="">
  47. {{ status=='APPLY'?'报名中':'缴费中' }}</p>
  48. </div>
  49. <div class="searchList">
  50. <el-form :inline="true"
  51. :model="searchFrom">
  52. <el-form-item label="专业">
  53. <el-select v-model="searchFrom.subject"
  54. filterable
  55. clearable>
  56. <el-option v-for="(item,index) in soundList"
  57. :key='index'
  58. :label="item.name"
  59. :value="item.id"></el-option>
  60. </el-select>
  61. </el-form-item>
  62. <el-form-item label="是否允许调剂">
  63. <el-select v-model="searchFrom.isAllowAdjust"
  64. filterable
  65. clearable>
  66. <el-option label="是"
  67. value="1"></el-option>
  68. <el-option label="否"
  69. value="0"></el-option>
  70. </el-select>
  71. </el-form-item>
  72. <el-form-item label="用户名或手机号">
  73. <el-input v-model="searchFrom.name"></el-input>
  74. </el-form-item>
  75. <!-- 专业actualSubjectId 调剂isAllowAdjust 手机号name -->
  76. <el-form-item>
  77. <div class='searchBtn'
  78. @click='search'>搜索</div>
  79. </el-form-item>
  80. </el-form>
  81. </div>
  82. <div class="sigup-core">
  83. <div class="left">
  84. <el-table :data='leftList'
  85. :header-cell-style="{background:'#EDEEF0',color:'#444'}">
  86. <el-table-column label="乐团声部"
  87. prop="subjectName"
  88. align='center'>
  89. </el-table-column>
  90. <el-table-column label="计划招生"
  91. prop="expectedStudentNum"
  92. align='center'>
  93. <template slot-scope="scope">
  94. <div>
  95. <p v-if="!isEdit">{{ scope.row.expectedStudentNum }}</p>
  96. <el-input v-if="isEdit"
  97. v-model="scope.row.expectedStudentNum"></el-input>
  98. </div>
  99. </template>
  100. </el-table-column>
  101. <el-table-column label="已报名"
  102. prop='applyStudentNum'
  103. align='center'>
  104. </el-table-column>
  105. <el-table-column label="已缴费"
  106. prop='payNum'
  107. align='center'>
  108. </el-table-column>
  109. </el-table>
  110. <div class="btnWrap"
  111. style="margin-right:20px; margin-top:20px;">
  112. <el-button v-if="!isEdit"
  113. v-permission="'musicGroup/updateExpectedStudentNum'"
  114. @click="isEdit = true">编辑</el-button>
  115. <el-button v-if="isEdit"
  116. v-permission="'musicGroup/updateExpectedStudentNum'"
  117. @click="saveIsEdit">保存</el-button>
  118. </div>
  119. </div>
  120. <div class="right">
  121. <el-table :data='rightList'
  122. ref="multipleTable"
  123. :header-cell-style="{background:'#EDEEF0',color:'#444'}"
  124. @selection-change="handleSelectionChange">
  125. <el-table-column type="selection"
  126. width="55">
  127. </el-table-column>
  128. <el-table-column label="学员姓名"
  129. prop="studentName"
  130. align='center'>
  131. </el-table-column>
  132. <el-table-column label="家长姓名"
  133. prop="parentsName"
  134. align='center'>
  135. </el-table-column>
  136. <el-table-column label="年级班级"
  137. align='center'>
  138. <template slot-scope="scope">
  139. <div>
  140. {{scope.row.currentGrade+scope.row.currentClass}}
  141. </div>
  142. </template>
  143. </el-table-column>
  144. <el-table-column label="性别"
  145. prop="gender"
  146. align='center'>
  147. <template slot-scope="scope">
  148. <div>
  149. {{scope.row.gender | sex}}
  150. </div>
  151. </template>
  152. </el-table-column>
  153. <el-table-column label="服从调剂"
  154. prop="isAllowAdjust"
  155. align='center'>
  156. <template slot-scope="scope">
  157. <div>
  158. {{ scope.row.isAllowAdjust | isAllowAdjust}}
  159. </div>
  160. </template>
  161. </el-table-column>
  162. <el-table-column label="报名专业"
  163. prop="subjectName"
  164. align='center'>
  165. </el-table-column>
  166. <el-table-column label="调剂专业"
  167. prop="actualSubjectName"
  168. align='center'>
  169. </el-table-column>
  170. <el-table-column label="联系电话"
  171. prop="parentsPhone"
  172. align='center'>
  173. </el-table-column>
  174. <!-- v-if='status == "PAY"' -->
  175. <el-table-column label="学员状态"
  176. fixed='right'
  177. prop="paymentStatus"
  178. align='center'>
  179. <template slot-scope="scope">
  180. <div>
  181. {{ scope.row.paymentStatus | paymentStatus }}
  182. </div>
  183. </template>
  184. </el-table-column>
  185. <el-table-column label="操作"
  186. fixed='right'
  187. align='center'>
  188. <template slot-scope="scope">
  189. <div>
  190. <el-button type='text'
  191. v-permission="'studentRegistration/batchUpdateSubject'"
  192. v-if="scope.row.paymentStatus != 2"
  193. @click='resetSubject(scope.row)'>修改专业</el-button>
  194. <!-- APPLY status == "APPLY" || s-->
  195. <el-popover v-if='scope.row.remark'
  196. placement="top-start"
  197. title="备注"
  198. width="200"
  199. trigger="hover"
  200. :content="scope.row.remark">
  201. <el-button type="text"
  202. slot="reference">备注</el-button>
  203. </el-popover>
  204. <!-- PAY -->
  205. <!-- && status == "PAY"-->
  206. <el-button type='text'
  207. v-permission="'studentRegistration/queryFeeDetail'"
  208. v-if='scope.row.paymentStatus==2'
  209. @click='lookdetail(scope.row)'>查看</el-button>
  210. </div>
  211. </template>
  212. </el-table-column>
  213. </el-table>
  214. <div style="margin-top: 10px; margin-bottom: 10px;"
  215. v-if="status=='APPLY'">
  216. <el-button @click="onSelectAll">全选/取消</el-button>
  217. <el-button style="background-color: #14928a;border: 1px solid #14928a;"
  218. @click="onPartPayment"
  219. v-permission="'studentRegistration/openPayment'"
  220. type="primary">提前缴费</el-button>
  221. <!-- <div class='newBand' v-if="status=='APPLY'">允许缴费</div> -->
  222. </div>
  223. <pagination :total="rules.total"
  224. :page.sync="rules.page"
  225. :limit.sync="rules.limit"
  226. :page-sizes="rules.page_size"
  227. @pagination="getList" />
  228. </div>
  229. </div>
  230. <el-dialog title="修改专业"
  231. :visible.sync="subjectVisible"
  232. width="400px">
  233. <el-form :model="maskForm">
  234. <el-form-item label="选择专业">
  235. <el-select v-model="maskForm.subject"
  236. filterable
  237. clearable>
  238. <el-option v-for="(item,index) in soundList"
  239. :key='index'
  240. :label="item.name"
  241. :value="item.id"></el-option>
  242. </el-select>
  243. </el-form-item>
  244. </el-form>
  245. <div slot="footer"
  246. class="dialog-footer">
  247. <el-button @click="subjectVisible = false">取 消</el-button>
  248. <el-button type="primary"
  249. @click="okReset">确 定</el-button>
  250. </div>
  251. </el-dialog>
  252. <el-dialog title="延长缴费"
  253. :visible.sync="extendPaymentStatus"
  254. width="400px">
  255. <el-form :model="extendForm"
  256. ref="extendForm"
  257. :rules="extendRule">
  258. <el-form-item label="延长时间"
  259. prop="expireDate">
  260. <el-date-picker v-model="extendForm.expireDate"
  261. value-format="yyyy-MM-dd"
  262. type="date"
  263. placeholder="选择日期">
  264. </el-date-picker>
  265. </el-form-item>
  266. </el-form>
  267. <div slot="footer"
  268. class="dialog-footer">
  269. <el-button @click="extendPaymentStatus = false">取 消</el-button>
  270. <el-button type="primary"
  271. @click="onExtendPayment('extendForm')">确 定</el-button>
  272. </div>
  273. </el-dialog>
  274. <el-dialog title="订单详情"
  275. :visible.sync="orderVisible"
  276. width="600px">
  277. <el-form :model="orderForm"
  278. :inline="true">
  279. <!-- name: '',
  280. totalAmount: '',
  281. subject: '',
  282. subjectFee: '',
  283. axe: '',
  284. axePrice: '',
  285. others: '',
  286. othersPrice: '' -->
  287. <el-form-item label="学员姓名">
  288. <el-input v-model="orderForm.name"
  289. disabled=""></el-input>
  290. </el-form-item>
  291. <el-form-item label="实缴金额">
  292. <el-input v-model="orderForm.totalAmount"
  293. disabled=""></el-input>
  294. </el-form-item>
  295. <el-form-item label="实际专业">
  296. <el-input v-model="orderForm.subject"
  297. disabled=""></el-input>
  298. </el-form-item>
  299. <el-form-item label="课程费用">
  300. <el-input v-model="orderForm.subjectFee"
  301. disabled=""></el-input>
  302. </el-form-item>
  303. <el-form-item label="选择乐器">
  304. <el-input v-model="orderForm.axe"
  305. disabled=""></el-input>
  306. </el-form-item>
  307. <el-form-item label="乐器价格">
  308. <el-input v-model="orderForm.axePrice"
  309. disabled=""></el-input>
  310. </el-form-item>
  311. <el-form-item label="教辅组合">
  312. <el-input v-model="orderForm.others"
  313. disabled=""></el-input>
  314. </el-form-item>
  315. <el-form-item label="组合价格">
  316. <el-input v-model="orderForm.othersPrice"
  317. disabled=""></el-input>
  318. </el-form-item>
  319. </el-form>
  320. <div slot="footer"
  321. class="dialog-footer">
  322. <!-- <el-button>取 消</el-button> -->
  323. <el-button type="primary"
  324. @click="orderVisible = false">确 定</el-button>
  325. </div>
  326. </el-dialog>
  327. <el-dialog title="开始缴费"
  328. :visible.sync="paymentStatus"
  329. width="400px">
  330. <el-form ref="paymentForm"
  331. :model="paymentForm"
  332. label-position="top"
  333. :rules="paymentRules">
  334. <el-form-item label="请设置缴费截止日期"
  335. prop="paymentExpireDate">
  336. <el-date-picker v-model="paymentForm.paymentExpireDate"
  337. type="date"
  338. value-format="yyyy-MM-dd"
  339. style="width: 100%"
  340. placeholder="选择日期">
  341. </el-date-picker>
  342. </el-form-item>
  343. </el-form>
  344. <div slot="footer"
  345. class="dialog-footer">
  346. <el-button @click="paymentStatus = false">取 消</el-button>
  347. <el-button type="primary"
  348. @click="onStartPayment('paymentForm')">确 定</el-button>
  349. </div>
  350. </el-dialog>
  351. <el-dialog title="报名二维码"
  352. :visible.sync="qrcodeStatus"
  353. width="300px">
  354. <div class="left-code">
  355. <h2>学员报名连接</h2>
  356. <div id="qrcode"
  357. class="qrcode code"
  358. ref="qrCodeUrl"></div>
  359. <p class="code-url"
  360. v-if="codeUrl">{{ codeUrl }}</p>
  361. </div>
  362. </el-dialog>
  363. <el-dialog title="缴费详情二维码"
  364. :visible.sync="qrcodeStatus2"
  365. width="300px">
  366. <div class="right-code">
  367. <h2>报名缴费详情</h2>
  368. <div id="qrcode2"
  369. class="qrcode code"
  370. ref="qrCodeUrl"></div>
  371. <p class="code-url"
  372. v-if="codeUrl2">{{ codeUrl2 }}</p>
  373. </div>
  374. </el-dialog>
  375. </div>
  376. </template>
  377. <script>
  378. import pagination from '@/components/Pagination/index'
  379. import { getintoClass, getStudentList, findSound, musicGroupOpenPay, openPayment, musicGroupFound, extensionPayment, resetPlanNum, cancelMusicGroup, getTeamBaseInfo, studentApplyDetailExport } from '@/api/buildTeam'
  380. import { resetStudentSubject, getStudentFeeDetail } from '@/api/studentManager'
  381. import { vaildStudentUrl, vaildTeacherUrl } from '@/utils/validate'
  382. import QRCode from 'qrcodejs2'
  383. import axios from 'axios'
  384. import { getToken } from '@/utils/auth'
  385. import qs from 'qs'
  386. export default {
  387. name: 'signupList',
  388. components: {
  389. pagination
  390. },
  391. data () {
  392. return {
  393. multipleSelection: [], //
  394. isEdit: false,
  395. subjectVisible: false,
  396. orderVisible: false,
  397. leftList: [],
  398. rightList: [],
  399. searchFrom: {
  400. name: '',
  401. subject: '', // 专业
  402. isAllowAdjust: '' // 是否允许调剂
  403. },
  404. stepImgs: {
  405. APPLY: require('@/assets/images/base/clock.png'),
  406. PAY: require('@/assets/images/base/pay.png')
  407. },
  408. status: '',
  409. id: '',
  410. rules: {
  411. // 分页规则
  412. limit: 10, // 限制显示条数
  413. page: 1, // 当前页
  414. total: 0, // 总条数
  415. page_size: [10, 20, 30, 40] // 选择限制显示条数
  416. },
  417. teamName: '',
  418. maskForm: {
  419. subject: ''
  420. },
  421. activeId: '',
  422. soundList: [],
  423. orderForm: {
  424. name: '',
  425. totalAmount: '',
  426. subject: '',
  427. subjectFee: '',
  428. axe: '',
  429. axePrice: '',
  430. others: '',
  431. othersPrice: ''
  432. },
  433. paymentStatus: false,
  434. paymentForm: {
  435. paymentExpireDate: null,
  436. },
  437. paymentRules: {
  438. paymentExpireDate: [{ required: true, message: '请设置缴费截止日期', trigger: 'blur' }]
  439. },
  440. paymentNum: 0, // 缴费了多少人
  441. qrcodeStatus: false, // 生成二维码
  442. qrcodes: true,
  443. qrcode: null,
  444. codeUrl: null,
  445. qrcodeStatus2: false, // 生成二维码
  446. qrcodes2: true,
  447. qrcode2: null,
  448. codeUrl2: null,
  449. extendPaymentStatus: false,
  450. extendForm: {
  451. expireDate: null,
  452. },
  453. extendRule: {
  454. expireDate: [{ required: true, message: '请选择延长时间', trigger: 'change' }]
  455. },
  456. Fsearch: null,
  457. Frules: null,
  458. applyExpireDate: ''
  459. }
  460. },
  461. created () {
  462. // 通过乐团状态判断显示隐藏的东西
  463. this.init()
  464. },
  465. activated () {
  466. this.init()
  467. },
  468. mounted () {
  469. },
  470. methods: {
  471. init () {
  472. this.status = this.$route.query.status;
  473. // 通过乐团id 获取乐团招生状态
  474. this.id = this.$route.query.id;
  475. this.teamName = this.$route.query.name
  476. // 判断是否带缓存参数
  477. if (this.$route.query.search) {
  478. this.Fsearch = this.$route.query.search;
  479. }
  480. if (this.$route.query.rules) {
  481. this.Frules = this.$route.query.rules
  482. }
  483. getTeamBaseInfo({ musicGroupId: this.id }).then(res => {
  484. if (res.code == 200) {
  485. this.applyExpireDate = res.data.musicGroup.applyExpireDate;
  486. }
  487. })
  488. // 根据乐团id获取学团情况
  489. getintoClass({ musicGroupId: this.id }).then(res => {
  490. if (res.code == 200) {
  491. this.leftList = res.data;
  492. }
  493. })
  494. // 根据乐团id获乐团声部
  495. findSound({ musicGroupId: this.id }).then(res => {
  496. if (res.code == 200) {
  497. this.soundList = res.data;
  498. }
  499. })
  500. // 通过乐团id获取乐团学生列表
  501. this.getList()
  502. },
  503. search () {
  504. this.rules.page = 1;
  505. this.getList();
  506. },
  507. onCancel () {
  508. this.$router.push({ path: '/business/teamDetail', query: { search: this.Fsearch, rules: this.Frules } })
  509. },
  510. payStart () {
  511. this.paymentStatus = true;
  512. },
  513. getList () {
  514. let obj = {
  515. musicGroupId: this.id,
  516. actualSubjectId: this.searchFrom.subject || null,
  517. isAllowAdjust: this.searchFrom.isAllowAdjust || null,
  518. name: this.searchFrom.name || null,
  519. page: this.rules.page,
  520. rows: this.rules.limit
  521. }
  522. getStudentList(obj).then(res => {
  523. if (res.code == 200) {
  524. res.data.rows.forEach(item => {
  525. // '未开启缴费', '开启缴费', '已缴费'
  526. if (item.paymentStatus == 2) {
  527. this.paymentNum += 1
  528. }
  529. })
  530. this.rightList = res.data.rows
  531. this.rules.total = res.data.total
  532. }
  533. })
  534. },
  535. onStartPayment (formName) { // 开启缴费
  536. this.$refs[formName].validate((valid) => {
  537. if (valid) {
  538. musicGroupOpenPay({
  539. musicGroupId: this.id,
  540. expireDate: this.paymentForm.paymentExpireDate
  541. }).then(res => {
  542. if (res.code == 200) {
  543. this.$message.success('开启成功')
  544. this.paymentStatus = false
  545. this.$router.push({
  546. path: '/business/signupList',
  547. query: {
  548. status: 'PAY',
  549. id: this.$route.query.id,
  550. name: this.$route.query.name
  551. }
  552. })
  553. this.status = 'PAY'
  554. this.getList();
  555. }
  556. })
  557. } else {
  558. return false;
  559. }
  560. })
  561. // this.id
  562. },
  563. onSelectAll () { // 选中全部
  564. this.$refs.multipleTable.toggleAllSelection()
  565. },
  566. onPartPayment () { // 部分缴费
  567. let selection = this.multipleSelection
  568. if (selection.length <= 0) {
  569. this.$message.success('您还没有选择学生')
  570. return false
  571. }
  572. let ids = []
  573. selection.forEach(item => {
  574. ids.push(item.id)
  575. })
  576. this.$confirm(`是否确认提前缴费?`, '提示', {
  577. confirmButtonText: '确定',
  578. cancelButtonText: '取消',
  579. type: 'warning'
  580. }).then(() => {
  581. openPayment({
  582. ids: ids.join(',')
  583. }).then(res => {
  584. if (res.code == 200) {
  585. this.$message.success('开启成功')
  586. this.getList()
  587. } else {
  588. this.$message.error(res.msg)
  589. }
  590. })
  591. }).catch(() => { })
  592. },
  593. onCreateQRCode () { // 生成报名二维码
  594. this.qrcodeStatus = true
  595. let id = this.$route.query.id
  596. let teamName = this.$route.query.name
  597. if (this.qrcodes) {
  598. this.qrcodes = false
  599. setTimeout(() => {
  600. this.qrcode = new QRCode('qrcode', {
  601. width: 200,
  602. height: 200,
  603. colorDark: '#000000',
  604. colorLight: '#ffffff',
  605. correctLevel: QRCode.CorrectLevel.H
  606. })
  607. this.qrcode.makeCode(vaildStudentUrl() + '/#/login?musicGroupId=' + id)
  608. this.codeUrl = vaildStudentUrl() + '/#/login?musicGroupId=' + id
  609. }, 500)
  610. }
  611. },
  612. onCreateQRCode2 () { // 生成报名二维码
  613. this.qrcodeStatus2 = true
  614. let id = this.$route.query.id
  615. let teamName = this.$route.query.name
  616. if (this.qrcodes2) {
  617. this.qrcodes2 = false
  618. setTimeout(() => {
  619. this.qrcode2 = new QRCode('qrcode2', {
  620. width: 200,
  621. height: 200,
  622. colorDark: '#000000',
  623. colorLight: '#ffffff',
  624. correctLevel: QRCode.CorrectLevel.H
  625. })
  626. this.qrcode2.makeCode(vaildTeacherUrl() + '/#/order?musicGroupId=' + id + '&musicGroupName=' + teamName)
  627. this.codeUrl2 = vaildTeacherUrl() + '/#/order?musicGroupId=' + id + '&musicGroupName=' + teamName
  628. }, 500)
  629. }
  630. },
  631. onDownLoadExecl () { // 报表导出
  632. let url = '/api-web/studentRegistration/queryStudentApplyDetailExport'
  633. let data = {
  634. musicGroupId: this.$route.query.id,
  635. page: 1,
  636. rows: 9999
  637. }
  638. const options = {
  639. method: 'POST',
  640. headers: {
  641. 'Authorization': getToken()
  642. },
  643. data: qs.stringify(data),
  644. url,
  645. responseType: 'blob'
  646. }
  647. axios(options).then(res => {
  648. let blob = new Blob([res.data], {
  649. // type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
  650. type: 'application/vnd.ms-excel;charset=utf-8'
  651. //word文档为application/msword,pdf文档为application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
  652. })
  653. let objectUrl = URL.createObjectURL(blob)
  654. let link = document.createElement("a")
  655. let nowTime = new Date()
  656. let ymd = nowTime.getFullYear() + '' + (nowTime.getMonth() + 1) + '' + nowTime.getDate() + '' + nowTime.getHours() + '' + nowTime.getMinutes()
  657. let fname = this.$route.query.id + '-' + ymd //下载文件的名字
  658. link.href = objectUrl
  659. link.setAttribute("download", fname)
  660. document.body.appendChild(link)
  661. link.click()
  662. })
  663. },
  664. onGoHome () { // 确认开团
  665. // 判断是否有学生缴费
  666. if (this.paymentNum <= 0) {
  667. this.$message.error('当前缴费人数为0,无法开团')
  668. return
  669. }
  670. this.$confirm(`是否确认开团?`, '提示', {
  671. confirmButtonText: '确定',
  672. cancelButtonText: '取消',
  673. type: 'warning'
  674. }).then(() => {
  675. musicGroupFound({
  676. musicGroupId: this.$route.query.id
  677. }).then(res => {
  678. if (res.code == 200) {
  679. this.$message.success('开启成功')
  680. this.$router.push({
  681. path: '/business/teamSeting',
  682. query: {
  683. status: 'PREPARE',
  684. id: this.$route.query.id,
  685. name: this.$route.query.name
  686. }
  687. })
  688. }
  689. })
  690. }).catch(() => {
  691. })
  692. },
  693. onClose () { // 停止乐团
  694. this.$confirm('您确定停止乐团吗?', '提示', {
  695. confirmButtonText: '确定',
  696. cancelButtonText: '取消',
  697. type: 'warning'
  698. }).then(() => {
  699. cancelMusicGroup({
  700. musicGroupId: this.$route.query.id
  701. }).then(res => {
  702. if (res.code == 200) {
  703. this.$message.success('停止成功')
  704. this.$router.push({
  705. path: '/business/teamDetail',
  706. query: { search: this.Fsearch, rules: this.Frules }
  707. })
  708. }
  709. })
  710. }).catch(() => {
  711. })
  712. },
  713. handleSelectionChange (val) {
  714. this.multipleSelection = val;
  715. },
  716. // 修改专业
  717. resetSubject (row) {
  718. this.activeId = row.studentId
  719. this.subjectVisible = true;
  720. // resetStudentSubject().then(res=>{]})
  721. },
  722. // 确认修改
  723. okReset () {
  724. if (!this.maskForm.subject) {
  725. this.$message.error('请选择调剂专业');
  726. return
  727. }
  728. resetStudentSubject({ musicGroupId: this.id, userId: this.activeId, subId: this.maskForm.subject }).then(res => {
  729. if (res.code == 200) {
  730. this.$message.success('修改成功');
  731. this.subjectVisible = false;
  732. this.maskForm.subject = '';
  733. getintoClass({ musicGroupId: this.id }).then(res => {
  734. if (res.code == 200) {
  735. this.leftList = res.data;
  736. }
  737. })
  738. this.getList();
  739. }
  740. })
  741. },
  742. onExtendPayment (formName) {
  743. this.$refs[formName].validate(valid => {
  744. if (valid) {
  745. extensionPayment({
  746. musicGroupId: this.id,
  747. expireDate: this.extendForm.expireDate
  748. }).then(res => {
  749. if (res.code == 200) {
  750. this.$message.success('延长缴费成功')
  751. this.extendPaymentStatus = false
  752. } else {
  753. this.$message.error(res.msg);
  754. }
  755. })
  756. }
  757. })
  758. },
  759. lookdetail (row) {
  760. this.orderVisible = true;
  761. this.activeId = row.studentId;
  762. this.orderForm.name = row.studentName;
  763. this.orderForm.subject = row.subjectName;
  764. getStudentFeeDetail({ musicGroupId: this.id, studentId: row.studentId }).then(res => {
  765. if (res.code == 200) {
  766. if (res.data) {
  767. this.orderForm.totalAmount = res.data.totalAmount;
  768. // this.orderForm.subjectFee = res.data.courseFee;
  769. let goodStr = '';
  770. let goodPrice = 0;
  771. let otherStr = '';
  772. let othersPrice = 0;
  773. for (let i in res.data.goods) {
  774. if (res.data.goods[i].goodsType == 'INSTRUMENT') {
  775. goodStr += res.data.goods[i].goodsName + ',';
  776. goodPrice += parseFloat(res.data.goods[i].musicalFee);
  777. // this.orderForm.axe = res.data.goods[i].goodsName;
  778. // this.orderForm.axePrice = res.data.goods[i].musicalFee;
  779. } else if (res.data.goods[i].goodsType == 'ACCESSORIES') {
  780. otherStr += res.data.goods[i].goodsName + ',';
  781. othersPrice += parseFloat(res.data.goods[i].musicalFee);
  782. // this.orderForm.others = res.data.goods[i].goodsName;
  783. // this.orderForm.othersPrice = res.data.goods[i].musicalFee;
  784. } else if (res.data.goods[i].goodsType == 'COURSE') {
  785. this.orderForm.subjectFee = res.data.goods[i].musicalFee
  786. }
  787. }
  788. this.orderForm.others = otherStr.substring(0, otherStr.length - 1);
  789. this.orderForm.othersPrice = othersPrice;
  790. this.orderForm.axe = goodStr.substring(0, goodStr.length - 1);
  791. this.orderForm.axePrice = goodPrice;
  792. }
  793. }
  794. })
  795. },
  796. saveIsEdit () {
  797. // 提交数据
  798. this.isEdit = false;
  799. resetPlanNum(this.leftList).then(res => {
  800. })
  801. }
  802. },
  803. watch: {
  804. orderVisible (val) {
  805. if (!val) {
  806. this.orderForm = {
  807. name: '',
  808. totalAmount: '',
  809. subject: '',
  810. subjectFee: '',
  811. axe: '',
  812. axePrice: '',
  813. others: '',
  814. othersPrice: ''
  815. }
  816. }
  817. }
  818. }
  819. }
  820. </script>
  821. <style lang="scss">
  822. .sigup-container {
  823. margin-left: 12px;
  824. .topWrap {
  825. padding: 18px 58px;
  826. // height: 136px;
  827. background-color: #fff;
  828. display: flex;
  829. flex-direction: row;
  830. justify-content: space-between;
  831. .msg.pay {
  832. color: #f85043;
  833. }
  834. .msg {
  835. text-align: right;
  836. color: #f97215;
  837. font-size: 32px;
  838. font-weight: bold;
  839. padding-top: 30px;
  840. box-sizing: border-box;
  841. img {
  842. width: 36px;
  843. height: 36px;
  844. position: relative;
  845. top: 5px;
  846. margin-right: 8px;
  847. }
  848. }
  849. h2 {
  850. height: 48px;
  851. line-height: 48px;
  852. position: relative;
  853. // padding-left: 30px;
  854. font-size: 32px;
  855. font-weight: 600;
  856. margin-bottom: 10px;
  857. display: flex;
  858. flex-direction: row;
  859. justify-content: flex-start;
  860. align-items: center;
  861. .term {
  862. height: 32px;
  863. line-height: 32px;
  864. border-radius: 24px;
  865. width: 100px;
  866. color: #14928a;
  867. border: 1px solid rgba(20, 146, 138, 1);
  868. font-size: 14px;
  869. text-align: center;
  870. margin-right: 12px;
  871. &:nth-child(1) {
  872. margin-left: 47px;
  873. }
  874. }
  875. .term.active {
  876. color: #fff;
  877. background-color: #14928a;
  878. }
  879. .squrt {
  880. position: absolute;
  881. left: -25px;
  882. top: 8px;
  883. height: 34px;
  884. width: 8px;
  885. background-color: #14928a;
  886. }
  887. }
  888. .btnList {
  889. display: flex;
  890. flex-direction: row;
  891. justify-content: flex-start;
  892. align-items: center;
  893. div {
  894. margin-right: 15px;
  895. }
  896. }
  897. .newBand.close {
  898. background-color: #777;
  899. border: 1px solid #777;
  900. }
  901. }
  902. .searchList {
  903. background-color: #fff;
  904. padding: 0 58px;
  905. }
  906. .sigup-core {
  907. margin-top: 12px;
  908. display: flex;
  909. flex-direction: row;
  910. justify-content: flex-start;
  911. .left {
  912. width: 340px;
  913. background-color: #fff;
  914. height: 80vh;
  915. overflow: auto;
  916. }
  917. .right {
  918. width: calc(100% - 340px);
  919. margin-left: 12px;
  920. flex-grow: 1;
  921. }
  922. }
  923. }
  924. .el-dialog__body {
  925. overflow: hidden;
  926. }
  927. .left-code,
  928. .right-code {
  929. // width: 50%;
  930. // float: left;
  931. h2 {
  932. font-size: 18px;
  933. text-align: center;
  934. padding-bottom: 8px;
  935. }
  936. .qrcode {
  937. img {
  938. width: 200px;
  939. height: 200px;
  940. margin: 0 auto;
  941. }
  942. }
  943. .code-url {
  944. font-size: 18px;
  945. text-align: center;
  946. padding: 15px 15px 0 15px;
  947. }
  948. }
  949. </style>