teamBaseInfo.vue 37 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075
  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 :model="topFrom"
  7. :inline="true"
  8. ref="topinfo"
  9. style="margin-left:11px;">
  10. <el-form-item label="收费类型"
  11. prop="type"
  12. :rules="[{ required: true, message: '收费类型不能为空'}]">
  13. <el-select v-model.trim="topFrom.type"
  14. filterable
  15. clearable>
  16. <el-option v-for="(item,index) in typeList"
  17. :key="index"
  18. :label="item.name"
  19. :value="item.id"></el-option>
  20. </el-select>
  21. </el-form-item>
  22. <el-form-item label="所属分部"
  23. prop="section"
  24. :rules="[{ required: true, message: '所属分部不能为空'},]">
  25. <el-select v-model.trim="topFrom.section"
  26. filterable
  27. @change="changeSection"
  28. clearable>
  29. <el-option v-for="(item,index) in sectionList"
  30. :key="index"
  31. :label="item.name"
  32. :value="item.id"></el-option>
  33. </el-select>
  34. </el-form-item>
  35. <el-form-item label="合作单位"
  36. prop="school"
  37. :rules="[{ required: true, message: '合作单位不能为空'},]">
  38. <el-select v-model.trim="topFrom.school"
  39. :disabled="!topFrom.section"
  40. @change="chioseSchool"
  41. filterable
  42. clearable>
  43. <el-option v-for="(item,index) in cooperationList"
  44. :key="index"
  45. :label="item.name"
  46. :value="item.id"></el-option>
  47. </el-select>
  48. </el-form-item>
  49. <el-form-item label="教学地点"
  50. prop="address"
  51. :rules="[{ required: true, message: '教学地点不能为空'},]">
  52. <el-select v-model.trim="topFrom.address"
  53. filterable
  54. clearable
  55. :disabled="!topFrom.section">
  56. <el-option v-for="(item,index) in addList"
  57. :key="index"
  58. :label="item.name"
  59. :value="item.id"></el-option>
  60. </el-select>
  61. </el-form-item>
  62. <el-form-item label="乐团名称"
  63. prop="name"
  64. :rules="[{ required: true, message: '乐团名称不能为空'},]">
  65. <el-input placeholder="请输入乐团名称"
  66. v-model.trim="topFrom.name"></el-input>
  67. </el-form-item>
  68. <el-form-item label="运营主管"
  69. prop="boss"
  70. :rules="[{ required: true, message: '运营主管不能为空'},]">
  71. <el-select v-model.trim="topFrom.boss"
  72. :disabled="!topFrom.section"
  73. filterable
  74. clearable>
  75. <el-option v-for="(item,index) in orgianList"
  76. :key="index"
  77. :label="item.realName"
  78. :value="item.id"></el-option>
  79. </el-select>
  80. </el-form-item>
  81. <el-form-item label="教务老师"
  82. prop="teacher"
  83. :rules="[{ required: true, message: '教务老师不能为空'},]">
  84. <el-select v-model.trim="topFrom.teacher"
  85. :disabled="!topFrom.section"
  86. filterable
  87. clearable>
  88. <el-option v-for="(item,index) in orgianList"
  89. :key="index"
  90. :label="item.realName"
  91. :value="item.id"></el-option>
  92. </el-select>
  93. </el-form-item>
  94. <el-form-item label="维修技师"
  95. prop="repairUserId"
  96. :rules="[{ required: true, message: '维修技师不能为空'},]">
  97. <el-select v-model.trim="topFrom.repairUserId"
  98. :disabled="!topFrom.section"
  99. filterable
  100. clearable>
  101. <el-option v-for="(item,index) in technician"
  102. :key="index"
  103. :label="item.userName"
  104. :value="item.userId"></el-option>
  105. </el-select>
  106. </el-form-item>
  107. <el-form-item label="报名截止时间"
  108. prop="time"
  109. :rules="[{ required: true, message: '请输入报名截止时间'},]">
  110. <el-date-picker v-model.trim="topFrom.time"
  111. style="width:100%!important"
  112. type="date"
  113. value-format="yyyy-MM-dd"
  114. placeholder="选择日期"></el-date-picker>
  115. </el-form-item>
  116. <el-form-item label="预计开团时间"
  117. prop="startTime"
  118. :rules="[{ required: true, message: '请输入预计开团时间'},]">
  119. <el-date-picker v-model.trim="topFrom.startTime"
  120. style="width:100%!important"
  121. type="date"
  122. value-format="yyyy-MM-dd"
  123. placeholder="选择日期"></el-date-picker>
  124. </el-form-item>
  125. <el-form-item label="招生年级"
  126. prop="startClass"
  127. :rules="[{ required: true, message: '请选择招生年纪'},]">
  128. <el-select placeholder="起始年级"
  129. clearable
  130. multiple
  131. collapse-tags
  132. filterable
  133. v-model.trim="topFrom.startClass">
  134. <el-option value="1"
  135. label="一年级"></el-option>
  136. <el-option value="2"
  137. label="二年级"></el-option>
  138. <el-option value="3"
  139. label="三年级"></el-option>
  140. <el-option value="4"
  141. label="四年级"></el-option>
  142. <el-option value="5"
  143. label="五年级"></el-option>
  144. <el-option value="6"
  145. label="六年级"></el-option>
  146. <el-option value="7"
  147. label="初一"></el-option>
  148. <el-option value="8"
  149. label="初二"></el-option>
  150. <el-option value="9"
  151. label="初三"></el-option>
  152. <el-option value="10"
  153. label="高一"></el-option>
  154. <el-option value="11"
  155. label="高二"></el-option>
  156. <el-option value="12"
  157. label="高三"></el-option>
  158. </el-select>
  159. </el-form-item>
  160. <el-form-item label="课酬结算标准"
  161. :rules="[{ required: true, message: '请选择课酬结算标准'},]"
  162. prop="salary">
  163. <el-select v-model.trim="topFrom.salary"
  164. clearable
  165. filterable>
  166. <el-option label="默认课酬"
  167. value="TEACHER_DEFAULT"></el-option>
  168. <el-option label="3.0课酬"
  169. value="GRADIENT_SALARY"></el-option>
  170. <!-- <el-option label="课堂课酬"
  171. value="CLASSROOM_SALARY"></el-option>-->
  172. </el-select>
  173. </el-form-item>
  174. <el-form-item label="机构类型"
  175. prop="ownershipType">
  176. <el-select v-model.trim="topFrom.ownershipType">
  177. <el-option label="自有"
  178. value="OWN"></el-option>
  179. <el-option label="三方"
  180. value="COOPERATION"></el-option>
  181. <!-- <el-option label="租赁"
  182. value="LEASE"></el-option>-->
  183. </el-select>
  184. </el-form-item>
  185. <el-form-item label="乐队指导"
  186. v-if="teamStatus=='resetTeam' || teamStatus=='teamList'"
  187. prop="head">
  188. <el-select v-model.trim="topFrom.head"
  189. filterable
  190. clearable>
  191. <el-option v-for="(item,index) in orgianList"
  192. :key="index"
  193. :label="item.realName"
  194. :value="item.id"></el-option>
  195. </el-select>
  196. </el-form-item>
  197. <el-form-item label="缴费类型"
  198. :rules="[{ required: true, message: '请选择缴费类型'}]"
  199. prop="feeType">
  200. <el-select v-model="topFrom.feeType"
  201. @change="changeFeeType">
  202. <el-option label="线上"
  203. value="ONLINE"></el-option>
  204. <el-option label="线下"
  205. value="OFFLINE"></el-option>
  206. </el-select>
  207. </el-form-item>
  208. <el-form-item label
  209. prop="isClass">
  210. <el-checkbox v-model.trim="topFrom.isClass">课堂课乐团</el-checkbox>
  211. </el-form-item>
  212. </el-form>
  213. <div class="checkList">
  214. <div class="head noMargin">课程组成形态:</div>
  215. <div class="checkRow">
  216. <el-checkbox label="乐团声部训练"
  217. v-model.trim="checkList.soundInfo.ischeck"></el-checkbox>
  218. <div class="inputWrap">
  219. 单价:
  220. <input type="text"
  221. placeholder="请输入"
  222. v-model.trim="checkList.soundInfo.value" />
  223. </div>
  224. </div>
  225. <div class="checkRow">
  226. <el-checkbox label="乐团合奏训练"
  227. v-model.trim="checkList.allInfo.ischeck"></el-checkbox>
  228. <div class="inputWrap">
  229. 单价:
  230. <input type="text"
  231. placeholder="请输入"
  232. v-model.trim="checkList.allInfo.value" />
  233. </div>
  234. </div>
  235. <div class="checkRow">
  236. <el-checkbox label="基础技能训练"
  237. v-model.trim="checkList.baseInfo.ischeck"></el-checkbox>
  238. <div class="inputWrap">
  239. 单价:
  240. <input type="number"
  241. @mousewheel.native.prevent
  242. placeholder="请输入"
  243. v-model.trim="checkList.baseInfo.value" />
  244. </div>
  245. </div>
  246. <div class="checkRow">
  247. <el-checkbox label="假期集中训练"
  248. v-model.trim="checkList.holidayInfo.ischeck"></el-checkbox>
  249. <div class="inputWrap">
  250. 单价:
  251. <input type="number"
  252. @mousewheel.native.prevent
  253. placeholder="请输入"
  254. v-model.trim="checkList.holidayInfo.value" />
  255. </div>
  256. </div>
  257. <div class="checkRow"
  258. v-if="checkList.networkInfo">
  259. <el-checkbox label="乐团网络课堂"
  260. v-model="checkList.networkInfo.ischeck"></el-checkbox>
  261. <div class="inputWrap">
  262. 单价:
  263. <input type="number"
  264. @mousewheel.native.prevent
  265. placeholder="请输入"
  266. v-model.trim="checkList.networkInfo.value" />
  267. </div>
  268. </div>
  269. <div class="checkRow">
  270. <el-checkbox label="课程提示"
  271. class="classCheckBox"
  272. v-model.trim="checkList.submit.ischeck"></el-checkbox>
  273. <div class="textWrap"
  274. v-if="checkList.submit.ischeck">
  275. <el-input type="textarea"
  276. :rows="1"
  277. style="width:500px"
  278. v-model.trim="checkList.submit.value"></el-input>
  279. </div>
  280. </div>
  281. <div class="head noMargin">付费方式:</div>
  282. <div class="checkRow">
  283. <el-checkbox label="学校"
  284. class="classCheckBox"
  285. v-model.trim="payList.school.ischeck"></el-checkbox>
  286. <div class="chioseList">
  287. <div class="chioseItem"
  288. :class="payList.school.chiose == 'ONE_OFF'?'active':''"
  289. @click="payList.school.chiose='ONE_OFF'">一次性</div>
  290. <div class="chioseItem"
  291. :class="payList.school.chiose == 'MONTHLY'?'active':''"
  292. @click="payList.school.chiose='MONTHLY'">一个月</div>
  293. <div class="chioseItem"
  294. :class="payList.school.chiose == 'TERM'?'active':''"
  295. @click="payList.school.chiose='TERM'">一学期</div>
  296. <div class="chioseItem"
  297. :class="payList.school.chiose == 'YEAR'?'active':''"
  298. @click="payList.school.chiose='YEAR'">一学年</div>
  299. </div>
  300. <div class="inputWrap">
  301. 预计收费:
  302. <input type="textarea"
  303. v-model.trim="payList.school.price"
  304. placeholder="请输入" />
  305. </div>
  306. <div class="inputWrap">
  307. 备注:
  308. <input type="textarea"
  309. v-model.trim="payList.school.value"
  310. placeholder="请输入" />
  311. </div>
  312. </div>
  313. <div class="checkRow">
  314. <el-checkbox label="公司"
  315. class="classCheckBox"
  316. v-model.trim="payList.company.ischeck"></el-checkbox>
  317. <div class="chioseList">
  318. <div class="chioseItem"
  319. :class="payList.company.chiose == 'ONE_OFF'?'active':''"
  320. @click="payList.company.chiose='ONE_OFF'">一次性</div>
  321. <div class="chioseItem"
  322. :class="payList.company.chiose == 'MONTHLY'?'active':''"
  323. @click="payList.company.chiose='MONTHLY'">一个月</div>
  324. <div class="chioseItem"
  325. :class="payList.company.chiose == 'TERM'?'active':''"
  326. @click="payList.company.chiose='TERM'">一学期</div>
  327. <div class="chioseItem"
  328. :class="payList.company.chiose == 'YEAR'?'active':''"
  329. @click="payList.company.chiose='YEAR'">一学年</div>
  330. </div>
  331. <div class="inputWrap">
  332. 预计收费:
  333. <input type="textarea"
  334. placeholder="请输入"
  335. v-model.trim="payList.company.price" />
  336. </div>
  337. <div class="inputWrap">
  338. 备注:
  339. <input type="textarea"
  340. placeholder="请输入"
  341. v-model.trim="payList.company.value" />
  342. </div>
  343. </div>
  344. <!-- <div class="checkRow"
  345. v-if='teamStatus !="resetTeam"'>
  346. <el-checkbox label="学员"
  347. class="classCheckBox"
  348. v-model.trim="payList.student.ischeck"></el-checkbox>
  349. <div class="chioseList">
  350. <div class="chioseItem"
  351. :class="payList.student.chiose == 'ONE_OFF'?'active':''"
  352. @click="payList.student.chiose='ONE_OFF'">一次性</div>
  353. <div class="chioseItem"
  354. :class="payList.student.chiose == 'loop'?'active':''"
  355. @click="payList.student.chiose='loop'">周期循环</div>
  356. </div>
  357. </div> -->
  358. <!-- <p class="subTitle"
  359. v-if="payList.student.chiose == 'loop'&&teamStatus !='resetTeam'">按月缴费时,将在所选月份的1号的前一周提醒用户缴费操作,单次的缴费金额为当前列表「预计收费」的设置金额</p>
  360. <div class="chioseWrap"
  361. v-if="payList.student.chiose == 'loop'&&teamStatus !='resetTeam'">
  362. <p>缴费月份:</p>
  363. <el-checkbox-group v-model.trim="payList.chioseMonth"
  364. fill="#14928A"
  365. text-color="#474747">
  366. <el-checkbox :label="1">一月</el-checkbox>
  367. <el-checkbox :label="2">二月</el-checkbox>
  368. <el-checkbox :label="3">三月</el-checkbox>
  369. <el-checkbox :label="4">四月</el-checkbox>
  370. <el-checkbox :label="5">五月</el-checkbox>
  371. <el-checkbox :label="6">六月</el-checkbox>
  372. <el-checkbox :label="7">七月</el-checkbox>
  373. <el-checkbox :label="8">八月</el-checkbox>
  374. <el-checkbox :label="9">九月</el-checkbox>
  375. <el-checkbox :label="10">十月</el-checkbox>
  376. <el-checkbox :label="11">十一月</el-checkbox>
  377. <el-checkbox :label="12">十二月</el-checkbox>
  378. </el-checkbox-group>
  379. </div> -->
  380. </div>
  381. <div class="btnWrap">
  382. <div class="nextBtn"
  383. v-if="teamStatus=='resetTeam'"
  384. v-permission="{child: 'musicGroup/update', parent: '/resetTeaming/teamBaseInfo'}"
  385. @click="resetSubmit">修改</div>
  386. <!-- 审批或者草稿的下一步 -->
  387. <div class="nextBtn"
  388. @click="gotoNext(1)"
  389. v-if="teamStatus=='newTeam' || teamStatus=='teamDraft'||teamStatus=='teamAudit' ">下一步</div>
  390. <!-- 跨团调整的下一步 -->
  391. <div class="nextBtn"
  392. v-if="teamStatus=='teamList'"
  393. @click="gotoNext(2)">下一步</div>
  394. </div>
  395. </div>
  396. </div>
  397. </div>
  398. </template>
  399. <script>
  400. import {
  401. getSection,
  402. getType,
  403. getCooperation,
  404. getTeacher,
  405. getAddress,
  406. getPayMaster,
  407. getPayStatus,
  408. getTeamBaseInfo,
  409. resetTeamBaseInfo,
  410. getEmployeeOrgan
  411. } from "@/api/buildTeam";
  412. import { findTechnician } from "@/api/repairManager";
  413. import {
  414. queryEmployByOrganId,
  415. queryByOrganId,
  416. getSchool
  417. } from "@/api/systemManage";
  418. import { scrollTo } from "@/utils/scroll-to";
  419. import axios from "axios";
  420. import store from "@/store";
  421. import qs from "qs";
  422. export default {
  423. name: "teamBaseInfo",
  424. props: ["getTeamList"],
  425. data () {
  426. return {
  427. organId: null,
  428. topFrom: {
  429. type: "", // 收费类型
  430. section: "", //所属分部
  431. school: "", // 合作单位
  432. teacher: "", // 教务老师
  433. name: "", //乐团名称
  434. boss: "", // 运营主管
  435. time: "", // 报名截止时间
  436. startClass: [], // 招生年级起始
  437. address: "", // 教学地点
  438. salary: "", // 收费模式
  439. head: "",
  440. isClass: false, //是否为课堂课
  441. startTime: "",
  442. feeType: null,
  443. ownershipType: "OWN", // 合作机构类型
  444. repairUserId: null, // 维修技师
  445. },
  446. checkList: {
  447. soundInfo: {
  448. // 声部
  449. ischeck: false,
  450. value: ""
  451. },
  452. allInfo: {
  453. // 合奏
  454. ischeck: false,
  455. value: ""
  456. },
  457. baseInfo: {
  458. // 基础
  459. ischeck: false,
  460. value: ""
  461. },
  462. holidayInfo: {
  463. // 假期
  464. ischeck: false,
  465. value: ""
  466. },
  467. networkInfo: {
  468. ischeck: false,
  469. value: ""
  470. },
  471. submit: {
  472. ischeck: false,
  473. value:
  474. "年度安排个月共xxx课时,课时,原价xxx元,现价xxxx元/月(约 xxxx元/课时 )"
  475. }
  476. }, // 选中的集合
  477. baseInfo: {},
  478. money: 580,
  479. orderInfo: {
  480. marketPrice: 0, // 原价总金额
  481. referencePrice: 0 // 现价总金额
  482. }, // 金额列表,金额计算
  483. sectionList: [], // 分部列表
  484. typeList: [], // 收费类型列表
  485. cooperationList: [], // 教学点列表
  486. teacherList: [], // 获取老师列表
  487. addList: [], // 教学地点列表
  488. payList: {
  489. school: {
  490. ischeck: false,
  491. value: "",
  492. price: "",
  493. chiose: ""
  494. },
  495. company: {
  496. ischeck: false,
  497. value: "",
  498. price: "",
  499. chiose: ""
  500. },
  501. student: {
  502. ischeck: true,
  503. chiose: "loop"
  504. },
  505. chioseMonth: [] // 选中的月份
  506. },
  507. activeTeam: [],
  508. teamid: "",
  509. teamStatus: "",
  510. orgianList: [],
  511. isInit: false,
  512. technician: []
  513. };
  514. },
  515. created () { },
  516. activated () {
  517. this.payList = {
  518. school: {
  519. ischeck: false,
  520. value: "",
  521. price: "",
  522. chiose: ""
  523. },
  524. company: {
  525. ischeck: false,
  526. value: "",
  527. price: "",
  528. chiose: ""
  529. },
  530. student: {
  531. ischeck: true,
  532. chiose: "loop"
  533. },
  534. chioseMonth: [] // 选中的月份
  535. }
  536. this.init();
  537. },
  538. mounted () {
  539. this.init();
  540. // this.$forceUpdate()
  541. // 获取分部下的员工
  542. },
  543. beforeDestroy () {
  544. },
  545. methods: {
  546. changeFeeType (val) {
  547. console.log(val == "ONLINE")
  548. },
  549. init () {
  550. this.isInit = true;
  551. // 分为3种 this.teamStatus
  552. // 1.resetTeam 乐团修改
  553. // 2. newTeam 新建乐团
  554. // 3.teamList 跨团修改
  555. // 4.teamDraft 乐团草稿
  556. this.teamStatus = this.$route.query.type;
  557. // 传过来的乐团信息
  558. this.activeTeam = this.getTeamList;
  559. if (
  560. this.teamStatus == "resetTeam" ||
  561. this.teamStatus == "teamDraft" ||
  562. this.teamStatus == "teamAudit"
  563. ) {
  564. // 单团修改
  565. this.teamid = this.$route.query.id;
  566. getTeamBaseInfo({ musicGroupId: this.teamid }).then(res => {
  567. if (res.code == 200) {
  568. // 头部
  569. this.topFrom.name = res.data.musicGroup.name;
  570. this.$emit('getName', this.topFrom.name)
  571. this.topFrom.time = res.data.musicGroup.applyExpireDate;
  572. this.topFrom.type = res.data.musicGroup.chargeTypeId;
  573. this.topFrom.startClass = res.data.musicGroup.enrollClasses.split(
  574. ","
  575. );
  576. this.topFrom.section = res.data.musicGroup.organId;
  577. this.topFrom.school = res.data.musicGroup.cooperationOrganId;
  578. this.topFrom.teacher = res.data.musicGroup.educationalTeacherId;
  579. this.topFrom.boss = res.data.musicGroup.teamTeacherId;
  580. this.topFrom.address = res.data.musicGroup.schoolId;
  581. this.topFrom.salary = res.data.musicGroup.settlementType;
  582. this.topFrom.head = res.data.musicGroup.directorUserId;
  583. this.topFrom.isClass = res.data.musicGroup.isClassroomLessons;
  584. this.topFrom.startTime = res.data.musicGroup.expectStartGroupDate;
  585. this.topFrom.ownershipType = res.data.musicGroup.ownershipType;
  586. this.topFrom.repairUserId = res.data.musicGroup.repairUserId ? res.data.musicGroup.repairUserId : null;
  587. this.topFrom.feeType = res.data.musicGroup.feeType ? res.data.musicGroup.feeType : null;
  588. // 课程组成形式
  589. this.checkList = JSON.parse(res.data.musicGroup.courseForm);
  590. if (this.checkList.networkInfo) {
  591. } else {
  592. this.$set(this.checkList, 'networkInfo', {
  593. ischeck: false,
  594. value: ""
  595. })
  596. }
  597. // 付费方式和周期
  598. for (let i in res.data.musicGroupPaymentEntities) {
  599. if (res.data.musicGroupPaymentEntities[i].name == "学校") {
  600. this.payList.school.ischeck = true;
  601. this.payList.school.value =
  602. res.data.musicGroupPaymentEntities[i].memo;
  603. this.payList.school.price =
  604. res.data.musicGroupPaymentEntities[i].amount;
  605. this.payList.school.chiose =
  606. res.data.musicGroupPaymentEntities[i].paymentMethod;
  607. }
  608. if (res.data.musicGroupPaymentEntities[i].name == "公司") {
  609. this.payList.company.ischeck = true;
  610. this.payList.company.value =
  611. res.data.musicGroupPaymentEntities[i].memo;
  612. this.payList.company.price =
  613. res.data.musicGroupPaymentEntities[i].amount;
  614. this.payList.company.chiose =
  615. res.data.musicGroupPaymentEntities[i].paymentMethod;
  616. }
  617. if (res.data.months.length > 0) {
  618. this.payList.student.ischeck = true;
  619. this.payList.student.chiose = "loop";
  620. this.chioseMonth = res.data.months;
  621. } else {
  622. this.payList.student.ischeck = true;
  623. this.payList.student.chiose = "ONE_OFF";
  624. }
  625. }
  626. // 循环缴费月
  627. this.payList.chioseMonth = res.data.months;
  628. if (res.data.musicGroup.organId) {
  629. // 获取员工
  630. queryEmployByOrganId({
  631. organId: res.data.musicGroup.organId,
  632. rows: 1000
  633. }).then(res => {
  634. if (res.code == 200) {
  635. this.orgianList = res.data.rows;
  636. }
  637. });
  638. // 获取合作单位
  639. queryByOrganId({ organId: res.data.musicGroup.organId }).then(
  640. res => {
  641. if (res.code == 200) {
  642. this.cooperationList = res.data;
  643. }
  644. }
  645. );
  646. // 获取教学点
  647. getSchool({ organId: res.data.musicGroup.organId }).then(res => {
  648. if (res.code == 200) {
  649. this.addList = res.data;
  650. this.isInit = false;
  651. }
  652. });
  653. // 获取维修技师
  654. findTechnician().then(res => {
  655. if (res.code == 200) {
  656. this.technician = res.data;
  657. }
  658. })
  659. }
  660. }
  661. });
  662. } else {
  663. (this.topFrom = {
  664. type: "", // 收费类型
  665. section: "", //所属分部
  666. school: "", // 合作单位
  667. teacher: "", // 教务老师
  668. name: "", //乐团名称
  669. boss: "", // 运营主管
  670. time: "", // 报名截止时间
  671. startClass: [], // 招生年级起始
  672. address: "", // 教学地点
  673. salary: "", // 收费模式
  674. head: "",
  675. isClass: false, //是否为课堂课
  676. startTime: "",
  677. ownershipType: "OWN", // 合作机构类型
  678. feeType: 'ONLINE'
  679. }),
  680. this.$refs["topinfo"].resetFields();
  681. }
  682. // 1.获取各个选项卡的数据内容
  683. // getSection({ 'delFlag': 0, 'rows': 1000 }).then(res => {
  684. // if (res.code == 200) {
  685. // this.sectionList = res.data.rows;
  686. // }
  687. // }).catch()
  688. getEmployeeOrgan().then(res => {
  689. if (res.code == 200) {
  690. this.sectionList = res.data;
  691. }
  692. });
  693. // 2.获取收费类型选项卡
  694. getType({ rows: 1000 }).then(res => {
  695. if (res.code == 200) {
  696. this.typeList = res.data.rows;
  697. }
  698. });
  699. // 3.获取合作单位选项卡
  700. // getCooperation({ 'rows': 1000, search: this.organId }).then(res => {
  701. // if (res.code == 200) {
  702. // this.cooperationList = res.data.rows;
  703. // }
  704. // })
  705. // 4.获取老师选项卡
  706. // getTeacher({ 'rows': 1000, organId: this.organId }).then(res => {
  707. // if (res.code == 200) {
  708. // this.teacherList = res.data;
  709. // }
  710. // })
  711. // 5.获取教学地点选项卡
  712. // getAddress({ 'rows': 1000, }).then(res => {
  713. // if (res.code == 200) {
  714. // this.addList = res.data.rows;
  715. // }
  716. // })
  717. // 6.默认支付主体
  718. // getPayMaster({ 'rows': 1000 }).then(res => {
  719. // if (res.code == 200) {
  720. // this.payList = res.data.map(item => {
  721. // let obj = {};
  722. // obj.id = item.id;
  723. // obj.ischios
  724. // })
  725. // }
  726. // })
  727. // 缓存设置时的状态
  728. sessionStorage.setItem("resetCode", "1");
  729. },
  730. changeSection (val) {
  731. // 修改分部的时候 重置运营主管 重置教务老师 重置乐队指导 合作单位 教学点
  732. this.topFrom.teacher = "";
  733. this.topFrom.boss = "";
  734. this.topFrom.head = "";
  735. this.topFrom.school = "";
  736. this.topFrom.address = "";
  737. // 发请求 根据分部id 查询所有员工
  738. queryEmployByOrganId({ organId: val, rows: 1000 }).then(res => {
  739. if (res.code == 200) {
  740. this.orgianList = res.data.rows;
  741. }
  742. });
  743. // 合作单位
  744. queryByOrganId({ organId: val }).then(res => {
  745. if (res.code == 200) {
  746. this.cooperationList = res.data;
  747. }
  748. });
  749. // 教学点=>学校
  750. getSchool({ organId: val }).then(res => {
  751. if (res.code == 200) {
  752. this.addList = res.data;
  753. }
  754. });
  755. // 获取维修技师
  756. findTechnician().then(res => {
  757. if (res.code == 200) {
  758. this.technician = res.data;
  759. }
  760. })
  761. },
  762. chioseSchool (val) { },
  763. gotoNext (num) {
  764. // 1.效验数据 判断是否数据正常=> 正常放入store存储
  765. // 不正常=> 进行效验提示
  766. this.$refs["topinfo"].validate((valid, object) => {
  767. if (!valid) {
  768. this.$message.error("请填写建团必要参数");
  769. } else {
  770. // 判断一下是否勾选了课程类型而没有输入金额
  771. let flagList = []
  772. for (let i in this.checkList) {
  773. if (this.checkList[i].ischeck && !this.checkList[i].value) {
  774. flagList.push(false)
  775. } else {
  776. flagList.push(true)
  777. }
  778. }
  779. let flag = flagList.every(item => {
  780. return item == true
  781. })
  782. if (!flag) {
  783. this.$message.error('课程价格不能为空')
  784. return
  785. }
  786. // 验证通过
  787. this.$store.dispatch("topinfo", this.topFrom);
  788. this.$store.dispatch("checkinfo", this.checkList);
  789. this.$store.dispatch("getpayInfo", this.payList);
  790. if (this.teamStatus == "teamDraft") {
  791. // 获取数据提交
  792. this.resetSubmit();
  793. } else {
  794. this.$emit("chiosetab", num);
  795. }
  796. }
  797. });
  798. },
  799. resetSubmit () {
  800. this.$refs["topinfo"].validate((valid, object) => {
  801. if (!valid) {
  802. this.$message.error("请填写必要参数");
  803. } else {
  804. let flagList = []
  805. for (let i in this.checkList) {
  806. if (this.checkList[i].ischeck && !this.checkList[i].value) {
  807. flagList.push(false)
  808. } else {
  809. flagList.push(true)
  810. }
  811. }
  812. let flag = flagList.every(item => {
  813. return item == true
  814. })
  815. if (!flag) {
  816. this.$message.error('课程价格不能为空')
  817. return
  818. }
  819. let status = null;
  820. // 1.resetTeam 乐团修改
  821. // 2.newTeam 新建乐团
  822. // 3.teamList 跨团修改
  823. // 4.teamDraft 乐团草稿
  824. switch (this.teamStatus) {
  825. case "resetTeam": {
  826. status = "PROGRESS";
  827. break;
  828. }
  829. case "newTeam": {
  830. status = null;
  831. break;
  832. }
  833. case "teamList": {
  834. status = null;
  835. break;
  836. }
  837. case "teamDraft": {
  838. status = "DRAFT";
  839. break;
  840. }
  841. }
  842. let obj = {};
  843. // topFrom.ownershipType
  844. this.payList.student.chiose == "loop"
  845. ? (obj.months = this.payList.chioseMonth)
  846. : (obj.months = []);
  847. obj.musicGroup = {
  848. settlementType: this.topFrom.salary,
  849. applyExpireDate: this.topFrom.time + " 00:00:01",
  850. chargeTypeId: this.topFrom.type,
  851. cooperationOrganId: this.topFrom.school,
  852. teamTeacherId: this.topFrom.boss,
  853. educationalTeacherId: this.topFrom.teacher,
  854. enrollClasses: this.topFrom.startClass.join(","),
  855. name: this.topFrom.name,
  856. organId: this.topFrom.section,
  857. // paymentMonths:obj.months 有待确认
  858. schoolId: this.topFrom.address,
  859. courseForm: JSON.stringify(this.checkList),
  860. id: this.teamid,
  861. directorUserId: this.topFrom.head,
  862. isClassroomLessons: this.topFrom.isClass,
  863. status,
  864. expectStartGroupDate: this.topFrom.startTime,
  865. ownershipType: this.topFrom.ownershipType,
  866. repairUserId: this.topFrom.repairUserId
  867. };
  868. obj.musicGroupPaymentEntities = [];
  869. // 添加学校主体付费方式
  870. if (this.payList.school.ischeck) {
  871. obj.musicGroupPaymentEntities.push({
  872. amount: this.payList.school.price,
  873. memo: this.payList.school.value,
  874. paymentMethod: this.payList.school.chiose,
  875. name: "学校"
  876. });
  877. }
  878. // 添加公司主体付费方式
  879. if (this.payList.company.ischeck) {
  880. obj.musicGroupPaymentEntities.push({
  881. amount: this.payList.company.price,
  882. memo: this.payList.company.value,
  883. paymentMethod: this.payList.company.chiose,
  884. name: "公司"
  885. });
  886. }
  887. if (this.payList.student.ischeck) {
  888. obj.musicGroupPaymentEntities.push({
  889. paymentMethod: this.payList.student.chiose,
  890. name: "学生"
  891. });
  892. }
  893. // 发请求
  894. resetTeamBaseInfo(obj).then(res => {
  895. if (res.code == 200) {
  896. if (this.teamStatus == "teamDraft") {
  897. this.$message.success("保存成功");
  898. // 跳到第二页
  899. // 删掉结束
  900. this.$emit("chiosetab", 1);
  901. } else {
  902. this.$message.success("修改乐团成功");
  903. // this.$router.push({ path: '/business/teamDetails', query: { id: this.teamid, name: this.topFrom.name } })
  904. }
  905. }
  906. });
  907. }
  908. });
  909. }
  910. },
  911. computed: {}
  912. };
  913. </script>
  914. <style lang="scss">
  915. .base-container {
  916. overflow: auto;
  917. // display: flex;
  918. // flex-direction: row;
  919. // justify-content: flex-start;
  920. // flex-wrap: nowrap;
  921. font-size: 14px;
  922. color: #444;
  923. // width: fill-available;
  924. .banseLeft {
  925. // width: 1050px;
  926. .head {
  927. height: 48px;
  928. line-height: 48px;
  929. background-color: #edeef0;
  930. font-size: 14px;
  931. font-weight: bold;
  932. color: #444;
  933. padding: 0 11px;
  934. margin-bottom: 20px;
  935. }
  936. .noMargin.head {
  937. margin-bottom: 0;
  938. }
  939. .num {
  940. padding: 15px 11px;
  941. }
  942. .checkRow {
  943. // width: 1050px;
  944. padding-left: 28px;
  945. display: flex;
  946. flex-direction: row;
  947. justify-content: flex-start;
  948. flex-wrap: nowrap;
  949. overflow: auto;
  950. .el-checkbox {
  951. line-height: 72px;
  952. }
  953. .inputWrap {
  954. line-height: 72px;
  955. font-size: 14px;
  956. color: #777;
  957. margin-left: 65px;
  958. input {
  959. border: none;
  960. width: 80px;
  961. margin-right: 10px;
  962. outline: none;
  963. }
  964. }
  965. .inputWrap.rightFirst {
  966. margin-left: 245px;
  967. }
  968. .textWrap {
  969. display: flex;
  970. flex-direction: row;
  971. justify-content: flex-start;
  972. font-size: 14px;
  973. color: #777;
  974. align-items: center;
  975. span {
  976. color: #f97215;
  977. }
  978. }
  979. .selectWrap {
  980. font-size: 14px;
  981. padding-top: 5px;
  982. margin-left: 100px;
  983. margin-right: 52px;
  984. .rowSelect {
  985. .el-input__inner {
  986. min-height: 69px;
  987. }
  988. }
  989. }
  990. .chioseList {
  991. display: flex;
  992. flex-direction: row;
  993. justify-content: flex-start;
  994. align-items: center;
  995. font-size: 14px;
  996. color: #777;
  997. margin-left: 64px;
  998. .chioseItem {
  999. width: 80px;
  1000. height: 30px;
  1001. border-radius: 15px;
  1002. border: 1px solid #979797;
  1003. margin-right: 10px;
  1004. line-height: 30px;
  1005. text-align: center;
  1006. cursor: pointer;
  1007. }
  1008. .chioseItem.active {
  1009. background-color: #14928a;
  1010. border: 1px solid #14928a;
  1011. color: #fff;
  1012. }
  1013. }
  1014. // &:nth-child(even) {
  1015. // background-color: #c6cbd4;
  1016. // input {
  1017. // background-color: #c6cbd4;
  1018. // }
  1019. // }
  1020. }
  1021. }
  1022. .btnWrap {
  1023. margin-top: 30px;
  1024. }
  1025. .el-checkbox__input.is-checked + .el-checkbox__label {
  1026. color: #606266;
  1027. }
  1028. .subTitle {
  1029. // width: 1203px;
  1030. height: 40px;
  1031. line-height: 40px;
  1032. background-color: #fefceb;
  1033. padding: 0 25px;
  1034. box-sizing: border-box;
  1035. font-size: 16px;
  1036. color: #474747;
  1037. margin-bottom: 20px;
  1038. }
  1039. .chioseWrap {
  1040. margin-bottom: 30px;
  1041. display: flex;
  1042. flex-direction: row;
  1043. padding: 0 25px;
  1044. p {
  1045. width: 80px;
  1046. font-size: 14px;
  1047. // margin-right: 30px;
  1048. }
  1049. }
  1050. .classCheckBox {
  1051. margin-right: 10px;
  1052. }
  1053. }
  1054. </style>