teamBaseInfo.vue 57 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833
  1. <template>
  2. <div class="base-container">
  3. <div class="banseLeft">
  4. <!-- <div class="num">乐团编号:dywh01</div> -->
  5. <el-form
  6. :model="topFrom"
  7. ref="topinfo"
  8. label-width="150px"
  9. :inline="true"
  10. label-position="right"
  11. >
  12. <div class="head">乐团基本信息:</div>
  13. <el-form-item
  14. label="乐团名称"
  15. prop="name"
  16. :rules="[{ required: true, message: '乐团名称不能为空' }]"
  17. >
  18. <el-input
  19. placeholder="请输入乐团名称"
  20. v-model.trim="topFrom.name"
  21. :disabled="basdisabled"
  22. ></el-input>
  23. </el-form-item>
  24. <!-- style="margin-left: 11px" -->
  25. <el-form-item
  26. label="所属分部"
  27. prop="section"
  28. :rules="[{ required: true, message: '所属分部不能为空' }]"
  29. >
  30. <el-select
  31. class="width400"
  32. v-model.trim="topFrom.section"
  33. filterable
  34. :disabled="basdisabled"
  35. @change="changeSection"
  36. clearable
  37. >
  38. <el-option
  39. v-for="(item, index) in sectionList"
  40. :key="index"
  41. :label="item.name"
  42. :value="item.id"
  43. ></el-option>
  44. </el-select>
  45. </el-form-item>
  46. <el-form-item
  47. label="乐团收费类型"
  48. prop="type"
  49. :rules="[{ required: true, message: '乐团收费类型不能为空' }]"
  50. >
  51. <el-select
  52. v-model.trim="topFrom.type"
  53. filterable
  54. :disabled="basdisabled"
  55. clearable
  56. @change="changeType"
  57. >
  58. <el-option
  59. v-for="(item, index) in typeList"
  60. :key="index"
  61. :label="item.name"
  62. :value="item.id"
  63. ></el-option>
  64. </el-select>
  65. </el-form-item>
  66. <el-form-item
  67. label="收费模式"
  68. prop="courseViewType"
  69. :rules="[{ required: true, message: '收费模式不能为空' }]"
  70. >
  71. <el-select
  72. v-model.trim="topFrom.courseViewType"
  73. filterable
  74. :disabled="basdisabled"
  75. clearable
  76. >
  77. <el-option
  78. :label="item.label"
  79. :value="Number(item.value)"
  80. v-for="item in courseViewTypeList"
  81. :key="item.value"
  82. :disabled="checkCourseView(Number(item.value))"
  83. ></el-option>
  84. <!-- <el-option label="AMR收费" :value="1"></el-option>
  85. <el-option label="会员收费" :value="2"></el-option> -->
  86. </el-select>
  87. </el-form-item>
  88. <el-form-item
  89. label="合作单位"
  90. prop="school"
  91. :rules="[{ required: true, message: '合作单位不能为空' }]"
  92. >
  93. <el-select
  94. v-model.trim="topFrom.school"
  95. :disabled="!topFrom.section || basdisabled"
  96. @change="chioseSchool"
  97. filterable
  98. clearable
  99. >
  100. <el-option
  101. v-for="(item, index) in cooperationList"
  102. :key="index"
  103. :label="item.name"
  104. :value="item.id"
  105. ></el-option>
  106. </el-select>
  107. </el-form-item>
  108. <el-form-item
  109. label="教学地点"
  110. prop="address"
  111. :rules="[{ required: true, message: '教学地点不能为空' }]"
  112. >
  113. <template #label>
  114. <p style="position: relative; display: inline-block">
  115. 教学地点
  116. <el-tooltip placement="top" popper-class="mTooltip">
  117. <div slot="content">
  118. 如果已生成课表,则会修改未上课时的教学点
  119. </div>
  120. <i
  121. class="el-icon-question"
  122. style="font-size: 18px; color: #f56c6c"
  123. ></i>
  124. </el-tooltip>
  125. </p>
  126. </template>
  127. <el-select
  128. v-model.trim="topFrom.address"
  129. filterable
  130. clearable
  131. :disabled="!topFrom.section || basdisabled"
  132. >
  133. <el-option
  134. v-for="(item, index) in addList"
  135. :key="index"
  136. :label="item.name"
  137. :value="item.id"
  138. ></el-option>
  139. </el-select>
  140. </el-form-item>
  141. <!-- <el-form-item
  142. label="运营主管"
  143. prop="boss"
  144. :rules="[{ required: true, message: '运营主管不能为空' }]"
  145. >
  146. <el-select
  147. v-model.trim="topFrom.boss"
  148. :disabled="!topFrom.section || basdisabled"
  149. filterable
  150. clearable
  151. >
  152. <el-option
  153. v-for="item in bossList"
  154. :key="item.userId"
  155. :label="item.realName"
  156. :value="item.userId"
  157. >
  158. <span style="float: left">{{ item.realName }}</span>
  159. <span style="float: right; color: #8492a6; font-size: 13px">{{
  160. String(item.userId)
  161. }}</span>
  162. </el-option>
  163. </el-select>
  164. </el-form-item> -->
  165. <!-- <el-form-item
  166. label="预报名截止时间"
  167. prop="time"
  168. :rules="[{ required: true, message: '请输入预报名截止时间' }]"
  169. >
  170. <el-date-picker
  171. v-model.trim="topFrom.time"
  172. :disabled="basdisabled"
  173. type="date"
  174. value-format="yyyy-MM-dd"
  175. :picker-options="beginDate()"
  176. placeholder="选择日期"
  177. ></el-date-picker>
  178. </el-form-item> -->
  179. <!-- <el-form-item
  180. label="报名截止时间"
  181. prop="time"
  182. :rules="[{ required: true, message: '请输入报名截止时间' }]"
  183. >
  184. <el-date-picker
  185. v-model.trim="topFrom.time"
  186. :disabled="basdisabled"
  187. type="date"
  188. value-format="yyyy-MM-dd"
  189. :picker-options="beginDate()"
  190. placeholder="选择日期"
  191. ></el-date-picker>
  192. </el-form-item> -->
  193. <!-- <el-form-item
  194. label="预计开团时间"
  195. prop="startTime"
  196. :rules="[{ required: true, message: '请输入预计开团时间' }]"
  197. >
  198. <el-date-picker
  199. v-model.trim="topFrom.startTime"
  200. :disabled="basdisabled"
  201. type="date"
  202. value-format="yyyy-MM-dd"
  203. :picker-options="beginDate()"
  204. placeholder="选择日期"
  205. ></el-date-picker>
  206. </el-form-item> -->
  207. <!-- <el-form-item
  208. label="课酬结算标准"
  209. :rules="[{ required: true, message: '请选择课酬结算标准' }]"
  210. prop="salary"
  211. >
  212. <el-select
  213. v-model.trim="topFrom.salary"
  214. clearable
  215. :disabled="basdisabled"
  216. filterable
  217. >
  218. <el-option label="自定义课酬" value="TEACHER_DEFAULT"></el-option>
  219. <el-option label="标准课酬" value="GRADIENT_SALARY"></el-option>
  220. </el-select>
  221. </el-form-item> -->
  222. <el-form-item
  223. label="机构类型"
  224. prop="ownershipType"
  225. v-if="tenantId == 1"
  226. >
  227. <el-select
  228. v-model.trim="topFrom.ownershipType"
  229. :disabled="basdisabled"
  230. >
  231. <el-option label="自有" value="OWN"></el-option>
  232. <el-option label="三方" value="COOPERATION"></el-option>
  233. <!-- <el-option label="租赁"
  234. value="LEASE"></el-option>-->
  235. </el-select>
  236. </el-form-item>
  237. <el-form-item
  238. label="课外训练布置老师"
  239. prop="extracurricularTeacher"
  240. v-if="tenantId == 1"
  241. >
  242. <el-select
  243. v-model.trim="topFrom.extracurricularTeacher"
  244. :disabled="basdisabled"
  245. >
  246. <el-option label="声部班老师" value="NORMAL"></el-option>
  247. <el-option label="合奏班老师" value="MIX"></el-option>
  248. <!-- <el-option label="租赁"
  249. value="LEASE"></el-option>-->
  250. </el-select>
  251. </el-form-item>
  252. <!-- v-if="teamStatus == 'resetTeam' || teamStatus == 'teamList'" -->
  253. <div class="head">人员配置:</div>
  254. <el-form-item
  255. label="乐团主管"
  256. prop="teacher"
  257. :rules="[{ required: true, message: '乐团主管不能为空' }]"
  258. >
  259. <el-select
  260. v-model.trim="topFrom.teacher"
  261. :disabled="true"
  262. filterable
  263. clearable
  264. >
  265. <el-option
  266. v-for="(item, key) in educationList"
  267. :key="key"
  268. :label="item.userName"
  269. :value="Number(item.userId)"
  270. >
  271. <span style="float: left">{{ item.userName }}</span>
  272. <span style="float: right; color: #8492a6; font-size: 13px">{{
  273. String(item.userId)
  274. }}</span>
  275. </el-option>
  276. </el-select>
  277. </el-form-item>
  278. <el-form-item label="乐队指导" prop="head">
  279. <el-select
  280. v-model.trim="topFrom.head"
  281. filterable
  282. :disabled="!topFrom.section || basdisabled"
  283. clearable
  284. >
  285. <el-option
  286. v-for="(item, index) in teacherList"
  287. :key="index"
  288. :label="item.realName"
  289. :value="item.id"
  290. >
  291. <span style="float: left">{{ item.realName }}</span>
  292. <span style="float: right; color: #8492a6; font-size: 13px">{{
  293. String(item.id)
  294. }}</span>
  295. </el-option>
  296. </el-select>
  297. </el-form-item>
  298. <el-form-item label="维修技师" prop="repairUserId">
  299. <el-select
  300. v-model.trim="topFrom.repairUserId"
  301. :disabled="!topFrom.section || basdisabled"
  302. filterable
  303. clearable
  304. >
  305. <el-option
  306. v-for="(item, key) in technician"
  307. :key="key"
  308. :label="item.userName"
  309. :value="item.userId"
  310. >
  311. <span style="float: left">{{ item.userName }}</span>
  312. <span style="float: right; color: #8492a6; font-size: 13px">{{
  313. String(item.userId)
  314. }}</span>
  315. </el-option>
  316. </el-select>
  317. </el-form-item>
  318. <el-form-item label="衔接老师" prop="transactionTeacherId">
  319. <el-select
  320. v-model.trim="topFrom.transactionTeacherId"
  321. :disabled="!topFrom.section || basdisabled"
  322. filterable
  323. clearable
  324. >
  325. <el-option
  326. v-for="(item, key) in transactionList"
  327. :key="key"
  328. :label="item.userName"
  329. :value="item.userId"
  330. >
  331. <span style="float: left">{{ item.userName }}</span>
  332. <span style="float: right; color: #8492a6; font-size: 13px">{{
  333. String(item.userId)
  334. }}</span>
  335. </el-option>
  336. </el-select>
  337. </el-form-item>
  338. <div v-if="tenantId == 1">
  339. <div class="head">建团信息:</div>
  340. <el-form-item
  341. label="建团编制"
  342. prop="musicGroupPlanMakingId"
  343. :rules="[{ required: true, message: '建团编制不能为空' }]"
  344. >
  345. <el-select
  346. v-model.trim="topFrom.musicGroupPlanMakingId"
  347. filterable
  348. :disabled="basdisabled"
  349. clearable
  350. @change="changeType"
  351. >
  352. <el-option
  353. v-for="(item, index) in musicGroupPlanMakingList"
  354. :key="index"
  355. :label="item.name"
  356. :value="item.id"
  357. ></el-option>
  358. </el-select>
  359. </el-form-item>
  360. <el-form-item
  361. label="成团年级"
  362. prop="firstRecruitGrade"
  363. :rules="[{ required: true, message: '成团年级不能为空' }]"
  364. >
  365. <el-select
  366. v-model.trim="topFrom.firstRecruitGrade"
  367. filterable
  368. :disabled="basdisabled || !topFrom.section"
  369. clearable
  370. >
  371. <el-option
  372. v-for="(item, index) in gradeList"
  373. :key="index"
  374. :label="item.label"
  375. :value="item.value"
  376. ></el-option>
  377. </el-select>
  378. </el-form-item>
  379. <el-form-item
  380. label="收费标准"
  381. prop="defaultChargeStandard"
  382. :rules="[{ required: true, message: '收费标准不能为空' }, {
  383. pattern:
  384. /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
  385. message: '请输入正确的金额',
  386. trigger: 'blur',
  387. },]"
  388. >
  389. <el-input
  390. v-model.trim="topFrom.defaultChargeStandard"
  391. placeholder="请输入收费标准"
  392. :disabled="basdisabled"
  393. >
  394. </el-input>
  395. </el-form-item>
  396. <el-form-item
  397. label="单次训练时长"
  398. prop="singleTrainMinutes"
  399. :rules="[
  400. { required: true, message: '请输入单次训练时长' },
  401. {
  402. pattern: /(^[0-9+]*$)/,
  403. message: '请输入正确的时长',
  404. },
  405. ]"
  406. >
  407. <el-select
  408. v-model.trim="topFrom.singleTrainMinutes"
  409. filterable
  410. :disabled="basdisabled"
  411. allow-create
  412. default-first-option
  413. clearable
  414. >
  415. <el-option
  416. v-for="(item, index) in singleTrainMinutesList"
  417. :key="index"
  418. :label="item.name"
  419. :value="item.id"
  420. ></el-option>
  421. </el-select>
  422. </el-form-item>
  423. <el-form-item
  424. label="课程配置"
  425. prop="coursePlan"
  426. :rules="[{ required: true, message: '请选择课程配置' }]"
  427. >
  428. <el-select
  429. v-model.trim="topFrom.coursePlan"
  430. filterable
  431. :disabled="basdisabled"
  432. clearable
  433. >
  434. <el-option
  435. v-for="(item, index) in coursePlanList"
  436. :key="index"
  437. :label="item.name"
  438. :value="item.id"
  439. ></el-option>
  440. </el-select>
  441. </el-form-item>
  442. <el-form-item
  443. label="毕业年级"
  444. prop="graduateGrade"
  445. :rules="[{ required: true, message: '毕业年级不能为空' }]"
  446. >
  447. <el-select
  448. v-model.trim="topFrom.graduateGrade"
  449. filterable
  450. :disabled="basdisabled || !topFrom.firstRecruitGrade"
  451. clearable
  452. >
  453. <el-option
  454. v-for="(item, index) in gradeList"
  455. :key="index"
  456. :label="item.label"
  457. :value="item.value"
  458. :disabled="item.value <= topFrom.firstRecruitGrade"
  459. ></el-option>
  460. </el-select>
  461. </el-form-item>
  462. <el-form-item label="销售活动" prop="saleActivityDesc">
  463. <el-input
  464. placeholder="请输入销售活动"
  465. :maxlength="100"
  466. v-model.trim="topFrom.saleActivityDesc"
  467. show-word-limit
  468. :disabled="basdisabled"
  469. ></el-input>
  470. </el-form-item>
  471. </div>
  472. <div class="head">乐团设置:</div>
  473. <el-form-item
  474. label="同步群消息"
  475. prop="homeworkPushFlag"
  476. label-width="200px"
  477. :rules="[{ required: true, message: '同步群消息不能为空' }]"
  478. >
  479. <template #label>
  480. <p style="position: relative; display: inline-block">
  481. 开课后作业同步群消息
  482. <el-tooltip placement="top" popper-class="mTooltip">
  483. <div slot="content">
  484. 学员提交乐团课后作业时,群聊中是否发送作业提交消息
  485. </div>
  486. <i
  487. class="el-icon-question"
  488. style="font-size: 18px; color: #f56c6c"
  489. ></i>
  490. </el-tooltip>
  491. </p>
  492. </template>
  493. <el-switch
  494. v-model="topFrom.homeworkPushFlag"
  495. :disabled="basdisabled"
  496. :active-value="1"
  497. :inactive-value="0"
  498. >
  499. </el-switch>
  500. </el-form-item>
  501. <el-form-item
  502. label="是否赠送辅件"
  503. prop="memberCourseShowFlag"
  504. label-width="200px"
  505. :rules="[{ required: true, message: '是否赠送辅件不能为空' }]"
  506. >
  507. <template #label>
  508. <p style="position: relative; display: inline-block">
  509. 是否赠送辅件
  510. <el-tooltip placement="top" popper-class="mTooltip">
  511. <div slot="content">购买团练宝是否赠送辅件</div>
  512. <i
  513. class="el-icon-question"
  514. style="font-size: 18px; color: #f56c6c"
  515. ></i>
  516. </el-tooltip>
  517. </p>
  518. </template>
  519. <el-switch
  520. v-model="topFrom.isGiveAccessories"
  521. :disabled="basdisabled"
  522. :active-value="1"
  523. :inactive-value="0"
  524. >
  525. </el-switch>
  526. </el-form-item>
  527. <!-- <el-form-item
  528. label="是否显示免费课程"
  529. prop="memberCourseShowFlag"
  530. label-width="200px"
  531. :rules="[{ required: true, message: '是否显示免费课程不能为空' }]"
  532. >
  533. <template #label>
  534. <p style="position: relative; display: inline-block">
  535. 是否显示免费课程
  536. <el-tooltip placement="top" popper-class="mTooltip">
  537. <div slot="content">报名时是否显示免费赠送课程</div>
  538. <i
  539. class="el-icon-question"
  540. style="font-size: 18px; color: #f56c6c"
  541. ></i>
  542. </el-tooltip>
  543. </p>
  544. </template>
  545. <el-switch
  546. v-model="topFrom.memberCourseShowFlag"
  547. :disabled="basdisabled"
  548. :active-value="1"
  549. :inactive-value="0"
  550. >
  551. </el-switch>
  552. </el-form-item> -->
  553. <!-- <el-form-item label prop="isClass">
  554. <el-checkbox v-model.trim="topFrom.isClass" :disabled="basdisabled"
  555. >课堂课乐团</el-checkbox
  556. >
  557. </el-form-item> -->
  558. <br />
  559. <el-form-item label="" v-if="teamStatus == 'teamDraft'">
  560. <p style="color: red; padding-left: 50px">
  561. 修改【收费类型】会重置乐团声部与缴费信息
  562. </p>
  563. </el-form-item>
  564. </el-form>
  565. <div class="btnWrap">
  566. <!-- <div
  567. class="nextBtn"
  568. v-if="teamStatus == 'resetTeam'"
  569. v-permission="{
  570. child: 'musicGroup/update',
  571. parent: '/resetTeaming/teamBaseInfo',
  572. }"
  573. @click="resetSubmit"
  574. >
  575. 修改
  576. </div> -->
  577. <!-- 审批或者草稿的下一步 -->
  578. <div class="nextBtn" @click="gotoNext()" v-if="!basdisabled">
  579. {{ this.teamStatus == "teamDraft" ? "下一步" : "保存" }}
  580. </div>
  581. <div
  582. class="nextBtn"
  583. v-if="this.teamStatus == 'teamAudit'"
  584. @click="gotoNext()"
  585. >
  586. 下一步
  587. </div>
  588. </div>
  589. </div>
  590. </div>
  591. </template>
  592. <script>
  593. import {
  594. getType,
  595. getTeamBaseInfo,
  596. resetTeamBaseInfo,
  597. getEmployeeOrgan,
  598. getStudentList,
  599. musicGroupOpenPay,
  600. extensionPayment,
  601. extensionApplyExpire,
  602. getOrganRole,
  603. getTeacher,
  604. createTeam,
  605. getGradeList,
  606. } from "@/api/buildTeam";
  607. import dayjs from "dayjs";
  608. import merge from "webpack-merge";
  609. import { queryByOrganId, getSchool } from "@/api/systemManage";
  610. import qrCode from "@/components/QrCode/index";
  611. import { classStatus, courseViewTypeList } from "@/utils/searchArray";
  612. import { vaildStudentUrl, vaildTeacherUrl } from "@/utils/validate";
  613. import { getMusicGroupPlanMakingList } from "@/views/baseRulesManager/api";
  614. import mergeMusic from "../components/merge-music";
  615. const singleTrainMinutesList = [
  616. { name: "90+90", id: "90+90" },
  617. { name: "90+90+45", id: "90+90+45" },
  618. ];
  619. const coursePlanList = [
  620. { name: "PlanS", id: "PlanS" },
  621. { name: "PlanA", id: "PlanA" },
  622. { name: "PlanB", id: "PlanB" },
  623. { name: "PlanC", id: "PlanC" },
  624. { name: "PlanD", id: "PlanD" },
  625. { name: "PlanE", id: "PlanE" },
  626. ];
  627. export default {
  628. components: {
  629. mergeMusic,
  630. qrCode,
  631. },
  632. name: "teamBaseInfo",
  633. props: ["getTeamList"],
  634. data() {
  635. return {
  636. classStatus,
  637. courseViewTypeList,
  638. organId: null,
  639. topFrom: {
  640. type: "", // 收费类型
  641. section: "", //所属分部
  642. courseViewType: "", // 收费模式
  643. school: "", // 合作单位
  644. teacher: null, // 乐团主管
  645. name: "", //乐团名称
  646. boss: "", // 运营主管
  647. time: "", // 报名截止时间
  648. startClass: [], // 招生年级起始
  649. address: "", // 教学地点
  650. salary: "", // 收费模式
  651. head: "",
  652. homeworkPushFlag: 1, // 是否同步群消息
  653. isGiveAccessories: 0, // 是否赠送辅件 默认不赠送
  654. memberCourseShowFlag: 0,
  655. isClass: false, //是否为课堂课
  656. startTime: "",
  657. feeType: null,
  658. paymentPattern: "", // 缴费方式
  659. paymentValid: [], // 缴费有效期
  660. paymentValidStartDate: null, // 缴费有效期开始
  661. paymentValidEndDate: null, // 缴费有效期结束
  662. ownershipType: "OWN", // 合作机构类型
  663. repairUserId: null, // 维修技师
  664. transactionTeacherId: null, // 衔接老师
  665. extracurricularTeacher: "NORMAL",
  666. musicGroupPlanMakingId: "", //建团编制
  667. firstRecruitGrade: "", // 成团年级
  668. defaultChargeStandard: "", // 收费标准
  669. singleTrainMinutes: "", //单次训练时长
  670. coursePlan: "", // 课程计划
  671. graduateGrade: "", // 毕业年级
  672. saleActivityDesc: "", // 销售活动描述
  673. },
  674. baseInfo: {},
  675. money: 580,
  676. orderInfo: {
  677. marketPrice: 0, // 原价总金额
  678. referencePrice: 0, // 现价总金额
  679. }, // 金额列表,金额计算
  680. sectionList: [], // 分部列表
  681. typeList: [], // 收费类型列表
  682. cooperationList: [], // 教学点列表
  683. teacherList: [], // 获取老师列表
  684. educationList: [], // 乐团主管
  685. bossList: [],
  686. transactionList: [],
  687. addList: [], // 教学地点列表
  688. activeTeam: [],
  689. gradeList: [], // 年级
  690. gradeListObj: null,
  691. teamid: "",
  692. teamStatus: "",
  693. isInit: false,
  694. technician: [],
  695. basdisabled: false,
  696. // 整合报名中
  697. paymentExpireDate: "",
  698. applyExpireDate: null,
  699. mergeVisible: false,
  700. team_status: "",
  701. paymentNum: 0,
  702. paymentStatus: false,
  703. paymentForm: {
  704. paymentExpireDate: null,
  705. // feeType: null
  706. },
  707. paymentRules: {
  708. paymentExpireDate: [
  709. { required: true, message: "请设置缴费截止日期", trigger: "blur" },
  710. ],
  711. },
  712. extendForm: {
  713. expireDate: null,
  714. },
  715. extendRule: {
  716. expireDate: [
  717. { required: true, message: "请选择延长时间", trigger: "change" },
  718. ],
  719. },
  720. isPay: false,
  721. extendPaymentStatus: false, // 延长缴费
  722. codeStatus: false,
  723. qrCodeUrl: null,
  724. codeTitle: null,
  725. tenantId: "",
  726. coursePlanList: coursePlanList,
  727. musicGroupPlanMakingList: [],
  728. singleTrainMinutesList: singleTrainMinutesList,
  729. };
  730. },
  731. created() {},
  732. mounted() {
  733. if (this.$route.query.type == "newTeam") {
  734. this.onReset();
  735. }
  736. this.init();
  737. },
  738. activated() {
  739. if (
  740. (this.teamid && this.teamid != this.$route.query.id) ||
  741. this.teamStatus != this.$route.query.type
  742. ) {
  743. this.init();
  744. }
  745. if (this.$route.query.clear == "true") {
  746. this.onReset();
  747. }
  748. if (this.teamStatus == "newTeam") {
  749. this.$store.dispatch("buildIndex", 0);
  750. }
  751. if (this.teamStatus != "newTeam") {
  752. this.$store.dispatch("draftIndex", 0);
  753. }
  754. this.teamStatus = this.$route.query.type;
  755. if (
  756. this.teamStatus == "look" ||
  757. this.teamStatus == "teamAudit" ||
  758. this.teamStatus == "feeAudit" ||
  759. this.teamStatus == "APPLY" ||
  760. this.teamStatus == "PAY"
  761. ) {
  762. this.basdisabled = true;
  763. } else {
  764. this.basdisabled = false;
  765. }
  766. },
  767. deactivated() {},
  768. // async beforeDestroy() {
  769. // await this.setStore();
  770. // // await new Promise((res, err) => {
  771. // // setTimeout(() => {
  772. // // res();
  773. // // }, 1000);
  774. // // });
  775. // },
  776. methods: {
  777. async setStore(str) {
  778. if (this.teamid) {
  779. let loadash = this.$helpers.lodash;
  780. let sotrage = JSON.parse(localStorage.getItem(`${this.teamid}base`));
  781. // console.log(sotrage,this.topFrom)
  782. if (!loadash.isEqual(this.topFrom, sotrage) && sotrage) {
  783. // 提示保存
  784. return await this.$confirm("已修改当前页面数据是否保存", "提示", {
  785. confirmButtonText: "是",
  786. cancelButtonText: "否",
  787. type: "warning",
  788. closeOnClickModal: false,
  789. distinguishCancelAndClose: true,
  790. })
  791. .then(async () => {
  792. // localStorage.setItem(
  793. // `${this.teamid}base`,
  794. // JSON.stringify(this.topFrom)
  795. // );
  796. let b = await this.gotoNext(str);
  797. console.log(b);
  798. return b;
  799. })
  800. .catch((e) => {
  801. console.log(e);
  802. if (e == "close") {
  803. return false;
  804. } else {
  805. localStorage.removeItem(`${this.teamid}base`);
  806. return true;
  807. }
  808. // localStorage.setItem(`${this.teamid}base`,JSON.stringify(this.topFrom));
  809. });
  810. } else {
  811. return true;
  812. // localStorage.setItem(`${this.teamid}base`,JSON.stringify(this.topFrom));
  813. }
  814. } else {
  815. localStorage.setItem(`newTeambase`, JSON.stringify(this.topFrom));
  816. return true;
  817. }
  818. },
  819. //|| this.teamStatus === 'teamAudit'
  820. isNotEditing: function () {
  821. return !(
  822. this.teamStatus === "teamDraft" ||
  823. this.teamStatus === "newTeam" ||
  824. this.teamStatus === "teamList"
  825. );
  826. },
  827. changeFeeType(val) {},
  828. changePaymentValidStartDate(val) {
  829. if (val) {
  830. this.$set(this.topFrom, "paymentValidEndDate", "");
  831. }
  832. },
  833. changePaymentPattern(val) {
  834. // if (val === 2) {
  835. // // this.topFrom.paymentValidStartDate = null
  836. // this.$set(this.topFrom, 'paymentValidEndDate', '')
  837. // }
  838. },
  839. beginDate(end) {
  840. return {
  841. firstDayOfWeek: 1,
  842. disabledDate(time) {
  843. if (end) {
  844. return new Date(end).getTime() - 86400000 >= time.getTime();
  845. } else {
  846. return time.getTime() + 86400000 < Date.now();
  847. //开始时间不选时,结束时间最大值小于等于当天
  848. }
  849. },
  850. };
  851. },
  852. init() {
  853. this.isInit = true;
  854. if (this.$route.query.id) {
  855. this.teamid = this.$route.query.id;
  856. }
  857. this.teamStatus = this.$route.query.type;
  858. this.team_status = this.$route.query.team_status;
  859. this.tenantId = this.$helpers.tenantId;
  860. // if (this.teamStatus == "newTeam") {
  861. // this.$store.dispatch("buildIndex", 0);
  862. // }
  863. // if (this.teamStatus != "newTeam") {
  864. // this.$store.dispatch("draftIndex", 0);
  865. // }
  866. // 获取建团编制
  867. getMusicGroupPlanMakingList().then((res) => {
  868. if (res.code == 200) {
  869. this.musicGroupPlanMakingList = res.data;
  870. }
  871. });
  872. // 传过来的乐团信息
  873. this.activeTeam = this.getTeamList;
  874. if (
  875. this.teamStatus == "look" ||
  876. this.teamStatus == "teamAudit" ||
  877. this.teamStatus == "feeAudit" ||
  878. this.teamStatus == "teamCanceled"
  879. ) {
  880. this.basdisabled = true;
  881. } else {
  882. this.basdisabled = false;
  883. }
  884. if (this.$route.query.id) {
  885. // 单团修改
  886. this.teamid = this.$route.query.id;
  887. let sotrage = JSON.parse(
  888. localStorage.getItem(`${this.$route.query.id}base`)
  889. );
  890. if (!sotrage?.section) {
  891. getTeamBaseInfo({ musicGroupId: this.teamid }).then((res) => {
  892. if (res.code == 200) {
  893. // if (this.$listeners.getBaseInfo) {
  894. // this.$listeners.getBaseInfo(res.data);
  895. // }
  896. // 头部
  897. this.setBase(res);
  898. // // 循环缴费月
  899. // this.payList.chioseMonth = res.data.months;
  900. if (res.data.musicGroup.organId) {
  901. // 获取员工
  902. this.getBaseList(res.data.musicGroup.organId);
  903. }
  904. this.$emit("getBaseInfo", res.data);
  905. }
  906. });
  907. } else {
  908. this.topFrom = sotrage;
  909. // this.applyExpireDate = sotrage.time;
  910. // this.paymentExpireDate = Storage.paymentExpireDate;
  911. if (this.topFrom?.section) {
  912. // 获取员工
  913. this.getBaseList(this.topFrom.section);
  914. }
  915. }
  916. } else {
  917. // 如果是新建团
  918. let sotrage = JSON.parse(localStorage.getItem(`newTeambase`));
  919. console.log(sotrage, this.topFrom);
  920. sotrage ? (this.topFrom = sotrage) : this.topFrom;
  921. if (this.topFrom?.section) {
  922. // 获取员工
  923. this.getBaseList(this.topFrom.section);
  924. }
  925. }
  926. this.getStudentStatus();
  927. this.$emit("getName", this.topFrom?.name);
  928. // getEmployeeOrgan().then((res) => {
  929. // if (res.code == 200) {
  930. // this.sectionList = res.data;
  931. // }
  932. // });
  933. // // 2.获取收费类型选项卡
  934. // getType({ rows: 1000 }).then((res) => {
  935. // if (res.code == 200) {
  936. // this.typeList = res.data.rows;
  937. // }
  938. // });
  939. Promise.all([getType({ rows: 1000 }), getEmployeeOrgan()]).then(
  940. (values) => {
  941. if (values[0].code == 200) {
  942. this.typeList = values[0].data;
  943. // this.typeList = [];
  944. }
  945. if (values[1].code == 200) {
  946. this.sectionList = values[1].data;
  947. // this.sectionList = [];
  948. }
  949. let arr = [];
  950. if (this.sectionList.length <= 0) {
  951. arr.push("organ");
  952. } else {
  953. if (!this.topFrom.section) {
  954. this.$set(this.topFrom, "section", this.sectionList[0].id);
  955. this.changeSection(this.sectionList[0].id);
  956. // diao
  957. }
  958. }
  959. if (this.typeList.length <= 0) {
  960. arr.push("teamPayType");
  961. }
  962. this.$bus.$emit("showguide", arr);
  963. }
  964. );
  965. // console.log('到这里来',getEmployeeOrgan())
  966. // 缓存设置时的状态
  967. },
  968. changeSection(val) {
  969. // 修改分部的时候 重置运营主管 重置乐团主管 重置乐队指导 合作单位 教学点
  970. this.topFrom.teacher = null;
  971. this.topFrom.boss = "";
  972. this.topFrom.head = "";
  973. this.topFrom.school = "";
  974. this.topFrom.address = "";
  975. this.topFrom.firstRecruitGrade = "";
  976. this.topFrom.graduateGrade = "";
  977. // 发请求 根据分部id 查询所有员工
  978. if (val) {
  979. this.getBaseList(val);
  980. }
  981. },
  982. async getBaseList(val) {
  983. // 合作单位
  984. // queryByOrganId({ organId: val }).then((res) => {
  985. // if (res.code == 200) {
  986. // this.cooperationList = res.data;
  987. // }
  988. // });
  989. // 教学点=>学校
  990. // getSchool({ organId: val }).then((res) => {
  991. // if (res.code == 200) {
  992. // this.addList = res.data;
  993. // }
  994. // });
  995. // 获取乐团主管
  996. try {
  997. const ruselt = await getOrganRole({
  998. id: val,
  999. });
  1000. // 乐团主管
  1001. this.educationList = ruselt?.data?.EDUCATION;
  1002. // 维修技师
  1003. this.technician = ruselt?.data?.REPAIR;
  1004. // this.bossList = ruselt?.data?.TEAM_TEACHER;
  1005. // 衔接老师
  1006. this.transactionList = ruselt?.data?.JOIN_TEACHER;
  1007. } catch (e) {
  1008. console.log(e);
  1009. }
  1010. // 获取指导老师
  1011. getTeacher({ organId: val }).then((res) => {
  1012. if (res.code == 200) {
  1013. this.teacherList = res.data;
  1014. }
  1015. });
  1016. // 获取年级
  1017. getGradeList({ id: val }).then((res) => {
  1018. let result = res.data;
  1019. this.gradeListObj = res.data;
  1020. if (res.code == 200 && result) {
  1021. for (let i in result) {
  1022. this.gradeList.push({
  1023. value: i,
  1024. label: result[i],
  1025. });
  1026. }
  1027. }
  1028. });
  1029. Promise.all([
  1030. queryByOrganId({ organId: val }),
  1031. getSchool({ organId: val }),
  1032. ]).then((values) => {
  1033. if (values[0].code == 200) {
  1034. this.cooperationList = values[0].data;
  1035. }
  1036. if (values[1].code == 200) {
  1037. this.addList = values[1].data;
  1038. }
  1039. let arr = [];
  1040. if (this.cooperationList.length <= 0) {
  1041. arr.push("cooperationOrgan");
  1042. }
  1043. if (this.addList.length <= 0) {
  1044. arr.push("school");
  1045. }
  1046. if (arr.length > 0) {
  1047. this.$bus.$emit("showguide", arr);
  1048. return;
  1049. }
  1050. });
  1051. },
  1052. chioseSchool(val) {
  1053. // 清除教学点
  1054. this.topFrom.teacher = null;
  1055. if (val) {
  1056. console.log(this.cooperationList);
  1057. this.cooperationList.forEach((item) => {
  1058. if (item.id == val) {
  1059. console.log(item);
  1060. this.$set(this.topFrom, "teacher", item.educationUserId);
  1061. console.log(this.topFrom);
  1062. }
  1063. });
  1064. }
  1065. console.log("chioseSchool", this.topFrom.teacher);
  1066. },
  1067. async gotoNext(str) {
  1068. let tempStatus;
  1069. return new Promise((resolve, reject) => {
  1070. this.$refs["topinfo"].validate(async (valid, object) => {
  1071. if (!valid) {
  1072. this.$message.error("请填写建团必要参数");
  1073. // return false
  1074. resolve(false);
  1075. } else {
  1076. // 判断一下是否勾选了课程类型而没有输入金额
  1077. // 验证通过
  1078. this.$store.dispatch("topinfo", this.topFrom);
  1079. if (this.teamStatus == "teamAudit") {
  1080. // 获取数据提交
  1081. this.$emit("handleClick", { name: "2" });
  1082. } else {
  1083. this.$emit("getName", this.topFrom.name);
  1084. tempStatus = await this.resetSubmit(str);
  1085. console.log(tempStatus, "tempStatus");
  1086. resolve(tempStatus);
  1087. }
  1088. }
  1089. });
  1090. });
  1091. },
  1092. async resetSubmit(str) {
  1093. return new Promise((resolve, reject) => {
  1094. this.$refs["topinfo"].validate(async (valid, object) => {
  1095. if (!valid) {
  1096. this.$message.error("请填写必要参数");
  1097. reject();
  1098. } else {
  1099. let status = null;
  1100. // 1.resetTeam 乐团修改
  1101. // 2.newTeam 新建乐团
  1102. // 3.teamList 跨团修改
  1103. // 4.teamDraft 乐团草稿
  1104. switch (this.teamStatus) {
  1105. case "resetTeam": {
  1106. status = "PROGRESS";
  1107. break;
  1108. }
  1109. case "newTeam": {
  1110. status = "DRAFT";
  1111. break;
  1112. }
  1113. case "teamList": {
  1114. status = null;
  1115. break;
  1116. }
  1117. case "teamDraft": {
  1118. status = "DRAFT";
  1119. break;
  1120. }
  1121. }
  1122. let obj = {};
  1123. // topFrom.ownershipType
  1124. // 修改 合并对象
  1125. obj.musicGroup = {
  1126. settlementType: this.topFrom.salary,
  1127. applyExpireDate: dayjs(this.topFrom.time).format(
  1128. "YYYY-MM-DD HH:mm:ss"
  1129. ),
  1130. chargeTypeId: this.topFrom.type,
  1131. cooperationOrganId: this.topFrom.school,
  1132. courseViewType: this.topFrom.courseViewType,
  1133. teamTeacherId: this.topFrom.boss,
  1134. // educationalTeacherId: this.topFrom.teacher,
  1135. // chioseSchool
  1136. enrollClasses: this.topFrom.startClass.join(","),
  1137. name: this.topFrom.name,
  1138. paymentPattern: this.topFrom.paymentPattern,
  1139. paymentValidStartDate: this.topFrom.paymentValidStartDate
  1140. ? dayjs(this.topFrom.paymentValidStartDate).format("YYYY-MM-DD")
  1141. : this.topFrom.paymentValidStartDate,
  1142. paymentValidEndDate: this.topFrom.paymentValidEndDate
  1143. ? dayjs(this.topFrom.paymentValidEndDate).format("YYYY-MM-DD")
  1144. : this.topFrom.paymentValidEndDate,
  1145. organId: this.topFrom.section,
  1146. // paymentMonths:obj.months 有待确认
  1147. schoolId: this.topFrom.address,
  1148. id: this.teamid,
  1149. directorUserId: this.topFrom.head,
  1150. isClassroomLessons: this.topFrom.isClass,
  1151. status,
  1152. expectStartGroupDate: this.topFrom.startTime,
  1153. ownershipType: this.topFrom.ownershipType,
  1154. repairUserId: this.topFrom.repairUserId || null,
  1155. feeType: this.topFrom.feeType,
  1156. transactionTeacherId: this.topFrom.transactionTeacherId,
  1157. homeworkPushFlag: this.topFrom.homeworkPushFlag,
  1158. isGiveAccessories: this.topFrom.isGiveAccessories,
  1159. memberCourseShowFlag: this.topFrom.memberCourseShowFlag,
  1160. extracurricularTeacher: this.topFrom.extracurricularTeacher,
  1161. musicGroupPlanMakingId: this.topFrom.musicGroupPlanMakingId,
  1162. firstRecruitGrade: this.topFrom.firstRecruitGrade,
  1163. defaultChargeStandard: this.topFrom.defaultChargeStandard,
  1164. singleTrainMinutes: this.topFrom.singleTrainMinutes,
  1165. coursePlan: this.topFrom.coursePlan,
  1166. graduateGrade: this.topFrom.graduateGrade,
  1167. saleActivityDesc: this.topFrom.saleActivityDesc,
  1168. };
  1169. // obj.musicGroupPaymentEntities = [];
  1170. // createTeam
  1171. if (this.teamStatus != "newTeam") {
  1172. return await resetTeamBaseInfo(obj).then(async (res) => {
  1173. if (res.code == 200) {
  1174. localStorage.setItem(
  1175. `${this.teamid}base`,
  1176. JSON.stringify(this.topFrom)
  1177. );
  1178. this.$emit("getBaseInfo");
  1179. if (this.teamStatus == "teamDraft") {
  1180. this.$message.success("保存成功");
  1181. if (!str) {
  1182. this.$emit("handleClick", { name: "2" });
  1183. }
  1184. resolve(true);
  1185. // 跳到第二页
  1186. } else {
  1187. this.$message.success("修改乐团成功");
  1188. // this.$router.push({ path: '/teamLists', query: { id: this.teamid, name: this.topFrom.name } })
  1189. }
  1190. resolve(true);
  1191. }
  1192. });
  1193. } else {
  1194. // 发送建团申请 成功后跳到第二页
  1195. createTeam(obj).then((res) => {
  1196. if (res.code == 200) {
  1197. // this.$message.success('建团成功,请设置声部信息')
  1198. // this.$emit("chiosetab", 1);
  1199. const h = this.$createElement;
  1200. this.$msgbox({
  1201. title: "提示",
  1202. message: h("p", null, [
  1203. h("p", null, "新乐团基础信息创建完成"),
  1204. h("p", null, "请设置声部信息"),
  1205. ]),
  1206. type: "warning",
  1207. confirmButtonText: "是",
  1208. cancelButtonText: "否",
  1209. showCancelButton: true,
  1210. customClass: "messageBox-prompt-test",
  1211. })
  1212. .then(() => {
  1213. this.$router.push(
  1214. {
  1215. query: merge(this.$route.query, {
  1216. type: "teamDraft",
  1217. id: res.data,
  1218. team_status: "DRAFT",
  1219. }),
  1220. },
  1221. (router) => {
  1222. console.log(router);
  1223. router.meta.title = "乐团编辑中";
  1224. }
  1225. );
  1226. this.$emit("getName", this.topFrom.name);
  1227. this.$emit("handleClick", { name: "2" });
  1228. return true;
  1229. })
  1230. .catch(() => {
  1231. this.$router.push(
  1232. {
  1233. query: merge(this.$route.query, {
  1234. type: "teamDraft",
  1235. id: res.data,
  1236. team_status: "DRAFT",
  1237. }),
  1238. },
  1239. (router) => {
  1240. console.log(router);
  1241. router.meta.title = "乐团编辑中";
  1242. }
  1243. );
  1244. this.$emit("getName", this.topFrom.name);
  1245. this.init();
  1246. return true;
  1247. });
  1248. }
  1249. });
  1250. }
  1251. // 发请求
  1252. }
  1253. });
  1254. });
  1255. },
  1256. changeApplyTime(val) {
  1257. this.$set(this.topFrom, "paymentValidStartDate", "");
  1258. this.$set(this.topFrom, "paymentValidEndDate", "");
  1259. // this.topFrom.paymentValidStartDate = ''
  1260. // this.topFrom.paymentValidEndDate = ''
  1261. },
  1262. onReset() {
  1263. this.topFrom = {
  1264. type: "", // 收费类型
  1265. section: "", //所属分部
  1266. school: "", // 合作单位
  1267. courseViewType: "",
  1268. teacher: "", // 乐团主管
  1269. name: "", //乐团名称
  1270. boss: "", // 运营主管
  1271. time: "", // 报名截止时间
  1272. startClass: [], // 招生年级起始
  1273. paymentValid: [], // 缴费有效期时间起始
  1274. address: "", // 教学地点
  1275. salary: "", // 收费模式
  1276. head: "",
  1277. paymentPattern: "", // 缴费方式
  1278. isClass: false, //是否为课堂课
  1279. startTime: "",
  1280. ownershipType: "OWN", // 合作机构类型
  1281. feeType: null,
  1282. homeworkPushFlag: 1,
  1283. isGiveAccessories: 0,
  1284. memberCourseShowFlag: 0,
  1285. extracurricularTeacher: "NORMAL",
  1286. musicGroupPlanMakingId: '',
  1287. firstRecruitGrade: '',
  1288. defaultChargeStandard: '',
  1289. singleTrainMinutes: '',
  1290. coursePlan: '',
  1291. graduateGrade: '',
  1292. saleActivityDesc: '',
  1293. };
  1294. this.$refs["topinfo"].resetFields();
  1295. },
  1296. onGoHome() {
  1297. if (this.paymentNum <= 0) {
  1298. this.$message.error("当前缴费人数为0,无法开团");
  1299. return;
  1300. }
  1301. this.$confirm(`是否确认开团?`, "提示", {
  1302. confirmButtonText: "确定",
  1303. cancelButtonText: "取消",
  1304. type: "warning",
  1305. })
  1306. .then(() => {
  1307. musicGroupFound({
  1308. musicGroupId: this.$route.query.id,
  1309. }).then((res) => {
  1310. if (res.code == 200) {
  1311. // let query = this.$route.query;
  1312. // this.$message.success("开启成功");
  1313. // this.$router.push({
  1314. // path: "/teamList",
  1315. // query: {
  1316. // ...query,
  1317. // },
  1318. // });
  1319. this.onCancel();
  1320. }
  1321. });
  1322. })
  1323. .catch(() => {});
  1324. },
  1325. payStart() {
  1326. this.paymentStatus = true;
  1327. },
  1328. getStudentStatus() {
  1329. let obj = {
  1330. musicGroupId: this.teamid,
  1331. page: 1,
  1332. rows: 9999,
  1333. };
  1334. if (!this.teamid) return;
  1335. getStudentList(obj).then((res) => {
  1336. if (res.code == 200) {
  1337. res.data.rows.forEach((item) => {
  1338. // '未开启缴费', '开启缴费', '已缴费'
  1339. if (item.paymentStatus == 2) {
  1340. this.paymentNum += 1;
  1341. }
  1342. });
  1343. // this.rightList = res.data.rows;
  1344. // this.rules.total = res.data.total;
  1345. // return res;
  1346. }
  1347. });
  1348. },
  1349. payDate() {
  1350. let self = this;
  1351. return {
  1352. firstDayOfWeek: 1,
  1353. disabledDate(time) {
  1354. if (self.applyExpireDate) {
  1355. return (
  1356. time.getTime() <=
  1357. new Date(self.applyExpireDate.replace(/-/g, "/")).getTime()
  1358. );
  1359. } else {
  1360. return false;
  1361. }
  1362. },
  1363. };
  1364. },
  1365. onStartPayment(formName) {
  1366. // 开启缴费
  1367. this.$refs[formName].validate((valid) => {
  1368. if (valid) {
  1369. musicGroupOpenPay({
  1370. musicGroupId: this.teamid,
  1371. expireDate: this.paymentForm.paymentExpireDate,
  1372. // feeType: this.paymentForm.feeType
  1373. }).then((res) => {
  1374. if (res.code == 200) {
  1375. this.$message.success("开启成功");
  1376. this.paymentStatus = false;
  1377. this.$store.dispatch("delVisitedViews", this.$route);
  1378. this.$router.push({ path: "/teamList" });
  1379. // this.$router.push({
  1380. // path: "/business/resetTeaming",
  1381. // query: {
  1382. // status: "PAY",
  1383. // id: this.$route.query.id,
  1384. // name: this.$route.query.name,
  1385. // },
  1386. // });
  1387. // this.team_status = "PAY";
  1388. // this.paymentExpireDate = this.paymentForm.paymentExpireDate;
  1389. // this.getList();
  1390. }
  1391. });
  1392. } else {
  1393. return false;
  1394. }
  1395. });
  1396. },
  1397. applyDate() {
  1398. let self = this;
  1399. return {
  1400. firstDayOfWeek: 1,
  1401. disabledDate(time) {
  1402. if (self.paymentExpireDate) {
  1403. return (
  1404. time.getTime() >
  1405. new Date(self.paymentExpireDate.replace(/-/g, "/")).getTime()
  1406. );
  1407. } else {
  1408. return false;
  1409. }
  1410. },
  1411. };
  1412. },
  1413. extendTime(isPay) {
  1414. this.isPay = isPay;
  1415. if (isPay) {
  1416. // 点击的延长缴费
  1417. this.extendForm.expireDate = this.paymentExpireDate;
  1418. } else {
  1419. // 点击的延长报名
  1420. this.extendForm.expireDate = this.applyExpireDate;
  1421. }
  1422. this.extendPaymentStatus = true;
  1423. },
  1424. onExtendPayment(formName, isPay) {
  1425. this.$refs[formName].validate((valid) => {
  1426. if (valid) {
  1427. if (!isPay) {
  1428. extensionApplyExpire({
  1429. musicGroupId: this.teamid,
  1430. expireDate: this.extendForm.expireDate,
  1431. }).then((res) => {
  1432. if (res.code == 200) {
  1433. this.$message.success("延长报名成功");
  1434. this.extendPaymentStatus = false;
  1435. getTeamBaseInfo({ musicGroupId: this.teamid }).then((res) => {
  1436. if (res.code == 200) {
  1437. this.applyExpireDate = res.data.musicGroup.applyExpireDate;
  1438. this.setBase(res);
  1439. }
  1440. });
  1441. } else {
  1442. this.$message.error(res.msg);
  1443. }
  1444. });
  1445. } else {
  1446. extensionPayment({
  1447. musicGroupId: this.teamid,
  1448. expireDate: this.extendForm.expireDate,
  1449. }).then((res) => {
  1450. if (res.code == 200) {
  1451. this.$message.success("延长缴费成功");
  1452. this.extendPaymentStatus = false;
  1453. getTeamBaseInfo({ musicGroupId: this.teamid }).then((res) => {
  1454. if (res.code == 200) {
  1455. this.paymentExpireDate =
  1456. res.data.musicGroup.paymentExpireDate;
  1457. }
  1458. });
  1459. } else {
  1460. this.$message.error(res.msg);
  1461. }
  1462. });
  1463. }
  1464. }
  1465. });
  1466. },
  1467. onCreateQRCode(type) {
  1468. // 生成报名二维码
  1469. let id = this.teamid;
  1470. this.codeStatus = true;
  1471. if (type == "payment") {
  1472. this.codeTitle = "学员报名链接";
  1473. this.qrCodeUrl = vaildStudentUrl() + "/#/login?musicGroupId=" + id;
  1474. } else if (type == "detail") {
  1475. let teamName = this.$route.query.name;
  1476. this.codeTitle = "报名缴费详情";
  1477. this.qrCodeUrl =
  1478. vaildTeacherUrl() +
  1479. "/#/order?musicGroupId=" +
  1480. id +
  1481. "&musicGroupName=" +
  1482. teamName;
  1483. } else if (type == "rePayment") {
  1484. this.codeTitle = "学生报名链接(无乐器)";
  1485. this.qrCodeUrl =
  1486. vaildStudentUrl() + "/#/login?musicGroupId=" + id + "&instrument=1";
  1487. }
  1488. },
  1489. gotoStudentList() {
  1490. this.$router.push({
  1491. query: merge(this.$route.query, { tabrouter: 7 }),
  1492. });
  1493. // this.$router.replace({query:{...this.$route.query,tabrouter:7}})
  1494. },
  1495. setBase(res) {
  1496. this.topFrom.name = res.data.musicGroup.name;
  1497. this.$emit("getName", this.topFrom.name);
  1498. this.topFrom.time = res.data.musicGroup.applyExpireDate;
  1499. this.topFrom.type = res.data.musicGroup.chargeTypeId;
  1500. this.topFrom.startClass = res.data.musicGroup.enrollClasses.split(",");
  1501. this.topFrom.paymentPattern = res.data.musicGroup.paymentPattern;
  1502. this.topFrom.paymentValidStartDate =
  1503. res.data.musicGroup.paymentValidStartDate;
  1504. this.topFrom.paymentValidEndDate =
  1505. res.data.musicGroup.paymentValidEndDate;
  1506. this.topFrom.section = res.data.musicGroup.organId;
  1507. this.topFrom.courseViewType = res.data.musicGroup.courseViewType;
  1508. this.topFrom.school = res.data.musicGroup.cooperationOrganId;
  1509. this.topFrom.teacher = res.data.musicGroup.educationalTeacherId;
  1510. this.topFrom.boss = res.data.musicGroup.teamTeacherId;
  1511. this.topFrom.address = res.data.musicGroup.schoolId;
  1512. // this.topFrom.salary = res.data.musicGroup.settlementType;
  1513. this.topFrom.head = res.data.musicGroup.directorUserId
  1514. ? res.data.musicGroup.directorUserId
  1515. : null;
  1516. this.topFrom.isClass = res.data.musicGroup.isClassroomLessons;
  1517. this.topFrom.startTime = res.data.musicGroup.expectStartGroupDate;
  1518. this.topFrom.ownershipType = res.data.musicGroup.ownershipType;
  1519. this.topFrom.repairUserId = res.data.musicGroup.repairUserId
  1520. ? res.data.musicGroup.repairUserId
  1521. : null;
  1522. this.topFrom.feeType = res.data.musicGroup.feeType
  1523. ? res.data.musicGroup.feeType
  1524. : null;
  1525. this.paymentExpireDate = res.data.musicGroup.paymentExpireDate;
  1526. this.applyExpireDate = res.data.musicGroup.applyExpireDate;
  1527. this.topFrom.transactionTeacherId =
  1528. res.data.musicGroup.transactionTeacherId || "";
  1529. this.topFrom.homeworkPushFlag = res.data.musicGroup.homeworkPushFlag;
  1530. this.topFrom.isGiveAccessories = res.data.musicGroup.isGiveAccessories
  1531. ? 1
  1532. : 0;
  1533. this.topFrom.memberCourseShowFlag = res.data.musicGroup
  1534. .memberCourseShowFlag
  1535. ? 1
  1536. : 0;
  1537. this.topFrom.extracurricularTeacher =
  1538. res.data.musicGroup.extracurricularTeacher;
  1539. this.topFrom.musicGroupPlanMakingId =
  1540. res.data.musicGroup.musicGroupPlanMakingId;
  1541. this.topFrom.firstRecruitGrade =
  1542. res.data.musicGroup.firstRecruitGrade;
  1543. this.topFrom.defaultChargeStandard =
  1544. res.data.musicGroup.defaultChargeStandard;
  1545. this.topFrom.singleTrainMinutes =
  1546. res.data.musicGroup.singleTrainMinutes;
  1547. this.topFrom.coursePlan =
  1548. res.data.musicGroup.coursePlan;
  1549. this.topFrom.graduateGrade =
  1550. res.data.musicGroup.graduateGrade;
  1551. this.topFrom.saleActivityDesc =
  1552. res.data.musicGroup.saleActivityDesc;
  1553. localStorage.setItem(`${this.teamid}base`, JSON.stringify(this.topFrom));
  1554. },
  1555. changeType(val) {
  1556. if (val) {
  1557. localStorage.removeItem(`${this.teamid}sound`);
  1558. }
  1559. },
  1560. checkCourseView(val) {
  1561. if (this.teamStatus == "newTeam" || this.teamStatus == "teamDraft") {
  1562. return false;
  1563. } else {
  1564. if (
  1565. this.topFrom.courseViewType == 0 ||
  1566. this.topFrom.courseViewType == 1
  1567. ) {
  1568. // val ==2
  1569. return false;
  1570. } else {
  1571. return val == 0 || val == 1;
  1572. }
  1573. }
  1574. },
  1575. },
  1576. computed: {
  1577. startClassString() {
  1578. return this.topFrom.startClass
  1579. .map((item) => {
  1580. for (let i in this.classStatus) {
  1581. if (item == this.classStatus[i].value) {
  1582. return this.classStatus[i].label;
  1583. }
  1584. }
  1585. // return this.classStatus[item]
  1586. })
  1587. .join(",");
  1588. },
  1589. showNext() {
  1590. const teamStatus = this.teamStatus;
  1591. return (
  1592. teamStatus == "newTeam" ||
  1593. teamStatus == "teamDraft" ||
  1594. teamStatus == "teamAudit" ||
  1595. teamStatus == "feeAudit"
  1596. );
  1597. },
  1598. },
  1599. };
  1600. </script>
  1601. <style lang="scss" >
  1602. .messageBox-prompt-test {
  1603. .el-message-box__status {
  1604. top: 25% !important;
  1605. }
  1606. }
  1607. .base-container {
  1608. overflow: auto;
  1609. // display: flex;
  1610. // flex-direction: row;
  1611. // justify-content: flex-start;
  1612. // flex-wrap: nowrap;
  1613. font-size: 14px;
  1614. color: #444;
  1615. // width: fill-available;
  1616. .banseLeft {
  1617. // width: 1050px;
  1618. .head {
  1619. height: 48px;
  1620. line-height: 48px;
  1621. background-color: #edeef0;
  1622. font-size: 14px;
  1623. font-weight: bold;
  1624. color: #444;
  1625. padding: 0 11px;
  1626. margin-bottom: 20px;
  1627. }
  1628. .noMargin.head {
  1629. margin-bottom: 0;
  1630. }
  1631. .num {
  1632. padding: 15px 11px;
  1633. }
  1634. .checkRow {
  1635. min-width: 1200px;
  1636. padding-left: 28px;
  1637. display: flex;
  1638. flex-direction: row;
  1639. justify-content: flex-start;
  1640. flex-wrap: nowrap;
  1641. overflow: auto;
  1642. .el-checkbox {
  1643. line-height: 72px;
  1644. width: 120px;
  1645. }
  1646. .inputWrap {
  1647. line-height: 72px;
  1648. font-size: 14px;
  1649. color: #777;
  1650. margin-left: 65px;
  1651. input {
  1652. // border: none;
  1653. // width: 80px;
  1654. // margin-right: 10px;
  1655. // outline: none;
  1656. }
  1657. }
  1658. .inputWrap.rightFirst {
  1659. margin-left: 245px;
  1660. }
  1661. .textWrap {
  1662. display: flex;
  1663. flex-direction: row;
  1664. justify-content: flex-start;
  1665. font-size: 14px;
  1666. color: #777;
  1667. align-items: center;
  1668. span {
  1669. color: #f97215;
  1670. }
  1671. }
  1672. .selectWrap {
  1673. font-size: 14px;
  1674. padding-top: 5px;
  1675. margin-left: 100px;
  1676. margin-right: 52px;
  1677. .rowSelect {
  1678. .el-input__inner {
  1679. min-height: 69px;
  1680. }
  1681. }
  1682. }
  1683. .chioseList {
  1684. display: flex;
  1685. flex-direction: row;
  1686. justify-content: flex-start;
  1687. align-items: center;
  1688. font-size: 14px;
  1689. color: #777;
  1690. margin-left: 64px;
  1691. .chioseItem {
  1692. width: 80px;
  1693. height: 30px;
  1694. border-radius: 15px;
  1695. border: 1px solid #979797;
  1696. margin-right: 10px;
  1697. line-height: 30px;
  1698. text-align: center;
  1699. cursor: pointer;
  1700. }
  1701. .chioseItem.active {
  1702. background-color: var(--color-primary);
  1703. border: 1px solid var(--color-primary);
  1704. color: #fff;
  1705. }
  1706. }
  1707. // &:nth-child(even) {
  1708. // background-color: #c6cbd4;
  1709. // input {
  1710. // background-color: #c6cbd4;
  1711. // }
  1712. // }
  1713. }
  1714. }
  1715. .btnWrap {
  1716. margin-top: 30px;
  1717. }
  1718. .el-checkbox__input.is-checked + .el-checkbox__label {
  1719. color: #606266;
  1720. }
  1721. .subTitle {
  1722. // width: 1203px;
  1723. height: 40px;
  1724. line-height: 40px;
  1725. background-color: #fefceb;
  1726. padding: 0 25px;
  1727. box-sizing: border-box;
  1728. font-size: 16px;
  1729. color: #474747;
  1730. margin-bottom: 20px;
  1731. }
  1732. .chioseWrap {
  1733. margin-bottom: 30px;
  1734. display: flex;
  1735. flex-direction: row;
  1736. padding: 0 25px;
  1737. p {
  1738. width: 80px;
  1739. font-size: 14px;
  1740. // margin-right: 30px;
  1741. }
  1742. }
  1743. .classCheckBox {
  1744. margin-right: 10px;
  1745. }
  1746. }
  1747. </style>
  1748. <style scoped lang="scss">
  1749. .banseLeft {
  1750. :deep(.el-form--inline) {
  1751. .el-form-item__content {
  1752. display: block;
  1753. }
  1754. }
  1755. ::v-deep .el-select {
  1756. width: 300px !important;
  1757. }
  1758. ::v-deep .el-date-editor {
  1759. width: 300px !important;
  1760. }
  1761. ::v-deep .el-checkbox {
  1762. margin-left: 15px !important;
  1763. }
  1764. ::v-deep .el-input {
  1765. position: relative;
  1766. font-size: 14px;
  1767. display: inline-block;
  1768. width: 300px;
  1769. }
  1770. }
  1771. input[disabled] {
  1772. background-color: #fff;
  1773. border-color: #b3b3b3;
  1774. color: #606266;
  1775. }
  1776. ::v-deep .el-radio-button__orig-radio:checked + .el-radio-button__inner {
  1777. background-color: #00a79d;
  1778. border-color: #00a79d;
  1779. // -webkit-box-shadow: -1px 0 0 0 rgb (19, 129, 122);
  1780. box-shadow: -1px 0 0 #00a79d;
  1781. color: #fff;
  1782. outline: none;
  1783. }
  1784. ::v-deep .el-radio-button__inner {
  1785. &:hover {
  1786. color: #00a79d;
  1787. }
  1788. outline: none;
  1789. }
  1790. ::v-deep .el-radio-button:focus:not(.is-focus):not(:active):not(.is-disabled) {
  1791. -webkit-box-shadow: none;
  1792. box-shadow: none;
  1793. }
  1794. </style>