|
@@ -2,13 +2,17 @@
|
|
<el-dialog
|
|
<el-dialog
|
|
class="publish-print-task"
|
|
class="publish-print-task"
|
|
:visible.sync="modalIsShow"
|
|
:visible.sync="modalIsShow"
|
|
- title="发布印刷任务"
|
|
|
|
- fullscreen
|
|
|
|
:close-on-click-modal="false"
|
|
:close-on-click-modal="false"
|
|
:close-on-press-escape="false"
|
|
:close-on-press-escape="false"
|
|
|
|
+ :show-close="false"
|
|
append-to-body
|
|
append-to-body
|
|
|
|
+ fullscreen
|
|
@opened="visibleChange"
|
|
@opened="visibleChange"
|
|
>
|
|
>
|
|
|
|
+ <div slot="title">
|
|
|
|
+ <span class="el-dialog__title">发布印刷任务</span>
|
|
|
|
+ <button class="el-dialog__headerbtn" @click="close"></button>
|
|
|
|
+ </div>
|
|
<div class="md-4">
|
|
<div class="md-4">
|
|
<el-form ref="FilterForm" label-position="left" label-width="0" inline>
|
|
<el-form ref="FilterForm" label-position="left" label-width="0" inline>
|
|
<el-form-item>
|
|
<el-form-item>
|
|
@@ -48,16 +52,15 @@
|
|
</el-form>
|
|
</el-form>
|
|
</div>
|
|
</div>
|
|
<div class="mb-2">
|
|
<div class="mb-2">
|
|
- <el-button type="primary" @click="toAdd">增加考试对象</el-button>
|
|
|
|
|
|
+ <el-button :disabled="curPlanSubmit" type="primary" @click="toAdd"
|
|
|
|
+ >增加考试对象</el-button
|
|
|
|
+ >
|
|
<el-button
|
|
<el-button
|
|
- v-if="curPlanSubmit"
|
|
|
|
- type="danger"
|
|
|
|
|
|
+ type="success"
|
|
:loading="loading"
|
|
:loading="loading"
|
|
- @click="toCancel"
|
|
|
|
- >撤回提交</el-button
|
|
|
|
- >
|
|
|
|
- <el-button v-else type="success" :loading="loading" @click="toSubmit"
|
|
|
|
- >提交</el-button
|
|
|
|
|
|
+ :disabled="curPlanSubmit || !tableData.length"
|
|
|
|
+ @click="toSubmit"
|
|
|
|
+ >发布</el-button
|
|
>
|
|
>
|
|
</div>
|
|
</div>
|
|
<el-table ref="TableList" :data="tableData">
|
|
<el-table ref="TableList" :data="tableData">
|
|
@@ -65,8 +68,6 @@
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column prop="examRoom" label="考场"> </el-table-column>
|
|
<el-table-column prop="examRoom" label="考场"> </el-table-column>
|
|
<el-table-column prop="examPlace" label="考点"> </el-table-column>
|
|
<el-table-column prop="examPlace" label="考点"> </el-table-column>
|
|
- <el-table-column prop="invigilatorTeacher" label="监考老师">
|
|
|
|
- </el-table-column>
|
|
|
|
<el-table-column prop="className" label="考试对象"> </el-table-column>
|
|
<el-table-column prop="className" label="考试对象"> </el-table-column>
|
|
<el-table-column prop="studentCount" label="人数"> </el-table-column>
|
|
<el-table-column prop="studentCount" label="人数"> </el-table-column>
|
|
<el-table-column prop="printHouseName" label="印刷室"> </el-table-column>
|
|
<el-table-column prop="printHouseName" label="印刷室"> </el-table-column>
|
|
@@ -95,12 +96,19 @@
|
|
>编辑</el-button
|
|
>编辑</el-button
|
|
>
|
|
>
|
|
<el-button
|
|
<el-button
|
|
- v-if="!curPlanSubmit"
|
|
|
|
|
|
+ v-if="scope.row.status === 'NEW' || scope.row.status === 'READY'"
|
|
class="btn-danger"
|
|
class="btn-danger"
|
|
type="text"
|
|
type="text"
|
|
@click="toDelete(scope.row)"
|
|
@click="toDelete(scope.row)"
|
|
>删除</el-button
|
|
>删除</el-button
|
|
>
|
|
>
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="scope.row.status === 'WAITING'"
|
|
|
|
+ class="btn-danger"
|
|
|
|
+ type="text"
|
|
|
|
+ @click="toCancel(scope.row)"
|
|
|
|
+ >撤回提交</el-button
|
|
|
|
+ >
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
@@ -124,12 +132,8 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import {
|
|
|
|
- listTaskPrint,
|
|
|
|
- removeTaskPrint,
|
|
|
|
- submitTaskPrint,
|
|
|
|
- cancelTaskPrint
|
|
|
|
-} from "../api";
|
|
|
|
|
|
+import { listTaskPrint, removeTaskPrint, submitTaskPrint } from "../api";
|
|
|
|
+import { cancelPrintTask } from "../../print/api";
|
|
import { examRuleDetail } from "../../base/api";
|
|
import { examRuleDetail } from "../../base/api";
|
|
import CreatePrintTask from "./CreatePrintTask";
|
|
import CreatePrintTask from "./CreatePrintTask";
|
|
import PrintTaskStudents from "./PrintTaskStudents";
|
|
import PrintTaskStudents from "./PrintTaskStudents";
|
|
@@ -187,6 +191,10 @@ export default {
|
|
this.filter = this.$objAssign(this.filter, this.instance);
|
|
this.filter = this.$objAssign(this.filter, this.instance);
|
|
this.tableData = [];
|
|
this.tableData = [];
|
|
this.curRow = {};
|
|
this.curRow = {};
|
|
|
|
+ this.timeDisabled = false;
|
|
|
|
+ this.createDate = "";
|
|
|
|
+ this.createTime = [...this.curCreateTime];
|
|
|
|
+ this.curPlanSubmit = false;
|
|
},
|
|
},
|
|
async getExtendFields() {
|
|
async getExtendFields() {
|
|
const examRule = await examRuleDetail();
|
|
const examRule = await examRuleDetail();
|
|
@@ -214,11 +222,10 @@ export default {
|
|
});
|
|
});
|
|
return item;
|
|
return item;
|
|
});
|
|
});
|
|
- this.total = data.iPage.total;
|
|
|
|
} else {
|
|
} else {
|
|
this.tableData = [];
|
|
this.tableData = [];
|
|
}
|
|
}
|
|
- this.curPlanSubmit = data.isSubmit;
|
|
|
|
|
|
+ this.curPlanSubmit = data.submit;
|
|
if (data.examStartTime && data.examEndTime) {
|
|
if (data.examStartTime && data.examEndTime) {
|
|
this.createTime = [data.examStartTime, data.examEndTime];
|
|
this.createTime = [data.examStartTime, data.examEndTime];
|
|
this.createDate = getTimeDatestamp(data.examStartTime);
|
|
this.createDate = getTimeDatestamp(data.examStartTime);
|
|
@@ -233,12 +240,13 @@ export default {
|
|
this.timeDisabled = false;
|
|
this.timeDisabled = false;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- toPage(page) {
|
|
|
|
- this.current = page;
|
|
|
|
- this.getList();
|
|
|
|
- },
|
|
|
|
printPlanChange(val) {
|
|
printPlanChange(val) {
|
|
- if (!val) return;
|
|
|
|
|
|
+ if (!val) {
|
|
|
|
+ this.timeDisabled = false;
|
|
|
|
+ this.createDate = "";
|
|
|
|
+ this.createTime = [...this.curCreateTime];
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
this.filter.printPlanName = val && val.name;
|
|
this.filter.printPlanName = val && val.name;
|
|
this.getList();
|
|
this.getList();
|
|
},
|
|
},
|
|
@@ -261,6 +269,21 @@ export default {
|
|
open() {
|
|
open() {
|
|
this.modalIsShow = true;
|
|
this.modalIsShow = true;
|
|
},
|
|
},
|
|
|
|
+ async close() {
|
|
|
|
+ if (this.tableData.length && !this.curPlanSubmit) {
|
|
|
|
+ const result = await this.$confirm(
|
|
|
|
+ `当前印刷计划下印刷任务还没有发布,是否要发布?`,
|
|
|
|
+ "提示",
|
|
|
|
+ {
|
|
|
|
+ type: "warning"
|
|
|
|
+ }
|
|
|
|
+ ).catch(() => {});
|
|
|
|
+ if (result === "confirm") {
|
|
|
|
+ await this.sumbitTask();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.cancel();
|
|
|
|
+ },
|
|
toAdd() {
|
|
toAdd() {
|
|
if (
|
|
if (
|
|
!this.filter.printPlanId ||
|
|
!this.filter.printPlanId ||
|
|
@@ -307,6 +330,10 @@ export default {
|
|
).catch(() => {});
|
|
).catch(() => {});
|
|
if (result !== "confirm") return;
|
|
if (result !== "confirm") return;
|
|
|
|
|
|
|
|
+ await this.sumbitTask();
|
|
|
|
+ this.cancel();
|
|
|
|
+ },
|
|
|
|
+ async sumbitTask() {
|
|
const datas = {
|
|
const datas = {
|
|
printPlanId: this.filter.printPlanId,
|
|
printPlanId: this.filter.printPlanId,
|
|
list: this.tableData.map(item => item.examDetailId)
|
|
list: this.tableData.map(item => item.examDetailId)
|
|
@@ -319,27 +346,17 @@ export default {
|
|
this.curPlanSubmit = true;
|
|
this.curPlanSubmit = true;
|
|
this.$message.success("印刷任务发布成功!");
|
|
this.$message.success("印刷任务发布成功!");
|
|
},
|
|
},
|
|
- async toCancel() {
|
|
|
|
- const result = await this.$confirm(
|
|
|
|
- `确定要撤回当前计划所有印刷任务吗?`,
|
|
|
|
- "提示",
|
|
|
|
- {
|
|
|
|
- type: "warning"
|
|
|
|
- }
|
|
|
|
- ).catch(() => {});
|
|
|
|
|
|
+ async toCancel(row) {
|
|
|
|
+ const result = await this.$confirm(`确定撤回该印刷任务吗?`, "提示", {
|
|
|
|
+ type: "warning"
|
|
|
|
+ }).catch(() => {});
|
|
if (result !== "confirm") return;
|
|
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;
|
|
|
|
|
|
+ const data = await cancelPrintTask(row.examDetailId);
|
|
|
|
+ if (!data) return;
|
|
|
|
|
|
- this.curPlanSubmit = false;
|
|
|
|
- this.$message.success("印刷任务撤销成功!");
|
|
|
|
|
|
+ this.$message.success("撤回成功!");
|
|
|
|
+ this.getList();
|
|
},
|
|
},
|
|
async toDelete(row) {
|
|
async toDelete(row) {
|
|
const result = await this.$confirm(`确定要删除当前卷袋吗?`, "提示", {
|
|
const result = await this.$confirm(`确定要删除当前卷袋吗?`, "提示", {
|
|
@@ -349,7 +366,7 @@ export default {
|
|
|
|
|
|
await removeTaskPrint(row.id);
|
|
await removeTaskPrint(row.id);
|
|
this.$message.success("删除成功!");
|
|
this.$message.success("删除成功!");
|
|
- this.deletePageLastItem();
|
|
|
|
|
|
+ this.getList();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|