visitError.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. <template>
  2. <div>
  3. <save-form
  4. :inline="true"
  5. :model="searchForm"
  6. ref="searchForm"
  7. @submit="search"
  8. @reset="onReSet"
  9. :saveKey="`indexErrDataRecord-${searchType}`"
  10. >
  11. <el-form-item prop="organId">
  12. <el-select
  13. class="multiple"
  14. v-model.trim="searchForm.organId"
  15. filterable
  16. clearable
  17. placeholder="请选择分部"
  18. >
  19. <el-option
  20. v-for="(item, index) in selects.branchs"
  21. :key="index"
  22. :label="item.name"
  23. :value="item.id"
  24. ></el-option>
  25. </el-select>
  26. </el-form-item>
  27. <el-form-item prop="userId">
  28. <remote-search :commit="'setEducations'" v-model="searchForm.userId" />
  29. </el-form-item>
  30. <el-form-item prop="month">
  31. <el-date-picker
  32. v-model="searchForm.month"
  33. value-format="yyyy-MM"
  34. type="monthrange"
  35. start-placeholder="开始周期"
  36. end-placeholder="结束周期"
  37. style="width: 220px"
  38. >
  39. </el-date-picker>
  40. </el-form-item>
  41. <el-form-item>
  42. <el-button native-type="submit" type="primary">搜索</el-button>
  43. <el-button native-type="reset" type="danger">重置</el-button>
  44. </el-form-item>
  45. </save-form>
  46. <el-table
  47. style="width: 100%"
  48. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  49. :data="tableList"
  50. >
  51. <el-table-column align="center" prop="organName" label="分部">
  52. <template slot-scope="scope">
  53. <div>
  54. <copy-text>{{ scope.row.organName }}</copy-text>
  55. </div>
  56. </template>
  57. </el-table-column>
  58. <el-table-column align="center" prop="month" label="工作周期">
  59. <template slot-scope="scope">
  60. <div>
  61. {{ scope.row.month | dayjsFormatWeek }}
  62. </div>
  63. </template>
  64. </el-table-column>
  65. <el-table-column align="center" prop="userName" label="乐团主管">
  66. <template slot-scope="scope">
  67. <div>
  68. <copy-text>{{ scope.row.userName }}</copy-text>
  69. </div>
  70. </template>
  71. </el-table-column>
  72. <el-table-column align="center" prop="item" label="任务事项">
  73. <template slot-scope="scope">
  74. <div>
  75. {{ scope.row.item | inspectionItemFormat }}
  76. </div>
  77. </template>
  78. </el-table-column>
  79. <el-table-column
  80. align="center"
  81. prop="times"
  82. label="任务次数"
  83. ></el-table-column>
  84. <el-table-column
  85. align="center"
  86. prop="plannedTimes"
  87. label="已安排日程次数"
  88. ></el-table-column>
  89. <el-table-column
  90. align="center"
  91. prop="submittedTimes"
  92. label="已提交任务数"
  93. >
  94. <template slot-scope="scope">
  95. <div
  96. :style="
  97. scope.row.times > scope.row.submittedTimes ? 'color:red' : ''
  98. "
  99. >
  100. {{ scope.row.submittedTimes }}
  101. </div>
  102. </template>
  103. </el-table-column>
  104. <el-table-column align="center" prop="memo" label="处理意见" width="220">
  105. <template slot-scope="scope">
  106. <overflow-text :text="scope.row.memo"></overflow-text>
  107. </template>
  108. </el-table-column>
  109. <el-table-column align="center" label="异常产生时间">
  110. <template slot-scope="scope">
  111. <div>
  112. {{ scope.row.generateTime }}
  113. </div>
  114. </template>
  115. </el-table-column>
  116. <el-table-column align="center" label="异常处理时间">
  117. <template slot-scope="scope">
  118. <div>
  119. {{ scope.row.dealTime }}
  120. </div>
  121. </template>
  122. </el-table-column>
  123. <!-- <el-table-column align="center" prop="studentId" label="操作">
  124. <template slot-scope="scope">
  125. <div>
  126. <auth v-if="scope.row.item == 'INSPECT'" auths="/teamSchedule/scheduleDetail">
  127. <el-button type="text" @click="gotoHander(scope.row)"
  128. >安排日程</el-button
  129. >
  130. </auth>
  131. <auth v-if="scope.row.item != 'INSPECT'" auths="/returnVisitList">
  132. <el-button type="text" @click="gotoHander(scope.row)"
  133. >回访记录</el-button
  134. >
  135. </auth>
  136. <auth :auths="['inspectionItem/update']">
  137. <el-button
  138. type="text"
  139. :disabled="scope.row.times < scope.row.submittedTimes"
  140. @click="resetLine(scope.row)"
  141. >立即处理</el-button
  142. >
  143. </auth>
  144. </div>
  145. </template>
  146. </el-table-column> -->
  147. </el-table>
  148. <pagination
  149. sync
  150. :total.sync="rules.total"
  151. :saveKey="`indexErrDataRecord-${searchType}`"
  152. :page.sync="rules.page"
  153. :limit.sync="rules.limit"
  154. :page-sizes="rules.page_size"
  155. @pagination="getList"
  156. />
  157. <!-- <el-dialog title="处理方式" width="700px" :visible.sync="handleVisible">
  158. <el-input
  159. type="textarea"
  160. :rows="3"
  161. v-model="handleForm.memo"
  162. placeholder="请填写处理方式"
  163. ></el-input>
  164. <div slot="footer" class="dialog-footer">
  165. <el-button @click="handleVisible = false">取 消</el-button>
  166. <el-button type="primary" @click="submitHandle">确 定</el-button>
  167. </div>
  168. </el-dialog> -->
  169. </div>
  170. </template>
  171. <script>
  172. // import { getInspectionItem, resetInspectionItem } from "../api";
  173. import { permission } from "@/utils/directivePage";
  174. import pagination from "@/components/Pagination/index";
  175. import { getErrStudentVisit } from "../api";
  176. import dayjs from "dayjs";
  177. import { getTimes } from "@/utils";
  178. export default {
  179. props: ["searchType"],
  180. components: { pagination },
  181. data() {
  182. return {
  183. searchForm: {
  184. userId: "",
  185. organId: "",
  186. month: [],
  187. searchType: "",
  188. },
  189. handleForm: {
  190. memo: "",
  191. searchType: "",
  192. },
  193. tableList: [],
  194. handleVisible: false,
  195. rules: {
  196. // 分页规则
  197. limit: 10, // 限制显示条数
  198. page: 1, // 当前页
  199. total: 0, // 总条数
  200. page_size: [10, 20, 40, 50], // 选择限制显示条数
  201. },
  202. };
  203. },
  204. mounted() {
  205. const { query } = this.$route;
  206. if (query.organId) {
  207. this.searchForm.organId = query.organId;
  208. }
  209. if (query.start && query.end) {
  210. this.searchForm.month = [query.start, query.end];
  211. }
  212. this.$store.dispatch("setBranchs");
  213. this.getList();
  214. },
  215. methods: {
  216. permission(str) {
  217. return permission(str);
  218. },
  219. onReSet() {
  220. this.$refs.searchForm.resetFields();
  221. this.search();
  222. },
  223. search() {
  224. this.rules.page = 1;
  225. this.getList();
  226. },
  227. async getList() {
  228. let { month, ...rest } = this.searchForm;
  229. let params = {
  230. ...rest,
  231. page: this.rules.page,
  232. rows: this.rules.limit,
  233. ...getTimes(month, ["startTime", "endTime"], "YYYY-MM"),
  234. searchType: this.searchType,
  235. };
  236. try {
  237. const res = await getErrStudentVisit(params);
  238. this.tableList = res.data.rows;
  239. this.rules.total = res.data.total;
  240. } catch (e) {
  241. console.log(e);
  242. }
  243. },
  244. resetLine(row) {
  245. let { id, memo } = row;
  246. this.handleForm = { id, memo };
  247. this.handleVisible = true;
  248. },
  249. // async submitHandle() {
  250. // try {
  251. // const res = await resetInspectionItem(this.handleForm);
  252. // this.$message.success("提交成功");
  253. // this.getList();
  254. // this.handleVisible = false;
  255. // } catch (e) {
  256. // console.log(e);
  257. // }
  258. // },
  259. gotoHander(row) {
  260. let startTime = dayjs(row.month).startOf("month").format("YYYY-MM-DD");
  261. let endTime = dayjs(row.month).endOf("month").format("YYYY-MM-DD");
  262. if (row.item == "VISIT") {
  263. // 学员回访
  264. // 跳到回访页面 搜索条件 教务老师 时间范围
  265. this.$router.push({
  266. path: "/studentManager/returnVisitList",
  267. query: { teacher: row.userName, timer: [startTime, endTime] },
  268. });
  269. } else {
  270. // 下校巡查
  271. this.$router.push({
  272. path: "/main/scheduleDetail",
  273. query: {
  274. teacher: row.userId,
  275. startTime,
  276. endTime,
  277. name: row.userName,
  278. organId: row.organId,
  279. itemId: row.id,
  280. times: row.times,
  281. },
  282. });
  283. }
  284. },
  285. },
  286. };
  287. </script>
  288. <style lang="scss" scoped>
  289. </style>