index.vue 7.2 KB

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