|
|
|
@ -226,14 +226,24 @@
|
|
|
|
|
<el-dialog
|
|
|
|
|
title="备料信息"
|
|
|
|
|
:visible.sync="printDialogVisible"
|
|
|
|
|
:width="shengchan?'731px':'721px'"
|
|
|
|
|
:width="shengchan?'861px':'871px'"
|
|
|
|
|
>
|
|
|
|
|
<div id="printFrom" class="my-print-box">
|
|
|
|
|
|
|
|
|
|
<el-form :model="form">
|
|
|
|
|
|
|
|
|
|
<!-- 表头-工单信息 -->
|
|
|
|
|
<!-- 导航栏 -->
|
|
|
|
|
<el-row class="my-print-nav">
|
|
|
|
|
<el-col style="position: absolute;right: 0px;" :span="8">
|
|
|
|
|
<div class="my-print-barcode" :width="shengchan?'631px':'621px'">
|
|
|
|
|
<svg id="barcode"></svg>
|
|
|
|
|
</div>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<!-- 主数据 -->
|
|
|
|
|
<div v-for="(item,index) in printData.workTable" :key="index">
|
|
|
|
|
<!-- 表头-工单信息 -->
|
|
|
|
|
<el-row>
|
|
|
|
|
<div class="my-print-head">
|
|
|
|
|
<el-col>生产订单备料单({{printData.printTitle}})</el-col>
|
|
|
|
@ -244,44 +254,28 @@
|
|
|
|
|
<el-col :span="6">工厂:{{printData.factory}}</el-col>
|
|
|
|
|
<el-col :span="6">工作中心:{{printData.workCenter}}</el-col>
|
|
|
|
|
<el-col :span="4" v-if="printData.prodLineCode!=null">线体:{{printData.prodLineCode}}</el-col>
|
|
|
|
|
<el-col style="position: absolute;right: 0px;" :span="8">
|
|
|
|
|
<div class="my-print-barcode" :width="shengchan?'631px':'621px'">
|
|
|
|
|
<svg id="barcode"></svg>
|
|
|
|
|
</div>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row class="my-print-nav">
|
|
|
|
|
<el-col :span="6">生产日期:{{printData.productDate}}</el-col>
|
|
|
|
|
<el-col :span="6">打印日期:{{printData.printDate}}</el-col>
|
|
|
|
|
<el-col :span="6">页次: 1/ 1</el-col>
|
|
|
|
|
<el-col :span="6">条数: {{printData.pageNo}}</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<!-- 主数据 -->
|
|
|
|
|
<div v-for="(item,index) in printData.workTable" :key="index">
|
|
|
|
|
<el-table
|
|
|
|
|
v-if="refreshNewWorkerTable" v-loading="newWorkerLoading" class="my-print-table" :data="item"
|
|
|
|
|
border style="width: 100%;">
|
|
|
|
|
<el-table-column label="序号" width="40">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<!-- scope.$index 是当前行的索引(从 0 开始),加 1 后乘以 2 -->
|
|
|
|
|
{{ (scope.$index + 1) + (index==0?fenyeNumber* index:fenyeNumberTwo* index-2) }}
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="materialCode" label="料号" :width="shengchan?85:125" :formatter="productCodeFormate"></el-table-column>
|
|
|
|
|
<el-table-column prop="materialName" label="物料描述" :width="shengchan?200:240"></el-table-column>
|
|
|
|
|
<el-table-column prop="unit" width="60" label="单位"></el-table-column>
|
|
|
|
|
<el-table-column v-if="showWorkorderCode" prop="workorderCode" width="90" label="生产订单" :formatter="orderCodeFormate"></el-table-column>
|
|
|
|
|
<el-table-column prop="quantity" label="请领数量" width="80"></el-table-column>
|
|
|
|
|
border style="width: 100%;padding-bottom: 1px;">
|
|
|
|
|
<el-table-column label="序号" prop="xh" width="55"></el-table-column>
|
|
|
|
|
<el-table-column prop="materialCode" label="料号" :width="shengchan?90:120" :formatter="productCodeFormate"></el-table-column>
|
|
|
|
|
<el-table-column prop="materialName" label="物料描述" :width="shengchan?245:290"></el-table-column>
|
|
|
|
|
<el-table-column prop="unit" width="55" label="单位"></el-table-column>
|
|
|
|
|
<el-table-column v-if="showWorkorderCode" prop="workorderCode" :width="shengchan?105:100" label="生产订单" :formatter="orderCodeFormate"></el-table-column>
|
|
|
|
|
<el-table-column prop="quantity" label="请领数量" width="100"></el-table-column>
|
|
|
|
|
|
|
|
|
|
<el-table-column prop="routeCode" width="60" label="实发数量"></el-table-column>
|
|
|
|
|
<el-table-column prop="routeCode" width="75" label="实发数量2"></el-table-column>
|
|
|
|
|
<el-table-column prop="routeCode" width="75" label="实发"></el-table-column>
|
|
|
|
|
<el-table-column prop="routeCode" width="75" label="数量2"></el-table-column>
|
|
|
|
|
|
|
|
|
|
</el-table>
|
|
|
|
|
<div class="fy" v-if="index!=printData.workTable.length-1"></div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 底部 -->
|
|
|
|
|
<el-row class="my-print-foot">
|
|
|
|
|
<el-row class="my-print-foot0">
|
|
|
|
|
<el-col :offset="1" :span="3">发料人:</el-col>
|
|
|
|
|
<el-col :offset="2" :span="3">收料人:</el-col>
|
|
|
|
|
<el-col :offset="2" :span="3">白色:车间联</el-col>
|
|
|
|
@ -290,8 +284,10 @@
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row class="my-print-foot">
|
|
|
|
|
<el-col :offset="1" :span="3">SAP-No:{{printData.SAPNo}}</el-col>
|
|
|
|
|
<el-col :offset="1" :span="3">Z-PM-F-030-A.2</el-col>
|
|
|
|
|
<el-col :offset="1" :span="6">Z-PM-F-030-A.2</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<div class="fy" v-if="index!=printData.workTable.length-1"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</el-form>
|
|
|
|
|
</div>
|
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
|
@ -313,8 +309,8 @@ export default {
|
|
|
|
|
// components: {Detail},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
fenyeNumber:4,
|
|
|
|
|
fenyeNumberTwo:6,
|
|
|
|
|
fenyeNumber:5,
|
|
|
|
|
fenyeNumberTwo:7,
|
|
|
|
|
shengchan:true,
|
|
|
|
|
newWorkerLoading: false,
|
|
|
|
|
refreshNewWorkerTable:true,
|
|
|
|
@ -324,6 +320,7 @@ export default {
|
|
|
|
|
// 打印
|
|
|
|
|
printData: {
|
|
|
|
|
printable: 'printFrom',
|
|
|
|
|
pageNo:1,
|
|
|
|
|
ignore: ['no-print'],
|
|
|
|
|
workCenter: "暂无数据",
|
|
|
|
|
SAPNo: null,
|
|
|
|
@ -430,17 +427,11 @@ export default {
|
|
|
|
|
printJS({
|
|
|
|
|
printable: params.printable, // 'printFrom', // 标签元素id
|
|
|
|
|
type: params.type || 'html',
|
|
|
|
|
dpi: 300, // 清晰度
|
|
|
|
|
dpi: 360, // 清晰度
|
|
|
|
|
//font_size: "",// 设置字体大小
|
|
|
|
|
header: params.header, // '表单',
|
|
|
|
|
targetStyles: ['*'],
|
|
|
|
|
style: `
|
|
|
|
|
|
|
|
|
|
body {margin: 3mm;padding: 0;}
|
|
|
|
|
.fy{page-break-after: always;}
|
|
|
|
|
table { border-collapse: collapse; } table, th, td { border: 2px solid black; }
|
|
|
|
|
.el-table .cell{padding-left:5px;padding-right:5px;}
|
|
|
|
|
`,
|
|
|
|
|
//没用//style:'body {margin: 2mm;padding: 0;}.fy{page-break-after: always;} table { width:100%;height:800px;border-collapse: collapse;} table, th, td { border: 2px solid black; white-space: pre-wrap; word-break: break-all;} .el-table .cell{padding-left:1px;padding-right:1px;border: 2px solid black;}',
|
|
|
|
|
ignoreElements: params.ignore || [], // ['no-print']
|
|
|
|
|
properties: params.properties || null
|
|
|
|
|
})
|
|
|
|
@ -450,6 +441,7 @@ export default {
|
|
|
|
|
this.shengchan = true;
|
|
|
|
|
// 清楚缓存
|
|
|
|
|
this.printData.workCenter = "暂无数据";
|
|
|
|
|
this.printData.pageNo =0 ;
|
|
|
|
|
this.printData.printDate = null;
|
|
|
|
|
this.printData.workTable = [];
|
|
|
|
|
this.printData.factory = null;
|
|
|
|
@ -466,9 +458,10 @@ export default {
|
|
|
|
|
this.printData.productDate = response.data.mesPrepareDetailList[0].productDate
|
|
|
|
|
this.printData.printDate = moment(new Date()).format('YYYY-MM-DD')
|
|
|
|
|
this.printData.workTable = response.data.mesPrepareDetailList;
|
|
|
|
|
this.printData.pageNo = response.data.mesPrepareDetailList.length;
|
|
|
|
|
let chunkedArray = [];
|
|
|
|
|
|
|
|
|
|
// 遍历this.printData.workTable
|
|
|
|
|
//遍历this.printData.workTable
|
|
|
|
|
for (let i = 0; i < this.printData.workTable.length; i += (i==0?this.fenyeNumber:this.fenyeNumberTwo)) {
|
|
|
|
|
// 使用slice方法从当前索引i开始切割,切割长度为10(如果剩余元素少于10,则切割剩余所有元素)
|
|
|
|
|
let chunk = this.printData.workTable.slice(i, i + (i==0?this.fenyeNumber:this.fenyeNumberTwo));
|
|
|
|
@ -509,10 +502,13 @@ export default {
|
|
|
|
|
this.printData.productDate = moment(this.queryParams.productDate).format('YYYY-MM-DD')
|
|
|
|
|
this.printData.printDate = moment(new Date()).format('YYYY-MM-DD')
|
|
|
|
|
this.printData.workTable = response.data.mesPrepareDetailList
|
|
|
|
|
this.printData.pageNo = response.data.mesPrepareDetailList.length;
|
|
|
|
|
let chunkedArray = [];
|
|
|
|
|
|
|
|
|
|
// 遍历this.printData.workTable
|
|
|
|
|
// 遍历this.printData.workTable
|
|
|
|
|
for (let i = 0; i < this.printData.workTable.length; i += (i==0?this.fenyeNumber:this.fenyeNumberTwo)) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 使用slice方法从当前索引i开始切割,切割长度为10(如果剩余元素少于10,则切割剩余所有元素)
|
|
|
|
|
let chunk = this.printData.workTable.slice(i, i + (i==0?this.fenyeNumber:this.fenyeNumberTwo));
|
|
|
|
|
// 将切割后的数组添加到chunkedArray中
|
|
|
|
@ -672,12 +668,8 @@ export default {
|
|
|
|
|
border: 1px solid black !important;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.my-print-head {
|
|
|
|
|
margin-top: 2px;
|
|
|
|
|
margin-top: 5px;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
text-align: center;
|
|
|
|
|
}
|
|
|
|
@ -694,18 +686,17 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.my-print-foot {
|
|
|
|
|
margin-top: 20px;
|
|
|
|
|
margin-top: 10px;
|
|
|
|
|
}
|
|
|
|
|
@media print {
|
|
|
|
|
body {
|
|
|
|
|
font-family: 'Arial', sans-serif; /* 设置字体为'Arial'或其他清晰的无衬线字体 */
|
|
|
|
|
font-size: 14px; /* 设置字体大小 */
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
.my-print-table .el-table {
|
|
|
|
|
border-collapse: collapse; /* 合并表格边框 */
|
|
|
|
|
.my-print-foot0 {
|
|
|
|
|
margin-top: -1px;
|
|
|
|
|
padding-top:2px;
|
|
|
|
|
border-top: 1px solid black;
|
|
|
|
|
width: 94%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@media print {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
.fy{
|
|
|
|
|
page-break-after: always;
|
|
|
|
|