From 507394e825626d375764491ceb335cf09a0378e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=98=8E=E6=A2=81?= <2429105222@qq.com> Date: Mon, 15 May 2023 17:42:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=85=E9=83=A8=E7=A0=81=EF=BC=8C=E5=BA=93?= =?UTF-8?q?=E5=AD=98=E6=98=8E=E7=BB=86=20=E6=8C=89=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E6=96=B9=E5=BC=8F=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/inout/orderDetailResult.js | 17 ++++ src/api/itextpdf/itextpdf.js | 20 ++++ .../basic/business/stockOrderQRCodeDetail.vue | 75 ++++++++++++++- src/views/inventory/inner/innerCodeDetail.vue | 89 ++++++++++++++---- src/views/inventory/supInoutSearchOrder.vue | 92 ++++++++++++++++--- 5 files changed, 263 insertions(+), 30 deletions(-) diff --git a/src/api/inout/orderDetailResult.js b/src/api/inout/orderDetailResult.js index 244896f..f7b60a8 100644 --- a/src/api/inout/orderDetailResult.js +++ b/src/api/inout/orderDetailResult.js @@ -15,3 +15,20 @@ export function getResultOrderList(params) { params: params }); } +export function verifyTemplateFile(data) { + return axios({ + url: "/udiwms/pdf/template/order/result/file", + method: "post", + data: data + }); +} + +export function printOrder(data) { + return axios({ + url: "/udiwms/inout/resultDetail/filterOrderPrint", + method: "post", + headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'}, + responseType: 'arraybuffer', //一定要设置响应类型,否则页面会是空白pdf + data: data + }); +} diff --git a/src/api/itextpdf/itextpdf.js b/src/api/itextpdf/itextpdf.js index ffb5177..5ec423b 100644 --- a/src/api/itextpdf/itextpdf.js +++ b/src/api/itextpdf/itextpdf.js @@ -71,6 +71,26 @@ export function stockQRCodeTextPDFFromTemplateFile(query) { responseType: 'arraybuffer', //一定要设置响应类型,否则页面会是空白pdf }); } + + +//---------打印码 +export function inspectionStockQRCodeTextPDFFromTemplateStatementFile(query) { + return axios({ + url: "/udiwms/pdf/template/inspection/stock/qrcode/text/statement/file", + method: "post", + data: query, + }); +} +export function stockQRCodeTextPDFFromTemplateStatementFile(query) { + return axios({ + url: "/udiwms/pdf/template/stock/qrcode/text/statement/file", + method: "post", + data: query, + headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'}, + responseType: 'arraybuffer', //一定要设置响应类型,否则页面会是空白pdf + }); +} + export function stockQRCodeTextPDFFromTemplateFileMax(query) { return axios({ url: "/udiwms/pdf/template/stock/qrcode/text/maxfile", diff --git a/src/views/basic/business/stockOrderQRCodeDetail.vue b/src/views/basic/business/stockOrderQRCodeDetail.vue index 55c54af..d6a9955 100644 --- a/src/views/basic/business/stockOrderQRCodeDetail.vue +++ b/src/views/basic/business/stockOrderQRCodeDetail.vue @@ -5,7 +5,8 @@ 生成内部码 - 打印全部 + 标签打印全部 + 报表打印全部 @@ -76,6 +77,13 @@ >标签打印 + 报表打印 + @@ -157,7 +165,7 @@ import draggable from "vuedraggable"; import { filterTemp, inspectionOrderDetailPDFFromTemplateFile, - inspectionStockQRCodeTextPDFFromTemplateFile, + inspectionStockQRCodeTextPDFFromTemplateFile, inspectionStockQRCodeTextPDFFromTemplateStatementFile,stockQRCodeTextPDFFromTemplateStatementFile, orderDetailPDFFromTemplateFile, stockQRCodeTextPDFFromTemplateFile, stockQRCodeTextPDFFromTemplateFileMax } from "@/api/itextpdf/itextpdf"; import {generateInCodeQRCodeText, generateInnerQRCodeText} from "@/api/inout/innerOrderQRCode"; @@ -262,6 +270,69 @@ export default { this.total = 0; }); }, + printStockOrderDetailStatementPDF(row) { + let tQuery = { + queryId: null, + orderId: null, + countList: [], + labelId: 5 + }; + if (row == null) { + tQuery.orderId = this.query.orderIdFk; + } else { + if (row.reCount <= 0) { + return this.$message.error('数量错误'); + } + tQuery.queryId = row.id; + } + this.loading = true; + inspectionStockQRCodeTextPDFFromTemplateStatementFile(tQuery).then((response) => { + if (response.code === 20000) { + if (row != null) { + tQuery.id = row.id; + tQuery.rowCount = row.reCount; + let data = { + queryId: row.id, + rowCount: row.count + } + tQuery.countList.push(data); + } else { + for (let i = 0; i < this.codeArray.length; i++) { + let data = { + queryId: this.codeArray[i].id, + rowCount: this.codeArray[i].count + } + tQuery.countList.push(data); + } + } + let count = 0; + for (let i = 0; i < tQuery.countList.length; i++) { + + count = count + tQuery.countList[i].rowCount; + console.log(count); + } + stockQRCodeTextPDFFromTemplateStatementFile(tQuery).then((response) => { + //将pdf文件转换为url。 + const binaryData = []; + binaryData.push(response); + //获取blob链接。 + let url = window.URL.createObjectURL( + new Blob(binaryData, {type: "application/pdf"}) + ); + this.loading = false; + window.open(url);//打开新标签页,预览pdf。 + this.getOrderQRCodeTextList(); + }).catch(() => { + this.loading = false; + }); + } else { + this.loading = false; + this.$message.error(response.message); + } + }).catch(() => { + this.loading = false; + }); + }, handleLableChange(val) { this.refreshQuery.page = val.page; this.refeshLabel(); diff --git a/src/views/inventory/inner/innerCodeDetail.vue b/src/views/inventory/inner/innerCodeDetail.vue index 51a311b..2a30586 100644 --- a/src/views/inventory/inner/innerCodeDetail.vue +++ b/src/views/inventory/inner/innerCodeDetail.vue @@ -4,22 +4,9 @@ - 生成内部码 - - - 打印全部 - + 生成内部码 + 标签打印全部 + 报表打印全部 @@ -87,6 +74,13 @@ >标签打印 + 报表打印 + @@ -371,6 +365,69 @@ export default { }); }, + printStockOrderDetailStatementPDF(row) { + let tQuery = { + queryId: null, + orderId: null, + countList: [], + labelId: 5 + }; + if (row == null) { + tQuery.orderId = this.query.orderIdFk; + } else { + if (row.reCount <= 0) { + return this.$message.error('数量错误'); + } + tQuery.queryId = row.id; + } + this.loading = true; + inspectionStockQRCodeTextPDFFromTemplateStatementFile(tQuery).then((response) => { + if (response.code === 20000) { + if (row != null) { + tQuery.id = row.id; + tQuery.rowCount = row.reCount; + let data = { + queryId: row.id, + rowCount: row.count + } + tQuery.countList.push(data); + } else { + for (let i = 0; i < this.codeArray.length; i++) { + let data = { + queryId: this.codeArray[i].id, + rowCount: this.codeArray[i].count + } + tQuery.countList.push(data); + } + } + let count = 0; + for (let i = 0; i < tQuery.countList.length; i++) { + + count = count + tQuery.countList[i].rowCount; + console.log(count); + } + stockQRCodeTextPDFFromTemplateStatementFile(tQuery).then((response) => { + //将pdf文件转换为url。 + const binaryData = []; + binaryData.push(response); + //获取blob链接。 + let url = window.URL.createObjectURL( + new Blob(binaryData, {type: "application/pdf"}) + ); + this.loading = false; + window.open(url);//打开新标签页,预览pdf。 + this.getOrderQRCodeTextList(); + }).catch(() => { + this.loading = false; + }); + } else { + this.loading = false; + this.$message.error(response.message); + } + }).catch(() => { + this.loading = false; + }); + }, generateQRCodeText() { this.$confirm("确定生成内部码?", "提示", { confirmButtonText: "确定", diff --git a/src/views/inventory/supInoutSearchOrder.vue b/src/views/inventory/supInoutSearchOrder.vue index d1368f6..24b97a1 100644 --- a/src/views/inventory/supInoutSearchOrder.vue +++ b/src/views/inventory/supInoutSearchOrder.vue @@ -69,20 +69,15 @@
显示/隐藏搜索栏 - 重置 - - 查询 - + 选入打印 + 查询打印 + 重置 + 查询
- + + @@ -112,7 +107,8 @@