studentList.vue 42 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271
  1. <template>
  2. <div class='stu-container'>
  3. <!-- 头部展示 -->
  4. <div class="headWrap">
  5. <div class="left">
  6. <div class="headItem">
  7. <p>在读人数:<span>{{studentListInfo.studying}}</span></p>
  8. </div>
  9. <div class="headItem">
  10. <p>退团人数:<span>{{studentListInfo.quit}}</span></p>
  11. </div>
  12. <div class="headItem">
  13. <p>新增人数:<span>{{studentListInfo.add}}</span></p>
  14. </div>
  15. </div>
  16. <div class="right">
  17. <div class="newStudent"
  18. style="margin-bottom:10px;"
  19. @click="addStudentVisible = true">新增学员</div>
  20. <!-- <div class="newStudent"
  21. style="margin-bottom:10px;"
  22. @click="onCreateQRCode">报名连接</div> -->
  23. <div class="newStudent"
  24. @click='gotoSignin'>点名总览</div>
  25. </div>
  26. </div>
  27. <!-- 搜索类型 -->
  28. <el-form :inline="true"
  29. class="searchForm"
  30. v-model="searchForm">
  31. <el-form-item>
  32. <el-input v-model="searchForm.search"
  33. placeholder="学生姓名或电话"
  34. @keyup.enter.native='search'></el-input>
  35. </el-form-item>
  36. <el-form-item>
  37. <el-select v-model="searchForm.studentStatus"
  38. clearable
  39. filterable
  40. placeholder="学员状态">
  41. <el-option label="在读"
  42. value="NORMAL"></el-option>
  43. <el-option label="请假"
  44. value="LEAVE"></el-option>
  45. <el-option label="退团"
  46. value="QUIT"></el-option>
  47. </el-select>
  48. </el-form-item>
  49. <el-form-item>
  50. <el-select v-model="searchForm.major"
  51. clearable
  52. filterable
  53. placeholder="所选专业">
  54. <el-option v-for='(item,index) in soundList'
  55. :key='index'
  56. :value="item.id"
  57. :label="item.name"></el-option>
  58. </el-select>
  59. </el-form-item>
  60. <el-form-item>
  61. <el-select v-model="searchForm.isPay"
  62. clearable
  63. filterable
  64. placeholder="报名缴费">
  65. <el-option label="完成缴费"
  66. value="PAID_COMPLETED"></el-option>
  67. <el-option label="未缴费"
  68. value="NON_PAYMENT"></el-option>
  69. <el-option label="缴费中"
  70. value="PROCESSING"></el-option>
  71. </el-select>
  72. </el-form-item>
  73. <el-form-item>
  74. <el-select v-model="searchForm.isActive"
  75. clearable
  76. filterable
  77. placeholder="是否激活">
  78. <el-option label="是"
  79. value="1"></el-option>
  80. <el-option label="否"
  81. value="0"></el-option>
  82. </el-select>
  83. </el-form-item>
  84. <!-- <el-form-item>
  85. <el-select v-model="searchForm.school"
  86. placeholder="所在学校">
  87. <el-option label="item.text"
  88. value="1"></el-option>
  89. </el-select>
  90. </el-form-item> -->
  91. <el-form-item>
  92. <div class='searchBtn'
  93. @click='search'>搜索</div>
  94. </el-form-item>
  95. <el-form-item>
  96. <div class='searchBtn export'
  97. v-permission="'export/musicGroupStudent'"
  98. @click='onMusicGroupExport'>导出</div>
  99. </el-form-item>
  100. </el-form>
  101. <!-- 列表 -->
  102. <div class="tableWrap">
  103. <el-table :data='tableList'
  104. :header-cell-style="{background:'#EDEEF0',color:'#444'}">
  105. <el-table-column label="学员编号"
  106. width="120px;"
  107. prop="userId">
  108. </el-table-column>
  109. <el-table-column label="学员姓名"
  110. width="120px;"
  111. prop="realName">
  112. </el-table-column>
  113. <el-table-column align='center'
  114. prop="gender"
  115. width="50px;"
  116. label="性别">
  117. <template slot-scope="scope">
  118. <div>
  119. {{scope.row.gender| sex }}
  120. </div>
  121. </template>
  122. </el-table-column>
  123. <el-table-column align='center'
  124. prop="phone"
  125. label="联系电话">
  126. </el-table-column>
  127. <!-- <el-table-column align='center'
  128. prop=""
  129. label="所在学校">
  130. </el-table-column> -->
  131. <el-table-column align='center'
  132. label="年级班级">
  133. <template slot-scope="scope">
  134. <div>
  135. {{scope.row.currentGrade+scope.row.currentClass}}
  136. </div>
  137. </template>
  138. </el-table-column>
  139. <el-table-column align='center'
  140. label="专业"
  141. prop="subjectName">
  142. </el-table-column>
  143. <!-- <el-table-column align='center'
  144. label="乐团班级">
  145. </el-table-column>
  146. <el-table-column align='center'
  147. label="合奏班">
  148. </el-table-column> -->
  149. <el-table-column align='center'
  150. prop="studentStatus"
  151. label="学员状态">
  152. <template slot-scope="scope">
  153. <div>
  154. {{ scope.row.studentStatus | musicGroupStudentType}}
  155. </div>
  156. </template>
  157. </el-table-column>
  158. <el-table-column align='center'
  159. label="新增学员">
  160. <template slot-scope="scope">
  161. <div>
  162. {{ scope.row.isNewStudent | yesOrNo}}
  163. </div>
  164. </template>
  165. </el-table-column>
  166. <el-table-column align='center'
  167. label="批量修改缴费">
  168. <template slot-scope="scope">
  169. <div>
  170. {{ scope.row.isLock?'已锁定':'可修改'}}
  171. </div>
  172. </template>
  173. </el-table-column>
  174. <el-table-column align="center"
  175. label="下次缴费日期"
  176. prop="nextPaymentDate">
  177. <template slot-scope="scope">
  178. {{ scope.row.nextPaymentDate | formatTimer }}
  179. </template>
  180. </el-table-column>
  181. <el-table-column align="center"
  182. label="缴费金额"
  183. prop="courseFee">
  184. </el-table-column>
  185. <el-table-column align='center'
  186. label="报名缴费">
  187. <template slot-scope="scope">
  188. <div>
  189. {{ scope.row.paymentStatus | studentPays}}
  190. </div>
  191. </template>
  192. </el-table-column>
  193. <el-table-column align='center'
  194. label="是否激活">
  195. <template slot-scope="scope">
  196. <div>
  197. {{ scope.row.isActive?'是':'否'}}
  198. </div>
  199. </template>
  200. </el-table-column>
  201. <el-table-column align='center'
  202. fixed="right"
  203. width="250px;"
  204. label="操作">
  205. <template slot-scope="scope">
  206. <div v-if="scope.row.studentStatus != 'QUIT'">
  207. <!-- <el-popover placement="top"
  208. v-model="scope.row.typeVisible">
  209. <el-input v-model="remark"
  210. placeholder="请输入退团原因"></el-input>
  211. <el-button type="text"
  212. slot='reference'
  213. class='chiose'>
  214. 退团
  215. </el-button>
  216. <div style="text-align: right; margin-top: 20px">
  217. <el-button size="mini"
  218. type="text"
  219. @click="scope.row.typeVisible = false">取消</el-button>
  220. <el-button type="primary"
  221. size="mini"
  222. @click="chioseType(scope.row)">确定</el-button>
  223. </div>
  224. </el-popover> -->
  225. <el-button type="text"
  226. @click="lookClass(scope.row)">查看班级</el-button>
  227. <el-button type="text"
  228. v-if="!scope.row.isLock"
  229. @click="lockStudent(scope.row)">锁定</el-button>
  230. <el-button v-else
  231. type="text"
  232. @click="lockStudent(scope.row)">解锁</el-button>
  233. <el-button type="text"
  234. @click="resetPay(scope.row)">修改缴费</el-button>
  235. <el-button type='text'
  236. @click="quieTeamMask(scope.row)">退团</el-button>
  237. </div>
  238. </template>
  239. </el-table-column>
  240. </el-table>
  241. <pagination :total="rules.total"
  242. :page.sync="rules.page"
  243. :limit.sync="rules.limit"
  244. :page-sizes="rules.page_size"
  245. @pagination="getList" />
  246. </div>
  247. <el-dialog title="新增学员"
  248. width="640px"
  249. class="studentInfo"
  250. :visible.sync="addStudentVisible">
  251. <el-form :model="maskForm"
  252. label-position="right"
  253. label-width="100px"
  254. ref='maskForm'
  255. :rules="maskRules"
  256. :inline="true">
  257. <el-divider>基本信息</el-divider>
  258. <el-form-item label="联系电话"
  259. :rules="[{ required: true, message: '请输入手机号' }, { pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号', trigger: 'blur' }]"
  260. prop="phone">
  261. <el-input v-model="maskForm.phone"
  262. placeholder="联系电话"
  263. @blur="checkPhone(maskForm.phone)"></el-input>
  264. </el-form-item>
  265. <el-form-item label="学员姓名"
  266. prop="studentName">
  267. <el-input v-model="maskForm.studentName"
  268. placeholder="学员姓名"></el-input>
  269. </el-form-item>
  270. <el-form-item label="学员性别"
  271. prop="sex">
  272. <el-select v-model="maskForm.sex"
  273. clearable>
  274. <el-option label="男"
  275. :value="1"></el-option>
  276. <el-option label="女"
  277. :value="0"></el-option>
  278. </el-select>
  279. </el-form-item>
  280. <el-form-item label="家长姓名"
  281. prop="parentName">
  282. <el-input v-model="maskForm.parentName"
  283. placeholder="家长姓名"></el-input>
  284. </el-form-item>
  285. <el-form-item label="年级"
  286. prop="startClass">
  287. <el-select placeholder="起始年级"
  288. filterable
  289. clearable
  290. v-model="maskForm.startClass">
  291. <el-option value="一年级"
  292. label="一年级"></el-option>
  293. <el-option value="二年级"
  294. label="二年级"></el-option>
  295. <el-option value="三年级"
  296. label="三年级"></el-option>
  297. <el-option value="四年级"
  298. label="四年级"></el-option>
  299. <el-option value="五年级"
  300. label="五年级"></el-option>
  301. <el-option value="六年级"
  302. label="六年级"></el-option>
  303. <el-option value="初一"
  304. label="初一"></el-option>
  305. <el-option value="初二"
  306. label="初二"></el-option>
  307. <el-option value="初三"
  308. label="初三"></el-option>
  309. <el-option value="高一"
  310. label="高一"></el-option>
  311. <el-option value="高二"
  312. label="高二"></el-option>
  313. <el-option value="高三"
  314. label="高三"></el-option>
  315. </el-select>
  316. </el-form-item>
  317. <el-form-item label="班级"
  318. prop="course">
  319. <el-input v-model="maskForm.course"
  320. placeholder="班级"></el-input>
  321. </el-form-item>
  322. <el-form-item label="学员声部"
  323. prop="sound">
  324. <el-select v-model="maskForm.sound"
  325. clearable
  326. filterable
  327. @change="onSoundChange">
  328. <el-option v-for='(item,index) in soundList'
  329. :key='index'
  330. :value="item.id"
  331. :label="item.name"></el-option>
  332. </el-select>
  333. </el-form-item>
  334. <!-- <el-form-item label="证件号"
  335. prop="id">
  336. <el-input v-model="maskForm.id"></el-input>
  337. </el-form-item> -->
  338. <el-form-item label="出生日期"
  339. style="margin-right: 0;"
  340. prop="timer">
  341. <el-col :span="24">
  342. <el-date-picker v-model="maskForm.timer"
  343. value-format="yyyy-MM-dd"
  344. type="date"
  345. placeholder="选择日期">
  346. </el-date-picker>
  347. </el-col>
  348. </el-form-item>
  349. <el-form-item label="声部费用"
  350. prop="courseFee">
  351. <el-input v-model="maskForm.courseFee"
  352. placeholder="请输入声部费用"></el-input>
  353. </el-form-item>
  354. <br>
  355. <el-form-item label="单技班">
  356. <el-select v-model="maskForm.signClass"
  357. filterable
  358. clearable>
  359. <el-option v-for="(item,index) in signList"
  360. :key="index"
  361. :value="item.id"
  362. :label="item.name"></el-option>
  363. </el-select>
  364. </el-form-item>
  365. <el-form-item label="合奏班">
  366. <el-select v-model="maskForm.mixClass"
  367. filterable
  368. clearable>
  369. <el-option v-for="(item,index) in mixList"
  370. :key="index"
  371. :value="item.id"
  372. :label="item.name"></el-option>
  373. </el-select>
  374. </el-form-item>
  375. <el-form-item label="基础技能班">
  376. <el-select v-model="maskForm.highClass"
  377. filterable
  378. clearable>
  379. <el-option v-for="(item,index) in highList"
  380. :key="index"
  381. :value="item.id"
  382. :label="item.name"></el-option>
  383. </el-select>
  384. </el-form-item>
  385. <el-form-item label="临时班">
  386. <el-select v-model="maskForm.snapClass"
  387. filterable
  388. clearable
  389. multiple>
  390. <el-option v-for="(item,index) in snapList"
  391. :key="index"
  392. :value="item.id"
  393. :label="item.name"></el-option>
  394. </el-select>
  395. </el-form-item>
  396. <el-divider>订单信息</el-divider>
  397. <el-form-item label="课程费用"
  398. prop="temporaryCourseFee">
  399. <el-input type='number'
  400. @mousewheel.native.prevent
  401. v-model="maskForm.temporaryCourseFee"
  402. placeholder="本次课程费用"></el-input>
  403. </el-form-item>
  404. <el-form-item label="乐器"
  405. class="instrList">
  406. <el-col :span="11"
  407. style="width: auto;">
  408. <el-form-item>
  409. <el-select placeholder="选择乐器"
  410. filterable
  411. clearable
  412. v-model="maskForm.musicGoodsIdList">
  413. <el-option v-for="(item, index) in INSTRUMENTLIST"
  414. :key="index"
  415. :value="item.value"
  416. :label="item.label"></el-option>
  417. </el-select>
  418. </el-form-item>
  419. </el-col>
  420. <el-col :span="1">&nbsp;</el-col>
  421. <el-col :span="11">
  422. <el-form-item>
  423. <el-input v-model="maskForm.musicPrice"
  424. placeholder="输入金额">
  425. <template slot="prepend">
  426. {{ maskForm.musicMode }}
  427. </template>
  428. </el-input>
  429. </el-form-item>
  430. </el-col>
  431. </el-form-item>
  432. <el-form-item label="辅件">
  433. <el-col :span="11"
  434. style="width: auto;">
  435. <el-form-item>
  436. <el-select filterable
  437. clearable
  438. multiple
  439. placeholder="选择辅件"
  440. v-model="maskForm.instrGoodsIdList">
  441. <el-option v-for="(item, index) in ACCESSORIESLIST"
  442. :key="index"
  443. :value="item.value"
  444. :label="item.label"></el-option>
  445. </el-select>
  446. </el-form-item>
  447. </el-col>
  448. <el-col :span="1">&nbsp;</el-col>
  449. <el-col :span="11">
  450. <el-form-item>
  451. <el-input v-model="maskForm.instrPrice"
  452. placeholder="输入金额"></el-input>
  453. </el-form-item>
  454. </el-col>
  455. </el-form-item>
  456. </el-form>
  457. <div slot="footer"
  458. class="dialog-footer">
  459. <!-- <el-button @click="addStudentVisible = false">取 消</el-button> -->
  460. <el-button type="primary"
  461. @click="addStudent">确 定</el-button>
  462. </div>
  463. </el-dialog>
  464. <el-dialog title="学员所在班级"
  465. width="640px"
  466. :visible.sync="studentClassVisible">
  467. <el-form :model="classMask">
  468. <el-form-item label="学生姓名">
  469. {{ classMask.studentName }}
  470. </el-form-item>
  471. <el-form-item label="所在班级"
  472. v-for="(item,index) in classList"
  473. :key="index">
  474. {{ item.name }}
  475. </el-form-item>
  476. </el-form>
  477. </el-dialog>
  478. <!-- 退团弹窗 -->
  479. <el-dialog title="退团信息确认"
  480. width="640px"
  481. :visible.sync="quitVisible">
  482. <el-form :model="quitForm"
  483. ref="quitForm"
  484. :rules="quitRules">
  485. <el-form-item label="退还课程费用"
  486. prop="isRefundCourseFee">
  487. <el-radio v-model="quitForm.isRefundCourseFee"
  488. :label="true">是</el-radio>
  489. <el-radio v-model="quitForm.isRefundCourseFee"
  490. :label="false">否</el-radio>
  491. </el-form-item>
  492. <el-form-item label="退还乐器费用"
  493. prop="isRefundInstrumentFee">
  494. <el-radio v-model="quitForm.isRefundInstrumentFee"
  495. :label="true">是</el-radio>
  496. <el-radio v-model="quitForm.isRefundInstrumentFee"
  497. :label="false">否</el-radio>
  498. </el-form-item>
  499. <el-form-item label="退还教辅费用"
  500. prop="isRefundTeachingAssistantsFee">
  501. <el-radio v-model="quitForm.isRefundTeachingAssistantsFee"
  502. :label="true">是</el-radio>
  503. <el-radio v-model="quitForm.isRefundTeachingAssistantsFee"
  504. :label="false">否</el-radio>
  505. </el-form-item>
  506. <el-form-item label="退团原因">
  507. <el-input type="textarea"
  508. v-model="quitForm.reason"></el-input>
  509. </el-form-item>
  510. </el-form>
  511. <span slot="footer"
  512. class="dialog-footer">
  513. <el-button @click="quitVisible = false">取 消</el-button>
  514. <el-button type="primary"
  515. @click="chioseType">确 定</el-button>
  516. </span>
  517. </el-dialog>
  518. <el-dialog title="报名二维码"
  519. :visible.sync="qrcodeStatus"
  520. width="300px">
  521. <div class="left-code">
  522. <h2>学员报名连接</h2>
  523. <div id="qrcode"
  524. class="qrcode code"
  525. ref="qrCodeUrl"></div>
  526. <p class="code-url"
  527. v-if="codeUrl">{{ codeUrl }}</p>
  528. </div>
  529. </el-dialog>
  530. <el-dialog title="修改缴费周期"
  531. :before-close='closePayVisible'
  532. width='600px'
  533. :visible.sync="payVisible">
  534. <el-form :model="payForm"
  535. ref="payForm"
  536. :inline="true">
  537. <el-form-item label="学生姓名"
  538. prop="studentName">
  539. <el-input v-model="payForm.studentName"
  540. disabled></el-input>
  541. </el-form-item>
  542. <br>
  543. <el-form-item label="缴费金额"
  544. prop="payMoney">
  545. <el-input type="number"
  546. v-model="payForm.payMoney"
  547. @mousewheel.native.prevent></el-input>
  548. </el-form-item>
  549. <el-form-item label="缴费月份"
  550. prop="payMonth">
  551. <el-checkbox-group v-model="payForm.payMonth"
  552. fill="#14928A"
  553. text-color='#474747'>
  554. <el-checkbox label="1">一月</el-checkbox>
  555. <el-checkbox label="2">二月</el-checkbox>
  556. <el-checkbox label="3">三月</el-checkbox>
  557. <el-checkbox label="4">四月</el-checkbox>
  558. <el-checkbox label="5">五月</el-checkbox>
  559. <el-checkbox label="6">六月</el-checkbox>
  560. <el-checkbox label="7">七月</el-checkbox>
  561. <el-checkbox label="8">八月</el-checkbox>
  562. <el-checkbox label="9">九月</el-checkbox>
  563. <el-checkbox label="10">十月</el-checkbox>
  564. <el-checkbox label="11">十一月</el-checkbox>
  565. <el-checkbox label="12">十二月</el-checkbox>
  566. </el-checkbox-group>
  567. </el-form-item>
  568. <!-- studentName: '',
  569. payMoney: '',
  570. payMonth -->
  571. </el-form>
  572. <div slot="footer"
  573. class="dialog-footer">
  574. <el-button @click="quitVisible = false">取 消</el-button>
  575. <el-button type="primary"
  576. @click="submitPay">确 定</el-button>
  577. </div>
  578. </el-dialog>
  579. </div>
  580. </template>
  581. <script>
  582. import { getTeamStudentList, getTeamStudentInfo, getSingleClass, findSound, StudentQuit, findSubjectPlan, getGoods, getSubject, getMusicGroupAllClass, StudentFeeIsLock, updateStudentFee } from '@/api/buildTeam'
  583. import { addStudent, getStudentClass, getStudentInfoByPhone } from '@/api/studentManager'
  584. import pagination from '@/components/Pagination/index'
  585. import { vaildStudentUrl } from '@/utils/validate'
  586. import QRCode from 'qrcodejs2'
  587. import axios from 'axios'
  588. import { getToken } from '@/utils/auth'
  589. export default {
  590. props: {
  591. teamid: {
  592. type: String,
  593. required: true
  594. },
  595. },
  596. data () {
  597. return {
  598. payVisible: false,
  599. quitVisible: false, // 退团信息确认的弹窗
  600. studentClassVisible: false, // 学员所在班级弹窗
  601. addStudentVisible: false, //新增学员弹窗
  602. topFrom: { // 顶部的禁选框集合
  603. expect: '2', // 预期招生
  604. studing: '5', // 在读人数
  605. allmoney: '100', //实收总额
  606. students: '5', // 实际招生人数
  607. signout: '10', // 退团总数
  608. },
  609. searchForm: {
  610. studentStatus: '', // 学生状态
  611. major: '', // 报名专业
  612. isPay: '', // 是否缴费
  613. search: '',
  614. isActive: ''
  615. },
  616. quitForm: { // 退团信息确认
  617. isRefundCourseFee: null,
  618. isRefundInstrumentFee: null,
  619. isRefundTeachingAssistantsFee: null,
  620. reason: ''
  621. },
  622. classMask: {
  623. studentName: ''
  624. },
  625. searchLsit: [],
  626. tableList: [], //
  627. rules: {
  628. // 分页规则
  629. limit: 10, // 限制显示条数
  630. page: 1, // 当前页
  631. total: 0, // 总条数
  632. page_size: [10, 20, 40, 50] // 选择限制显示条数
  633. },
  634. studentListInfo: {
  635. add: '',
  636. quit: '',
  637. studying: ''
  638. },
  639. signList: [],
  640. mixList: [],
  641. highList: [],
  642. snapList: [],
  643. soundList: [],
  644. qrcodeStatus: false, // 生成二维码
  645. qrcodes: true,
  646. qrcode: null,
  647. codeUrl: null,
  648. maskForm: {
  649. studentName: '',
  650. sex: '',
  651. parentName: '',
  652. course: '',
  653. phone: '',
  654. sound: '',
  655. timer: '',
  656. signClass: '',
  657. mixClass: '',
  658. highClass: '',
  659. snapClass: [],
  660. // price: '',
  661. startClass: '',
  662. id: '',
  663. courseFee: null, // 声部费用
  664. temporaryCourseFee: null, // 本次课程费用
  665. musicGoodsIdList: null, // 乐器商品编号
  666. musicMode: null, // 乐器购买方式
  667. musicPrice: null, // 乐器购买金额
  668. instrGoodsIdList: [], // 辅件商品编号
  669. instrPrice: null // 辅件购买金额
  670. },
  671. remark: '', // 退团原因
  672. classList: [],
  673. quitRules: {
  674. isRefundCourseFee: [{ required: true, message: '请选择是否退还课程费用' },],
  675. isRefundInstrumentFee: [{ required: true, message: '选择是否退还乐器费用' },],
  676. isRefundTeachingAssistantsFee: [{ required: true, message: '选择是否退还教辅费用' },],
  677. },
  678. maskRules: {
  679. studentName: [{ required: true, message: '请输入学生姓名' },],
  680. sex: [{ required: true, message: '请选择学生姓名' },],
  681. parentName: [{ required: true, message: '请输入家长姓名' },],
  682. course: [{ required: true, message: '请输入班级' },],
  683. // phone: [{ required: true, message: '请输入手机号' }, { pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号', trigger: 'blur' }],
  684. sound: [{ required: true, message: '请选择声部' },],
  685. timer: [{ required: true, message: '请选择出生日期' },],
  686. signClass: [{ required: true, message: '请选择单技班' },],
  687. // price: [{ required: true, message: '请输入首缴金额' },],
  688. startClass: [{ required: true, message: '请选择年级' }],
  689. id: [{ required: true, message: '请输入证件号' }],
  690. courseFee: [{ required: true, message: '请输入声部费用' }],
  691. temporaryCourseFee: [{ required: true, message: '请输课程费用' }],
  692. musicGoodsIdList: [{ required: true, message: '请选择乐器', trigger: 'change' }],
  693. musicPrice: [{ required: true, message: '请输入乐器购买金额' }],
  694. instrGoodsIdList: [{ required: true, message: '请选择辅件' }],
  695. instrPrice: [{ required: true, message: '请输入辅件金额' }]
  696. },
  697. INSTRUMENTLIST: [], // 乐器列表
  698. ACCESSORIESLIST: [], // 辅件列表
  699. activeRow: null,
  700. Fsearch: null,
  701. Frules: null,
  702. payForm: {
  703. studentName: '',
  704. payMoney: '',
  705. payMonth: []
  706. }
  707. }
  708. },
  709. components: {
  710. pagination
  711. },
  712. created () {
  713. // 判断是否带缓存参数
  714. if (this.$route.query.search) {
  715. this.Fsearch = this.$route.query.search;
  716. }
  717. if (this.$route.query.rules) {
  718. this.Frules = this.$route.query.rules
  719. }
  720. },
  721. /** <el-option label="已开启缴费"
  722. value="1"></el-option>
  723. <el-option label="未缴费"
  724. value="0"></el-option>
  725. <el-option label="已缴费"
  726. value="2"></el-option> */
  727. filters: {
  728. studentPays (val) {
  729. let template = {
  730. 'PAID_COMPLETED': "完成缴费",
  731. 'NON_PAYMENT': "未缴费",
  732. 'PROCESSING': "缴费中"
  733. }
  734. return template[val]
  735. }
  736. },
  737. mounted () {
  738. // 获取汇总数据
  739. getTeamStudentInfo({ musicGroupId: this.teamid }).then(res => {
  740. if (res.code == 200) {
  741. this.studentListInfo = res.data;
  742. }
  743. });
  744. this.getList();
  745. // 获取乐团内所有声部
  746. findSound({ musicGroupId: this.teamid }).then(res => {
  747. if (res.code == 200) {
  748. this.soundList = res.data;
  749. }
  750. })
  751. // getSubject().then(res => {
  752. // if (res.code == 200) {
  753. // this.soundList = res.data;
  754. // }
  755. // })
  756. // 获取乐团所有单技课班
  757. // getSingleClass({ musicGroupId: this.teamid }).then(res => {
  758. // if (res.code == 200) {
  759. // this.signList = res.data;
  760. // }
  761. // })
  762. // 获取乐团所有合奏课
  763. getMusicGroupAllClass({ musicGroupId: this.teamid }).then(res => {
  764. if (res.code == 200) {
  765. res.data.forEach(item => {
  766. if (item.type == 'NORMAL') {
  767. this.signList.push(item);
  768. } else if (item.type == 'MIX') {
  769. this.mixList.push(item);
  770. } else if (item.type == 'HIGH') {
  771. this.highList.push(item)
  772. } else if (item.type == 'SNAP') {
  773. this.snapList.push(item);
  774. }
  775. })
  776. }
  777. })
  778. },
  779. methods: {
  780. onMusicGroupExport () {
  781. let url = '/api-web/export/musicGroupStudent'
  782. let data = {
  783. musicGroupId: this.teamid,
  784. studentStatus: this.searchForm.studentStatus || null,
  785. paymentStatus: this.searchForm.isPay || null,
  786. subjectId: this.searchForm.major || null,
  787. search: this.searchForm.search || null,
  788. isActive: this.searchForm.isActive
  789. }
  790. const options = {
  791. method: 'get',
  792. headers: {
  793. 'Authorization': getToken()
  794. },
  795. url,
  796. params: data,
  797. responseType: 'blob'
  798. }
  799. this.$confirm('您确定导出学员列表?', '提示', {
  800. confirmButtonText: '确定',
  801. cancelButtonText: '取消',
  802. type: 'warning'
  803. }).then(() => {
  804. axios(options).then(res => {
  805. let blob = new Blob([res.data], {
  806. // type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8',
  807. type: 'application/vnd.ms-excel;charset=utf-8'
  808. // word文档为application/msword,pdf文档为application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
  809. })
  810. let objectUrl = URL.createObjectURL(blob)
  811. let link = document.createElement("a")
  812. let fname = this.$route.query.name + '学员列表'
  813. link.href = objectUrl
  814. link.setAttribute("download", fname)
  815. document.body.appendChild(link)
  816. link.click()
  817. })
  818. }).catch(() => { })
  819. },
  820. search () {
  821. this.rules.page = 1;
  822. this.getList()
  823. },
  824. onCreateQRCode () { // 生成报名二维码
  825. this.qrcodeStatus = true
  826. let id = this.$route.query.id
  827. if (this.qrcodes) {
  828. this.qrcodes = false
  829. setTimeout(() => {
  830. this.qrcode = new QRCode('qrcode', {
  831. width: 200,
  832. height: 200,
  833. colorDark: '#000000',
  834. colorLight: '#ffffff',
  835. correctLevel: QRCode.CorrectLevel.H
  836. })
  837. this.qrcode.makeCode(vaildStudentUrl() + '/#/login?musicGroupId=' + id)
  838. this.codeUrl = vaildStudentUrl() + '/#/login?musicGroupId=' + id
  839. }, 500)
  840. }
  841. },
  842. getList () {
  843. let obj = {
  844. musicGroupId: this.teamid,
  845. page: this.rules.page,
  846. rows: this.rules.limit,
  847. studentStatus: this.searchForm.studentStatus || null,
  848. paymentStatus: this.searchForm.isPay || null,
  849. subjectId: this.searchForm.major || null,
  850. search: this.searchForm.search || null,
  851. isActive: this.searchForm.isActive
  852. }
  853. getTeamStudentList(obj).then(res => {
  854. if (res.code == 200) {
  855. this.tableList = res.data.rows;
  856. this.rules.total = res.data.total
  857. }
  858. })
  859. },
  860. gotoSignin () {
  861. this.$router.push({
  862. path: '/business/studentSignin',
  863. query: {
  864. id: this.teamid,
  865. status: this.$route.query.status,
  866. name: this.$route.query.name,
  867. rules: this.Frules, search: this.Fsearch
  868. }
  869. })
  870. },
  871. chioseType () {
  872. this.$refs['quitForm'].validate(res => {
  873. if (res) {
  874. this.$confirm('确定退团?', '提示', {
  875. confirmButtonText: '确定',
  876. cancelButtonText: '取消',
  877. type: 'warning'
  878. }).then(() => {
  879. let row = this.activeRow;
  880. // 发请求 退团
  881. StudentQuit({ musicGroupId: this.teamid, userId: row.userId,
  882. reason: this.quitForm.reason,
  883. isRefundCourseFee: this.quitForm.isRefundCourseFee,
  884. isRefundInstrumentFee: this.quitForm.isRefundInstrumentFee,
  885. isRefundTeachingAssistantsFee: this.quitForm.isRefundTeachingAssistantsFee }).then(res => {
  886. this.quitForm = { // 退团信息确认
  887. isRefundCourseFee: null,
  888. isRefundInstrumentFee: null,
  889. isRefundTeachingAssistantsFee: null,
  890. reason: ''
  891. }
  892. if (res.code == 200) {
  893. this.$message.success('退团成功')
  894. this.getList();
  895. this.quitVisible = false;
  896. }
  897. })
  898. }).catch(() => {
  899. });
  900. } else {
  901. }
  902. })
  903. // row.typeVisible = false;
  904. },
  905. //
  906. addStudent () {
  907. // 发请求添加学员
  908. this.$refs['maskForm'].validate(res => {
  909. if (res) {
  910. // this.maskForm.parentName.timer 少个生日的字段
  911. // classGroupId: maskForm.signClass
  912. /** <!-- signClass: '',
  913. mixClass: '',
  914. highClass: '',
  915. snapClass: [], --> */
  916. let maskForm = this.maskForm
  917. if (!maskForm.signClass && !maskForm.mixClass && !maskForm.highClass) {
  918. if (!maskForm.snapClass || !(maskForm.snapClass && maskForm.snapClass.length >= 1)) {
  919. this.$message.error('该学生必须加入一个班级')
  920. return;
  921. }
  922. }
  923. let snapClassIds;
  924. maskForm.snapClass ? snapClassIds = maskForm.snapClass.join(',') : snapClassIds = null
  925. let params = {
  926. signClassId: maskForm.signClass,
  927. mixClassId: maskForm.mixClass,
  928. snapClassIds,
  929. highClassId: maskForm.highClass,
  930. courseFee: maskForm.courseFee,
  931. temporaryCourseFee: maskForm.temporaryCourseFee,
  932. studentRegistration: {
  933. name: maskForm.studentName,
  934. gender: maskForm.sex,
  935. birthdate: maskForm.timer,
  936. parentsName: maskForm.parentName,
  937. parentsPhone: maskForm.phone,
  938. currentGrade: maskForm.startClass,
  939. currentClass: maskForm.course,
  940. subjectId: maskForm.sound,
  941. musicGroupId: this.teamid,
  942. }
  943. }
  944. params.studentPaymentOrderDetails = []
  945. if (maskForm.musicGoodsIdList) {
  946. params.studentPaymentOrderDetails.push({
  947. goodsIdList: maskForm.musicGoodsIdList,
  948. type: 'MUSICAL',
  949. price: maskForm.musicPrice
  950. })
  951. }
  952. if (maskForm.instrGoodsIdList && maskForm.instrGoodsIdList != '') {
  953. params.studentPaymentOrderDetails.push({
  954. goodsIdList: maskForm.instrGoodsIdList.join(','),
  955. type: 'ACCESSORIES',
  956. price: maskForm.instrPrice
  957. })
  958. }
  959. addStudent(params).then(res => {
  960. if (res.code == 200) {
  961. this.$message.success('添加学生成功');
  962. this.getList()
  963. this.addStudentVisible = false
  964. }
  965. this.$refs.maskForm.resetFields()
  966. })
  967. }
  968. })
  969. },
  970. onSoundChange (value) { // 学员声部切换时
  971. this.findSubjectPlan(value)
  972. this.getGoodsList(value, 'INSTRUMENT') // 乐器
  973. this.getGoodsList(value, 'ACCESSORIES') // 辅件
  974. },
  975. // 获取购买方式
  976. findSubjectPlan (subjectId) {
  977. findSubjectPlan({
  978. musicGroupId: this.teamid,
  979. subjectId: subjectId
  980. }).then(res => {
  981. let result = res.data
  982. if (res.code == 200) {
  983. this.maskForm.musicMode = this.getBranchType(result.kitGroupPurchaseType)
  984. }
  985. })
  986. },
  987. getGoodsList (subjectId, type) {
  988. getGoods({
  989. subjectId: subjectId,
  990. type: type
  991. }).then(res => {
  992. let result = res.data
  993. if (res.code == 200) {
  994. let tempArr = []
  995. result.forEach(item => {
  996. tempArr.push({
  997. label: item.name,
  998. value: item.id
  999. })
  1000. })
  1001. if (type == 'ACCESSORIES') {
  1002. this.ACCESSORIESLIST = tempArr
  1003. }
  1004. if (type == 'INSTRUMENT') {
  1005. this.INSTRUMENTLIST = tempArr
  1006. }
  1007. }
  1008. })
  1009. },
  1010. getBranchType (status) {
  1011. let common = {
  1012. FREE: "免费",
  1013. GROUP: "团购",
  1014. LEASE: "租赁"
  1015. }
  1016. return common[status]
  1017. },
  1018. lookClass (row) {
  1019. this.classMask.studentName = row.realName;
  1020. getStudentClass({
  1021. musicGroupId: this.teamid,
  1022. teacherId: row.userId
  1023. }).then(res => {
  1024. if (res.code == 200) {
  1025. this.classList = res.data;
  1026. this.studentClassVisible = true;
  1027. }
  1028. })
  1029. },
  1030. quieTeamMask (row) {
  1031. this.activeRow = row;
  1032. this.quitVisible = true;
  1033. },
  1034. checkPhone (val) {
  1035. var regu = /^1[3456789]\d{9}$/;
  1036. var re = new RegExp(regu);
  1037. if (re.test(val)) {
  1038. getStudentInfoByPhone({ mobile: this.maskForm.phone }).then(res => {
  1039. if (res.code == 200) {
  1040. if (res.data) {
  1041. this.maskForm = {
  1042. studentName: res.data.name,
  1043. sex: res.data.gender,
  1044. parentName: res.data.parentsName,
  1045. course: res.data.currentClass,
  1046. startClass: res.data.currentGrade,
  1047. // sound: parseInt(res.data.subjectId),
  1048. phone: val,
  1049. timer: res.data.birthdate
  1050. }
  1051. /**
  1052. * name: maskForm.studentName,
  1053. gender: maskForm.sex,
  1054. parentsName: maskForm.parentName,
  1055. parentsPhone: maskForm.phone,
  1056. currentGrade: maskForm.startClass,
  1057. currentClass: maskForm.course,
  1058. subjectId: maskForm.sound,
  1059. musicGroupId: this.teamid,
  1060. */
  1061. /**
  1062. maskForm: {
  1063. studentName: '',
  1064. sex: '',
  1065. parentName: '',
  1066. course: '',
  1067. phone: '',
  1068. sound: '',
  1069. timer: '',
  1070. signClass: '',
  1071. // price: '',
  1072. startClass: '',
  1073. id: '',
  1074. courseFee: null, // 声部费用
  1075. temporaryCourseFee: null, // 本次课程费用
  1076. musicGoodsIdList: null, // 乐器商品编号
  1077. musicMode: null, // 乐器购买方式
  1078. musicPrice: null, // 乐器购买金额
  1079. instrGoodsIdList: [], // 辅件商品编号
  1080. instrPrice: null // 辅件购买金额
  1081. },
  1082. *
  1083. */
  1084. }
  1085. }
  1086. })
  1087. }
  1088. },
  1089. lockStudent (row) {
  1090. this.$confirm('是否锁定/解锁学生缴费周期?', '提示', {
  1091. confirmButtonText: '确定',
  1092. cancelButtonText: '取消',
  1093. type: 'warning'
  1094. }).then(() => {
  1095. let musicGroupId = this.teamid;
  1096. let studentId = row.userId;
  1097. let isLock;
  1098. row.isLock == 0 ? isLock = 1 : isLock = 0;
  1099. StudentFeeIsLock({ musicGroupId, studentId, isLock }).then(res => {
  1100. if (res.code == 200) {
  1101. this.$message.success('修改成功')
  1102. this.getList()
  1103. }
  1104. })
  1105. }).catch(() => {
  1106. });
  1107. },
  1108. resetPay (row) {
  1109. this.activeRow = row;
  1110. this.payVisible = true;
  1111. this.payForm.studentName = row.realName;
  1112. this.payForm.payMoney = row.courseFee;
  1113. this.payForm.payMonth = row.paymentPeriodList.split(',')
  1114. if (this.payForm.payMonth[0] == "") {
  1115. this.payForm.payMonth = []
  1116. }
  1117. },
  1118. submitPay () {
  1119. let studentId = this.activeRow.userId;
  1120. let musicGroupId = this.teamid;
  1121. let month = this.payForm.payMonth.join(',') || null;
  1122. let amount = this.payForm.payMoney;
  1123. let obj = {
  1124. studentId,
  1125. musicGroupId,
  1126. month,
  1127. amount
  1128. }
  1129. updateStudentFee(obj).then(res => {
  1130. if (res.code == 200) {
  1131. this.$message.success('修改成功')
  1132. this.payVisible = false;
  1133. this.getList();
  1134. }
  1135. })
  1136. },
  1137. closePayVisible () {
  1138. this.$refs['payForm'].resetFields();
  1139. this.payVisible = false;
  1140. }
  1141. }
  1142. }
  1143. </script>
  1144. <style lang="scss" scoped>
  1145. // .moreInput {
  1146. // width: 100%;
  1147. // display: flex;
  1148. // /deep/.el-form-item__content {
  1149. // display: flex;
  1150. // flex-direction: row;
  1151. // }
  1152. // }
  1153. .el-select {
  1154. width: 180px !important;
  1155. }
  1156. .headWrap {
  1157. padding: 20px 0;
  1158. }
  1159. /deep/.el-date-editor.el-input {
  1160. width: auto;
  1161. .el-input__inner {
  1162. padding-right: 0;
  1163. }
  1164. }
  1165. .studentInfo {
  1166. /deep/.el-dialog__body {
  1167. padding-top: 0;
  1168. padding-bottom: 0;
  1169. }
  1170. }
  1171. // .instrList {
  1172. // display: flex;
  1173. // /deep/.el-form-item__content {
  1174. // width: 80%;
  1175. // }
  1176. // .el-col {
  1177. // /deep/.el-form-item__content {
  1178. // width: 100%;
  1179. // }
  1180. // }
  1181. // }
  1182. .stu-container {
  1183. .topFrom {
  1184. margin: 20px 30px 0;
  1185. width: 1000px;
  1186. }
  1187. .newStudent {
  1188. width: 121px;
  1189. height: 40px;
  1190. background: rgba(20, 146, 138, 1);
  1191. border-radius: 4px;
  1192. color: #fff;
  1193. text-align: center;
  1194. line-height: 40px;
  1195. font-size: 14px;
  1196. cursor: pointer;
  1197. }
  1198. }
  1199. .left-code,
  1200. .right-code {
  1201. // width: 50%;
  1202. // float: left;
  1203. h2 {
  1204. display: block;
  1205. font-size: 18px;
  1206. text-align: center;
  1207. padding-bottom: 8px;
  1208. line-height: 1;
  1209. height: 30px;
  1210. margin-bottom: 0;
  1211. }
  1212. .qrcode {
  1213. display: flex;
  1214. justify-content: center;
  1215. img {
  1216. width: 200px;
  1217. height: 200px;
  1218. // margin: 0 auto;
  1219. }
  1220. }
  1221. .code-url {
  1222. font-size: 18px;
  1223. text-align: center;
  1224. padding: 15px 15px 0 15px;
  1225. }
  1226. }
  1227. .export {
  1228. background: #14928a;
  1229. }
  1230. </style>