resetPayList.vue 39 KB

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