resetPayList.vue 40 KB

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