|
|
|
@ -233,8 +233,13 @@
|
|
|
|
|
<el-form :model="form">
|
|
|
|
|
|
|
|
|
|
<!-- 表头-工单信息 -->
|
|
|
|
|
<el-row class="my-print-head">
|
|
|
|
|
<el-col>生产订单备料单({{printData.printTitle}})</el-col>
|
|
|
|
|
<div class="my-print-barcode" :width="shengchan?'821px':'721px'">
|
|
|
|
|
<svg id="barcode"></svg>
|
|
|
|
|
</div>
|
|
|
|
|
<el-row>
|
|
|
|
|
<div class="my-print-head">
|
|
|
|
|
<el-col>生产订单备料单({{printData.printTitle}})</el-col>
|
|
|
|
|
</div>
|
|
|
|
|
</el-row>
|
|
|
|
|
<!-- 导航栏 -->
|
|
|
|
|
<el-row class="my-print-nav">
|
|
|
|
@ -297,6 +302,8 @@
|
|
|
|
|
import { listPrepare, getPrepare, delPrepare, addPrepare, updatePrepare } from "@/api/mes/prepare";
|
|
|
|
|
import {printPrepareByCode,printPrepareXByCode} from "@/api/mes/prepareDetail";
|
|
|
|
|
import moment from "moment/moment";
|
|
|
|
|
import JsBarcode from 'jsbarcode';
|
|
|
|
|
|
|
|
|
|
// import { listPrepareDetail, getPrepareDetail, delPrepareDetail, addPrepareDetail, updatePrepareDetail } from "@/api/mes/prepareDetail";
|
|
|
|
|
// import Detail from "./prepareDetail.vue";
|
|
|
|
|
export default {
|
|
|
|
@ -323,6 +330,7 @@ export default {
|
|
|
|
|
factory: null,
|
|
|
|
|
productDate: null,
|
|
|
|
|
workTable: [],
|
|
|
|
|
barcode:null,//打印生产物料和反冲物料的条码
|
|
|
|
|
},
|
|
|
|
|
printDialogVisible: false,
|
|
|
|
|
// 遮罩层
|
|
|
|
@ -400,6 +408,9 @@ export default {
|
|
|
|
|
created() {
|
|
|
|
|
this.getList();
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
this.generateBarcode();
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
//产品编码格式化
|
|
|
|
|
productCodeFormate(row, column, cellValue){
|
|
|
|
@ -463,6 +474,8 @@ export default {
|
|
|
|
|
this.printData.prodLineCode = response.data.mesPrepare.prodLineCode
|
|
|
|
|
this.refreshNewWorkerTable = true // 立即将refreshProTable设置为true,显示表格
|
|
|
|
|
this.newWorkerLoading = false // 设置加载状态为false,表示加载完成
|
|
|
|
|
|
|
|
|
|
this.generateBarcode(this.selectPrepare[0].workorderCode); //条码 根据工单号生成
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
// 打印预览(反冲物料)
|
|
|
|
@ -503,8 +516,21 @@ export default {
|
|
|
|
|
this.printData.workTable = chunkedArray;
|
|
|
|
|
this.refreshNewWorkerTable = true // 立即将refreshProTable设置为true,显示表格
|
|
|
|
|
this.newWorkerLoading = false // 设置加载状态为false,表示加载完成
|
|
|
|
|
|
|
|
|
|
this.generateBarcode(this.printData.printDate); //条码 根据打印日期生成
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//打印条码
|
|
|
|
|
generateBarcode(barcode){
|
|
|
|
|
JsBarcode("#barcode", barcode, {
|
|
|
|
|
format: "CODE128",
|
|
|
|
|
height:75,
|
|
|
|
|
width:2,
|
|
|
|
|
displayValue: true,
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 生成表头序号
|
|
|
|
|
indexMethod(index){
|
|
|
|
|
return index+1 ;
|
|
|
|
@ -629,10 +655,16 @@ export default {
|
|
|
|
|
</script>
|
|
|
|
|
<style>
|
|
|
|
|
.my-print-head {
|
|
|
|
|
margin-top: 20px;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
text-align: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.my-print-barcode {
|
|
|
|
|
margin-top: 0px;
|
|
|
|
|
margin-right: 40px;
|
|
|
|
|
text-align: right;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.my-print-nav {
|
|
|
|
|
margin-top: 15px;
|
|
|
|
|
margin-bottom: 15px;
|
|
|
|
|