Selaa lähdekoodia

修改打印bug

695593266@qq.com 3 päivää sitten
vanhempi
commit
13dfa6f9e3

+ 12 - 7
src/views/batchRecord/components/tables/batchRecordTable.vue

@@ -299,14 +299,20 @@
         }
         try {
           const printRows = this.getPrintRows();
-          const ids = printRows.map((item) => item.id).filter(Boolean);
-          if (!ids.length) {
+          const validPrintRows = printRows.filter((item) => item.id);
+          if (!validPrintRows.length) {
             this.$message.warning('未获取到可打印数据的ID');
             return;
           }
-          const res = await queryPrint({ ids, printType });
-          const data = this.buildPrintData(key, res);
-          if (!data) {
+          const data = (
+            await Promise.all(
+              validPrintRows.map(async (row) => {
+                const res = await queryPrint({ ids: [row.id], printType });
+                return this.buildPrintData(key, res, row);
+              })
+            )
+          ).filter(Boolean);
+          if (!data.length) {
             this.$message.warning('未查询到可打印的生产记录数据');
             return;
           }
@@ -317,13 +323,12 @@
           this.$message.error(error.message || '查询打印数据失败');
         }
       },
-      buildPrintData(key, res) {
+      buildPrintData(key, res, fallback = this.getPrintRows()[0] || {}) {
         const list = this.getPrintList(key, res);
         const first = list[0];
         if (!first) {
           return null;
         }
-        const fallback = this.getPrintRows()[0] || {};
         const today = this.formatPrintDate(new Date());
         const base = this.buildBasePrintData(first, fallback, today);
 

+ 21 - 33
src/views/batchRecord/print/electrodeBatchRecord/cleaningRecord.vue

@@ -1,7 +1,12 @@
 <template>
   <ele-modal title="清场清洁记录表 SC-033" :visible.sync="visible" v-if="visible" width="70%" :maxable="true">
     <div id="printSection_cleaningRecord">
-      <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: 24px; font-weight: bold; margin-bottom: 5px;">清场清洁记录表</div>
         <div style="text-align: right; margin-bottom: 5px;">表单编号:TR.D-033/SC &nbsp;&nbsp;版本:B/4</div>
@@ -34,7 +39,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="4">
-              {{ completionYear }} 年 {{ completionMonth }} 月 {{ completionDay }} 日 {{ completionHour }} 时 {{ completionMinute }} 分
+              {{ getDatePart(form.completionTime, 0, 4) }} 年 {{ getDatePart(form.completionTime, 5, 7) }} 月 {{ getDatePart(form.completionTime, 8, 10) }} 日 {{ getDatePart(form.completionTime, 11, 13) }} 时 {{ getDatePart(form.completionTime, 14, 16) }} 分
             </td>
           </tr>
         </table>
@@ -52,7 +57,7 @@
             </tr>
           </thead>
           <tbody>
-            <tr v-for="(item, idx) in checkItems" :key="idx">
+            <tr v-for="(item, idx) in getCheckItems(form)" :key="idx">
               <td style="border: 1px solid #000; padding: 6px; text-align: center;">{{ idx + 1 }}</td>
               <td style="border: 1px solid #000; padding: 6px;">{{ item.name }}</td>
               <td style="border: 1px solid #000; padding: 6px; text-align: center;">{{ item.cleaningStatus }}</td>
@@ -103,6 +108,7 @@
       return {
         visible: false,
         form: {},
+        formList: [],
         defaultCheckItems: [
           { name: '顶棚清洁干净', cleaner: '', abnormalDesc: '' },
           { name: '墙面清洁干净', cleaner: '', abnormalDesc: '' },
@@ -117,47 +123,29 @@
           { name: '批生产记录按规定收集、送交', cleaner: '', abnormalDesc: '' },
           { name: '与上批生产的容器标识已清除或更换', cleaner: '', abnormalDesc: '' },
           { name: '需销毁的物资按规定清除出生产区', cleaner: '', abnormalDesc: '' }
-        ],
-        checkItems: []
+        ]
       };
     },
-    computed: {
-      completionYear() {
-        if (!this.form.completionTime) return '';
-        return this.form.completionTime.substring(0, 4);
-      },
-      completionMonth() {
-        if (!this.form.completionTime) return '';
-        return this.form.completionTime.substring(5, 7);
-      },
-      completionDay() {
-        if (!this.form.completionTime) return '';
-        return this.form.completionTime.substring(8, 10);
-      },
-      completionHour() {
-        if (!this.form.completionTime) return '';
-        return this.form.completionTime.substring(11, 13);
-      },
-      completionMinute() {
-        if (!this.form.completionTime) return '';
-        return this.form.completionTime.substring(14, 16);
-      }
-    },
     methods: {
       open(data) {
-        this.form = data || {};
-        this.checkItems =
-          Array.isArray(this.form.checkItems) && this.form.checkItems.length
-            ? this.form.checkItems
-            : this.defaultCheckItems.map((item) => ({ ...item }));
+        this.formList = Array.isArray(data) ? data : data ? [data] : [];
+        this.form = this.formList[0] || {};
         this.visible = true;
       },
+      getCheckItems(form) {
+        return Array.isArray(form.checkItems) && form.checkItems.length
+          ? form.checkItems
+          : this.defaultCheckItems;
+      },
+      getDatePart(value, start, end) {
+        return value ? String(value).substring(start, end) : '';
+      },
       print() {
         const el = document.getElementById('printSection_cleaningRecord');
         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>');

+ 36 - 27
src/views/batchRecord/print/electrodeBatchRecord/labelPrintRecord.vue

@@ -1,7 +1,11 @@
 <template>
   <ele-modal title="标签打印记录 SC-102" :visible.sync="visible" v-if="visible" width="80%" :maxable="true">
     <div id="printSection_labelPrintRecord">
-      <div class="report-container">
+      <div
+        v-for="(form, formIndex) in formList"
+        :key="form.id || form.code || formIndex"
+        class="report-container batch-print-document"
+      >
         <div class="report-header">
           <div class="header-left">
             <img :src="logoSrc" class="logo" alt="特瑞精密医疗" />
@@ -31,10 +35,10 @@
           </tr>
           <tr>
             <td class="label-cell">打印对象</td>
-            <td class="value-cell">{{ getPrintTarget(0) }}</td>
-            <td class="value-cell">{{ getPrintTarget(1) }}</td>
-            <td class="value-cell">{{ getPrintTarget(2) }}</td>
-            <td class="value-cell">{{ getPrintTarget(3) }}</td>
+            <td class="value-cell">{{ getPrintTarget(form, 0) }}</td>
+            <td class="value-cell">{{ getPrintTarget(form, 1) }}</td>
+            <td class="value-cell">{{ getPrintTarget(form, 2) }}</td>
+            <td class="value-cell">{{ getPrintTarget(form, 3) }}</td>
             <td rowspan="2" class="sample-cell">
               <div class="diagonal-wrap">
                 <div class="diagonal-line"></div>
@@ -44,24 +48,24 @@
           </tr>
           <tr>
             <td class="label-cell">规格</td>
-            <td class="value-cell">{{ getSpec(0) }}</td>
-            <td class="value-cell">{{ getSpec(1) }}</td>
-            <td class="value-cell">{{ getSpec(2) }}</td>
-            <td class="value-cell">{{ getSpec(3) }}</td>
+            <td class="value-cell">{{ getSpec(form, 0) }}</td>
+            <td class="value-cell">{{ getSpec(form, 1) }}</td>
+            <td class="value-cell">{{ getSpec(form, 2) }}</td>
+            <td class="value-cell">{{ getSpec(form, 3) }}</td>
           </tr>
           <tr>
             <td class="label-cell strong">产品型号</td>
             <td class="label-cell strong" colspan="4">打印数量(张)</td>
             <td class="label-cell sample-cell-bottom"></td>
           </tr>
-          <tr v-for="(item, idx) in paddedRecords" :key="idx" class="data-row">
+          <tr v-for="(item, idx) in getPaddedRecords(form)" :key="idx" class="data-row">
             <td class="value-cell">{{ item.productModel }}</td>
             <td class="value-cell" colspan="4">{{ item.printQuantity }}</td>
             <td class="value-cell"></td>
           </tr>
           <tr>
             <td class="label-cell">合计数量(张)</td>
-            <td class="value-cell" colspan="5">{{ totalQuantity }}</td>
+            <td class="value-cell" colspan="5">{{ getTotalQuantity(form) }}</td>
           </tr>
           <tr>
             <td class="label-cell">打印人/打印日期</td>
@@ -94,40 +98,44 @@
       return {
         visible: false,
         form: {},
+        formList: [],
         logoSrc: logoImg
       };
     },
-    computed: {
-      paddedRecords() {
-        const list = (this.form.records || []).map(item => ({ ...item }));
+    methods: {
+      getPaddedRecords(form) {
+        const list = (form.records || []).map(item => ({ ...item }));
         const minRows = 8;
         while (list.length < minRows) {
           list.push({ productModel: '', printQuantity: '' });
         }
         return list;
       },
-      totalQuantity() {
-        const list = this.form.records || [];
+      getTotalQuantity(form) {
+        const list = form.records || [];
         const total = list.reduce(
           (sum, item) => sum + (parseFloat(item.printQuantity) || 0),
           0
         );
         return total ? total : '';
-      }
-    },
-    methods: {
+      },
       open(data) {
-        this.form = data || {};
-        if (!this.form.records) this.form.records = [];
-        if (!this.form.printTargets) this.form.printTargets = [];
-        if (!this.form.specs) this.form.specs = [];
+        this.formList = (Array.isArray(data) ? data : data ? [data] : []).map(
+          (item) => ({
+            ...item,
+            records: item.records || [],
+            printTargets: item.printTargets || [],
+            specs: item.specs || []
+          })
+        );
+        this.form = this.formList[0] || {};
         this.visible = true;
       },
-      getPrintTarget(idx) {
-        return (this.form.printTargets && this.form.printTargets[idx]) || '';
+      getPrintTarget(form, idx) {
+        return (form.printTargets && form.printTargets[idx]) || '';
       },
-      getSpec(idx) {
-        return (this.form.specs && this.form.specs[idx]) || '';
+      getSpec(form, idx) {
+        return (form.specs && form.specs[idx]) || '';
       },
       print() {
         const el = document.getElementById('printSection_labelPrintRecord');
@@ -153,6 +161,7 @@
         win.document.write('.diagonal-line{position:absolute;top:0;left:0;width:100%;height:100%;background:linear-gradient(to top right,transparent calc(50% - 0.5px),#000 calc(50% - 0.5px),#000 calc(50% + 0.5px),transparent calc(50% + 0.5px));}');
         win.document.write('.sample-text{position:absolute;bottom:2px;right:2px;color:#c00000;font-weight:bold;font-size:12px;}');
         win.document.write('.remark-cell{text-align:left;height:50px;vertical-align:top;}');
+        win.document.write('.batch-print-document+.batch-print-document{page-break-before:always;}');
         win.document.write('</style></head><body>');
         win.document.write(el.innerHTML);
         win.document.write('</body></html>');

+ 24 - 56
src/views/batchRecord/print/electrodeBatchRecord/packagingRecord.vue

@@ -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 &nbsp;&nbsp;版本: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>');

+ 14 - 2
src/views/batchRecord/print/electrodeBatchRecord/processInspectionRecord.vue

@@ -7,7 +7,11 @@
     :maxable="true"
   >
     <div id="printSection_processInspectionRecord">
-      <div class="report-container">
+      <div
+        v-for="(form, formIndex) in formList"
+        :key="form.id || form.code || formIndex"
+        class="report-container batch-print-document"
+      >
         <div class="report-header">
           <div class="header-left">
             <img :src="logoSrc" alt="特瑞精密医疗" class="logo" />
@@ -228,12 +232,14 @@
       return {
         visible: false,
         form: {},
+        formList: [],
         logoSrc: logoImg
       };
     },
     methods: {
       open(data) {
-        this.form = data || {};
+        this.formList = Array.isArray(data) ? data : data ? [data] : [];
+        this.form = this.formList[0] || {};
         this.visible = true;
       },
       print() {
@@ -288,6 +294,9 @@
         win.document.write(
           '.judgement-row{height:32px;}.judgement-row td{text-align:center;white-space:nowrap;}.judgement-options{display:flex;align-items:center;justify-content:space-around;width:100%;}'
         );
+        win.document.write(
+          '.batch-print-document+.batch-print-document{page-break-before:always;}'
+        );
         win.document.write('</style>');
         win.document.write('</head><body>');
         win.document.write(el.innerHTML);
@@ -310,6 +319,9 @@
     font-size: 12px;
     box-sizing: border-box;
   }
+  .batch-print-document + .batch-print-document {
+    page-break-before: always;
+  }
   .report-header {
     display: flex;
     align-items: center;

+ 17 - 8
src/views/batchRecord/print/electrodeBatchRecord/productLabelRecord.vue

@@ -1,7 +1,12 @@
 <template>
   <ele-modal title="产品贴标记录 TR.D-050/SC" :visible.sync="visible" v-if="visible" width="70%" :maxable="true">
     <div id="printSection_productLabelRecord">
-      <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: 24px; font-weight: bold; margin-bottom: 5px;">产品贴标记录</div>
         <div style="text-align: right; margin-bottom: 5px;">表单编号:TR.D-050/SC &nbsp;&nbsp;版本:A/2</div>
@@ -68,7 +73,7 @@
             </tr>
           </thead>
           <tbody>
-            <tr v-for="(item, idx) in materialRows" :key="idx">
+            <tr v-for="(item, idx) in getMaterialRows(form)" :key="idx">
               <td style="border: 1px solid #000; padding: 6px; text-align: center;">{{ item.labelName }}</td>
               <td style="border: 1px solid #000; padding: 6px; text-align: center;">{{ item.spec }}</td>
               <td style="border: 1px solid #000; padding: 6px; text-align: center;">{{ item.receiveQty }}</td>
@@ -146,7 +151,8 @@
       return {
         visible: false,
         form: {},
-        materialRows: [
+        formList: [],
+        defaultMaterialRows: [
           { labelName: '', spec: '', receiveQty: '', useQty: '', remainQty: '', wasteQty: '' },
           { labelName: '', spec: '', receiveQty: '', useQty: '', remainQty: '', wasteQty: '' },
           { labelName: '', spec: '', receiveQty: '', useQty: '', remainQty: '', wasteQty: '' },
@@ -156,18 +162,21 @@
     },
     methods: {
       open(data) {
-        this.form = data || {};
-        if (this.form.materialRows && this.form.materialRows.length) {
-          this.materialRows = this.form.materialRows;
-        }
+        this.formList = Array.isArray(data) ? data : data ? [data] : [];
+        this.form = this.formList[0] || {};
         this.visible = true;
       },
+      getMaterialRows(form) {
+        return Array.isArray(form.materialRows) && form.materialRows.length
+          ? form.materialRows
+          : this.defaultMaterialRows;
+      },
       print() {
         const el = document.getElementById('printSection_productLabelRecord');
         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>');