|
@@ -327,7 +327,7 @@
|
|
"
|
|
"
|
|
class="btn-primary"
|
|
class="btn-primary"
|
|
type="text"
|
|
type="text"
|
|
- @click="toViewPdf(scope.row)"
|
|
|
|
|
|
+ @click="toActionPdf(scope.row, 'view')"
|
|
>查看pdf</el-button
|
|
>查看pdf</el-button
|
|
>
|
|
>
|
|
<el-button
|
|
<el-button
|
|
@@ -338,7 +338,7 @@
|
|
"
|
|
"
|
|
class="btn-primary"
|
|
class="btn-primary"
|
|
type="text"
|
|
type="text"
|
|
- @click="toRebuildPdf(scope.row)"
|
|
|
|
|
|
+ @click="toActionPdf(scope.row, 'build')"
|
|
>重新生成pdf</el-button
|
|
>重新生成pdf</el-button
|
|
>
|
|
>
|
|
<el-button
|
|
<el-button
|
|
@@ -409,19 +409,27 @@
|
|
:visible.sync="padViewDialogVisible"
|
|
:visible.sync="padViewDialogVisible"
|
|
title="请选择PDF类型"
|
|
title="请选择PDF类型"
|
|
top="10vh"
|
|
top="10vh"
|
|
- width="540px"
|
|
|
|
|
|
+ width="600px"
|
|
:close-on-click-modal="false"
|
|
:close-on-click-modal="false"
|
|
:close-on-press-escape="false"
|
|
:close-on-press-escape="false"
|
|
append-to-body
|
|
append-to-body
|
|
>
|
|
>
|
|
- <el-button
|
|
|
|
- v-for="item in pdfList"
|
|
|
|
- :key="item.name"
|
|
|
|
- type="primary"
|
|
|
|
- size="large"
|
|
|
|
- @click="viewPdf(item)"
|
|
|
|
- >{{ item.type | printPdfTypeFilter }}</el-button
|
|
|
|
- >
|
|
|
|
|
|
+ <div class="text-center">
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="actionType === 'build'"
|
|
|
|
+ size="large"
|
|
|
|
+ @click="actionPdf({ type: undefined })"
|
|
|
|
+ >全部</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ v-for="item in pdfList"
|
|
|
|
+ :key="item.name"
|
|
|
|
+ type="primary"
|
|
|
|
+ size="large"
|
|
|
|
+ @click="actionPdf(item)"
|
|
|
|
+ >{{ item.type | printPdfTypeFilter }}</el-button
|
|
|
|
+ >
|
|
|
|
+ </div>
|
|
<div slot="footer"></div>
|
|
<div slot="footer"></div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
<!-- data-task-dialog -->
|
|
<!-- data-task-dialog -->
|
|
@@ -483,6 +491,7 @@ export default {
|
|
// view-pdf
|
|
// view-pdf
|
|
padViewDialogVisible: false,
|
|
padViewDialogVisible: false,
|
|
pdfList: [],
|
|
pdfList: [],
|
|
|
|
+ actionType: "view",
|
|
// view-template
|
|
// view-template
|
|
curTask: {},
|
|
curTask: {},
|
|
// date-picker
|
|
// date-picker
|
|
@@ -619,7 +628,9 @@ export default {
|
|
})
|
|
})
|
|
.catch(() => {});
|
|
.catch(() => {});
|
|
},
|
|
},
|
|
- async toViewPdf(row) {
|
|
|
|
|
|
+ async toActionPdf(row, actionType) {
|
|
|
|
+ this.curTask = row;
|
|
|
|
+ this.actionType = actionType;
|
|
this.pdfList = [];
|
|
this.pdfList = [];
|
|
let result = true;
|
|
let result = true;
|
|
const data = await getPrintTaskPdf(row.examDetailId).catch(() => {
|
|
const data = await getPrintTaskPdf(row.examDetailId).catch(() => {
|
|
@@ -631,13 +642,20 @@ export default {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
if (data.length === 1) {
|
|
if (data.length === 1) {
|
|
- this.viewPdf(data[0]);
|
|
|
|
|
|
+ this.actionPdf(data[0]);
|
|
} else {
|
|
} else {
|
|
this.pdfList = data;
|
|
this.pdfList = data;
|
|
this.padViewDialogVisible = true;
|
|
this.padViewDialogVisible = true;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- async toRebuildPdf(row) {
|
|
|
|
|
|
+ actionPdf(item) {
|
|
|
|
+ if (this.actionType === "view") {
|
|
|
|
+ this.viewPdf(item);
|
|
|
|
+ } else {
|
|
|
|
+ this.rebuildPdf(item);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ async rebuildPdf(item) {
|
|
const action = await this.$confirm(
|
|
const action = await this.$confirm(
|
|
`确定要重新生成该印刷任务PDF吗?`,
|
|
`确定要重新生成该印刷任务PDF吗?`,
|
|
"提示",
|
|
"提示",
|
|
@@ -647,7 +665,7 @@ export default {
|
|
).catch(() => {});
|
|
).catch(() => {});
|
|
if (action !== "confirm") return;
|
|
if (action !== "confirm") return;
|
|
|
|
|
|
- const res = await rebuildPrintTaskPdf(row.taskId);
|
|
|
|
|
|
+ const res = await rebuildPrintTaskPdf(this.curTask.taskId, item.type);
|
|
if (!res) return;
|
|
if (!res) return;
|
|
this.$message.success("操作成功!");
|
|
this.$message.success("操作成功!");
|
|
},
|
|
},
|