networkList.vue 19 KB

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