|
@@ -47,9 +47,19 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
- <el-button class="mb-2" type="primary" @click="toAdd"
|
|
|
- >增加考试对象</el-button
|
|
|
- >
|
|
|
+ <div class="mb-2">
|
|
|
+ <el-button type="primary" @click="toAdd">增加考试对象</el-button>
|
|
|
+ <el-button
|
|
|
+ v-if="curPlanSubmit"
|
|
|
+ type="danger"
|
|
|
+ :loading="loading"
|
|
|
+ @click="toCancel"
|
|
|
+ >撤回提交</el-button
|
|
|
+ >
|
|
|
+ <el-button v-else type="success" :loading="loading" @click="toSubmit"
|
|
|
+ >提交</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
<el-table ref="TableList" :data="tableData">
|
|
|
<el-table-column type="index" width="80" label="卷袋序号">
|
|
|
</el-table-column>
|
|
@@ -77,26 +87,23 @@
|
|
|
@click="toPreview(scope.row)"
|
|
|
>考生明细</el-button
|
|
|
>
|
|
|
- <el-button class="btn-primary" type="text" @click="toEdit(scope.row)"
|
|
|
+ <el-button
|
|
|
+ v-if="!curPlanSubmit"
|
|
|
+ class="btn-primary"
|
|
|
+ type="text"
|
|
|
+ @click="toEdit(scope.row)"
|
|
|
>编辑</el-button
|
|
|
>
|
|
|
- <el-button class="btn-danger" type="text" @click="toDelete(scope.row)"
|
|
|
+ <el-button
|
|
|
+ v-if="!curPlanSubmit"
|
|
|
+ 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 slot="footer"></div>
|
|
|
|
|
@@ -117,7 +124,12 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { listTaskPrint, removeTaskPrint } from "../api";
|
|
|
+import {
|
|
|
+ listTaskPrint,
|
|
|
+ removeTaskPrint,
|
|
|
+ submitTaskPrint,
|
|
|
+ cancelTaskPrint
|
|
|
+} from "../api";
|
|
|
import { examRuleDetail } from "../../base/api";
|
|
|
import CreatePrintTask from "./CreatePrintTask";
|
|
|
import PrintTaskStudents from "./PrintTaskStudents";
|
|
@@ -137,7 +149,6 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
modalIsShow: false,
|
|
|
- isSubmit: false,
|
|
|
filter: {
|
|
|
printPlanName: "",
|
|
|
printPlanId: "",
|
|
@@ -147,9 +158,8 @@ export default {
|
|
|
courseName: "",
|
|
|
courseCode: ""
|
|
|
},
|
|
|
- current: 1,
|
|
|
- size: this.GLOBAL.pageSize,
|
|
|
- total: 0,
|
|
|
+ loading: false,
|
|
|
+ curPlanSubmit: false,
|
|
|
timeDisabled: false,
|
|
|
tableData: [],
|
|
|
curRow: {},
|
|
@@ -193,8 +203,8 @@ export default {
|
|
|
pageSize: this.size
|
|
|
};
|
|
|
const data = await listTaskPrint(datas);
|
|
|
- if (data.iPage) {
|
|
|
- this.tableData = data.iPage.records.map(item => {
|
|
|
+ if (data.list) {
|
|
|
+ this.tableData = data.list.map(item => {
|
|
|
item.extends = {};
|
|
|
const extendFields = item.extendFields
|
|
|
? JSON.parse(item.extendFields)
|
|
@@ -208,6 +218,7 @@ export default {
|
|
|
} else {
|
|
|
this.tableData = [];
|
|
|
}
|
|
|
+ this.curPlanSubmit = data.isSubmit;
|
|
|
if (data.examStartTime && data.examEndTime) {
|
|
|
this.createTime = [data.examStartTime, data.examEndTime];
|
|
|
this.createDate = getTimeDatestamp(data.examStartTime);
|
|
@@ -286,6 +297,50 @@ export default {
|
|
|
this.curClassId = row.classId;
|
|
|
this.$refs.PrintTaskStudents.open();
|
|
|
},
|
|
|
+ async toSubmit() {
|
|
|
+ const result = await this.$confirm(
|
|
|
+ `确定要发布当前计划所有印刷任务吗?`,
|
|
|
+ "提示",
|
|
|
+ {
|
|
|
+ type: "warning"
|
|
|
+ }
|
|
|
+ ).catch(() => {});
|
|
|
+ if (result !== "confirm") return;
|
|
|
+
|
|
|
+ const datas = {
|
|
|
+ printPlanId: this.filter.printPlanId,
|
|
|
+ list: this.tableData.map(item => item.examDetailId)
|
|
|
+ };
|
|
|
+ this.loading = true;
|
|
|
+ const res = await submitTaskPrint(datas).catch(() => {});
|
|
|
+ this.loading = false;
|
|
|
+ if (!res) return;
|
|
|
+
|
|
|
+ this.curPlanSubmit = true;
|
|
|
+ this.$message.success("印刷任务发布成功!");
|
|
|
+ },
|
|
|
+ async toCancel() {
|
|
|
+ const result = await this.$confirm(
|
|
|
+ `确定要撤回当前计划所有印刷任务吗?`,
|
|
|
+ "提示",
|
|
|
+ {
|
|
|
+ type: "warning"
|
|
|
+ }
|
|
|
+ ).catch(() => {});
|
|
|
+ if (result !== "confirm") return;
|
|
|
+
|
|
|
+ const datas = {
|
|
|
+ printPlanId: this.filter.printPlanId,
|
|
|
+ list: this.tableData.map(item => item.examDetailId)
|
|
|
+ };
|
|
|
+ this.loading = true;
|
|
|
+ const res = await cancelTaskPrint(datas).catch(() => {});
|
|
|
+ this.loading = false;
|
|
|
+ if (!res) return;
|
|
|
+
|
|
|
+ this.curPlanSubmit = false;
|
|
|
+ this.$message.success("印刷任务撤销成功!");
|
|
|
+ },
|
|
|
async toDelete(row) {
|
|
|
const result = await this.$confirm(`确定要删除当前卷袋吗?`, "提示", {
|
|
|
type: "warning"
|