3 changed files with 526 additions and 0 deletions
@ -0,0 +1,523 @@ |
|||
<template> |
|||
<div class="outgoing-report-container"> |
|||
<el-tabs v-model="activeTab"> |
|||
<el-tab-pane label="出货检验" name="left"> |
|||
<div class="toolbar no-print"> |
|||
<el-button type="primary" @click="openSelectDialog">选择出货通知单</el-button> |
|||
<el-button type="success" :disabled="!report.delNo" @click="printReport">打印</el-button> |
|||
<span v-if="report.delNo" class="picked-no">通知单:{{ report.delNo }} 行号:{{ report.delItemNo }}</span> |
|||
</div> |
|||
<div v-if="report.delNo" class="report-content"> |
|||
<table class="out-table"> |
|||
<colgroup> |
|||
<col class="c1" /><col class="c2" /><col class="c3" /><col class="c4" /> |
|||
<col class="c5" /><col class="c6" /><col class="c7" /><col class="c8" /> |
|||
<col class="c9" /><col class="c10" /><col class="c11" /><col class="c12" /> |
|||
</colgroup> |
|||
<tr class="head-row"> |
|||
<td colspan="3" class="logo-cell"> |
|||
<img v-if="logoUrl" :src="logoUrl" class="logo" alt="" /> |
|||
</td> |
|||
<td colspan="9" class="title-cell"> |
|||
<div class="title-text">OUTGOING QUALITY INSPECTION REPORT</div> |
|||
<div class="doc-no">QP-8.2-02-R05</div> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td colspan="2" class="label">Date:</td> |
|||
<td colspan="2" class="value">{{ formatDate(report.delDate) }}</td> |
|||
<td colspan="2" class="label">Customer:</td> |
|||
<td colspan="2" class="value">{{ report.customerName }}</td> |
|||
<td colspan="2" class="label">PN:</td> |
|||
<td colspan="2" class="value">{{ report.partNo }}</td> |
|||
</tr> |
|||
<tr> |
|||
<td colspan="2" class="label">P/O:</td> |
|||
<td colspan="2" class="value">{{ report.orderNo }}</td> |
|||
<td colspan="2" class="label">Lot Size</td> |
|||
<td colspan="2" class="value">{{ displayQty(report.shipQty) }}</td> |
|||
<td colspan="2" class="label">Sampling QTY</td> |
|||
<td colspan="2" class="value">{{ displayQty(report.samplingQty) }}</td> |
|||
</tr> |
|||
<tr> |
|||
<td colspan="2" class="label left">Sampling Standard</td> |
|||
<td colspan="2" class="value">GB/T 2828</td> |
|||
<td class="label">Leverl</td> |
|||
<td colspan="2" class="value"></td> |
|||
<td colspan="5" class="value"> |
|||
<span class="opt" @click="samplingLevel = 'Normal'"><i class="tick">{{ samplingLevel === 'Normal' ? '✓' : '' }}</i>Normal 常规</span> |
|||
<span class="opt" @click="samplingLevel = 'Tightened'"><i class="tick">{{ samplingLevel === 'Tightened' ? '✓' : '' }}</i>Tightened 加严</span> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td colspan="4" class="label">关键 Critical (0.1)</td> |
|||
<td colspan="4" class="label">主要 Major (1)</td> |
|||
<td colspan="4" class="label">次要 Minor (4.0)</td> |
|||
</tr> |
|||
<tr> |
|||
<td class="label">ACC.</td> |
|||
<td class="value">0</td> |
|||
<td class="label">Rej.</td> |
|||
<td class="value">1</td> |
|||
<td class="label">ACC.</td> |
|||
<td class="value">1</td> |
|||
<td class="label">Rej.</td> |
|||
<td class="value">3</td> |
|||
<td class="label">ACC.</td> |
|||
<td class="value">7</td> |
|||
<td class="label">Rej.</td> |
|||
<td class="value">10</td> |
|||
</tr> |
|||
<tr> |
|||
<td colspan="9" class="section">Surface Quality Inspection Standard</td> |
|||
<td class="label">Critical</td> |
|||
<td class="label">Main</td> |
|||
<td class="label">Minor</td> |
|||
</tr> |
|||
<tr> |
|||
<td colspan="2" class="label">Constructure</td> |
|||
<td colspan="7" class="left">Dimensions & surface requirment based on the print; see print;</td> |
|||
<td class="mark">√</td> |
|||
<td></td> |
|||
<td></td> |
|||
</tr> |
|||
<tr> |
|||
<td colspan="2" rowspan="2" class="label">Surface</td> |
|||
<td colspan="7" class="left">1.Surface inspection standard based on ISO3601;</td> |
|||
<td></td> |
|||
<td class="mark">√</td> |
|||
<td></td> |
|||
</tr> |
|||
<tr> |
|||
<td colspan="7" class="left">2.Surface has no crack,burrs,spews,bubble or defects;</td> |
|||
<td class="mark">√</td> |
|||
<td></td> |
|||
<td></td> |
|||
</tr> |
|||
<tr> |
|||
<td colspan="2" class="label">Scratch</td> |
|||
<td colspan="7" class="left">Scratch can not feeling,length≤10mm,width≤0.1mm,one surface ≤1strip</td> |
|||
<td></td> |
|||
<td></td> |
|||
<td class="mark">√</td> |
|||
</tr> |
|||
<tr> |
|||
<td colspan="2" class="label">Chromatism</td> |
|||
<td colspan="7" class="left">Color based on print;not allow obvious different color in one batch;</td> |
|||
<td></td> |
|||
<td></td> |
|||
<td class="mark">√</td> |
|||
</tr> |
|||
<tr> |
|||
<td colspan="12" class="banner">Surface Quality Inspection Report (Including Gage inspect)</td> |
|||
</tr> |
|||
<tr> |
|||
<td colspan="12" class="photo-cell"> |
|||
<img v-if="photoUrl" :src="photoUrl" class="part-photo" alt="" /> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td rowspan="2" class="label">Item</td> |
|||
<td colspan="2" rowspan="2" class="label">Inspection Item</td> |
|||
<td colspan="9" class="label">Spot Inspection Data (1 group = 25 PCS)</td> |
|||
</tr> |
|||
<tr> |
|||
<td v-for="n in 7" :key="'h'+n">{{ n }}</td> |
|||
<td>PASS</td> |
|||
<td>FAIL</td> |
|||
</tr> |
|||
<tr v-for="(name, index) in spotItems" :key="name"> |
|||
<td>{{ index + 1 }}</td> |
|||
<td colspan="2" class="left">{{ name }}</td> |
|||
<td v-for="n in 7" :key="name+n"></td> |
|||
<td></td> |
|||
<td></td> |
|||
</tr> |
|||
</table> |
|||
</div> |
|||
<div v-else class="empty-state"> |
|||
<i class="el-icon-document" style="font-size: 60px; color: #dcdfe6;"></i> |
|||
<p>请先点击“选择出货通知单”</p> |
|||
</div> |
|||
</el-tab-pane> |
|||
<el-tab-pane label="材料与尺寸" name="right"> |
|||
<div class="empty-state"> |
|||
<p>右侧报表后续再做</p> |
|||
</div> |
|||
</el-tab-pane> |
|||
</el-tabs> |
|||
|
|||
<el-dialog title="选择出货通知单" :visible.sync="selectDialogVisible" width="90%" top="5vh" :modal-append-to-body="false" :destroy-on-close="true"> |
|||
<el-form :inline="true" :model="searchData" size="small"> |
|||
<el-form-item label="通知单号"> |
|||
<el-input v-model="searchData.delNo" clearable style="width: 150px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="订单号"> |
|||
<el-input v-model="searchData.orderNo" clearable style="width: 150px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="物料编码"> |
|||
<el-input v-model="searchData.partNo" clearable style="width: 150px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="客户编码"> |
|||
<el-input v-model="searchData.customerNo" clearable style="width: 140px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="检验单号"> |
|||
<el-input v-model="searchData.inspectionNo" clearable style="width: 150px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="检验单状态"> |
|||
<el-select v-model="searchData.state" clearable placeholder="全部" style="width: 120px"> |
|||
<el-option label="已完成" value="已完成"></el-option> |
|||
<el-option label="待审核" value="待审核"></el-option> |
|||
<el-option label="待检验" value="待检验"></el-option> |
|||
<el-option label="未开始" value="未开始"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="primary" @click="searchList">查询</el-button> |
|||
<el-button @click="resetSearch">重置</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-table :data="delList" border stripe highlight-current-row height="450" @current-change="row => selectedRow = row" @row-dblclick="handleRowDblClick"> |
|||
<el-table-column type="index" label="序号" width="60" align="center"></el-table-column> |
|||
<el-table-column prop="delNo" label="通知单号" min-width="140"></el-table-column> |
|||
<el-table-column prop="delDate" label="日期" min-width="110"></el-table-column> |
|||
<el-table-column prop="customerNo" label="客户编码" min-width="110"></el-table-column> |
|||
<el-table-column prop="customerName" label="客户" min-width="160"></el-table-column> |
|||
<el-table-column prop="orderNo" label="订单号" min-width="130"></el-table-column> |
|||
<el-table-column prop="delItemNo" label="行号" width="70"></el-table-column> |
|||
<el-table-column prop="partNo" label="物料编码" min-width="130"></el-table-column> |
|||
<el-table-column prop="shipQty" label="出货数量" min-width="90"></el-table-column> |
|||
<el-table-column prop="samplingQty" label="抽样数量" min-width="90"></el-table-column> |
|||
<el-table-column prop="inspectionNo" label="检验单号" min-width="150"></el-table-column> |
|||
<el-table-column prop="state" label="检验单状态" min-width="100"></el-table-column> |
|||
</el-table> |
|||
<el-pagination |
|||
@size-change="val => { searchData.limit = val; searchData.page = 1; searchList() }" |
|||
@current-change="val => { searchData.page = val; searchList() }" |
|||
:current-page="searchData.page" |
|||
:page-sizes="[10, 20, 50, 100]" |
|||
:page-size="searchData.limit" |
|||
:total="total" |
|||
layout="total, sizes, prev, pager, next, jumper" |
|||
style="margin-top: 10px; text-align: right;"> |
|||
</el-pagination> |
|||
<div slot="footer"> |
|||
<el-button @click="selectDialogVisible = false">取消</el-button> |
|||
<el-button type="primary" :disabled="!selectedRow" @click="confirmSelection">确定</el-button> |
|||
</div> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { getOutgoingDelList } from '@/api/qc/qc_report.js' |
|||
import { getPhotoAddressData } from '@/api/pad.js' |
|||
import { buildPrintImageUrl } from '@/utils/runtimeSiteConfig.js' |
|||
|
|||
const SPOT_ITEMS = [ |
|||
'Flash & Burrs', |
|||
'Dirty Point & Bubble', |
|||
'Scratch & Crack', |
|||
'Broken & Split', |
|||
'Chromatism & colorate', |
|||
'Gage Tool check', |
|||
'Polybag label', |
|||
'Polybag weight', |
|||
'Carton Polybags' |
|||
] |
|||
|
|||
export default { |
|||
name: '产品出货检验报告', |
|||
data () { |
|||
return { |
|||
activeTab: 'left', |
|||
samplingLevel: 'Normal', |
|||
spotItems: SPOT_ITEMS, |
|||
logoUrl: '', |
|||
photoUrl: '', |
|||
report: {}, |
|||
selectDialogVisible: false, |
|||
selectedRow: null, |
|||
delList: [], |
|||
total: 0, |
|||
searchData: { delNo: '', orderNo: '', partNo: '', customerNo: '', inspectionNo: '', state: '已完成', page: 1, limit: 10 } |
|||
} |
|||
}, |
|||
methods: { |
|||
displayQty (value) { |
|||
if (value === null || value === undefined || value === '') return '' |
|||
const num = Number(value) |
|||
return Number.isNaN(num) ? value : String(num) |
|||
}, |
|||
formatDate (value) { |
|||
if (!value) return '' |
|||
const text = String(value) |
|||
return text.length >= 10 ? text.substring(0, 10) : text |
|||
}, |
|||
openSelectDialog () { |
|||
this.selectDialogVisible = true |
|||
this.selectedRow = null |
|||
this.searchList() |
|||
}, |
|||
resetSearch () { |
|||
this.searchData = { delNo: '', orderNo: '', partNo: '', customerNo: '', inspectionNo: '', state: '已完成', page: 1, limit: 10 } |
|||
this.delList = [] |
|||
this.total = 0 |
|||
this.selectedRow = null |
|||
this.searchList() |
|||
}, |
|||
searchList () { |
|||
getOutgoingDelList({ |
|||
site: '', |
|||
delNo: this.searchData.delNo || '', |
|||
orderNo: this.searchData.orderNo || '', |
|||
partNo: this.searchData.partNo || '', |
|||
customerNo: this.searchData.customerNo || '', |
|||
inspectionNo: this.searchData.inspectionNo || '', |
|||
state: this.searchData.state || '', |
|||
page: this.searchData.page, |
|||
limit: this.searchData.limit |
|||
}).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
this.delList = (data.page && data.page.list) || [] |
|||
this.total = (data.page && data.page.totalCount) || 0 |
|||
} else { |
|||
this.delList = [] |
|||
this.total = 0 |
|||
this.$message.error((data && data.msg) || '查询失败') |
|||
} |
|||
}) |
|||
}, |
|||
handleRowDblClick (row) { |
|||
this.selectedRow = row |
|||
this.confirmSelection() |
|||
}, |
|||
confirmSelection () { |
|||
if (!this.selectedRow) return |
|||
this.report = { ...this.selectedRow } |
|||
this.samplingLevel = 'Normal' |
|||
this.logoUrl = '' |
|||
this.photoUrl = '' |
|||
const fileName = this.report.logoFileName == null ? '' : String(this.report.logoFileName).trim() |
|||
if (fileName) this.logoUrl = buildPrintImageUrl(fileName) |
|||
this.loadPartPhoto() |
|||
this.selectDialogVisible = false |
|||
this.activeTab = 'left' |
|||
}, |
|||
loadPartPhoto () { |
|||
if (!this.report.site || !this.report.partNo) return |
|||
getPhotoAddressData({ site: this.report.site, partNo: this.report.partNo }).then(({data}) => { |
|||
const rows = (data && data.rows) || [] |
|||
if (!rows.length) { |
|||
this.photoUrl = '' |
|||
return |
|||
} |
|||
const name = rows[0].attaFileNameDb || rows[0].attaFileName || '' |
|||
const base = this.$store.state.user.padSopUrl || '' |
|||
this.photoUrl = name ? base + name : '' |
|||
}) |
|||
}, |
|||
printReport () { |
|||
if (!this.report.delNo) { |
|||
this.$message.warning('请先选择出货通知单') |
|||
return |
|||
} |
|||
const reportContent = this.$el.querySelector('.report-content') |
|||
if (!reportContent) return |
|||
const clone = reportContent.cloneNode(true) |
|||
const liveImgs = reportContent.querySelectorAll('img') |
|||
const cloneImgs = clone.querySelectorAll('img') |
|||
for (let i = 0; i < liveImgs.length; i++) { |
|||
if (liveImgs[i].src && cloneImgs[i]) cloneImgs[i].setAttribute('src', liveImgs[i].src) |
|||
} |
|||
const printWindow = window.open('', '_blank') |
|||
printWindow.document.write(`<!DOCTYPE html><html><head><title>产品出货检验报告</title><style>${this.printStyle()}</style></head><body>${clone.innerHTML}</body></html>`) |
|||
printWindow.document.close() |
|||
printWindow.focus() |
|||
setTimeout(() => { |
|||
printWindow.print() |
|||
printWindow.close() |
|||
}, 300) |
|||
}, |
|||
printStyle () { |
|||
return ` |
|||
@page { size: A4 portrait; margin: 8mm; } |
|||
body { margin: 0; } |
|||
.out-table { width: 100%; border-collapse: collapse; table-layout: fixed; } |
|||
.out-table td { border: 1px solid #000; text-align: center; vertical-align: middle; font-family: Arial, '宋体', sans-serif; font-size: 10px; padding: 2px; word-break: break-all; } |
|||
.head-row td, .doc-row td { border-color: transparent; } |
|||
.head-row td { height: 58px; border-top: 1px solid #000; border-bottom: 1px solid #000; } |
|||
.head-row td.logo-cell { border-left: 1px solid #000; } |
|||
.head-row td.title-cell { border-right: 1px solid #000; } |
|||
.doc-row td { height: 18px; } |
|||
.doc-row td:first-child { border-left: 1px solid #000; } |
|||
.doc-row td:last-child { border-right: 1px solid #000; } |
|||
.logo { height: 36px; max-width: 140px; width: auto; object-fit: contain; } |
|||
.out-table td.title-cell { position: relative; padding-bottom: 14px; border-color: transparent; border-top: 1px solid #000; border-bottom: 1px solid #000; border-right: 1px solid #000; font-family: 'Arial Black', 'Microsoft YaHei', sans-serif; font-size: 22px; font-weight: 700; line-height: 1.1; text-align: center; } |
|||
.doc-no { position: absolute; right: 6px; bottom: 2px; font-family: Arial, '宋体', sans-serif; font-size: 11px; font-weight: 700; line-height: 1; } |
|||
.label { font-weight: 700; } |
|||
.out-table td.left { text-align: left; padding-left: 4px; } |
|||
.section { font-size: 13px; font-weight: 700; } |
|||
.banner, .photo-title { font-family: 'Times New Roman', serif; font-size: 14px; font-weight: 700; } |
|||
.photo-cell { height: 160px; } |
|||
.part-photo { max-height: 150px; max-width: 90%; object-fit: contain; } |
|||
.tick { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; width: 12px; height: 12px; margin-right: 3px; border: 1px solid #000; font-style: normal; font-size: 11px; line-height: 1; vertical-align: middle; overflow: hidden; } |
|||
.opt { margin-right: 10px; white-space: nowrap; } |
|||
` |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.outgoing-report-container { |
|||
padding: 0 12px 12px; |
|||
} |
|||
.toolbar { |
|||
margin-bottom: 8px; |
|||
text-align: right; |
|||
} |
|||
.picked-no { |
|||
margin-left: 12px; |
|||
font-size: 13px; |
|||
color: #606266; |
|||
} |
|||
.report-content { |
|||
background: #fff; |
|||
padding: 12px; |
|||
overflow: auto; |
|||
} |
|||
.out-table { |
|||
width: 100%; |
|||
min-width: 980px; |
|||
border-collapse: collapse; |
|||
table-layout: fixed; |
|||
} |
|||
.out-table td { |
|||
border: 1px solid #000; |
|||
text-align: center; |
|||
vertical-align: middle; |
|||
font-family: Arial, '宋体', sans-serif; |
|||
font-size: 12px; |
|||
height: 28px; |
|||
padding: 2px 4px; |
|||
} |
|||
.c1 { width: 7%; } |
|||
.c2 { width: 8%; } |
|||
.c3 { width: 7%; } |
|||
.c4 { width: 8%; } |
|||
.c5 { width: 8%; } |
|||
.c6 { width: 8%; } |
|||
.c7 { width: 10%; } |
|||
.c8 { width: 9%; } |
|||
.c9 { width: 8%; } |
|||
.c10 { width: 8%; } |
|||
.c11 { width: 9%; } |
|||
.c12 { width: 10%; } |
|||
.head-row td, |
|||
.doc-row td { |
|||
border-color: transparent; |
|||
} |
|||
.head-row td { |
|||
height: 58px; |
|||
border-top: 1px solid #000; |
|||
border-bottom: 1px solid #000; |
|||
} |
|||
.head-row td.logo-cell { |
|||
border-left: 1px solid #000; |
|||
} |
|||
.head-row td.title-cell { |
|||
border-right: 1px solid #000; |
|||
} |
|||
.doc-row td { |
|||
height: 22px; |
|||
} |
|||
.doc-row td:first-child { |
|||
border-left: 1px solid #000; |
|||
} |
|||
.doc-row td:last-child { |
|||
border-right: 1px solid #000; |
|||
} |
|||
.logo { |
|||
height: 40px; |
|||
max-width: 180px; |
|||
width: auto; |
|||
object-fit: contain; |
|||
display: block; |
|||
} |
|||
.out-table td.title-cell { |
|||
position: relative; |
|||
padding-bottom: 16px; |
|||
border-top: 1px solid #000; |
|||
border-bottom: 1px solid #000; |
|||
border-right: 1px solid #000; |
|||
font-family: 'Arial Black', 'Microsoft YaHei', sans-serif; |
|||
font-size: 22px; |
|||
font-weight: 700; |
|||
line-height: 1.1; |
|||
text-align: center; |
|||
} |
|||
.doc-no { |
|||
position: absolute; |
|||
right: 8px; |
|||
bottom: 3px; |
|||
font-family: Arial, '宋体', sans-serif; |
|||
font-size: 13px; |
|||
font-weight: 700; |
|||
line-height: 1; |
|||
} |
|||
.label { |
|||
font-weight: 700; |
|||
} |
|||
.out-table td.left { |
|||
text-align: left; |
|||
padding-left: 6px; |
|||
} |
|||
.section { |
|||
font-size: 15px; |
|||
font-weight: 700; |
|||
} |
|||
.banner, |
|||
.photo-title { |
|||
font-family: 'Times New Roman', serif; |
|||
font-size: 16px; |
|||
font-weight: 700; |
|||
} |
|||
.photo-cell { |
|||
height: 220px; |
|||
} |
|||
.part-photo { |
|||
max-height: 200px; |
|||
max-width: 70%; |
|||
object-fit: contain; |
|||
} |
|||
.mark { |
|||
font-size: 16px; |
|||
} |
|||
.opt { |
|||
margin-right: 16px; |
|||
cursor: pointer; |
|||
white-space: nowrap; |
|||
} |
|||
.tick { |
|||
display: inline-flex; |
|||
align-items: center; |
|||
justify-content: center; |
|||
box-sizing: border-box; |
|||
width: 13px; |
|||
height: 13px; |
|||
margin-right: 3px; |
|||
border: 1px solid #000; |
|||
font-style: normal; |
|||
font-size: 12px; |
|||
font-weight: 700; |
|||
line-height: 1; |
|||
vertical-align: middle; |
|||
overflow: hidden; |
|||
} |
|||
.empty-state { |
|||
text-align: center; |
|||
padding-top: 80px; |
|||
color: #909399; |
|||
} |
|||
</style> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue