vipEvaluateList.vue 22 KB

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