|
@@ -180,13 +180,40 @@
|
|
|
<p v-for="(cont, cidx) in logList" :key="cidx">{{ cont }}</p>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+ <!-- pdf-view -->
|
|
|
+ <el-dialog
|
|
|
+ class="pdf-view-dialog"
|
|
|
+ :visible.sync="padViewDialogVisible"
|
|
|
+ title="请选择PDF类型"
|
|
|
+ top="10vh"
|
|
|
+ width="600px"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :close-on-press-escape="false"
|
|
|
+ append-to-body
|
|
|
+ >
|
|
|
+ <div class="text-center">
|
|
|
+ <el-button size="large" @click="rebuildPdf({ type: undefined })"
|
|
|
+ >全部</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ v-for="item in pdfList"
|
|
|
+ :key="item.name"
|
|
|
+ type="primary"
|
|
|
+ size="large"
|
|
|
+ @click="rebuildPdf(item)"
|
|
|
+ >{{ item.type | printPdfTypeFilter }}</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ <div slot="footer"></div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { DATA_TASK_STATUS, DATA_TASK_RESULT } from "@/constants/enumerate";
|
|
|
-import { pdfBuildListPage, taskResetPdf } from "../api";
|
|
|
+import { pdfBuildListPage } from "../api";
|
|
|
import pickerOptions from "@/constants/datePickerOptions";
|
|
|
+import { getPrintTaskPdf, rebuildPrintTaskPdf } from "@/modules/print/api";
|
|
|
|
|
|
export default {
|
|
|
name: "pdf-build-manage",
|
|
@@ -219,9 +246,11 @@ export default {
|
|
|
// log dialog
|
|
|
modalIsShow: false,
|
|
|
logList: [],
|
|
|
+ // view-pdf
|
|
|
+ padViewDialogVisible: false,
|
|
|
+ pdfList: [],
|
|
|
};
|
|
|
},
|
|
|
- mounted() {},
|
|
|
methods: {
|
|
|
async getList() {
|
|
|
if (!this.checkPrivilege("list", "list")) return;
|
|
@@ -243,21 +272,47 @@ export default {
|
|
|
this.current = page;
|
|
|
this.getList();
|
|
|
},
|
|
|
+ toViewLog(row) {
|
|
|
+ this.logList = (row.summary || "").split("\n");
|
|
|
+ this.modalIsShow = true;
|
|
|
+ },
|
|
|
async toResetCreatePdf(row) {
|
|
|
- if (this.loading) return;
|
|
|
+ this.curRow = row;
|
|
|
+ this.pdfList = [];
|
|
|
+ let result = true;
|
|
|
+ const data = await getPrintTaskPdf(row.id).catch(() => {
|
|
|
+ result = false;
|
|
|
+ });
|
|
|
+ if (!result) return;
|
|
|
+ if (!data || !data.length) {
|
|
|
+ this.$message.error("当前任务pdf还未生成好,请稍后再试!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (data.length === 1) {
|
|
|
+ this.rebuildPdf(data[0]);
|
|
|
+ } else {
|
|
|
+ this.pdfList = data;
|
|
|
+ this.padViewDialogVisible = true;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async rebuildPdf(item) {
|
|
|
+ const action = await this.$confirm(
|
|
|
+ `确定要重新生成该印刷任务PDF吗?`,
|
|
|
+ "提示",
|
|
|
+ {
|
|
|
+ type: "warning",
|
|
|
+ }
|
|
|
+ ).catch(() => {});
|
|
|
+ if (action !== "confirm") return;
|
|
|
|
|
|
- this.loading = true;
|
|
|
- const res = await taskResetPdf(row.id).catch(() => {});
|
|
|
- this.loading = false;
|
|
|
+ const res = await rebuildPrintTaskPdf(this.curRow.id, item.type).catch(
|
|
|
+ () => {}
|
|
|
+ );
|
|
|
if (!res) return;
|
|
|
-
|
|
|
this.$message.success("操作成功!");
|
|
|
+ this.padViewDialogVisible = false;
|
|
|
this.getList();
|
|
|
},
|
|
|
- toViewLog(row) {
|
|
|
- this.logList = (row.summary || "").split("\n");
|
|
|
- this.modalIsShow = true;
|
|
|
- },
|
|
|
},
|
|
|
};
|
|
|
</script>
|