|
|
|
@ -76,6 +76,13 @@
|
|
|
|
|
>标签打印
|
|
|
|
|
</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
type="text"
|
|
|
|
|
size="small"
|
|
|
|
|
@click.native="printStockOrderDetailStatementPDF(scope.row)"
|
|
|
|
|
>报表打印
|
|
|
|
|
</el-button
|
|
|
|
|
>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
@ -158,7 +165,11 @@ import {
|
|
|
|
|
filterTemp,
|
|
|
|
|
inspectionOrderDetailPDFFromTemplateFile,
|
|
|
|
|
inspectionStockQRCodeTextPDFFromTemplateFile,
|
|
|
|
|
orderDetailPDFFromTemplateFile, stockQRCodeTextPDFFromTemplateFile, stockQRCodeTextPDFFromTemplateFileMax
|
|
|
|
|
inspectionStockQRCodeTextPDFFromTemplateStatementFile,
|
|
|
|
|
orderDetailPDFFromTemplateFile,
|
|
|
|
|
stockQRCodeTextPDFFromTemplateFile,
|
|
|
|
|
stockQRCodeTextPDFFromTemplateFileMax,
|
|
|
|
|
stockQRCodeTextPDFFromTemplateStatementFile
|
|
|
|
|
} from "@/api/itextpdf/itextpdf";
|
|
|
|
|
import {generateInCodeQRCodeText, generateInnerQRCodeText} from "@/api/inout/innerOrderQRCode";
|
|
|
|
|
|
|
|
|
@ -392,6 +403,69 @@ export default {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
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;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
getBusType() {
|
|
|
|
|
let query = {
|
|
|
|
|
enabled: true,
|
|
|
|
|