打印调整

yangwl
zhaoxiaolin 2 months ago
parent 67d69833ba
commit e1b1e1d5c3

@ -188,6 +188,13 @@ export function getIdCardList(data){
data:data
})
}
export function getIdCardListRefresh(data){
return request({
url:'/plan/pro/workorder/getIdCardListRefresh',
method:'post',
data:data
})
}
export function getBatchCode(workorderId){
return request({

@ -313,14 +313,14 @@ export default {
setInterval(() => this.getAlarmData(), 1000 * 60);
this.poolNameList = JSON.parse(localStorage.getItem("POOL_NAME_LIST"));
this.poolName = localStorage.getItem("USER_POOL_NAME_CURRENT");
/**
//
this.getUnReadList();
//
this.timer = setInterval(() => {
setTimeout(this.getUnReadList(), 30000);
}, 30000);
**/
},
components: {
Breadcrumb,

@ -226,62 +226,56 @@
<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>
<!-- 表头-工单信息 -->
<el-row>
<div class="my-print-head">
<el-col>生产订单备料单({{printData.printTitle}})</el-col>
</div>
</el-row>
<!-- 导航栏 -->
<el-row class="my-print-nav">
<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-row>
<!-- 主数据 -->
<div v-for="(item,index) in printData.workTable" :key="index">
<!-- 表头-工单信息 -->
<el-row>
<div class="my-print-head">
<el-col>生产订单备料单({{printData.printTitle}})</el-col>
</div>
</el-row>
<!-- 导航栏 -->
<el-row class="my-print-nav">
<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-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">条数: {{printData.pageNo}}</el-col>
</el-row>
<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,16 +458,17 @@ 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
for (let i = 0; i < this.printData.workTable.length; i += (i==0?this.fenyeNumber:this.fenyeNumberTwo)) {
// 使slicei1010
let chunk = this.printData.workTable.slice(i, i + (i==0?this.fenyeNumber:this.fenyeNumberTwo));
// chunkedArray
chunkedArray.push(chunk);
}
this.printData.workTable = chunkedArray;
//this.printData.workTable
for (let i = 0; i < this.printData.workTable.length; i += (i==0?this.fenyeNumber:this.fenyeNumberTwo)) {
// 使slicei1010
let chunk = this.printData.workTable.slice(i, i + (i==0?this.fenyeNumber:this.fenyeNumberTwo));
// chunkedArray
chunkedArray.push(chunk);
}
this.printData.workTable = chunkedArray;
this.printData.prodLineCode = response.data.mesPrepare.prodLineCode
this.refreshNewWorkerTable = true // refreshProTabletrue
this.newWorkerLoading = false // false
@ -509,14 +502,17 @@ 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)) {
// 使slicei1010
let chunk = this.printData.workTable.slice(i, i + (i==0?this.fenyeNumber:this.fenyeNumberTwo));
// chunkedArray
chunkedArray.push(chunk);
// 使slicei1010
let chunk = this.printData.workTable.slice(i, i + (i==0?this.fenyeNumber:this.fenyeNumberTwo));
// chunkedArray
chunkedArray.push(chunk);
}
this.printData.workTable = chunkedArray;
this.refreshNewWorkerTable = true // refreshProTabletrue
@ -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;

@ -3,6 +3,7 @@
<el-dialog title="" :visible.sync="printDialogVisible" width="1000px">
<div>
<el-form inline label-width="80px">
<el-form-item label="补打板次" prop="factory">
<el-input v-model="idCardsNum" placeholder="请输入" style="width:100px"/>
</el-form-item>
@ -31,6 +32,7 @@
<el-input v-model="batchQuantity" placeholder="请输入" style="width:100px"/>
</el-form-item>
<el-button type="primary" icon="el-icon-check" circle @click="showAddPrint()"/>
<el-button type="danger" icon="el-icon-refresh" round @click="refreshCards()"></el-button>
</el-form>
</div>
@ -85,6 +87,7 @@
import {
getIdCardList,
getBatchCode,
getIdCardListRefresh
} from '@/api/plan/workorder';
import QRCode from 'qrcode';
@ -198,6 +201,20 @@ export default {
})
},
async refreshCards(){
let response = await getIdCardListRefresh({workorderCode:this.workorderCode});
this.printData.idCardList = response;
this.$nextTick(() => {
this.printData.idCardList.forEach((item, index) => {
const canvas = document.getElementById('qrcode-' + index);
QRCode.toCanvas(canvas, item.palletCode, { width: 300 , margin:1 }, function (error) {
if (error) console.error(error);
console.log('success!');
});
});
})
},
// -
async showAddPrint() {
console.log('执行了新增打印预览');

@ -664,12 +664,17 @@
<el-col :span="20">
<el-form-item label="车间组长/机管员签名" label-width="160px">
<template >
<el-image
:src="form.jgy"
style="width: 260px; height: 100px"
:preview-src-list="form.jgy"
fit="fill" />
</template>
<el-image
:src="form.cxzz"
style="width: 260px; height: 100px"
:preview-src-list="form.cxzz"
fit="fill" />
<el-image
:src="form.jgy"
style="width: 260px; height: 100px"
:preview-src-list="form.jgy"
fit="fill" />
</template>
</el-form-item>
</el-col>
</el-row>
@ -680,7 +685,7 @@
<el-image
:src="form.pgy"
style="width: 260px; height: 100px"
:preview-src-list="form.jgy"
:preview-src-list="form.pgy"
fit="fill" />
</template>
</el-form-item>
@ -912,7 +917,7 @@ export default {
delFlag: null,
jgy: null,
pgy: null,
cxzz: null
};
this.spanArr = [];
this.position = 0;

@ -224,6 +224,8 @@
width="1300px"
append-to-body
>
<el-button type="primary" round v-if="title == 'CPK分析'" @click="handleExportCPK">CPK</el-button>
<div
class="echartbox"
id="echart1"
@ -617,6 +619,16 @@ export default {
`DLTable_${new Date().getTime()}.xlsx`
);
},
/**导出CPK**/
handleExportCPK() {
this.download(
"quality/staticTable/exportCPK",
{
...this.queryParams,
},
`CPK_${new Date().getTime()}.xlsx`
);
},
//
handleAnalysis1() {
this.title = "柱状图表分析";

@ -596,7 +596,7 @@ export default {
/** SAP同步按钮操作 */
handleSyncSAP() {
this.$modal.confirm('是否确认SAP同步操作步骤').then(function() {
return syncSAP()
syncSAP();
}).then(() => {
this.getList()
this.$modal.msgSuccess('同步成功')

Loading…
Cancel
Save