forecastName.vue 15 KB

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