teamBaseInfo.vue 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323
  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" 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. createTeam,
  364. } from "@/api/buildTeam";
  365. import { findTechnician } from "@/api/repairManager";
  366. import dayjs from "dayjs";
  367. import merge from "webpack-merge";
  368. import { queryByOrganId, getSchool } from "@/api/systemManage";
  369. import qrCode from "@/components/QrCode/index";
  370. import { classStatus } from "@/utils/searchArray";
  371. import { vaildStudentUrl, vaildTeacherUrl } from "@/utils/validate";
  372. import mergeMusic from "../components/merge-music";
  373. export default {
  374. components: {
  375. mergeMusic,
  376. qrCode,
  377. },
  378. name: "teamBaseInfo",
  379. props: ["getTeamList"],
  380. data() {
  381. return {
  382. classStatus,
  383. organId: null,
  384. topFrom: {
  385. type: "", // 收费类型
  386. section: "", //所属分部
  387. courseViewType: "", // 收费模式
  388. school: "", // 合作单位
  389. teacher: "", // 乐团主管
  390. name: "", //乐团名称
  391. boss: "", // 运营主管
  392. time: "", // 报名截止时间
  393. startClass: [], // 招生年级起始
  394. address: "", // 教学地点
  395. salary: "", // 收费模式
  396. head: "",
  397. isClass: false, //是否为课堂课
  398. startTime: "",
  399. feeType: null,
  400. paymentPattern: "", // 缴费方式
  401. paymentValid: [], // 缴费有效期
  402. paymentValidStartDate: null, // 缴费有效期开始
  403. paymentValidEndDate: null, // 缴费有效期结束
  404. ownershipType: "OWN", // 合作机构类型
  405. repairUserId: null, // 维修技师
  406. },
  407. baseInfo: {},
  408. money: 580,
  409. orderInfo: {
  410. marketPrice: 0, // 原价总金额
  411. referencePrice: 0, // 现价总金额
  412. }, // 金额列表,金额计算
  413. sectionList: [], // 分部列表
  414. typeList: [], // 收费类型列表
  415. cooperationList: [], // 教学点列表
  416. teacherList: [], // 获取老师列表
  417. educationList: [], // 乐团主管
  418. bossList: [],
  419. addList: [], // 教学地点列表
  420. activeTeam: [],
  421. teamid: "",
  422. teamStatus: "",
  423. isInit: false,
  424. technician: [],
  425. basdisabled: false,
  426. // 整合报名中
  427. paymentExpireDate: "",
  428. applyExpireDate: null,
  429. mergeVisible: false,
  430. team_status: "",
  431. paymentNum: 0,
  432. paymentStatus: false,
  433. paymentForm: {
  434. paymentExpireDate: null,
  435. // feeType: null
  436. },
  437. paymentRules: {
  438. paymentExpireDate: [
  439. { required: true, message: "请设置缴费截止日期", trigger: "blur" },
  440. ],
  441. },
  442. extendForm: {
  443. expireDate: null,
  444. },
  445. extendRule: {
  446. expireDate: [
  447. { required: true, message: "请选择延长时间", trigger: "change" },
  448. ],
  449. },
  450. isPay: false,
  451. extendPaymentStatus: false, // 延长缴费
  452. codeStatus: false,
  453. qrCodeUrl: null,
  454. codeTitle: null,
  455. teamid: "",
  456. };
  457. },
  458. created() {},
  459. mounted() {
  460. if (this.$route.query.type == "newTeam") {
  461. this.onReset();
  462. }
  463. this.init();
  464. },
  465. activated() {
  466. if (
  467. (this.teamid && this.teamid != this.$route.query.id) ||
  468. this.teamStatus != this.$route.query.type
  469. ) {
  470. this.init();
  471. }
  472. if (this.$route.query.clear == "true") {
  473. this.onReset();
  474. }
  475. if (this.teamStatus == "newTeam") {
  476. this.$store.dispatch("buildIndex", 0);
  477. }
  478. if (this.teamStatus != "newTeam") {
  479. this.$store.dispatch("draftIndex", 0);
  480. }
  481. this.teamStatus = this.$route.query.type;
  482. if (
  483. this.teamStatus == "look" ||
  484. this.teamStatus == "teamAudit" ||
  485. this.teamStatus == "feeAudit" ||
  486. this.teamStatus == "APPLY" ||
  487. this.teamStatus == "PAY"
  488. ) {
  489. this.basdisabled = true;
  490. } else {
  491. this.basdisabled = false;
  492. }
  493. },
  494. deactivated() {
  495. console.log("laile");
  496. },
  497. beforeDestroy() {
  498. // this.topFrom.paymentExpireDate = this.paymentExpireDate;
  499. this.setStore();
  500. },
  501. methods: {
  502. setStore() {
  503. if (this.teamid) {
  504. localStorage.setItem(
  505. `${this.teamid}base`,
  506. JSON.stringify(this.topFrom)
  507. );
  508. } else {
  509. localStorage.setItem(`newTeambase`, JSON.stringify(this.topFrom));
  510. }
  511. },
  512. //|| this.teamStatus === 'teamAudit'
  513. isNotEditing: function () {
  514. return !(
  515. this.teamStatus === "teamDraft" ||
  516. this.teamStatus === "newTeam" ||
  517. this.teamStatus === "teamList"
  518. );
  519. },
  520. changeFeeType(val) {},
  521. changePaymentValidStartDate(val) {
  522. if (val) {
  523. this.$set(this.topFrom, "paymentValidEndDate", "");
  524. }
  525. },
  526. changePaymentPattern(val) {
  527. // if (val === 2) {
  528. // // this.topFrom.paymentValidStartDate = null
  529. // this.$set(this.topFrom, 'paymentValidEndDate', '')
  530. // }
  531. },
  532. beginDate(end) {
  533. return {
  534. firstDayOfWeek: 1,
  535. disabledDate(time) {
  536. if (end) {
  537. return new Date(end).getTime() - 86400000 >= time.getTime();
  538. } else {
  539. return time.getTime() + 86400000 < Date.now();
  540. //开始时间不选时,结束时间最大值小于等于当天
  541. }
  542. },
  543. };
  544. },
  545. init() {
  546. this.isInit = true;
  547. if (this.$route.query.id) {
  548. this.teamid = this.$route.query.id;
  549. }
  550. this.teamStatus = this.$route.query.type;
  551. this.team_status = this.$route.query.team_status;
  552. // if (this.teamStatus == "newTeam") {
  553. // this.$store.dispatch("buildIndex", 0);
  554. // }
  555. // if (this.teamStatus != "newTeam") {
  556. // this.$store.dispatch("draftIndex", 0);
  557. // }
  558. // 传过来的乐团信息
  559. this.activeTeam = this.getTeamList;
  560. if (
  561. this.teamStatus == "look" ||
  562. this.teamStatus == "teamAudit" ||
  563. this.teamStatus == "feeAudit" ||
  564. this.teamStatus == "teamCanceled"
  565. ) {
  566. this.basdisabled = true;
  567. } else {
  568. this.basdisabled = false;
  569. }
  570. if (this.$route.query.id) {
  571. // 单团修改
  572. this.teamid = this.$route.query.id;
  573. let sotrage = JSON.parse(
  574. localStorage.getItem(`${this.$route.query.id}base`)
  575. );
  576. if (!sotrage?.section) {
  577. getTeamBaseInfo({ musicGroupId: this.teamid }).then((res) => {
  578. if (res.code == 200) {
  579. // if (this.$listeners.getBaseInfo) {
  580. // this.$listeners.getBaseInfo(res.data);
  581. // }
  582. // 头部
  583. this.setBase(res);
  584. // // 循环缴费月
  585. // this.payList.chioseMonth = res.data.months;
  586. if (res.data.musicGroup.organId) {
  587. // 获取员工
  588. this.getBaseList(res.data.musicGroup.organId);
  589. }
  590. this.$emit("getBaseInfo", res.data);
  591. }
  592. });
  593. } else {
  594. this.topFrom = sotrage;
  595. // this.applyExpireDate = sotrage.time;
  596. // this.paymentExpireDate = Storage.paymentExpireDate;
  597. if (this.topFrom?.section) {
  598. // 获取员工
  599. this.getBaseList(this.topFrom.section);
  600. }
  601. }
  602. } else {
  603. // 如果是新建团
  604. let sotrage = JSON.parse(localStorage.getItem(`newTeambase`));
  605. sotrage ? (this.topFrom = sotrage) : this.topFrom;
  606. if (this.topFrom?.section) {
  607. // 获取员工
  608. this.getBaseList(this.topFrom.section);
  609. }
  610. }
  611. this.getStudentStatus();
  612. this.$emit("getName", this.topFrom?.name);
  613. getEmployeeOrgan().then((res) => {
  614. if (res.code == 200) {
  615. this.sectionList = res.data;
  616. }
  617. });
  618. // 2.获取收费类型选项卡
  619. getType({ rows: 1000 }).then((res) => {
  620. if (res.code == 200) {
  621. this.typeList = res.data.rows;
  622. }
  623. });
  624. // 缓存设置时的状态
  625. },
  626. changeSection(val) {
  627. // 修改分部的时候 重置运营主管 重置乐团主管 重置乐队指导 合作单位 教学点
  628. this.topFrom.teacher = "";
  629. this.topFrom.boss = "";
  630. this.topFrom.head = "";
  631. this.topFrom.school = "";
  632. this.topFrom.address = "";
  633. // 发请求 根据分部id 查询所有员工
  634. this.getBaseList(val);
  635. },
  636. async getBaseList(val) {
  637. // 合作单位
  638. queryByOrganId({ organId: val }).then((res) => {
  639. if (res.code == 200) {
  640. this.cooperationList = res.data;
  641. }
  642. });
  643. // 教学点=>学校
  644. getSchool({ organId: val }).then((res) => {
  645. if (res.code == 200) {
  646. this.addList = res.data;
  647. }
  648. });
  649. // 获取维修技师
  650. findTechnician().then((res) => {
  651. if (res.code == 200) {
  652. this.technician = res.data;
  653. }
  654. });
  655. // 获取乐团主管
  656. try {
  657. const ruselt = await findUserByRole({
  658. organId: val,
  659. employeeRole: "EDUCATION",
  660. });
  661. this.educationList = ruselt.data;
  662. } catch (e) {
  663. console.log(e);
  664. }
  665. // 获取运营主管
  666. try {
  667. const ruselt = await findUserByRole({
  668. organId: val,
  669. employeeRole: "TEAM_TEACHER",
  670. });
  671. this.bossList = ruselt.data;
  672. } catch (e) {
  673. console.log(e);
  674. }
  675. // 获取指导老师
  676. getTeacher({ organId: val }).then((res) => {
  677. if (res.code == 200) {
  678. this.teacherList = res.data;
  679. }
  680. });
  681. },
  682. chioseSchool(val) {},
  683. gotoNext() {
  684. this.$refs["topinfo"].validate((valid, object) => {
  685. if (!valid) {
  686. this.$message.error("请填写建团必要参数");
  687. } else {
  688. // 判断一下是否勾选了课程类型而没有输入金额
  689. // 验证通过
  690. this.$store.dispatch("topinfo", this.topFrom);
  691. // if (this.teamStatus == "teamDraft") {
  692. // // 获取数据提交
  693. // } else {
  694. // // this.resetSubmit();
  695. // console.log("来了");
  696. // this.$router.push({
  697. // query: merge(this.$route.query, { tabrouter: 2 }),
  698. // });
  699. // }
  700. this.resetSubmit();
  701. }
  702. });
  703. },
  704. resetSubmit() {
  705. this.$refs["topinfo"].validate((valid, object) => {
  706. if (!valid) {
  707. this.$message.error("请填写必要参数");
  708. } else {
  709. let status = null;
  710. // 1.resetTeam 乐团修改
  711. // 2.newTeam 新建乐团
  712. // 3.teamList 跨团修改
  713. // 4.teamDraft 乐团草稿
  714. switch (this.teamStatus) {
  715. case "resetTeam": {
  716. status = "PROGRESS";
  717. break;
  718. }
  719. case "newTeam": {
  720. status = "DRAFT";
  721. break;
  722. }
  723. case "teamList": {
  724. status = null;
  725. break;
  726. }
  727. case "teamDraft": {
  728. status = "DRAFT";
  729. break;
  730. }
  731. }
  732. let obj = {};
  733. // topFrom.ownershipType
  734. // 修改 合并对象
  735. obj.musicGroup = {
  736. settlementType: this.topFrom.salary,
  737. applyExpireDate: dayjs(this.topFrom.time).format(
  738. "YYYY-MM-DD HH:mm:ss"
  739. ),
  740. chargeTypeId: this.topFrom.type,
  741. cooperationOrganId: this.topFrom.school,
  742. courseViewType: this.topFrom.courseViewType,
  743. teamTeacherId: this.topFrom.boss,
  744. educationalTeacherId: this.topFrom.teacher,
  745. enrollClasses: this.topFrom.startClass.join(","),
  746. name: this.topFrom.name,
  747. paymentPattern: this.topFrom.paymentPattern,
  748. paymentValidStartDate: this.topFrom.paymentValidStartDate
  749. ? dayjs(this.topFrom.paymentValidStartDate).format("YYYY-MM-DD")
  750. : this.topFrom.paymentValidStartDate,
  751. paymentValidEndDate: this.topFrom.paymentValidEndDate
  752. ? dayjs(this.topFrom.paymentValidEndDate).format("YYYY-MM-DD")
  753. : this.topFrom.paymentValidEndDate,
  754. organId: this.topFrom.section,
  755. // paymentMonths:obj.months 有待确认
  756. schoolId: this.topFrom.address,
  757. id: this.teamid,
  758. directorUserId: this.topFrom.head,
  759. isClassroomLessons: this.topFrom.isClass,
  760. status,
  761. expectStartGroupDate: this.topFrom.startTime,
  762. ownershipType: this.topFrom.ownershipType,
  763. repairUserId: this.topFrom.repairUserId || null,
  764. feeType: this.topFrom.feeType,
  765. };
  766. // obj.musicGroupPaymentEntities = [];
  767. // createTeam
  768. if (this.teamStatus != "newTeam") {
  769. resetTeamBaseInfo(obj).then((res) => {
  770. if (res.code == 200) {
  771. this.setStore();
  772. if (this.teamStatus == "teamDraft") {
  773. this.$message.success("保存成功");
  774. // 跳到第二页
  775. } else {
  776. this.$message.success("修改乐团成功");
  777. // this.$router.push({ path: '/teamLists', query: { id: this.teamid, name: this.topFrom.name } })
  778. }
  779. this.init();
  780. }
  781. });
  782. } else {
  783. // 发送建团申请 成功后跳到第二页
  784. createTeam(obj).then((res) => {
  785. if (res.code == 200) {
  786. // this.$message.success('建团成功,请设置声部信息')
  787. // this.$emit("chiosetab", 1);
  788. const h = this.$createElement;
  789. this.$msgbox({
  790. title: "提示",
  791. message: h("p", null, [
  792. h("p", null, "新建乐团成功 "),
  793. h("p", null, "请设置声部信息"),
  794. ]),
  795. type: "warning",
  796. confirmButtonText: "是",
  797. cancelButtonText: "否",
  798. showCancelButton: true,
  799. customClass: "messageBox-prompt-test",
  800. })
  801. .then(() => {
  802. this.$router.push({
  803. query: merge(
  804. this.$route.query,
  805. {
  806. type: "teamDraft",
  807. id: res.data,
  808. team_status: "DRAFT",
  809. },
  810. ),
  811. },(router) => {
  812. console.log(router)
  813. router.meta.title = "乐团编辑中";
  814. });
  815. this.$emit("getName", this.topFrom.name);
  816. this.$emit("handleClick", { name: "2" });
  817. })
  818. .catch(() => {
  819. this.$router.push({
  820. query: merge(this.$route.query, {
  821. type: "teamDraft",
  822. id: res.data,
  823. team_status: "DRAFT",
  824. }),
  825. });
  826. this.$emit("getName", this.topFrom.name);
  827. this.init();
  828. });
  829. }
  830. });
  831. }
  832. // 发请求
  833. }
  834. });
  835. },
  836. changeApplyTime(val) {
  837. this.$set(this.topFrom, "paymentValidStartDate", "");
  838. this.$set(this.topFrom, "paymentValidEndDate", "");
  839. // this.topFrom.paymentValidStartDate = ''
  840. // this.topFrom.paymentValidEndDate = ''
  841. },
  842. onReset() {
  843. this.topFrom = {
  844. type: "", // 收费类型
  845. section: "", //所属分部
  846. school: "", // 合作单位
  847. courseViewType: "",
  848. teacher: "", // 乐团主管
  849. name: "", //乐团名称
  850. boss: "", // 运营主管
  851. time: "", // 报名截止时间
  852. startClass: [], // 招生年级起始
  853. paymentValid: [], // 缴费有效期时间起始
  854. address: "", // 教学地点
  855. salary: "", // 收费模式
  856. head: "",
  857. paymentPattern: "", // 缴费方式
  858. isClass: false, //是否为课堂课
  859. startTime: "",
  860. ownershipType: "OWN", // 合作机构类型
  861. feeType: null,
  862. };
  863. this.$refs["topinfo"].resetFields();
  864. },
  865. onGoHome() {
  866. if (this.paymentNum <= 0) {
  867. this.$message.error("当前缴费人数为0,无法开团");
  868. return;
  869. }
  870. this.$confirm(`是否确认开团?`, "提示", {
  871. confirmButtonText: "确定",
  872. cancelButtonText: "取消",
  873. type: "warning",
  874. })
  875. .then(() => {
  876. musicGroupFound({
  877. musicGroupId: this.$route.query.id,
  878. }).then((res) => {
  879. if (res.code == 200) {
  880. // let query = this.$route.query;
  881. // this.$message.success("开启成功");
  882. // this.$router.push({
  883. // path: "/teamList",
  884. // query: {
  885. // ...query,
  886. // },
  887. // });
  888. this.onCancel();
  889. }
  890. });
  891. })
  892. .catch(() => {});
  893. },
  894. payStart() {
  895. this.paymentStatus = true;
  896. },
  897. getStudentStatus() {
  898. let obj = {
  899. musicGroupId: this.teamid,
  900. page: 1,
  901. rows: 9999,
  902. };
  903. if (!this.teamid) return;
  904. getStudentList(obj).then((res) => {
  905. if (res.code == 200) {
  906. res.data.rows.forEach((item) => {
  907. // '未开启缴费', '开启缴费', '已缴费'
  908. if (item.paymentStatus == 2) {
  909. this.paymentNum += 1;
  910. }
  911. });
  912. // this.rightList = res.data.rows;
  913. // this.rules.total = res.data.total;
  914. // return res;
  915. }
  916. });
  917. },
  918. payDate() {
  919. let self = this;
  920. return {
  921. firstDayOfWeek: 1,
  922. disabledDate(time) {
  923. if (self.applyExpireDate) {
  924. return (
  925. time.getTime() <=
  926. new Date(self.applyExpireDate.replace(/-/g, "/")).getTime()
  927. );
  928. } else {
  929. return false;
  930. }
  931. },
  932. };
  933. },
  934. onStartPayment(formName) {
  935. // 开启缴费
  936. this.$refs[formName].validate((valid) => {
  937. if (valid) {
  938. musicGroupOpenPay({
  939. musicGroupId: this.teamid,
  940. expireDate: this.paymentForm.paymentExpireDate,
  941. // feeType: this.paymentForm.feeType
  942. }).then((res) => {
  943. if (res.code == 200) {
  944. this.$message.success("开启成功");
  945. this.paymentStatus = false;
  946. this.$store.dispatch("delVisitedViews", this.$route);
  947. this.$router.push({ path: "/teamList" });
  948. // this.$router.push({
  949. // path: "/business/resetTeaming",
  950. // query: {
  951. // status: "PAY",
  952. // id: this.$route.query.id,
  953. // name: this.$route.query.name,
  954. // },
  955. // });
  956. // this.team_status = "PAY";
  957. // this.paymentExpireDate = this.paymentForm.paymentExpireDate;
  958. // this.getList();
  959. }
  960. });
  961. } else {
  962. return false;
  963. }
  964. });
  965. },
  966. applyDate() {
  967. let self = this;
  968. return {
  969. firstDayOfWeek: 1,
  970. disabledDate(time) {
  971. if (self.paymentExpireDate) {
  972. return (
  973. time.getTime() >
  974. new Date(self.paymentExpireDate.replace(/-/g, "/")).getTime()
  975. );
  976. } else {
  977. return false;
  978. }
  979. },
  980. };
  981. },
  982. extendTime(isPay) {
  983. this.isPay = isPay;
  984. if (isPay) {
  985. // 点击的延长缴费
  986. this.extendForm.expireDate = this.paymentExpireDate;
  987. } else {
  988. // 点击的延长报名
  989. this.extendForm.expireDate = this.applyExpireDate;
  990. }
  991. this.extendPaymentStatus = true;
  992. },
  993. onExtendPayment(formName, isPay) {
  994. this.$refs[formName].validate((valid) => {
  995. if (valid) {
  996. if (!isPay) {
  997. extensionApplyExpire({
  998. musicGroupId: this.teamid,
  999. expireDate: this.extendForm.expireDate,
  1000. }).then((res) => {
  1001. if (res.code == 200) {
  1002. this.$message.success("延长报名成功");
  1003. this.extendPaymentStatus = false;
  1004. getTeamBaseInfo({ musicGroupId: this.teamid }).then((res) => {
  1005. if (res.code == 200) {
  1006. this.applyExpireDate = res.data.musicGroup.applyExpireDate;
  1007. this.setBase(res);
  1008. }
  1009. });
  1010. } else {
  1011. this.$message.error(res.msg);
  1012. }
  1013. });
  1014. } else {
  1015. extensionPayment({
  1016. musicGroupId: this.teamid,
  1017. expireDate: this.extendForm.expireDate,
  1018. }).then((res) => {
  1019. if (res.code == 200) {
  1020. this.$message.success("延长缴费成功");
  1021. this.extendPaymentStatus = false;
  1022. getTeamBaseInfo({ musicGroupId: this.teamid }).then((res) => {
  1023. if (res.code == 200) {
  1024. this.paymentExpireDate =
  1025. res.data.musicGroup.paymentExpireDate;
  1026. }
  1027. });
  1028. } else {
  1029. this.$message.error(res.msg);
  1030. }
  1031. });
  1032. }
  1033. }
  1034. });
  1035. },
  1036. onCreateQRCode(type) {
  1037. // 生成报名二维码
  1038. let id = this.teamid;
  1039. this.codeStatus = true;
  1040. if (type == "payment") {
  1041. this.codeTitle = "学员报名连接";
  1042. this.qrCodeUrl = vaildStudentUrl() + "/#/login?musicGroupId=" + id;
  1043. } else if (type == "detail") {
  1044. let teamName = this.$route.query.name;
  1045. this.codeTitle = "报名缴费详情";
  1046. this.qrCodeUrl =
  1047. vaildTeacherUrl() +
  1048. "/#/order?musicGroupId=" +
  1049. id +
  1050. "&musicGroupName=" +
  1051. teamName;
  1052. } else if (type == "rePayment") {
  1053. this.codeTitle = "学生报名链接(无乐器)";
  1054. this.qrCodeUrl =
  1055. vaildStudentUrl() + "/#/login?musicGroupId=" + id + "&instrument=1";
  1056. }
  1057. },
  1058. gotoStudentList() {
  1059. this.$router.push({
  1060. query: merge(this.$route.query, { tabrouter: 7 }),
  1061. });
  1062. // this.$router.replace({query:{...this.$route.query,tabrouter:7}})
  1063. },
  1064. setBase(res) {
  1065. this.topFrom.name = res.data.musicGroup.name;
  1066. this.$emit("getName", this.topFrom.name);
  1067. this.topFrom.time = res.data.musicGroup.applyExpireDate;
  1068. this.topFrom.type = res.data.musicGroup.chargeTypeId;
  1069. this.topFrom.startClass = res.data.musicGroup.enrollClasses.split(",");
  1070. this.topFrom.paymentPattern = res.data.musicGroup.paymentPattern;
  1071. this.topFrom.paymentValidStartDate =
  1072. res.data.musicGroup.paymentValidStartDate;
  1073. this.topFrom.paymentValidEndDate =
  1074. res.data.musicGroup.paymentValidEndDate;
  1075. this.topFrom.section = res.data.musicGroup.organId;
  1076. this.topFrom.courseViewType = res.data.musicGroup.courseViewType;
  1077. this.topFrom.school = res.data.musicGroup.cooperationOrganId;
  1078. this.topFrom.teacher = res.data.musicGroup.educationalTeacherId;
  1079. this.topFrom.boss = res.data.musicGroup.teamTeacherId;
  1080. this.topFrom.address = res.data.musicGroup.schoolId;
  1081. this.topFrom.salary = res.data.musicGroup.settlementType;
  1082. this.topFrom.head = res.data.musicGroup.directorUserId
  1083. ? res.data.musicGroup.directorUserId
  1084. : null;
  1085. this.topFrom.isClass = res.data.musicGroup.isClassroomLessons;
  1086. this.topFrom.startTime = res.data.musicGroup.expectStartGroupDate;
  1087. this.topFrom.ownershipType = res.data.musicGroup.ownershipType;
  1088. this.topFrom.repairUserId = res.data.musicGroup.repairUserId
  1089. ? res.data.musicGroup.repairUserId
  1090. : null;
  1091. this.topFrom.feeType = res.data.musicGroup.feeType
  1092. ? res.data.musicGroup.feeType
  1093. : null;
  1094. this.paymentExpireDate = res.data.musicGroup.paymentExpireDate;
  1095. this.applyExpireDate = res.data.musicGroup.applyExpireDate;
  1096. },
  1097. },
  1098. computed: {
  1099. startClassString() {
  1100. return this.topFrom.startClass
  1101. .map((item) => {
  1102. for (let i in this.classStatus) {
  1103. if (item == this.classStatus[i].value) {
  1104. return this.classStatus[i].label;
  1105. }
  1106. }
  1107. // return this.classStatus[item]
  1108. })
  1109. .join(",");
  1110. },
  1111. showNext() {
  1112. const teamStatus = this.teamStatus;
  1113. return (
  1114. teamStatus == "newTeam" ||
  1115. teamStatus == "teamDraft" ||
  1116. teamStatus == "teamAudit" ||
  1117. teamStatus == "feeAudit"
  1118. );
  1119. },
  1120. },
  1121. };
  1122. </script>
  1123. <style lang="scss" >
  1124. .messageBox-prompt-test {
  1125. .el-message-box__status {
  1126. top: 25% !important;
  1127. }
  1128. }
  1129. .base-container {
  1130. overflow: auto;
  1131. // display: flex;
  1132. // flex-direction: row;
  1133. // justify-content: flex-start;
  1134. // flex-wrap: nowrap;
  1135. font-size: 14px;
  1136. color: #444;
  1137. // width: fill-available;
  1138. .banseLeft {
  1139. // width: 1050px;
  1140. .head {
  1141. height: 48px;
  1142. line-height: 48px;
  1143. background-color: #edeef0;
  1144. font-size: 14px;
  1145. font-weight: bold;
  1146. color: #444;
  1147. padding: 0 11px;
  1148. margin-bottom: 20px;
  1149. }
  1150. .noMargin.head {
  1151. margin-bottom: 0;
  1152. }
  1153. .num {
  1154. padding: 15px 11px;
  1155. }
  1156. .checkRow {
  1157. min-width: 1200px;
  1158. padding-left: 28px;
  1159. display: flex;
  1160. flex-direction: row;
  1161. justify-content: flex-start;
  1162. flex-wrap: nowrap;
  1163. overflow: auto;
  1164. .el-checkbox {
  1165. line-height: 72px;
  1166. width: 120px;
  1167. }
  1168. .inputWrap {
  1169. line-height: 72px;
  1170. font-size: 14px;
  1171. color: #777;
  1172. margin-left: 65px;
  1173. input {
  1174. // border: none;
  1175. // width: 80px;
  1176. // margin-right: 10px;
  1177. // outline: none;
  1178. }
  1179. }
  1180. .inputWrap.rightFirst {
  1181. margin-left: 245px;
  1182. }
  1183. .textWrap {
  1184. display: flex;
  1185. flex-direction: row;
  1186. justify-content: flex-start;
  1187. font-size: 14px;
  1188. color: #777;
  1189. align-items: center;
  1190. span {
  1191. color: #f97215;
  1192. }
  1193. }
  1194. .selectWrap {
  1195. font-size: 14px;
  1196. padding-top: 5px;
  1197. margin-left: 100px;
  1198. margin-right: 52px;
  1199. .rowSelect {
  1200. .el-input__inner {
  1201. min-height: 69px;
  1202. }
  1203. }
  1204. }
  1205. .chioseList {
  1206. display: flex;
  1207. flex-direction: row;
  1208. justify-content: flex-start;
  1209. align-items: center;
  1210. font-size: 14px;
  1211. color: #777;
  1212. margin-left: 64px;
  1213. .chioseItem {
  1214. width: 80px;
  1215. height: 30px;
  1216. border-radius: 15px;
  1217. border: 1px solid #979797;
  1218. margin-right: 10px;
  1219. line-height: 30px;
  1220. text-align: center;
  1221. cursor: pointer;
  1222. }
  1223. .chioseItem.active {
  1224. background-color: #14928a;
  1225. border: 1px solid #14928a;
  1226. color: #fff;
  1227. }
  1228. }
  1229. // &:nth-child(even) {
  1230. // background-color: #c6cbd4;
  1231. // input {
  1232. // background-color: #c6cbd4;
  1233. // }
  1234. // }
  1235. }
  1236. }
  1237. .btnWrap {
  1238. margin-top: 30px;
  1239. }
  1240. .el-checkbox__input.is-checked + .el-checkbox__label {
  1241. color: #606266;
  1242. }
  1243. .subTitle {
  1244. // width: 1203px;
  1245. height: 40px;
  1246. line-height: 40px;
  1247. background-color: #fefceb;
  1248. padding: 0 25px;
  1249. box-sizing: border-box;
  1250. font-size: 16px;
  1251. color: #474747;
  1252. margin-bottom: 20px;
  1253. }
  1254. .chioseWrap {
  1255. margin-bottom: 30px;
  1256. display: flex;
  1257. flex-direction: row;
  1258. padding: 0 25px;
  1259. p {
  1260. width: 80px;
  1261. font-size: 14px;
  1262. // margin-right: 30px;
  1263. }
  1264. }
  1265. .classCheckBox {
  1266. margin-right: 10px;
  1267. }
  1268. }
  1269. </style>
  1270. <style scoped lang="scss">
  1271. /deep/.el-date-editor {
  1272. width: 180px !important;
  1273. }
  1274. /deep/.el-checkbox {
  1275. margin-left: 15px !important;
  1276. }
  1277. /deep/.el-input {
  1278. position: relative;
  1279. font-size: 14px;
  1280. display: inline-block;
  1281. width: 180px;
  1282. }
  1283. input[disabled] {
  1284. background-color: #fff;
  1285. border-color: #b3b3b3;
  1286. color: #606266;
  1287. }
  1288. /deep/.el-radio-button__orig-radio:checked + .el-radio-button__inner {
  1289. background-color: rgb(19, 129, 122);
  1290. border-color: rgb(19, 129, 122);
  1291. // -webkit-box-shadow: -1px 0 0 0 rgb (19, 129, 122);
  1292. box-shadow: -1px 0 0 rgb(19, 129, 122);
  1293. color: #fff;
  1294. outline: none;
  1295. }
  1296. /deep/.el-radio-button__inner {
  1297. &:hover {
  1298. color: rgb(19, 129, 122);
  1299. }
  1300. outline: none;
  1301. }
  1302. /deep/.el-radio-button:focus:not(.is-focus):not(:active):not(.is-disabled) {
  1303. -webkit-box-shadow: none;
  1304. box-shadow: none;
  1305. }
  1306. </style>