内部码,库存明细 按报表方式导出

ywj_dev
郑明梁 2 years ago
parent 0f7354e415
commit 507394e825

@ -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
});
}

@ -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",

@ -5,7 +5,8 @@
<el-row type="flex" justify="end">
<el-button-group style="display: flex;margin-bottom: 15px; margin-right: 50px;">
<el-button type="primary" @click.native="generateQRCodeText()" :loading="loading">生成内部码</el-button>
<el-button type="primary" @click.native="printStockOrderDetailPDF()" :loading="loading">打印全部</el-button>
<el-button type="primary" @click.native="printStockOrderDetailPDF()" :loading="loading">标签打印全部</el-button>
<el-button type="primary" @click.native="printStockOrderDetailStatementPDF()" :loading="loading">报表打印全部</el-button>
<el-switch style="margin-left: 50px;" v-model="filterUDIType" active-text="过滤已有UDI码的产品"></el-switch>
</el-button-group>
</el-row>
@ -76,6 +77,13 @@
>标签打印
</el-button
>
<el-button
type="text"
size="small"
@click.native="printStockOrderDetailStatementPDF(scope.row)"
>报表打印
</el-button
>
</template>
</el-table-column>
</el-table>
@ -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) => {
//pdfurl
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();

@ -4,22 +4,9 @@
<el-form :model="formData" :rules="formRules" ref="dataForm">
<el-row type="flex" justify="end">
<el-button-group style="display: flex;margin-bottom: 15px; margin-right: 50px;margin-top: -10px">
<el-button
type="primary"
@click.native="generateQRCodeText()"
:loading="loading"
>生成内部码
</el-button
>
<el-button
type="primary"
@click.native="printStockOrderDetailPDF()"
:loading="loading"
>打印全部
</el-button
>
<el-button type="primary" @click.native="generateQRCodeText()" :loading="loading">生成内部码</el-button>
<el-button type="primary" @click.native="printStockOrderDetailPDF()" :loading="loading">标签打印全部</el-button>
<el-button type="primary" @click.native="printStockOrderDetailStatementPDF()" :loading="loading">报表打印全部</el-button>
</el-button-group>
</el-row>
@ -87,6 +74,13 @@
>标签打印
</el-button
>
<el-button
type="text"
size="small"
@click.native="printStockOrderDetailStatementPDF(scope.row)"
>报表打印
</el-button
>
</template>
</el-table-column>
</el-table>
@ -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) => {
//pdfurl
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: "确定",

@ -69,20 +69,15 @@
<div class="top-right-btn">
<el-button-group>
<el-button icon="el-icon-view" type="primary" @click="hideSearch">/</el-button>
<el-button
type="primary"
icon="el-icon-refresh"
@click="onReset"
>重置
</el-button>
<el-button type="primary" icon="el-icon-search" @click="onSubmit"
>查询
</el-button
>
<el-button type="primary" icon="el-icon-refresh" @click="optinPrint"></el-button>
<el-button type="primary" icon="el-icon-refresh" @click="selectPrint"></el-button>
<el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button>
<el-button type="primary" icon="el-icon-search" @click="onSubmit"></el-button>
</el-button-group>
</div>
<el-divider style="margin: 15px"></el-divider>
<el-table v-loading="loading" :data="list" style="width: 100%" highlight-current-row border>
<el-table v-loading="loading" :data="list" style="width: 100%" highlight-current-row borderv @selection-change="handleCheckedChange">
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="供应商" prop="fromCorpName" width="160" v-if="showSup"></el-table-column>
<el-table-column label="出入库单号" prop="orderIdFk" width="160"></el-table-column>
@ -112,7 +107,8 @@
</template>
<script>
import {getResultDetailList, getResultOrderList} from '@/api/inout/orderDetailResult'
import {getResultDetailList, getResultOrderList, verifyTemplateFile, printOrder} from '@/api/inout/orderDetailResult'
import {isBlank} from "@/utils/strUtil";
export default {
@ -135,6 +131,7 @@ export default {
actionType: "norDetail",
},
loading: false,
orderSelection: [],
total: 0,
showSup: false,
customerId: this.$store.getters.customerId,
@ -236,6 +233,77 @@ export default {
this.total = 0;
});
},
handleCheckedChange(val) {
this.orderSelection = val;
},
optinPrint() {
if (this.orderSelection == null || this.orderSelection.length <= 0) {
return this.$message.error("请选择打印的明细!");
}
let query = {id: 4};
verifyTemplateFile(query).then((res) => {
if (res.code === 20000) {
let printParams = {
templateId: res.data,
list: this.orderSelection
};
printOrder(printParams).then((response) => {
//pdfurl
const binaryData = [];
binaryData.push(response);
//blob
let url = window.URL.createObjectURL(
new Blob(binaryData, {type: "application/pdf"})
);
this.loading = false;
window.open(url);//pdf
})
}
}).catch((error) => {
this.loading = false;
this.$message.error(error.message);
})
},
selectPrint(){
let query = {id: 4};
verifyTemplateFile(query).then((res) => {
if (res.code === 20000) {
let printParams = {
templateId: res.data,
orderIdFk: this.filterQuery.orderIdFk,
nameCode: this.filterQuery.nameCode,
coName: this.filterQuery.coName,
spec: this.filterQuery.spec,
batchNo: this.filterQuery.batchNo,
zczbhhzbapzbh: this.filterQuery.zczbhhzbapzbh,
manufacturer: this.filterQuery.manufacturer,
actionType: this.filterQuery.actionType
};
if (this.actDateRange !== null) {
printParams.startAduditTime = this.actDateRange[0];
printParams.endAduditTime = this.actDateRange[1];
} else {
printParams.startAduditTime = null;
printParams.endAduditTime = null;
}
printOrder(printParams).then((response) => {
//pdfurl
const binaryData = [];
binaryData.push(response);
//blob
let url = window.URL.createObjectURL(
new Blob(binaryData, {type: "application/pdf"})
);
this.loading = false;
window.open(url);//pdf
})
}
}).catch((error) => {
this.loading = false;
this.$message.error(error.message);
})
}
}
,
mounted() {

Loading…
Cancel
Save