networkList.vue 21 KB

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