index.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534
  1. <!-- -->
  2. <template>
  3. <div class="m-container">
  4. <h2>
  5. <div class="squrt"></div>
  6. 服务指标明细
  7. </h2>
  8. <!-- <filter-search
  9. ref="filterSearch"
  10. @reload="reloadSearch"
  11. :keys="['searchType']"
  12. :moreKeys="['organId']"
  13. /> -->
  14. <div class="m-core">
  15. <save-form
  16. :inline="true"
  17. :model="searchForm"
  18. @submit="search"
  19. @reset="onReSet"
  20. ref="form"
  21. >
  22. <el-form-item prop="organId">
  23. <el-select
  24. class="multiple"
  25. v-model.trim="searchForm.organId"
  26. filterable
  27. clearable
  28. placeholder="请选择分部"
  29. >
  30. <el-option
  31. v-for="(item, index) in selects.branchs"
  32. :key="index"
  33. :label="item.name"
  34. :value="item.id"
  35. ></el-option>
  36. </el-select>
  37. </el-form-item>
  38. <el-form-item prop="teacherId">
  39. <remote-search
  40. :commit="'setTeachers'"
  41. :isForzenWithQueryCondition="true"
  42. v-model="searchForm.teacherId"
  43. />
  44. </el-form-item>
  45. <el-form-item prop="serviceIsError">
  46. <el-select
  47. placeholder="服务是否异常"
  48. v-model="searchForm.serviceIsError"
  49. clearable
  50. >
  51. <el-option label="是" value="1"></el-option>
  52. <el-option label="否" value="0"></el-option>
  53. </el-select>
  54. </el-form-item>
  55. <el-form-item prop="unDone">
  56. <el-select
  57. class="multiple"
  58. v-model.trim="searchForm.unDone"
  59. clearable
  60. placeholder="是否异常"
  61. >
  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 prop="reminded">
  67. <el-select
  68. class="multiple"
  69. v-model.trim="searchForm.reminded"
  70. clearable
  71. placeholder="是否提醒"
  72. >
  73. <el-option label="是" value="1"></el-option>
  74. <el-option label="否" value="0"></el-option>
  75. </el-select>
  76. </el-form-item>
  77. <el-form-item prop="operatorId">
  78. <remote-search
  79. :commit="'setEmploys'"
  80. v-model.trim="searchForm.operatorId"
  81. />
  82. </el-form-item>
  83. <el-form-item>
  84. <el-select
  85. v-model.trim="searchForm.jobNature"
  86. filterable
  87. clearable
  88. placeholder="工作类型"
  89. >
  90. <el-option
  91. v-for="item in jobNature"
  92. :key="item.value"
  93. :label="item.label"
  94. :value="item.value"
  95. ></el-option>
  96. </el-select>
  97. </el-form-item>
  98. <el-form-item >
  99. <el-select
  100. placeholder="实际训练布置"
  101. v-model="searchForm.actualExercisesNumIsAchieve"
  102. clearable
  103. >
  104. <el-option label="符合预期" value="1"></el-option>
  105. <el-option label="不符合预期" value="0"></el-option>
  106. </el-select>
  107. </el-form-item>
  108. <el-form-item>
  109. <el-select
  110. placeholder="提交次数"
  111. v-model="searchForm.exercisesReplyNumIsAchieve"
  112. clearable
  113. >
  114. <el-option label="符合预期" value="1"></el-option>
  115. <el-option label="不符合预期" value="0"></el-option>
  116. </el-select>
  117. </el-form-item>
  118. <el-form-item >
  119. <el-select
  120. placeholder="评价次数"
  121. v-model="searchForm.exercisesMessageNumIsAchieve"
  122. clearable
  123. >
  124. <el-option label="符合预期" value="1"></el-option>
  125. <el-option label="不符合预期" value="0"></el-option>
  126. </el-select>
  127. </el-form-item>
  128. <el-form-item >
  129. <el-select
  130. placeholder="及时评价"
  131. v-model="searchForm.exercisesMessageTimelyNumIsAchieve"
  132. clearable
  133. >
  134. <el-option label="符合预期" value="1"></el-option>
  135. <el-option label="不符合预期" value="0"></el-option>
  136. </el-select>
  137. </el-form-item>
  138. <el-form-item>
  139. <el-date-picker
  140. style="width: 410px"
  141. v-model.trim="orderDate"
  142. type="daterange"
  143. value-format="yyyy-MM-dd"
  144. range-separator="至"
  145. start-placeholder="开始日期"
  146. end-placeholder="结束日期"
  147. :clearable="false"
  148. @change="changeWeek"
  149. :picker-options="bigin()"
  150. >
  151. </el-date-picker>
  152. </el-form-item>
  153. <el-form-item>
  154. <el-button native-type="submit" type="primary">搜索</el-button>
  155. <el-button native-type="reset" type="danger">重置</el-button>
  156. <el-button @click="onExport" type="primary" v-permission="'export/teacherServeInfo'">导出</el-button>
  157. </el-form-item>
  158. </save-form>
  159. <div class="btnWraps" style="margin-bottom: 20px">
  160. <el-button
  161. type="primary"
  162. v-permission="'exercisesSituation/teacherServeRemindPush'"
  163. @click="remindTeachers"
  164. >批量提醒</el-button
  165. >
  166. </div>
  167. <div class="tableWrap">
  168. <el-table
  169. style="width: 100%"
  170. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  171. :data="tableList"
  172. @selection-change="handleSelectionChange"
  173. >
  174. <el-table-column
  175. type="selection"
  176. width="55"
  177. :selectable="checkSelectable"
  178. >
  179. </el-table-column>
  180. <el-table-column
  181. align="center"
  182. prop="organName"
  183. label="分部"
  184. ></el-table-column>
  185. <el-table-column
  186. align="center"
  187. prop="teacherId"
  188. label="老师编号"
  189. ></el-table-column>
  190. <el-table-column
  191. align="center"
  192. prop="teacherName"
  193. label="老师姓名"
  194. ></el-table-column>
  195. <el-table-column
  196. align="center"
  197. prop="teacherName"
  198. label="服务周期"
  199. width="180px"
  200. >
  201. <template slot-scope="scope">
  202. <div>
  203. {{scope.row.monday | dayjsFormat}}~{{scope.row.sunday | dayjsFormat}}
  204. </div>
  205. </template>
  206. </el-table-column>
  207. <el-table-column align="center" label="预期训练布置">
  208. <template slot-scope="scope">
  209. <div>{{ scope.row.expectExercisesNum + "人次" }}</div>
  210. </template>
  211. </el-table-column>
  212. <el-table-column align="center" width="120" prop>
  213. <template slot="header" slot-scope="scope">
  214. <p style="position: relative">
  215. 实际训练布置
  216. <el-tooltip placement="top" popper-class="mTooltip">
  217. <div slot="content">
  218. 以周为单位,每周服务指标指定的课程布置训练记一次实际训练布置
  219. </div>
  220. <!-- <img :src="imageIcon"
  221. class="micon el-tooltip"
  222. style="width:8px height:8px"
  223. alt /> -->
  224. <i
  225. class="el-icon-question"
  226. style="font-size: 18px; color: #f56c6c"
  227. ></i>
  228. </el-tooltip>
  229. </p>
  230. </template>
  231. <template slot-scope="scope">
  232. <div :style="
  233. scope.row.actualExercisesNum < scope.row.expectExercisesNum
  234. ? 'color:red'
  235. : ''
  236. ">{{ scope.row.actualExercisesNum + "人次" }}</div>
  237. </template>
  238. </el-table-column>
  239. <el-table-column align="center" prop label="提交次数">
  240. <template slot-scope="scope">
  241. <div>{{ scope.row.exercisesReplyNum + "次" }}</div>
  242. </template>
  243. </el-table-column>
  244. <el-table-column align="center" prop label="评价次数">
  245. <template slot-scope="scope">
  246. <div :style="
  247. scope.row.exercisesMessageNum < scope.row.exercisesReplyNum
  248. ? 'color:red'
  249. : ''
  250. ">{{ scope.row.exercisesMessageNum + "次" }}</div>
  251. </template>
  252. </el-table-column>
  253. <el-table-column align="center" prop label="及时评价次数">
  254. <template slot-scope="scope">
  255. <div>{{ scope.row.exercisesMessageTimelyNum + "次" }}</div>
  256. </template>
  257. </el-table-column>
  258. <el-table-column
  259. align="center"
  260. prop="homeworkNum"
  261. label="课后训练(节)"
  262. ></el-table-column>
  263. <el-table-column
  264. align="center"
  265. prop="homeworkStuNum"
  266. label="课后训练(人)"
  267. ></el-table-column>
  268. <el-table-column
  269. align="center"
  270. prop="exerciseNum"
  271. label="课外训练(人)"
  272. ></el-table-column>
  273. <el-table-column align="center" prop="studentId" label="是否异常">
  274. <template slot-scope="scope">
  275. {{ scope.row.unDone ? "是" : "否" }}
  276. </template>
  277. </el-table-column>
  278. <el-table-column
  279. align="center"
  280. prop="remindDate"
  281. label="提醒时间"
  282. >
  283. <template slot-scope="scope">
  284. <div>
  285. {{scope.row.remindDate | dateForMinFormat}}
  286. </div>
  287. </template>
  288. </el-table-column>
  289. <el-table-column
  290. align="center"
  291. prop="operatorName"
  292. label="操作人"
  293. ></el-table-column>
  294. <el-table-column align="center" prop="studentId" label="操作" width="160px">
  295. <template slot-scope="scope">
  296. <div>
  297. <el-button type="text" @click="gotoDteail(scope.row)"
  298. >查看</el-button
  299. >
  300. <el-button
  301. type="text"
  302. v-if="scope.row.unDone"
  303. v-permission="'exercisesSituation/teacherServeRemindPush'"
  304. @click="remindTeacher(scope.row)"
  305. >提醒老师</el-button
  306. >
  307. </div>
  308. </template>
  309. </el-table-column>
  310. </el-table>
  311. <pagination
  312. sync
  313. :total.sync="rules.total"
  314. :page.sync="rules.page"
  315. :limit.sync="rules.limit"
  316. :page-sizes="rules.page_size"
  317. @pagination="getList"
  318. />
  319. </div>
  320. <el-dialog
  321. title="查看"
  322. :close-on-click-modal="false"
  323. :visible.sync="lookVisible"
  324. v-if="lookVisible"
  325. >
  326. <serverMask
  327. :detail="activeRow"
  328. @close="lookVisible = false"
  329. @submited="getList"
  330. />
  331. <span slot="footer" class="dialog-footer">
  332. <el-button type="primary" @click="lookVisible = false"
  333. >确 定</el-button
  334. >
  335. </span>
  336. </el-dialog>
  337. </div>
  338. </div>
  339. </template>
  340. <script>
  341. import axios from "axios";
  342. import { getToken } from "@/utils/auth";
  343. import pagination from "@/components/Pagination/index";
  344. import serverMask from "./conponent/serverMask";
  345. import load from "@/utils/loading";
  346. import { getTeacherServeInfo, teacherServeRemindPush } from "./api";
  347. import { getTimes } from "@/utils";
  348. import { getNowDateAndSunday, getNowDateAndMonday } from "@/utils/date";
  349. import { jobNature } from "@/utils/searchArray";
  350. import { Export } from '@/utils/downLoadFile'
  351. import qs from 'qs'
  352. export default {
  353. components: { pagination, serverMask },
  354. data() {
  355. return {
  356. searchForm: {
  357. organId: "",
  358. teacherId: "",
  359. operatorId: "",
  360. reminded: "",
  361. unDone: "",
  362. operatorId: "",
  363. jobNature:"",
  364. actualExercisesNumIsAchieve: null, // 训练次数
  365. exercisesMessageNumIsAchieve: null, //评价
  366. exercisesMessageTimelyNumIsAchieve: null, //及时评价
  367. exercisesReplyNumIsAchieve: null, // 提交次数
  368. serviceIsError:null
  369. },
  370. orderDate: [],
  371. tableList: [],
  372. organList: [],
  373. rules: {
  374. // 分页规则
  375. limit: 10, // 限制显示条数
  376. page: 1, // 当前页
  377. total: 0, // 总条数
  378. page_size: [10, 20, 40, 50], // 选择限制显示条数
  379. },
  380. lookVisible: false,
  381. activeRow: null,
  382. chioseList: [],
  383. jobNature: jobNature,
  384. };
  385. },
  386. //生命周期 - 创建完成(可以访问当前this实例)
  387. created() {},
  388. //生命周期 - 挂载完成(可以访问DOM元素)
  389. mounted() {
  390. // 获取分部
  391. this.init();
  392. },
  393. methods: {
  394. init() {
  395. this.$store.dispatch("setBranchs");
  396. this.$store.dispatch("setEmploys");
  397. this.getDefaultTime();
  398. if (this.$route.query.searchType) {
  399. this.searchForm.organId = this.$route.query.organId * 1 || "";
  400. this.searchForm.unDone = this.$route.query.unDone+'' || ""
  401. this.searchForm.reminded = this.$route.query.reminded+'' || ""
  402. const dayjs = this.$helpers.dayjs;
  403. let nowDate = dayjs(new Date()).subtract(7, 'day').format("YYYY-MM-DD");
  404. this.orderDate = [
  405. getNowDateAndMonday(nowDate),
  406. getNowDateAndSunday(nowDate),
  407. ];
  408. }
  409. this.getList();
  410. },
  411. async getList() {
  412. try {
  413. const {orderDate, ...rest} = this.searchForm;
  414. const result = await getTeacherServeInfo({
  415. ...rest,
  416. ...getTimes(this.orderDate, ["monday", "sunday"]),
  417. rows: this.rules.limit,
  418. page: this.rules.page,
  419. });
  420. this.rules.total = result.data.total;
  421. this.tableList = result.data.rows;
  422. } catch (e) {}
  423. },
  424. search() {
  425. this.rules.page = 1;
  426. this.getList();
  427. },
  428. onReSet() {
  429. this.$refs.form.resetFields();
  430. this.getDefaultTime();
  431. this.search();
  432. },
  433. gotoDteail(row) {
  434. this.activeRow = row;
  435. this.lookVisible = true;
  436. },
  437. reloadSearch() {
  438. this.getList();
  439. },
  440. getDefaultTime() {
  441. const dayjs = this.$helpers.dayjs;
  442. let nowDate = dayjs(new Date()).format("YYYY-MM-DD");
  443. let lastWeek = dayjs(nowDate).subtract(1, "week").format("YYYY-MM-DD");
  444. this.orderDate = [
  445. getNowDateAndMonday(lastWeek),
  446. getNowDateAndSunday(nowDate),
  447. ];
  448. this.searchForm.jobNature = 'FULL_TIME'
  449. },
  450. changeWeek(val) {
  451. if (val) {
  452. this.orderDate = [
  453. getNowDateAndMonday(val[0]),
  454. getNowDateAndSunday(val[1]),
  455. ]
  456. } else {
  457. this.getDefaultTime();
  458. }
  459. },
  460. remindTeacher(row) {
  461. this.$confirm("是否给老师发送提醒?", "提示", {
  462. confirmButtonText: "确定",
  463. cancelButtonText: "取消",
  464. type: "warning",
  465. }).then(async () => {
  466. try {
  467. const result = await teacherServeRemindPush([row]);
  468. this.getList();
  469. this.$message.success("提醒成功");
  470. } catch (e) {
  471. console.log(e);
  472. }
  473. });
  474. },
  475. remindTeachers() {
  476. if (this.chioseList.length <= 0) {
  477. this.$message.error("请至少选择一条信息");
  478. return;
  479. }
  480. this.$confirm("是否批量给老师发送提醒?", "提示", {
  481. confirmButtonText: "确定",
  482. cancelButtonText: "取消",
  483. type: "warning",
  484. }).then(async () => {
  485. try {
  486. const result = await teacherServeRemindPush(this.chioseList);
  487. this.getList();
  488. this.$message.success("提醒成功");
  489. } catch (e) {
  490. console.log(e);
  491. }
  492. });
  493. },
  494. checkSelectable(row) {
  495. return row.unDone;
  496. },
  497. handleSelectionChange(arr) {
  498. this.chioseList = arr;
  499. },
  500. bigin(){
  501. let self = this;
  502. return {
  503. firstDayOfWeek: 1,
  504. disabledDate(time) {
  505. return time.getTime() >= Date.now();
  506. },
  507. };
  508. },
  509. onExport() {
  510. const { orderDate, ...rest } = this.searchForm;
  511. Export(
  512. this,
  513. {
  514. url: "/api-web/export/teacherServeInfo",
  515. fileName: "服务指标明细.xls",
  516. method: "post",
  517. params: qs.stringify({
  518. ...rest,
  519. ...getTimes(this.orderDate, ["monday", "sunday"]),
  520. }),
  521. },
  522. "您确定导出服务指标明细?"
  523. );
  524. },
  525. },
  526. };
  527. </script>
  528. <style lang='scss' scoped>
  529. </style>