resetPayList.vue 39 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315
  1. <!-- -->
  2. <template>
  3. <div class="m-core">
  4. <save-form
  5. :inline="true"
  6. save-key="resetPayList"
  7. @submit="getList"
  8. :model="searchForm"
  9. >
  10. <el-form-item>
  11. <el-select
  12. placeholder="缴费种类"
  13. v-model="searchForm.payUserType"
  14. clearable
  15. filterable
  16. >
  17. <el-option
  18. v-for="(item, index) in payUserTypeList"
  19. :label="item.label"
  20. :value="item.value"
  21. :key="index"
  22. ></el-option>
  23. </el-select>
  24. </el-form-item>
  25. <el-form-item>
  26. <el-select
  27. placeholder="缴费类型"
  28. v-model="searchForm.paymentType"
  29. clearable
  30. filterable
  31. >
  32. <el-option
  33. v-for="(item, index) in payOrderTypeList"
  34. :label="item.label"
  35. :value="item.value"
  36. :key="index"
  37. ></el-option>
  38. </el-select>
  39. </el-form-item>
  40. <el-form-item>
  41. <el-button type="danger" native-type="submit">搜索</el-button>
  42. <!-- <el-button @click="onReSet" type="primary">重置</el-button> -->
  43. </el-form-item>
  44. </save-form>
  45. <div class="topWrap">
  46. <div
  47. class="newBand"
  48. @click="newUserPay"
  49. v-if="teamStatus"
  50. v-permission="'musicGroupPaymentCalender/createCalender/3895'"
  51. >
  52. 新建学员缴费
  53. </div>
  54. <div
  55. class="newBand"
  56. @click="newSchoolPay"
  57. v-if="teamStatus"
  58. v-permission="'musicGroupPaymentCalender/createCalender/4359'"
  59. >
  60. 新建学校缴费
  61. </div>
  62. <div
  63. class="newBand"
  64. @click="newGoodsPay"
  65. v-if="teamStatus"
  66. v-permission="'musicGroupPaymentCalender/createCalender/4359'"
  67. >
  68. 新建商品采购
  69. </div>
  70. <div
  71. class="newBand"
  72. v-permission="'musicGroup/extensionPayment'"
  73. @click="extendTime"
  74. >
  75. 延长缴费
  76. </div>
  77. <!-- <div class="newBand"
  78. v-if="teamStatus"
  79. v-permission="'/studentPayBase'"
  80. @click="setStudentPay">学员缴费设置</div> -->
  81. <!-- <div class="newBand"
  82. v-if="!isNewGropu"
  83. @click="onCreateQRCode">续费二维码</div> -->
  84. </div>
  85. <div class="tableWrap">
  86. <el-table
  87. style="width: 100%"
  88. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  89. :data="tableList"
  90. >
  91. <el-table-column
  92. align="center"
  93. prop="batchNo"
  94. width="200"
  95. label="缴费批次"
  96. >
  97. <template slot-scope="scope">
  98. <div>
  99. <copy-text>{{ scope.row.batchNo }}</copy-text>
  100. </div>
  101. </template>
  102. </el-table-column>
  103. <el-table-column align="center" prop="paymentType" label="缴费种类">
  104. <template slot-scope="scope">
  105. <div>
  106. {{ scope.row.payUserType | payUserTypeFormat }}
  107. </div>
  108. </template>
  109. </el-table-column>
  110. <el-table-column align="center" prop="paymentType" label="缴费类型">
  111. <template slot-scope="scope">
  112. <div>
  113. {{ scope.row.paymentType | userPaymentTypeFormat }}
  114. </div>
  115. </template>
  116. </el-table-column>
  117. <el-table-column
  118. align="center"
  119. prop="auditStatus"
  120. label="审核状态"
  121. width="100px"
  122. >
  123. <template slot-scope="scope">
  124. <div>
  125. {{ scope.row.status | auditType }}
  126. </div>
  127. </template>
  128. </el-table-column>
  129. <!-- <el-table-column
  130. align="center"
  131. prop="addCourseTotalTime"
  132. width="150px"
  133. label="加课总时长"
  134. >
  135. </el-table-column> -->
  136. <!-- <el-table-column
  137. align="center"
  138. prop="courseCurrentPrice"
  139. label="课程费用"
  140. >
  141. <template slot-scope="scope">
  142. <div>
  143. {{
  144. (scope.row.paymentType === "SPAN_GROUP_CLASS_ADJUST"
  145. ? scope.row.courseOriginalPrice
  146. : scope.row.courseCurrentPrice) | moneyFormat
  147. }}
  148. </div>
  149. </template>
  150. </el-table-column>
  151. <el-table-column
  152. align="center"
  153. prop="courseCurrentPrice"
  154. label="会员费用"
  155. >
  156. <template slot-scope="scope">
  157. <div>
  158. {{ scope.row.memberPaymentAmount | moneyFormat }}
  159. </div>
  160. </template>
  161. </el-table-column> -->
  162. <el-table-column align="center" prop="status" label="缴费人数">
  163. <template slot-scope="scope">
  164. <div v-if="scope.row.payUserType == 'STUDENT'">
  165. {{ scope.row.actualNum }}/{{ scope.row.expectNum }}
  166. </div>
  167. <div v-else>--</div>
  168. </template>
  169. </el-table-column>
  170. <el-table-column
  171. align="center"
  172. prop="currentTotalAmount"
  173. label="缴费金额(元)"
  174. >
  175. </el-table-column>
  176. <el-table-column align="center" prop="memo" width="200px" label="备注">
  177. <template slot-scope="scope">
  178. <overflow-text width="200px" :text="scope.row.memo" />
  179. </template>
  180. </el-table-column>
  181. <el-table-column label="操作" fixed="right" min-width="200px">
  182. <template slot-scope="scope">
  183. <div>
  184. <auth auths="musicGroupPaymentCalender/queryPage/4315">
  185. <!-- v-permission="'musicGroupPaymentCalender/queryPage/4315'" -->
  186. <el-button type="text" @click="lookDetail(scope.row)"
  187. >查看</el-button
  188. ></auth
  189. >
  190. <auth
  191. auths="musicGroupPaymentCalenderDetail/batchAdd/3890"
  192. v-if="
  193. scope.row.status != 'REJECT' &&
  194. scope.row.status != 'AUDITING' &&
  195. scope.row.status != 'DRAFT' &&
  196. teamStatus &&
  197. scope.row.paymentType != 'MUSIC_APPLY' &&
  198. scope.row.paymentType != 'ADD_STUDENT' &&
  199. scope.row.paymentType != 'SPAN_GROUP_CLASS_ADJUST'
  200. "
  201. >
  202. <!-- &&scope.row.payUserType === 'STUDENT' -->
  203. <el-button type="text" @click="openChioseStudent(scope.row)"
  204. >添加学员</el-button
  205. >
  206. </auth>
  207. <!-- v-permission="'musicGroupPaymentCalenderDetail/batchAdd/3890'" v-permission="''" -->
  208. <auth
  209. auths="musicGroupPaymentCalender/update/4313"
  210. v-if="
  211. teamStatus &&
  212. scope.row.paymentType != 'ADD_STUDENT' &&
  213. (scope.row.status === 'REJECT' ||
  214. scope.row.status === 'DRAFT')
  215. "
  216. >
  217. <el-button type="text" @click="resetPay(scope.row)"
  218. >修改</el-button
  219. >
  220. </auth>
  221. <auth
  222. auths="musicGroupPaymentCalender/update/4313"
  223. v-if="
  224. team_status == 'FEE_AUDIT_FAILED' &&
  225. scope.row.paymentType != 'ADD_STUDENT' &&
  226. (scope.row.status === 'REJECT' ||
  227. scope.row.status === 'DRAFT')
  228. "
  229. >
  230. <el-button type="text" @click="resetPay(scope.row)"
  231. >修改</el-button
  232. >
  233. </auth>
  234. <!-- scope.row.paymentType != 'SPAN_GROUP_CLASS_ADJUST' &&-->
  235. <auth
  236. auths="musicGroupPaymentCalender/revoke"
  237. v-if="
  238. (team_status == 'FEE_AUDIT' || team_status == 'PROGRESS') &&
  239. scope.row.status === 'AUDITING' &&
  240. scope.row.paymentType != 'ADD_STUDENT'
  241. "
  242. >
  243. <el-button type="text" @click="revoke(scope.row)"
  244. >撤回</el-button
  245. >
  246. </auth>
  247. <!-- scope.row.paymentType != 'SPAN_GROUP_CLASS_ADJUST' && -->
  248. <auth
  249. auths="musicGroupPaymentCalender/delByBatchNo/4305"
  250. v-if="
  251. teamStatus &&
  252. scope.row.paymentType != 'ADD_STUDENT' &&
  253. (scope.row.status == 'DRAFT' ||
  254. scope.row.status == 'REJECT')
  255. "
  256. >
  257. <el-button type="text" @click="removeBatchNo(scope.row)"
  258. >删除</el-button
  259. ></auth
  260. >
  261. <auth
  262. auths="musicGroupPaymentCalender/delByBatchNo/4305"
  263. v-if="
  264. teamStatus &&
  265. scope.row.paymentType == 'ADD_STUDENT' &&
  266. (scope.row.status == 'DRAFT' ||
  267. scope.row.status == 'REJECT')
  268. "
  269. >
  270. <el-button type="text" @click="removeBatchNo(scope.row)"
  271. >删除</el-button
  272. ></auth
  273. >
  274. <el-button
  275. type="text"
  276. v-if="
  277. !isNewGropu &&
  278. teamStatus &&
  279. scope.row.paymentType != 'MUSIC_APPLY' &&
  280. (scope.row.status == 'OPEN' ||
  281. scope.row.status == 'OVER') &&
  282. scope.row.payUserType === 'STUDENT'
  283. "
  284. @click="onCreateQRCode(scope.row)"
  285. >续费二维码</el-button
  286. >
  287. <el-button
  288. type="text"
  289. v-if="
  290. scope.row.payUserType === 'STUDENT' &&
  291. scope.row.paymentType == 'MUSIC_APPLY' &&
  292. $helpers.permission(
  293. 'musicGroup/findMusicGroupSubjectInfo/966'
  294. )
  295. "
  296. @click="onPreview(scope.row)"
  297. >预览</el-button
  298. >
  299. </div>
  300. </template>
  301. </el-table-column>
  302. </el-table>
  303. <pagination
  304. save-key="resetPayList"
  305. sync
  306. :total.sync="rules.total"
  307. :page.sync="rules.page"
  308. :limit.sync="rules.limit"
  309. :page-sizes="rules.page_size"
  310. @pagination="getList"
  311. />
  312. </div>
  313. <el-dialog :visible.sync="itemsVisible" title="查看缴费计划" width="1000px">
  314. <pay-items
  315. v-if="itemsVisible"
  316. ref="payItems"
  317. :batchNo="viewDetail && viewDetail.batchNo"
  318. payUserType="STUDENT"
  319. :teamStatus="teamStatus"
  320. :teamType="teamType"
  321. :isNewGropu="isNewGropu"
  322. @lookDetail="lookDetail"
  323. @onPreview="onPreview"
  324. @openChioseStudent="openChioseStudent"
  325. @resetPay="resetPay"
  326. @close="itemsVisible = false"
  327. @onCreateQRCode="onCreateQRCode"
  328. />
  329. </el-dialog>
  330. <el-dialog
  331. :visible.sync="payVisible"
  332. :close-on-click-modal="false"
  333. width="500px"
  334. :title="diTitle"
  335. >
  336. <el-form
  337. :model="payForm"
  338. :inline="true"
  339. label-width="120px"
  340. label-position="right"
  341. ref="payForm"
  342. >
  343. <el-form-item
  344. label="缴费开始日期"
  345. :rules="[
  346. { required: true, message: '请设置缴费开始日期', trigger: 'blur' }
  347. ]"
  348. prop="startPaymentDate"
  349. >
  350. <el-date-picker
  351. v-model.trim="payForm.startPaymentDate"
  352. @change="changeStartTime"
  353. type="date"
  354. :picker-options="pickerOptions"
  355. value-format="yyyy-MM-dd"
  356. placeholder="开始日期"
  357. ></el-date-picker>
  358. </el-form-item>
  359. <el-form-item
  360. label="缴费结束日期"
  361. :rules="[
  362. { required: true, message: '请设置缴费结束日期', trigger: 'blur' }
  363. ]"
  364. prop="deadlinePaymentDate"
  365. >
  366. <el-date-picker
  367. v-model.trim="payForm.deadlinePaymentDate"
  368. type="date"
  369. :picker-options="beginDate(payForm.startPaymentDate)"
  370. value-format="yyyy-MM-dd"
  371. placeholder="结束日期"
  372. ></el-date-picker>
  373. </el-form-item>
  374. <el-form-item
  375. label="缴费方式"
  376. prop="paymentPattern"
  377. :rules="[{ required: true, message: '请选择缴费方式' }]"
  378. >
  379. <el-select
  380. placeholder="缴费方式"
  381. style="width: 220px"
  382. clearable
  383. filterable
  384. @change="paymentPatternChange"
  385. v-model.trim="payForm.paymentPattern"
  386. >
  387. <el-option :value="0" label="按月"></el-option>
  388. <el-option :value="1" label="按季"></el-option>
  389. <el-option :value="2" label="一次性"></el-option>
  390. </el-select>
  391. </el-form-item>
  392. <el-form-item
  393. label="缴费有效期开始"
  394. :rules="[
  395. {
  396. required: true,
  397. message: '请设置缴费有效期开始日期',
  398. trigger: 'blur'
  399. }
  400. ]"
  401. prop="paymentValidStartDate"
  402. >
  403. <el-date-picker
  404. v-model.trim="payForm.paymentValidStartDate"
  405. type="date"
  406. @change="changePaymentStartTime"
  407. :picker-options="pickerOptions"
  408. value-format="yyyy-MM-dd"
  409. placeholder="有效期开始日期"
  410. ></el-date-picker>
  411. </el-form-item>
  412. <el-form-item
  413. label="缴费有效期结束"
  414. :rules="[
  415. {
  416. required: true,
  417. message: '请设置缴费有效期结束日期',
  418. trigger: 'blur'
  419. }
  420. ]"
  421. prop="paymentValidEndDate"
  422. >
  423. <el-date-picker
  424. v-model.trim="payForm.paymentValidEndDate"
  425. type="date"
  426. :picker-options="beginDate(payForm.paymentValidStartDate)"
  427. value-format="yyyy-MM-dd"
  428. placeholder="有效期结束日期"
  429. ></el-date-picker>
  430. </el-form-item>
  431. <el-form-item
  432. label="收费类型"
  433. v-if="isNew"
  434. :rules="[
  435. { required: true, message: '请选择收费类型', trigger: 'blur' }
  436. ]"
  437. prop="type"
  438. >
  439. <el-select
  440. v-model.trim="payForm.type"
  441. style="width: 220px !important"
  442. placeholder="课程类型"
  443. >
  444. <el-option label="线上" value="ONLINE"></el-option>
  445. <el-option label="线下" value="OFFLINE"></el-option>
  446. </el-select>
  447. </el-form-item>
  448. <el-form-item
  449. label="备注"
  450. v-if="isNew"
  451. :rules="[{ required: true, message: '请填写备注', trigger: 'blur' }]"
  452. prop="memo"
  453. >
  454. <el-input
  455. type="textarea"
  456. style="width: 220px !important"
  457. :rows="4"
  458. placeholder="请填写备注"
  459. v-model="payForm.memo"
  460. ></el-input>
  461. </el-form-item>
  462. </el-form>
  463. <div slot="footer" class="dialog-footer">
  464. <el-button @click="payVisible = false">取 消</el-button>
  465. <el-button type="primary" v-if="isNew" @click="newPayInfo"
  466. >确 定</el-button
  467. >
  468. <el-button type="primary" v-else @click="resetPayDate">确 定</el-button>
  469. </div>
  470. </el-dialog>
  471. <el-dialog
  472. title="查看"
  473. :visible.sync="reviewVisible"
  474. width="900px"
  475. v-if="reviewVisible"
  476. >
  477. <reviewDetail
  478. @close="reviewVisible = false"
  479. @submited="getList"
  480. :detail="viewDetail"
  481. :musicGroupId="$route.query.id"
  482. destroy-on-close
  483. />
  484. <div slot="footer" class="dialog-footer">
  485. <el-button type="primary" @click="reviewVisible = false"
  486. >关闭</el-button
  487. >
  488. </div>
  489. </el-dialog>
  490. <el-dialog :title="payFormTitle" :visible.sync="userVisible" width="830px">
  491. <userPayForm
  492. v-if="userVisible"
  493. @close="userVisible = false"
  494. @submited="payedSubmited"
  495. @changeActive="changeActive"
  496. :organizationCourseUnitPriceSettings="
  497. organizationCourseUnitPriceSettings
  498. "
  499. :rowDetail="activeRow"
  500. :type="payFormType"
  501. :baseInfo="baseInfo"
  502. :paymentType="paymentType"
  503. :musicGroupId="$route.query.id"
  504. @changePaymentType="changePaymentType"
  505. />
  506. </el-dialog>
  507. <!-- 会员缴费 -->
  508. <el-dialog
  509. :title="payFormTitle"
  510. :visible.sync="memberVisible"
  511. width="830px"
  512. >
  513. <memberPayForm
  514. v-if="memberVisible"
  515. @close="memberVisible = false"
  516. @submited="payedSubmited"
  517. @changeActive="changeActive"
  518. :organizationCourseUnitPriceSettings="
  519. organizationCourseUnitPriceSettings
  520. "
  521. :rowDetail="activeRow"
  522. :type="payFormType"
  523. :baseInfo="baseInfo"
  524. :paymentType="paymentType"
  525. :musicGroupId="$route.query.id"
  526. />
  527. </el-dialog>
  528. <el-dialog
  529. title="学员选择"
  530. :visible.sync="chioseStudentVisible"
  531. destroy-on-close
  532. append-to-body
  533. width="800px"
  534. >
  535. <setStudentFee
  536. @chioseStudent="chioseStudent"
  537. ref="setStudentFee"
  538. v-if="chioseStudentVisible"
  539. :batchNo="batchNo"
  540. :musicGroupPaymentCalenderId="musicGroupPaymentCalenderId"
  541. @submited="chioseStudentSubmited"
  542. :clearTale="clearStduent"
  543. ></setStudentFee>
  544. <div slot="footer" class="dialog-footer">
  545. <el-button @click="chioseStudentVisible = false">取 消</el-button>
  546. <el-button type="primary" @click="submitNewPay">确 定</el-button>
  547. </div>
  548. </el-dialog>
  549. <qr-code v-model="qrcodeStatus" title="续费二维码" :codeUrl="codeUrl" />
  550. <el-dialog
  551. title="报名声部预览"
  552. :visible.sync="dialogSubjectVisible"
  553. width="400px"
  554. class="subjectPreview"
  555. >
  556. <el-tabs v-model="activeName" type="card">
  557. <el-tab-pane
  558. :label="subject.subName"
  559. lazy
  560. v-for="(subject, index) in dialogSubjectList"
  561. :key="index"
  562. :name="subject.subjectId.toString()"
  563. style="max-height: 500px; overflow-y: auto"
  564. >
  565. <subject-preview
  566. :subjectId="subject.subjectId"
  567. :calenderId="dialogCalenderId"
  568. ></subject-preview>
  569. </el-tab-pane>
  570. </el-tabs>
  571. <!-- <div slot="footer">
  572. <el-button @click="dialogSubjectVisible = false">取 消</el-button>
  573. </div> -->
  574. </el-dialog>
  575. <el-dialog
  576. :title="'延长缴费'"
  577. :visible.sync="extendPaymentStatus"
  578. v-if="extendPaymentStatus"
  579. width="400px"
  580. >
  581. <el-form :model="extendForm" ref="extendForm" :rules="extendRule">
  582. <el-form-item label="缴费时间" prop="expireDate">
  583. <el-date-picker
  584. v-model.trim="extendForm.expireDate"
  585. value-format="yyyy-MM-dd"
  586. type="date"
  587. :picker-options="applyDates"
  588. placeholder="选择日期"
  589. >
  590. </el-date-picker>
  591. </el-form-item>
  592. </el-form>
  593. <div slot="footer" class="dialog-footer">
  594. <el-button @click="extendPaymentStatus = false">取 消</el-button>
  595. <el-button type="primary" @click="onExtendPayment('extendForm')"
  596. >确 定</el-button
  597. >
  598. </div>
  599. </el-dialog>
  600. <el-button
  601. type="primary"
  602. @click="submitAudit"
  603. v-if="team_status == 'DRAFT' || team_status == 'AUDIT_FAILED'"
  604. >提交审核</el-button
  605. >
  606. <el-button
  607. type="primary"
  608. @click="approval"
  609. v-if="team_status == 'AUDIT'"
  610. v-permission="'musicGroup/auditSuccess'"
  611. >审核通过</el-button
  612. >
  613. <el-button
  614. type="danger"
  615. @click="refuse"
  616. v-if="team_status == 'AUDIT'"
  617. v-permission="'musicGroup/auditFailed'"
  618. >驳回</el-button
  619. >
  620. </div>
  621. </template>
  622. <script>
  623. import pagination from "@/components/Pagination/index";
  624. import dayjs from "dayjs";
  625. import QrCode from "@/components/QrCode/index";
  626. import { vaildStudentUrl } from "@/utils/validate";
  627. import {
  628. getTeamBaseInfo,
  629. auditSuccess,
  630. auditFailed,
  631. musicGroupAuditing
  632. } from "@/api/buildTeam";
  633. // import { auditSuccess, auditFailed } from "@/api/buildTeam";
  634. import {
  635. resetMusicGroupPaymentCalender,
  636. delMusicGroupPaymentCalender,
  637. findMusicGroupSubjectInfo,
  638. extensionPayment
  639. } from "@/api/buildTeam";
  640. import { getAuditList } from "@/api/auditManager";
  641. import { getOrganizationCourseUnitPriceSettings } from "@/api/specialSetting";
  642. import {
  643. getMusicGroupStu,
  644. musicGroupPaymentCalenderDetailBatchAdd,
  645. musicGroupPaymentCalenderDelByBatchNo,
  646. revokeMusicGroupPaymentCalender
  647. } from "../api";
  648. import setStudentFee from "./studentPayBase";
  649. import userPayForm from "../modals/user-pay-form";
  650. import memberPayForm from "../modals/member-pay-form";
  651. import payItems from "../modals/pay-items";
  652. import schoolPayForm from "../modals/school-pay-form";
  653. import review from "../modals/review";
  654. import reviewDetail from "../modals/review-detail";
  655. import subjectPreview from "@/views/resetTeaming/modals/subject-preview";
  656. import { userPaymentType } from "@/constant";
  657. import { objectToOptions } from "@/utils";
  658. import { payOrderTypeList, payUserTypeList } from "@/utils/searchArray";
  659. export default {
  660. props: ["isNewGropu"],
  661. components: {
  662. pagination,
  663. setStudentFee,
  664. userPayForm,
  665. memberPayForm,
  666. schoolPayForm,
  667. QrCode,
  668. review,
  669. reviewDetail,
  670. "pay-items": payItems,
  671. subjectPreview
  672. },
  673. data() {
  674. return {
  675. paymentType: this.team_status == "DRAFT" ? 0 : 1,
  676. musicGroupStu: [],
  677. payFormType: "user",
  678. userVisible: false,
  679. schoolVisible: false,
  680. itemsVisible: false,
  681. reviewVisible: false,
  682. organizationCourseUnitPriceSettings: [],
  683. searchForm: {
  684. paymentType: null,
  685. payUserType: null
  686. },
  687. viewDetail: null,
  688. tableList: [],
  689. rules: {
  690. // 分页规则
  691. limit: 10, // 限制显示条数
  692. page: 1, // 当前页
  693. total: 0, // 总条数
  694. page_size: [10, 20, 40, 50] // 选择限制显示条数
  695. },
  696. isInit: false,
  697. diTitle: "新增缴费",
  698. payVisible: false,
  699. payForm: {
  700. startPaymentDate: null,
  701. deadlinePaymentDate: null,
  702. paymentPattern: null,
  703. paymentValidStartDate: null,
  704. paymentValidEndDate: null,
  705. type: null,
  706. memo: null
  707. },
  708. isNew: false,
  709. activeRow: null,
  710. pickerOptions: {
  711. firstDayOfWeek: 1,
  712. disabledDate(time) {
  713. return time.getTime() + 86400000 <= new Date().getTime();
  714. }
  715. },
  716. qrcodeStatus: false, // 生成二维码
  717. codeUrl: null,
  718. chioseStudentVisible: false,
  719. chioseStudentList: [],
  720. clearStduent: true,
  721. batchNo: "",
  722. musicGroupPaymentCalenderId: "",
  723. teamType: this.$route.query.type,
  724. payOrderTypeLists: payOrderTypeList,
  725. dialogSubjectVisible: false, // 预览声部
  726. dialogSubjectList: [],
  727. activeName: null,
  728. dialogCalenderId: null, // 选择编号
  729. baseInfo: null,
  730. memberVisible: false, // 会员缴费,
  731. payUserTypeList: payUserTypeList,
  732. extendPaymentStatus: "",
  733. extendForm: {
  734. expireDate: null
  735. },
  736. extendRule: {
  737. expireDate: [
  738. { required: true, message: "请选择延长时间", trigger: "change" }
  739. ]
  740. },
  741. applyDates: this.applyDate()
  742. };
  743. },
  744. //生命周期 - 创建完成(可以访问当前this实例)
  745. created() {},
  746. //生命周期 - 挂载完成(可以访问DOM元素)
  747. async mounted() {
  748. this.teamid = this.$route.query.id;
  749. this.paymentType = this.team_status == "DRAFT" ? 0 : 1;
  750. // 获取分部
  751. try {
  752. const res = await getOrganizationCourseUnitPriceSettings({
  753. rows: 9999
  754. });
  755. this.organizationCourseUnitPriceSettings = res.data.rows;
  756. // this.organizationCourseUnitPriceSettings=[];
  757. if (this.organizationCourseUnitPriceSettings.length <= 0) {
  758. this.$bus.$emit("showguide", ["teamCourseFee"]);
  759. return;
  760. }
  761. localStorage.setItem(
  762. "organizationCourseUnitPriceSettings",
  763. JSON.stringify(this.organizationCourseUnitPriceSettings)
  764. );
  765. } catch (error) {
  766. localStorage.removeItem("organizationCourseUnitPriceSettings");
  767. }
  768. this.init();
  769. },
  770. computed: {
  771. payOrderTypeList() {
  772. return objectToOptions(userPaymentType);
  773. },
  774. payFormTitle() {
  775. if (this.isNew) {
  776. return this.payFormType === "user" ? "新增学员缴费" : "新增学校缴费";
  777. } else {
  778. return this.payFormType === "user" ? "修改学员缴费" : "修改学校缴费";
  779. }
  780. },
  781. teamStatus() {
  782. // let type = this.$route.query.type;
  783. return (
  784. this.team_status == "DRAFT" ||
  785. this.team_status == "PROGRESS" ||
  786. this.team_status == "AUDIT_FAILED"
  787. );
  788. },
  789. team_status() {
  790. return this.$route.query.team_status;
  791. }
  792. },
  793. // activated () {
  794. // this.init();
  795. // },
  796. methods: {
  797. async init() {
  798. // this.team_status = this.$route.query.team_status;
  799. try {
  800. const res = await getMusicGroupStu({
  801. musicGroupId: this.$route.query.id
  802. });
  803. } catch (error) {}
  804. this.getTeamInfo();
  805. this.getList();
  806. },
  807. getTeamInfo() {
  808. if (this.$route.query.id) {
  809. getTeamBaseInfo({ musicGroupId: this.$route.query.id }).then(res => {
  810. if (res.code == 200) {
  811. this.baseInfo = res.data;
  812. this.$emit("getBaseInfo", this.baseInfo);
  813. localStorage.setItem("payMusicBase", JSON.stringify(this.baseInfo));
  814. } else {
  815. localStorage.removeItem("payMusicBase");
  816. }
  817. });
  818. }
  819. },
  820. changePaymentType(val) {
  821. this.paymentType = val;
  822. },
  823. newUserPay() {
  824. let query = this.$route.query;
  825. this.$router.push({
  826. path: "/business/studentPaySet",
  827. query: { ...query, payUserType: "STUDENT" }
  828. });
  829. // 判断一下乐团是课程缴费 还是会员缴费 且乐团状态为创建缴费中
  830. // if (
  831. // this.baseInfo?.musicGroup?.courseViewType == 2 &&
  832. // this.team_status == "DRAFT"
  833. // ) {
  834. // this.payFormType = "user";
  835. // this.isNew = true;
  836. // this.activeRow = null;
  837. // this.memberVisible = true;
  838. // } else {
  839. // this.payFormType = "user";
  840. // this.isNew = true;
  841. // this.activeRow = null;
  842. // this.userVisible = true;
  843. // }
  844. },
  845. newSchoolPay() {
  846. let query = this.$route.query;
  847. this.$router.push(
  848. {
  849. path: "/business/studentPaySet",
  850. query: { ...query, payUserType: "SCHOOL" }
  851. },
  852. route => {
  853. route.meta.title = "学校缴费设置";
  854. }
  855. );
  856. },
  857. newGoodsPay() {
  858. let query = this.$route.query;
  859. this.$router.push(
  860. {
  861. path: "/business/goodsPaySet",
  862. query: { ...query, payUserType: "SCHOOL" }
  863. },
  864. route => {
  865. route.meta.title = "商品采购设置";
  866. }
  867. );
  868. },
  869. getList() {
  870. let musicGroupId = this.$route.query.id;
  871. return getAuditList({
  872. page: this.rules.page,
  873. rows: this.rules.limit,
  874. musicGroupId: musicGroupId,
  875. payUserType: this.searchForm.payUserType,
  876. paymentType: this.searchForm.paymentType
  877. }).then(res => {
  878. if (res.code == 200) {
  879. this.rules.total = res.data.total;
  880. this.tableList = res.data.rows;
  881. }
  882. });
  883. // 请求乐团状态
  884. },
  885. paymentPatternChange(val) {
  886. // if (val === 2) {
  887. // this.payForm.paymentValidEndDate = null
  888. // }
  889. },
  890. onCreateQRCode(row) {
  891. // 生成报名二维码
  892. this.qrcodeStatus = true;
  893. this.codeUrl =
  894. vaildStudentUrl() +
  895. "/#/musicGroupRenew?calenderId=" +
  896. row.id +
  897. "&id=" +
  898. this.$route.query.id;
  899. },
  900. chioseStudent(val) {
  901. this.chioseStudentList = val;
  902. },
  903. newPay() {
  904. this.diTitle = "新增缴费";
  905. this.isNew = true;
  906. this.payVisible = true;
  907. },
  908. resetPay(row) {
  909. this.diTitle = "修改缴费";
  910. if (
  911. row.paymentType == "MUSIC_APPLY" ||
  912. row.paymentType == "MUSIC_RENEW" ||
  913. row.paymentType == "ADD_COURSE"
  914. ) {
  915. this.payFormType = row.payUserType === "SCHOOL" ? "school" : "user";
  916. this.isNew = false;
  917. this.activeRow = row;
  918. let query = this.$route.query;
  919. this.$router.push({
  920. path: "/business/studentPaySet",
  921. query: { ...query, payUserType: row.payUserType, calenderId: row.id }
  922. });
  923. // 跳转新接口
  924. // this.memberVisible = true;
  925. }
  926. // 判断一下 是不是云收费团 且是乐团报名缴费
  927. },
  928. async revoke(row) {
  929. try {
  930. await this.$confirm("是否撤回此缴费项目的审批?", "提示", {
  931. confirmButtonText: "确定",
  932. cancelButtonText: "取消",
  933. type: "warning"
  934. });
  935. const res = await revokeMusicGroupPaymentCalender({
  936. batchNo: row.batchNo
  937. });
  938. this.$message.success("取消审批成功");
  939. this.getList();
  940. this.getTeamInfo();
  941. } catch {}
  942. },
  943. changeActive(val) {
  944. if (this.$listeners.changeActive) {
  945. this.$listeners.changeActive(val);
  946. }
  947. },
  948. async chioseStudentSubmited() {
  949. try {
  950. await this.$confirm("缴费创建完成, 是否立即排课?", "提示", {
  951. confirmButtonText: "确定",
  952. cancelButtonText: "取消",
  953. type: "warning"
  954. });
  955. if (this.$listeners.changeActive) {
  956. this.$listeners.changeActive({
  957. name: "5"
  958. });
  959. }
  960. } catch (error) {}
  961. },
  962. detelePay(row) {
  963. let id = row.id;
  964. this.$confirm(`确定删除该缴费周期?`, "提示", {
  965. confirmButtonText: "确定",
  966. cancelButtonText: "取消",
  967. type: "warning"
  968. })
  969. .then(() => {
  970. delMusicGroupPaymentCalender({ id }).then(res => {
  971. if (res.code == 200) {
  972. this.$message.success("删除成功");
  973. this.getList();
  974. }
  975. });
  976. })
  977. .catch(() => {});
  978. },
  979. lookList(row) {
  980. this.viewDetail = row;
  981. this.itemsVisible = true;
  982. },
  983. lookDetail(row) {
  984. let query = this.$route.query;
  985. this.$route.query.paymentId = row.id;
  986. this.viewDetail = row;
  987. if (row.payUserType === "SCHOOL") {
  988. this.reviewVisible = true;
  989. } else {
  990. this.$router.push({ path: "/business/strudentPayInfo", query });
  991. // this.$router.push({ path: "/teamPayInfo/strudentPayInfo", query });
  992. }
  993. },
  994. async submitAudit() {
  995. try {
  996. await this.$confirm("确定提交审核?", "提示", {
  997. confirmButtonText: "确定",
  998. cancelButtonText: "取消",
  999. type: "warning"
  1000. });
  1001. const res = await musicGroupAuditing({ musicGroupId: this.teamid });
  1002. this.$message.success("提交成功");
  1003. this.$store.dispatch("delVisitedViews", this.$route);
  1004. this.$router.push({
  1005. path: "/teamList"
  1006. });
  1007. } catch (e) {
  1008. console.log(e);
  1009. }
  1010. },
  1011. extendTime() {
  1012. this.extendPaymentStatus = true;
  1013. },
  1014. onExtendPayment(formName) {
  1015. this.$refs[formName].validate(valid => {
  1016. if (valid) {
  1017. extensionPayment({
  1018. musicGroupId: this.$route.query.id,
  1019. expireDate: this.extendForm.expireDate
  1020. }).then(res => {
  1021. if (res.code == 200) {
  1022. this.$message.success("延长缴费成功");
  1023. this.extendPaymentStatus = false;
  1024. this.getList();
  1025. } else {
  1026. this.$message.error(res.msg);
  1027. }
  1028. });
  1029. }
  1030. });
  1031. },
  1032. // setStudentPay () {
  1033. // let query = this.$route.query;
  1034. // this.$router.push({ path: "/business/studentPayBase", query });
  1035. // },
  1036. async removeBatchNo(row) {
  1037. try {
  1038. await this.$confirm("是否确认删除该缴费批次?", "提示", {
  1039. type: "warning"
  1040. });
  1041. await musicGroupPaymentCalenderDelByBatchNo({ batchNo: row.batchNo });
  1042. this.$message.success("删除成功");
  1043. this.getList();
  1044. } catch (error) {}
  1045. },
  1046. newPayInfo() {
  1047. this.$refs["payForm"].validate(res => {
  1048. if (res) {
  1049. /**
  1050. * payForm: {
  1051. startPaymentDate: null,
  1052. deadlinePaymentDate: null,
  1053. type: null,
  1054. memo: null
  1055. },
  1056. *
  1057. */
  1058. this.chioseStudentVisible = true;
  1059. return;
  1060. }
  1061. });
  1062. },
  1063. submitNewPay() {
  1064. if (this.chioseStudentList.length < 1) {
  1065. this.$message.error("请至少选择一名学员");
  1066. return;
  1067. }
  1068. let obj = {};
  1069. obj.userIdList = this.chioseStudentList.map(stu => {
  1070. return stu.userId;
  1071. });
  1072. obj.batchNo = this.batchNo;
  1073. musicGroupPaymentCalenderDetailBatchAdd(obj).then(res => {
  1074. if (res.code == 200) {
  1075. this.$message.success("添加成功");
  1076. this.$refs.setStudentFee.clearTable();
  1077. this.payVisible = false;
  1078. this.chioseStudentVisible = false;
  1079. // this.$refs.payItems?.getList()
  1080. this.getList();
  1081. }
  1082. });
  1083. },
  1084. resetPayDate() {
  1085. resetMusicGroupPaymentCalender({
  1086. id: this.activeRow.id,
  1087. startPaymentDate: this.payForm.startPaymentDate,
  1088. deadlinePaymentDate: this.payForm.deadlinePaymentDate,
  1089. paymentValidStartDate: this.payForm.paymentValidStartDate
  1090. ? dayjs(this.payForm.paymentValidStartDate).format("YYYY-MM-DD")
  1091. : this.payForm.paymentValidStartDate,
  1092. paymentValidEndDate: this.payForm.paymentValidEndDate
  1093. ? dayjs(this.payForm.paymentValidEndDate).format("YYYY-MM-DD")
  1094. : this.payForm.paymentValidEndDate,
  1095. paymentPattern: this.payForm.paymentPattern
  1096. }).then(res => {
  1097. if (res.code == 200) {
  1098. this.$message.success("修改成功");
  1099. this.payVisible = false;
  1100. this.getTeamInfo();
  1101. this.getList();
  1102. }
  1103. });
  1104. },
  1105. changeStartTime(val) {
  1106. this.payForm.deadlinePaymentDate = this.dateAddDays(val, 3);
  1107. },
  1108. changePaymentStartTime(val) {
  1109. this.payForm.paymentValidEndDate = null;
  1110. },
  1111. dateAddDays(dataStr, dayCount) {
  1112. let strdate = dataStr; //日期字符串
  1113. let isdate = new Date(strdate.replace(/-/g, "/")); //把日期字符串转换成日期格式
  1114. isdate = new Date((isdate / 1000 + 86400 * dayCount) * 1000); //日期加1天
  1115. let pdate =
  1116. isdate.getFullYear() +
  1117. "-" +
  1118. (isdate.getMonth() + 1) +
  1119. "-" +
  1120. isdate.getDate(); //把日期格式转换成字符串
  1121. return pdate;
  1122. },
  1123. beginDate(end) {
  1124. return {
  1125. firstDayOfWeek: 1,
  1126. disabledDate(time) {
  1127. if (end) {
  1128. return new Date(end).getTime() - 86400000 >= time.getTime();
  1129. } else {
  1130. return time.getTime() + 86400000 < Date.now();
  1131. //开始时间不选时,结束时间最大值小于等于当天
  1132. }
  1133. }
  1134. };
  1135. },
  1136. search() {
  1137. this.rules.page = 1;
  1138. this.getList();
  1139. },
  1140. onReSet() {
  1141. this.searchForm = { payUserType: null };
  1142. },
  1143. openChioseStudent(row) {
  1144. this.chioseStudentVisible = true;
  1145. this.batchNo = row.batchNo;
  1146. this.musicGroupPaymentCalenderId = row.id;
  1147. },
  1148. async payedSubmited(data) {
  1149. try {
  1150. await this.getList();
  1151. this.getTeamInfo();
  1152. // if (!this.isNewGropu) {
  1153. // this.chioseStudentVisible = true;
  1154. // if (data) {
  1155. // this.musicGroupPaymentCalenderId = data.musicGroupPaymentCalenderId;
  1156. // }
  1157. // }
  1158. } catch (error) {}
  1159. },
  1160. async onPreview(row) {
  1161. // 开始预览
  1162. this.dialogCalenderId = row.id;
  1163. const musicGroupId = this.$route.query.id;
  1164. findMusicGroupSubjectInfo({ musicGroupId: musicGroupId }).then(res => {
  1165. if (res.code == 200) {
  1166. this.dialogSubjectList = res.data.musicGroupSubjectPlans;
  1167. // 默认预览第一个
  1168. if (this.dialogSubjectList.length <= 0) {
  1169. this.$message.error("请先设置声部信息");
  1170. return;
  1171. }
  1172. this.activeName = this.dialogSubjectList[0].subjectId.toString();
  1173. this.dialogSubjectVisible = true;
  1174. } else {
  1175. this.$message.warning("没有可预览的声部");
  1176. }
  1177. });
  1178. },
  1179. approval() {
  1180. // 审核通过 验证商品
  1181. // let flag = this.$refs.soundSetCore.checkSubmit()
  1182. // if (!flag) return;
  1183. this.$confirm(`是否审核通过?`, "提示", {
  1184. confirmButtonText: "确定",
  1185. cancelButtonText: "取消",
  1186. type: "warning"
  1187. })
  1188. .then(() => {
  1189. auditSuccess({ musicGroupId: this.teamid }).then(res => {
  1190. if (res.code == 200) {
  1191. this.$message.success("审核通过");
  1192. this.$store.dispatch("delVisitedViews", this.$route);
  1193. this.$router.push({
  1194. path: "/teamList",
  1195. query: { search: this.Fsearch, rules: this.Frules }
  1196. });
  1197. }
  1198. });
  1199. })
  1200. .catch(() => {});
  1201. },
  1202. refuse() {
  1203. // auditFailed
  1204. this.$prompt("请输入拒绝原因", "提示", {
  1205. confirmButtonText: "确定",
  1206. cancelButtonText: "取消"
  1207. }).then(({ value }) => {
  1208. // 点击确认 值是value
  1209. if (!value) {
  1210. this.$message.error("请输入驳回原因");
  1211. return;
  1212. } else {
  1213. auditFailed({ musicGroupId: this.teamid, memo: value }).then(res => {
  1214. if (res.code == 200) {
  1215. this.$message.success("已拒绝");
  1216. this.$store.dispatch("delVisitedViews", this.$route);
  1217. this.$router.push({
  1218. path: "/teamList",
  1219. query: { search: this.Fsearch, rules: this.Frules }
  1220. });
  1221. }
  1222. });
  1223. }
  1224. });
  1225. },
  1226. applyDate() {
  1227. let self = this;
  1228. return {
  1229. firstDayOfWeek: 1,
  1230. disabledDate(time) {
  1231. return time.getTime() + 86400000 < new Date().getTime();
  1232. }
  1233. };
  1234. }
  1235. },
  1236. watch: {
  1237. chioseStudentVisible() {
  1238. this.chioseStudentList = [];
  1239. },
  1240. payVisible(val) {
  1241. if (!val) {
  1242. this.payForm = {
  1243. startPaymentDate: null,
  1244. paymentPattern: null,
  1245. paymentValidStartDate: null,
  1246. paymentValidEndDate: null,
  1247. type: null,
  1248. memo: null,
  1249. deadlinePaymentDate: null
  1250. };
  1251. this.$refs["payForm"].resetFields();
  1252. }
  1253. }
  1254. }
  1255. };
  1256. </script>
  1257. <style lang="scss" scoped>
  1258. .topWrap {
  1259. display: flex;
  1260. flex-direction: row;
  1261. justify-content: flex-start;
  1262. div {
  1263. margin-right: 10px;
  1264. }
  1265. }
  1266. .left-code,
  1267. .right-code {
  1268. // width: 50%;
  1269. // float: left;
  1270. h2 {
  1271. font-size: 18px;
  1272. text-align: center;
  1273. padding-bottom: 8px;
  1274. }
  1275. .qrcode {
  1276. display: flex;
  1277. flex-direction: column;
  1278. align-items: center;
  1279. img {
  1280. width: 200px;
  1281. height: 200px;
  1282. margin: 0 auto;
  1283. }
  1284. }
  1285. .code-url {
  1286. font-size: 18px;
  1287. text-align: center;
  1288. padding: 15px 15px 0 15px;
  1289. }
  1290. }
  1291. .previewContainer {
  1292. ::v-deep .el-dialog__body {
  1293. padding: 0;
  1294. }
  1295. }
  1296. .subjectPreview {
  1297. ::v-deep .el-dialog__body {
  1298. padding: 30px 0 0;
  1299. }
  1300. }
  1301. </style>