695593266@qq.com 6 giorni fa
parent
commit
eb2a6c0d15

+ 21 - 1
src/views/batchRecord/components/tables/batchRecordTable.vue

@@ -403,8 +403,20 @@
           return {
             ...base,
             batchNo: first.produceBatch || base.batchNo,
+            productName: first.productName || base.productName,
             productionDate: this.formatPrintDate(first.productionDate),
-            specification: first.modelSpec || first.specification || ''
+            specification: this.buildSpecificationModel(
+              first.modelSpec ||
+                first.specModel ||
+                first.specification ||
+                base.specification,
+              first.productModel ||
+                first.modelType ||
+                first.model ||
+                fallback.productModel ||
+                fallback.modelType ||
+                fallback.model
+            )
           };
         }
 
@@ -498,6 +510,14 @@
       uniqueList(list) {
         return [...new Set((list || []).filter(Boolean))];
       },
+      buildSpecificationModel(specification, model) {
+        const specificationText = String(specification || '').trim();
+        const modelText = String(model || '').trim();
+        if (!modelText || specificationText.includes(modelText)) {
+          return specificationText;
+        }
+        return [specificationText, modelText].filter(Boolean).join('/');
+      },
       formatPrintDate(value) {
         if (!value) {
           return '';

+ 1 - 1
src/views/batchRecord/components/tables/materialTable.vue

@@ -299,7 +299,7 @@
           processOrderCode: r.joinWorkOrderCode || r.workOrderCode || '',
           processOrderNo: r.joinWorkOrderCode || r.workOrderCode || '',
           moCode: r.joinWorkOrderCode || r.workOrderCode || '',
-          department: r.joinWarehouseName || r.warehouseName || '生产部',
+          department: r.executorDeptName || '',
           workshop: r.joinWarehouseName || r.warehouseName || '',
           applicant: r.executorName || r.createUserName || '',
           handler: r.executorName || r.createUserName || '',

+ 58 - 6
src/views/batchRecord/components/tables/qualityReportApproval.vue

@@ -348,9 +348,22 @@
       buildFinishedProductReportData(item = {}, index = 0) {
         const basicInfo = item.basicInfo || {};
         const selected = this.getSelectedReport(basicInfo, index);
+        const reportTemplate = this.getReportTemplateData(item, selected);
+        const templateBasicInfo = reportTemplate.basicInfoData;
         const detailList = Array.isArray(item.detailList)
           ? item.detailList
           : [];
+        const inspectionItems = reportTemplate.inspectionItems.length
+          ? reportTemplate.inspectionItems.map((detail) => ({
+              inspectionItem: detail.item || '',
+              standard: detail.standardRegulations || '',
+              result: detail.results || ''
+            }))
+          : detailList.map((detail) => ({
+              inspectionItem: detail.inspectionItem || '',
+              standard: detail.standardRequirement || '',
+              result: detail.inspectionResult || ''
+            }));
         return {
           ...selected,
           ...basicInfo,
@@ -361,6 +374,10 @@
             selected.productName
           ),
           specification: this.getValue(
+            this.buildSpecification(
+              templateBasicInfo.specification,
+              templateBasicInfo.modelType
+            ),
             basicInfo.specModel,
             selected.specification
           ),
@@ -383,6 +400,7 @@
             selected.sampleQuantity
           ),
           packagingSpec: this.getValue(
+            templateBasicInfo.packingSpecification,
             basicInfo.packageSpec,
             selected.packagingSpec
           ),
@@ -401,19 +419,53 @@
             selected.validityPeriod
           ),
           inspectionBasis: this.getValue(
+            templateBasicInfo.inspectionBasis,
             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 || ''
-          }))
+          conclusion: this.getValue(
+            templateBasicInfo.conclusion,
+            selected.reportApprovalStatus === 2 ? '合格' : ''
+          ),
+          inspectionItems
         };
       },
+      getReportTemplateData(item = {}, selected = {}) {
+        const reportTemplateJson = this.parseReportTemplateJson(
+          this.getValue(item.reportTemplateJson, selected.reportTemplateJson)
+        );
+        const basicInfoData =
+          reportTemplateJson.basicInfoData || reportTemplateJson;
+        let inspectionItems = reportTemplateJson.inspectionItems;
+        if (!Array.isArray(inspectionItems)) {
+          inspectionItems = Array.isArray(reportTemplateJson.items)
+            ? reportTemplateJson.items
+            : this.hasValue(reportTemplateJson.item)
+            ? [reportTemplateJson]
+            : [];
+        }
+        return { basicInfoData, inspectionItems };
+      },
+      parseReportTemplateJson(value) {
+        if (!value) {
+          return {};
+        }
+        if (typeof value === 'object') {
+          return value;
+        }
+        try {
+          return JSON.parse(value);
+        } catch (error) {
+          return {};
+        }
+      },
+      buildSpecification(specification, modelType) {
+        return [specification, modelType]
+          .filter((value) => this.hasValue(value))
+          .join('/');
+      },
       getPrintRows() {
         return this.selection.length ? this.selection : this.tableData;
       },

+ 1 - 1
src/views/batchRecord/components/tables/qualityWorkOrderTable.vue

@@ -409,7 +409,7 @@
             ? item.batch
             : this.buildQuantityText(item.quantityVerified, item.unit),
           sampleQuantity: this.buildQuantityText(
-            this.getValue(item.quantity, selected.sampleQuantity),
+            this.getValue(item.sampleQuantity, selected.sampleQuantity),
             item.unit
           ),
           sampler: this.getValue(

+ 19 - 3
src/views/batchRecord/components/tables/wmsOutInt.vue

@@ -276,7 +276,12 @@
           ...item,
           itemCode: item.code || '',
           itemName: item.name || '',
+          modelType: item.modelType || '',
           specification: item.specification || '',
+          specificationModel: this.joinPrintValues([
+            item.specification,
+            item.modelType
+          ]),
           batchNo: item.batchNo || '',
           productionDate: this.formatPrintDate(item.productionDate),
           expiryDate: this.formatPrintDate(item.expirationDate),
@@ -291,13 +296,16 @@
           batchNo: this.tableQuery.batchNo,
           productCode: this.tableQuery.productCode,
           productName: r.productName || firstItem.name || '',
-          specification: r.specification || firstItem.specification || '',
+          specification: this.joinPrintValues([
+            firstItem.specification,
+            firstItem.modelType
+          ]),
           code: r.bizNo || '',
           date:
             this.formatPrintDate(r.storageTime || firstItem.createTime) ||
             today,
           warehouse: r.warehouseName || '',
-          department: r.warehouseName || '',
+          department: firstItem.groupName || r.groupName || '',
           processOrderCode: r.sourceBizNo || '',
           processOrderNo: r.sourceBizNo || '',
           moCode: r.sourceBizNo || '',
@@ -305,7 +313,8 @@
           receiver: r.createUserName || '',
           reporter: r.createUserName || '',
           creator: r.createUserName || '',
-          reviewer: r.reviewerName || '',
+          reviewer:
+            firstItem.verifyName || r.verifyName || r.reviewerName || '',
           totalQuantity: this.getTotalQuantity(itemList),
           remark: r.remark || firstItem.remark || '',
           itemList
@@ -322,6 +331,13 @@
           ? this.$util.toDateString(value, 'yyyy-MM-dd')
           : '';
       },
+      joinPrintValues(values) {
+        return values
+          .filter(
+            (value, index, list) => value && list.indexOf(value) === index
+          )
+          .join('/');
+      },
       getTotalQuantity(list) {
         const total = list.reduce((sum, item) => {
           const quantity = Number(item.quantity);

+ 6 - 2
src/views/batchRecord/components/tables/workOrderTable.vue

@@ -218,7 +218,7 @@
             label: '物料平衡表',
             code: 'SC-041',
             component: 'materialBalance'
-          },
+          }
           // {
           //   key: 'productReleaseApproval',
           //   label: '成品放行审批单',
@@ -499,7 +499,11 @@
           remark: row.remark || fallback.remark || '',
           materialRemark: row.remark || fallback.remark || '',
           packagingRequirement:
-            fallback.packagingRequirement || '按工艺要求执行',
+            row.packageRequirements ||
+            row.packagingRequirement ||
+            fallback.packageRequirements ||
+            fallback.packagingRequirement ||
+            '',
           materialList: fallback.materialList || []
         };
       },

+ 1 - 1
src/views/batchRecord/print/electrodeBatchRecord/finishedProductWarehouse.vue

@@ -37,7 +37,7 @@
               <td>{{ idx + 1 }}</td>
               <td>{{ item.itemCode }}</td>
               <td>{{ item.itemName }}</td>
-              <td>{{ item.specification }}</td>
+              <td>{{ item.specificationModel }}</td>
               <td>{{ item.batchNo }}</td>
               <td>{{ item.productionDate }}</td>
               <td>{{ item.expiryDate }}</td>

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

@@ -1,5 +1,5 @@
 <template>
-  <ele-modal title="一次性射频消融电极过程检验记录" :visible.sync="visible" v-if="visible" width="90%" :maxable="true">
+  <ele-modal :title="`${form.productName || ''}过程检验记录`" :visible.sync="visible" v-if="visible" width="90%" :maxable="true">
     <div id="printSection_processInspectionRecord">
       <div class="report-container">
         <div class="report-header">
@@ -8,7 +8,7 @@
           </div>
           <div class="header-center">湖 南 特 瑞 精 密 医 疗 器 械 有 限 公 司</div>
         </div>
-        <div class="report-title">一次性射频消融电极_生产过程检验记录(Ver1.0)</div>
+        <div class="report-title">{{ form.productName }}_生产过程检验记录(Ver1.0)</div>
         <div class="form-code">表单编号:TR.D-105/ZL &nbsp; 版本:A/0</div>
         <table class="info-table">
           <tr>