resetPayList.vue 40 KB

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