teamBaseInfo.vue 41 KB

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