teamBaseInfo.vue 40 KB

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