forecastName.vue 16 KB

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