|
|
|
@ -0,0 +1,368 @@
|
|
|
|
|
<template>
|
|
|
|
|
<Dialog title="打印预览" v-model="dialogVisible" width="1000">
|
|
|
|
|
<!-- 打印预览 -->
|
|
|
|
|
<div class="print-wrap page" ref="print">
|
|
|
|
|
<table border="2" cellspacing="0" id="table">
|
|
|
|
|
<tbody>
|
|
|
|
|
<tr>
|
|
|
|
|
<td colspan="2">
|
|
|
|
|
<div style="width: 100px; text-align: center">
|
|
|
|
|
<img src="/src/assets/imgs/exlogo.png" style="width: 100%" alt="" />
|
|
|
|
|
</div>
|
|
|
|
|
</td>
|
|
|
|
|
<td colspan="6">
|
|
|
|
|
<span style="font-size: 20px; font-weight: 700">摸具生产计划单</span>
|
|
|
|
|
</td>
|
|
|
|
|
<td colspan="2" style="padding: 5px 0">
|
|
|
|
|
<div style="border-bottom: 1px solid #666; padding-bottom: 5px">项目编号</div>
|
|
|
|
|
<div style="padding-top: 5px">{{ `formData.code` }}</div>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
|
<tbody>
|
|
|
|
|
<tr>
|
|
|
|
|
<td colspan="2"> 客户名称 </td>
|
|
|
|
|
<td colspan="5">
|
|
|
|
|
<span>{{ '公司名字' }}</span>
|
|
|
|
|
</td>
|
|
|
|
|
<td colspan="1">{{ `密称` }}</td>
|
|
|
|
|
<td> 编码: </td>
|
|
|
|
|
<td>{{ `1091` }} </td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
|
<tr>
|
|
|
|
|
<td colspan="2"> 项目名称 </td>
|
|
|
|
|
<td colspan="6">
|
|
|
|
|
{{ `系列摸具` }}
|
|
|
|
|
</td>
|
|
|
|
|
<td> 业务员: </td>
|
|
|
|
|
<td>{{ `xxx` }} </td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td colspan="2"> 项目工期 </td>
|
|
|
|
|
<td style="padding: 0 5px"> 起 </td>
|
|
|
|
|
<td colspan="1">
|
|
|
|
|
<span>{{ '2024/1/11' }}</span>
|
|
|
|
|
</td>
|
|
|
|
|
<td colspan="1">至</td>
|
|
|
|
|
<td colspan="1">{{ `2024/4/11` }}</td>
|
|
|
|
|
<td>天数</td>
|
|
|
|
|
<td colspan="1">{{ `92` }}</td>
|
|
|
|
|
<td colspan="1"> 是否紧急: </td>
|
|
|
|
|
<td colspan="1">{{ `否` }} </td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td colspan="2"> 项目负责: </td>
|
|
|
|
|
<td colspan="2">{{ `111` }} </td>
|
|
|
|
|
<td colspan="2">
|
|
|
|
|
<div style="width: 100%; display: flex; justify-content: center; font-size: 12px">
|
|
|
|
|
<div>
|
|
|
|
|
<div>类别:</div>
|
|
|
|
|
<div>性质:</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="border: 1px solid #333">
|
|
|
|
|
<div style="border-bottom: 1px solid #333; padding: 0 5px; height: 50%">{{
|
|
|
|
|
``
|
|
|
|
|
}}</div>
|
|
|
|
|
<div style="padding: 0 5px; height: 50%">{{ `维修` }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</td>
|
|
|
|
|
<td colspan="4">
|
|
|
|
|
<div style="display: flex; justify-content: space-between">
|
|
|
|
|
<div style="width: 100%; font-size: 12px; display: flex; flex-direction: column">
|
|
|
|
|
<div style="text-align: left; width: 100; margin-left: 10px">自客户提供资料:</div>
|
|
|
|
|
<div
|
|
|
|
|
id="fruitForm"
|
|
|
|
|
style="display: flex; justify-content: flex-start; align-items: center"
|
|
|
|
|
>
|
|
|
|
|
<span class="checkbox" v-if="isSelected.includes(1) == false"></span>
|
|
|
|
|
<span class="checkbox" v-else-if="isSelected.includes(1) == true">√</span>
|
|
|
|
|
<label for="checkbox1">修理内容</label>
|
|
|
|
|
|
|
|
|
|
<span class="checkbox" v-if="isSelected.includes(2) == false"></span>
|
|
|
|
|
<span class="checkbox" v-else-if="isSelected.includes(2) == true">√</span>
|
|
|
|
|
<label for="checkbox2">技术协议</label>
|
|
|
|
|
|
|
|
|
|
<span class="checkbox" v-if="isSelected.includes(3) == false"></span>
|
|
|
|
|
<span class="checkbox" v-else-if="isSelected.includes(3) == true">√</span>
|
|
|
|
|
<label for="checkbox3">图纸/数模</label>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td colspan="2">是否要工:</td>
|
|
|
|
|
<td>{{ `是` }}</td>
|
|
|
|
|
<td>开始日期</td>
|
|
|
|
|
<td>{{ `2024/1/15` }}</td>
|
|
|
|
|
<td>结束日期</td>
|
|
|
|
|
<td>{{ `2024/1/15` }}</td>
|
|
|
|
|
<td>负责人</td>
|
|
|
|
|
<td colspan="2">{{ `2024/1/15` }}</td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
|
<tr
|
|
|
|
|
><td colspan="10"> <div style="text-align: left; width: 100%">子项目信息:</div></td></tr
|
|
|
|
|
>
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="xh"> 序号 </td>
|
|
|
|
|
<td colspan="3"> 名称/编号 </td>
|
|
|
|
|
<td> 设备型号 </td>
|
|
|
|
|
<td> 数量 </td>
|
|
|
|
|
<td> 主要材料 </td>
|
|
|
|
|
<td> 毛坯日期 </td>
|
|
|
|
|
<td> 2D/日期 </td>
|
|
|
|
|
<td> 3D/日期 </td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr v-for="item in 8" :key="item.index">
|
|
|
|
|
<td class="xh"> {{ item }} </td>
|
|
|
|
|
<td colspan="3" style="padding: 0 0">
|
|
|
|
|
<div style="display: flex; flex-direction: column; justify-content: space-between">
|
|
|
|
|
<span style="border-bottom: 1px solid #666"> {{ `名称` }} </span>
|
|
|
|
|
<span>{{ `编号` }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
</td>
|
|
|
|
|
<td>{{ `LP 100L` }} </td>
|
|
|
|
|
<td>{{ `1` }} </td>
|
|
|
|
|
<td>{{ `H13` }} </td>
|
|
|
|
|
<td> {{ `2024/1/15` }} </td>
|
|
|
|
|
<td style="padding: 0 0">
|
|
|
|
|
<div style="display: flex; flex-direction: column; justify-content: space-between">
|
|
|
|
|
<span style="border-bottom: 1px solid #666"> {{ `2024/1/15` }} </span>
|
|
|
|
|
<span>{{ `name` }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
</td>
|
|
|
|
|
<td style="padding: 0 0">
|
|
|
|
|
<div style="display: flex; flex-direction: column; justify-content: space-between">
|
|
|
|
|
<span style="border-bottom: 1px solid #666"> {{ `2024/1/15` }} </span>
|
|
|
|
|
<span>{{ `name` }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="xh"> 序号 </td>
|
|
|
|
|
<td colspan="3"> 工艺流程 </td>
|
|
|
|
|
<td> 开始日期 </td>
|
|
|
|
|
<td> 结束日期 </td>
|
|
|
|
|
<td colspan="2"> 责任人 </td>
|
|
|
|
|
<td colspan="2"> 备注 </td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr v-for="item in 8" :key="item.index">
|
|
|
|
|
<td class="xh"> {{ item }} </td>
|
|
|
|
|
<td colspan="3"> </td>
|
|
|
|
|
<td> </td>
|
|
|
|
|
<td> </td>
|
|
|
|
|
<td colspan="2"> </td>
|
|
|
|
|
<td colspan="2"> </td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
|
<tbody>
|
|
|
|
|
<tr>
|
|
|
|
|
<td colspan="10">
|
|
|
|
|
<div style="text-align: left; width: 100%;display: flex; flex-direction: column;padding-left:15px;">
|
|
|
|
|
<span>说明:</span>
|
|
|
|
|
<span>1.每个项目的零部件制作工艺,材料材质,硬度要求必须统一,出现任何问题,各工程师负责!</span>
|
|
|
|
|
<span>2.模具调试,试模需要根据客户要求,自己安排调试,我司根据需要安排人员参与配合。</span>
|
|
|
|
|
</div>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
|
<tbody>
|
|
|
|
|
<tr>
|
|
|
|
|
<td colspan="4" style="width: 33%"> 编制/日期 </td>
|
|
|
|
|
<td colspan="3" style="width: 33%"> 审核/日期 </td>
|
|
|
|
|
<td colspan="3" style="width: 33%"> 批准/日期 </td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td colspan="4">{{ `formData.creatorName` }}</td>
|
|
|
|
|
<td colspan="3">{{ `formData.auditUserName` }}</td>
|
|
|
|
|
<td colspan="3">{{ `formData.approveUserName` }}</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td colspan="4">{{ `formData.creatorName` }}</td>
|
|
|
|
|
<td colspan="3">{{ `formData.auditUserName` }}</td>
|
|
|
|
|
<td colspan="3">{{ `formData.approveUserName` }}</td>
|
|
|
|
|
<!-- <td colspan="4">{{formatDate(new Date(formData.createTime), 'YYYY-MM-DD')}}</td>
|
|
|
|
|
<td colspan="3">{{formatDate(new Date(formData.auditTime), 'YYYY-MM-DD')}}</td>
|
|
|
|
|
<td colspan="3">{{formatDate(new Date(formData.approveTime), 'YYYY-MM-DD')}}</td> -->
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
<template #footer>
|
|
|
|
|
<!-- 【打印】 -->
|
|
|
|
|
<el-button @click="onPrint" type="primary">打印</el-button>
|
|
|
|
|
<el-button @click="outopen">取消</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</Dialog>
|
|
|
|
|
</template>
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
// import { ref, reactive } from 'vue'
|
|
|
|
|
import { Check } from '@element-plus/icons-vue'
|
|
|
|
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
|
|
|
|
|
|
|
|
|
const onPrint = () => {
|
|
|
|
|
// 拿到打印页面dom节点
|
|
|
|
|
const printNode = document.querySelector('.print-wrap')
|
|
|
|
|
if (!printNode) return
|
|
|
|
|
// 页面文档创建一个空的内框架,用于挂载打印节点,并设置一定的样式
|
|
|
|
|
const newIframe: any = document.createElement('iframe')
|
|
|
|
|
newIframe.setAttribute(
|
|
|
|
|
'style',
|
|
|
|
|
'width:0px;height:0px;position:absolute;left:-9999px;top:-9999px;'
|
|
|
|
|
)
|
|
|
|
|
newIframe.setAttribute('align', 'center')
|
|
|
|
|
document.body.appendChild(newIframe)
|
|
|
|
|
// 将打印页面设置为内框架内容
|
|
|
|
|
let doc: any = null
|
|
|
|
|
doc = newIframe.contentWindow.document
|
|
|
|
|
doc.write(`
|
|
|
|
|
<style type="text/css">
|
|
|
|
|
/* 浏览器打印基本样式 */
|
|
|
|
|
.page {
|
|
|
|
|
width: 21cm;
|
|
|
|
|
min-height: 29.7cm;
|
|
|
|
|
padding: 10mm;
|
|
|
|
|
margin: 20px auto;
|
|
|
|
|
border: 1px #d3d3d3 solid;
|
|
|
|
|
border-radius: 5px;
|
|
|
|
|
background: white;
|
|
|
|
|
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
|
|
|
|
|
position: relative;
|
|
|
|
|
font-size: 14px !important;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@page {
|
|
|
|
|
size: A4;
|
|
|
|
|
margin:1cm;
|
|
|
|
|
}
|
|
|
|
|
@media print {
|
|
|
|
|
.page {
|
|
|
|
|
margin: 10mm;
|
|
|
|
|
border: initial;
|
|
|
|
|
border-radius: initial;
|
|
|
|
|
width: initial;
|
|
|
|
|
min-height: initial;
|
|
|
|
|
box-shadow: initial;
|
|
|
|
|
background: initial;
|
|
|
|
|
page-break-after: always;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
table {
|
|
|
|
|
width: 100%; /* 让表格宽度100%占满其父元素宽度 */
|
|
|
|
|
height: auto; /* 高度根据内容自适应 */
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
text-align: center;
|
|
|
|
|
border-collapse: collapse;
|
|
|
|
|
margin-top: 5mm; /* 添加顶部外边距,替代原先的页内边距 */
|
|
|
|
|
tr{
|
|
|
|
|
td {
|
|
|
|
|
padding: 5px 0;
|
|
|
|
|
border: 1px solid #333;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.xh {
|
|
|
|
|
width: 50px !important;
|
|
|
|
|
}
|
|
|
|
|
.checkbox {
|
|
|
|
|
border: 2px solid #999;
|
|
|
|
|
width: 10px;
|
|
|
|
|
height: 10px;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
align-items: center;
|
|
|
|
|
margin-left:10px ;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
<div>
|
|
|
|
|
${printNode.innerHTML}
|
|
|
|
|
</div>`)
|
|
|
|
|
doc.close()
|
|
|
|
|
// 浏览器打印页面打开渲染
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
newIframe.contentWindow.focus()
|
|
|
|
|
newIframe.contentWindow.print()
|
|
|
|
|
document.body.removeChild(newIframe) // 移除打印内框架,下次打印下次再挂载
|
|
|
|
|
dialogVisible.value = false
|
|
|
|
|
}, 100)
|
|
|
|
|
}
|
|
|
|
|
const outopen = () => {
|
|
|
|
|
dialogVisible.value = false
|
|
|
|
|
}
|
|
|
|
|
const queryParams: any = ref({
|
|
|
|
|
code: undefined
|
|
|
|
|
})
|
|
|
|
|
const isSelected = ref([1, 3])
|
|
|
|
|
|
|
|
|
|
/** 打开弹窗 */
|
|
|
|
|
const open = async (type: string, id?: number) => {
|
|
|
|
|
dialogVisible.value = true
|
|
|
|
|
}
|
|
|
|
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
.page {
|
|
|
|
|
width: 22cm;
|
|
|
|
|
min-height: 29.7cm;
|
|
|
|
|
padding: 10mm;
|
|
|
|
|
margin: 20px auto;
|
|
|
|
|
border: 1px #d3d3d3 solid;
|
|
|
|
|
border-radius: 5px;
|
|
|
|
|
background: white;
|
|
|
|
|
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
|
|
|
|
|
position: relative;
|
|
|
|
|
font-size: 14px !important;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@page {
|
|
|
|
|
size: A4;
|
|
|
|
|
margin: 0;
|
|
|
|
|
}
|
|
|
|
|
@media print {
|
|
|
|
|
.page {
|
|
|
|
|
margin: 0;
|
|
|
|
|
border: initial;
|
|
|
|
|
border-radius: initial;
|
|
|
|
|
width: initial;
|
|
|
|
|
min-height: initial;
|
|
|
|
|
box-shadow: initial;
|
|
|
|
|
background: initial;
|
|
|
|
|
page-break-after: always;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
table {
|
|
|
|
|
width: 100%; /* 让表格宽度100%占满其父元素宽度 */
|
|
|
|
|
height: auto; /* 高度根据内容自适应 */
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
text-align: center;
|
|
|
|
|
border-collapse: collapse;
|
|
|
|
|
margin-top: 5mm; /* 添加顶部外边距,替代原先的页内边距 */
|
|
|
|
|
tr {
|
|
|
|
|
td {
|
|
|
|
|
padding: 2px 0;
|
|
|
|
|
border: 1px solid #333;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.xh {
|
|
|
|
|
width: 50px !important;
|
|
|
|
|
}
|
|
|
|
|
.checkbox {
|
|
|
|
|
border: 2px solid #999;
|
|
|
|
|
width: 15px;
|
|
|
|
|
height: 15px;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
align-items: center;
|
|
|
|
|
margin-left: 10px;
|
|
|
|
|
}
|
|
|
|
|
/*
|
|
|
|
|
A4的大小:21cm*29.7cm(width:794px;)。
|
|
|
|
|
单位换算:1 inch = 2.54 cm 1mm = 96 px 1 cm = 37.79528 px*/
|
|
|
|
|
</style>
|