teamBaseInfo.vue 40 KB

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