You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1443 lines
59 KiB
1443 lines
59 KiB
<template>
|
|
<div class="outgoing-report-container report-tabs">
|
|
<el-button class="tabs-print no-print" type="success" size="small" :disabled="!report.delNo" @click="printBoth">打印</el-button>
|
|
<el-tabs v-model="activeTab">
|
|
<el-tab-pane label="出货检验" name="left">
|
|
<div class="toolbar no-print">
|
|
<el-button type="primary" @click="openSelectDialog">选择出货通知单</el-button>
|
|
<span v-if="report.delNo" class="picked-no">通知单:{{ report.delNo }} 行号:{{ report.delItemNo }}</span>
|
|
</div>
|
|
<div v-if="report.delNo" class="report-content out-sheet">
|
|
<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" :disabled="!report.delNo">
|
|
<div class="toolbar no-print">
|
|
<el-button type="warning" @click="openTemplateDialog">选择模板</el-button>
|
|
<el-button type="primary" :disabled="!selectedTemplateCode" @click="openInspDialog('fqc')">选择FQC检验单</el-button>
|
|
<el-button type="primary" :disabled="!selectedTemplateCode" @click="openInspDialog('ipqc')">选择IPQC检验单</el-button>
|
|
<span v-if="selectedTemplateCode" class="picked-no">模板:{{ selectedTemplateDesc || selectedTemplateCode }}</span>
|
|
<span v-if="fqcRecord.inspectionNo" class="picked-no">FQC:{{ fqcRecord.inspectionNo }}</span>
|
|
<span v-if="ipqcRecord.inspectionNo" class="picked-no">IPQC:{{ ipqcRecord.inspectionNo }}</span>
|
|
</div>
|
|
<div v-if="selectedTemplateCode" class="report-content mat-report">
|
|
<table class="out-table">
|
|
<colgroup>
|
|
<col class="mc" /><col class="mc" /><col class="mc" /><col class="mc" />
|
|
<col class="mc" /><col class="mc" /><col class="mc" /><col class="mc" />
|
|
<col class="mc" /><col class="mc" /><col class="mc" /><col class="mp" /><col class="mp" />
|
|
</colgroup>
|
|
<tr class="head-row">
|
|
<td colspan="3" class="logo-cell">
|
|
<img v-if="logoUrl" :src="logoUrl" class="logo" alt="" />
|
|
</td>
|
|
<td colspan="10" class="title-cell title-plain">
|
|
<div class="title-text">OUTGOING QUALITY INSPECTION REPORT</div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="6" class="section">Certification Of Material</td>
|
|
<td colspan="2" class="label">Standard</td>
|
|
<td colspan="2" class="label">Required</td>
|
|
<td class="label">Result</td>
|
|
<td class="label">Pass</td>
|
|
<td class="label">Fail</td>
|
|
</tr>
|
|
<tr>
|
|
<td>1</td>
|
|
<td colspan="5" class="left">Material Type</td>
|
|
<td colspan="2"></td>
|
|
<td colspan="2">{{ mat('materialType').required }}</td>
|
|
<td>{{ mat('materialType').result }}</td>
|
|
<td class="mark">{{ mat('materialType').pass ? '✓' : '' }}</td>
|
|
<td class="mark">{{ mat('materialType').fail ? '✓' : '' }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>2</td>
|
|
<td colspan="2" class="left">Durometer,pts</td>
|
|
<td colspan="3">
|
|
<span class="opt" @click="pickChoice('durometer', 'lab')"><i class="tick">{{ choices.durometer === 'lab' ? '✓' : '' }}</i>Lab. Standard</span>
|
|
</td>
|
|
<td colspan="2">D2240</td>
|
|
<td colspan="2">{{ mat('durometerLab').required }}</td>
|
|
<td>{{ mat('durometerLab').result }}</td>
|
|
<td class="mark">{{ mat('durometerLab').pass ? '✓' : '' }}</td>
|
|
<td class="mark">{{ mat('durometerLab').fail ? '✓' : '' }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>3</td>
|
|
<td colspan="2" class="left">Durometer,pts</td>
|
|
<td colspan="3">
|
|
<span class="opt" @click="pickChoice('durometer', 'product')"><i class="tick">{{ choices.durometer === 'product' ? '✓' : '' }}</i>Product</span>
|
|
</td>
|
|
<td colspan="2">D2240</td>
|
|
<td colspan="2">{{ mat('durometerProduct').required }}</td>
|
|
<td>{{ mat('durometerProduct').result }}</td>
|
|
<td class="mark">{{ mat('durometerProduct').pass ? '✓' : '' }}</td>
|
|
<td class="mark">{{ mat('durometerProduct').fail ? '✓' : '' }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>4</td>
|
|
<td colspan="5" class="left">Tensile, min(Mpa)</td>
|
|
<td colspan="2">D412/DieC</td>
|
|
<td colspan="2">{{ mat('tensile').required }}</td>
|
|
<td>{{ mat('tensile').result }}</td>
|
|
<td class="mark">{{ mat('tensile').pass ? '✓' : '' }}</td>
|
|
<td class="mark">{{ mat('tensile').fail ? '✓' : '' }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>5</td>
|
|
<td colspan="5" class="left">Tear Resistance,min(KN/m)</td>
|
|
<td colspan="2">D624/DieC</td>
|
|
<td colspan="2">{{ mat('tear').required }}</td>
|
|
<td>{{ mat('tear').result }}</td>
|
|
<td class="mark">{{ mat('tear').pass ? '✓' : '' }}</td>
|
|
<td class="mark">{{ mat('tear').fail ? '✓' : '' }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>6</td>
|
|
<td colspan="5" class="left">Elongation,min%</td>
|
|
<td colspan="2">D412/DieC</td>
|
|
<td colspan="2">{{ mat('elongation').required }}</td>
|
|
<td>{{ mat('elongation').result }}</td>
|
|
<td class="mark">{{ mat('elongation').pass ? '✓' : '' }}</td>
|
|
<td class="mark">{{ mat('elongation').fail ? '✓' : '' }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>7</td>
|
|
<td colspan="2" class="left">Density(G/CM)</td>
|
|
<td colspan="3">
|
|
<span class="opt" @click="pickChoice('density', '100')"><i class="tick">{{ choices.density === '100' ? '✓' : '' }}</i>100℃</span>
|
|
</td>
|
|
<td colspan="2">D297</td>
|
|
<td colspan="2">{{ mat('density').required }}</td>
|
|
<td>{{ mat('density').result }}</td>
|
|
<td class="mark">{{ mat('density').pass ? '✓' : '' }}</td>
|
|
<td class="mark">{{ mat('density').fail ? '✓' : '' }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>8</td>
|
|
<td colspan="2" class="left">Mooney(1+4)</td>
|
|
<td colspan="3">
|
|
<span class="opt" @click="pickChoice('mooney', '125')"><i class="tick">{{ choices.mooney === '125' ? '✓' : '' }}</i>125℃</span>
|
|
</td>
|
|
<td colspan="2">D1646</td>
|
|
<td colspan="2">{{ mat('mooney').required }}</td>
|
|
<td>{{ mat('mooney').result }}</td>
|
|
<td class="mark">{{ mat('mooney').pass ? '✓' : '' }}</td>
|
|
<td class="mark">{{ mat('mooney').fail ? '✓' : '' }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="3" class="label">Carton Packing</td>
|
|
<td colspan="3">
|
|
<span class="opt" @click="pickChoice('carton', 'single')"><i class="tick">{{ choices.carton === 'single' ? '✓' : '' }}</i>single</span>
|
|
<span class="opt" @click="pickChoice('carton', 'mixing')"><i class="tick">{{ choices.carton === 'mixing' ? '✓' : '' }}</i>Mixing</span>
|
|
</td>
|
|
<td colspan="2" class="left">Inspection Report</td>
|
|
<td colspan="2">
|
|
<span class="opt" @click="pickChoice('inspectionReport', 'yes')"><i class="tick">{{ choices.inspectionReport === 'yes' ? '✓' : '' }}</i>Yes</span>
|
|
<span class="opt" @click="pickChoice('inspectionReport', 'no')"><i class="tick">{{ choices.inspectionReport === 'no' ? '✓' : '' }}</i>NO</span>
|
|
</td>
|
|
<td class="left">Bag label</td>
|
|
<td colspan="2">
|
|
<span class="opt" @click="pickChoice('bagLabel', 'yes')"><i class="tick">{{ choices.bagLabel === 'yes' ? '✓' : '' }}</i>Yes</span>
|
|
<span class="opt" @click="pickChoice('bagLabel', 'no')"><i class="tick">{{ choices.bagLabel === 'no' ? '✓' : '' }}</i>NO</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="3" class="label">Material Report</td>
|
|
<td colspan="3">
|
|
<span class="opt" @click="pickChoice('materialReport', 'yes')"><i class="tick">{{ choices.materialReport === 'yes' ? '✓' : '' }}</i>Yes</span>
|
|
<span class="opt" @click="pickChoice('materialReport', 'no')"><i class="tick">{{ choices.materialReport === 'no' ? '✓' : '' }}</i>NO</span>
|
|
</td>
|
|
<td colspan="2" class="left">Packing List</td>
|
|
<td colspan="2">
|
|
<span class="opt" @click="pickChoice('packingList', 'yes')"><i class="tick">{{ choices.packingList === 'yes' ? '✓' : '' }}</i>Yes</span>
|
|
<span class="opt" @click="pickChoice('packingList', 'no')"><i class="tick">{{ choices.packingList === 'no' ? '✓' : '' }}</i>NO</span>
|
|
</td>
|
|
<td class="left">Slabs</td>
|
|
<td colspan="2">
|
|
<span class="opt" @click="pickChoice('slabs', 'yes')"><i class="tick">{{ choices.slabs === 'yes' ? '✓' : '' }}</i>Yes</span>
|
|
<span class="opt" @click="pickChoice('slabs', 'no')"><i class="tick">{{ choices.slabs === 'no' ? '✓' : '' }}</i>NO</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="10" class="banner">Main Dimensions Random Inspection</td>
|
|
<td class="left">Hardness</td>
|
|
<td colspan="2">
|
|
<span class="opt" @click="pickChoice('hardness', 'yes')"><i class="tick">{{ choices.hardness === 'yes' ? '✓' : '' }}</i>Yes</span>
|
|
<span class="opt" @click="pickChoice('hardness', 'no')"><i class="tick">{{ choices.hardness === 'no' ? '✓' : '' }}</i>NO</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="2" class="left">Post Cure:</td>
|
|
<td colspan="2">{{ postText('postCure1') }}</td>
|
|
<td class="label">xx</td>
|
|
<td colspan="2">{{ postText('xx') }}</td>
|
|
<td colspan="2" class="label">Job/Purchase No.</td>
|
|
<td>{{ postText('jobPurchase') }}</td>
|
|
<td class="left">Taste</td>
|
|
<td colspan="2">
|
|
<span class="opt" @click="pickChoice('taste', 'yes')"><i class="tick">{{ choices.taste === 'yes' ? '✓' : '' }}</i>Yes</span>
|
|
<span class="opt" @click="pickChoice('taste', 'no')"><i class="tick">{{ choices.taste === 'no' ? '✓' : '' }}</i>NO</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="10"></td>
|
|
<td class="label">Tolerance</td>
|
|
<td colspan="2">{{ postText('toleranceAttr') }}</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<table class="dim-table">
|
|
<colgroup>
|
|
<col class="dd" /><col class="dd" /><col class="dd" /><col class="dd" /><col class="dd" />
|
|
<col class="dd" /><col class="dd" /><col class="dd" /><col class="dd" /><col class="dd" />
|
|
<col class="dd" /><col class="dd" /><col class="dd" /><col class="dp" /><col class="dp" />
|
|
</colgroup>
|
|
<tr>
|
|
<td rowspan="3" class="seq-head seq-cell">
|
|
<button type="button" class="sign-btn plus no-print" @click="addDimRow">+</button>
|
|
序号
|
|
</td>
|
|
<td rowspan="3" class="col-op">操作</td>
|
|
<td rowspan="3" class="col-mode">展现方式</td>
|
|
<td rowspan="2">Dimension</td>
|
|
<td rowspan="2">Tolerance</td>
|
|
<td rowspan="3">转换</td>
|
|
<td colspan="2">Limited Dimension</td>
|
|
<td colspan="5">Inspection Data</td>
|
|
<td rowspan="3">PASS</td>
|
|
<td rowspan="3">FAIL</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Down</td>
|
|
<td>UP</td>
|
|
<td v-for="n in 5" :key="'cav'+n">Cavity</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="unit-note">(英寸:INCH) (不转换:MM)</td>
|
|
<td class="unit-note">(英寸:INCH) (不转换:MM)</td>
|
|
<td class="unit-note">(英寸:INCH) (不转换:MM)</td>
|
|
<td class="unit-note">(英寸:INCH) (不转换:MM)</td>
|
|
<td v-for="n in 5" :key="'idx'+n">{{ n }}</td>
|
|
</tr>
|
|
<tr v-for="(row, index) in dimRows" :key="'u'+row.uid">
|
|
<td class="seq-cell">
|
|
<button type="button" class="sign-btn minus no-print" @click="deleteDimRow(index)">−</button>
|
|
{{ index + 1 }}
|
|
</td>
|
|
<td class="col-op">
|
|
<el-button size="mini" class="no-print" @click="openItemDialog(row)">选择</el-button>
|
|
</td>
|
|
<td class="col-mode">
|
|
<select v-model="row.displayMode" class="mode-select no-print" @change="rebuildDimRow(row)">
|
|
<option value="列转行">列转行</option>
|
|
<option value="行转列">行转列</option>
|
|
</select>
|
|
<span class="print-only">{{ row.displayMode }}</span>
|
|
</td>
|
|
<td class="left">{{ row.itemDesc }}</td>
|
|
<td>{{ showNum(row, row.stdValue) }}</td>
|
|
<td>
|
|
<select v-model="row.unitMode" class="mode-select no-print">
|
|
<option value="不转换">不转换</option>
|
|
<option value="英寸">英寸</option>
|
|
</select>
|
|
<span class="print-only">{{ row.unitMode }}</span>
|
|
</td>
|
|
<td>{{ showNum(row, row.minValue) }}</td>
|
|
<td>{{ showNum(row, row.maxValue) }}</td>
|
|
<td v-for="n in 5" :key="'um'+row.uid+n">{{ showNum(row, row.upperMeasures[n - 1]) }}</td>
|
|
<td class="mark">{{ row.fqcResult === 'Y' ? '✓' : '' }}</td>
|
|
<td class="mark">{{ row.fqcResult === 'N' ? '✓' : '' }}</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<table class="dim-table lower-dim">
|
|
<colgroup>
|
|
<col class="dd" /><col class="dd" /><col class="dd" /><col class="dd" /><col class="dd" />
|
|
<col class="dd" /><col class="dd" /><col class="dd" /><col class="dd" /><col class="dd" />
|
|
<col class="dd" /><col class="dd" /><col class="dd" /><col class="dp" /><col class="dp" />
|
|
</colgroup>
|
|
<tr>
|
|
<td rowspan="2" class="seq-head">序号</td>
|
|
<td rowspan="2" class="col-op"></td>
|
|
<td rowspan="2" class="col-mode"></td>
|
|
<td rowspan="2">Dimension</td>
|
|
<td rowspan="2">Tolerance</td>
|
|
<td rowspan="2"></td>
|
|
<td>Down</td>
|
|
<td>UP</td>
|
|
<td v-for="n in 5" :key="'lc'+n">Cavity</td>
|
|
<td rowspan="2">PASS</td>
|
|
<td rowspan="2">FAIL</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="unit-note">(英寸:INCH) (不转换:MM)</td>
|
|
<td class="unit-note">(英寸:INCH) (不转换:MM)</td>
|
|
<td v-for="n in 5" :key="'li'+n">{{ n + 5 }}</td>
|
|
</tr>
|
|
<tr v-for="(row, index) in dimRows" :key="'d'+row.uid">
|
|
<td>{{ index + 1 }}</td>
|
|
<td class="col-op"></td>
|
|
<td class="col-mode"></td>
|
|
<td class="left">{{ row.itemDesc }}</td>
|
|
<td>{{ showNum(row, row.stdValue) }}</td>
|
|
<td></td>
|
|
<td>{{ showNum(row, row.minValue) }}</td>
|
|
<td>{{ showNum(row, row.maxValue) }}</td>
|
|
<td v-for="n in 5" :key="'lm'+row.uid+n">{{ showNum(row, row.lowerMeasures[n - 1]) }}</td>
|
|
<td class="mark">{{ row.ipqcResult === 'Y' ? '✓' : '' }}</td>
|
|
<td class="mark">{{ row.ipqcResult === 'N' ? '✓' : '' }}</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div v-else class="empty-state">
|
|
<i class="el-icon-document" style="font-size: 60px; color: #dcdfe6;"></i>
|
|
<p>请先选择模板,再分别选择 FQC、IPQC 检验单</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>
|
|
|
|
<el-dialog :title="inspKind === 'fqc' ? '选择FQC检验单' : '选择IPQC检验单'" :visible.sync="inspDialogVisible" width="90%" top="5vh" :modal-append-to-body="false" :destroy-on-close="true">
|
|
<el-form :inline="true" :model="inspSearch" size="small">
|
|
<el-form-item label="检验单号">
|
|
<el-input v-model="inspSearch.inspectionNo" clearable style="width: 150px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="物料编码">
|
|
<el-input v-model="inspSearch.partNo" clearable style="width: 150px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="物料名称">
|
|
<el-input v-model="inspSearch.partDesc" clearable style="width: 180px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-button type="primary" @click="searchInspList">查询</el-button>
|
|
<el-button @click="resetInspSearch">重置</el-button>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-table :data="inspList" border stripe highlight-current-row height="450" @current-change="row => selectedInspRow = row" @row-dblclick="handleInspDblClick">
|
|
<el-table-column type="index" label="序号" width="60" align="center"></el-table-column>
|
|
<el-table-column prop="inspectionNo" label="检验单号" min-width="150"></el-table-column>
|
|
<el-table-column prop="partNo" label="物料编码" min-width="120"></el-table-column>
|
|
<el-table-column prop="partDesc" label="物料名称" min-width="150"></el-table-column>
|
|
<el-table-column prop="seqNo" label="派工单号" min-width="120"></el-table-column>
|
|
<el-table-column prop="state" label="状态" min-width="90"></el-table-column>
|
|
<el-table-column prop="inspectionResult" label="检验结论" min-width="100"></el-table-column>
|
|
</el-table>
|
|
<el-pagination
|
|
@size-change="val => { inspSearch.limit = val; inspSearch.page = 1; searchInspList() }"
|
|
@current-change="val => { inspSearch.page = val; searchInspList() }"
|
|
:current-page="inspSearch.page"
|
|
:page-sizes="[10, 20, 50, 100]"
|
|
:page-size="inspSearch.limit"
|
|
:total="inspTotal"
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
style="margin-top: 10px; text-align: right;">
|
|
</el-pagination>
|
|
<div slot="footer">
|
|
<el-button @click="inspDialogVisible = false">取消</el-button>
|
|
<el-button type="primary" :disabled="!selectedInspRow" @click="confirmInsp">确定</el-button>
|
|
</div>
|
|
</el-dialog>
|
|
|
|
<el-dialog title="选择模板" :visible.sync="templateDialogVisible" width="60%" top="8vh" :modal-append-to-body="false" :destroy-on-close="true">
|
|
<el-form :inline="true" :model="templateSearch" size="small">
|
|
<el-form-item label="模板编号">
|
|
<el-input v-model="templateSearch.codeNo" clearable style="width: 150px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item label="模板名称">
|
|
<el-input v-model="templateSearch.codeDesc" clearable style="width: 200px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-button type="primary" @click="searchTemplateList">查询</el-button>
|
|
<el-button @click="resetTemplateSearch">重置</el-button>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-table :data="templateList" border stripe highlight-current-row height="400" @current-change="row => selectedTemplateRow = row" @row-dblclick="handleTemplateDblClick">
|
|
<el-table-column type="index" label="序号" width="60" align="center"></el-table-column>
|
|
<el-table-column prop="codeNo" label="属性模板编号" min-width="150"></el-table-column>
|
|
<el-table-column prop="codeDesc" label="属性模板名称" min-width="220"></el-table-column>
|
|
<el-table-column prop="functionType" label="功能类型" min-width="100"></el-table-column>
|
|
</el-table>
|
|
<el-pagination
|
|
@size-change="val => { templateSearch.limit = val; templateSearch.page = 1; searchTemplateList() }"
|
|
@current-change="val => { templateSearch.page = val; searchTemplateList() }"
|
|
:current-page="templateSearch.page"
|
|
:page-sizes="[10, 20, 50, 100]"
|
|
:page-size="templateSearch.limit"
|
|
:total="templateTotal"
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
style="margin-top: 10px; text-align: right;">
|
|
</el-pagination>
|
|
<div slot="footer">
|
|
<el-button @click="templateDialogVisible = false">取消</el-button>
|
|
<el-button type="primary" :disabled="!selectedTemplateRow" @click="confirmTemplate">确定</el-button>
|
|
</div>
|
|
</el-dialog>
|
|
|
|
<el-dialog title="选择检验项目" :visible.sync="itemDialogVisible" width="60%" top="8vh" :modal-append-to-body="false" :destroy-on-close="true">
|
|
<el-form :inline="true" :model="itemSearch" size="small">
|
|
<el-form-item label="项目名称">
|
|
<el-input v-model="itemSearch.itemDesc" clearable style="width: 200px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-button type="primary" @click="searchItemList">查询</el-button>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-table :data="itemList" border stripe highlight-current-row height="400" @current-change="row => selectedItemRow = row" @row-dblclick="handleItemDblClick">
|
|
<el-table-column type="index" label="序号" width="60" align="center"></el-table-column>
|
|
<el-table-column prop="itemNo" label="检验项目编码" min-width="120"></el-table-column>
|
|
<el-table-column prop="itemDesc" label="检验项目名称" min-width="180"></el-table-column>
|
|
<el-table-column prop="defaultValue" label="标准值" min-width="100"></el-table-column>
|
|
<el-table-column prop="minValue" label="最小值" min-width="90"></el-table-column>
|
|
<el-table-column prop="maxValue" label="最大值" min-width="90"></el-table-column>
|
|
<el-table-column prop="textValue" label="实测值" min-width="120"></el-table-column>
|
|
<el-table-column label="FAIL" min-width="80" align="center">
|
|
<template slot-scope="scope">{{ scope.row.itemResult === 'N' ? '✓' : '' }}</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
<el-pagination
|
|
@size-change="val => { itemSearch.limit = val; itemSearch.page = 1; searchItemList() }"
|
|
@current-change="val => { itemSearch.page = val; searchItemList() }"
|
|
:current-page="itemSearch.page"
|
|
:page-sizes="[10, 20, 50, 100]"
|
|
:page-size="itemSearch.limit"
|
|
:total="itemTotal"
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
style="margin-top: 10px; text-align: right;">
|
|
</el-pagination>
|
|
<div slot="footer">
|
|
<el-button @click="itemDialogVisible = false">取消</el-button>
|
|
<el-button type="primary" :disabled="!selectedItemRow" @click="confirmItem">确定</el-button>
|
|
</div>
|
|
</el-dialog>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import { getOutgoingDelList, getPropertiesModelList, getPropertiesModelDetail, getFQCReport, getIPQCReport } from '@/api/qc/qc_report.js'
|
|
import { getPhotoAddressData } from '@/api/pad.js'
|
|
import { qcFQCInspectionSearch, qcIPQCInspectionSearch, selectFQCSubDetailedRecord, selectIPQCSubDetailedRecord } from '@/api/qc/qc.js'
|
|
import { buildPrintImageUrl } from '@/utils/runtimeSiteConfig.js'
|
|
|
|
function normName (value) {
|
|
return String(value == null ? '' : value).replace(/[\s::.。,,()()/%+\-]/g, '').toLowerCase()
|
|
}
|
|
|
|
const FIELD_ALIASES = [
|
|
['materialType', ['Material Type']],
|
|
['durometerLab', ['Durometer Lab', 'Durometer Lab. Standard', 'Durometer,pts(Lab. Standard)']],
|
|
['durometerProduct', ['Durometer Product', 'Durometer,pts(Product)']],
|
|
['tensile', ['Tensile', 'Tensile, min(Mpa)', 'Tensile min']],
|
|
['tear', ['Tear Resistance', 'Tear Resistance,min(KN/m)']],
|
|
['elongation', ['Elongation', 'Elongation,min%']],
|
|
['density', ['Density', 'Density(G/CM)']],
|
|
['mooney', ['Mooney', 'Mooney(1+4)']],
|
|
['postCure1', ['Post Cure', 'Post Cure 1']],
|
|
['xx', ['xx']],
|
|
['jobPurchase', ['Job/Purchase No.', 'Job/Purchase No']],
|
|
['toleranceAttr', ['Tolerance']]
|
|
]
|
|
const FIELD_KEY = {}
|
|
FIELD_ALIASES.forEach(pair => {
|
|
pair[1].forEach(label => { FIELD_KEY[normName(label)] = pair[0] })
|
|
})
|
|
const POST_KEYS = { postCure1: true, xx: true, jobPurchase: true, toleranceAttr: true }
|
|
|
|
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 },
|
|
selectedTemplateCode: '',
|
|
selectedTemplateDesc: '',
|
|
templateRows: [],
|
|
templateDialogVisible: false,
|
|
selectedTemplateRow: null,
|
|
templateList: [],
|
|
templateTotal: 0,
|
|
templateSearch: { codeNo: '', codeDesc: '', page: 1, limit: 10 },
|
|
choices: {
|
|
durometer: 'lab',
|
|
density: '',
|
|
mooney: '',
|
|
carton: 'single',
|
|
inspectionReport: 'yes',
|
|
bagLabel: 'yes',
|
|
materialReport: 'yes',
|
|
packingList: 'yes',
|
|
slabs: 'no',
|
|
hardness: 'no',
|
|
taste: 'no'
|
|
},
|
|
material: {},
|
|
fqcRecord: {},
|
|
ipqcRecord: {},
|
|
fqcDetailMap: {},
|
|
ipqcDetailMap: {},
|
|
fqcDetailList: [],
|
|
dimRows: [],
|
|
inspKind: 'fqc',
|
|
inspDialogVisible: false,
|
|
selectedInspRow: null,
|
|
inspList: [],
|
|
inspTotal: 0,
|
|
inspSearch: { inspectionNo: '', partNo: '', partDesc: '', page: 1, limit: 10 },
|
|
itemDialogVisible: false,
|
|
currentDimRow: null,
|
|
selectedItemRow: null,
|
|
itemList: [],
|
|
itemTotal: 0,
|
|
itemSearch: { itemDesc: '', page: 1, limit: 10 },
|
|
dimSeed: 1
|
|
}
|
|
},
|
|
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 : ''
|
|
})
|
|
},
|
|
printBoth () {
|
|
if (!this.report.delNo) {
|
|
this.$message.warning('请先选择出货通知单')
|
|
return
|
|
}
|
|
const left = this.$el.querySelector('.out-sheet')
|
|
if (!left) {
|
|
this.$message.warning('请先选择出货通知单')
|
|
return
|
|
}
|
|
const right = this.$el.querySelector('.mat-report')
|
|
const leftClone = this.cloneSheet(left)
|
|
const rightClone = right ? this.cloneSheet(right) : null
|
|
const html = `<div class="print-pair"><div class="print-col">${leftClone.innerHTML}</div><div class="print-col">${rightClone ? rightClone.innerHTML : ''}</div></div>`
|
|
const printWindow = window.open('', '_blank')
|
|
printWindow.document.write(`<!DOCTYPE html><html><head><title>产品出货检验报告</title><style>${this.printStyle()}${this.materialPrintStyle()}</style></head><body>${html}</body></html>`)
|
|
printWindow.document.close()
|
|
printWindow.focus()
|
|
setTimeout(() => {
|
|
printWindow.print()
|
|
printWindow.close()
|
|
}, 300)
|
|
},
|
|
cloneSheet (node) {
|
|
const clone = node.cloneNode(true)
|
|
const liveImgs = node.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)
|
|
}
|
|
Array.prototype.forEach.call(clone.querySelectorAll('.no-print'), function (el) {
|
|
if (el.parentNode) el.parentNode.removeChild(el)
|
|
})
|
|
return clone
|
|
},
|
|
printStyle () {
|
|
return `
|
|
@page { size: A3 landscape; margin: 6mm; }
|
|
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: 12px; 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: 13px; font-weight: 700; line-height: 1.1; text-align: center; }
|
|
.out-table td.title-plain { padding-bottom: 2px; }
|
|
.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; }
|
|
`
|
|
},
|
|
defaultChoices () {
|
|
return {
|
|
durometer: 'lab', density: '', mooney: '', carton: 'single',
|
|
inspectionReport: 'yes', bagLabel: 'yes', materialReport: 'yes', packingList: 'yes',
|
|
slabs: 'no', hardness: 'no', taste: 'no'
|
|
}
|
|
},
|
|
emptyMaterial () {
|
|
const material = {}
|
|
FIELD_ALIASES.forEach(pair => {
|
|
material[pair[0]] = { required: '', result: '', pass: false, fail: false }
|
|
})
|
|
return material
|
|
},
|
|
mat (key) {
|
|
return this.material[key] || { required: '', result: '', pass: false, fail: false }
|
|
},
|
|
postText (key) {
|
|
const item = this.mat(key)
|
|
return item.result || ''
|
|
},
|
|
jobNo () {
|
|
const seq = this.ipqcRecord && this.ipqcRecord.seqNo
|
|
return seq == null ? '' : seq
|
|
},
|
|
pickChoice (group, value) {
|
|
this.$set(this.choices, group, this.choices[group] === value ? '' : value)
|
|
},
|
|
blankFive () {
|
|
return ['', '', '', '', '']
|
|
},
|
|
newDimRow () {
|
|
this.dimSeed += 1
|
|
return {
|
|
uid: this.dimSeed,
|
|
displayMode: '列转行',
|
|
unitMode: '不转换',
|
|
itemNo: '',
|
|
itemDesc: '',
|
|
stdValue: '',
|
|
minValue: '',
|
|
maxValue: '',
|
|
fqcResult: '',
|
|
ipqcResult: '',
|
|
fqcSubs: [],
|
|
ipqcSubs: [],
|
|
upperMeasures: this.blankFive(),
|
|
lowerMeasures: this.blankFive()
|
|
}
|
|
},
|
|
blankDimRows () {
|
|
const rows = []
|
|
for (let i = 0; i < 6; i++) rows.push(this.newDimRow())
|
|
return rows
|
|
},
|
|
addDimRow () {
|
|
this.dimRows.push(this.newDimRow())
|
|
},
|
|
deleteDimRow (index) {
|
|
this.dimRows.splice(index, 1)
|
|
},
|
|
openTemplateDialog () {
|
|
if (!this.report.delNo) {
|
|
this.$message.warning('请先在出货检验页签选择出货通知单')
|
|
return
|
|
}
|
|
this.templateSearch = { codeNo: '', codeDesc: '', page: 1, limit: 10 }
|
|
this.selectedTemplateRow = null
|
|
this.templateDialogVisible = true
|
|
this.searchTemplateList()
|
|
},
|
|
resetTemplateSearch () {
|
|
this.templateSearch = { codeNo: '', codeDesc: '', page: 1, limit: 10 }
|
|
this.selectedTemplateRow = null
|
|
this.searchTemplateList()
|
|
},
|
|
searchTemplateList () {
|
|
getPropertiesModelList({
|
|
codeNo: this.templateSearch.codeNo || '',
|
|
codeDesc: this.templateSearch.codeDesc || '',
|
|
page: this.templateSearch.page,
|
|
limit: this.templateSearch.limit
|
|
}).then(({data}) => {
|
|
if (data && data.code === 0) {
|
|
this.templateList = (data.page && data.page.list) || []
|
|
this.templateTotal = (data.page && data.page.totalCount) || 0
|
|
} else {
|
|
this.templateList = []
|
|
this.templateTotal = 0
|
|
this.$message.error((data && data.msg) || '属性模板查询失败')
|
|
}
|
|
})
|
|
},
|
|
handleTemplateDblClick (row) {
|
|
this.selectedTemplateRow = row
|
|
this.confirmTemplate()
|
|
},
|
|
confirmTemplate () {
|
|
if (!this.selectedTemplateRow) return
|
|
this.selectedTemplateCode = this.selectedTemplateRow.codeNo
|
|
this.selectedTemplateDesc = this.selectedTemplateRow.codeDesc || ''
|
|
this.templateDialogVisible = false
|
|
this.fqcRecord = {}
|
|
this.ipqcRecord = {}
|
|
this.fqcDetailMap = {}
|
|
this.ipqcDetailMap = {}
|
|
this.fqcDetailList = []
|
|
this.material = this.emptyMaterial()
|
|
this.choices = this.defaultChoices()
|
|
this.dimRows = this.blankDimRows()
|
|
getPropertiesModelDetail({ codeNo: this.selectedTemplateCode }).then(({data}) => {
|
|
if (data && data.code === 0) {
|
|
this.templateRows = data.rows || []
|
|
} else {
|
|
this.templateRows = []
|
|
this.$message.error((data && data.msg) || '属性模板明细查询失败')
|
|
}
|
|
})
|
|
},
|
|
openInspDialog (kind) {
|
|
if (!this.selectedTemplateCode) {
|
|
this.$message.warning('请先选择属性模板')
|
|
return
|
|
}
|
|
this.inspKind = kind
|
|
this.inspSearch = { inspectionNo: '', partNo: '', partDesc: '', page: 1, limit: 10 }
|
|
this.inspList = []
|
|
this.inspTotal = 0
|
|
this.selectedInspRow = null
|
|
this.inspDialogVisible = true
|
|
},
|
|
resetInspSearch () {
|
|
this.inspSearch = { inspectionNo: '', partNo: '', partDesc: '', page: 1, limit: 10 }
|
|
this.selectedInspRow = null
|
|
this.inspList = []
|
|
this.inspTotal = 0
|
|
},
|
|
searchInspList () {
|
|
const payload = {
|
|
site: '',
|
|
userName: this.$store.state.user.name,
|
|
inspectionNo: this.inspSearch.inspectionNo || '',
|
|
partNo: this.inspSearch.partNo || '',
|
|
partDesc: this.inspSearch.partDesc || '',
|
|
page: this.inspSearch.page,
|
|
limit: this.inspSearch.limit
|
|
}
|
|
const request = this.inspKind === 'ipqc' ? qcIPQCInspectionSearch : qcFQCInspectionSearch
|
|
request(payload).then(({data}) => {
|
|
if (data && data.code === 0) {
|
|
this.inspList = (data.page && data.page.list) || []
|
|
this.inspTotal = (data.page && data.page.totalCount) || 0
|
|
} else {
|
|
this.inspList = []
|
|
this.inspTotal = 0
|
|
this.$message.error((data && data.msg) || '检验单查询失败')
|
|
}
|
|
})
|
|
},
|
|
handleInspDblClick (row) {
|
|
this.selectedInspRow = row
|
|
this.confirmInsp()
|
|
},
|
|
confirmInsp () {
|
|
if (!this.selectedInspRow) return
|
|
const row = { ...this.selectedInspRow }
|
|
this.inspDialogVisible = false
|
|
if (this.inspKind === 'ipqc') {
|
|
this.ipqcRecord = row
|
|
this.loadInspDetails('ipqc', row)
|
|
} else {
|
|
this.fqcRecord = row
|
|
this.loadInspDetails('fqc', row)
|
|
}
|
|
},
|
|
loadInspDetails (kind, record) {
|
|
const request = kind === 'ipqc' ? getIPQCReport : getFQCReport
|
|
request({
|
|
userName: this.$store.state.user.name,
|
|
inspectionNo: record.inspectionNo,
|
|
page: 1,
|
|
limit: 9999
|
|
}).then(({data}) => {
|
|
const list = ((data && data.code === 0 && data.page && data.page.list) || [])
|
|
.filter(item => item.itemNo && item.inspectionNo === record.inspectionNo)
|
|
const map = {}
|
|
list.forEach(item => {
|
|
if (map[item.itemNo] === undefined) map[item.itemNo] = item
|
|
})
|
|
if (kind === 'ipqc') {
|
|
this.ipqcDetailMap = map
|
|
} else {
|
|
this.fqcDetailMap = map
|
|
this.fqcDetailList = list.filter((item, index) => list.findIndex(row => row.itemNo === item.itemNo) === index)
|
|
}
|
|
this.fillFixed()
|
|
this.dimRows.forEach(dimRow => {
|
|
if (dimRow.itemNo) this.refreshDimSide(dimRow, kind)
|
|
})
|
|
})
|
|
},
|
|
fillFixed () {
|
|
const material = this.emptyMaterial()
|
|
;(this.templateRows || []).forEach(row => {
|
|
const key = FIELD_KEY[normName(row.itemDesc)]
|
|
if (!key) return
|
|
const current = material[key]
|
|
if (current.required || current.result) return
|
|
if (row.defaultValue == null || row.defaultValue === '') return
|
|
const detail = POST_KEYS[key] ? this.ipqcDetailMap[row.defaultValue] : this.fqcDetailMap[row.defaultValue]
|
|
if (!detail) return
|
|
material[key] = {
|
|
required: detail.defaultValue != null ? detail.defaultValue : '',
|
|
result: detail.textValue || '',
|
|
pass: this.resultFlag(detail) === 'Y',
|
|
fail: this.resultFlag(detail) === 'N'
|
|
}
|
|
})
|
|
this.material = material
|
|
},
|
|
openItemDialog (row) {
|
|
if (!this.fqcRecord.inspectionNo) {
|
|
this.$message.warning('请先选择FQC检验单')
|
|
return
|
|
}
|
|
this.currentDimRow = row
|
|
this.selectedItemRow = null
|
|
this.itemSearch = { itemDesc: '', page: 1, limit: 10 }
|
|
this.itemDialogVisible = true
|
|
this.searchItemList()
|
|
},
|
|
searchItemList () {
|
|
const key = (this.itemSearch.itemDesc || '').trim().toLowerCase()
|
|
const all = (this.fqcDetailList || []).filter(item => {
|
|
if (!key) return true
|
|
return String(item.itemDesc || '').toLowerCase().indexOf(key) >= 0 || String(item.itemNo || '').toLowerCase().indexOf(key) >= 0
|
|
})
|
|
this.itemTotal = all.length
|
|
const start = (this.itemSearch.page - 1) * this.itemSearch.limit
|
|
this.itemList = all.slice(start, start + this.itemSearch.limit)
|
|
},
|
|
handleItemDblClick (row) {
|
|
this.selectedItemRow = row
|
|
this.confirmItem()
|
|
},
|
|
confirmItem () {
|
|
if (!this.selectedItemRow || !this.currentDimRow) return
|
|
const detail = this.selectedItemRow
|
|
const row = this.currentDimRow
|
|
const ipqc = this.ipqcDetailMap[detail.itemNo]
|
|
this.$set(row, 'itemNo', detail.itemNo || '')
|
|
this.$set(row, 'itemDesc', detail.itemDesc || '')
|
|
this.$set(row, 'stdValue', detail.defaultValue != null ? detail.defaultValue : (ipqc && ipqc.defaultValue != null ? ipqc.defaultValue : ''))
|
|
this.$set(row, 'minValue', detail.minValue != null ? detail.minValue : (ipqc && ipqc.minValue != null ? ipqc.minValue : ''))
|
|
this.$set(row, 'maxValue', detail.maxValue != null ? detail.maxValue : (ipqc && ipqc.maxValue != null ? ipqc.maxValue : ''))
|
|
this.$set(row, 'fqcResult', this.resultFlag(detail))
|
|
this.$set(row, 'ipqcResult', ipqc ? this.resultFlag(ipqc) : '')
|
|
this.itemDialogVisible = false
|
|
this.loadDimSubs(row)
|
|
},
|
|
refreshDimSide (row, kind) {
|
|
if (kind === 'ipqc') {
|
|
const ipqc = this.ipqcDetailMap[row.itemNo]
|
|
this.$set(row, 'ipqcResult', ipqc ? this.resultFlag(ipqc) : '')
|
|
} else {
|
|
const fqc = this.fqcDetailMap[row.itemNo]
|
|
if (fqc) {
|
|
this.$set(row, 'itemDesc', fqc.itemDesc || row.itemDesc)
|
|
this.$set(row, 'stdValue', fqc.defaultValue != null ? fqc.defaultValue : '')
|
|
this.$set(row, 'minValue', fqc.minValue != null ? fqc.minValue : '')
|
|
this.$set(row, 'maxValue', fqc.maxValue != null ? fqc.maxValue : '')
|
|
this.$set(row, 'fqcResult', this.resultFlag(fqc))
|
|
}
|
|
}
|
|
this.loadDimSubs(row)
|
|
},
|
|
loadDimSubs (row) {
|
|
const jobs = []
|
|
if (this.fqcRecord.inspectionNo) {
|
|
jobs.push(selectFQCSubDetailedRecord({
|
|
site: this.fqcRecord.site || '',
|
|
buNo: this.fqcRecord.buNo || '',
|
|
inspectionNo: this.fqcRecord.inspectionNo,
|
|
itemNo: row.itemNo
|
|
}).then(({data}) => {
|
|
this.$set(row, 'fqcSubs', ((data && data.rows) || []).slice())
|
|
}))
|
|
} else {
|
|
this.$set(row, 'fqcSubs', [])
|
|
}
|
|
if (this.ipqcRecord.inspectionNo) {
|
|
jobs.push(selectIPQCSubDetailedRecord({
|
|
site: this.ipqcRecord.site || '',
|
|
buNo: this.ipqcRecord.buNo || '',
|
|
inspectionNo: this.ipqcRecord.inspectionNo,
|
|
itemNo: row.itemNo
|
|
}).then(({data}) => {
|
|
this.$set(row, 'ipqcSubs', ((data && data.rows) || []).slice())
|
|
}))
|
|
} else {
|
|
this.$set(row, 'ipqcSubs', [])
|
|
}
|
|
Promise.all(jobs).then(() => this.rebuildDimRow(row))
|
|
},
|
|
rebuildDimRow (row) {
|
|
const upper = this.calcMeasures(row.displayMode, row.fqcSubs).slice(0, 5)
|
|
const lower = this.calcMeasures(row.displayMode, row.ipqcSubs).slice(5, 10)
|
|
while (upper.length < 5) upper.push('')
|
|
while (lower.length < 5) lower.push('')
|
|
this.$set(row, 'upperMeasures', upper)
|
|
this.$set(row, 'lowerMeasures', lower)
|
|
},
|
|
textOf (value) {
|
|
return value == null ? '' : String(value).trim()
|
|
},
|
|
resultFlag (detail) {
|
|
if (!detail) return ''
|
|
if (detail.itemResult === 'Y' || detail.itemResult === 'N') return detail.itemResult
|
|
if (detail.itemResultDesc === '合格') return 'Y'
|
|
if (detail.itemResultDesc === '不合格') return 'N'
|
|
return ''
|
|
},
|
|
calcMeasures (mode, subDetails) {
|
|
const rows = (subDetails || []).slice().sort((a, b) => (a.num || 0) - (b.num || 0))
|
|
const raw = []
|
|
if (mode === '行转列') {
|
|
const first = rows[0] || {}
|
|
const second = rows[1] || {}
|
|
;[first.subDetailValue, first.subDetailValueB, first.subDetailValueC, first.subDetailValueD, first.subDetailValueE,
|
|
second.subDetailValue, second.subDetailValueB, second.subDetailValueC, second.subDetailValueD, second.subDetailValueE]
|
|
.forEach(value => raw.push(this.textOf(value)))
|
|
} else {
|
|
rows.forEach(item => raw.push(this.textOf(item.subDetailValue)))
|
|
if (raw.filter(value => value).length < 10) {
|
|
rows.forEach(item => raw.push(this.textOf(item.subDetailValueB)))
|
|
}
|
|
}
|
|
const out = raw.filter(value => value)
|
|
while (out.length < 10) out.push('')
|
|
return out.slice(0, 10)
|
|
},
|
|
showNum (row, value) {
|
|
if (value == null || value === '') return ''
|
|
if (!row || row.unitMode !== '英寸') return value
|
|
const num = Number(String(value).replace(/,/g, ''))
|
|
if (!isFinite(num)) return value
|
|
const converted = Math.round((num / 25.4) * 10000) / 10000
|
|
return String(converted)
|
|
},
|
|
materialPrintStyle () {
|
|
return `
|
|
.print-pair { display: flex; align-items: flex-start; }
|
|
.print-col { width: 50%; box-sizing: border-box; }
|
|
.print-col + .print-col { padding-left: 8px; }
|
|
.print-col .out-table, .print-col .dim-table { min-width: 0; width: 100%; }
|
|
.dim-table { width: 100%; border-collapse: collapse; table-layout: fixed; margin-top: -1px; }
|
|
.dim-table td { border: 1px solid #000; text-align: center; vertical-align: middle; font-size: 8px; padding: 1px; word-break: break-all; height: auto; }
|
|
.print-only { display: inline; }
|
|
.unit-note { font-size: 7px; }
|
|
.sign-btn { display: none; }
|
|
`
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
.outgoing-report-container {
|
|
padding: 0 12px 12px;
|
|
}
|
|
.report-tabs {
|
|
position: relative;
|
|
}
|
|
.tabs-print {
|
|
position: absolute;
|
|
right: 12px;
|
|
top: 4px;
|
|
z-index: 3;
|
|
}
|
|
.report-tabs >>> .el-tabs__header {
|
|
padding-right: 88px;
|
|
}
|
|
.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%; }
|
|
.mat-report .mc,
|
|
.mat-report .mp,
|
|
.mat-report .dp {
|
|
width: 7.692%;
|
|
}
|
|
.mat-report .dd {
|
|
width: 6.509%;
|
|
}
|
|
.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;
|
|
}
|
|
.out-table td.title-plain {
|
|
padding-bottom: 2px;
|
|
}
|
|
.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;
|
|
}
|
|
.print-only {
|
|
display: none;
|
|
}
|
|
.mat-report {
|
|
padding-left: 28px;
|
|
}
|
|
.dim-table {
|
|
width: 100%;
|
|
min-width: 980px;
|
|
margin-top: -1px;
|
|
border-collapse: collapse;
|
|
table-layout: fixed;
|
|
}
|
|
.dim-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;
|
|
}
|
|
.dim-table td.left {
|
|
text-align: left;
|
|
padding-left: 4px;
|
|
}
|
|
.unit-note {
|
|
font-size: 10px;
|
|
line-height: 1.2;
|
|
}
|
|
.seq-cell {
|
|
position: relative;
|
|
}
|
|
.sign-btn {
|
|
position: absolute;
|
|
left: -22px;
|
|
top: 50%;
|
|
width: 18px;
|
|
height: 18px;
|
|
margin-top: -9px;
|
|
padding: 0;
|
|
border-radius: 2px;
|
|
background: #fff;
|
|
font-size: 14px;
|
|
line-height: 16px;
|
|
cursor: pointer;
|
|
}
|
|
.sign-btn.minus {
|
|
color: #f56c6c;
|
|
border: 1px solid #f56c6c;
|
|
}
|
|
.sign-btn.plus {
|
|
color: #409eff;
|
|
border: 1px solid #409eff;
|
|
}
|
|
.mode-select {
|
|
width: 76px;
|
|
height: 22px;
|
|
font-size: 12px;
|
|
}
|
|
</style>
|