teamBaseInfo.vue 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251
  1. <template>
  2. <div class="base-container">
  3. <div class="banseLeft">
  4. <div class="head">乐团基本信息:</div>
  5. <!-- <div class="num">乐团编号:dywh01</div> -->
  6. <el-form
  7. :model="topFrom"
  8. :inline="true"
  9. ref="topinfo"
  10. label-width="120px"
  11. style="margin-left: 11px"
  12. >
  13. <el-form-item
  14. label="所属分部"
  15. prop="section"
  16. :rules="[{ required: true, message: '所属分部不能为空' }]"
  17. >
  18. <el-select
  19. v-model.trim="topFrom.section"
  20. filterable
  21. :disabled="basdisabled"
  22. @change="changeSection"
  23. clearable
  24. >
  25. <el-option
  26. v-for="(item, index) in sectionList"
  27. :key="index"
  28. :label="item.name"
  29. :value="item.id"
  30. ></el-option>
  31. </el-select>
  32. </el-form-item>
  33. <el-form-item
  34. label="收费类型"
  35. prop="type"
  36. :rules="[{ required: true, message: '收费类型不能为空' }]"
  37. >
  38. <el-select
  39. v-model.trim="topFrom.type"
  40. filterable
  41. :disabled="basdisabled"
  42. clearable
  43. >
  44. <el-option
  45. v-for="(item, index) in typeList"
  46. :key="index"
  47. :label="item.name"
  48. :value="item.id"
  49. ></el-option>
  50. </el-select>
  51. </el-form-item>
  52. <el-form-item
  53. label="收费模式"
  54. prop="courseViewType"
  55. :rules="[{ required: true, message: '收费模式不能为空' }]"
  56. >
  57. <el-select
  58. v-model.trim="topFrom.courseViewType"
  59. filterable
  60. :disabled="basdisabled"
  61. clearable
  62. >
  63. <el-option label="课程收费" :value="0"></el-option>
  64. <el-option label="系统收费" :value="1"></el-option>
  65. </el-select>
  66. </el-form-item>
  67. <el-form-item
  68. label="合作单位"
  69. prop="school"
  70. :rules="[{ required: true, message: '合作单位不能为空' }]"
  71. >
  72. <el-select
  73. v-model.trim="topFrom.school"
  74. :disabled="!topFrom.section || basdisabled"
  75. @change="chioseSchool"
  76. filterable
  77. clearable
  78. >
  79. <el-option
  80. v-for="(item, index) in cooperationList"
  81. :key="index"
  82. :label="item.name"
  83. :value="item.id"
  84. ></el-option>
  85. </el-select>
  86. </el-form-item>
  87. <el-form-item
  88. label="教学地点"
  89. prop="address"
  90. :rules="[{ required: true, message: '教学地点不能为空' }]"
  91. >
  92. <template #label>
  93. <p style="position: relative; display: inline-block">
  94. 教学地点
  95. <el-tooltip placement="top" popper-class="mTooltip">
  96. <div slot="content">
  97. 如果已生成课表,则会修改未上课时的教学点
  98. </div>
  99. <i
  100. class="el-icon-question"
  101. style="font-size: 18px; color: #f56c6c"
  102. ></i>
  103. </el-tooltip>
  104. </p>
  105. </template>
  106. <el-select
  107. v-model.trim="topFrom.address"
  108. filterable
  109. clearable
  110. :disabled="!topFrom.section || basdisabled"
  111. >
  112. <el-option
  113. v-for="(item, index) in addList"
  114. :key="index"
  115. :label="item.name"
  116. :value="item.id"
  117. ></el-option>
  118. </el-select>
  119. </el-form-item>
  120. <el-form-item
  121. label="乐团名称"
  122. prop="name"
  123. :rules="[{ required: true, message: '乐团名称不能为空' }]"
  124. >
  125. <el-input
  126. placeholder="请输入乐团名称"
  127. v-model.trim="topFrom.name"
  128. :disabled="basdisabled"
  129. ></el-input>
  130. </el-form-item>
  131. <el-form-item
  132. label="运营主管"
  133. prop="boss"
  134. :rules="[{ required: true, message: '运营主管不能为空' }]"
  135. >
  136. <el-select
  137. v-model.trim="topFrom.boss"
  138. :disabled="!topFrom.section || basdisabled"
  139. filterable
  140. clearable
  141. >
  142. <el-option
  143. v-for="(item) in bossList"
  144. :key="item.userId"
  145. :label="item.realName"
  146. :value="item.userId"
  147. ></el-option>
  148. </el-select>
  149. </el-form-item>
  150. <el-form-item
  151. label="乐团主管"
  152. prop="teacher"
  153. :rules="[{ required: true, message: '乐团主管不能为空' }]"
  154. >
  155. <el-select
  156. v-model.trim="topFrom.teacher"
  157. :disabled="!topFrom.section || basdisabled"
  158. filterable
  159. clearable
  160. >
  161. <el-option
  162. v-for="(item, index) in educationList"
  163. :key="index"
  164. :label="item.realName"
  165. :value="item.userId"
  166. ></el-option>
  167. </el-select>
  168. </el-form-item>
  169. <el-form-item label="维修技师" prop="repairUserId">
  170. <el-select
  171. v-model.trim="topFrom.repairUserId"
  172. :disabled="!topFrom.section || basdisabled"
  173. filterable
  174. clearable
  175. >
  176. <el-option
  177. v-for="(item, index) in technician"
  178. :key="index"
  179. :label="item.userName"
  180. :value="item.userId"
  181. ></el-option>
  182. </el-select>
  183. </el-form-item>
  184. <!-- <el-form-item
  185. label="预报名截止时间"
  186. prop="time"
  187. :rules="[{ required: true, message: '请输入预报名截止时间' }]"
  188. >
  189. <el-date-picker
  190. v-model.trim="topFrom.time"
  191. :disabled="basdisabled"
  192. type="date"
  193. value-format="yyyy-MM-dd"
  194. :picker-options="beginDate()"
  195. placeholder="选择日期"
  196. ></el-date-picker>
  197. </el-form-item> -->
  198. <el-form-item
  199. label="报名截止时间"
  200. prop="time"
  201. :rules="[{ required: true, message: '请输入报名截止时间' }]"
  202. >
  203. <el-date-picker
  204. v-model.trim="topFrom.time"
  205. :disabled="basdisabled"
  206. type="date"
  207. value-format="yyyy-MM-dd"
  208. :picker-options="beginDate()"
  209. placeholder="选择日期"
  210. ></el-date-picker>
  211. </el-form-item>
  212. <el-form-item
  213. label="预计开团时间"
  214. prop="startTime"
  215. :rules="[{ required: true, message: '请输入预计开团时间' }]"
  216. >
  217. <el-date-picker
  218. v-model.trim="topFrom.startTime"
  219. :disabled="basdisabled"
  220. type="date"
  221. value-format="yyyy-MM-dd"
  222. :picker-options="beginDate()"
  223. placeholder="选择日期"
  224. ></el-date-picker>
  225. </el-form-item>
  226. <!-- <el-form-item label="招生年级" v-if="basdisabled">
  227. <el-input
  228. placeholder="请输入招生年级"
  229. v-model.trim="startClassString"
  230. :disabled="basdisabled"
  231. ></el-input> -->
  232. <!-- <el-tooltip
  233. class="item"
  234. effect="dark"
  235. :content="startClassString"
  236. placement="top-start"
  237. >
  238. <div style="width: 180px; overflow: hidden">
  239. {{ startClassString }}
  240. </div>
  241. </el-tooltip> -->
  242. <!-- </el-form-item> -->
  243. <!-- <el-form-item
  244. label="招生年级"
  245. v-else
  246. prop="startClass"
  247. :rules="[{ required: true, message: '请选择招生年纪' }]"
  248. >
  249. <el-select
  250. placeholder="起始年级"
  251. clearable
  252. multiple
  253. collapse-tags
  254. filterable
  255. v-model.trim="topFrom.startClass"
  256. >
  257. <el-option
  258. v-for="item in classStatus"
  259. :value="item.value"
  260. :label="item.label"
  261. :key="item.value"
  262. ></el-option>
  263. </el-select>
  264. </el-form-item> -->
  265. <el-form-item
  266. label="课酬结算标准"
  267. :rules="[{ required: true, message: '请选择课酬结算标准' }]"
  268. prop="salary"
  269. >
  270. <el-select
  271. v-model.trim="topFrom.salary"
  272. clearable
  273. :disabled="basdisabled"
  274. filterable
  275. >
  276. <el-option label="默认课酬" value="TEACHER_DEFAULT"></el-option>
  277. <el-option label="3.0课酬" value="GRADIENT_SALARY"></el-option>
  278. <!-- <el-option label="课堂课酬" value="CLASSROOM_SALARY"></el-option> -->
  279. </el-select>
  280. </el-form-item>
  281. <el-form-item label="机构类型" prop="ownershipType">
  282. <el-select
  283. v-model.trim="topFrom.ownershipType"
  284. :disabled="basdisabled"
  285. >
  286. <el-option label="自有" value="OWN"></el-option>
  287. <el-option label="三方" value="COOPERATION"></el-option>
  288. <!-- <el-option label="租赁"
  289. value="LEASE"></el-option>-->
  290. </el-select>
  291. </el-form-item>
  292. <!-- v-if="teamStatus == 'resetTeam' || teamStatus == 'teamList'" -->
  293. <el-form-item label="乐队指导" prop="head">
  294. <el-select
  295. v-model.trim="topFrom.head"
  296. filterable
  297. :disabled="!topFrom.section || basdisabled"
  298. clearable
  299. >
  300. <el-option
  301. v-for="(item, index) in teacherList"
  302. :key="index"
  303. :label="item.realName"
  304. :value="item.id"
  305. ></el-option>
  306. </el-select>
  307. </el-form-item>
  308. <el-form-item label prop="isClass">
  309. <el-checkbox v-model.trim="topFrom.isClass" :disabled="basdisabled"
  310. >课堂课乐团</el-checkbox
  311. >
  312. </el-form-item>
  313. <br />
  314. <el-form-item label="" v-if="teamStatus == 'teamDraft'">
  315. <p style="color: red; padding-left: 50px">
  316. 修改【收费类型】会重置乐团声部与缴费信息
  317. </p>
  318. </el-form-item>
  319. </el-form>
  320. <div class="btnWrap">
  321. <!-- <div
  322. class="nextBtn"
  323. v-if="teamStatus == 'resetTeam'"
  324. v-permission="{
  325. child: 'musicGroup/update',
  326. parent: '/resetTeaming/teamBaseInfo',
  327. }"
  328. @click="resetSubmit"
  329. >
  330. 修改
  331. </div> -->
  332. <!-- 审批或者草稿的下一步 -->
  333. <div class="nextBtn" @click="gotoNext(1)" v-if="!basdisabled">保存</div>
  334. <!-- <div
  335. class="nextBtn"
  336. @click="
  337. () => {
  338. this.$router.push({
  339. query: merge(this.$route.query, { tabrouter: 2 }),
  340. });
  341. }
  342. "
  343. v-if="teamStatus == 'teamCanceled'"
  344. >
  345. 下一步
  346. </div> -->
  347. </div>
  348. </div>
  349. </div>
  350. </template>
  351. <script>
  352. import {
  353. getType,
  354. getTeamBaseInfo,
  355. resetTeamBaseInfo,
  356. getEmployeeOrgan,
  357. getStudentList,
  358. musicGroupOpenPay,
  359. extensionPayment,
  360. extensionApplyExpire,
  361. findUserByRole,
  362. getTeacher
  363. } from "@/api/buildTeam";
  364. import { findTechnician } from "@/api/repairManager";
  365. import dayjs from "dayjs";
  366. import merge from "webpack-merge";
  367. import {
  368. queryEmployByOrganId,
  369. queryByOrganId,
  370. getSchool,
  371. } from "@/api/systemManage";
  372. import qrCode from "@/components/QrCode/index";
  373. import { classStatus } from "@/utils/searchArray";
  374. import { vaildStudentUrl, vaildTeacherUrl } from "@/utils/validate";
  375. import mergeMusic from "../components/merge-music";
  376. export default {
  377. components: {
  378. mergeMusic,
  379. qrCode,
  380. },
  381. name: "teamBaseInfo",
  382. props: ["getTeamList"],
  383. data() {
  384. return {
  385. classStatus,
  386. organId: null,
  387. topFrom: {
  388. type: "", // 收费类型
  389. section: "", //所属分部
  390. courseViewType: "", // 收费模式
  391. school: "", // 合作单位
  392. teacher: "", // 乐团主管
  393. name: "", //乐团名称
  394. boss: "", // 运营主管
  395. time: "", // 报名截止时间
  396. startClass: [], // 招生年级起始
  397. address: "", // 教学地点
  398. salary: "", // 收费模式
  399. head: "",
  400. isClass: false, //是否为课堂课
  401. startTime: "",
  402. feeType: null,
  403. paymentPattern: "", // 缴费方式
  404. paymentValid: [], // 缴费有效期
  405. paymentValidStartDate: null, // 缴费有效期开始
  406. paymentValidEndDate: null, // 缴费有效期结束
  407. ownershipType: "OWN", // 合作机构类型
  408. repairUserId: null, // 维修技师
  409. },
  410. baseInfo: {},
  411. money: 580,
  412. orderInfo: {
  413. marketPrice: 0, // 原价总金额
  414. referencePrice: 0, // 现价总金额
  415. }, // 金额列表,金额计算
  416. sectionList: [], // 分部列表
  417. typeList: [], // 收费类型列表
  418. cooperationList: [], // 教学点列表
  419. teacherList: [], // 获取老师列表
  420. educationList:[], // 乐团主管
  421. bossList:[],
  422. addList: [], // 教学地点列表
  423. activeTeam: [],
  424. teamid: "",
  425. teamStatus: "",
  426. isInit: false,
  427. technician: [],
  428. basdisabled: false,
  429. // 整合报名中
  430. paymentExpireDate: "",
  431. applyExpireDate:null,
  432. mergeVisible: false,
  433. team_status: "",
  434. paymentNum: 0,
  435. paymentStatus: false,
  436. paymentForm: {
  437. paymentExpireDate: null,
  438. // feeType: null
  439. },
  440. paymentRules: {
  441. paymentExpireDate: [
  442. { required: true, message: "请设置缴费截止日期", trigger: "blur" },
  443. ],
  444. },
  445. extendForm: {
  446. expireDate: null,
  447. },
  448. extendRule: {
  449. expireDate: [
  450. { required: true, message: "请选择延长时间", trigger: "change" },
  451. ],
  452. },
  453. isPay: false,
  454. extendPaymentStatus: false, // 延长缴费
  455. codeStatus: false,
  456. qrCodeUrl: null,
  457. codeTitle: null,
  458. };
  459. },
  460. created() {},
  461. mounted() {
  462. if (this.$route.query.id) {
  463. this.teamid = this.$route.query.id;
  464. }
  465. this.teamStatus = this.$route.query.type;
  466. this.team_status = this.$route.query.team_status;
  467. console.log(this.team_status);
  468. if (this.$route.query.type == "newTeam") {
  469. this.onReset();
  470. }
  471. this.init();
  472. },
  473. activated() {
  474. if (
  475. (this.teamid && this.teamid != this.$route.query.id) ||
  476. this.teamStatus != this.$route.query.type
  477. ) {
  478. this.init();
  479. }
  480. if (this.$route.query.clear == "true") {
  481. this.onReset();
  482. }
  483. if (this.teamStatus == "newTeam") {
  484. this.$store.dispatch("buildIndex", 0);
  485. }
  486. if (this.teamStatus != "newTeam") {
  487. this.$store.dispatch("draftIndex", 0);
  488. }
  489. this.teamStatus = this.$route.query.type;
  490. if (
  491. this.teamStatus == "look" ||
  492. this.teamStatus == "teamAudit" ||
  493. this.teamStatus == "feeAudit" ||
  494. this.teamStatus == "APPLY" ||
  495. this.teamStatus == "PAY"
  496. ) {
  497. this.basdisabled = true;
  498. } else {
  499. this.basdisabled = false;
  500. }
  501. },
  502. deactivated() {},
  503. beforeDestroy() {
  504. this.topFrom.paymentExpireDate = this.paymentExpireDate;
  505. console.log( this.topFrom.paymentExpireDate )
  506. sessionStorage.setItem(`${this.teamid}base`, JSON.stringify(this.topFrom));
  507. },
  508. methods: {
  509. //|| this.teamStatus === 'teamAudit'
  510. isNotEditing: function () {
  511. return !(
  512. this.teamStatus === "teamDraft" ||
  513. this.teamStatus === "newTeam" ||
  514. this.teamStatus === "teamList"
  515. );
  516. },
  517. changeFeeType(val) {},
  518. changePaymentValidStartDate(val) {
  519. if (val) {
  520. this.$set(this.topFrom, "paymentValidEndDate", "");
  521. }
  522. },
  523. changePaymentPattern(val) {
  524. // if (val === 2) {
  525. // // this.topFrom.paymentValidStartDate = null
  526. // this.$set(this.topFrom, 'paymentValidEndDate', '')
  527. // }
  528. },
  529. beginDate(end) {
  530. return {
  531. firstDayOfWeek: 1,
  532. disabledDate(time) {
  533. if (end) {
  534. return new Date(end).getTime() - 86400000 >= time.getTime();
  535. } else {
  536. return time.getTime() + 86400000 < Date.now();
  537. //开始时间不选时,结束时间最大值小于等于当天
  538. }
  539. },
  540. };
  541. },
  542. init() {
  543. this.isInit = true;
  544. this.teamStatus = this.$route.query.type;
  545. if (this.teamStatus == "newTeam") {
  546. this.$store.dispatch("buildIndex", 0);
  547. }
  548. if (this.teamStatus != "newTeam") {
  549. this.$store.dispatch("draftIndex", 0);
  550. }
  551. // 传过来的乐团信息
  552. this.activeTeam = this.getTeamList;
  553. if (
  554. this.teamStatus == "look" ||
  555. this.teamStatus == "teamAudit" ||
  556. this.teamStatus == "feeAudit" ||
  557. this.teamStatus == "teamCanceled"
  558. ) {
  559. this.basdisabled = true;
  560. } else {
  561. this.basdisabled = false;
  562. }
  563. if (this.$route.query.id) {
  564. // 单团修改
  565. this.teamid = this.$route.query.id;
  566. let sotrage = JSON.parse(
  567. sessionStorage.getItem(`${this.$route.query.id}base`)
  568. );
  569. if (!sotrage?.section) {
  570. getTeamBaseInfo({ musicGroupId: this.teamid }).then((res) => {
  571. if (res.code == 200) {
  572. // if (this.$listeners.getBaseInfo) {
  573. // this.$listeners.getBaseInfo(res.data);
  574. // }
  575. // 头部
  576. this.setBase(res)
  577. // // 循环缴费月
  578. // this.payList.chioseMonth = res.data.months;
  579. if (res.data.musicGroup.organId) {
  580. // 获取员工
  581. this.getBaseList(res.data.musicGroup.organId)
  582. }
  583. this.$emit("getBaseInfo", res.data);
  584. }
  585. });
  586. } else {
  587. this.topFrom = sotrage;
  588. this.applyExpireDate = sotrage.time
  589. this.paymentExpireDate = Storage.paymentExpireDate
  590. console.log( sotrage,this.applyExpireDate,this.paymentExpireDate)
  591. if (this.topFrom.section) {
  592. // 获取员工
  593. this.getBaseList(this.topFrom.section)
  594. }
  595. }
  596. }
  597. this.getStudentStatus();
  598. this.$emit("getName", this.topFrom.name);
  599. getEmployeeOrgan().then((res) => {
  600. if (res.code == 200) {
  601. this.sectionList = res.data;
  602. }
  603. });
  604. // 2.获取收费类型选项卡
  605. getType({ rows: 1000 }).then((res) => {
  606. if (res.code == 200) {
  607. this.typeList = res.data.rows;
  608. }
  609. });
  610. // 缓存设置时的状态
  611. },
  612. changeSection(val) {
  613. // 修改分部的时候 重置运营主管 重置乐团主管 重置乐队指导 合作单位 教学点
  614. this.topFrom.teacher = "";
  615. this.topFrom.boss = "";
  616. this.topFrom.head = "";
  617. this.topFrom.school = "";
  618. this.topFrom.address = "";
  619. // 发请求 根据分部id 查询所有员工
  620. this.getBaseList(val)
  621. },
  622. async getBaseList(val){
  623. // 合作单位
  624. queryByOrganId({ organId: val }).then((res) => {
  625. if (res.code == 200) {
  626. this.cooperationList = res.data;
  627. }
  628. });
  629. // 教学点=>学校
  630. getSchool({ organId: val }).then((res) => {
  631. if (res.code == 200) {
  632. this.addList = res.data;
  633. }
  634. });
  635. // 获取维修技师
  636. findTechnician().then((res) => {
  637. if (res.code == 200) {
  638. this.technician = res.data;
  639. }
  640. });
  641. // 获取乐团主管
  642. try {
  643. const ruselt = await findUserByRole({organId: val,employeeRole:'EDUCATION' })
  644. this.educationList = ruselt.data
  645. }catch(e){
  646. console.log(e)
  647. }
  648. // 获取运营主管
  649. try {
  650. const ruselt = await findUserByRole({organId: val,employeeRole:'TEAM_TEACHER' })
  651. this.bossList = ruselt.data
  652. }catch(e){
  653. console.log(e)
  654. }
  655. // 获取指导老师
  656. getTeacher({organId: val}).then(res=>{
  657. if(res.code == 200){
  658. this.teacherList = res.data
  659. }
  660. })
  661. },
  662. chioseSchool(val) {},
  663. gotoNext(num) {
  664. this.$refs["topinfo"].validate((valid, object) => {
  665. if (!valid) {
  666. this.$message.error("请填写建团必要参数");
  667. } else {
  668. // 判断一下是否勾选了课程类型而没有输入金额
  669. // 验证通过
  670. this.$store.dispatch("topinfo", this.topFrom);
  671. // if (this.teamStatus == "teamDraft") {
  672. // // 获取数据提交
  673. // } else {
  674. // // this.resetSubmit();
  675. // console.log("来了");
  676. // this.$router.push({
  677. // query: merge(this.$route.query, { tabrouter: 2 }),
  678. // });
  679. // }
  680. this.resetSubmit();
  681. }
  682. });
  683. },
  684. resetSubmit() {
  685. this.$refs["topinfo"].validate((valid, object) => {
  686. if (!valid) {
  687. this.$message.error("请填写必要参数");
  688. } else {
  689. let status = null;
  690. // 1.resetTeam 乐团修改
  691. // 2.newTeam 新建乐团
  692. // 3.teamList 跨团修改
  693. // 4.teamDraft 乐团草稿
  694. switch (this.teamStatus) {
  695. case "resetTeam": {
  696. status = "PROGRESS";
  697. break;
  698. }
  699. case "newTeam": {
  700. status = null;
  701. break;
  702. }
  703. case "teamList": {
  704. status = null;
  705. break;
  706. }
  707. case "teamDraft": {
  708. status = "DRAFT";
  709. break;
  710. }
  711. }
  712. let obj = {};
  713. // topFrom.ownershipType
  714. // 修改 合并对象
  715. obj.musicGroup = {
  716. settlementType: this.topFrom.salary,
  717. applyExpireDate: dayjs(this.topFrom.time).format(
  718. "YYYY-MM-DD HH:mm:ss"
  719. ),
  720. chargeTypeId: this.topFrom.type,
  721. cooperationOrganId: this.topFrom.school,
  722. courseViewType: this.topFrom.courseViewType,
  723. teamTeacherId: this.topFrom.boss,
  724. educationalTeacherId: this.topFrom.teacher,
  725. enrollClasses: this.topFrom.startClass.join(","),
  726. name: this.topFrom.name,
  727. paymentPattern: this.topFrom.paymentPattern,
  728. paymentValidStartDate: this.topFrom.paymentValidStartDate
  729. ? dayjs(this.topFrom.paymentValidStartDate).format("YYYY-MM-DD")
  730. : this.topFrom.paymentValidStartDate,
  731. paymentValidEndDate: this.topFrom.paymentValidEndDate
  732. ? dayjs(this.topFrom.paymentValidEndDate).format("YYYY-MM-DD")
  733. : this.topFrom.paymentValidEndDate,
  734. organId: this.topFrom.section,
  735. // paymentMonths:obj.months 有待确认
  736. schoolId: this.topFrom.address,
  737. id: this.teamid,
  738. directorUserId: this.topFrom.head,
  739. isClassroomLessons: this.topFrom.isClass,
  740. status,
  741. expectStartGroupDate: this.topFrom.startTime,
  742. ownershipType: this.topFrom.ownershipType,
  743. repairUserId: this.topFrom.repairUserId || null,
  744. feeType: this.topFrom.feeType,
  745. };
  746. obj.musicGroupPaymentEntities = [];
  747. // 发请求
  748. resetTeamBaseInfo(obj).then((res) => {
  749. if (res.code == 200) {
  750. if (this.teamStatus == "teamDraft") {
  751. this.$message.success("保存成功");
  752. // 跳到第二页
  753. this.$emit("chiosetab", 1);
  754. } else {
  755. this.$message.success("修改乐团成功");
  756. // this.$router.push({ path: '/business/teamDetails', query: { id: this.teamid, name: this.topFrom.name } })
  757. }
  758. this.init();
  759. }
  760. });
  761. }
  762. });
  763. },
  764. changeApplyTime(val) {
  765. this.$set(this.topFrom, "paymentValidStartDate", "");
  766. this.$set(this.topFrom, "paymentValidEndDate", "");
  767. // this.topFrom.paymentValidStartDate = ''
  768. // this.topFrom.paymentValidEndDate = ''
  769. },
  770. onReset() {
  771. this.topFrom = {
  772. type: "", // 收费类型
  773. section: "", //所属分部
  774. school: "", // 合作单位
  775. courseViewType: "",
  776. teacher: "", // 乐团主管
  777. name: "", //乐团名称
  778. boss: "", // 运营主管
  779. time: "", // 报名截止时间
  780. startClass: [], // 招生年级起始
  781. paymentValid: [], // 缴费有效期时间起始
  782. address: "", // 教学地点
  783. salary: "", // 收费模式
  784. head: "",
  785. paymentPattern: "", // 缴费方式
  786. isClass: false, //是否为课堂课
  787. startTime: "",
  788. ownershipType: "OWN", // 合作机构类型
  789. feeType: null,
  790. };
  791. this.$refs["topinfo"].resetFields();
  792. },
  793. onGoHome() {
  794. if (this.paymentNum <= 0) {
  795. this.$message.error("当前缴费人数为0,无法开团");
  796. return;
  797. }
  798. this.$confirm(`是否确认开团?`, "提示", {
  799. confirmButtonText: "确定",
  800. cancelButtonText: "取消",
  801. type: "warning",
  802. })
  803. .then(() => {
  804. musicGroupFound({
  805. musicGroupId: this.$route.query.id,
  806. }).then((res) => {
  807. if (res.code == 200) {
  808. // let query = this.$route.query;
  809. // this.$message.success("开启成功");
  810. // this.$router.push({
  811. // path: "/business/teamDetail",
  812. // query: {
  813. // ...query,
  814. // },
  815. // });
  816. this.onCancel();
  817. }
  818. });
  819. })
  820. .catch(() => {});
  821. },
  822. payStart() {
  823. this.paymentStatus = true;
  824. },
  825. getStudentStatus() {
  826. let obj = {
  827. musicGroupId: this.teamid,
  828. page: 1,
  829. rows: 9999,
  830. };
  831. getStudentList(obj).then((res) => {
  832. if (res.code == 200) {
  833. res.data.rows.forEach((item) => {
  834. // '未开启缴费', '开启缴费', '已缴费'
  835. if (item.paymentStatus == 2) {
  836. this.paymentNum += 1;
  837. }
  838. });
  839. // this.rightList = res.data.rows;
  840. // this.rules.total = res.data.total;
  841. // return res;
  842. }
  843. });
  844. },
  845. payDate() {
  846. let self = this;
  847. return {
  848. firstDayOfWeek: 1,
  849. disabledDate(time) {
  850. if (self.applyExpireDate) {
  851. return (
  852. time.getTime() <=
  853. new Date(self.applyExpireDate.replace(/-/g, "/")).getTime()
  854. );
  855. } else {
  856. return false;
  857. }
  858. },
  859. };
  860. },
  861. onStartPayment(formName) {
  862. // 开启缴费
  863. this.$refs[formName].validate((valid) => {
  864. if (valid) {
  865. musicGroupOpenPay({
  866. musicGroupId: this.teamid,
  867. expireDate: this.paymentForm.paymentExpireDate,
  868. // feeType: this.paymentForm.feeType
  869. }).then((res) => {
  870. if (res.code == 200) {
  871. this.$message.success("开启成功");
  872. this.paymentStatus = false;
  873. this.$store.dispatch("delVisitedViews", this.$route);
  874. this.$router.push({ path: "/business/teamDetail" });
  875. // this.$router.push({
  876. // path: "/business/resetTeaming",
  877. // query: {
  878. // status: "PAY",
  879. // id: this.$route.query.id,
  880. // name: this.$route.query.name,
  881. // },
  882. // });
  883. // this.team_status = "PAY";
  884. // this.paymentExpireDate = this.paymentForm.paymentExpireDate;
  885. // this.getList();
  886. }
  887. });
  888. } else {
  889. return false;
  890. }
  891. });
  892. },
  893. applyDate() {
  894. let self = this;
  895. return {
  896. firstDayOfWeek: 1,
  897. disabledDate(time) {
  898. if (self.paymentExpireDate) {
  899. return (
  900. time.getTime() >
  901. new Date(self.paymentExpireDate.replace(/-/g, "/")).getTime()
  902. );
  903. } else {
  904. return false;
  905. }
  906. },
  907. };
  908. },
  909. extendTime(isPay) {
  910. this.isPay = isPay;
  911. if (isPay) {
  912. // 点击的延长缴费
  913. this.extendForm.expireDate = this.paymentExpireDate;
  914. } else {
  915. // 点击的延长报名
  916. this.extendForm.expireDate = this.applyExpireDate;
  917. }
  918. this.extendPaymentStatus = true;
  919. },
  920. onExtendPayment(formName, isPay) {
  921. this.$refs[formName].validate((valid) => {
  922. if (valid) {
  923. if (!isPay) {
  924. extensionApplyExpire({
  925. musicGroupId: this.teamid,
  926. expireDate: this.extendForm.expireDate,
  927. }).then((res) => {
  928. if (res.code == 200) {
  929. this.$message.success("延长报名成功");
  930. this.extendPaymentStatus = false;
  931. getTeamBaseInfo({ musicGroupId: this.teamid }).then((res) => {
  932. if (res.code == 200) {
  933. this.applyExpireDate = res.data.musicGroup.applyExpireDate;
  934. this.setBase(res)
  935. }
  936. });
  937. } else {
  938. this.$message.error(res.msg);
  939. }
  940. });
  941. } else {
  942. extensionPayment({
  943. musicGroupId: this.teamid,
  944. expireDate: this.extendForm.expireDate,
  945. }).then((res) => {
  946. if (res.code == 200) {
  947. this.$message.success("延长缴费成功");
  948. this.extendPaymentStatus = false;
  949. getTeamBaseInfo({ musicGroupId: this.teamid }).then((res) => {
  950. if (res.code == 200) {
  951. this.paymentExpireDate =
  952. res.data.musicGroup.paymentExpireDate;
  953. }
  954. });
  955. } else {
  956. this.$message.error(res.msg);
  957. }
  958. });
  959. }
  960. }
  961. });
  962. },
  963. onCreateQRCode(type) {
  964. // 生成报名二维码
  965. let id = this.teamid;
  966. this.codeStatus = true;
  967. if (type == "payment") {
  968. this.codeTitle = "学员报名连接";
  969. this.qrCodeUrl = vaildStudentUrl() + "/#/login?musicGroupId=" + id;
  970. } else if (type == "detail") {
  971. let teamName = this.$route.query.name;
  972. this.codeTitle = "报名缴费详情";
  973. this.qrCodeUrl =
  974. vaildTeacherUrl() +
  975. "/#/order?musicGroupId=" +
  976. id +
  977. "&musicGroupName=" +
  978. teamName;
  979. } else if (type == "rePayment") {
  980. this.codeTitle = "学生报名链接(无乐器)";
  981. this.qrCodeUrl =
  982. vaildStudentUrl() + "/#/login?musicGroupId=" + id + "&instrument=1";
  983. }
  984. },
  985. gotoStudentList() {
  986. this.$router.push({
  987. query: merge(this.$route.query, { tabrouter: 7 }),
  988. });
  989. // this.$router.replace({query:{...this.$route.query,tabrouter:7}})
  990. },
  991. setBase(res){
  992. this.topFrom.name = res.data.musicGroup.name;
  993. this.$emit("getName", this.topFrom.name);
  994. this.topFrom.time = res.data.musicGroup.applyExpireDate;
  995. this.topFrom.type = res.data.musicGroup.chargeTypeId;
  996. this.topFrom.startClass = res.data.musicGroup.enrollClasses.split(
  997. ","
  998. );
  999. this.topFrom.paymentPattern = res.data.musicGroup.paymentPattern;
  1000. this.topFrom.paymentValidStartDate =
  1001. res.data.musicGroup.paymentValidStartDate;
  1002. this.topFrom.paymentValidEndDate =
  1003. res.data.musicGroup.paymentValidEndDate;
  1004. this.topFrom.section = res.data.musicGroup.organId;
  1005. this.topFrom.courseViewType = res.data.musicGroup.courseViewType;
  1006. this.topFrom.school = res.data.musicGroup.cooperationOrganId;
  1007. this.topFrom.teacher = res.data.musicGroup.educationalTeacherId;
  1008. this.topFrom.boss = res.data.musicGroup.teamTeacherId;
  1009. this.topFrom.address = res.data.musicGroup.schoolId;
  1010. this.topFrom.salary = res.data.musicGroup.settlementType;
  1011. this.topFrom.head = res.data.musicGroup.directorUserId
  1012. ? res.data.musicGroup.directorUserId
  1013. : null;
  1014. this.topFrom.isClass = res.data.musicGroup.isClassroomLessons;
  1015. this.topFrom.startTime = res.data.musicGroup.expectStartGroupDate;
  1016. this.topFrom.ownershipType = res.data.musicGroup.ownershipType;
  1017. this.topFrom.repairUserId = res.data.musicGroup.repairUserId
  1018. ? res.data.musicGroup.repairUserId
  1019. : null;
  1020. this.topFrom.feeType = res.data.musicGroup.feeType
  1021. ? res.data.musicGroup.feeType
  1022. : null;
  1023. this.paymentExpireDate = res.data.musicGroup.paymentExpireDate;
  1024. this.applyExpireDate = res.data.musicGroup.applyExpireDate;
  1025. }
  1026. },
  1027. computed: {
  1028. startClassString() {
  1029. return this.topFrom.startClass
  1030. .map((item) => {
  1031. for (let i in this.classStatus) {
  1032. if (item == this.classStatus[i].value) {
  1033. return this.classStatus[i].label;
  1034. }
  1035. }
  1036. // return this.classStatus[item]
  1037. })
  1038. .join(",");
  1039. },
  1040. showNext() {
  1041. const teamStatus = this.teamStatus;
  1042. return (
  1043. teamStatus == "newTeam" ||
  1044. teamStatus == "teamDraft" ||
  1045. teamStatus == "teamAudit" ||
  1046. teamStatus == "feeAudit"
  1047. );
  1048. },
  1049. },
  1050. };
  1051. </script>
  1052. <style lang="scss" >
  1053. .base-container {
  1054. overflow: auto;
  1055. // display: flex;
  1056. // flex-direction: row;
  1057. // justify-content: flex-start;
  1058. // flex-wrap: nowrap;
  1059. font-size: 14px;
  1060. color: #444;
  1061. // width: fill-available;
  1062. .banseLeft {
  1063. // width: 1050px;
  1064. .head {
  1065. height: 48px;
  1066. line-height: 48px;
  1067. background-color: #edeef0;
  1068. font-size: 14px;
  1069. font-weight: bold;
  1070. color: #444;
  1071. padding: 0 11px;
  1072. margin-bottom: 20px;
  1073. }
  1074. .noMargin.head {
  1075. margin-bottom: 0;
  1076. }
  1077. .num {
  1078. padding: 15px 11px;
  1079. }
  1080. .checkRow {
  1081. min-width: 1200px;
  1082. padding-left: 28px;
  1083. display: flex;
  1084. flex-direction: row;
  1085. justify-content: flex-start;
  1086. flex-wrap: nowrap;
  1087. overflow: auto;
  1088. .el-checkbox {
  1089. line-height: 72px;
  1090. width: 120px;
  1091. }
  1092. .inputWrap {
  1093. line-height: 72px;
  1094. font-size: 14px;
  1095. color: #777;
  1096. margin-left: 65px;
  1097. input {
  1098. // border: none;
  1099. // width: 80px;
  1100. // margin-right: 10px;
  1101. // outline: none;
  1102. }
  1103. }
  1104. .inputWrap.rightFirst {
  1105. margin-left: 245px;
  1106. }
  1107. .textWrap {
  1108. display: flex;
  1109. flex-direction: row;
  1110. justify-content: flex-start;
  1111. font-size: 14px;
  1112. color: #777;
  1113. align-items: center;
  1114. span {
  1115. color: #f97215;
  1116. }
  1117. }
  1118. .selectWrap {
  1119. font-size: 14px;
  1120. padding-top: 5px;
  1121. margin-left: 100px;
  1122. margin-right: 52px;
  1123. .rowSelect {
  1124. .el-input__inner {
  1125. min-height: 69px;
  1126. }
  1127. }
  1128. }
  1129. .chioseList {
  1130. display: flex;
  1131. flex-direction: row;
  1132. justify-content: flex-start;
  1133. align-items: center;
  1134. font-size: 14px;
  1135. color: #777;
  1136. margin-left: 64px;
  1137. .chioseItem {
  1138. width: 80px;
  1139. height: 30px;
  1140. border-radius: 15px;
  1141. border: 1px solid #979797;
  1142. margin-right: 10px;
  1143. line-height: 30px;
  1144. text-align: center;
  1145. cursor: pointer;
  1146. }
  1147. .chioseItem.active {
  1148. background-color: #14928a;
  1149. border: 1px solid #14928a;
  1150. color: #fff;
  1151. }
  1152. }
  1153. // &:nth-child(even) {
  1154. // background-color: #c6cbd4;
  1155. // input {
  1156. // background-color: #c6cbd4;
  1157. // }
  1158. // }
  1159. }
  1160. }
  1161. .btnWrap {
  1162. margin-top: 30px;
  1163. }
  1164. .el-checkbox__input.is-checked + .el-checkbox__label {
  1165. color: #606266;
  1166. }
  1167. .subTitle {
  1168. // width: 1203px;
  1169. height: 40px;
  1170. line-height: 40px;
  1171. background-color: #fefceb;
  1172. padding: 0 25px;
  1173. box-sizing: border-box;
  1174. font-size: 16px;
  1175. color: #474747;
  1176. margin-bottom: 20px;
  1177. }
  1178. .chioseWrap {
  1179. margin-bottom: 30px;
  1180. display: flex;
  1181. flex-direction: row;
  1182. padding: 0 25px;
  1183. p {
  1184. width: 80px;
  1185. font-size: 14px;
  1186. // margin-right: 30px;
  1187. }
  1188. }
  1189. .classCheckBox {
  1190. margin-right: 10px;
  1191. }
  1192. }
  1193. </style>
  1194. <style scoped lang="scss">
  1195. /deep/.el-date-editor {
  1196. width: 180px !important;
  1197. }
  1198. /deep/.el-checkbox {
  1199. margin-left: 15px !important;
  1200. }
  1201. /deep/.el-input {
  1202. position: relative;
  1203. font-size: 14px;
  1204. display: inline-block;
  1205. width: 180px;
  1206. }
  1207. input[disabled] {
  1208. background-color: #fff;
  1209. border-color: #b3b3b3;
  1210. color: #606266;
  1211. }
  1212. /deep/.el-radio-button__orig-radio:checked + .el-radio-button__inner {
  1213. background-color: rgb(19, 129, 122);
  1214. border-color: rgb(19, 129, 122);
  1215. // -webkit-box-shadow: -1px 0 0 0 rgb (19, 129, 122);
  1216. box-shadow: -1px 0 0 rgb(19, 129, 122);
  1217. color: #fff;
  1218. outline: none;
  1219. }
  1220. /deep/.el-radio-button__inner {
  1221. &:hover {
  1222. color: rgb(19, 129, 122);
  1223. }
  1224. outline: none;
  1225. }
  1226. /deep/.el-radio-button:focus:not(.is-focus):not(:active):not(.is-disabled) {
  1227. -webkit-box-shadow: none;
  1228. box-shadow: none;
  1229. }
  1230. </style>