|
|
@@ -1,7 +1,12 @@
|
|
|
<template>
|
|
|
<ele-modal title="产品中、外包装工序记录 SC-019" :visible.sync="visible" v-if="visible" width="70%" :maxable="true">
|
|
|
<div id="printSection_packagingRecord">
|
|
|
- <div style="font-family: 'SimSun', serif; padding: 20px; background: #fff; font-size: 12px;">
|
|
|
+ <div
|
|
|
+ v-for="(form, formIndex) in formList"
|
|
|
+ :key="form.id || form.code || formIndex"
|
|
|
+ class="batch-print-document"
|
|
|
+ style="font-family: 'SimSun', serif; padding: 20px; background: #fff; font-size: 12px;"
|
|
|
+ >
|
|
|
<div style="text-align: center; font-size: 18px; letter-spacing: 6px; margin-bottom: 5px;">湖南特瑞精密医疗器械有限公司</div>
|
|
|
<div style="text-align: center; font-size: 22px; font-weight: bold; margin-bottom: 5px;">产品中、外包装工序记录</div>
|
|
|
<div style="text-align: right; margin-bottom: 5px;">表单编号:TR.D-019/SC 版本:B/3</div>
|
|
|
@@ -22,7 +27,7 @@
|
|
|
<tr>
|
|
|
<td style="border: 1px solid #000; padding: 6px 10px; text-align: center;">操作时间:</td>
|
|
|
<td style="border: 1px solid #000; padding: 6px 10px;" colspan="3">
|
|
|
- {{ startYear }} 年 {{ startMonth }} 月 {{ startDay }} 日 {{ startHour }} 时 {{ startMinute }} 分~{{ endYear }} 年 {{ endMonth }} 月 {{ endDay }} 日 {{ endHour }} 时 {{ endMinute }} 分
|
|
|
+ {{ getDatePart(form.startTime, 0, 4) }} 年 {{ getDatePart(form.startTime, 5, 7) }} 月 {{ getDatePart(form.startTime, 8, 10) }} 日 {{ getDatePart(form.startTime, 11, 13) }} 时 {{ getDatePart(form.startTime, 14, 16) }} 分~{{ getDatePart(form.endTime, 0, 4) }} 年 {{ getDatePart(form.endTime, 5, 7) }} 月 {{ getDatePart(form.endTime, 8, 10) }} 日 {{ getDatePart(form.endTime, 11, 13) }} 时 {{ getDatePart(form.endTime, 14, 16) }} 分
|
|
|
</td>
|
|
|
</tr>
|
|
|
</table>
|
|
|
@@ -56,14 +61,14 @@
|
|
|
<td style="border: 1px solid #000; padding: 6px 10px; width: 10%; text-align: center; font-weight: bold;">合格数</td>
|
|
|
<td style="border: 1px solid #000; padding: 6px 10px; width: 10%; text-align: center; font-weight: bold;">操作人</td>
|
|
|
</tr>
|
|
|
- <tr v-for="(item, index) in operationRecords" :key="index">
|
|
|
+ <tr v-for="(item, index) in getOperationRecords(form)" :key="index">
|
|
|
<td style="border: 1px solid #000; padding: 6px 10px; text-align: center;">{{ item.operationProcess }}</td>
|
|
|
<td style="border: 1px solid #000; padding: 6px 10px; white-space: pre-line;">{{ item.contentText }}</td>
|
|
|
<td style="border: 1px solid #000; padding: 6px 10px; text-align: center;">{{ item.unqualifiedCount }}</td>
|
|
|
<td style="border: 1px solid #000; padding: 6px 10px; text-align: center;">{{ item.qualifiedCount }}</td>
|
|
|
<td style="border: 1px solid #000; padding: 6px 10px; text-align: center;">{{ item.operator }}</td>
|
|
|
</tr>
|
|
|
- <tr v-if="!operationRecords.length">
|
|
|
+ <tr v-if="!getOperationRecords(form).length">
|
|
|
<td colspan="5" style="border: 1px solid #000; padding: 12px; text-align: center;">暂无包装工序记录</td>
|
|
|
</tr>
|
|
|
</table>
|
|
|
@@ -80,7 +85,7 @@
|
|
|
<td style="border: 1px solid #000; padding: 6px 10px; width: 30%; text-align: center; font-weight: bold;">清场检查操作记录</td>
|
|
|
<td style="border: 1px solid #000; padding: 6px 10px; width: 30%; text-align: center; font-weight: bold;">清场检查记录</td>
|
|
|
</tr>
|
|
|
- <tr v-for="(item, index) in cleaningItems" :key="index">
|
|
|
+ <tr v-for="(item, index) in getCleaningItems(form)" :key="index">
|
|
|
<td style="border: 1px solid #000; padding: 6px 10px;">{{ item.name }}</td>
|
|
|
<td style="border: 1px solid #000; padding: 6px 10px; text-align: center;">
|
|
|
{{ item.cleaningStatus }}<span v-if="item.cleaner"> / {{ item.cleaner }}</span>
|
|
|
@@ -89,7 +94,7 @@
|
|
|
{{ item.checkResult }}<span v-if="item.abnormalDesc"> / {{ item.abnormalDesc }}</span>
|
|
|
</td>
|
|
|
</tr>
|
|
|
- <tr v-if="!cleaningItems.length">
|
|
|
+ <tr v-if="!getCleaningItems(form).length">
|
|
|
<td colspan="3" style="border: 1px solid #000; padding: 12px; text-align: center;">暂无清场检查记录</td>
|
|
|
</tr>
|
|
|
</table>
|
|
|
@@ -119,71 +124,34 @@
|
|
|
data() {
|
|
|
return {
|
|
|
visible: false,
|
|
|
- form: {}
|
|
|
+ form: {},
|
|
|
+ formList: []
|
|
|
};
|
|
|
},
|
|
|
- computed: {
|
|
|
- operationRecords() {
|
|
|
- return (this.form.operationRecords || []).map((item) => ({
|
|
|
+ methods: {
|
|
|
+ getOperationRecords(form) {
|
|
|
+ return (form.operationRecords || []).map((item) => ({
|
|
|
...item,
|
|
|
contentText: (item.content || []).join('\n')
|
|
|
}));
|
|
|
},
|
|
|
- cleaningItems() {
|
|
|
- return this.form.cleaningItems || [];
|
|
|
- },
|
|
|
- startYear() {
|
|
|
- if (!this.form.startTime) return '';
|
|
|
- return this.form.startTime.substring(0, 4);
|
|
|
- },
|
|
|
- startMonth() {
|
|
|
- if (!this.form.startTime) return '';
|
|
|
- return this.form.startTime.substring(5, 7);
|
|
|
- },
|
|
|
- startDay() {
|
|
|
- if (!this.form.startTime) return '';
|
|
|
- return this.form.startTime.substring(8, 10);
|
|
|
- },
|
|
|
- startHour() {
|
|
|
- if (!this.form.startTime) return '';
|
|
|
- return this.form.startTime.substring(11, 13);
|
|
|
- },
|
|
|
- startMinute() {
|
|
|
- if (!this.form.startTime) return '';
|
|
|
- return this.form.startTime.substring(14, 16);
|
|
|
- },
|
|
|
- endYear() {
|
|
|
- if (!this.form.endTime) return '';
|
|
|
- return this.form.endTime.substring(0, 4);
|
|
|
+ getCleaningItems(form) {
|
|
|
+ return form.cleaningItems || [];
|
|
|
},
|
|
|
- endMonth() {
|
|
|
- if (!this.form.endTime) return '';
|
|
|
- return this.form.endTime.substring(5, 7);
|
|
|
- },
|
|
|
- endDay() {
|
|
|
- if (!this.form.endTime) return '';
|
|
|
- return this.form.endTime.substring(8, 10);
|
|
|
- },
|
|
|
- endHour() {
|
|
|
- if (!this.form.endTime) return '';
|
|
|
- return this.form.endTime.substring(11, 13);
|
|
|
- },
|
|
|
- endMinute() {
|
|
|
- if (!this.form.endTime) return '';
|
|
|
- return this.form.endTime.substring(14, 16);
|
|
|
- }
|
|
|
- },
|
|
|
- methods: {
|
|
|
open(data) {
|
|
|
- this.form = data || {};
|
|
|
+ this.formList = Array.isArray(data) ? data : data ? [data] : [];
|
|
|
+ this.form = this.formList[0] || {};
|
|
|
this.visible = true;
|
|
|
},
|
|
|
+ getDatePart(value, start, end) {
|
|
|
+ return value ? String(value).substring(start, end) : '';
|
|
|
+ },
|
|
|
print() {
|
|
|
const el = document.getElementById('printSection_packagingRecord');
|
|
|
const win = window.open('', '_blank');
|
|
|
win.document.open();
|
|
|
win.document.write('<html><head><title>产品中、外包装工序记录</title>');
|
|
|
- win.document.write('<style>body{margin:0;padding:20px;font-family:"SimSun",serif;} table{border-collapse:collapse;width:100%;} td,th{border:1px solid #000;padding:6px;}</style>');
|
|
|
+ win.document.write('<style>body{margin:0;padding:20px;font-family:"SimSun",serif;} table{border-collapse:collapse;width:100%;} td,th{border:1px solid #000;padding:6px;}.batch-print-document+.batch-print-document{page-break-before:always;}</style>');
|
|
|
win.document.write('</head><body>');
|
|
|
win.document.write(el.innerHTML);
|
|
|
win.document.write('</body></html>');
|