forecastName.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475
  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. <auth :auths="['forecastName/forecastLink']" v-if="isedit">
  11. <el-button type="primary" @click="codeStatus = true"
  12. >预报名链接</el-button
  13. >
  14. </auth>
  15. <el-button type="primary" @click="codedetailStatus = true" v-if="isedit"
  16. >预报名详情</el-button
  17. >
  18. <auth :auths="['musicGroup/sendParentMeetingNotice']" v-if="isedit">
  19. <el-button type="primary" @click="extendPaymentStatus = true"
  20. >家长会通知</el-button
  21. >
  22. </auth>
  23. <auth :auths="['musicGroup/finishPreApply']">
  24. <el-button type="primary" @click="onPaymentGroup" v-if="isedit"
  25. >乐团缴费</el-button
  26. >
  27. </auth>
  28. <auth :auths="['musicGroup/finishPreApply/item']" v-if="isedit">
  29. <el-button type="primary" @click="onPaymentGroup(1)"
  30. >特色乐团缴费</el-button
  31. >
  32. </auth>
  33. <auth :auths="['studentRegistration/preRegisterExport']">
  34. <el-button type="primary" @click="downloadFile">导出</el-button>
  35. </auth>
  36. <auth :auths="['studentRegistration/queryPreApplySubjectList']">
  37. <el-button type="primary" @click="subjectVisible = true"
  38. >意向统计</el-button
  39. >
  40. </auth>
  41. </div>
  42. <div class="m-core">
  43. <save-form
  44. :inline="true"
  45. @reset="onReSet"
  46. @submit="search"
  47. :model="searchForm"
  48. ref="searchForm"
  49. >
  50. <el-form-item prop="name">
  51. <el-input
  52. v-model.trim="searchForm.name"
  53. clearable
  54. @keyup.enter.native="search"
  55. placeholder="学生编号/姓名/手机号"
  56. ></el-input>
  57. </el-form-item>
  58. <el-form-item prop="isAllowAdjust">
  59. <el-select
  60. v-model.trim="searchForm.isAllowAdjust"
  61. clearable
  62. placeholder="是否允许调剂"
  63. >
  64. <el-option label="是" :value="1"></el-option>
  65. <el-option label="否" :value="0"></el-option>
  66. </el-select>
  67. </el-form-item>
  68. <el-form-item prop="subjectId">
  69. <el-select
  70. clearable
  71. v-model="searchForm.subjectId"
  72. placeholder="所选专业"
  73. >
  74. <el-option
  75. v-for="item in selects.subjects"
  76. :value="item.id"
  77. :label="item.name"
  78. :key="item.id"
  79. ></el-option>
  80. </el-select>
  81. </el-form-item>
  82. <!-- kitPurchaseMethod -->
  83. <el-form-item prop="kitPurchaseMethod">
  84. <el-select
  85. v-model.trim="searchForm.kitPurchaseMethod"
  86. clearable
  87. placeholder="乐器准备方式"
  88. >
  89. <el-option label="团购" value="GROUP"></el-option>
  90. <el-option label="自备" value="OWNED"></el-option>
  91. </el-select>
  92. </el-form-item>
  93. <el-form-item prop="cloudTeacherMethod">
  94. <el-select
  95. v-model.trim="searchForm.cloudTeacherMethod"
  96. clearable
  97. placeholder="系统意向"
  98. >
  99. <el-option label="团购" value="GROUP"></el-option>
  100. <el-option label="自备" value="OWNED"></el-option>
  101. </el-select>
  102. </el-form-item>
  103. <el-form-item>
  104. <el-button type="danger" native-type="seach">搜索</el-button>
  105. <el-button native-type="reset" type="primary">重置</el-button>
  106. </el-form-item>
  107. </save-form>
  108. <div class="tableWrap">
  109. <el-table
  110. style="width: 100%"
  111. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  112. :data="tableList"
  113. >
  114. <el-table-column align="center" prop="userId" label="学员编号">
  115. <template slot-scope="scope">
  116. <copy-text>{{ scope.row.userId }}</copy-text>
  117. </template>
  118. </el-table-column>
  119. <el-table-column
  120. align="center"
  121. prop="userName"
  122. label="学员姓名"
  123. ></el-table-column>
  124. <el-table-column align="center" prop="gender" label="性别">
  125. <template slot-scope="scope">
  126. {{ scope.row.gender ? "男" : "女" }}
  127. </template>
  128. </el-table-column>
  129. <el-table-column align="center" prop="phone" label="联系电话">
  130. <template slot-scope="scope">
  131. <copy-text>{{ scope.row.phone }}</copy-text>
  132. </template>
  133. </el-table-column>
  134. <el-table-column align="center" label="年级班级">
  135. <template slot-scope="scope">
  136. {{ scope.row.currentGrade }}{{ scope.row.currentClass }}
  137. </template>
  138. </el-table-column>
  139. <el-table-column
  140. align="center"
  141. prop="subjectFirstName"
  142. label="选报声部1"
  143. >
  144. <template slot-scope="scope">
  145. {{
  146. scope.row.subjectFirstName ? scope.row.subjectFirstName : null
  147. }}
  148. {{
  149. !scope.row.subjectFirstName && scope.row.subjectFirst == 999
  150. ? "听从老师安排"
  151. : null
  152. }}
  153. </template>
  154. </el-table-column>
  155. <el-table-column
  156. align="center"
  157. prop="subjectSecondName"
  158. label="选报声部2"
  159. >
  160. <template slot-scope="scope">
  161. {{
  162. scope.row.subjectSecondName ? scope.row.subjectSecondName : null
  163. }}
  164. {{
  165. !scope.row.subjectSecondName && scope.row.subjectSecond == 999
  166. ? "听从老师安排"
  167. : null
  168. }}
  169. </template>
  170. </el-table-column>
  171. <el-table-column
  172. align="center"
  173. prop="isAllowAdjust"
  174. label="是否服从调剂"
  175. >
  176. <template slot-scope="scope">
  177. {{ scope.row.isAllowAdjust ? "是" : "否" }}
  178. </template>
  179. </el-table-column>
  180. <el-table-column align="center" label="乐器准备方式">
  181. <template slot-scope="scope">
  182. {{ scope.row.kitPurchaseMethod | instrumentType }}
  183. </template>
  184. </el-table-column>
  185. <el-table-column align="center" label="系统意向">
  186. <template slot-scope="scope">
  187. {{ scope.row.cloudTeacherMethod | instrumentType }}
  188. </template>
  189. </el-table-column>
  190. <el-table-column
  191. align="center"
  192. prop="courseScheduleId"
  193. width="150"
  194. label="操作"
  195. v-if="isedit"
  196. >
  197. <!-- :router="['/business/forecastName']" -->
  198. <template slot-scope="scope">
  199. <auth :auths="['visit/add/teamForecastName']">
  200. <el-button type="text" @click="addVisited(scope.row)"
  201. >新增回访</el-button
  202. >
  203. </auth>
  204. </template>
  205. </el-table-column>
  206. </el-table>
  207. <pagination
  208. sync
  209. :total.sync="pageInfo.total"
  210. :page.sync="pageInfo.page"
  211. :limit.sync="pageInfo.limit"
  212. :page-sizes="pageInfo.page_size"
  213. @pagination="getList"
  214. />
  215. </div>
  216. </div>
  217. <!-- 预报名链接 -->
  218. <qr-code v-model="codeStatus" title="预报名二维码" :codeUrl="codeUrl" />
  219. <!-- 预报名详情 -->
  220. <qr-code v-model="codedetailStatus" title="预报名二维码" :codeUrl="detailUrl" />
  221. <!-- 发送家长会通知 -->
  222. <el-dialog
  223. title="发送家长会通知"
  224. :visible.sync="extendPaymentStatus"
  225. @close="onClose('extendForm')"
  226. width="400px"
  227. >
  228. <el-form
  229. label-width="110px"
  230. :model="extendForm"
  231. ref="extendForm"
  232. :rules="extendRule"
  233. >
  234. <el-form-item label="家长会时间" prop="meetingDate">
  235. <el-date-picker
  236. style="width: 100% !important"
  237. value-format="yyyy-MM-dd HH:mm:ss"
  238. v-model.trim="extendForm.meetingDate"
  239. type="datetime"
  240. :picker-options="applyDates"
  241. placeholder="请选择家长会时间"
  242. >
  243. </el-date-picker>
  244. </el-form-item>
  245. <el-form-item label="家长会地址" prop="address">
  246. <el-input
  247. v-model="extendForm.address"
  248. placeholder="请输入家长会地址"
  249. ></el-input>
  250. </el-form-item>
  251. </el-form>
  252. <div slot="footer" class="dialog-footer">
  253. <el-button @click="extendPaymentStatus = false">取 消</el-button>
  254. <el-button type="primary" @click="onExtendPayment('extendForm')"
  255. >确 定</el-button
  256. >
  257. </div>
  258. </el-dialog>
  259. <!-- 回访记录 -->
  260. <el-dialog
  261. title="新增回访"
  262. width="600px"
  263. destroy-on-close
  264. :close-on-click-modal="false"
  265. :visible.sync="visitVisible"
  266. >
  267. <visit-model
  268. v-if="visitVisible"
  269. @close="visitVisible = false"
  270. :detail="visitDetail"
  271. @submited="getList"
  272. />
  273. </el-dialog>
  274. <!-- 回访记录 -->
  275. <el-dialog
  276. title="意向列表"
  277. width="600px"
  278. destroy-on-close
  279. :close-on-click-modal="false"
  280. :visible.sync="subjectVisible"
  281. >
  282. <intention-model v-if="subjectVisible" @close="subjectVisible = false" />
  283. </el-dialog>
  284. </div>
  285. </template>
  286. <script>
  287. import pagination from "@/components/Pagination/index";
  288. import qrCode from "@/components/QrCode/index";
  289. import { permission } from "@/utils/directivePage";
  290. import { vaildStudentUrl,vaildTeachingUrl } from "@/utils/validate";
  291. import { Export } from "@/utils/downLoadFile";
  292. import visitModel from "@/views/withdrawal-application/modals/visit";
  293. import intentionModel from "./modals/intention";
  294. import {
  295. queryPreApplyList,
  296. finishPreApply,
  297. sendParentMeetingNotice,
  298. } from "./api";
  299. export default {
  300. name: "forecastName",
  301. components: { pagination, qrCode, visitModel, intentionModel },
  302. props: ["isedit"],
  303. data() {
  304. const query = this.$route.query;
  305. return {
  306. codedetailStatus:false,
  307. teamName: query.name || null,
  308. codeStatus: false,
  309. musicGroupId: query.id,
  310. codeUrl:
  311. vaildStudentUrl() +
  312. "/project/forecastName/index.html?musicGroupId=" +
  313. query.id,
  314. detailUrl:vaildTeachingUrl()+'/#/preApplySubject?musicGroupId='+query.id,
  315. searchForm: {
  316. name: null,
  317. subjectId: null,
  318. isAllowAdjust: null,
  319. cloudTeacherMethod: null,
  320. kitPurchaseMethod: null,
  321. },
  322. tableList: [],
  323. pageInfo: {
  324. // 分页规则
  325. limit: 10, // 限制显示条数
  326. page: 1, // 当前页
  327. total: 0, // 总条数
  328. page_size: [10, 20, 40, 50], // 选择限制显示条数
  329. },
  330. visitVisible: false,
  331. subjectVisible: false,
  332. visitDetail: null,
  333. extendPaymentStatus: false,
  334. extendForm: {
  335. meetingDate: null,
  336. address: null,
  337. },
  338. extendRule: {
  339. meetingDate: [
  340. { required: true, message: "请选择家长会时间", trigger: "change" },
  341. ],
  342. address: [
  343. { required: true, message: "请输入家长会地址", trigger: "blur" },
  344. ],
  345. },
  346. };
  347. },
  348. mounted() {
  349. this.$store.dispatch("setSubjects");
  350. this.getList();
  351. },
  352. methods: {
  353. permission,
  354. onReSet() {
  355. this.$refs["searchForm"].resetFields();
  356. this.search();
  357. },
  358. search() {
  359. this.pageInfo.page = 1;
  360. this.getList();
  361. },
  362. onCancel() {
  363. this.$store.dispatch("delVisitedViews", this.$route);
  364. this.$router.push({ path: "/teamList" });
  365. },
  366. downloadFile() {
  367. let params = this.searchForm;
  368. Export(
  369. this,
  370. {
  371. url: "/api-web/studentRegistration/preRegisterExport",
  372. params: {
  373. ...params,
  374. musicGroupId: this.musicGroupId,
  375. },
  376. fileName: "预报名列表.xls",
  377. },
  378. "是否确认导出报表?"
  379. );
  380. },
  381. async getList() {
  382. try {
  383. const result = await queryPreApplyList({
  384. ...this.searchForm,
  385. musicGroupId: this.musicGroupId,
  386. page: this.pageInfo.page,
  387. rows: this.pageInfo.limit,
  388. });
  389. this.tableList = result.data.rows;
  390. this.pageInfo.total = result.data.total;
  391. } catch (error) {}
  392. },
  393. async onPaymentGroup(type) {
  394. try {
  395. this.$confirm("您是否确定开启乐团缴费?", "提示", {
  396. confirmButtonText: "确定",
  397. cancelButtonText: "取消",
  398. type: "warning",
  399. }).then(async () => {
  400. const result = await finishPreApply({
  401. isCheckStudentNum: type == 1 ? false : true,
  402. musicGroupId: this.musicGroupId,
  403. });
  404. this.$store.dispatch("delVisitedViews", this.$route);
  405. this.$router.push({
  406. path: "/teamList",
  407. });
  408. });
  409. } catch (error) {}
  410. },
  411. addVisited(rows) {
  412. // 新增回访
  413. this.visitVisible = true;
  414. this.visitDetail = {
  415. musicGroupId: rows.musicGroupId,
  416. overview: "",
  417. purpose: "",
  418. userId: rows.userId,
  419. type: "",
  420. visitTime: "",
  421. visitType: "",
  422. feedback: "",
  423. realName: rows.userName,
  424. };
  425. // this.visitDetail = rows
  426. },
  427. onClose(formName) {
  428. this.$refs[formName].resetFields();
  429. },
  430. onExtendPayment(formName) {
  431. this.$refs[formName].validate(async (valid) => {
  432. if (valid) {
  433. try {
  434. await this.$confirm("您是否确定发送家长会通知?", "提示", {
  435. confirmButtonText: "确定",
  436. cancelButtonText: "取消",
  437. type: "warning",
  438. });
  439. await sendParentMeetingNotice({
  440. ...this.extendForm,
  441. musicGroupId: this.musicGroupId,
  442. });
  443. this.$message.success("家长会通知已发送");
  444. this.extendPaymentStatus = false;
  445. } catch (error) {}
  446. }
  447. });
  448. },
  449. applyDates() {
  450. return {
  451. firstDayOfWeek: 1,
  452. disabledDate(time) {
  453. if (end) {
  454. return new Date(end).getTime() - 86400000 >= time.getTime();
  455. } else {
  456. return time.getTime() + 86400000 < Date.now();
  457. //开始时间不选时,结束时间最大值小于等于当天
  458. }
  459. },
  460. };
  461. },
  462. },
  463. };
  464. </script>
  465. <style lang="less" scoped>
  466. </style>