forecastName.vue 15 KB

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