initiationList.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520
  1. <template>
  2. <div class="forecastName">
  3. <!-- <h2> m-container
  4. <el-page-header @back="onCancel" :content="teamName"></el-page-header>
  5. </h2> -->
  6. <!-- <p style="margin-bottom: 15px; font-size: 18px; font-weight: 400">
  7. 缴费截止时间:{{ '2020-12-12' | formatTimer }}
  8. </p> -->
  9. <div class="btnList">
  10. <!-- <el-button type="primary" @click="codedetailStatus = true" v-if="isedit"
  11. >预报名详情</el-button
  12. > -->
  13. <auth :auths="['musicEnlightenmentQuestionnaire/sendParentMeetingNotice']" v-if="isedit">
  14. <el-button type="primary" @click="extendPaymentStatus = true"
  15. >启蒙课家长会通知</el-button
  16. >
  17. </auth>
  18. <auth :auths="['initiationList/forecastLink']" v-if="isedit">
  19. <el-button type="primary" @click="codeStatus = true"
  20. >启蒙课问卷</el-button
  21. >
  22. </auth>
  23. <auth :auths="['export/musicEnlightenmentQuestionnaires']">
  24. <el-button type="primary" @click="downloadFile"
  25. >启蒙课问卷导出</el-button
  26. >
  27. </auth>
  28. <auth :auths="['musicEnlightenmentQuestionnaire/musicEnlightenmentQuestionnaireStat']">
  29. <el-button type="primary" @click="subjectVisible = true"
  30. >启蒙课问卷统计</el-button
  31. >
  32. </auth>
  33. </div>
  34. <div class="m-core">
  35. <save-form
  36. :inline="true"
  37. @reset="onReSet"
  38. @submit="search"
  39. :model="searchForm"
  40. ref="searchForm"
  41. >
  42. <el-form-item prop="search">
  43. <el-input
  44. v-model.trim="searchForm.search"
  45. clearable
  46. @keyup.enter.native="search"
  47. placeholder="学生编号/姓名/手机号"
  48. ></el-input>
  49. </el-form-item>
  50. <el-form-item prop="currentGradeNum">
  51. <!-- <el-input
  52. v-model.trim="searchForm.currentGrade"
  53. clearable
  54. placeholder="学员年级"
  55. ></el-input> -->
  56. <el-select
  57. v-model.trim="searchForm.currentGradeNum"
  58. filterable
  59. clearable
  60. placeholder="请选择年级"
  61. >
  62. <el-option
  63. v-for="(item, index) in gradeList"
  64. :key="index"
  65. :label="item.label"
  66. :value="item.value"
  67. ></el-option>
  68. </el-select>
  69. </el-form-item>
  70. <el-form-item prop="teacherRecommandSubjectId">
  71. <el-select
  72. clearable
  73. v-model="searchForm.teacherRecommandSubjectId"
  74. filterable
  75. placeholder="老师推荐声部"
  76. >
  77. <el-option
  78. v-for="item in subjectList"
  79. :value="item.id"
  80. :label="item.name"
  81. :key="item.id"
  82. ></el-option>
  83. </el-select>
  84. </el-form-item>
  85. <el-form-item prop="musicalInstrumentsLearning">
  86. <el-select
  87. clearable
  88. v-model="searchForm.musicalInstrumentsLearning"
  89. placeholder="是否正在学习某乐器"
  90. >
  91. <el-option value="true" label="是"></el-option>
  92. <el-option value="false" label="否"></el-option>
  93. </el-select>
  94. </el-form-item>
  95. <el-form-item>
  96. <el-button type="danger" native-type="seach">搜索</el-button>
  97. <el-button native-type="reset" type="primary">重置</el-button>
  98. </el-form-item>
  99. </save-form>
  100. <div class="tableWrap">
  101. <el-table
  102. style="width: 100%"
  103. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  104. :data="tableList"
  105. >
  106. <el-table-column align="center" prop="userId" label="学员编号">
  107. <template slot-scope="scope">
  108. <copy-text>{{ scope.row.userId }}</copy-text>
  109. </template>
  110. </el-table-column>
  111. <el-table-column
  112. align="center"
  113. prop="userName"
  114. label="学员姓名"
  115. ></el-table-column>
  116. <!-- <el-table-column align="center" prop="gender" label="性别">
  117. <template slot-scope="scope">
  118. {{ scope.row.gender ? "男" : "女" }}
  119. </template>
  120. </el-table-column> -->
  121. <el-table-column align="center" prop="phone" label="联系电话">
  122. <template slot-scope="scope">
  123. <copy-text>{{ scope.row.phone }}</copy-text>
  124. </template>
  125. </el-table-column>
  126. <el-table-column align="center" label="年级班级">
  127. <template slot-scope="scope">
  128. {{ scope.row.currentGrade }}{{ scope.row.currentClass }}
  129. </template>
  130. </el-table-column>
  131. <el-table-column
  132. align="center"
  133. prop="teacherRecommandSubjectId"
  134. label="老师推荐声部"
  135. >
  136. <template slot-scope="scope">
  137. <div>
  138. {{
  139. scope.row.teacherRecommandSubjectId==-1
  140. ? scope.row.subjectName
  141. : "无"
  142. }}
  143. </div>
  144. </template>
  145. </el-table-column>
  146. <el-table-column
  147. align="center"
  148. prop="musicalInstrumentsLearning"
  149. label="是否在学习某件乐器"
  150. >
  151. <template slot-scope="scope">
  152. <div>
  153. {{ scope.row.musicalInstrumentsLearning ? "是" : "否" }}
  154. </div>
  155. </template>
  156. </el-table-column>
  157. <el-table-column align="center" prop="userName" label="目前所学乐器">
  158. <template slot-scope="scope">
  159. <div>
  160. {{
  161. scope.row.musicalInstrumentsLearning
  162. ? scope.row.musicalInstrumentsName
  163. : "否"
  164. }}
  165. </div>
  166. </template>
  167. </el-table-column>
  168. <el-table-column
  169. align="center"
  170. prop="userName"
  171. label="报名参加管乐团家长会了解相关情况"
  172. >
  173. <template slot-scope="scope">
  174. <div>
  175. {{ scope.row.joinParentMeeting ? "是" : "否" }}
  176. </div>
  177. </template>
  178. </el-table-column>
  179. <el-table-column
  180. align="center"
  181. prop="remark"
  182. label="备注"
  183. width="240px"
  184. >
  185. <template slot-scope="scope">
  186. <overflow-text width="200px" :text="scope.row.remark" />
  187. </template>
  188. </el-table-column>
  189. </el-table>
  190. <pagination
  191. sync
  192. :total.sync="pageInfo.total"
  193. :page.sync="pageInfo.page"
  194. :limit.sync="pageInfo.limit"
  195. :page-sizes="pageInfo.page_size"
  196. @pagination="getList"
  197. />
  198. </div>
  199. </div>
  200. <!-- 预报名链接 -->
  201. <qr-code
  202. v-model="codeStatus"
  203. title="启蒙课问卷"
  204. :codeUrl="codeUrl"
  205. @preLook="preLook"
  206. :ispreLook="true"
  207. />
  208. <!-- 预报名详情 -->
  209. <qr-code
  210. v-model="codedetailStatus"
  211. title="预报名详情"
  212. :codeUrl="detailUrl"
  213. />
  214. <!-- 发送家长会通知 -->
  215. <el-dialog
  216. title="发送家长会通知"
  217. :visible.sync="extendPaymentStatus"
  218. @close="onClose('extendForm')"
  219. width="400px"
  220. >
  221. <el-form
  222. label-width="110px"
  223. :model="extendForm"
  224. ref="extendForm"
  225. :rules="extendRule"
  226. >
  227. <el-form-item label="家长会时间" prop="meetingDate">
  228. <el-date-picker
  229. style="width: 100% !important"
  230. value-format="yyyy-MM-dd HH:mm:ss"
  231. v-model.trim="extendForm.meetingDate"
  232. type="datetime"
  233. :picker-options="applyDates"
  234. placeholder="请选择家长会时间"
  235. >
  236. </el-date-picker>
  237. </el-form-item>
  238. <el-form-item label="家长会地址" prop="address">
  239. <el-input
  240. v-model="extendForm.address"
  241. placeholder="请输入家长会地址"
  242. ></el-input>
  243. </el-form-item>
  244. <el-form-item label="短信内容" >
  245. <p class="msgP" v-html="sysMsgStr"></p> </el-form-item>
  246. <p style="color:red">确认后该短信将发送给已填写启蒙课问卷学员</p>
  247. </el-form>
  248. <div slot="footer" class="dialog-footer">
  249. <el-button @click="extendPaymentStatus = false">取 消</el-button>
  250. <el-button type="primary" @click="onExtendPayment('extendForm')"
  251. >确 定</el-button
  252. >
  253. </div>
  254. </el-dialog>
  255. <el-dialog
  256. title="启蒙课统计"
  257. width="600px"
  258. destroy-on-close
  259. :close-on-click-modal="false"
  260. :visible.sync="subjectVisible"
  261. >
  262. <intention-model v-if="subjectVisible" @close="subjectVisible = false" />
  263. </el-dialog>
  264. <el-dialog
  265. title="预览"
  266. width="500px"
  267. :close-on-click-modal="false"
  268. append-to-body
  269. :visible.sync="preLookVisible"
  270. >
  271. <iframe
  272. width="100%"
  273. height="600px"
  274. :src="codeUrl + '&look=true'"
  275. frameborder="0"
  276. ></iframe>
  277. </el-dialog>
  278. </div>
  279. </template>
  280. <script>
  281. import pagination from "@/components/Pagination/index";
  282. import qrCode from "@/components/QrCode/index";
  283. import { permission } from "@/utils/directivePage";
  284. import { vaildStudentUrl, vaildTeachingUrl } from "@/utils/validate";
  285. import { Export } from "@/utils/downLoadFile";
  286. import visitModel from "@/views/withdrawal-application/modals/visit";
  287. import intentionModel from "./modals/initiationStatistics";
  288. import { getMusicGroupGradeList } from "@/api/buildTeam";
  289. import {
  290. getSysMessageConfig,
  291. finishPreApply,
  292. sendEnlighParentMeetingNotice,
  293. getMusicEnlighList,
  294. } from "./api";
  295. export default {
  296. name: "forecastName",
  297. components: { pagination, qrCode, visitModel, intentionModel },
  298. props: ["isedit"],
  299. data() {
  300. const query = this.$route.query;
  301. return {
  302. codedetailStatus: false,
  303. teamName: query.name || null,
  304. codeStatus: false,
  305. musicGroupId: query.id,
  306. codeUrl:
  307. vaildStudentUrl() +
  308. "/project/forecastName/initiation.html?musicGroupId=" +
  309. query.id,
  310. detailUrl:
  311. vaildTeachingUrl() + "/#/preApplySubject?musicGroupId=" + query.id,
  312. searchForm: {
  313. search: null,
  314. currentGradeNum: null,
  315. subjectId: null,
  316. teacherRecommandSubjectId: null,
  317. selectionSubjectId: null,
  318. musicalInstrumentsLearning: null,
  319. },
  320. tableList: [],
  321. pageInfo: {
  322. // 分页规则
  323. limit: 10, // 限制显示条数
  324. page: 1, // 当前页
  325. total: 0, // 总条数
  326. page_size: [10, 20, 40, 50], // 选择限制显示条数
  327. },
  328. visitVisible: false,
  329. subjectVisible: false,
  330. visitDetail: null,
  331. extendPaymentStatus: false,
  332. extendForm: {
  333. meetingDate: null,
  334. address: null,
  335. },
  336. extendRule: {
  337. meetingDate: [
  338. { required: true, message: "请选择家长会时间", trigger: "change" },
  339. ],
  340. address: [
  341. { required: true, message: "请输入家长会地址", trigger: "blur" },
  342. ],
  343. },
  344. gradeList: [],
  345. preLookVisible: false,
  346. sysMsg: "",
  347. subjectList:[]
  348. };
  349. },
  350. async mounted() {
  351. await this.$store.dispatch("setSubjects");
  352. this.subjectList = [...this.selects.subjects]
  353. this.subjectList.push({id:-1,name:'无'})
  354. this.init();
  355. },
  356. methods: {
  357. async init() {
  358. this.teamid = this.$route.query.id;
  359. getMusicGroupGradeList({ musicGroupId: this.teamid }).then((res) => {
  360. let result = res.data;
  361. this.gradeListObj = res.data;
  362. if (res.code == 200 && result) {
  363. this.gradeList = [];
  364. for (let i in result) {
  365. this.gradeList.push({
  366. value: i,
  367. label: result[i],
  368. });
  369. }
  370. }
  371. });
  372. // 获取短信推送模板
  373. const rus = await getSysMessageConfig({
  374. type: "STUDENT_SMS_IM_MUSIC_GROUP_PARENT_MEETING_NOTICE",
  375. });
  376. this.sysMsg = rus.data.content;
  377. this.getList();
  378. },
  379. permission,
  380. onReSet() {
  381. this.$refs["searchForm"].resetFields();
  382. this.search();
  383. },
  384. search() {
  385. this.pageInfo.page = 1;
  386. this.getList();
  387. },
  388. onCancel() {
  389. this.$store.dispatch("delVisitedViews", this.$route);
  390. this.$router.push({ path: "/teamList" });
  391. },
  392. downloadFile() {
  393. let params = this.searchForm;
  394. Export(
  395. this,
  396. {
  397. url: "/api-web/export/musicEnlightenmentQuestionnaires",
  398. params: {
  399. ...params,
  400. musicGroupId: this.musicGroupId,
  401. },
  402. fileName: "启蒙课问卷.xls",
  403. },
  404. "是否确认导出报表?"
  405. );
  406. },
  407. async getList() {
  408. try {
  409. const result = await getMusicEnlighList({
  410. ...this.searchForm,
  411. musicGroupId: this.musicGroupId,
  412. page: this.pageInfo.page,
  413. rows: this.pageInfo.limit,
  414. });
  415. this.tableList = result.data.rows;
  416. this.pageInfo.total = result.data.total;
  417. } catch (error) {}
  418. },
  419. async onPaymentGroup(type) {
  420. try {
  421. this.$confirm("您是否确定开启乐团缴费?", "提示", {
  422. confirmButtonText: "确定",
  423. cancelButtonText: "取消",
  424. type: "warning",
  425. }).then(async () => {
  426. const result = await finishPreApply({
  427. isCheckStudentNum: type == 1 ? false : true,
  428. musicGroupId: this.musicGroupId,
  429. });
  430. this.$store.dispatch("delVisitedViews", this.$route);
  431. this.$router.push({
  432. path: "/teamList",
  433. });
  434. });
  435. } catch (error) {}
  436. },
  437. addVisited(rows) {
  438. // 新增回访
  439. this.visitVisible = true;
  440. this.visitDetail = {
  441. musicGroupId: rows.musicGroupId,
  442. overview: "",
  443. purpose: "",
  444. userId: rows.userId,
  445. type: "",
  446. visitTime: "",
  447. visitType: "",
  448. feedback: "",
  449. realName: rows.userName,
  450. };
  451. // this.visitDetail = rows
  452. },
  453. onClose(formName) {
  454. this.$refs[formName].resetFields();
  455. },
  456. onExtendPayment(formName) {
  457. this.$refs[formName].validate(async (valid) => {
  458. if (valid) {
  459. try {
  460. await this.$confirm("您是否确定发送家长会通知?", "提示", {
  461. confirmButtonText: "确定",
  462. cancelButtonText: "取消",
  463. type: "warning",
  464. });
  465. await sendEnlighParentMeetingNotice({
  466. ...this.extendForm,
  467. musicGroupId: this.musicGroupId,
  468. });
  469. this.$message.success("家长会通知已发送");
  470. this.extendPaymentStatus = false;
  471. } catch (error) {}
  472. }
  473. });
  474. },
  475. applyDates() {
  476. return {
  477. firstDayOfWeek: 1,
  478. disabledDate(time) {
  479. if (end) {
  480. return new Date(end).getTime() - 86400000 >= time.getTime();
  481. } else {
  482. return time.getTime() + 86400000 < Date.now();
  483. //开始时间不选时,结束时间最大值小于等于当天
  484. }
  485. },
  486. };
  487. },
  488. preLook(val) {
  489. this.preLookVisible = true;
  490. },
  491. },
  492. computed: {
  493. sysMsgStr() {
  494. let strArr = this.sysMsg.split("{}");
  495. if (strArr.length == 3) {
  496. return `${strArr[0]}<span style="color:red">"${
  497. this.extendForm.meetingDate ? this.extendForm.meetingDate : "--"
  498. }"</span>${strArr[1]}<span style="color:red">"${this.extendForm.address ? this.extendForm.address:"--"}"</span>
  499. ${strArr[2]}`;
  500. } else {
  501. return ``;
  502. }
  503. },
  504. },
  505. };
  506. </script>
  507. <style lang="less" scoped>
  508. .msgP {
  509. line-height: 24px;
  510. margin-top: 10px;
  511. }
  512. </style>