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

+ 9 - 0
src/api/samplingRecords/index.js

@@ -44,3 +44,12 @@ export async function listCancel(data) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+// 取样单打印查询
+export async function querySamplingPrint(ids) {
+  const res = await request.post(`/qms/samplingrecord/queryPrint`, ids);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 61 - 10
src/views/batchRecord/components/tables/qualityWorkOrderTable.vue

@@ -42,6 +42,7 @@
   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';
@@ -270,8 +271,15 @@
           return;
         }
         try {
-          const ids = this.selection.map((item) => item.id).filter(Boolean);
-          const res = await queryPrint({ ids, printType });
+          const ids = this.getPrintIds(key);
+          if (!ids.length) {
+            this.$message.warning('未获取到可打印数据的ID');
+            return;
+          }
+          const res =
+            key == 'samplingForm'
+              ? await querySamplingPrint(ids)
+              : await queryPrint({ ids, printType });
           const data = this.buildPrintData(res, key);
           if (!data) {
             this.$message.warning('未查询到可打印的质检工单数据');
@@ -295,7 +303,10 @@
           this.selection[0] ||
           {};
         const date = this.formatPrintDate(
-          first.createTime || selected.qualityTime || selected.createTime
+          first.sampleDate ||
+            first.createTime ||
+            selected.qualityTime ||
+            selected.createTime
         );
         const base = this.buildPrintItem(first, selected);
 
@@ -323,11 +334,21 @@
             date,
             sampleDate: date,
             batchNo:
-              first.produceBatch || first.batch || selected.batchNo || '',
-            batchQuantity: first.batch || first.quantity || '',
-            sampleQuantity: first.quantity || selected.sampleQuantity || '',
-            sampleLocation: selected.sampleLocation || '',
-            sampleSource: selected.sampleSource || '',
+              first.batchNo ||
+              first.produceBatch ||
+              first.batch ||
+              selected.batchNo ||
+              '',
+            batchQuantity: this.buildQuantityText(
+              first.batchQuantity || first.batch || first.quantity,
+              first.batchUnit
+            ),
+            sampleQuantity: this.buildQuantityText(
+              first.sampleQuantity || first.quantity || selected.sampleQuantity,
+              first.sampleUnit
+            ),
+            sampleLocation: first.samplePlace || selected.sampleLocation || '',
+            sampleSource: first.sourceTypeDesc || selected.sampleSource || '',
             sampler: selected.qualityName || selected.createUserName || '',
             checker: selected.checkerName || selected.reviewerName || ''
           };
@@ -366,16 +387,40 @@
         }
         return [];
       },
+      getPrintIds(key) {
+        return this.selection
+          .map((item) => {
+            if (key == 'samplingForm') {
+              return (
+                item.samplingRecordId ||
+                item.samplingrecordId ||
+                item.sampleRecordId ||
+                item.sampleId ||
+                item.id
+              );
+            }
+            return item.id;
+          })
+          .filter(Boolean);
+      },
       buildPrintItem(item, selected = {}, index = 0) {
         return {
           ...item,
           seq: index + 1,
           productCode: item.materialCode || selected.productCode || '',
           productName:
-            item.materialName || selected.productName || selected.name || '',
+            item.productName ||
+            item.materialName ||
+            selected.productName ||
+            selected.name ||
+            '',
           materialCode: item.materialCode || '',
           materialName: item.materialName || '',
-          specification: item.specModel || selected.specification || '',
+          specification:
+            [item.specification, item.modelType].filter(Boolean).join('/') ||
+            item.specModel ||
+            selected.specification ||
+            '',
           sterilizationBatchNo:
             item.sterilizationBatch || selected.sterilizationBatchNo || '',
           productionBatchNo: item.produceBatch || selected.batchNo || '',
@@ -390,6 +435,12 @@
           inspectionCode: selected.code || ''
         };
       },
+      buildQuantityText(quantity, unit) {
+        if (quantity === undefined || quantity === null || quantity === '') {
+          return '';
+        }
+        return `${quantity}${unit || ''}`;
+      },
       formatPrintDate(value) {
         const source = value || new Date();
         if (typeof source == 'string') {

+ 33 - 60
src/views/batchRecord/print/electrodeBatchRecord/unqualifiedProductReview.vue

@@ -23,7 +23,7 @@
             </div>
             <div>
               <div class="logo-cn">特瑞精密医疗</div>
-              <div class="logo-en">Triple Precision Medical</div>
+              <div class="logo-en">Triplex Precision Medical</div>
             </div>
           </div>
           <div class="uqr-company">湖南特瑞精密医疗器械有限公司</div>
@@ -169,7 +169,7 @@
             </div>
             <div>
               <div class="logo-cn">特瑞精密医疗</div>
-              <div class="logo-en">Triple Precision Medical</div>
+              <div class="logo-en">Triplex Precision Medical</div>
             </div>
           </div>
           <div class="uqr-company">湖南特瑞精密医疗器械有限公司</div>
@@ -353,10 +353,10 @@
         return `
           @page{size:A4;margin:0;}
           body{margin:0;background:#fff;font-family:SimSun,serif;color:#000;}
-          .uqr-page{width:210mm;height:297mm;margin:0 auto;padding:12mm 18mm 10mm;box-sizing:border-box;position:relative;page-break-after:always;background:#fff;font-size:14px;}
+          .uqr-page{width:210mm;height:297mm;margin:0 auto;padding:12mm 17.5mm 10mm;box-sizing:border-box;position:relative;page-break-after:always;background:#fff;font-size:14px;}
           .uqr-page:last-child{page-break-after:auto;}
           .uqr-header{height:27mm;display:flex;align-items:flex-start;justify-content:center;position:relative;padding-top:3.5mm;}
-          .uqr-logo{position:absolute;left:6mm;top:3mm;display:flex;align-items:center;color:#9a9a9a;font-family:Arial,'Microsoft YaHei',sans-serif;opacity:.7;transform:scale(.88);transform-origin:left top;}
+          .uqr-logo{position:absolute;left:0;top:1mm;display:flex;align-items:center;color:#8b8b8b;font-family:Arial,'Microsoft YaHei',sans-serif;transform:scale(.95);transform-origin:left top;}
           .logo-mark{width:22px;height:24px;margin-right:6px;position:relative;}
           .logo-mark span{position:absolute;display:block;border-radius:2px;background:#86b958;}
           .logo-mark span:nth-child(1){width:6px;height:18px;left:6px;top:0;transform:rotate(20deg);}
@@ -365,7 +365,7 @@
           .logo-cn{font-size:10px;font-weight:bold;line-height:1.2;}
           .logo-en{font-size:5px;line-height:1.2;}
           .uqr-company{font-size:15px;letter-spacing:8px;margin-top:3.5mm;}
-          .uqr-title{text-align:center;font-size:20px;font-weight:bold;margin-top:-12.5mm;margin-bottom:5.5mm;color:#666;}
+          .uqr-title{text-align:center;font-size:20px;font-weight:bold;margin-top:-12.5mm;margin-bottom:5.5mm;color:#000;}
           .uqr-meta{text-align:right;font-size:12px;margin-top:-5.5mm;margin-bottom:1mm;}
           .uqr-table{width:100%;border-collapse:collapse;table-layout:fixed;}
           .uqr-table+.uqr-table{margin-top:-1px;}
@@ -382,23 +382,23 @@
           .info-row td{height:54px;text-align:center;vertical-align:middle;}
           .source-cell{text-align:left!important;line-height:1.5!important;}
           .source-cell span{display:inline-block;}
-          .large-cell{height:342px;}
-          .write-area{min-height:146px;white-space:pre-wrap;}
-          .write-area.small{min-height:64px;}
+          .large-cell{height:282px;}
+          .write-area{min-height:106px;white-space:pre-wrap;}
+          .write-area.small{min-height:48px;}
           .suggestion{margin-top:2px;}
           .signature-row{display:flex;justify-content:space-between;margin-top:14px;}
-          .confirm-cell{height:104px;}
-          .confirm-sign{text-align:center;margin-top:50px;}
+          .confirm-cell{height:82px;}
+          .confirm-sign{text-align:center;margin-top:34px;}
           .review-head td{text-align:center;vertical-align:middle;}
           .review-label{text-align:center!important;vertical-align:middle!important;font-size:15px;}
-          .review-row td{height:40px;}
+          .review-row td{height:35px;}
           .page-number{position:absolute;bottom:10mm;left:0;right:0;text-align:center;color:#666;font-size:12px;}
-          .crop{position:absolute;width:8mm;height:8mm;}
+          .crop{display:none;}
           .crop-tl{left:13mm;top:13mm;border-left:1px solid #999;border-bottom:1px solid #999;}
           .crop-tr{right:13mm;top:13mm;border-right:1px solid #999;border-bottom:1px solid #999;}
           .crop-bl{left:13mm;bottom:13mm;border-left:1px solid #999;border-top:1px solid #999;}
           .crop-br{right:13mm;bottom:13mm;border-right:1px solid #999;border-top:1px solid #999;}
-          .approval-cell{height:204px;}
+          .approval-cell{height:54mm;}
           .bold{font-weight:bold;}
           .approval-options{margin:10px 0;}
           .approval-line{width:130px;margin-left:5px;}
@@ -406,13 +406,13 @@
           .indent-line{padding-left:14px;}
           .approval-sign{margin-top:34px;text-align:left;padding-left:20px;}
           .gm-options{text-align:center;margin:20px 0 54px;}
-          .record-cell{height:516px;font-size:14px;}
-          .record-cell div{margin-bottom:14px;}
+          .record-cell{height:134mm;font-size:14px;}
+          .record-cell div{margin-bottom:18px;}
           .form-line{width:160px;margin:0 5px;}
           .form-line.wide{width:220px;}
           .form-line.full{width:560px;}
           .form-line.short{width:160px;}
-          .bottom-sign-row td{height:72px;vertical-align:top;}
+          .bottom-sign-row td{height:22mm;vertical-align:top;}
           .uqr-note{font-size:12px;margin-top:4px;}
         `;
       }
@@ -425,7 +425,7 @@
     width: 210mm;
     height: 297mm;
     margin: 0 auto 18px;
-    padding: 12mm 18mm 10mm;
+    padding: 12mm 17.5mm 10mm;
     box-sizing: border-box;
     position: relative;
     page-break-after: always;
@@ -448,14 +448,13 @@
   }
   .uqr-logo {
     position: absolute;
-    left: 6mm;
-    top: 3mm;
+    left: 0;
+    top: 1mm;
     display: flex;
     align-items: center;
-    color: #9a9a9a;
+    color: #8b8b8b;
     font-family: Arial, 'Microsoft YaHei', sans-serif;
-    opacity: 0.7;
-    transform: scale(0.88);
+    transform: scale(0.95);
     transform-origin: left top;
   }
   .logo-mark {
@@ -513,7 +512,7 @@
     font-weight: bold;
     margin-top: -12.5mm;
     margin-bottom: 5.5mm;
-    color: #666;
+    color: #000;
   }
   .uqr-meta {
     text-align: right;
@@ -591,14 +590,14 @@
     display: inline-block;
   }
   .large-cell {
-    height: 342px;
+    height: 282px;
   }
   .write-area {
-    min-height: 146px;
+    min-height: 106px;
     white-space: pre-wrap;
   }
   .write-area.small {
-    min-height: 64px;
+    min-height: 48px;
   }
   .suggestion {
     margin-top: 2px;
@@ -609,11 +608,11 @@
     margin-top: 14px;
   }
   .confirm-cell {
-    height: 104px;
+    height: 82px;
   }
   .confirm-sign {
     text-align: center;
-    margin-top: 50px;
+    margin-top: 34px;
   }
   .review-head td {
     text-align: center;
@@ -625,7 +624,7 @@
     font-size: 15px;
   }
   .review-row td {
-    height: 40px;
+    height: 35px;
   }
   .page-number {
     position: absolute;
@@ -637,36 +636,10 @@
     font-size: 12px;
   }
   .crop {
-    position: absolute;
-    width: 8mm;
-    height: 8mm;
-  }
-  .crop-tl {
-    left: 13mm;
-    top: 13mm;
-    border-left: 1px solid #999;
-    border-bottom: 1px solid #999;
-  }
-  .crop-tr {
-    right: 13mm;
-    top: 13mm;
-    border-right: 1px solid #999;
-    border-bottom: 1px solid #999;
-  }
-  .crop-bl {
-    left: 13mm;
-    bottom: 13mm;
-    border-left: 1px solid #999;
-    border-top: 1px solid #999;
-  }
-  .crop-br {
-    right: 13mm;
-    bottom: 13mm;
-    border-right: 1px solid #999;
-    border-top: 1px solid #999;
+    display: none;
   }
   .approval-cell {
-    height: 204px;
+    height: 54mm;
   }
   .bold {
     font-weight: bold;
@@ -694,11 +667,11 @@
     margin: 20px 0 54px;
   }
   .record-cell {
-    height: 516px;
+    height: 134mm;
     font-size: 14px;
   }
   .record-cell div {
-    margin-bottom: 14px;
+    margin-bottom: 18px;
   }
   .form-line {
     width: 160px;
@@ -714,7 +687,7 @@
     width: 160px;
   }
   .bottom-sign-row td {
-    height: 72px;
+    height: 22mm;
     vertical-align: top;
   }
   .uqr-note {

+ 14 - 7
src/views/produce/components/workPlan/index.vue

@@ -102,6 +102,7 @@
               :underline="false"
               @click="addSampleOpen(row)"
               v-if="
+                $hasPermission('mes:samplingrecord:save') &&
                 ![1, 2].includes(row.status) &&
                 row.sampleQuantity < row.total &&
                 row.isPendingSample != 1
@@ -118,7 +119,11 @@
             <el-link
               type="primary"
               :underline="false"
-              v-if="row.status == 0 && row.isPendingSample != 1"
+              v-if="
+                row.status == 0 &&
+                $hasPermission('mes:quality_work_order:update') &&
+                row.isPendingSample != 1
+              "
               @click="openEdit('edit', row)"
               >报工</el-link
             >
@@ -126,7 +131,10 @@
             <el-link
               type="primary"
               :underline="false"
-              v-if="row.status == 0"
+              v-if="
+                row.status == 0 &&
+                $hasPermission('mes:quality_work_order:transfer')
+              "
               @click="openTransfer(row.id)"
               >转派</el-link
             >
@@ -141,7 +149,6 @@
               :businessId="row.id"
               businessCode="qmsqualityinspectionprint"
             ></jimureportBrowse>
-
             <el-dropdown
               trigger="click"
               v-if="
@@ -149,10 +156,10 @@
                 isReportApproval == 1 &&
                 (!row.reportApprovalStatus || row.reportApprovalStatus == 0) &&
                 isEmptyObject(row.reportTemplateJson) &&
-                $hasPermission('qms:quality_work_order:generateReport')
+                $hasPermission('mes:quality_work_order:generateReport')
               "
             >
-              <el-link type="primary" :underline="false">生成检测报告</el-link>
+              <el-link type="danger" :underline="false">生成检测报告</el-link>
               <el-dropdown-menu slot="dropdown">
                 <el-dropdown-item
                   v-for="item in reportTemplateList"
@@ -176,7 +183,7 @@
                 isReportApproval == 1 &&
                 row.reportApprovalStatus &&
                 !isEmptyObject(row.reportTemplateJson) &&
-                $hasPermission('qms:quality_work_order:generateReport')
+                $hasPermission('mes:quality_work_order:generateReport')
               "
               type="primary"
               :underline="false"
@@ -190,7 +197,7 @@
                 isReportApproval == 1 &&
                 !row.reportApprovalStatus &&
                 !isEmptyObject(row.reportTemplateJson) &&
-                $hasPermission('qms:quality_work_order:qualityReportApproval')
+                $hasPermission('mes:quality_work_order:qualityReportApproval')
               "
               type="primary"
               :underline="false"