Просмотр исходного кода

新增样品报告功能并优化质检任务单和请托单显示逻辑,支持样品和质检项两种记录方式

yusheng 7 месяцев назад
Родитель
Сommit
1cd2a77a78

+ 22 - 9
src/views/inspectionProjectRequest/index.vue

@@ -136,6 +136,8 @@
       ref="processSubmitDialogRef"
       @reload="reload"
     ></processSubmitDialog>
+      <sampleReport ref="sampleReportRef" @reload="reload"></sampleReport>
+
     <Transfer
       v-if="transferVisible"
       :transferVisible.sync="transferVisible"
@@ -154,6 +156,7 @@
         v-if="bpmDetailShow && processInstanceId"
         :id="processInstanceId"
       ></bpmDetail>
+
       <template v-slot:footer>
         <el-button @click="bpmDetailShow = false">关闭</el-button>
       </template>
@@ -164,6 +167,7 @@
 <script>
   import search from './components/search.vue';
   import Transfer from './components/transfer.vue';
+  import sampleReport from '@/views/inspectionWork/components/sampleReport.vue';
 
   import tabMixins from '@/mixins/tableColumnsMixin';
   import inspectionProjectTaskSend from '@/views/inspectionProjectTask/components/inspectionProjectTaskSend.vue';
@@ -190,7 +194,8 @@
       processSubmitDialog,
       inspectionProjectReport,
       Transfer,
-      bpmDetail
+      bpmDetail,
+      sampleReport
     },
     props: {
       cacheKeyUrl: {
@@ -526,14 +531,22 @@
         }
 
         const res = await getById(row.id);
-        this.$refs.inspectionProjectReportRef.open(
-          {
-            workData: { ...res, measureUnit: res.sampleMeasureUnit },
-            list: res.templateList
-          },
-          type,
-          'inspectionProjectRequest'
-        );
+        if (row.recordingMethod == 1) {
+          this.$refs.inspectionProjectReportRef.open(
+            {
+              workData: { ...res, measureUnit: res.sampleMeasureUnit },
+              list: res.templateList
+            },
+            type,
+            'inspectionProjectRequest'
+          );
+        } else {
+          this.$refs.sampleReportRef.open(
+            res,
+            type,
+            'inspectionProjectRequest'
+          );
+        }
       },
       // async craftFiles(id) {
       //   if (id) {

+ 280 - 82
src/views/inspectionProjectTask/components/inspectionProjectTaskSend.vue

@@ -4,12 +4,14 @@
     :append-to-body="true"
     :close-on-click-modal="false"
     custom-class="ele-dialog-form"
-    :title="type == 1 ? '质检项派单' : '质检项请托'"
+    :title="type == 1 ? '质检派单' : '质检请托'"
     :visible.sync="visible"
     :maxable="true"
     @close="cancel"
   >
-    <header-title title="质检项信息"></header-title>
+    <header-title
+      :title="recordingMethod == 1 ? '质检项信息' : '样品信息'"
+    ></header-title>
     <ele-pro-table
       :needPage="false"
       :columns="tableColumns"
@@ -29,7 +31,7 @@
       <el-row>
         <el-col :span="8">
           <el-form-item
-            :label="type == 1 ? '任务单号' : '质检项请托单号'"
+            :label="type == 1 ? '任务单号' : '质检请托单号'"
             prop="code"
           >
             <el-input
@@ -145,6 +147,8 @@
     executeDeptName: '',
     executeUserId: '',
     executeUserName: '',
+    receiveUserId: '',
+    receiveUserName: '',
     name: '',
     code: '',
     qualityWorkOrderId: '',
@@ -162,81 +166,7 @@
         executorList: [],
         selection: [],
         list: [],
-        tableColumns: [
-          {
-            width: 45,
-            type: 'index',
-            columnKey: 'index',
-            align: 'center',
-            fixed: 'left'
-          },
-          {
-            width: 45,
-            type: 'selection',
-            columnKey: 'selection',
-            align: 'center',
-            selectable: (row, index) => {
-              return row.status == 0 || this.templateIdS.includes(row.id);
-            }
-          },
-          {
-            minWidth: 150,
-            prop: 'qualitySchemeTemplateCode',
-            align: 'center',
-            label: '质检方案编码',
-            showOverflowTooltip: true
-          },
-          {
-            minWidth: 120,
-            prop: 'qualitySchemeTemplateName',
-            align: 'center',
-            label: '质检方案名称',
-            showOverflowTooltip: true
-          },
-          {
-            minWidth: 100,
-            prop: 'categoryLevelClassName',
-            align: 'center',
-            label: '质检类型',
-            showOverflowTooltip: true
-          },
-          {
-            minWidth: 130,
-            prop: 'inspectionCode',
-            align: 'center',
-            label: '质检项编码',
-            showOverflowTooltip: true
-          },
-          {
-            minWidth: 120,
-            prop: 'inspectionName',
-            align: 'center',
-            label: '质检项名称',
-            showOverflowTooltip: true
-          },
-          {
-            minWidth: 150,
-            prop: 'defaultValue',
-            align: 'center',
-            label: '工艺参数',
-            showOverflowTooltip: true
-          },
-          {
-            minWidth: 150,
-            prop: 'status',
-            align: 'center',
-            formatter: (row) => {
-              return (
-                inspectionProjectStatus.find(
-                  (item) => item.value === row.status
-                )?.label || ''
-              );
-            },
 
-            label: '状态',
-            showOverflowTooltip: true
-          }
-        ],
         rules: {
           executeDeptId: [
             { required: true, message: '请选择部门', trigger: 'blur' }
@@ -260,13 +190,264 @@
         templateIdS: [],
         loading: false,
         visible: false,
-        clientEnvironmentId: 0
+        clientEnvironmentId: 0,
+        recordingMethod: 1
       };
     },
+    computed: {
+      tableColumns() {
+        return this.recordingMethod == 1
+          ? [
+              {
+                width: 45,
+                type: 'index',
+                columnKey: 'index',
+                align: 'center',
+                fixed: 'left'
+              },
+              {
+                width: 45,
+                type: 'selection',
+                columnKey: 'selection',
+                align: 'center',
+                selectable: (row, index) => {
+                  return row.status == 0 || this.templateIdS.includes(row.id);
+                }
+              },
+              {
+                minWidth: 150,
+                prop: 'qualitySchemeTemplateCode',
+                align: 'center',
+                label: '质检方案编码',
+                showOverflowTooltip: true
+              },
+              {
+                minWidth: 120,
+                prop: 'qualitySchemeTemplateName',
+                align: 'center',
+                label: '质检方案名称',
+                showOverflowTooltip: true
+              },
+              {
+                minWidth: 100,
+                prop: 'categoryLevelClassName',
+                align: 'center',
+                label: '质检类型',
+                showOverflowTooltip: true
+              },
+              {
+                minWidth: 130,
+                prop: 'inspectionCode',
+                align: 'center',
+                label: '质检项编码',
+                showOverflowTooltip: true
+              },
+              {
+                minWidth: 120,
+                prop: 'inspectionName',
+                align: 'center',
+                label: '质检项名称',
+                showOverflowTooltip: true
+              },
+              {
+                minWidth: 150,
+                prop: 'defaultValue',
+                align: 'center',
+                label: '工艺参数',
+                showOverflowTooltip: true
+              },
+              {
+                minWidth: 150,
+                prop: 'status',
+                align: 'center',
+                formatter: (row) => {
+                  return (
+                    inspectionProjectStatus.find(
+                      (item) => item.value === row.status
+                    )?.label || ''
+                  );
+                },
+
+                label: '状态',
+                showOverflowTooltip: true
+              }
+            ]
+          : [
+              {
+                width: 45,
+                type: 'index',
+                columnKey: 'index',
+                align: 'center',
+                fixed: 'left'
+              },
+              {
+                width: 45,
+                type: 'selection',
+                columnKey: 'selection',
+                fixed: 'left',
+                align: 'center',
+                selectable: (row, index) => {
+                  return row.status == 0 || this.templateIdS.includes(row.id);
+                }
+              },
+              {
+                label: '样品编码',
+                prop: 'sampleCode',
+                minWidth: '200',
+                align: 'center',
+                fixed: 'left'
+              },
+              {
+                label: '编码',
+                minWidth: '200',
+                prop: 'categoryCode',
+                align: 'center',
+                fixed: 'left'
+              },
+              {
+                label: '名称',
+                minWidth: '150',
+                prop: 'categoryName',
+                align: 'center'
+              },
+              {
+                label: '批次号',
+                minWidth: '150',
+                prop: 'batchNo',
+                align: 'center'
+              },
+              {
+                label: '发货条码',
+                minWidth: '150',
+                prop: 'barcodes',
+                align: 'center'
+              },
+              {
+                label: '包装编码',
+                minWidth: '150',
+                prop: 'packageNo',
+                align: 'center'
+              },
+              {
+                label: '包装数量',
+                minWidth: '150',
+                prop: 'packingQuantity',
+                align: 'center'
+              },
+              { label: '包装单位', prop: 'packingUnit', align: 'center' },
+              { label: '计量数量', prop: 'measureQuantity', align: 'center' },
+              { label: '计量单位', prop: 'measureUnit', align: 'center' },
+              {
+                label: '供应商名称',
+                prop: 'supplierName',
+                align: 'center',
+                width: '120'
+              },
+              {
+                label: '供应商代号',
+                prop: 'supplierCode',
+                align: 'center',
+                width: '120'
+              },
+              {
+                label: '物料代号',
+                prop: 'materielDesignation',
+                align: 'center',
+                slot: 'materielDesignation',
+                width: '120'
+              },
+              {
+                label: '客户代号',
+                prop: 'clientCode',
+                align: 'center',
+                slot: 'clientCode',
+                width: '120'
+              },
+              {
+                label: '刻码',
+                prop: 'engrave',
+                align: 'center',
+                slot: 'engrave',
+                width: '120'
+              },
+              {
+                label: '机型',
+                prop: 'modelKey',
+                align: 'center',
+                showOverflowTooltip: true
+              },
+              {
+                label: '颜色',
+                prop: 'colorKey',
+                align: 'center',
+                showOverflowTooltip: true
+              },
+              {
+                label: '型号',
+                prop: 'modelType',
+                align: 'center',
+                showOverflowTooltip: true
+              },
+              {
+                label: '规格',
+                prop: 'specification',
+                align: 'center',
+                showOverflowTooltip: true
+              },
+              {
+                label: '电压等级',
+                prop: 'voltage',
+                align: 'center',
+                showOverflowTooltip: true
+              },
+              {
+                label: '重量',
+                prop: 'weight',
+                align: 'center',
+                slot: 'weight',
+                width: '120'
+              },
+              {
+                label: '重量单位',
+                prop: 'weightUnit',
+                align: 'center',
+                width: 100
+              },
+              {
+                label: '仓库',
+                prop: 'warehouseName',
+                align: 'center',
+                width: 100
+              },
+              { label: '货区', prop: 'areaName', align: 'center' },
+              { label: '货架', prop: 'goodsShelfName', align: 'center' },
+              { label: '货位', prop: 'goodsAllocationName', align: 'center' },
+              { label: '生产日期', prop: 'productionDate', align: 'center' },
+              { label: '采购日期', prop: 'purchaseDate', align: 'center' },
+              {
+                minWidth: 150,
+                prop: 'status',
+                align: 'center',
+                formatter: (row) => {
+                  return (
+                    inspectionProjectStatus.find(
+                      (item) => item.value === row.status
+                    )?.label || ''
+                  );
+                },
+
+                label: '状态',
+                fixed: 'right',
+                showOverflowTooltip: true
+              }
+            ];
+      }
+    },
 
     created() {},
     methods: {
       async open(row, type, pgaeName) {
+        this.recordingMethod = row.recordingMethod;
         this.clientEnvironmentId =
           this.$store.state.user.info.clientEnvironmentId;
         this.type = type;
@@ -284,8 +465,12 @@
             },
             true
           );
-          if (this.form.templateList.length) {
-            this.templateIdS = this.form.templateList.map((item) => item.id);
+          const list =
+            row.recordingMethod == 1
+              ? this.form.templateList
+              : this.form.sampleList;
+          if (list.length) {
+            this.templateIdS = list.map((item) => item.id);
           }
         } else {
           this.form.qualityWorkOrderId = row.id;
@@ -297,7 +482,10 @@
         }
         //获取工单质检方案
         await getById(this.form.qualityWorkOrderId).then((res) => {
-          this.list = res.data.templateList;
+          this.list =
+            row.recordingMethod == 1
+              ? res.data.templateList
+              : res.data.qualitySampleList;
           this.$nextTick(() => {
             this.$refs.table.setSelectedRowKeys(this.templateIdS);
           });
@@ -367,10 +555,20 @@
                 : qualityInspectionItemRequest
               : '';
 
+          if (this.recordingMethod == 2) {
+            this.form.sampleQuantity = this.selection
+              .map((item) => item.measureQuantity)
+              .reduce((a, b) => a + Number(b), 0);
+          }
+
           api({
             ...this.form,
             detailList: this.selection.map((item) => {
-              return { qualityPlanTemplateId: item.id };
+              return {
+                [this.recordingMethod == 1
+                  ? 'qualityPlanTemplateId'
+                  : 'sampleId']: item.id
+              };
             })
           })
             .then((msg) => {

+ 16 - 11
src/views/inspectionProjectTask/index.vue

@@ -8,7 +8,6 @@
         ref="table"
         :columns="columns"
         :datasource="datasource"
-        :selection.sync="selection"
         row-key="code"
         :page-size="20"
         @columns-change="handleColumnChange"
@@ -31,7 +30,6 @@
         </template>
         <!-- 操作列 -->
         <template v-slot:action="{ row }">
-      
           <el-link
             type="primary"
             :underline="false"
@@ -49,14 +47,16 @@
       ref="inspectionProjectReportRef"
       @reload="reload"
     />
+
+    <sampleReport ref="sampleReportRef" @reload="reload"></sampleReport>
     <!-- <fileList ref="fileListRef"></fileList> -->
-   
   </div>
 </template>
 
 <script>
   import search from './components/search.vue';
   import inspectionProjectReport from '@/views/inspectionWork/components/inspectionProjectReport.vue';
+  import sampleReport from '@/views/inspectionWork/components/sampleReport.vue';
   // import fileList from '@/components/addDoc/main.vue';
   import tabMixins from '@/mixins/tableColumnsMixin';
   import {
@@ -72,6 +72,7 @@
     components: {
       search,
       inspectionProjectReport,
+      sampleReport
       // fileList,
       // wokePopup
     },
@@ -317,14 +318,18 @@
           }
         }
         const res = await getById(row.id);
-        this.$refs.inspectionProjectReportRef.open(
-          {
-            workData: { ...res.data, measureUnit: row.measureUnit },
-            list: res.data.templateList
-          },
-          type,
-          'inspectionProjectTask'
-        );
+        if (row.recordingMethod == 1) {
+          this.$refs.inspectionProjectReportRef.open(
+            {
+              workData: { ...res.data, measureUnit: row.measureUnit },
+              list: res.data.templateList
+            },
+            type,
+            'inspectionProjectTask'
+          );
+        } else {
+          this.$refs.sampleReportRef.open(res.data, type, 'inspectionProjectTask');
+        }
       },
 
       /* 删除 */

+ 26 - 13
src/views/inspectionWork/components/newQualityContentTabs.vue

@@ -273,6 +273,22 @@
           </el-table-column>
           <!-- *** fixed="right" -->
           <el-table-column
+            label="状态"
+            prop="status"
+            align="center"
+            fixed="right"
+            :show-overflow-tooltip="true"
+            v-if="form.recordingMethod != 1"
+          >
+            <template slot-scope="scope">
+              {{
+                inspectionProjectStatus.find(
+                  (item) => item.value == scope.row.status
+                )?.label
+              }}
+            </template>
+          </el-table-column>
+          <!-- <el-table-column
             label="质检状态"
             prop="qualityStatus"
             align="center"
@@ -285,7 +301,7 @@
               <span v-if="scope.row.qualityStatus == 1">已检</span>
               <span v-if="scope.row.qualityStatus == 2">待检</span>
             </template>
-          </el-table-column>
+          </el-table-column> -->
           <el-table-column
             label="质检结果"
             prop="qualityResults"
@@ -301,7 +317,7 @@
                 v-model="scope.row.qualityResults"
                 placeholder="请选择"
                 style="width: 100%"
-                :disabled="type == 'detail'"
+                :disabled="type == 'detail' || scope.row.correlationId"
                 size="mini"
               >
                 <el-option
@@ -331,6 +347,7 @@
                 filterable
                 clearable
                 @change="badTypeChange(row)"
+                :disabled="type == 'detail' || row.correlationId"
               >
                 <el-option
                   v-for="item in badTypeList"
@@ -360,6 +377,7 @@
                 filterable
                 clearable
                 @change="badNameChange(row)"
+                :disabled="type == 'detail' || row.correlationId"
               >
                 <el-option
                   v-for="item in badNameList"
@@ -382,6 +400,7 @@
               <el-link
                 :type="scope.row.isValid ? 'primary' : 'danger'"
                 :underline="false"
+                v-if="!scope.row.correlationId"
                 @click="handleDetail(scope.$index, scope.row, 'report')"
               >
                 质检
@@ -575,11 +594,7 @@
           :total="schemeList.length"
         /> -->
       </el-tab-pane>
-      <el-tab-pane
-        label="质检项任务单"
-        name="4"
-        v-if="form.recordingMethod == 1"
-      >
+      <el-tab-pane label="质检任务单" name="4">
         <ele-pro-table
           ref="table"
           :columns="taskColumns"
@@ -588,11 +603,7 @@
         >
         </ele-pro-table>
       </el-tab-pane>
-      <el-tab-pane
-        label="质检项请托单"
-        name="5"
-        v-if="form.recordingMethod == 1"
-      >
+      <el-tab-pane label="质检请托单" name="5">
         <ele-pro-table
           ref="table"
           :columns="entrustColumns"
@@ -1404,7 +1415,9 @@
         if (byCategory) {
           this.$refs.wokePopupListRef.openTwo(this.form);
         } else {
-          this.$refs.wokePopupListRef.open(this.fileParam.map((item) => item.id));
+          this.$refs.wokePopupListRef.open(
+            this.fileParam.map((item) => item.id)
+          );
         }
       },
 

+ 26 - 9
src/views/inspectionWork/components/sampleListDialog.vue

@@ -106,7 +106,9 @@
                 <template slot-scope="scope">
                   <toolButtom
                     v-model="scope.row.useTools"
-                    :type="type"
+                    :type="
+                      !pageName && props.row.correlationId ? 'detail' : type
+                    "
                     :sList="scope.row.toolList"
                   />
                 </template>
@@ -125,9 +127,15 @@
                     :class="scope.row.qualityResults === 2 ? 'warn' : ''"
                     v-model="scope.row.qualityResultContent"
                     placeholder="请输入内容"
-                    :disabled="type == 'detail'"
+                    :disabled="
+                      type == 'detail' || (!pageName && props.row.correlationId)
+                    "
                     @input="
-                      handleInput(scope.row, scope.row.qualityResultContent,tableData)
+                      handleInput(
+                        scope.row,
+                        scope.row.qualityResultContent,
+                        tableData
+                      )
                     "
                   >
                     <template slot="append" v-if="scope.row.unitName">
@@ -148,7 +156,9 @@
                     placeholder="请选择"
                     style="width: 100%"
                     @change="qualityResultsListChange(tableData)"
-                    :disabled="type == 'detail'"
+                    :disabled="
+                      type == 'detail' || (!pageName && props.row.correlationId)
+                    "
                   >
                     <el-option
                       v-for="item in qualityResultsList"
@@ -213,19 +223,21 @@
 
 <script>
   import toolButtom from './toolButtom.vue';
-  import {handleInput,qualityResultsListChange} from './unit.js';
+  import { handleInput, qualityResultsListChange } from './unit.js';
   export default {
     components: {
       toolButtom
     },
     data() {
       return {
-        handleInput,qualityResultsListChange,
+        handleInput,
+        qualityResultsListChange,
         title: '',
         visible: false,
         rowIndex: 0,
         type: '',
         tableData: [],
+        pageName: '',
         tableColumns: [
           {
             label: '编码',
@@ -316,10 +328,11 @@
 
     created() {},
     methods: {
-      async openDia(index, row, type, list, isStatus, sList) {
+      async openDia(index, row, type, list, isStatus, sList, pageName) {
         this.tableData = [];
         this.rowIndex = index;
         this.type = type;
+        this.pageName = pageName;
         // console.log(list, 'lklllllllllllllllllkkkkkkkkkkkkkkkkkkkkk', list[0].qualityResults);
         //如果质检项qualitySampleTemplateList只有一条数据且质检结果是让步接收
         if (list[0].qualitySampleTemplateList.length == 1) {
@@ -343,13 +356,17 @@
         this.visible = true;
       },
 
-  
-
       handleClose() {
         this.visible = false;
       },
       handleConfirm() {
         this.visible = false;
+        this.tableData.forEach((item) => {
+          if (!this.pageName && item.correlationId) {
+            return;
+          }
+          item.status = 1;
+        });
         this.$emit('handleConfirm', this.tableData, this.rowIndex);
       },
       handleDispose(index, row, type) {

+ 852 - 0
src/views/inspectionWork/components/sampleReport.vue

@@ -0,0 +1,852 @@
+<!-- 用户编辑弹窗 -->
+<template>
+  <ele-modal
+    :title="title + (type == 'detail' ? '详情' : '报工')"
+    :visible.sync="visible"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    append-to-body
+    width="80%"
+    :maxable="true"
+  >
+    <ele-pro-table
+      :needPage="false"
+      :columns="workColumns"
+      :datasource="[form]"
+    >
+      <template v-slot:isRequired="{ column }">
+        <span class="is-required">{{ column.label }}</span>
+      </template>
+      <template v-slot:qualityType="{ row }">
+        {{ getDictValue('质检计划类型', row.qualityType) }}
+      </template>
+      <template v-slot:qualityMode="{ row }">
+        {{ getDictValue('取样类型', row.qualityMode) }}
+      </template>
+      <template v-slot:hours="{ row }">
+        <el-input
+          v-model="row.hours"
+          placeholder="请输入"
+          type="number"
+          :disabled="type == 'detail'"
+        >
+        </el-input>
+      </template>
+      <template v-slot:lossNumber="{ row, $index }">
+        <el-input
+          v-model="row.lossNumber"
+          placeholder="请输入"
+          :disabled="type == 'detail'"
+          type="number"
+          @input="inputValue('lossNumber', row, $index)"
+          @click.native="curretNum = row.lossNumber"
+        >
+          <template slot="append">{{ sampleList[0].measureUnit }}</template>
+        </el-input>
+      </template>
+      <template v-slot:lossNumberUnqualified="{ row, $index }">
+        <el-input
+          v-model="row.lossNumberUnqualified"
+          placeholder="请输入"
+          :disabled="type == 'detail'"
+          type="number"
+          @input="inputValue('lossNumberUnqualified', row, $index)"
+          @click.native="curretNum = row.lossNumberUnqualified"
+        >
+          <template slot="append">{{ sampleList[0].measureUnit }}</template>
+        </el-input>
+      </template>
+      <template v-slot:retainedSampleQuantity="{ row, $index }">
+        <el-input
+          v-model="row.retainedSampleQuantity"
+          placeholder="请输入"
+          :disabled="type == 'detail'"
+          type="number"
+          @input="inputValue('retainedSampleQuantity', row, $index)"
+          @click.native="curretNum = row.retainedSampleQuantity"
+        >
+          <template slot="append">{{ sampleList[0].measureUnit }}</template>
+        </el-input>
+      </template>
+      <template v-slot:retainedSampleUnqualified="{ row, $index }">
+        <el-input
+          v-model="row.retainedSampleUnqualified"
+          placeholder="请输入"
+          :disabled="type == 'detail'"
+          type="number"
+          @input="inputValue('retainedSampleUnqualified', row)"
+          @click.native="curretNum = row.retainedSampleUnqualified"
+        >
+          <template slot="append">{{ sampleList[0].measureUnit }}</template>
+        </el-input>
+      </template>
+    </ele-pro-table>
+    <el-table
+      ref="showSampleListTable"
+      :data="sampleList"
+      tooltip-effect="dark"
+      height="500"
+      border
+      row-key="id"
+    >
+      <el-table-column
+        label="序号"
+        type="index"
+        width="50"
+        align="center"
+        fixed="left"
+      ></el-table-column>
+      <template v-for="(column, index) in tableColumns">
+        <el-table-column
+          :key="index"
+          :label="column.label"
+          :prop="column.prop"
+          :fixed="column.fixed"
+          :show-overflow-tooltip="true"
+          :width="column.width"
+          :align="column.align"
+        >
+          <template slot-scope="scope">
+            <template v-if="column.prop === 'categoryCode'">
+              <el-link
+                type="primary"
+                :underline="false"
+                @click="handleDetail(scope.$index, scope.row, 'detail')"
+              >
+                {{ scope.row.categoryCode }}
+              </el-link>
+            </template>
+            <template v-else-if="column.prop === 'materielDesignation'">
+              <el-input
+                :disabled="type == 'detail'"
+                v-model="scope.row.materielDesignation"
+                size="mini"
+                v-direction="{ x: 0, y: scope.$index }"
+              ></el-input>
+            </template>
+            <template v-else-if="column.prop === 'clientCode'">
+              <el-input
+                :disabled="type == 'detail'"
+                v-model="scope.row.clientCode"
+                size="mini"
+                v-direction="{ x: 1, y: scope.$index }"
+              ></el-input>
+            </template>
+            <template v-else-if="column.prop === 'engrave'">
+              <el-input
+                :disabled="type == 'detail'"
+                v-model="scope.row.engrave"
+                size="mini"
+                v-direction="{ x: 2, y: scope.$index }"
+              ></el-input>
+            </template>
+            <template v-else-if="column.prop === 'weight'">
+              <el-input
+                v-model="scope.row.weight"
+                :disabled="type == 'detail'"
+                oninput="value = value.replace(/[^\d.]/g, '')"
+                :min="0"
+                size="mini"
+                v-direction="{ x: 3, y: scope.$index }"
+              ></el-input>
+            </template>
+            <template v-else>
+              {{ scope.row[column.prop] }}
+            </template>
+          </template>
+        </el-table-column>
+      </template>
+      <!-- *** fixed="right"  -->
+      <el-table-column
+        label="处置状态"
+        prop="disposeType"
+        align="center"
+        :show-overflow-tooltip="true"
+      >
+        <template slot-scope="scope">
+          <span>{{ disposeTypeList[scope.row.disposeType] }}</span>
+        </template>
+      </el-table-column>
+      <!-- ***  fixed="right" -->
+      <el-table-column
+        label="处置时间"
+        prop="disposeTime"
+        align="center"
+        :show-overflow-tooltip="true"
+      >
+      </el-table-column>
+      <!-- *** fixed="right" -->
+      <el-table-column
+        label="状态"
+        prop="status"
+        align="center"
+        fixed="right"
+        :show-overflow-tooltip="true"
+      >
+        <template slot-scope="scope">
+          {{
+            inspectionProjectStatus.find(
+              (item) => item.value == scope.row.status
+            )?.label
+          }}
+        </template>
+      </el-table-column>
+      <!-- <el-table-column
+        label="质检状态"
+        prop="qualityStatus"
+        align="center"
+        fixed="right"
+        :show-overflow-tooltip="true"
+      >
+        <template slot-scope="scope">
+          <span v-if="scope.row.qualityStatus == 0">未检</span>
+          <span v-if="scope.row.qualityStatus == 1">已检</span>
+          <span v-if="scope.row.qualityStatus == 2">待检</span></template
+        >
+      </el-table-column> -->
+
+      <el-table-column
+        label="质检结果"
+        prop="qualityResults"
+        align="center"
+        width="180"
+        fixed="right"
+        :show-overflow-tooltip="true"
+      >
+        <template slot-scope="scope">
+          <el-select
+            v-model="scope.row.qualityResults"
+            placeholder="请选择"
+            style="width: 100%"
+            :disabled="type == 'detail'"
+            @change="initQms"
+            size="mini"
+          >
+            <el-option
+              v-for="item in qualityResultsList"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            >
+            </el-option>
+          </el-select>
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="不良类型"
+        align="center"
+        prop="badTypeId"
+        width="180"
+      >
+        <template v-slot="{ row, $index }">
+          <el-select
+            v-model="row.badTypeId"
+            placeholder="请选择不良类型"
+            size="small"
+            style="width: 100%"
+            remote
+            filterable
+            clearable
+            @change="badTypeChange(row)"
+            :disabled="type == 'detail'"
+          >
+            <el-option
+              v-for="item in badTypeList"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id"
+            >
+            </el-option>
+          </el-select>
+        </template>
+      </el-table-column>
+
+      <el-table-column
+        label="不良名称"
+        align="center"
+        prop="badNameId"
+        width="180"
+      >
+        <template v-slot="{ row, $index }">
+          <el-select
+            v-model="row.badNameId"
+            placeholder="请选择不良名称"
+            size="small"
+            style="width: 100%"
+            remote
+            filterable
+            clearable
+            @change="badNameChange(row)"
+            :disabled="type == 'detail'"
+          >
+            <el-option
+              v-for="item in badNameList"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id"
+            >
+            </el-option>
+          </el-select>
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="操作"
+        align="center"
+        width="120"
+        fixed="right"
+        v-if="type != 'detail'"
+      >
+        <template slot-scope="scope">
+          <el-link
+            :type="scope.row.isValid ? 'primary' : 'danger'"
+            :underline="false"
+            @click="handleDetail(scope.$index, scope.row, 'report')"
+          >
+            质检
+          </el-link>
+        </template>
+      </el-table-column>
+    </el-table>
+    <template v-slot:footer>
+      <el-button @click="handleClose">取消</el-button>
+      <el-button type="primary" @click="save" v-if="type != 'detail'">
+        确认
+      </el-button>
+    </template>
+    <sampleListDialog
+      ref="detailRef"
+      @handleConfirm="handleConfirm"
+      @handleDispose="handleDispose"
+    ></sampleListDialog>
+  </ele-modal>
+</template>
+
+<script>
+  import dictMixins from '@/mixins/dictMixins';
+  import { inspectionProjectStatus } from '@/enum/dict.js';
+  import { getList as getBadNameList } from '@/api/unacceptedProduct/unqualifiedName';
+  import { getList as getBadTypeList } from '@/api/unacceptedProduct/unqualifiedType';
+  import sampleListDialog from './sampleListDialog.vue';
+  import {
+    exeTaskReportWork,
+    exeEntrustReportWork
+  } from '@/api/inspectionProjectTask';
+  import { init } from 'echarts/core';
+  export default {
+    mixins: [dictMixins],
+
+    components: { sampleListDialog },
+
+    data() {
+      return {
+        workColumns: [
+          {
+            minWidth: 150,
+            prop: 'code',
+            align: 'center',
+            label: '质检项工单号',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 150,
+            prop: 'qualityWorkOrderCode',
+            align: 'center',
+            label: '质检工单编码',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 150,
+            prop: 'qualityWorkOrderName',
+            align: 'center',
+            label: '质检工单名称',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 150,
+            prop: 'qualityWorkOrderCode',
+            align: 'center',
+            label: '来源单号',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 100,
+            prop: 'qualityType',
+            slot: 'qualityType',
+            align: 'center',
+            label: '类型',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 100,
+            slot: 'qualityMode',
+            prop: 'qualityMode',
+            align: 'center',
+            label: '质检方式',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 120,
+            prop: 'productCode',
+            align: 'center',
+            label: '编码',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 120,
+            prop: 'productName',
+            align: 'center',
+            label: '名称',
+            showOverflowTooltip: true
+          },
+
+          {
+            minWidth: 100,
+            prop: 'batchNo',
+            align: 'center',
+            label: '批次号',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 120,
+            prop: 'specification',
+            align: 'center',
+            label: '规格',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 100,
+            prop: 'brandNo',
+            align: 'center',
+            label: '牌号',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 120,
+            prop: 'produceTaskName',
+            align: 'center',
+            label: '工序名称',
+            showOverflowTooltip: true
+          },
+
+          {
+            minWidth: 180,
+            prop: 'sampleQuantity',
+            align: 'center',
+            label: '样品数',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 180,
+            prop: 'sampleNoQualifiedNumber',
+            slot: 'sampleNoQualifiedNumber',
+            formatter: (row) => {
+              if (row.sampleNoQualifiedNumber) {
+                return (
+                  row.sampleNoQualifiedNumber + (this.form.measureUnit || '')
+                );
+              }
+            },
+            align: 'center',
+            label: '样品不合格数',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 140,
+            prop: 'sampleQualifiedNumber',
+            headerSlot: 'isRequired',
+            slot: 'sampleQualifiedNumber',
+            align: 'center',
+            formatter: (row) => {
+              if (row.sampleQualifiedNumber) {
+                return (
+                  row.sampleQualifiedNumber + (this.form.measureUnit || '')
+                );
+              }
+            },
+            label: '样品合格数',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 180,
+            prop: 'lossNumber',
+            slot: 'lossNumber',
+            align: 'center',
+
+            label: '损耗数(合格品)',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 180,
+            prop: 'lossNumberUnqualified',
+            slot: 'lossNumberUnqualified',
+            align: 'center',
+
+            label: '损耗数(不合格品)',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 180,
+            prop: 'retainedSampleQuantity',
+            slot: 'retainedSampleQuantity',
+            align: 'center',
+
+            label: '留样数(合格品)',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 180,
+            prop: 'retainedSampleUnqualified',
+            slot: 'retainedSampleUnqualified',
+            align: 'center',
+            label: '留样数(不合格品)',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 120,
+            prop: 'hours',
+            slot: 'hours',
+            align: 'center',
+            label: '工时',
+            showOverflowTooltip: true
+          }
+        ],
+
+        inspectionProjectStatus,
+        type: 'report',
+        title: '质检任务单',
+        visible: false,
+        form: {},
+        disposeTypeList: {
+          1: '返工',
+          2: '返修',
+          3: '报废',
+          4: '降级使用',
+          5: '让步接收',
+          6: '留样',
+          7: '消耗',
+          8: '回用/归批',
+          9: '转试销',
+          10: '退货'
+        },
+        tableColumns: [
+          {
+            label: '样品编码',
+            prop: 'sampleCode',
+            width: '200',
+            align: 'center',
+            fixed: 'left'
+          },
+          {
+            label: '编码',
+            prop: 'categoryCode',
+            align: 'center',
+            fixed: 'left'
+          },
+          {
+            label: '名称',
+            prop: 'categoryName',
+            align: 'center'
+          },
+          { label: '批次号', prop: 'batchNo', align: 'center' },
+          { label: '发货条码', prop: 'barcodes', align: 'center' },
+          { label: '包装编码', prop: 'packageNo', align: 'center' },
+          { label: '包装数量', prop: 'packingQuantity', align: 'center' },
+          { label: '包装单位', prop: 'packingUnit', align: 'center' },
+          { label: '计量数量', prop: 'measureQuantity', align: 'center' },
+          { label: '计量单位', prop: 'measureUnit', align: 'center' },
+          {
+            label: '供应商名称',
+            prop: 'supplierName',
+            align: 'center',
+            width: '120'
+          },
+          {
+            label: '供应商代号',
+            prop: 'supplierCode',
+            align: 'center',
+            width: '120'
+          },
+          {
+            label: '物料代号',
+            prop: 'materielDesignation',
+            align: 'center',
+            slot: 'materielDesignation',
+            width: '120'
+          },
+          {
+            label: '客户代号',
+            prop: 'clientCode',
+            align: 'center',
+            slot: 'clientCode',
+            width: '120'
+          },
+          {
+            label: '刻码',
+            prop: 'engrave',
+            align: 'center',
+            slot: 'engrave',
+            width: '120'
+          },
+          {
+            label: '机型',
+            prop: 'modelKey',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            label: '颜色',
+            prop: 'colorKey',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            label: '型号',
+            prop: 'modelType',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            label: '规格',
+            prop: 'specification',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            label: '电压等级',
+            prop: 'voltage',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            label: '重量',
+            prop: 'weight',
+            align: 'center',
+            slot: 'weight',
+            width: '120'
+          },
+          {
+            label: '重量单位',
+            prop: 'weightUnit',
+            align: 'center',
+            width: 100
+          },
+          { label: '仓库', prop: 'warehouseName', align: 'center', width: 100 },
+          { label: '货区', prop: 'areaName', align: 'center' },
+          { label: '货架', prop: 'goodsShelfName', align: 'center' },
+          { label: '货位', prop: 'goodsAllocationName', align: 'center' },
+          { label: '生产日期', prop: 'productionDate', align: 'center' },
+          { label: '采购日期', prop: 'purchaseDate', align: 'center' }
+        ],
+        qualityResultsList: [
+          {
+            value: 1,
+            label: '合格'
+          },
+          {
+            value: 2,
+            label: '不合格'
+          },
+          {
+            value: 3,
+            label: '让步接收'
+          }
+        ],
+        pageName: '',
+        badNameList: [],
+        badTypeList: [],
+        sampleList: []
+      };
+    },
+    computed: {},
+
+    created() {
+      this.getBadNameList();
+      this.getBadTypeList();
+      this.requestDict('质检计划类型');
+      this.requestDict('取样类型');
+      this.requestDict('质检标准类型');
+    },
+    methods: {
+      inputValue(type) {
+        if (this.form[type] < 0) {
+          this.form[type] = 0;
+        }
+        //损耗数
+        if (type == 'lossNumber' || type == 'lossNumberUnqualified') {
+          if (
+            type == 'lossNumber' &&
+            Number(this.form[type]) + Number(this.form.retainedSampleQuantity) >
+              this.form.sampleQualifiedNumber
+          ) {
+            this.form[type] = 0;
+          }
+          if (
+            type == 'lossNumberUnqualified' &&
+            Number(this.form[type]) +
+              Number(this.form.retainedSampleUnqualified) >
+              this.form.sampleNoQualifiedNumber
+          ) {
+            this.form[type] = 0;
+          }
+        }
+        //留样数
+        if (
+          type == 'retainedSampleQuantity' ||
+          type == 'retainedSampleUnqualified'
+        ) {
+          if (
+            type == 'retainedSampleQuantity' &&
+            Number(this.form[type]) + Number(this.form.lossNumber) >
+              this.form.sampleQualifiedNumber
+          ) {
+            this.form[type] = 0;
+          }
+          if (
+            type == 'retainedSampleUnqualified' &&
+            Number(this.form[type]) + Number(this.form.lossNumberUnqualified) >
+              this.form.sampleNoQualifiedNumber
+          ) {
+            this.form[type] = 0;
+          }
+        }
+      },
+      handleDetail(index, row, type) {
+        if (type) {
+          this.$refs.detailRef.openDia(
+            index,
+            row,
+            type,
+            [row],
+            null,
+            [],
+            this.pageName
+          );
+        } else {
+          this.$refs.detailRef.openDia(
+            null,
+            null,
+            'report',
+            this.sampleList,
+            null,
+            [],
+            this.pageName
+          );
+        }
+      },
+      initQms(init) {
+        this.form.sampleNoQualifiedNumber = 0;
+        this.form.sampleQualifiedNumber = 0;
+        this.sampleList.forEach((item) => {
+          if (item.qualityResults == 1) {
+            this.form.sampleQualifiedNumber += 1;
+          } else {
+            this.form.sampleNoQualifiedNumber += 1;
+          }
+        });
+        if (init) return;
+        [
+          'lossNumber',
+          'lossNumberUnqualified',
+          'retainedSampleQuantity',
+          'retainedSampleUnqualified'
+        ].forEach((key) => {
+          this.form[key] = 0;
+        });
+      },
+
+      // 不良类型改变
+      badTypeChange(row) {
+        row.badTypeName = null;
+        // 赋值badTypeName
+        const badType = this.badTypeList.find(
+          (item) => item.id === row.badTypeId
+        );
+        if (badType) {
+          row.badTypeName = badType.name;
+        }
+        this.getBadNameList(row.badTypeId);
+      },
+      // 不良名称改变
+      badNameChange(row) {
+        // 赋值badNameName
+        const badItem = this.badNameList.find(
+          (item) => item.id === row.badNameId
+        );
+        if (badItem) {
+          row.badNameName = badItem.name;
+        }
+      },
+      // 查询不良类型
+      async getBadTypeList() {
+        const res = await getBadTypeList({
+          pageNum: 1,
+          size: 999
+        });
+        this.badTypeList = res.list;
+      },
+      // 查询不良名称
+      async getBadNameList() {
+        const res = await getBadNameList({
+          pageNum: 1,
+          size: 999
+        });
+        this.badNameList = res.list;
+      },
+      handleClose() {
+        this.visible = false;
+        this.sampleList = [];
+      },
+      async open(row, type, pageName) {
+        this.pageName = pageName;
+        this.type = type;
+        if (pageName == 'inspectionProjectTask') {
+          this.title = '质检任务单';
+        }
+        if (pageName == 'inspectionProjectRequest') {
+          this.title = '质检受托单';
+        }
+        this.form = JSON.parse(JSON.stringify(row));
+        console.log(this.form, 'this.form');
+        this.sampleList = this.form.sampleList;
+        this.initQms(true);
+
+        this.visible = true;
+      },
+      handleConfirm(data, index) {
+        console.log(data, 'data');
+        console.log(index, 'data');
+        if (index === 0 || index) {
+          this.$set(this.sampleList, index, data[0]);
+        } else {
+          this.sampleList = data;
+        }
+        this.initQms();
+      },
+      handleDispose() {},
+      save() {
+        let api =
+          this.pageName == 'inspectionProjectTask'
+            ? exeTaskReportWork
+            : exeEntrustReportWork;
+        api({
+          ...this.form,
+          sampleList: this.sampleList
+        }).then((res) => {
+          this.$message.success('操作成功');
+          this.$emit('reload');
+          this.visible = false;
+        });
+      }
+    }
+  };
+</script>
+
+<style scoped lang="scss">
+  ::v-deep .warn {
+    color: red;
+    .el-input__inner {
+      color: red;
+    }
+  }
+</style>

+ 24 - 1
src/views/inspectionWork/details.vue

@@ -61,7 +61,7 @@
                   <el-input :value="qualityName" disabled />
                 </el-form-item>
               </el-col>
-       
+
               <el-col :span="6">
                 <el-form-item
                   label="执行部门"
@@ -353,6 +353,24 @@
                 </template>
               </ele-pro-table></el-tab-pane
             >
+            <el-tab-pane label="质检任务单" name="4">
+              <ele-pro-table
+                ref="table"
+                :columns="taskColumns"
+                :datasource="taskMonadList"
+                :needPage="false"
+              >
+              </ele-pro-table>
+            </el-tab-pane>
+            <el-tab-pane label="质检请托单" name="5">
+              <ele-pro-table
+                ref="table"
+                :columns="entrustColumns"
+                :datasource="requestEntrustList"
+                :needPage="false"
+              >
+              </ele-pro-table>
+            </el-tab-pane>
           </el-tabs>
         </el-tab-pane>
         <el-tab-pane
@@ -413,6 +431,8 @@
         sourceData3: [],
         sourceData4: [],
         sourceData5: [],
+        taskMonadList:[],
+        requestEntrustList:[],
         disposeTypeList: [],
         form: {},
         showArrange: '0',
@@ -574,6 +594,9 @@
         this.$set(this.form, 'remark', res.remark);
         this.sourceData3 = res.templateList || [];
         this.sourceData1 = res.qualityInventoryList || [];
+        this.taskMonadList=res.taskMonadList||[]
+        this.requestEntrustList=res.requestEntrustList||[]
+        
         let name = this.$route.query.name;
         // const result = name == '计划' ? res.qualityWorkOrderDetailVO : res;
         let result = {};

+ 6 - 3
src/views/inspectionWork/edit.vue

@@ -1705,9 +1705,9 @@
             }
 
             for (let i = 0; i < this.sampleList.length; i++) {
-              const qualityStatus = this.sampleList[i].qualityStatus;
+              const status = this.sampleList[i].status;
 
-              if (qualityStatus == '2') {
+              if (status != '1') {
                 this.loading = false;
                 this.$refs.tabsRef.tabsChange('2');
                 this.$message.error('请完成以下样品质检!');
@@ -1730,7 +1730,7 @@
           this.form.qualityTimeEnd = this.getNowTime();
           this.form.qualityTimeStart = this.qualityTimeStart;
           this.form.qualityId = this.form.qualityIdList.join(',');
-          this.form.executeUserIdList=this.form.executeUserIdList||[]
+          this.form.executeUserIdList = this.form.executeUserIdList || [];
           if (
             !this.form.executeUserIdList.find(
               (item) => item == this.$store.state.user.info.userId
@@ -1802,6 +1802,9 @@
         //   }
         // }
         list.forEach((item) => {
+          if (item.correlationId) {
+            return;
+          }
           if (item.qualitySampleTemplateList.length == 1) {
             if (
               item.qualitySampleTemplateList.some(

+ 2 - 4
src/views/inspectionWork/index.vue

@@ -131,22 +131,20 @@
             :underline="false"
             v-if="
               row.status == 0 &&
-              row.recordingMethod == 1 &&
               $hasPermission('qms:quality_work_order:qualityInspectionSend')
             "
             @click="qualityInspectionSend(row, 1)"
-            >质检项派单</el-link
+            >质检派单</el-link
           >
           <el-link
             type="primary"
             :underline="false"
             v-if="
               row.status == 0 &&
-              row.recordingMethod == 1 &&
               $hasPermission('qms:quality_work_order:request')
             "
             @click="qualityInspectionSend(row, 2)"
-            >质检项请托</el-link
+            >质检请托</el-link
           >
 
           <el-link

+ 288 - 14
src/views/inspectionWork/mixins/detailMixins.js

@@ -544,6 +544,287 @@ export default {
             return this.disposeTypeMap[_row.disposeType];
           }
         }
+      ],
+      entrustColumns: [
+        {
+          columnKey: 'index',
+          label: '序号',
+          type: 'index',
+          width: 55,
+          align: 'center',
+          showOverflowTooltip: true,
+          fixed: 'left'
+        },
+        {
+          prop: 'code',
+          label: '请托单号',
+          showOverflowTooltip: true,
+          align: 'center',
+          minWidth: 130
+        },
+        {
+          prop: 'name',
+          label: '任务名称',
+          showOverflowTooltip: true,
+          align: 'center',
+          minWidth: 110
+        },
+
+        {
+          prop: 'sampleQuantity',
+          label: '样品数',
+          showOverflowTooltip: true,
+          align: 'center',
+          formatter: (row) => {
+            if (row.sampleQuantity) {
+              return (
+                row.sampleQuantity + this.sourceData2[0]?.measureUnit || ''
+              );
+            }
+          },
+          minWidth: 110
+        },
+        {
+          prop: 'sampleQualifiedNumber',
+          label: '样品合格数',
+          showOverflowTooltip: true,
+          align: 'center',
+          formatter: (row) => {
+            if (row.sampleQualifiedNumber) {
+              return (
+                row.sampleQualifiedNumber + this.sourceData2[0]?.measureUnit ||
+                ''
+              );
+            }
+          },
+          minWidth: 110
+        },
+        {
+          prop: 'sampleNoQualifiedNumber',
+          label: '样品不合格数',
+          showOverflowTooltip: true,
+          align: 'center',
+          formatter: (row) => {
+            if (row.sampleNoQualifiedNumber) {
+              return (
+                row.sampleNoQualifiedNumber +
+                  this.sourceData2[0]?.measureUnit || ''
+              );
+            }
+          },
+          minWidth: 110
+        },
+        {
+          prop: 'lossNumber',
+          label: '损耗数(合格品)',
+          showOverflowTooltip: true,
+          align: 'center',
+          formatter: (row) => {
+            if (row.lossNumber) {
+              return row.lossNumber + this.sourceData2[0]?.measureUnit || '';
+            }
+          },
+          minWidth: 110
+        },
+        {
+          prop: 'lossNumberUnqualified',
+          label: '损耗数(不合格品)',
+          showOverflowTooltip: true,
+          align: 'center',
+          formatter: (row) => {
+            if (row.lossNumberUnqualified) {
+              return (
+                row.lossNumberUnqualified + this.sourceData2[0]?.measureUnit ||
+                ''
+              );
+            }
+          },
+          minWidth: 110
+        },
+        {
+          prop: 'retainedSampleQuantity',
+          label: '留样数(合格品)',
+          showOverflowTooltip: true,
+          align: 'center',
+          formatter: (row) => {
+            if (row.retainedSampleQuantity) {
+              return (
+                row.retainedSampleQuantity + this.sourceData2[0]?.measureUnit ||
+                ''
+              );
+            }
+          },
+          minWidth: 110
+        },
+        {
+          prop: 'retainedSampleUnqualified',
+          label: '留样数(不合格品)',
+          formatter: (row) => {
+            if (row.retainedSampleUnqualified) {
+              return (
+                row.retainedSampleUnqualified +
+                  this.sourceData2[0]?.measureUnit || ''
+              );
+            }
+          },
+          showOverflowTooltip: true,
+          align: 'center',
+          minWidth: 110
+        },
+        {
+          prop: 'status',
+          minWidth: 110,
+          label: '状态',
+          align: 'center',
+          formatter: (row) => {
+            return row.status == 0
+              ? '待收样'
+              : row.status == 1
+              ? '未报工'
+              : '已报工';
+          },
+          showOverflowTooltip: true
+        }
+      ],
+      taskColumns: [
+        {
+          columnKey: 'index',
+          label: '序号',
+          type: 'index',
+          width: 55,
+          align: 'center',
+          showOverflowTooltip: true,
+          fixed: 'left'
+        },
+        {
+          prop: 'code',
+          label: '质检任务单号',
+          showOverflowTooltip: true,
+          align: 'center',
+          minWidth: 130
+        },
+        {
+          prop: 'name',
+          label: '任务名称',
+          showOverflowTooltip: true,
+          align: 'center',
+          minWidth: 110
+        },
+        {
+          prop: 'sampleQuantity',
+          label: '样品数',
+          showOverflowTooltip: true,
+          align: 'center',
+          formatter: (row) => {
+            if (row.sampleQuantity) {
+              return (
+                row.sampleQuantity + this.sourceData2[0]?.measureUnit || ''
+              );
+            }
+          },
+          minWidth: 110
+        },
+        {
+          prop: 'sampleQualifiedNumber',
+          label: '样品合格数',
+          showOverflowTooltip: true,
+          align: 'center',
+          formatter: (row) => {
+            if (row.sampleQualifiedNumber) {
+              return (
+                row.sampleQualifiedNumber + this.sourceData2[0]?.measureUnit ||
+                ''
+              );
+            }
+          },
+          minWidth: 110
+        },
+        {
+          prop: 'sampleNoQualifiedNumber',
+          label: '样品不合格数',
+          showOverflowTooltip: true,
+          align: 'center',
+          formatter: (row) => {
+            if (row.sampleNoQualifiedNumber) {
+              return (
+                row.sampleNoQualifiedNumber +
+                  this.sourceData2[0]?.measureUnit || ''
+              );
+            }
+          },
+          minWidth: 110
+        },
+        {
+          prop: 'lossNumber',
+          label: '损耗数(合格品)',
+          showOverflowTooltip: true,
+          align: 'center',
+          formatter: (row) => {
+            if (row.lossNumber) {
+              return row.lossNumber + this.sourceData2[0]?.measureUnit || '';
+            }
+          },
+          minWidth: 110
+        },
+        {
+          prop: 'lossNumberUnqualified',
+          label: '损耗数(不合格品)',
+          showOverflowTooltip: true,
+          align: 'center',
+          formatter: (row) => {
+            if (row.lossNumberUnqualified) {
+              return (
+                row.lossNumberUnqualified + this.sourceData2[0]?.measureUnit ||
+                ''
+              );
+            }
+          },
+          minWidth: 110
+        },
+        {
+          prop: 'retainedSampleQuantity',
+          label: '留样数(合格品)',
+          showOverflowTooltip: true,
+          align: 'center',
+          formatter: (row) => {
+            if (row.retainedSampleQuantity) {
+              return (
+                row.retainedSampleQuantity + this.sourceData2[0]?.measureUnit ||
+                ''
+              );
+            }
+          },
+          minWidth: 110
+        },
+        {
+          prop: 'retainedSampleUnqualified',
+          label: '留样数(不合格品)',
+          formatter: (row) => {
+            if (row.retainedSampleUnqualified) {
+              return (
+                row.retainedSampleUnqualified +
+                  this.sourceData2[0]?.measureUnit || ''
+              );
+            }
+          },
+          showOverflowTooltip: true,
+          align: 'center',
+          minWidth: 110
+        },
+        {
+          prop: 'status',
+          minWidth: 110,
+          label: '状态',
+          align: 'center',
+          formatter: (row) => {
+            return row.status == 0
+              ? '待收样'
+              : row.status == 1
+              ? '未报工'
+              : '已报工';
+          },
+          showOverflowTooltip: true
+        }
       ]
     };
   },
@@ -727,20 +1008,14 @@ export default {
           show: this.form.recordingMethod != 1
         },
         {
-          label: '质检状态',
-          prop: 'qualityStatus',
+          label: '状态',
+          prop: 'status',
           align: 'center',
           show: this.form.recordingMethod != 1,
           formatter: (row) => {
-            if (row.qualityStatus == 0) {
-              return '未检';
-            }
-            if (row.qualityStatus == 1) {
-              return '已检';
-            }
-            if (row.qualityStatus == 2) {
-              return '待检';
-            }
+            return inspectionProjectStatus.find(
+              (item) => item.value == scope.row.status
+            )?.label;
           }
         }
       ];
@@ -964,8 +1239,7 @@ export default {
     },
     //合格/不合格数操作
     isQualifiedQuantity(item, index, key) {
-
-      if (Number(item[key]) >Number(item.sampleQuantity)) {
+      if (Number(item[key]) > Number(item.sampleQuantity)) {
         this.$message.error(
           (key == 'qualifiedQuantity' ? '合格' : '不合格') +
             '数量不能大于样品数'
@@ -996,7 +1270,7 @@ export default {
               Number(item.retainedSampleUnqualified)
       };
 
-      if (Number(item[key]) >Number(item[keyObj.key])) {
+      if (Number(item[key]) > Number(item[keyObj.key])) {
         this.$message.error(
           title + keyObj.title + '不能大于样品' + keyObj.title
         );