passed.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <!--已通过 passed-->
  2. <template>
  3. <div class="app-container passed">
  4. <el-table v-loading="loading" border :data="studentinfoList" @selection-change="handleSelectionChange">
  5. <el-table-column label="姓名" align="left" prop="userName" />
  6. <el-table-column label="申请时间" align="left" prop="commitTime">
  7. <template slot-scope="scope">
  8. <span>{{ parseTime(scope.row.commitTime) }}</span>
  9. </template>
  10. </el-table-column>
  11. <el-table-column label="通过时间" align="left" prop="auditTime">
  12. <template slot-scope="scope">
  13. <span>{{ parseTime(scope.row.auditTime) }}</span>
  14. </template>
  15. </el-table-column>
  16. </el-table>
  17. <pagination :page-sizes="[20, 30, 40, 50]"
  18. v-show="total>0"
  19. :total="total"
  20. layout="total, prev, pager, next, sizes, jumper"
  21. :page.sync="queryParams.pageNum"
  22. :limit.sync="queryParams.pageSize"
  23. @pagination="getList"
  24. />
  25. <!-- 添加或修改学生信息对话框 -->
  26. <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
  27. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  28. <el-form-item label="学生ID" prop="joinStudentsId">
  29. <el-input v-model="form.joinStudentsId" placeholder="请输入学生ID" />
  30. </el-form-item>
  31. <el-form-item label="审核状态">
  32. <el-radio-group v-model="form.auditStatus">
  33. <el-radio label="1">请选择字典生成</el-radio>
  34. </el-radio-group>
  35. </el-form-item>
  36. <el-form-item label="学生卡图片" prop="card">
  37. <el-input v-model="form.card" placeholder="请输入学生卡图片" />
  38. </el-form-item>
  39. <el-form-item label="人脸信息图片" prop="faceImg">
  40. <el-input v-model="form.faceImg" placeholder="请输入人脸信息图片" />
  41. </el-form-item>
  42. <el-form-item label="部门id" prop="deptId">
  43. <el-input v-model="form.deptId" placeholder="请输入部门id" />
  44. </el-form-item>
  45. <el-form-item label="部门名称" prop="deptName">
  46. <el-input v-model="form.deptName" placeholder="请输入部门名称" />
  47. </el-form-item>
  48. <el-form-item label="创建人" prop="userId">
  49. <el-input v-model="form.userId" placeholder="请输入创建人" />
  50. </el-form-item>
  51. <el-form-item label="备注" prop="remark">
  52. <el-input v-model="form.remark" placeholder="请输入备注" />
  53. </el-form-item>
  54. </el-form>
  55. <div slot="footer" class="dialog-footer">
  56. <el-button @click="cancel">取 消</el-button>
  57. <el-button type="primary" @click="submitForm">确 定</el-button>
  58. </div>
  59. </el-dialog>
  60. </div>
  61. </template>
  62. <script>
  63. import { listStudentinfo, listStudentinfoByAudit,getStudentinfo, delStudentinfo, addStudentinfo, updateStudentinfo } from "@/api/laboratory/studentinfo";
  64. export default {
  65. name: "passed",
  66. data() {
  67. return {
  68. // 遮罩层
  69. loading: true,
  70. // 选中数组
  71. ids: [],
  72. // 非单个禁用
  73. single: true,
  74. // 非多个禁用
  75. multiple: true,
  76. // 显示搜索条件
  77. showSearch: true,
  78. // 总条数
  79. total: 0,
  80. // 学生信息表格数据
  81. studentinfoList: [],
  82. // 弹出层标题
  83. title: "",
  84. // 是否显示弹出层
  85. open: false,
  86. // 查询参数
  87. queryParams: {
  88. pageNum: 1,
  89. pageSize:20,
  90. joinStudentsId: null,
  91. auditStatus: 'SUCCESS',
  92. card: null,
  93. faceImg: null,
  94. deptId: null,
  95. deptName: null,
  96. userId: null,
  97. },
  98. // 表单参数
  99. form: {},
  100. // 表单校验
  101. rules: {
  102. },
  103. };
  104. },
  105. created() {
  106. this.getList();
  107. },
  108. methods: {
  109. /** 查询学生信息列表 */
  110. getList() {
  111. this.loading = true;
  112. listStudentinfoByAudit(this.queryParams.auditStatus).then(response => {
  113. this.studentinfoList = response.rows;
  114. this.total = response.total;
  115. this.loading = false;
  116. });
  117. },
  118. // 取消按钮
  119. cancel() {
  120. this.open = false;
  121. this.reset();
  122. },
  123. // 表单重置
  124. reset() {
  125. this.form = {
  126. joinStudentsId: null,
  127. auditStatus: 0,
  128. card: null,
  129. faceImg: null,
  130. deptId: null,
  131. deptName: null,
  132. userId: null,
  133. remark: null,
  134. createBy: null,
  135. createTime: null,
  136. updateBy: null,
  137. updateTime: null
  138. };
  139. this.resetForm("form");
  140. },
  141. /** 搜索按钮操作 */
  142. handleQuery() {
  143. this.queryParams.pageNum = 1;
  144. this.getList();
  145. },
  146. /** 重置按钮操作 */
  147. resetQuery() {
  148. this.resetForm("queryForm");
  149. this.handleQuery();
  150. },
  151. // 多选框选中数据
  152. handleSelectionChange(selection) {
  153. this.ids = selection.map(item => item.joinStudentsId)
  154. this.single = selection.length!==1
  155. this.multiple = !selection.length
  156. },
  157. /** 新增按钮操作 */
  158. handleAdd() {
  159. this.reset();
  160. this.open = true;
  161. this.title = "添加学生信息";
  162. },
  163. /** 修改按钮操作 */
  164. handleUpdate(row) {
  165. this.reset();
  166. const joinStudentsId = row.joinStudentsId || this.ids
  167. getStudentinfo(joinStudentsId).then(response => {
  168. this.form = response.data;
  169. this.open = true;
  170. this.title = "修改学生信息";
  171. });
  172. },
  173. /** 提交按钮 */
  174. submitForm() {
  175. this.$refs["form"].validate(valid => {
  176. if (valid) {
  177. if (this.form.joinStudentsId != null) {
  178. updateStudentinfo(this.form).then(response => {
  179. this.msgSuccess("修改成功");
  180. this.open = false;
  181. this.getList();
  182. });
  183. } else {
  184. addStudentinfo(this.form).then(response => {
  185. this.msgSuccess("新增成功");
  186. this.open = false;
  187. this.getList();
  188. });
  189. }
  190. }
  191. });
  192. },
  193. /** 删除按钮操作 */
  194. handleDelete(row) {
  195. const joinStudentsIds = row.joinStudentsId || this.ids;
  196. this.$confirm('确认删除学生信息吗?', "警告", {
  197. confirmButtonText: "确定",
  198. cancelButtonText: "取消",
  199. type: "warning"
  200. }).then(function() {
  201. return delStudentinfo(joinStudentsIds);
  202. }).then(() => {
  203. this.getList();
  204. this.msgSuccess("删除成功");
  205. }).catch(() => {});
  206. },
  207. /** 导出按钮操作 */
  208. handleExport() {
  209. this.download('laboratory/studentinfo/export', {
  210. ...this.queryParams
  211. }, `laboratory_studentinfo.xlsx`)
  212. }
  213. }
  214. };
  215. </script>
  216. <style scoped lang="scss">
  217. .passed {
  218. flex:1;
  219. display: flex!important;
  220. flex-direction: column;
  221. }
  222. </style>