patrol.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395
  1. <!-- -->
  2. <template>
  3. <div class="m-container">
  4. <h2>
  5. <div class="squrt"></div>
  6. 学校巡堂
  7. </h2>
  8. <div class="m-core">
  9. <save-form
  10. :inline="true"
  11. :model="searchForm"
  12. @submit="search"
  13. @reset="onReSet"
  14. ref="saveForm"
  15. >
  16. <el-form-item prop="keyword">
  17. <el-input
  18. class="seachInput"
  19. v-model.trim="searchForm.keyword"
  20. clearable
  21. @keyup.enter.native="
  22. (e) => {
  23. e.target.blur();
  24. $refs.saveForm.save();
  25. search();
  26. }
  27. "
  28. placeholder="老师姓名/编号/手机号"
  29. ></el-input>
  30. </el-form-item>
  31. <el-form-item prop="organId">
  32. <el-select
  33. style="width: 180px !important"
  34. class="multiple"
  35. v-model.trim="searchForm.organId"
  36. filterable
  37. clearable
  38. placeholder="请选择分部"
  39. >
  40. <el-option
  41. v-for="(item, index) in selects.branchs"
  42. :key="index"
  43. :label="item.name"
  44. :value="item.id"
  45. ></el-option>
  46. </el-select>
  47. </el-form-item>
  48. <el-form-item prop="cooperationOrganId">
  49. <el-select
  50. v-model.trim="searchForm.cooperationOrganId"
  51. :disabled="!searchForm.organId"
  52. filterable
  53. clearable
  54. placeholder="请选择合作单位"
  55. >
  56. <el-option
  57. v-for="(item, index) in cooperationList"
  58. :key="index"
  59. :label="item.name"
  60. :value="item.id"
  61. ></el-option>
  62. </el-select>
  63. </el-form-item>
  64. <el-form-item prop="courseType">
  65. <el-select
  66. v-model.trim="searchForm.courseType"
  67. clearable
  68. filterable
  69. placeholder="课程类型"
  70. >
  71. <el-option
  72. v-for="(item, index) in courseType"
  73. :key="index"
  74. :value="item.value"
  75. :label="item.label"
  76. ></el-option>
  77. </el-select>
  78. </el-form-item>
  79. <el-form-item prop="evaluateStatus">
  80. <el-select
  81. v-model.trim="searchForm.evaluateStatus"
  82. clearable
  83. filterable
  84. placeholder="综合评价"
  85. >
  86. <el-option
  87. v-for="(item, index) in evaluateStatusList"
  88. :key="index"
  89. :value="item.value"
  90. :label="item.label"
  91. ></el-option>
  92. </el-select>
  93. </el-form-item>
  94. <el-form-item prop="problemType">
  95. <el-select
  96. v-model.trim="searchForm.problemType"
  97. clearable
  98. filterable
  99. placeholder="问题类型"
  100. >
  101. <el-option
  102. v-for="(item, index) in problemTypeList"
  103. :key="index"
  104. :value="item.value"
  105. :label="item.label"
  106. ></el-option>
  107. </el-select>
  108. </el-form-item>
  109. <el-form-item prop="handleStatus">
  110. <el-select
  111. v-model.trim="searchForm.handleStatus"
  112. clearable
  113. filterable
  114. placeholder="处理状态"
  115. >
  116. <el-option :value="true" label="已处理"></el-option>
  117. <el-option :value="false" label="未处理"></el-option>
  118. </el-select>
  119. </el-form-item>
  120. <el-form-item prop="createTimer">
  121. <el-date-picker
  122. v-model.trim="searchForm.createTimer"
  123. type="daterange"
  124. value-format="yyyy-MM-dd"
  125. range-separator="至"
  126. start-placeholder="课程开始时间"
  127. end-placeholder="课程结束时间"
  128. :picker-options="{ firstDayOfWeek: 1 }"
  129. ></el-date-picker>
  130. </el-form-item>
  131. <el-form-item>
  132. <el-button native-type="submit" type="primary">搜索</el-button>
  133. <el-button native-type="reset" type="danger">重置</el-button>
  134. </el-form-item>
  135. </save-form>
  136. <div class="tableWrap">
  137. <el-table
  138. style="width: 100%"
  139. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  140. :data="tableList"
  141. >
  142. <el-table-column align="center" prop="id" label="编号"></el-table-column>
  143. <el-table-column align="center" prop="organName" label="分部"></el-table-column>
  144. <el-table-column
  145. align="center"
  146. prop="cooperationOrganName"
  147. label="合作单位"
  148. ></el-table-column>
  149. <el-table-column
  150. align="center"
  151. prop="teacherName"
  152. label="老师姓名"
  153. ></el-table-column>
  154. <el-table-column align="center" prop="courseType" label="课程类型">
  155. <template slot-scope="scope">
  156. <div>
  157. {{ scope.row.courseType | courseTypeFormat }}
  158. </div>
  159. </template>
  160. </el-table-column>
  161. <el-table-column
  162. align="center"
  163. prop="courseScheduleId"
  164. label="课程编号"
  165. ></el-table-column>
  166. <el-table-column align="center" prop="evaluateStatus" label="综合评价">
  167. <template slot-scope="scope">
  168. <div>{{ scope.row.evaluateStatus | evaluateStatus }}</div>
  169. </template>
  170. </el-table-column>
  171. <el-table-column align="center" prop="problemType" label="问题类型">
  172. <template slot-scope="scope">
  173. <div>
  174. {{ scope.row.problemType | problemType }}
  175. </div>
  176. </template>
  177. </el-table-column>
  178. <el-table-column align="center" prop="handleStatus" label="处理状态">
  179. <template slot-scope="scope">
  180. <div>
  181. {{ scope.row.handleStatus ? "已处理" : "未处理" }}
  182. </div>
  183. </template>
  184. </el-table-column>
  185. <el-table-column align="center" prop="studentId" label="课程时间">
  186. <template slot-scope="scope">
  187. <div>
  188. <p>{{ scope.row.startClassTime | formatTimer }}</p>
  189. {{
  190. scope.row.startClassTime ? scope.row.startClassTime.substr(11, 5) : ""
  191. }}-{{
  192. scope.row.endClassTime ? scope.row.endClassTime.substr(11, 5) : ""
  193. }}
  194. </div>
  195. </template>
  196. </el-table-column>
  197. <el-table-column align="center" prop="studentId" label="操作">
  198. <template slot-scope="scope">
  199. <div>
  200. <!-- <el-button type="text">详情</el-button> -->
  201. <el-button type="text" @click="lookDetail(scope.row)">处理意见</el-button>
  202. </div>
  203. </template>
  204. </el-table-column>
  205. </el-table>
  206. <pagination
  207. sync
  208. :total.sync="rules.total"
  209. :page.sync="rules.page"
  210. :limit.sync="rules.limit"
  211. :page-sizes="rules.page_size"
  212. @pagination="getList"
  213. />
  214. </div>
  215. </div>
  216. <el-dialog
  217. :title="activeRow.handleStatus ? '详情' : '处理意见'"
  218. width="450px"
  219. :visible.sync="dialogFormVisible"
  220. >
  221. <patrolModels
  222. :id="activeRow.id"
  223. v-if="dialogFormVisible"
  224. ref="patrolModelsRef"
  225. @close="
  226. () => {
  227. dialogFormVisible = false;
  228. getList();
  229. }
  230. "
  231. />
  232. <span slot="footer" class="dialog-footer">
  233. <el-button @click="dialogFormVisible = false">取 消</el-button>
  234. <el-button @click="submitMessage" type="primary">确 定</el-button>
  235. </span>
  236. </el-dialog>
  237. </div>
  238. </template>
  239. <script>
  240. import axios from "axios";
  241. import { getToken } from "@/utils/auth";
  242. import pagination from "@/components/Pagination/index";
  243. import load from "@/utils/loading";
  244. import { getTimes } from "@/utils";
  245. import { queryByOrganId } from "@/api/systemManage";
  246. import { getCoursePatrolEvaluation } from "./api";
  247. import { resetQuery } from "@/utils/utils";
  248. import {
  249. courseType,
  250. courseListType,
  251. evaluateStatusList,
  252. problemTypeList,
  253. } from "@/utils/searchArray";
  254. import patrolModels from "./modals/patrolModels";
  255. export default {
  256. components: { pagination, patrolModels },
  257. data() {
  258. return {
  259. searchForm: {
  260. keyword: null,
  261. organId: null,
  262. cooperationOrganId: null,
  263. courseType: null,
  264. evaluateStatus: null,
  265. problemType: null,
  266. handleStatus: null,
  267. createTimer: null,
  268. },
  269. courseType,
  270. tableList: [{}],
  271. organList: [],
  272. cooperationList: [],
  273. evaluateStatusList,
  274. problemTypeList,
  275. rules: {
  276. // 分页规则
  277. limit: 10, // 限制显示条数
  278. page: 1, // 当前页
  279. total: 0, // 总条数
  280. page_size: [10, 20, 40, 50], // 选择限制显示条数
  281. },
  282. dialogFormVisible: false,
  283. activeRow: { handleStatus: false },
  284. };
  285. },
  286. //生命周期 - 创建完成(可以访问当前this实例)
  287. created() {},
  288. //生命周期 - 挂载完成(可以访问DOM元素)
  289. mounted() {
  290. // 获取分部
  291. if (this.$route.query.handleStatus) {
  292. this.$set(
  293. this.searchForm,
  294. "handleStatus",
  295. Boolean(this.$route.query.handleStatus * 1)
  296. );
  297. }
  298. if (this.$route.query.evaluateStatus) {
  299. this.$set(this.searchForm, "evaluateStatus", this.$route.query.evaluateStatus);
  300. }
  301. this.$store.dispatch("setBranchs");
  302. this.init();
  303. },
  304. methods: {
  305. init() {
  306. this.getList();
  307. console.log(this.$refs.saveForm, "this.$refs.saveForm", this.$refs.saveForm.save);
  308. // this.$refs.saveForm.save();
  309. // resetQuery(this, {
  310. // handleStatus: undefined,
  311. // evaluateStatus: undefined,
  312. // filter_type: undefined,
  313. // });
  314. },
  315. async getList() {
  316. try {
  317. let { createTimer, ...rest } = this.searchForm;
  318. let params = {
  319. ...rest,
  320. page: this.rules.page,
  321. rows: this.rules.limit,
  322. ...getTimes(createTimer, ["startTime", "endTime"]),
  323. };
  324. const res = await getCoursePatrolEvaluation({
  325. ...params,
  326. page: this.rules.page,
  327. rows: this.rules.limit,
  328. });
  329. this.tableList = res.data.rows;
  330. this.rules.total = res.data.total;
  331. } catch (error) {
  332. console.log(error);
  333. }
  334. },
  335. search() {
  336. this.rules.page = 1;
  337. this.getList();
  338. },
  339. submitMessage() {
  340. this.$refs.patrolModelsRef.submit();
  341. },
  342. onReSet() {
  343. this.$nextTick(() => {
  344. this.getList();
  345. });
  346. },
  347. lookDetail(row) {
  348. this.activeRow = row;
  349. this.dialogFormVisible = true;
  350. console.log("查看详情");
  351. },
  352. handleOpinion(row) {
  353. console.log("处理意见");
  354. },
  355. getProblemType(type) {
  356. if (type) {
  357. const arrList = type.split(",");
  358. arrList.map((item) => {
  359. return;
  360. });
  361. } else {
  362. return "--";
  363. }
  364. },
  365. },
  366. watch: {
  367. "searchForm.organId"(val) {
  368. if (val) {
  369. queryByOrganId({ organId: val }).then((res) => {
  370. if (res.code == 200) {
  371. this.cooperationList = res.data;
  372. }
  373. });
  374. }
  375. },
  376. // "searchForm.cooperationId"(val) {
  377. // if (val) {
  378. // getMusicGroup({ cooperationId: val }).then((res) => {
  379. // this.musicList = res.data;
  380. // });
  381. // }
  382. // },
  383. },
  384. };
  385. </script>
  386. <style lang="scss">
  387. .seachInput {
  388. .el-input__inner {
  389. width: 200px !important;
  390. }
  391. }
  392. </style>