TaskApplyManage.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. <template>
  2. <div class="task-apply-manage">
  3. <div class="part-box part-box-filter part-box-flex">
  4. <el-form ref="FilterForm" label-position="left" label-width="85px" inline>
  5. <el-form-item label="审核状态:">
  6. <el-select
  7. v-model="filter.auditStatus"
  8. style="width: 142px;"
  9. placeholder="请选择"
  10. clearable
  11. >
  12. <el-option
  13. v-for="(val, key) in AUDITING_STATUS"
  14. :key="key"
  15. :value="key"
  16. :label="val"
  17. ></el-option>
  18. </el-select>
  19. </el-form-item>
  20. <el-form-item label="审核结果:">
  21. <el-select
  22. v-model="filter.reviewStatus"
  23. style="width: 142px;"
  24. placeholder="请选择"
  25. clearable
  26. >
  27. <el-option
  28. v-for="(val, key) in AUDITING_RESULT"
  29. :key="key"
  30. :value="key"
  31. :label="val"
  32. ></el-option>
  33. </el-select>
  34. </el-form-item>
  35. <el-form-item label="题卡规则:">
  36. <card-rule-select
  37. ref="CardRuleSelect"
  38. v-model.trim="filter.cardRuleId"
  39. placeholder="请选择"
  40. clearable
  41. ></card-rule-select>
  42. </el-form-item>
  43. <el-form-item label="课程(代码):" label-width="110px">
  44. <course-select
  45. ref="CourseSelect"
  46. v-model.trim="filter.courseCode"
  47. placeholder="请选择"
  48. clearable
  49. ></course-select>
  50. </el-form-item>
  51. <el-form-item label="试卷编号:">
  52. <paper-number-select
  53. ref="PaperNumberSelect"
  54. v-model="filter.paperNumber"
  55. placeholder="请选择"
  56. clearable
  57. ></paper-number-select>
  58. </el-form-item>
  59. <el-form-item label="命题时间:">
  60. <el-date-picker
  61. v-model="createTime"
  62. type="datetimerange"
  63. :picker-options="pickerOptions"
  64. range-separator="至"
  65. start-placeholder="开始日期"
  66. end-placeholder="结束日期"
  67. value-format="timestamp"
  68. align="right"
  69. unlink-panels
  70. >
  71. </el-date-picker>
  72. </el-form-item>
  73. <el-form-item label-width="0px">
  74. <el-button type="primary" icon="el-icon-search" @click="toPage(1)"
  75. >查询</el-button
  76. >
  77. </el-form-item>
  78. </el-form>
  79. </div>
  80. <div class="part-box">
  81. <el-table ref="TableList" :data="examTasks" border stripe>
  82. <el-table-column
  83. type="index"
  84. label="序号"
  85. width="70"
  86. align="center"
  87. :index="indexMethod"
  88. ></el-table-column>
  89. <el-table-column prop="paperNumber" label="试卷编号"></el-table-column>
  90. <el-table-column prop="courseName" label="课程(代码)">
  91. <template slot-scope="scope">
  92. {{ scope.row.courseName }}({{ scope.row.courseCode }})
  93. </template>
  94. </el-table-column>
  95. <el-table-column
  96. prop="specialty"
  97. label="适用专业(方向)"
  98. ></el-table-column>
  99. <el-table-column prop="cardRuleName" label="题卡规则"></el-table-column>
  100. <el-table-column
  101. prop="userName"
  102. label="命题老师"
  103. width="100"
  104. ></el-table-column>
  105. <el-table-column prop="startTime" label="命题开始时间">
  106. <span slot-scope="scope">{{
  107. scope.row.startTime | timestampFilter
  108. }}</span>
  109. </el-table-column>
  110. <el-table-column prop="endTime" label="命题结束时间">
  111. <span slot-scope="scope">{{
  112. scope.row.endTime | timestampFilter
  113. }}</span>
  114. </el-table-column>
  115. <el-table-column prop="auditStatus" label="审核状态" width="100">
  116. <template slot-scope="scope">
  117. {{ scope.row.auditStatus | auditStatusFilter }}
  118. </template>
  119. </el-table-column>
  120. <el-table-column prop="reviewStatus" label="审核结果" width="100">
  121. <template slot-scope="scope">
  122. {{ scope.row.reviewStatus | reviewStatusFilter }}
  123. </template>
  124. </el-table-column>
  125. <el-table-column prop="createName" label="创建人"></el-table-column>
  126. <el-table-column
  127. class-name="action-column"
  128. label="操作"
  129. align="center"
  130. width="120px"
  131. >
  132. <template slot-scope="scope">
  133. <el-button
  134. v-if="scope.row.auditStatus || scope.row.reviewStatus"
  135. class="btn-table-icon"
  136. type="text"
  137. icon="icon icon-circle-right"
  138. @click="toPreview(scope.row)"
  139. title="查看详情"
  140. ></el-button>
  141. <el-button
  142. v-if="!scope.row.auditStatus && !scope.row.reviewStatus"
  143. class="btn-table-icon"
  144. type="text"
  145. icon="icon icon-edit"
  146. @click="toEdit(scope.row)"
  147. title="立即申请"
  148. ></el-button>
  149. <el-button
  150. v-if="
  151. scope.row.auditStatus === 'AUDITED' &&
  152. scope.row.reviewStatus === 'NOT_PASS'
  153. "
  154. class="btn-table-icon"
  155. type="text"
  156. icon="icon icon-edit"
  157. @click="toEdit(scope.row)"
  158. title="重新申请"
  159. ></el-button>
  160. <el-button
  161. v-if="
  162. scope.row.auditStatus === 'NOT_AUDITED' &&
  163. scope.row.status === 'SUBMIT'
  164. "
  165. class="btn-table-icon"
  166. type="text"
  167. icon="icon icon-close-act"
  168. @click="toCancel(scope.row)"
  169. title="撤销申请"
  170. ></el-button>
  171. </template>
  172. </el-table-column>
  173. </el-table>
  174. <div class="part-page">
  175. <el-pagination
  176. background
  177. layout="total,prev, pager, next"
  178. :current-page="current"
  179. :total="total"
  180. :page-size="size"
  181. @current-change="toPage"
  182. >
  183. </el-pagination>
  184. </div>
  185. </div>
  186. <!-- ModifyTaskApply -->
  187. <modify-task-apply
  188. ref="ModifyTaskApply"
  189. :edit-type="editType"
  190. :instance="curExamTask"
  191. @modified="taskModified"
  192. ></modify-task-apply>
  193. </div>
  194. </template>
  195. <script>
  196. import ModifyTaskApply from "../components/ModifyTaskApply";
  197. import { AUDITING_STATUS, AUDITING_RESULT } from "@/constants/enumerate";
  198. import pickerOptions from "@/constants/datePickerOptions";
  199. import { taskApplyListPage, cancelOrRestartTaskApply } from "../api";
  200. import { mapActions } from "vuex";
  201. export default {
  202. name: "task-apply-manage",
  203. components: {
  204. ModifyTaskApply
  205. },
  206. data() {
  207. return {
  208. filter: {
  209. auditStatus: "",
  210. reviewStatus: "",
  211. cardRuleId: "",
  212. courseCode: "",
  213. paperNumber: "",
  214. startTime: "",
  215. endTime: ""
  216. },
  217. current: 1,
  218. size: this.GLOBAL.pageSize,
  219. total: 0,
  220. editType: "APPLY",
  221. AUDITING_STATUS,
  222. AUDITING_RESULT,
  223. examTasks: [],
  224. curExamTask: {},
  225. curUserId: this.$ls.get("user", { id: "" }).id,
  226. // date-picker
  227. createTime: [],
  228. pickerOptions
  229. };
  230. },
  231. created() {
  232. this.getList();
  233. },
  234. methods: {
  235. ...mapActions("exam", ["updateWaitTaskCount"]),
  236. async getList() {
  237. const datas = {
  238. ...this.filter,
  239. pageNumber: this.current,
  240. pageSize: this.size
  241. };
  242. if (this.createTime) {
  243. datas.startTime = this.createTime[0];
  244. datas.endTime = this.createTime[1];
  245. }
  246. const data = await taskApplyListPage(datas);
  247. this.examTasks = data.records;
  248. this.total = data.total;
  249. },
  250. toPage(page) {
  251. this.current = page;
  252. this.getList();
  253. },
  254. toCancel(row) {
  255. this.$confirm("确定要撤销当前申请吗?", "提示", {
  256. cancelButtonClass: "el-button--danger is-plain",
  257. confirmButtonClass: "el-button--primary",
  258. type: "warning"
  259. })
  260. .then(async () => {
  261. const data = await cancelOrRestartTaskApply({
  262. id: row.id,
  263. status: "CANCEL"
  264. }).catch(() => {});
  265. if (!data) return;
  266. this.$message.success("操作成功!");
  267. this.getList();
  268. })
  269. .catch(() => {});
  270. },
  271. toEdit(row) {
  272. this.curExamTask = row;
  273. this.editType = "APPLY";
  274. this.$refs.ModifyTaskApply.open();
  275. },
  276. toPreview(row) {
  277. this.curExamTask = row;
  278. this.editType = "PREVIEW";
  279. this.$refs.ModifyTaskApply.open();
  280. },
  281. taskModified() {
  282. this.getList();
  283. this.updateWaitTaskCount();
  284. }
  285. }
  286. };
  287. </script>