|
@@ -0,0 +1,238 @@
|
|
|
+<template>
|
|
|
+ <div class="scan-task-manage">
|
|
|
+ <div class="part-box part-box-filter part-box-flex">
|
|
|
+ <el-form ref="FilterForm" label-position="left" label-width="85px" inline>
|
|
|
+ <template v-if="checkPrivilege('condition', 'condition')">
|
|
|
+ <!-- <el-form-item label="关键词:" label-width="75px">
|
|
|
+ <el-input
|
|
|
+ style="width: 180px;"
|
|
|
+ v-model.trim="filter.userInfo"
|
|
|
+ placeholder="扫描员/课程"
|
|
|
+ clearable
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item> -->
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <el-form-item label-width="0px">
|
|
|
+ <el-button
|
|
|
+ v-if="checkPrivilege('button', 'select')"
|
|
|
+ type="primary"
|
|
|
+ @click="toPage(1)"
|
|
|
+ >查询</el-button
|
|
|
+ >
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div class="part-box-action">
|
|
|
+ <el-button
|
|
|
+ v-if="checkPrivilege('button', 'batchDelete')"
|
|
|
+ type="danger"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ :loading="loading"
|
|
|
+ @click="batchDelete"
|
|
|
+ >批量删除</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="success"
|
|
|
+ icon="el-icon-download"
|
|
|
+ v-if="checkPrivilege('button', 'export')"
|
|
|
+ ><a :href="downloadUrl" :download="dfilename">模板下载</a></el-button
|
|
|
+ >
|
|
|
+ <upload-button
|
|
|
+ v-if="checkPrivilege('button', 'export')"
|
|
|
+ btn-icon="el-icon-circle-plus-outline"
|
|
|
+ btn-content="批量导入"
|
|
|
+ btn-type="success"
|
|
|
+ :upload-url="uploadUrl"
|
|
|
+ :format="['xls', 'xlsx']"
|
|
|
+ accept=".xls,.xlsx"
|
|
|
+ @valid-error="validError"
|
|
|
+ @upload-success="uploadSuccess"
|
|
|
+ >
|
|
|
+ </upload-button>
|
|
|
+ <el-button
|
|
|
+ v-if="checkPrivilege('button', 'add')"
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-circle-plus-outline"
|
|
|
+ @click="toAdd"
|
|
|
+ >新增任务</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="part-box part-box-pad">
|
|
|
+ <el-table
|
|
|
+ ref="TableList"
|
|
|
+ :data="taskList"
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
+ >
|
|
|
+ <el-table-column
|
|
|
+ type="selection"
|
|
|
+ width="55"
|
|
|
+ align="center"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column prop="name" label="任务名称"></el-table-column>
|
|
|
+ <el-table-column prop="id" label="任务ID" width="120"></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="recordType"
|
|
|
+ label="档案名称"
|
|
|
+ width="120"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column prop="recordNumber" label="档案编号"></el-table-column>
|
|
|
+ <el-table-column prop="courseName" label="课程"> </el-table-column>
|
|
|
+ <el-table-column prop="teacherName" label="任课老师"> </el-table-column>
|
|
|
+ <el-table-column prop="teachingRoomName" label="教学班">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="scanCount" label="扫描量(份)">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="scanUser" label="扫描员"> </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ class-name="action-column"
|
|
|
+ label="操作"
|
|
|
+ width="200px"
|
|
|
+ fixed="right"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ v-if="checkPrivilege('link', 'edit')"
|
|
|
+ class="btn-primary"
|
|
|
+ type="text"
|
|
|
+ @click="toBindScanUser(scope.row)"
|
|
|
+ >绑定扫描员</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ v-if="checkPrivilege('link', 'detail')"
|
|
|
+ class="btn-primary"
|
|
|
+ type="text"
|
|
|
+ @click="toEdit(scope.row)"
|
|
|
+ >查看详情</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ v-if="checkPrivilege('link', 'delete')"
|
|
|
+ class="btn-danger"
|
|
|
+ type="text"
|
|
|
+ @click="toDelete(scope.row)"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div class="part-page">
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ layout="total,prev, pager, next"
|
|
|
+ :current-page="current"
|
|
|
+ :total="total"
|
|
|
+ :page-size="size"
|
|
|
+ @current-change="toPage"
|
|
|
+ >
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- ScanTaskBindUserDialog -->
|
|
|
+ <scan-task-bind-user-dialog
|
|
|
+ ref="ScanTaskBindUserDialog"
|
|
|
+ :instance="curRow"
|
|
|
+ @modified="getList"
|
|
|
+ ></scan-task-bind-user-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { scanTaskListPage, deleteScanTask } from "../api";
|
|
|
+import UploadButton from "../../../components/UploadButton";
|
|
|
+import ScanTaskBindUserDialog from "../components/ScanTaskBindUserDialog.vue";
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: "user-manage",
|
|
|
+ components: { ScanTaskBindUserDialog, UploadButton },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ filter: {},
|
|
|
+ current: 1,
|
|
|
+ size: this.GLOBAL.pageSize,
|
|
|
+ total: 0,
|
|
|
+ multipleSelection: [],
|
|
|
+ taskList: [],
|
|
|
+ curRow: {},
|
|
|
+ loading: false,
|
|
|
+ userId: this.$ls.get("user", { id: "" }).id,
|
|
|
+ // import
|
|
|
+ uploadUrl: "/api/admin/sys/user/import",
|
|
|
+ downloadUrl: "/temps/userTemplate.xlsx",
|
|
|
+ dfilename: "用户导入模板.xlsx"
|
|
|
+ };
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ async getList() {
|
|
|
+ if (!this.checkPrivilege("list", "list")) return;
|
|
|
+ const datas = {
|
|
|
+ ...this.filter,
|
|
|
+ pageNumber: this.current,
|
|
|
+ pageSize: this.size
|
|
|
+ };
|
|
|
+ const data = await scanTaskListPage(datas);
|
|
|
+ this.taskList = data.records;
|
|
|
+ this.total = data.total;
|
|
|
+ },
|
|
|
+ toPage(page) {
|
|
|
+ this.current = page;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ handleSelectionChange(val) {
|
|
|
+ this.multipleSelection = val.map(item => item.id);
|
|
|
+ },
|
|
|
+ toBindScanUser(row) {
|
|
|
+ this.curRow = row;
|
|
|
+ this.$refs.ScanTaskBindUserDialog.open();
|
|
|
+ },
|
|
|
+ toEdit(row) {
|
|
|
+ this.curRow = row;
|
|
|
+ this.$refs.ScanTaskBindUserDialog.open();
|
|
|
+ },
|
|
|
+ toAdd() {
|
|
|
+ this.curRow = {};
|
|
|
+ this.$refs.ScanTaskBindUserDialog.open();
|
|
|
+ },
|
|
|
+ async batchDelete() {
|
|
|
+ if (!this.multipleSelection.length) {
|
|
|
+ this.$message.error("请选择要删除的数据");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const res = await this.$confirm(`确定要删除选中的这些任务吗?`, "提示", {
|
|
|
+ type: "warning"
|
|
|
+ }).catch(() => {});
|
|
|
+ if (res !== "confirm") return;
|
|
|
+
|
|
|
+ await deleteScanTask(this.multipleSelection);
|
|
|
+ this.$message.success("操作成功!");
|
|
|
+ this.deletePageLastItem(this.multipleSelection.length);
|
|
|
+ this.multipleSelection = [];
|
|
|
+ },
|
|
|
+ async toDelete(row) {
|
|
|
+ const res = await this.$confirm(
|
|
|
+ `确定要删除任务【${row.name}】吗??`,
|
|
|
+ "提示",
|
|
|
+ {
|
|
|
+ type: "warning"
|
|
|
+ }
|
|
|
+ ).catch(() => {});
|
|
|
+ if (res !== "confirm") return;
|
|
|
+
|
|
|
+ await deleteScanTask([row.id]);
|
|
|
+ this.$message.success("操作成功!");
|
|
|
+ this.deletePageLastItem();
|
|
|
+ },
|
|
|
+ // import
|
|
|
+ validError(errorData) {
|
|
|
+ this.$message.error(errorData.message);
|
|
|
+ },
|
|
|
+ uploadSuccess() {
|
|
|
+ this.getList();
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|