打印调整

yangwl
zhaoxiaolin 2 months ago
parent 67d69833ba
commit e1b1e1d5c3

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

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

@ -226,62 +226,56 @@
<el-dialog <el-dialog
title="备料信息" title="备料信息"
:visible.sync="printDialogVisible" :visible.sync="printDialogVisible"
:width="shengchan?'731px':'721px'" :width="shengchan?'861px':'871px'"
> >
<div id="printFrom" class="my-print-box"> <div id="printFrom" class="my-print-box">
<el-form :model="form"> <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"> <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 <el-table
v-if="refreshNewWorkerTable" v-loading="newWorkerLoading" class="my-print-table" :data="item" v-if="refreshNewWorkerTable" v-loading="newWorkerLoading" class="my-print-table" :data="item"
border style="width: 100%;"> border style="width: 100%;padding-bottom: 1px;">
<el-table-column label="序号" width="40"> <el-table-column label="序号" prop="xh" width="55"></el-table-column>
<template slot-scope="scope"> <el-table-column prop="materialCode" label="料号" :width="shengchan?90:120" :formatter="productCodeFormate"></el-table-column>
<!-- scope.$index 是当前行的索引 0 开始 1 后乘以 2 --> <el-table-column prop="materialName" label="物料描述" :width="shengchan?245:290"></el-table-column>
{{ (scope.$index + 1) + (index==0?fenyeNumber* index:fenyeNumberTwo* index-2) }} <el-table-column prop="unit" width="55" label="单位"></el-table-column>
</template> <el-table-column v-if="showWorkorderCode" prop="workorderCode" :width="shengchan?105:100" label="生产订单" :formatter="orderCodeFormate"></el-table-column>
</el-table-column> <el-table-column prop="quantity" label="请领数量" width="100"></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>
<el-table-column prop="routeCode" width="60" label="实发数量"></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-column prop="routeCode" width="75" label="数量2"></el-table-column>
</el-table> </el-table>
<div class="fy" v-if="index!=printData.workTable.length-1"></div> <!-- 底部 -->
</div> <el-row class="my-print-foot0">
<!-- 底部 -->
<el-row class="my-print-foot">
<el-col :offset="1" :span="3">发料人:</el-col> <el-col :offset="1" :span="3">发料人:</el-col>
<el-col :offset="2" :span="3">收料人:</el-col> <el-col :offset="2" :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>
<el-row class="my-print-foot"> <el-row class="my-print-foot">
<el-col :offset="1" :span="3">SAP-No:{{printData.SAPNo}}</el-col> <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> </el-row>
<div class="fy" v-if="index!=printData.workTable.length-1"></div>
</div>
</el-form> </el-form>
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
@ -313,8 +309,8 @@ export default {
// components: {Detail}, // components: {Detail},
data() { data() {
return { return {
fenyeNumber:4, fenyeNumber:5,
fenyeNumberTwo:6, fenyeNumberTwo:7,
shengchan:true, shengchan:true,
newWorkerLoading: false, newWorkerLoading: false,
refreshNewWorkerTable:true, refreshNewWorkerTable:true,
@ -324,6 +320,7 @@ export default {
// //
printData: { printData: {
printable: 'printFrom', printable: 'printFrom',
pageNo:1,
ignore: ['no-print'], ignore: ['no-print'],
workCenter: "暂无数据", workCenter: "暂无数据",
SAPNo: null, SAPNo: null,
@ -430,17 +427,11 @@ export default {
printJS({ printJS({
printable: params.printable, // 'printFrom', // id printable: params.printable, // 'printFrom', // id
type: params.type || 'html', type: params.type || 'html',
dpi: 300, // dpi: 360, //
//font_size: "",// //font_size: "",//
header: params.header, // '', header: params.header, // '',
targetStyles: ['*'], targetStyles: ['*'],
style: ` ////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;}',
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;}
`,
ignoreElements: params.ignore || [], // ['no-print'] ignoreElements: params.ignore || [], // ['no-print']
properties: params.properties || null properties: params.properties || null
}) })
@ -450,6 +441,7 @@ export default {
this.shengchan = true; this.shengchan = true;
// //
this.printData.workCenter = "暂无数据"; this.printData.workCenter = "暂无数据";
this.printData.pageNo =0 ;
this.printData.printDate = null; this.printData.printDate = null;
this.printData.workTable = []; this.printData.workTable = [];
this.printData.factory = null; this.printData.factory = null;
@ -466,16 +458,17 @@ export default {
this.printData.productDate = response.data.mesPrepareDetailList[0].productDate this.printData.productDate = response.data.mesPrepareDetailList[0].productDate
this.printData.printDate = moment(new Date()).format('YYYY-MM-DD') this.printData.printDate = moment(new Date()).format('YYYY-MM-DD')
this.printData.workTable = response.data.mesPrepareDetailList; this.printData.workTable = response.data.mesPrepareDetailList;
this.printData.pageNo = response.data.mesPrepareDetailList.length;
let chunkedArray = []; let chunkedArray = [];
// this.printData.workTable //this.printData.workTable
for (let i = 0; i < this.printData.workTable.length; i += (i==0?this.fenyeNumber:this.fenyeNumberTwo)) { for (let i = 0; i < this.printData.workTable.length; i += (i==0?this.fenyeNumber:this.fenyeNumberTwo)) {
// 使slicei1010 // 使slicei1010
let chunk = this.printData.workTable.slice(i, i + (i==0?this.fenyeNumber:this.fenyeNumberTwo)); let chunk = this.printData.workTable.slice(i, i + (i==0?this.fenyeNumber:this.fenyeNumberTwo));
// chunkedArray // chunkedArray
chunkedArray.push(chunk); chunkedArray.push(chunk);
} }
this.printData.workTable = chunkedArray; this.printData.workTable = chunkedArray;
this.printData.prodLineCode = response.data.mesPrepare.prodLineCode this.printData.prodLineCode = response.data.mesPrepare.prodLineCode
this.refreshNewWorkerTable = true // refreshProTabletrue this.refreshNewWorkerTable = true // refreshProTabletrue
this.newWorkerLoading = false // false this.newWorkerLoading = false // false
@ -509,14 +502,17 @@ export default {
this.printData.productDate = moment(this.queryParams.productDate).format('YYYY-MM-DD') this.printData.productDate = moment(this.queryParams.productDate).format('YYYY-MM-DD')
this.printData.printDate = moment(new Date()).format('YYYY-MM-DD') this.printData.printDate = moment(new Date()).format('YYYY-MM-DD')
this.printData.workTable = response.data.mesPrepareDetailList this.printData.workTable = response.data.mesPrepareDetailList
this.printData.pageNo = response.data.mesPrepareDetailList.length;
let chunkedArray = []; let chunkedArray = [];
// this.printData.workTable // this.printData.workTable
for (let i = 0; i < this.printData.workTable.length; i += (i==0?this.fenyeNumber:this.fenyeNumberTwo)) { 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 // 使slicei1010
chunkedArray.push(chunk); 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 = chunkedArray;
this.refreshNewWorkerTable = true // refreshProTabletrue this.refreshNewWorkerTable = true // refreshProTabletrue
@ -672,12 +668,8 @@ export default {
border: 1px solid black !important; border: 1px solid black !important;
} }
.my-print-head { .my-print-head {
margin-top: 2px; margin-top: 5px;
font-weight: bold; font-weight: bold;
text-align: center; text-align: center;
} }
@ -694,18 +686,17 @@ export default {
} }
.my-print-foot { .my-print-foot {
margin-top: 20px; margin-top: 10px;
} }
@media print { .my-print-foot0 {
body { margin-top: -1px;
font-family: 'Arial', sans-serif; /* 设置字体为'Arial'或其他清晰的无衬线字体 */ padding-top:2px;
font-size: 14px; /* 设置字体大小 */ border-top: 1px solid black;
width: 94%;
}
.my-print-table .el-table {
border-collapse: collapse; /* 合并表格边框 */
} }
@media print {
} }
.fy{ .fy{
page-break-after: always; page-break-after: always;

@ -3,6 +3,7 @@
<el-dialog title="" :visible.sync="printDialogVisible" width="1000px"> <el-dialog title="" :visible.sync="printDialogVisible" width="1000px">
<div> <div>
<el-form inline label-width="80px"> <el-form inline label-width="80px">
<el-form-item label="补打板次" prop="factory"> <el-form-item label="补打板次" prop="factory">
<el-input v-model="idCardsNum" placeholder="请输入" style="width:100px"/> <el-input v-model="idCardsNum" placeholder="请输入" style="width:100px"/>
</el-form-item> </el-form-item>
@ -31,6 +32,7 @@
<el-input v-model="batchQuantity" placeholder="请输入" style="width:100px"/> <el-input v-model="batchQuantity" placeholder="请输入" style="width:100px"/>
</el-form-item> </el-form-item>
<el-button type="primary" icon="el-icon-check" circle @click="showAddPrint()"/> <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> </el-form>
</div> </div>
@ -85,6 +87,7 @@
import { import {
getIdCardList, getIdCardList,
getBatchCode, getBatchCode,
getIdCardListRefresh
} from '@/api/plan/workorder'; } from '@/api/plan/workorder';
import QRCode from 'qrcode'; 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() { async showAddPrint() {
console.log('执行了新增打印预览'); console.log('执行了新增打印预览');

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

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

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

Loading…
Cancel
Save