Browse Source

入库成功后打印送检单

master
han\hanst 9 months ago
parent
commit
8efb821234
  1. 2
      src/api/production/warehousing.js
  2. 83
      src/views/modules/production/warehousing.vue

2
src/api/production/warehousing.js

@ -5,3 +5,5 @@ export const searchProductionWarehousingInfo = data => createAPI(`/productionWar
// 生产入库接收
export const receiveProductionWarehousing = data => createAPI(`/productionWarehousing/receiveProductionWarehousing`,'post',data)
export const getProductionInspection = data => createAPI(`/productionWarehousing/getProductionInspection`,'post',data)

83
src/views/modules/production/warehousing.vue

@ -222,7 +222,11 @@
<script>
import {getTableDefaultListLanguage, getTableUserListLanguage} from "../../../api/table";
import {receiveProductionWarehousing, searchProductionWarehousingInfo} from "../../../api/production/warehousing";
import {receiveProductionWarehousing,
searchProductionWarehousingInfo,
getProductionInspection} from "../../../api/production/warehousing";
import {formatDate} from "element-ui/src/utils/date-util";
import getLodop from '@/utils/LodopFuncs.js'
export default {
data() {
@ -575,14 +579,14 @@ export default {
receiveProductionWarehousing(this.modalData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
this.modalFlag = false
this.$message({
message: '操作成功',
message: '入库成功,生产送检单打印中...',
type: 'success',
duration: 1500,
onClose: () => {
}
})
this.printSubmission(this.modalData)
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
@ -590,6 +594,79 @@ export default {
}
})
},
/** 保存入库后调用打印*/
printSubmission(params){
const LODOP = getLodop()
getProductionInspection(params).then(({data}) => {
if (data && data.code === 0) {
let piList = data.rows;
let piData = piList[0];
if (LODOP) {
let newDate = formatDate(new Date(), "yyyy/MM/dd");
LODOP.PRINT_INIT("");
LODOP.SET_PRINT_PAGESIZE(2,"210mm","297mm","A4");
LODOP.ADD_PRINT_TEXT(50, 400, 380, 20, piData.company);
LODOP.SET_PRINT_STYLEA(0, "Bold", 1);//
LODOP.SET_PRINT_STYLEA(0, "FontSize", 20);
LODOP.ADD_PRINT_TEXT(95, 485, 350, 20, "生产送检单");
LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
LODOP.SET_PRINT_STYLEA(0, "FontSize", 18);
LODOP.ADD_PRINT_TEXT(150, 80, 350, 20, "送检部门: "+piData.locationName);
LODOP.SET_PRINT_STYLEA(0, "FontSize", 14);
LODOP.ADD_PRINT_TEXT(150, 390, 350, 20, "打印时间:"+newDate);
LODOP.SET_PRINT_STYLEA(0, "FontSize", 14);
LODOP.ADD_PRINT_TEXT(150, 620, 350, 20, "批号: "+piData.lotNo);
LODOP.SET_PRINT_STYLEA(0, "FontSize", 14);
LODOP.ADD_PRINT_TEXT(150, 830, 350, 20, "WDR: "+piData.wdr);
LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
LODOP.SET_PRINT_STYLEA(0, "FontSize", 14);
let html = "";
html +="<table border=1 cellSpacing=1 cellPadding=1 width='100%' " +
"style='border-collapse:collapse;border-right:1px;border-top:1px;border-left:1px;font-size:16px'>";
html += "<thead>";
html += "<tr>";
html += "<th width='10%'><div align=center><b>送检日期</b></div></th>";
html += "<th width='15%'><div align=center><b>来源单号</b></div></th>";
html += "<th width='16%'><div align=center><b>品号</b></div></th>";
html += "<th width='30%'><div align=center><b>品名</b></div></th>";
html += "<th width='10%'><div align=center><b>单位</b></div></th>";
html += "<th width='15%'><div align=center><b>数量</b></div></th>";
html += "</tr>";
html += "</thead>";
html += "<tbody>";
for (let i = 0; i < piList.length; i++) {
html += "<tr style='height: 50px'>";
html += "<td align=center>" + formatDate(piList[i].transactionDate, "yyyy/MM/dd") + "</td>";
html += "<td align=center>" + piList[i].orderNo + "</td>";
html += "<td align=center>" + piList[i].partNo + "</td>";
html += "<td align=left>" + piList[i].partDesc + "</td>";
html += "<td align=center>" + piList[i].unitMeas + "</td>";
html += "<td align=center>" + piList[i].quantity + "</td>";
html += "</tr>";
}
html += "</tbody>";
html += "</table>";
LODOP.ADD_PRINT_TABLE(190,70,"88%",500,html);
LODOP.SET_PRINT_STYLEA(0, "Offset2Top", -130);//130
//
LODOP.ADD_PRINT_HTM(740,500,350,20,"<span style='font-size:16px' tdata='pageNO'>第##页 </span>,<span style='font-size:16px' tdata='pageCount'> 共##页 </span>");
LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
LODOP.PREVIEW()
}
this.modalFlag = false
} else {
this.$alert('打印数据获取失败!', '错误', {
confirmButtonText: '确定'
})
}
})
},
//
closeSaveDataDialog() {
this.modalData = {

Loading…
Cancel
Save