vipEvaluateList.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677
  1. <!-- -->
  2. <template>
  3. <div class="m-core">
  4. <el-form :inline="true"
  5. class="searchForm"
  6. v-model.trim="searchForm">
  7. <!-- 状态 指导老师 活动方案-->
  8. <el-form-item>
  9. <el-input v-model.trim="searchForm.search"
  10. @keyup.enter.native="search"
  11. placeholder="请输入课程组名称 ID"></el-input>
  12. </el-form-item>
  13. <el-form-item>
  14. <el-select placeholder="请选择分部"
  15. v-model="searchForm.organId"
  16. clearable>
  17. <el-option v-for="(item,index) in organList"
  18. :label="item.name"
  19. :value="item.id"
  20. :key="index"></el-option>
  21. </el-select>
  22. </el-form-item>
  23. <el-form-item>
  24. <el-select placeholder="指导老师"
  25. v-model="searchForm.teacherId"
  26. clearable
  27. filterable>
  28. <el-option v-for="(item,index) in teacherList"
  29. :label="item.realName"
  30. :value="item.id"
  31. :key="index"></el-option>
  32. </el-select>
  33. </el-form-item>
  34. <el-form-item>
  35. <el-select v-model.trim="searchForm.eduTeacherId"
  36. filterable
  37. clearable
  38. placeholder="教务老师">
  39. <el-option v-for="(item,index) in educationList"
  40. :key="index"
  41. :value="item.userId"
  42. :label="item.userName"></el-option>
  43. </el-select>
  44. </el-form-item>
  45. <el-form-item>
  46. <el-select placeholder="老师评价"
  47. v-model="searchForm.hasReview"
  48. clearable>
  49. <el-option label="评价"
  50. value="1"></el-option>
  51. <el-option label="未评价"
  52. value="0"></el-option>
  53. </el-select>
  54. </el-form-item>
  55. <!-- <el-form-item>
  56. <el-select placeholder="教务评价"
  57. v-model="searchForm.courseReview"
  58. clearable>
  59. <el-option label="好"
  60. value="好"></el-option>
  61. <el-option label="中"
  62. value="中"></el-option>
  63. <el-option label="差"
  64. value="差"></el-option>
  65. </el-select>
  66. </el-form-item> -->
  67. <!-- <el-form-item>
  68. <el-select placeholder="是否到课"
  69. v-model="searchForm.hasArrived"
  70. clearable>
  71. <el-option label="到课"
  72. value="1"></el-option>
  73. <el-option label="未到"
  74. value="0"></el-option>
  75. </el-select>
  76. </el-form-item> -->
  77. <!-- homeWorkReplied -->
  78. <el-form-item>
  79. <el-select placeholder="布置作业"
  80. v-model="searchForm.assignHomework"
  81. clearable>
  82. <el-option label="是"
  83. value="1"></el-option>
  84. <el-option label="否"
  85. value="0"></el-option>
  86. </el-select>
  87. </el-form-item>
  88. <!-- <el-form-item>
  89. <el-select placeholder="回复作业"
  90. v-model="searchForm.homeWorkReplied"
  91. clearable>
  92. <el-option label="是"
  93. value="1"></el-option>
  94. <el-option label="否"
  95. value="0"></el-option>
  96. </el-select>
  97. </el-form-item> -->
  98. <el-form-item>
  99. <el-date-picker :clearable="false"
  100. v-model="searchForm.month"
  101. type="daterange"
  102. value-format="yyyy-MM-dd"
  103. format="yyyy-MM-dd"
  104. range-separator="-"
  105. start-placeholder="开始日期"
  106. end-placeholder="结束日期">
  107. ></el-date-picker>
  108. </el-form-item>
  109. <el-form-item>
  110. <el-button @click="search"
  111. type="danger">搜索</el-button>
  112. <el-button @click="onReSet"
  113. type="primary">重置</el-button>
  114. <el-button type="primary"
  115. v-if="tableData.length > 0"
  116. v-permission="'export/courseReviews'"
  117. @click="netWorkExport">导出</el-button>
  118. </el-form-item>
  119. </el-form>
  120. <div class="tableWrap">
  121. <el-table style="width: 100%"
  122. :header-cell-style="{background:'#EDEEF0',color:'#444'}"
  123. :data="tableData">
  124. <el-table-column align="center"
  125. prop="organName"
  126. label="分部名称"></el-table-column>
  127. <el-table-column align="center"
  128. prop="id"
  129. label="课程编号"></el-table-column>
  130. <el-table-column align="center"
  131. prop="courseName"
  132. label="课程名称"></el-table-column>
  133. <el-table-column align="center"
  134. prop="courseName"
  135. label="上课日期">
  136. <template slot-scope="scope">
  137. <div>
  138. {{ scope.row.classDate | formatTimer }}
  139. </div>
  140. </template>
  141. </el-table-column>
  142. <el-table-column align="center"
  143. prop="subjectName"
  144. label="声部"></el-table-column>
  145. <el-table-column align="center"
  146. prop="teacherName"
  147. label="指导老师"></el-table-column>
  148. <el-table-column align="center"
  149. prop="eduTeacherName"
  150. label="教务老师"></el-table-column>
  151. <el-table-column align="center"
  152. label="老师评价">
  153. <template slot-scope="scope">
  154. <div>{{scope.row.reviewId>0?'评价':'未评价'}}</div>
  155. </template>
  156. </el-table-column>
  157. <el-table-column align="center"
  158. label="布置作业">
  159. <template slot-scope="scope">
  160. <div>{{scope.row.assignHomework?'是':'否'}}</div>
  161. </template>
  162. </el-table-column>
  163. <!-- <el-table-column align="center"
  164. label="是否到课">
  165. <template slot-scope="scope">
  166. <div>{{scope.row.attendanceId>0?'到课':'未到'}}</div>
  167. </template>
  168. </el-table-column> -->
  169. <el-table-column align="center"
  170. label="操作">
  171. <!-- v-permission="'evaluateList/look'" -->
  172. <template slot-scope="scope">
  173. <div>
  174. <el-button type="text"
  175. v-if="scope.row.reviewId"
  176. @click="lookDetail(scope.row)">查看</el-button>
  177. </div>
  178. </template>
  179. </el-table-column>
  180. </el-table>
  181. <pagination :total="rules.total"
  182. :page.sync="rules.page"
  183. :limit.sync="rules.limit"
  184. :page-sizes="rules.page_size"
  185. @pagination="getList" />
  186. </div>
  187. <el-dialog title="vip评价详情"
  188. :visible.sync="netWorkVisible"
  189. width="800px">
  190. <div class="wrap">
  191. <div class="commitLeft">
  192. <div class="leftCell"
  193. v-if="teacherClassHeadInfo">
  194. <p>课程班名称</p>
  195. <p>{{teacherClassHeadInfo.classGroupName}}</p>
  196. </div>
  197. <div class="leftCell"
  198. v-if="teacherClassHeadInfo">
  199. <p>上课时间</p>
  200. <p>{{teacherClassHeadInfo.classDate+' '+teacherClassHeadInfo.startClassTime+'-'+teacherClassHeadInfo.endClassTime}}</p>
  201. </div>
  202. <div class="leftCell"
  203. v-if="teacherClassHeadInfo">
  204. <p>乐器</p>
  205. <p>{{teacherClassHeadInfo.subjectNames}}</p>
  206. </div>
  207. <div class="leftCell"
  208. v-if="teacherClassHeadInfo">
  209. <p>指导老师</p>
  210. <p>{{teacherClassHeadInfo.bishopTeacher}}</p>
  211. </div>
  212. <div class="leftCell"
  213. v-if="teacherClassHeadInfo">
  214. <p>学员</p>
  215. <p>{{teacherClassHeadInfo.studentNames}}</p>
  216. </div>
  217. <div class="leftCell"
  218. v-if="courseScheduleReview">
  219. <p>回访日期</p>
  220. <p>{{ courseScheduleReview.createTime.substring(0,10) }}</p>
  221. </div>
  222. <!-- <div class="leftCell"
  223. v-if="courseScheduleReview">
  224. <p>是否双向沟通</p>
  225. <p>{{courseScheduleReview.hasLiaison?'是':'否'}}</p>
  226. </div> -->
  227. <div class="leftCell"
  228. v-if="courseScheduleReview">
  229. <p>是否提交作业</p>
  230. <p>{{courseScheduleReview.handHomework?'是':'否'}}</p>
  231. </div>
  232. <div class="leftCell"
  233. v-if="courseScheduleReview">
  234. <p>教务老师</p>
  235. <p>{{courseScheduleReview.eduTeacherName}}</p>
  236. </div>
  237. <div class="leftCell">
  238. <p>课程评价</p>
  239. <div class="chioseWrap">
  240. <el-tag :type="mychiose =='好'?'danger':'info'"
  241. @click="courseScheduleReview.courseReview='好'">好</el-tag>
  242. <el-tag :type="mychiose == '中'?'danger':'info'"
  243. @click="courseScheduleReview.courseReview='中'">中</el-tag>
  244. <el-tag :type="mychiose == '差'?'danger':'info'"
  245. @click="courseScheduleReview.courseReview='差'">差</el-tag>
  246. </div>
  247. </div>
  248. </div>
  249. <div class="commitRight">
  250. <div v-if="courseScheduleComplaints">
  251. <div v-for="(item,index) in courseScheduleComplaints"
  252. :key="index">
  253. <div class="rightCell">
  254. <p>{{item.username}}</p>
  255. <div class="chioseWrap">
  256. <el-rate v-model="item.score"
  257. disabled
  258. text-color="#ff9900"></el-rate>
  259. </div>
  260. </div>
  261. <el-input type="textarea"
  262. v-model="item.reason"
  263. disabled></el-input>
  264. </div>
  265. </div>
  266. <div v-if="courseScheduleReview">
  267. <div class="rightCell"
  268. v-if="courseScheduleReview">
  269. <p>教材内容</p>
  270. </div>
  271. <el-input type="textarea"
  272. disabled
  273. v-model="teachingMaterial"></el-input>
  274. <div class="leftCell"
  275. v-if="courseScheduleReview">
  276. <p>曲目</p>
  277. <p>{{ courseScheduleReview.song }}</p>
  278. </div>
  279. <div class="rightCell"
  280. v-if="courseScheduleReview">
  281. <p>发音</p>
  282. <div class="chioseWrap">
  283. <el-rate v-model="courseScheduleReview.pronunciation"
  284. disabled
  285. text-color="#ff9900"></el-rate>
  286. </div>
  287. </div>
  288. <div class="rightCell"
  289. v-if="courseScheduleReview">
  290. <p>节奏</p>
  291. <div class="chioseWrap">
  292. <el-rate v-model="courseScheduleReview.tempo"
  293. disabled
  294. text-color="#ff9900"></el-rate>
  295. </div>
  296. </div>
  297. <div class="rightCell"
  298. v-if="courseScheduleReview">
  299. <p>乐理</p>
  300. <div class="chioseWrap">
  301. <el-rate v-model="courseScheduleReview.musicTheory"
  302. disabled
  303. text-color="#ff9900"></el-rate>
  304. </div>
  305. </div>
  306. <div class="rightCell">
  307. <p>评价备注</p>
  308. </div>
  309. <el-input type="textarea"
  310. disabled
  311. v-model="courseScheduleReview.memo"
  312. v-if="courseScheduleReview"></el-input>
  313. </div>
  314. </div>
  315. </div>
  316. <div slot="footer"
  317. class="dialog-footer">
  318. <el-button @click="netWorkVisible = false">取 消</el-button>
  319. <el-button type="primary"
  320. @click="submitNetwork">确定</el-button>
  321. </div>
  322. </el-dialog>
  323. </div>
  324. </template>
  325. <script>
  326. import { getToken } from "@/utils/auth";
  327. import qs from "qs";
  328. import axios from "axios";
  329. import pagination from "@/components/Pagination/index";
  330. import { practiceGroupType } from "@/utils/searchArray";
  331. import {
  332. getTeacher,
  333. getEmployeeOrgan,
  334. findEducationUsers,
  335. getReviewInfo,
  336. updateReviewInfo,
  337. getVipGroup
  338. } from "@/api/buildTeam";
  339. export default {
  340. components: { pagination },
  341. data () {
  342. return {
  343. netWorkVisible: false,
  344. searchForm: {
  345. organId: null,
  346. teacherId: null,
  347. eduTeacherId: null,
  348. isFree: null,
  349. studentReview: null,
  350. hasHandHomework: null,
  351. hasReview: null,
  352. courseReview: null,
  353. hasArrived: null,
  354. homeWorkReplied: null,
  355. assignHomework: null,
  356. month: [],
  357. practiceGroupType: null
  358. },
  359. practiceGroupType: practiceGroupType,
  360. organList: [],
  361. teacherList: [],
  362. educationList: [],
  363. tableData: [],
  364. rules: {
  365. // 分页规则
  366. limit: 10, // 限制显示条数
  367. page: 1, // 当前页
  368. total: 0, // 总条数
  369. page_size: [10, 20, 40, 50] // 选择限制显示条数
  370. },
  371. value: null,
  372. teacherClassHeadInfo: null,
  373. courseScheduleReview: null,
  374. courseScheduleComplaints: null,
  375. activeId: null
  376. };
  377. },
  378. //生命周期 - 创建完成(可以访问当前this实例)
  379. created () { },
  380. //生命周期 - 挂载完成(可以访问DOM元素)
  381. mounted () {
  382. this.init();
  383. },
  384. activated () {
  385. this.init();
  386. },
  387. methods: {
  388. init () {
  389. // 获取默认月份
  390. if (this.searchForm.month.length <= 0) {
  391. var now = new Date();
  392. var startDate = new Date(
  393. Date.UTC(now.getFullYear(), now.getMonth(), now.getDate())
  394. )
  395. .toISOString()
  396. .slice(0, 10);
  397. // + " 00:00:00" + " 23:59:59"
  398. var endDate = new Date(
  399. Date.UTC(now.getFullYear(), now.getMonth(), now.getDate())
  400. )
  401. .toISOString()
  402. .slice(0, 10);
  403. this.searchForm.month = [];
  404. this.searchForm.month.push(startDate);
  405. this.searchForm.month.push(endDate);
  406. console.log(this.searchForm.month);
  407. }
  408. // 获取指导老师
  409. getTeacher({}).then(res => {
  410. if (res.code == 200) {
  411. this.teacherList = res.data;
  412. }
  413. });
  414. // 获取分部
  415. getEmployeeOrgan().then(res => {
  416. if (res.code == 200) {
  417. this.organList = res.data;
  418. }
  419. });
  420. // 获取教务
  421. findEducationUsers().then(res => {
  422. if (res.code == 200) {
  423. this.educationList = res.data;
  424. }
  425. });
  426. this.getList();
  427. },
  428. getList () {
  429. let obj = {};
  430. obj.organId = this.searchForm.organId || null;
  431. obj.teacherId = this.searchForm.teacherId || null;
  432. obj.eduTeacherId = this.searchForm.eduTeacherId || null;
  433. obj.isFree = this.searchForm.isFree || null;
  434. obj.studentReview = this.searchForm.studentReview || null;
  435. obj.hasHandHomework = this.searchForm.hasHandHomework || null;
  436. obj.hasReview = this.searchForm.hasReview || null;
  437. obj.courseReview = this.searchForm.courseReview || null;
  438. obj.hasArrived = this.searchForm.hasArrived || null;
  439. obj.homeWorkReplied = this.searchForm.homeWorkReplied || null;
  440. obj.assignHomework = this.searchForm.assignHomework || null;
  441. obj.search = this.searchForm.search;
  442. obj.practiceGroupType = this.searchForm.practiceGroupType || null;
  443. if (this.searchForm.month && this.searchForm.month.length > 0) {
  444. obj.startTime = this.searchForm.month[0];
  445. obj.endTime = this.searchForm.month[1];
  446. } else {
  447. this.$message.error('请选择时间范围')
  448. return
  449. }
  450. obj.page = this.rules.page;
  451. obj.rows = this.rules.limit;
  452. getVipGroup(obj).then(res => {
  453. if (res.code == 200) {
  454. this.tableData = res.data.rows;
  455. this.rules.total = res.data.total;
  456. }
  457. });
  458. },
  459. lookDetail (row) {
  460. this.activeId = row.reviewId;
  461. getReviewInfo({ id: this.activeId }).then(res => {
  462. if (res.code == 200) {
  463. this.teacherClassHeadInfo = res.data.teacherClassHeadInfo;
  464. this.courseScheduleReview = res.data.courseScheduleReview;
  465. this.courseScheduleComplaints = res.data.courseScheduleComplaints;
  466. // 教务评价详情
  467. // eduCourseReviewGetReviewInfo({id}).then(res=>{
  468. // if(res.code == 200){
  469. // }
  470. // })
  471. this.netWorkVisible = true;
  472. }
  473. });
  474. },
  475. submitNetwork () {
  476. if (!this.courseScheduleReview.courseReview) {
  477. this.$message.error("请评价课程");
  478. return;
  479. }
  480. updateReviewInfo({
  481. id: this.activeId,
  482. courseReview: this.courseScheduleReview.courseReview
  483. }).then(res => {
  484. if (res.code == 200) {
  485. this.$message.success("评价成功");
  486. this.netWorkVisible = false;
  487. this.getList();
  488. }
  489. });
  490. },
  491. search () {
  492. this.rules.page = 1;
  493. this.getList();
  494. },
  495. onReSet () {
  496. this.rules.page = 1;
  497. this.searchForm = {
  498. organId: null,
  499. teacherId: null,
  500. educationalTeacherId: null,
  501. isFree: null,
  502. studentReview: null,
  503. hasHandHomework: null,
  504. hasReview: null,
  505. courseReview: null,
  506. month: null,
  507. hasArrived: null,
  508. homeWorkReplied: null,
  509. assignHomework: null,
  510. practiceGroupType: null
  511. };
  512. var now = new Date();
  513. var startDate = new Date(
  514. Date.UTC(now.getFullYear(), now.getMonth(), now.getDate())
  515. )
  516. .toISOString()
  517. .slice(0, 10);
  518. // + " 00:00:00" + " 23:59:59"
  519. var endDate = new Date(
  520. Date.UTC(now.getFullYear(), now.getMonth(), now.getDate())
  521. )
  522. .toISOString()
  523. .slice(0, 10);
  524. this.searchForm.month = [];
  525. this.searchForm.month.push(startDate);
  526. this.searchForm.month.push(endDate);
  527. this.getList();
  528. },
  529. netWorkExport () {
  530. let url = "/api-web/export/courseReviews";
  531. let obj = {};
  532. this.searchForm.organId ? (obj.organId = this.searchForm.organId) : null;
  533. this.searchForm.teacherId
  534. ? (obj.teacherId = this.searchForm.teacherId)
  535. : null;
  536. this.searchForm.eduTeacherId
  537. ? (obj.eduTeacherId = this.searchForm.eduTeacherId)
  538. : null;
  539. this.searchForm.isFree ? (obj.isFree = this.searchForm.isFree) : null;
  540. this.searchForm.studentReview
  541. ? (obj.studentReview = this.searchForm.studentReview)
  542. : null;
  543. this.searchForm.hasHandHomework
  544. ? (obj.hasHandHomework = this.searchForm.hasHandHomework)
  545. : null;
  546. this.searchForm.hasReview
  547. ? (obj.hasReview = this.searchForm.hasReview)
  548. : null;
  549. this.searchForm.courseReview
  550. ? (obj.courseReview = this.searchForm.courseReview)
  551. : null;
  552. this.searchForm.search ? (obj.search = this.searchForm.search) : null;
  553. this.searchForm.hasArrived
  554. ? (obj.hasArrived = this.searchForm.hasArrived)
  555. : null;
  556. this.searchForm.homeWorkReplied
  557. ? (obj.homeWorkReplied = this.searchForm.homeWorkReplied)
  558. : null;
  559. this.searchForm.assignHomework ? obj.assignHomework = this.searchForm.assignHomework : null
  560. if (this.searchForm.month && this.searchForm.month.length > 0) {
  561. obj.startTime = this.searchForm.month[0];
  562. obj.endTime = this.searchForm.month[1];
  563. } else {
  564. this.$message.error('请选择时间范围')
  565. return
  566. }
  567. this.searchForm.practiceGroupType ? obj.practiceGroupType = this.searchForm.practiceGroupType : null;
  568. const options = {
  569. method: "POST",
  570. headers: {
  571. Authorization: getToken()
  572. },
  573. data: qs.stringify(obj),
  574. url,
  575. responseType: "blob"
  576. };
  577. this.$confirm("您确定导出评价列表", "提示", {
  578. confirmButtonText: "确定",
  579. cancelButtonText: "取消",
  580. type: "warning"
  581. })
  582. .then(() => {
  583. axios(options).then(res => {
  584. let blob = new Blob([res.data], {
  585. // type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
  586. type: "application/vnd.ms-excel;charset=utf-8"
  587. //word文档为application/msword,pdf文档为application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
  588. });
  589. let objectUrl = URL.createObjectURL(blob);
  590. let link = document.createElement("a");
  591. let nowTime = new Date();
  592. let ymd =
  593. nowTime.getFullYear() +
  594. "" +
  595. (nowTime.getMonth() + 1) +
  596. "" +
  597. nowTime.getDate() +
  598. "" +
  599. nowTime.getHours() +
  600. "" +
  601. nowTime.getMinutes();
  602. let fname = +ymd + "网管评价"; //下载文件的名字
  603. link.href = objectUrl;
  604. link.setAttribute("download", fname);
  605. document.body.appendChild(link);
  606. link.click();
  607. });
  608. })
  609. .catch(() => { });
  610. }
  611. },
  612. filters: {
  613. studentReviewFilter (val) {
  614. let arr = ["未评价", "1星", "2星", "3星", "4星", "5星"];
  615. return arr[val];
  616. }
  617. },
  618. computed: {
  619. teachingMaterial () {
  620. if (
  621. this.courseScheduleReview &&
  622. this.courseScheduleReview.teachingMaterial
  623. ) {
  624. return this.courseScheduleReview.teachingMaterial;
  625. } else {
  626. return "";
  627. }
  628. },
  629. mychiose () {
  630. if (this.courseScheduleReview && this.courseScheduleReview.courseReview) {
  631. return this.courseScheduleReview.courseReview;
  632. } else {
  633. return "";
  634. }
  635. }
  636. }
  637. };
  638. </script>
  639. <style lang='scss' scoped>
  640. .wrap {
  641. display: flex;
  642. flex-direction: row;
  643. justify-content: space-between;
  644. .leftCell {
  645. width: 300px;
  646. display: flex;
  647. flex-direction: row;
  648. justify-content: space-between;
  649. align-items: center;
  650. line-height: 50px;
  651. // border-bottom: 1px solid #ccc;
  652. }
  653. .rightCell {
  654. width: 300px;
  655. display: flex;
  656. flex-direction: row;
  657. justify-content: flex-start;
  658. align-items: center;
  659. line-height: 50px;
  660. p {
  661. margin-right: 30px;
  662. }
  663. }
  664. }
  665. /deep/.el-tag {
  666. cursor: pointer;
  667. }
  668. </style>