|
|
|
@ -87,6 +87,13 @@
|
|
|
|
|
>标签打印
|
|
|
|
|
</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
type="text"
|
|
|
|
|
size="small"
|
|
|
|
|
@click.native="printStockOrderDetailStatementPDF(scope.row)"
|
|
|
|
|
>报表打印
|
|
|
|
|
</el-button
|
|
|
|
|
>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
@ -164,8 +171,8 @@
|
|
|
|
|
import {stockQRCodeText, filterPrint, generateInnerQRCodeText} from "@/api/inout/innerOrderQRCode";
|
|
|
|
|
import draggable from "vuedraggable";
|
|
|
|
|
import {
|
|
|
|
|
filterTemp, inspectionStockQRCodeTextPDFFromTemplateFile,
|
|
|
|
|
stockQRCodeTextPDFFromTemplateFile, stockQRCodeTextPDFFromTemplateFileMax
|
|
|
|
|
filterTemp, inspectionStockQRCodeTextPDFFromTemplateFile, inspectionStockQRCodeTextPDFFromTemplateStatementFile,
|
|
|
|
|
stockQRCodeTextPDFFromTemplateFile, stockQRCodeTextPDFFromTemplateFileMax, stockQRCodeTextPDFFromTemplateStatementFile
|
|
|
|
|
} from "@/api/itextpdf/itextpdf";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -273,7 +280,7 @@ export default {
|
|
|
|
|
|
|
|
|
|
getOrderQRCodeTextList() {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
filterPrint({sOrderId :this.query.sOrderId}) //查找该单号下的所有条码
|
|
|
|
|
filterPrint({sOrderId: this.query.sOrderId}) //查找该单号下的所有条码
|
|
|
|
|
.then((response) => {
|
|
|
|
|
console.log(response)
|
|
|
|
|
this.codeArray = response.data.list || [];
|
|
|
|
@ -291,7 +298,7 @@ export default {
|
|
|
|
|
queryId: null,
|
|
|
|
|
orderId: null,
|
|
|
|
|
countList: [],
|
|
|
|
|
labelId:1
|
|
|
|
|
labelId: 1
|
|
|
|
|
};
|
|
|
|
|
if (row == null) {
|
|
|
|
|
tQuery.orderId = this.query.orderIdFk;
|
|
|
|
@ -371,6 +378,70 @@ 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: "确定",
|
|
|
|
|