695593266@qq.com 1 هفته پیش
والد
کامیت
cd0bcacc33

+ 12 - 0
src/api/qms/index.js

@@ -29,3 +29,15 @@ export async function getQualityReportApproval(params) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+// 质检报告打印前查询(成品检验报告)
+export async function queryQualityReportPrint(body) {
+  const res = await request.post(
+    '/qms/quality_work_order/queryQualityReportPrint',
+    body
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 145 - 33
src/views/batchRecord/components/tables/qualityReportApproval.vue

@@ -70,7 +70,10 @@
 <script>
   import dictMixins from '@/mixins/dictMixins';
   import tabMixins from '@/mixins/tableColumnsMixin';
-  import { getQualityReportApproval } from '@/api/qms/index.js';
+  import {
+    getQualityReportApproval,
+    queryQualityReportPrint
+  } from '@/api/qms/index.js';
   import exportButton from '@/components/upload/exportButton.vue';
   import printSelector from '../printSelector.vue';
   import finishedProductReport from '../../print/electrodeBatchRecord/finishedProductReport.vue';
@@ -262,6 +265,14 @@
       }
     },
     methods: {
+      reload(where = {}) {
+        this.$refs.table.reload({
+          where: {
+            ...where,
+            ...this.tableQuery
+          }
+        });
+      },
       async datasource({ page, where, limit }) {
         const body = {
           ...where,
@@ -275,10 +286,7 @@
         return data;
       },
       search(where) {
-        this.$refs.table.reload({
-          where: where
-          // page: 1
-        });
+        this.reload(where);
       },
       print() {
         const printSection = document.getElementById('printSection');
@@ -304,40 +312,144 @@
       openFinishedReport(row) {
         this.$refs.finishedProductReport.open(row);
       },
-      handlePrint(key) {
+      async handlePrint(key) {
         if (!this.selection.length) {
           this.$message.warning('请先勾选要打印的质检报告');
           return;
         }
-        const r = this.selection[0];
-        const today = this.$util?.toDateString
-          ? this.$util.toDateString(new Date(), 'yyyy-MM-dd')
-          : new Date().toISOString().slice(0, 10);
-        const data = {
-          batchNo: this.tableQuery.batchNo,
-          productCode: this.tableQuery.productCode,
-          productName: r.productName || '',
-          specification: r.specification || '',
-          reportCode: r.reportNumber || '',
-          inspectionCode: r.code || '',
-          quantity: r.quantity || '',
-          sampleQuantity: r.sampleQuantity || '',
-          productQuantity: r.productQuantity || '',
-          productionDate: r.reportDate || today,
-          inspectionDate: r.reportDate || today,
-          reportDate: r.reportDate || today,
-          inspector: r.reportTemplateCreateUserName || '',
-          reviewer: r.reportApprovalUserName || '',
-          conclusion: r.reportApprovalStatus === 2 ? '合格' : '',
-          inspectionBasis: r.inspectionBasis || 'GB/T 国家标准/企业标准',
-          packagingSpec: r.packagingSpec || '',
-          validityPeriod: r.validityPeriod || '',
-          sterilizationBatchNo: r.sterilizationBatchNo || '',
-          remark: r.remark || ''
+        if (key !== 'finishedProductReport') {
+          this.$message.warning('暂不支持该打印单据');
+          return;
+        }
+        const ids = [
+          ...new Set(
+            this.selection
+              .map((item) => item.id)
+              .filter((id) => this.hasValue(id))
+          )
+        ];
+        if (!ids.length) {
+          this.$message.warning('未获取到可打印质检报告的质检工单ID');
+          return;
+        }
+        try {
+          const res = await queryQualityReportPrint({ ids });
+          const list = Array.isArray(res) ? res : [];
+          if (!list.length) {
+            this.$message.warning('未查询到可打印的质检报告数据');
+            return;
+          }
+          const data = list.map((item, index) =>
+            this.buildFinishedProductReportData(item, index)
+          );
+          if (this.$refs[key]) {
+            this.$refs[key].open(data);
+          }
+        } catch (error) {
+          this.$message.error(error.message || '查询质检报告打印数据失败');
+        }
+      },
+      buildFinishedProductReportData(item = {}, index = 0) {
+        const basicInfo = item.basicInfo || {};
+        const selected = this.getSelectedReport(basicInfo, index);
+        const detailList = Array.isArray(item.detailList)
+          ? item.detailList
+          : [];
+        return {
+          ...selected,
+          ...basicInfo,
+          reportCode: selected.reportNumber || '',
+          inspectionCode: selected.code || '',
+          productName: this.getValue(
+            basicInfo.productName,
+            selected.productName
+          ),
+          specification: this.getValue(
+            basicInfo.specModel,
+            selected.specification
+          ),
+          batchNo: this.getValue(
+            basicInfo.produceBatch,
+            selected.batchNo,
+            this.tableQuery.batchNo
+          ),
+          sterilizationBatchNo: this.getValue(
+            basicInfo.sterilizationBatch,
+            selected.sterilizationBatchNo
+          ),
+          productQuantity: this.getValue(
+            basicInfo.productQuantity,
+            selected.productQuantity,
+            selected.quantity
+          ),
+          sampleQuantity: this.getValue(
+            basicInfo.samplingQuantity,
+            selected.sampleQuantity
+          ),
+          packagingSpec: this.getValue(
+            basicInfo.packageSpec,
+            selected.packagingSpec
+          ),
+          productionDate: this.formatPrintDate(
+            this.getValue(basicInfo.productionDate, selected.productionDate)
+          ),
+          reportDate: this.formatPrintDate(
+            this.getValue(
+              basicInfo.reportDate,
+              basicInfo.createTime,
+              selected.reportDate
+            )
+          ),
+          validityPeriod: this.getValue(
+            basicInfo.validityPeriod,
+            selected.validityPeriod
+          ),
+          inspectionBasis: this.getValue(
+            basicInfo.inspectionBasis,
+            selected.inspectionBasis
+          ),
+          inspector: selected.reportTemplateCreateUserName || '',
+          reviewer: selected.reportApprovalUserName || '',
+          conclusion: selected.reportApprovalStatus === 2 ? '合格' : '',
+          inspectionItems: detailList.map((detail) => ({
+            inspectionItem: detail.inspectionItem || '',
+            standard: detail.standardRequirement || '',
+            result: detail.inspectionResult || ''
+          }))
         };
-        if (this.$refs[key]) {
-          this.$refs[key].open(data);
+      },
+      getSelectedReport(basicInfo = {}, index = 0) {
+        return (
+          this.selection.find((row) => {
+            return (
+              (this.hasValue(basicInfo.id) && row.id == basicInfo.id) ||
+              (this.hasValue(basicInfo.produceBatch) &&
+                row.batchNo == basicInfo.produceBatch)
+            );
+          }) ||
+          this.selection[index] ||
+          this.selection[0] ||
+          {}
+        );
+      },
+      hasValue(value) {
+        return value !== undefined && value !== null && value !== '';
+      },
+      getValue(...values) {
+        const value = values.find((item) => this.hasValue(item));
+        return value === undefined ? '' : value;
+      },
+      formatPrintDate(value) {
+        if (!this.hasValue(value)) {
+          return '';
+        }
+        if (typeof value === 'string') {
+          return value.slice(0, 10);
+        }
+        if (this.$util?.toDateString) {
+          return this.$util.toDateString(value, 'yyyy-MM-dd');
         }
+        return new Date(value).toISOString().slice(0, 10);
       }
     }
   };

+ 191 - 54
src/views/batchRecord/components/tables/qualityWorkOrderTable.vue

@@ -42,16 +42,11 @@
   import dictMixins from '@/mixins/dictMixins';
   import tableColumnsMixin from '@/mixins/tableColumnsMixin';
   import { batchRecordPage, queryPrint } from '@/api/qualityWorkOrder/index.js';
-  import { querySamplingPrint } from '@/api/samplingRecords/index.js';
   import exportButton from '@/components/upload/exportButton.vue';
   import printSelector from '../printSelector.vue';
   import productInspectionReport from '../../print/electrodeBatchRecord/productInspectionReport.vue';
   import samplingForm from '../../print/electrodeBatchRecord/samplingForm.vue';
   import finishedProductOriginalRecord from '../../print/electrodeBatchRecord/finishedProductOriginalRecord.vue';
-  import {
-    buildSamplingFormPrintData,
-    getSamplingPrintIds
-  } from '../../utils/samplingFormPrint';
 
   export default {
     mixins: [dictMixins, tableColumnsMixin],
@@ -275,22 +270,13 @@
           return;
         }
         try {
-          const ids =
-            key == 'samplingForm'
-              ? getSamplingPrintIds(this.selection)
-              : this.getPrintIds(key);
+          const ids = this.getPrintIds();
           if (!ids.length) {
             this.$message.warning('未获取到可打印数据的ID');
             return;
           }
-          const res =
-            key == 'samplingForm'
-              ? await querySamplingPrint(ids)
-              : await queryPrint({ ids, printType });
-          const data =
-            key == 'samplingForm'
-              ? buildSamplingFormPrintData(res, this.selection)
-              : this.buildPrintData(res, key);
+          const res = await queryPrint({ ids, printType });
+          const data = this.buildPrintData(res, key);
           if (!data) {
             this.$message.warning('未查询到可打印的质检工单数据');
             return;
@@ -304,57 +290,47 @@
       },
       buildPrintData(res, key) {
         const list = this.getPrintList(res, key);
-        const first = list[0];
-        if (!first) {
+        if (!list.length) {
           return null;
         }
-        const selected =
-          this.selection.find((item) => item.id == first.id) ||
-          this.selection[0] ||
-          {};
-        const date = this.formatPrintDate(
-          first.sampleDate ||
-            first.createTime ||
-            selected.qualityTime ||
-            selected.createTime
-        );
-        const base = this.buildPrintItem(first, selected);
 
         if (key == 'productInspectionReport') {
+          const first = list[0];
+          const selected = this.getSelectedItem(first, 0);
+          const base = this.buildPrintItem(first, selected);
           return {
             ...base,
             code: selected.code || first.workOrderCode || '',
-            date,
+            date: this.formatPrintDate(
+              this.getValue(
+                first.createTime,
+                selected.qualityTime,
+                selected.createTime
+              )
+            ),
             reporter: selected.qualityName || selected.createUserName || '',
             receiver: selected.reviewerName || selected.checkerName || '',
             department: selected.departmentName || selected.workshopName || '',
             items: list.map((item, index) =>
               this.buildPrintItem(
                 item,
-                this.selection.find((row) => row.id == item.id) || selected,
+                this.getSelectedItem(item, index),
                 index
               )
             )
           };
         }
 
-        return {
-          ...base,
-          date,
-          inspectionDate: date,
-          batchNo: first.produceBatch || first.batch || selected.batchNo || '',
-          submitQuantity:
-            first.quantityVerified ||
-            selected.submitQuantity ||
-            first.quantity ||
-            '',
-          sampleQuantity: first.quantity || selected.sampleQuantity || '',
-          inspectionBasis: selected.inspectionBasis || '',
-          inspector: selected.qualityName || selected.createUserName || '',
-          checker: selected.checkerName || selected.reviewerName || '',
-          conclusion: selected.status === 1 ? '合格' : '',
-          remark: selected.remark || ''
-        };
+        const data = list.map((item, index) => {
+          const selected = this.getSelectedItem(
+            item.basicInfo || item,
+            index
+          );
+          return key == 'samplingForm'
+            ? this.buildSamplingFormData(item, selected)
+            : this.buildFinishedProductRecordData(item, selected);
+        });
+        return data.length == 1 ? data[0] : data;
       },
       getPrintList(res, key) {
         const listMap = {
@@ -371,8 +347,159 @@
         }
         return [];
       },
-      getPrintIds(key) {
-        return this.selection.map((item) => item.id).filter(Boolean);
+      getPrintIds() {
+        return [
+          ...new Set(
+            this.selection
+              .map((item) => item.id)
+              .filter((id) => this.hasValue(id))
+          )
+        ];
+      },
+      getSelectedItem(item = {}, index = 0) {
+        return (
+          this.selection.find(
+            (row) =>
+              (this.hasValue(item.id) && row.id == item.id) ||
+              (this.hasValue(item.workOrderCode) &&
+                row.workOrderCode == item.workOrderCode) ||
+              (this.hasValue(item.produceBatch) &&
+                row.batchNo == item.produceBatch)
+          ) ||
+          this.selection[index] ||
+          this.selection[0] ||
+          {}
+        );
+      },
+      buildSamplingFormData(item, selected) {
+        return {
+          ...selected,
+          ...item,
+          productName: this.getValue(
+            item.materialName,
+            selected.productName,
+            selected.materialName,
+            selected.name
+          ),
+          specification: this.getValue(
+            item.specModel,
+            selected.specification,
+            selected.productModel
+          ),
+          batchNo: this.getValue(
+            item.produceBatch,
+            item.batch,
+            selected.batchNo
+          ),
+          sampleSource: this.getValue(
+            selected.sampleSource,
+            selected.sourceTypeDesc,
+            selected.sourceCode,
+            selected.workOrderCode
+          ),
+          sampleLocation: this.getValue(
+            selected.samplePlace,
+            selected.sampleLocation
+          ),
+          sampleDate: this.formatPrintDate(
+            this.getValue(
+              item.createTime,
+              selected.qualityTime,
+              selected.createTime
+            )
+          ),
+          batchQuantity: this.hasValue(item.batch)
+            ? item.batch
+            : this.buildQuantityText(item.quantityVerified, item.unit),
+          sampleQuantity: this.buildQuantityText(
+            this.getValue(item.quantity, selected.sampleQuantity),
+            item.unit
+          ),
+          sampler: this.getValue(
+            selected.sampleUserName,
+            selected.qualityName,
+            selected.createUserName
+          ),
+          checker: this.getValue(
+            selected.checkerName,
+            selected.reviewerName,
+            selected.approvalUserName
+          ),
+          remark: this.getValue(item.remark, selected.remark)
+        };
+      },
+      buildFinishedProductRecordData(item, selected) {
+        const basicInfo = item.basicInfo || {};
+        const detailList = Array.isArray(item.detailList)
+          ? item.detailList
+          : [];
+        const inspectionItems = detailList.map((detail) => ({
+          ...detail,
+          name: detail.inspectionItem || '',
+          standard: detail.standardRequirement || '',
+          result: detail.inspectionResult || '',
+          conclusion: ''
+        }));
+        return {
+          ...selected,
+          ...basicInfo,
+          productName: this.getValue(
+            basicInfo.productName,
+            selected.productName,
+            selected.name
+          ),
+          productCode: this.getValue(
+            selected.productCode,
+            selected.materialCode
+          ),
+          specification: this.getValue(
+            basicInfo.specModel,
+            selected.specification,
+            selected.productModel
+          ),
+          packageSpec: basicInfo.packageSpec || '',
+          batchNo: this.getValue(
+            basicInfo.produceBatch,
+            selected.batchNo
+          ),
+          sterilizationBatchNo: basicInfo.sterilizationBatch || '',
+          submitQuantity: this.getValue(
+            basicInfo.productQuantity,
+            selected.submitQuantity
+          ),
+          sampleQuantity: this.getValue(
+            basicInfo.samplingQuantity,
+            selected.sampleQuantity
+          ),
+          inspectionBasis: this.getValue(
+            basicInfo.inspectionBasis,
+            selected.inspectionBasis
+          ),
+          inspectionDate: this.formatPrintDate(
+            this.getValue(
+              basicInfo.reportDate,
+              basicInfo.productionDate,
+              basicInfo.createTime,
+              selected.qualityTime
+            )
+          ),
+          appearanceItems: inspectionItems,
+          performanceItems: [],
+          packagingItems: [],
+          conclusion: this.getValue(
+            selected.conclusion,
+            selected.inspectionResult
+          ),
+          inspector: this.getValue(
+            selected.qualityName,
+            selected.createUserName
+          ),
+          checker: this.getValue(
+            selected.checkerName,
+            selected.reviewerName
+          ),
+          remark: selected.remark || ''
+        };
       },
       buildPrintItem(item, selected = {}, index = 0) {
         return {
@@ -397,7 +524,7 @@
           productionBatchNo: item.produceBatch || selected.batchNo || '',
           batchNo: item.produceBatch || item.batch || selected.batchNo || '',
           unit: item.unit || selected.unit || '',
-          quantity: item.quantity || selected.quantity || '',
+          quantity: this.getValue(item.quantity, selected.quantity),
           processOrderCode:
             item.workOrderCode ||
             selected.workOrderCode ||
@@ -407,13 +534,23 @@
         };
       },
       buildQuantityText(quantity, unit) {
-        if (quantity === undefined || quantity === null || quantity === '') {
+        if (!this.hasValue(quantity)) {
           return '';
         }
         return `${quantity}${unit || ''}`;
       },
+      hasValue(value) {
+        return value !== undefined && value !== null && value !== '';
+      },
+      getValue(...values) {
+        const value = values.find((item) => this.hasValue(item));
+        return value === undefined ? '' : value;
+      },
       formatPrintDate(value) {
-        const source = value || new Date();
+        if (!this.hasValue(value)) {
+          return '';
+        }
+        const source = value;
         if (typeof source == 'string') {
           return source.slice(0, 10);
         }

+ 23 - 7
src/views/batchRecord/print/electrodeBatchRecord/finishedProductOriginalRecord.vue

@@ -1,7 +1,12 @@
 <template>
   <ele-modal title="一次性射频消融电极成品检验原始记录 054-7" :visible.sync="visible" v-if="visible" width="70%" :maxable="true">
     <div id="printSection_finishedProductOriginalRecord">
-      <div style="font-family: 'SimSun', serif; padding: 20px; background: #fff; font-size: 12px;">
+      <div
+        v-for="(form, formIndex) in formList"
+        :key="formIndex"
+        class="finished-product-record-page"
+        style="font-family: 'SimSun', serif; padding: 20px; background: #fff; font-size: 12px;"
+      >
         <div style="text-align: center; font-size: 20px; font-weight: bold; margin-bottom: 5px;">一次性射频消融电极成品检验原始记录</div>
         <div style="text-align: center; font-size: 13px; margin-bottom: 10px;">编号:054-7</div>
         <table style="width: 100%; border-collapse: collapse;">
@@ -146,15 +151,26 @@
     data() {
       return {
         visible: false,
-        form: {}
+        form: {},
+        formList: []
       };
     },
     methods: {
       open(data) {
-        this.form = data || {};
-        if (!this.form.appearanceItems) this.form.appearanceItems = [];
-        if (!this.form.performanceItems) this.form.performanceItems = [];
-        if (!this.form.packagingItems) this.form.packagingItems = [];
+        const list = Array.isArray(data) ? data : data ? [data] : [];
+        this.formList = list.map((item) => ({
+          ...item,
+          appearanceItems: Array.isArray(item.appearanceItems)
+            ? item.appearanceItems
+            : [],
+          performanceItems: Array.isArray(item.performanceItems)
+            ? item.performanceItems
+            : [],
+          packagingItems: Array.isArray(item.packagingItems)
+            ? item.packagingItems
+            : []
+        }));
+        this.form = this.formList[0] || {};
         this.visible = true;
       },
       print() {
@@ -162,7 +178,7 @@
         const win = window.open('', '_blank');
         win.document.open();
         win.document.write('<html><head><title>成品检验原始记录</title>');
-        win.document.write('<style>body{margin:0;padding:20px;} table{border-collapse:collapse;width:100%;} td,th{border:1px solid #000;padding:6px;}</style>');
+        win.document.write('<style>body{margin:0;padding:20px;} table{border-collapse:collapse;width:100%;} td,th{border:1px solid #000;padding:6px;} .finished-product-record-page + .finished-product-record-page{page-break-before:always;}</style>');
         win.document.write('</head><body>');
         win.document.write(el.innerHTML);
         win.document.write('</body></html>');

+ 83 - 31
src/views/batchRecord/print/electrodeBatchRecord/finishedProductReport.vue

@@ -1,12 +1,24 @@
 <template>
-  <ele-modal title="成品检验报告 ZL-055" :visible.sync="visible" v-if="visible" width="70%" :maxable="true">
+  <ele-modal
+    title="成品检验报告 ZL-055"
+    :visible.sync="visible"
+    v-if="visible"
+    width="70%"
+    :maxable="true"
+  >
     <div id="printSection_finishedProductReport">
-      <div class="report-container">
+      <div
+        v-for="(form, formIndex) in formList"
+        :key="formIndex"
+        class="report-container"
+      >
         <div class="report-header">
           <div class="header-left">
             <img src="" alt="特瑞精密医疗" class="logo" />
           </div>
-          <div class="header-center">湖 南 特 瑞 精 密 医 疗 器 械 有 限 公 司</div>
+          <div class="header-center"
+            >湖 南 特 瑞 精 密 医 疗 器 械 有 限 公 司</div
+          >
         </div>
         <div class="report-title">成品检验报告</div>
         <div class="report-info-row">
@@ -52,18 +64,21 @@
         <table class="main-table">
           <thead>
             <tr>
-              <th style="width:15%;">检验项目</th>
+              <th style="width: 15%">检验项目</th>
               <th>标准要求</th>
-              <th style="width:20%;">检验结果</th>
+              <th style="width: 20%">检验结果</th>
             </tr>
           </thead>
           <tbody>
-            <tr v-for="(item, idx) in tableData" :key="idx">
+            <tr v-for="(item, idx) in form.inspectionItems" :key="idx">
               <td>{{ item.inspectionItem }}</td>
               <td>{{ item.standard }}</td>
               <td>{{ item.result }}</td>
             </tr>
-            <tr v-for="n in emptyRows" :key="'empty_' + n">
+            <tr
+              v-for="n in getEmptyRows(form.inspectionItems)"
+              :key="'empty_' + n"
+            >
               <td>&nbsp;</td>
               <td></td>
               <td></td>
@@ -95,51 +110,88 @@
       return {
         visible: false,
         form: {},
-        tableData: []
+        formList: []
       };
     },
-    computed: {
-      emptyRows() {
+    methods: {
+      getEmptyRows(items) {
         const min = 16;
-        const current = this.tableData.length;
+        const current = Array.isArray(items) ? items.length : 0;
         return current >= min ? 0 : min - current;
-      }
-    },
-    methods: {
+      },
       open(data) {
-        this.form = data || {};
-        this.tableData = (data && data.inspectionItems) || [];
+        const list = Array.isArray(data) ? data : data ? [data] : [];
+        this.formList = list.map((item) => ({
+          ...item,
+          inspectionItems: Array.isArray(item.inspectionItems)
+            ? item.inspectionItems
+            : []
+        }));
+        this.form = this.formList[0] || {};
         this.visible = true;
       },
       print() {
-        const el = document.getElementById('printSection_finishedProductReport');
+        const el = document.getElementById(
+          'printSection_finishedProductReport'
+        );
         const win = window.open('', '_blank');
         win.document.open();
         win.document.write('<html><head><title>成品检验报告</title>');
         win.document.write('<style>');
-        win.document.write('body{margin:0;padding:20px;font-family:SimSun,serif;font-size:12px;}');
+        win.document.write(
+          'body{margin:0;padding:20px;font-family:SimSun,serif;font-size:12px;}'
+        );
         win.document.write('.report-container{padding:20px;background:#fff;}');
-        win.document.write('.report-header{display:flex;align-items:center;justify-content:center;position:relative;margin-bottom:5px;}');
-        win.document.write('.header-center{font-size:22px;letter-spacing:4px;}');
-        win.document.write('.report-title{text-align:center;font-size:18px;font-weight:bold;margin-bottom:5px;}');
-        win.document.write('.report-info-row{display:flex;justify-content:space-between;margin-bottom:5px;font-size:12px;}');
-        win.document.write('.info-table{width:100%;border-collapse:collapse;margin-bottom:0;}');
-        win.document.write('.info-table td{border:1px solid #000;padding:5px 8px;font-size:12px;}');
-        win.document.write('.info-table .label-cell{width:12%;text-align:center;}');
+        win.document.write(
+          '.report-container + .report-container{page-break-before:always;}'
+        );
+        win.document.write(
+          '.report-header{display:flex;align-items:center;justify-content:center;position:relative;margin-bottom:5px;}'
+        );
+        win.document.write(
+          '.header-center{font-size:22px;letter-spacing:4px;}'
+        );
+        win.document.write(
+          '.report-title{text-align:center;font-size:18px;font-weight:bold;margin-bottom:5px;}'
+        );
+        win.document.write(
+          '.report-info-row{display:flex;justify-content:space-between;margin-bottom:5px;font-size:12px;}'
+        );
+        win.document.write(
+          '.info-table{width:100%;border-collapse:collapse;margin-bottom:0;}'
+        );
+        win.document.write(
+          '.info-table td{border:1px solid #000;padding:5px 8px;font-size:12px;}'
+        );
+        win.document.write(
+          '.info-table .label-cell{width:12%;text-align:center;}'
+        );
         win.document.write('.info-table .value-cell{width:38%;}');
-        win.document.write('.main-table{width:100%;border-collapse:collapse;margin-top:-1px;}');
-        win.document.write('.main-table th,.main-table td{border:1px solid #000;padding:5px 8px;font-size:12px;text-align:left;vertical-align:middle;}');
-        win.document.write('.main-table th{text-align:center;font-weight:bold;}');
-        win.document.write('.conclusion-section{margin-top:15px;font-size:12px;}');
+        win.document.write(
+          '.main-table{width:100%;border-collapse:collapse;margin-top:-1px;}'
+        );
+        win.document.write(
+          '.main-table th,.main-table td{border:1px solid #000;padding:5px 8px;font-size:12px;text-align:left;vertical-align:middle;}'
+        );
+        win.document.write(
+          '.main-table th{text-align:center;font-weight:bold;}'
+        );
+        win.document.write(
+          '.conclusion-section{margin-top:15px;font-size:12px;}'
+        );
         win.document.write('.conclusion-title{font-weight:bold;}');
         win.document.write('.conclusion-content{min-height:20px;}');
-        win.document.write('.report-footer{margin-top:20px;display:flex;justify-content:space-between;font-size:12px;}');
+        win.document.write(
+          '.report-footer{margin-top:20px;display:flex;justify-content:space-between;font-size:12px;}'
+        );
         win.document.write('</style>');
         win.document.write('</head><body>');
         win.document.write(el.innerHTML);
         win.document.write('</body></html>');
         win.document.close();
-        win.onload = function() { win.print(); };
+        win.onload = function () {
+          win.print();
+        };
       }
     }
   };

+ 2 - 2
vue.config.js

@@ -32,7 +32,7 @@ module.exports = {
       // 当我们的本地的请求 有/api的时候,就会代理我们的请求地址向另外一个服务器发出请求
       '/api': {
         // target: 'http://124.71.68.31:50001',
-        // target: 'http://192.168.1.125:18086',
+        target: 'http://192.168.1.125:18086',
         // target: 'http://192.168.1.251:18086',
         // target: 'http://192.168.1.251:18186',
         // target: 'http://192.168.1.251:18086', // 开发环境
@@ -42,7 +42,7 @@ module.exports = {
         // target: 'http://192.168.1.211:18086',
         // target: 'http://192.168.1.33:18086',
         // target: 'http://192.168.1.116:18086',
-        target: 'http://192.168.1.19:18086',
+        // target: 'http://192.168.1.19:18086',
         // target: 'http://192.168.1.251:18186', // 测试环境
         // target: 'http://192.168.1.251:18087',
         // target: 'http://116.163.22.90:86/api', // 嘉实生产