Browse Source

feat(inspection): 添加检验项目委托及样品报告组件

yusheng 1 tháng trước cách đây
mục cha
commit
5c936f1e86

+ 83 - 0
src/views/bpm/handleTask/components/inspectionProjectRequest/inspectionProjectEntrusted.vue

@@ -0,0 +1,83 @@
+<!-- 用户编辑弹窗 -->
+<template>
+  <div>
+    <inspectionProjectReport
+      v-if="type == 1"
+      ref="inspectionProjectReportRef"
+    ></inspectionProjectReport>
+    <sampleReport ref="sampleReportRef" v-if="type == 2"></sampleReport>
+  </div>
+</template>
+
+<script>
+  import { requestentrustGetById } from '@/api/bpm/components/inspectionProjectRequest';
+  import inspectionProjectReport from './inspectionProjectReport.vue';
+  import sampleReport from './sampleReport.vue';
+
+  export default {
+    // mixins: [dictMixins],
+    components: { inspectionProjectReport, sampleReport },
+
+    data() {
+      return { type: 1 };
+    },
+    computed: {},
+
+    created() {
+      this.init();
+    },
+    props: {
+      businessId: {
+        default: ''
+      }
+    },
+    methods: {
+      async init() {
+        const res = await requestentrustGetById(this.businessId);
+        if (res.recordingMethod == 1 && !res.sampleTranscriptList?.length) {
+          this.type = 1;
+          this.$nextTick(() => {
+            this.$refs.inspectionProjectReportRef.open({
+              workData: {
+                ...res,
+                workSampleCount: res.sampleTotal
+              },
+              list: res.templateList
+            });
+          });
+        } else {
+          // if (res.data.sampleTranscriptList.length) {
+          //   this.type = 2;
+
+          //   res.data.sampleList = res.data.sampleTranscriptList.map((item) => {
+          //     return {
+          //       ...item,
+          //       qualitySampleTemplateList: item.selfCheckList.map(
+          //         (selfCheck) => {
+          //           return {
+          //             ...selfCheck,
+          //             qualityResultContent: selfCheck.selfCheckContent
+          //           };
+          //         }
+          //       )
+          //     };
+          //   });
+          // }
+          this.type = 2;
+          this.$nextTick(() => {
+            this.$refs.sampleReportRef.open(res);
+          });
+        }
+      }
+    }
+  };
+</script>
+
+<style scoped lang="scss">
+  ::v-deep .warn {
+    color: red;
+    .el-input__inner {
+      color: red;
+    }
+  }
+</style>

+ 712 - 0
src/views/bpm/handleTask/components/inspectionProjectRequest/inspectionProjectReport.vue

@@ -0,0 +1,712 @@
+<!-- 用户编辑弹窗 -->
+<template>
+  <div>
+    <ele-pro-table
+      :needPage="false"
+      :columns="workColumns"
+      :datasource="[form]"
+    >
+      <template v-slot:toolbar>
+        样品总数:{{ form.workSampleCount }}{{ form.measureUnit }}
+      </template>
+      <!-- <template v-slot:craftFiles="{ row }">
+        <el-link type="primary" :underline="false" @click="craftFiles(row)"
+          >工艺文件</el-link
+        >
+      </template> -->
+
+      <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>
+        </el-input>
+      </template>
+      <template v-slot:accessory="{ row }">
+        <fileMain v-model="row.accessory" type="view"></fileMain>
+      </template>
+      <template v-slot:sampleQuantity="{ row }">
+        <el-input
+          v-model="row.sampleQuantity"
+          placeholder=" "
+          type="number"
+          disabled
+        >
+          <template slot="append">{{ form.measureUnit }}</template>
+        </el-input>
+      </template>
+      <template v-slot:sampleNoQualifiedNumber="{ row }">
+        <el-input
+          v-model="row.sampleNoQualifiedNumber"
+          @input="formSampleNoQualifiedNumberChange"
+          placeholder=" "
+          type="number"
+          disabled
+        >
+          <template slot="append">{{ form.measureUnit }}</template>
+        </el-input>
+      </template>
+    </ele-pro-table>
+    <ele-pro-table
+      :needPage="false"
+      :columns="tableColumns"
+      :datasource="tableData"
+    >
+      <template v-slot:toolbar>
+        <div
+          style="
+            display: flex;
+            justify-content: space-between;
+            align-items: center;
+          "
+        >
+          <span>
+            当前检测剩余样品数:{{ form.sampleQuantity
+            }}{{ form.measureUnit }}</span
+          >
+        </div>
+      </template>
+      <template v-slot:qualityStandardType="{ row }">
+        {{ getDictValue('质检标准类型', row.qualityStandardType) }}
+      </template>
+      <template v-slot:executionMethod="{ row }">
+        <el-select v-model="row.executionMethod" style="width: 100%" disabled>
+          <el-option :value="1" label="常规检验"></el-option>
+          <el-option :value="2" label="实验"></el-option>
+        </el-select>
+      </template>
+      <!-- <template v-slot:useTools="{ row }">
+        <toolButtom v-model="row.useTools" :type="type" :sList="row.toolList" />
+      </template> -->
+      <template v-slot:qualityResultContent="{ row }">
+        <el-input
+          v-model="row.qualityResultContent"
+          placeholder="请输入内容"
+          disabled
+        >
+          <template slot="append" v-if="row.unitName">
+            {{ row.unitName }}
+          </template>
+        </el-input>
+      </template>
+      <template v-slot:sampleQuantity="{ row, $index }">
+        <el-input
+          v-model="row.sampleQuantity"
+          placeholder="请输入"
+          disabled
+          type="number"
+        >
+          <template slot="append">{{ form.measureUnit }}</template>
+        </el-input>
+      </template>
+
+      <template v-slot:qualifiedQuantity="{ row, $index }">
+        <el-input
+          v-model="row.qualifiedQuantity"
+          placeholder="请输入"
+          disabled
+          type="number"
+        >
+          <template slot="append">{{ form.measureUnit }}</template>
+        </el-input>
+      </template>
+      <template v-slot:noQualifiedQuantity="{ row, $index }">
+        <el-input
+          v-model="row.noQualifiedQuantity"
+          placeholder="请输入"
+          disabled
+          type="number"
+        >
+          <template slot="append">{{ form.measureUnit }}</template>
+        </el-input>
+      </template>
+      <template v-slot:lossNumber="{ row, $index }">
+        <el-input
+          v-model="row.lossNumber"
+          placeholder="请输入"
+          disabled
+          type="number"
+          @click.native="curretNum = row.lossNumber"
+        >
+          <template slot="append">{{ form.measureUnit }}</template>
+        </el-input>
+      </template>
+      <template v-slot:lossNumberUnqualified="{ row, $index }">
+        <el-input
+          v-model="row.lossNumberUnqualified"
+          placeholder="请输入"
+          disabled
+          type="number"
+          @click.native="curretNum = row.lossNumberUnqualified"
+        >
+          <template slot="append">{{ form.measureUnit }}</template>
+        </el-input>
+      </template>
+      <template v-slot:retainedSampleQuantity="{ row, $index }">
+        <el-input
+          v-model="row.retainedSampleQuantity"
+          placeholder="请输入"
+          disabled
+          type="number"
+          @click.native="curretNum = row.retainedSampleQuantity"
+        >
+          <template slot="append">{{ form.measureUnit }}</template>
+        </el-input>
+      </template>
+      <template v-slot:retainedSampleUnqualified="{ row, $index }">
+        <el-input
+          v-model="row.retainedSampleUnqualified"
+          placeholder="请输入"
+          disabled
+          type="number"
+          @click.native="curretNum = row.retainedSampleUnqualified"
+        >
+          <template slot="append">{{ form.measureUnit }}</template>
+        </el-input>
+      </template>
+      <template v-slot:qualityResults="{ row, $index }">
+        <el-select
+          v-model="row.qualityResults"
+          placeholder="请选择"
+          style="width: 100%"
+          disabled
+        >
+          <el-option
+            v-for="item in qualityResultsList"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          >
+          </el-option>
+        </el-select>
+      </template>
+      <template v-slot:inspectImage="{ row, $index }">
+        <fileMain v-model="row.inspectImage" type="view"></fileMain>
+      </template>
+      <template v-slot:imgUrl="{ row, $index }">
+        <fileMain v-model="row.imgUrl" type="view"></fileMain>
+      </template>
+      <template v-slot:defaultValue="{ row }">
+        <div style="display: flex; justify-content: center; color: #409eff">
+          <span v-if="row.textType != 8">{{ row.symbol }}</span>
+          <span v-if="row.textType == 3">
+            {{ row.minValue }}-{{ row.maxValue }}
+          </span>
+          <span v-else-if="row.textType == 8">
+            标准值:{{ row.defaultValue }}{{ row.unitName || '' }} 下限:{{
+              row.minValue || 0
+            }}{{ row.unitName || '' }} 上限:{{ row.maxValue || 0
+            }}{{ row.unitName || '' }}
+          </span>
+          <span v-else>
+            <span>{{ row.defaultValue }}</span>
+          </span>
+          <span v-if="row.textType != 8">
+            {{ row.unitName }}
+          </span>
+        </div>
+      </template>
+      <template v-slot:inspectionName="{ row }">
+        <span style="color: #409eff">{{ row.inspectionName }}</span>
+      </template>
+      <template v-slot:isRequired="{ column }">
+        <span class="is-required">{{ column.label }}</span>
+      </template>
+      <!-- <template v-slot:action="{ row }">
+        <el-link
+          type="primary"
+          :underline="false"
+          @click="experimentReport(row, 'report')"
+          v-if="row.executionMethod == 2"
+        >
+          实验
+        </el-link>
+      </template> -->
+    </ele-pro-table>
+  </div>
+</template>
+
+<script>
+  import dictMixins from '@/mixins/dictMixins';
+
+  export default {
+    mixins: [dictMixins],
+
+    data() {
+      return {
+        form: {},
+        tableData: [],
+        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: 120,
+            prop: 'total',
+            align: 'center',
+            label: '总数量',
+            formatter: (row) => {
+              if (row.total) {
+                return row.total + this.form.measureUnit || '';
+              }
+            },
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 180,
+            prop: 'sampleQuantity',
+            headerSlot: 'isRequired',
+            slot: 'sampleQuantity',
+            align: 'center',
+            label: '样品数',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 180,
+            prop: 'sampleNoQualifiedNumber',
+            slot: 'sampleNoQualifiedNumber',
+            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: 140,
+            prop: 'lossNumber',
+            slot: 'lossNumber',
+            align: 'center',
+            formatter: (row) => {
+              if (row.lossNumber) {
+                return row.lossNumber + (this.form.measureUnit || '');
+              }
+            },
+            label: '损耗数(合格品)',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 140,
+            prop: 'lossNumberUnqualified',
+            slot: 'lossNumberUnqualified',
+            align: 'center',
+            formatter: (row) => {
+              if (row.lossNumberUnqualified) {
+                return (
+                  row.lossNumberUnqualified + (this.form.measureUnit || '')
+                );
+              }
+            },
+            label: '损耗数(不合格品)',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 140,
+            prop: 'retainedSampleQuantity',
+            slot: 'retainedSampleQuantity',
+            align: 'center',
+            formatter: (row) => {
+              if (row.retainedSampleQuantity) {
+                return (
+                  row.retainedSampleQuantity + (this.form.measureUnit || '')
+                );
+              }
+            },
+            label: '留样数(合格品)',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 140,
+            prop: 'retainedSampleUnqualified',
+            slot: 'retainedSampleUnqualified',
+            align: 'center',
+            formatter: (row) => {
+              if (row.retainedSampleUnqualified) {
+                return (
+                  row.retainedSampleUnqualified + (this.form.measureUnit || '')
+                );
+              }
+            },
+            label: '留样数(不合格品)',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 120,
+            prop: 'hours',
+            slot: 'hours',
+            align: 'center',
+            label: '工时',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 120,
+            prop: 'accessory',
+            slot: 'accessory',
+            align: 'center',
+            label: '附件',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 120,
+            prop: 'qualityNames',
+            slot: 'qualityNames',
+            align: 'center',
+            label: '检测人',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 120,
+            prop: 'qualityTimeEnd',
+            slot: 'qualityTimeEnd',
+            align: 'center',
+            label: '检测时间',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 120,
+            prop: 'craftFiles',
+            slot: 'craftFiles',
+            align: 'center',
+            label: '工艺文件',
+            fixed: 'right',
+            showOverflowTooltip: true
+          }
+        ],
+
+        qualityResultsList: [
+          {
+            value: 1,
+            label: '合格'
+          },
+          {
+            value: 2,
+            label: '不合格'
+          },
+          {
+            value: 3,
+            label: '让步接收'
+          }
+        ]
+      };
+    },
+    computed: {
+      tableColumns() {
+        return [
+          {
+            width: 45,
+            type: 'index',
+            columnKey: 'index',
+            align: 'center',
+            fixed: 'left'
+          },
+          {
+            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',
+            slot: 'inspectionName',
+            align: 'center',
+            label: '检测项名称',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 100,
+            prop: 'qualityStandardType',
+            slot: 'qualityStandardType',
+            align: 'center',
+            label: '执行标准',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 320,
+            slot: 'defaultValue',
+            prop: 'defaultValue',
+            align: 'center',
+            label: '工艺参数',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 130,
+            prop: 'executionMethod',
+            slot: 'executionMethod',
+            align: 'center',
+            label: '执行方法',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 100,
+            prop: 'useTools',
+            slot: 'useTools',
+            align: 'center',
+            label: '检测工具',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 200,
+            prop: 'qualityResultContent',
+            align: 'center',
+            slot: 'qualityResultContent',
+            headerSlot: this.qms_qualityResultContent == 1 ? 'isRequired' : '',
+            label: '检测内容',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 180,
+            prop: 'sampleQuantity',
+            slot: 'sampleQuantity',
+            headerSlot: 'isRequired',
+
+            align: 'center',
+            label: '样品数',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 180,
+            prop: 'qualifiedQuantity',
+            align: 'center',
+            slot: 'qualifiedQuantity',
+            label: '合格数',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 180,
+            prop: 'noQualifiedQuantity',
+            slot: 'noQualifiedQuantity',
+            align: 'center',
+            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: 130,
+            prop: 'qualityResults',
+            slot: 'qualityResults',
+            align: 'center',
+            label: '检测结果',
+            showOverflowTooltip: true,
+            fixed: 'right'
+          },
+          {
+            minWidth: 150,
+            prop: 'experimentCode',
+            align: 'center',
+            label: '实验编号',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 120,
+            prop: 'inspectImage',
+            slot: 'inspectImage',
+            align: 'center',
+            label: '检验图片',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 100,
+            prop: 'imgUrl',
+            slot: 'imgUrl',
+            align: 'center',
+            label: '附件',
+            showOverflowTooltip: true
+          }
+        ];
+      }
+    },
+
+    created() {
+      this.requestDict('质检计划类型');
+      this.requestDict('取样类型');
+      this.requestDict('质检标准类型');
+    },
+
+    methods: {
+      async open({ workData, row, list }) {
+        this.$set(this, 'form', JSON.parse(JSON.stringify(workData)));
+        this.$set(
+          this.form,
+          'sampleNoQualifiedNumber',
+          this.form.sampleNoQualifiedNumber || 0
+        );
+        this.$set(
+          this.form,
+          'sampleQualifiedNumber',
+          this.form.sampleQualifiedNumber ||
+            this.form.sampleQuantity - this.form.sampleNoQualifiedNumber ||
+            0
+        );
+
+        this.tableData = JSON.parse(JSON.stringify(list));
+      }
+    }
+  };
+</script>
+
+<style scoped lang="scss">
+  ::v-deep .warn {
+    color: red;
+    .el-input__inner {
+      color: red;
+    }
+  }
+</style>

+ 413 - 0
src/views/bpm/handleTask/components/inspectionProjectRequest/sampleListDialog.vue

@@ -0,0 +1,413 @@
+<!-- 用户编辑弹窗 -->
+<template>
+  <ele-modal
+    :title="title"
+    :visible.sync="visible"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    append-to-body
+    width="80%"
+    :maxable="true"
+  >
+    <el-table :data="tableData" :default-expand-all="true">
+      <el-table-column type="expand">
+        <template slot-scope="props">
+          <div style="padding: 10px">
+            <el-table :data="props.row.qualitySampleTemplateList" border>
+              <el-table-column
+                label="检测方案编码"
+                prop="qualitySchemeTemplateCode"
+                align="center"
+                show-overflow-tooltip
+              >
+                <template slot-scope="scope">
+                  <span :class="scope.row.qualityResults === 2 ? 'warn' : ''">
+                    {{ scope.row.qualitySchemeTemplateCode }}
+                  </span>
+                </template>
+              </el-table-column>
+              <el-table-column
+                label="检测方案名称"
+                prop="qualitySchemeTemplateName"
+                align="center"
+                show-overflow-tooltip
+              >
+                <template slot-scope="scope">
+                  <span :class="scope.row.qualityResults === 2 ? 'warn' : ''">
+                    {{ scope.row.qualitySchemeTemplateName }}
+                  </span>
+                </template>
+              </el-table-column>
+              <el-table-column
+                label="检测类型"
+                prop="categoryLevelClassName"
+                align="center"
+                show-overflow-tooltip
+              >
+                <template slot-scope="scope">
+                  <span :class="scope.row.qualityResults === 2 ? 'warn' : ''">
+                    {{ scope.row.categoryLevelClassName }}
+                  </span>
+                </template>
+              </el-table-column>
+              <el-table-column
+                label="检测项编码"
+                prop="inspectionCode"
+                align="center"
+                show-overflow-tooltip
+              >
+                <template slot-scope="scope">
+                  <span :class="scope.row.qualityResults === 2 ? 'warn' : ''">
+                    {{ scope.row.inspectionCode }}
+                  </span>
+                </template>
+              </el-table-column>
+              <el-table-column
+                label="检测项名称"
+                prop="inspectionName"
+                align="center"
+                show-overflow-tooltip
+              >
+                <template slot-scope="scope">
+                  <span :class="scope.row.qualityResults === 2 ? 'warn' : ''">
+                    {{ scope.row.inspectionName }}
+                  </span>
+                </template>
+              </el-table-column>
+              <el-table-column
+                label="工艺参数"
+                prop="defaultValue"
+                align="center"
+                show-overflow-tooltip
+                min-width="220px"
+              >
+                <template slot-scope="scope">
+                  <!-- <span :class="scope.row.qualityResults === 2 ? 'warn' : ''">
+                    {{ scope.row.defaultValue }}
+                  </span> -->
+                  <div
+                    style="display: flex; justify-content: center"
+                    :class="scope.row.qualityResults === 2 ? 'warn' : ''"
+                  >
+                    <span v-if="scope.row.textType != 8">{{
+                      scope.row.symbol
+                    }}</span>
+                    <span v-if="scope.row.textType == 3">
+                      {{ scope.row.minValue }}-{{ scope.row.maxValue }}
+                    </span>
+                    <span v-else-if="scope.row.textType == 8">
+                      标准值:{{ scope.row.defaultValue
+                      }}{{ scope.row.unitName || '' }} 下限:{{
+                        scope.row.minValue || 0
+                      }}{{ scope.row.unitName || '' }} 上限:{{
+                        scope.row.maxValue || 0
+                      }}{{ scope.row.unitName || '' }}
+                    </span>
+                    <span v-else>
+                      <span>{{ scope.row.defaultValue }}</span>
+                    </span>
+                    <span v-if="scope.row.textType != 8">
+                      {{ scope.row.unitName }}
+                    </span>
+                  </div>
+                </template>
+              </el-table-column>
+              <!-- <el-table-column label="检测工具" prop="" align="center">
+                <template slot-scope="scope">
+                  <toolButtom
+                    v-model="scope.row.useTools"
+                    :type="
+                      !pageName && props.row.correlationId ? 'detail' : type
+                    "
+                    :sList="scope.row.toolList"
+                  />
+                </template>
+              </el-table-column> -->
+
+              <!-- @blur="(e) => inputResultContent(e, scope.row)" -->
+              <el-table-column
+                label="检测内容"
+                prop="qualityResultContent"
+                align="center"
+                fixed="right"
+                width="360"
+              >
+                <template slot-scope="scope">
+                  <el-input
+                    :class="scope.row.qualityResults === 2 ? 'warn' : ''"
+                    v-model="scope.row.qualityResultContent"
+                    placeholder="请输入内容"
+                    disabled
+                  >
+                    <template slot="append" v-if="scope.row.unitName">
+                      {{ scope.row.unitName }}
+                    </template>
+                  </el-input>
+                </template>
+              </el-table-column>
+              <el-table-column
+                label="检测结果"
+                prop="qualityResults"
+                align="center"
+                fixed="right"
+              >
+                <template slot-scope="scope">
+                  <el-select
+                    v-if="
+                      !['炉水电导率', '给水电导率'].includes(
+                        scope.row.inspectionName
+                      )
+                    "
+                    v-model="scope.row.qualityResults"
+                    placeholder="请选择"
+                    style="width: 100%"
+                    disabled
+                  >
+                    <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>
+          </div>
+        </template>
+      </el-table-column>
+      <template v-for="column in tableColumns">
+        <el-table-column
+          :label="column.label"
+          :prop="column.prop"
+          :fixed="column.fixed"
+          :show-overflow-tooltip="true"
+          :width="column.width"
+          :align="column.align"
+          :formatter="column.formatter"
+        >
+          <!-- <template slot-scope="scope" v-if="column.slot=='qualityResults'">
+            <el-select
+              v-model="scope.row.qualityResults"
+              placeholder="请选择"
+              style="width: 100%"
+              :disabled="type == 'detail'"
+            >
+              <el-option
+                v-for="item in qualityResultsList"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
+          </template> -->
+        </el-table-column>
+      </template>
+      <!-- <el-table-column label="操作" align="center" width="80">
+        <template slot-scope="scope">
+          <el-link
+            :underline="false"
+            type="primary"
+            @click="handleDispose(scope.$index, scope.row, 'dispose')"
+          >
+            处置
+          </el-link>
+        </template>
+      </el-table-column> -->
+    </el-table>
+  </ele-modal>
+</template>
+
+<script>
+  export default {
+    components: {},
+    data() {
+      return {
+        title: '',
+        visible: false,
+        rowIndex: 0,
+        type: '',
+        tableData: [],
+        pageName: '',
+        tableColumns: [
+          {
+            label: '编码',
+            prop: 'categoryCode',
+            width: '150',
+            align: 'center'
+          },
+          {
+            label: '名称',
+            prop: 'categoryName',
+            width: '150',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          { label: '批次号', prop: 'batchNo', align: 'center' },
+          // { label: '发货条码', prop: 'barcodes', align: 'center' },
+          { label: '包装编码', prop: 'packageNo', align: 'center' },
+          { label: '样品编码', prop: 'sampleCode', align: 'center' },
+          { label: '包装数量', prop: 'packingQuantity', align: 'center' },
+          // { label: '包装单位', prop: 'packingUnit', align: 'center' },
+          { label: '样品数量', prop: 'measureQuantity', align: 'center' },
+          // { label: '计量单位', prop: 'measureUnit', align: 'center' },
+          { label: '物料代号', prop: 'materielDesignation', align: 'center' },
+          { label: '客户代号', prop: 'clientCode', align: 'center' },
+          { label: '刻码', prop: 'engrave', align: 'center' },
+          {
+            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' },
+          { label: '重量单位', prop: 'weightUnit', align: 'center' },
+          { label: '仓库', prop: 'warehouseName', align: 'center' },
+          {
+            label: '检测结果',
+            prop: 'qualityResults',
+            align: 'center',
+            slot: 'qualityResults',
+            formatter: (row, column) => {
+              if (row.qualityResults) {
+                return row.qualityResults == 1
+                  ? '合格'
+                  : row.qualityResults == 2
+                  ? '不合格'
+                  : row.qualityResults == 3
+                  ? '让步接收'
+                  : '';
+              }
+            }
+          }
+          // { 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: '让步接收'
+          }
+        ],
+        clientEnvironmentId: '',
+        sList: [] //检测工具筛选
+      };
+    },
+    computed: {},
+
+    created() {},
+    methods: {
+      async openDia(index, row, type, list, isStatus, sList, pageName) {
+        this.clientEnvironmentId =
+          this.$store.state.user.info.clientEnvironmentId;
+        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) {
+          for (let i = 0; i < list[0].qualitySampleTemplateList.length; i++) {
+            list[0].qualitySampleTemplateList[i].qualityResults = list[0]
+              .qualityResults
+              ? list[0].qualityResults
+              : 1;
+          }
+        }
+        // 默认合格
+        list.map((item) => {
+          item.qualitySampleTemplateList &&
+            item.qualitySampleTemplateList.map((el) => {
+              el.qualityResults = el.qualityResults ? el.qualityResults : 1;
+            });
+        });
+        this.tableData = JSON.parse(JSON.stringify(list));
+        console.log(this.tableData, '33333333333333333');
+
+        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) {
+        this.$emit('handleDispose', index, row, type);
+      },
+      //宇信特殊处理
+      newHandleInput(arr, index) {
+        let num = arr.find(
+          (item) => item.inspectionName == '炉水电导率'
+        )?.qualityResultContent;
+        let num1 = arr.find(
+          (item) => item.inspectionName == '给水电导率'
+        )?.qualityResultContent;
+        console.log(num, num1);
+
+        arr.forEach((item, i) => {
+          if (num && num1 && item.inspectionName == '干度值') {
+            let val = parseFloat(
+              (((num - num1 / 1000) / num) * 100).toFixed(5)
+            );
+            this.$set(
+              this.tableData[index].qualitySampleTemplateList[i],
+              'qualityResultContent',
+              val
+            );
+
+            this.handleInput(item, val, this.tableData);
+          }
+        });
+      },
+
+      //选择检测工具
+      openToolList(index, row) {
+        this.$emit('openToolList', index, row);
+      }
+    }
+  };
+</script>
+
+<style scoped lang="scss">
+  ::v-deep .warn {
+    color: red;
+    .el-input__inner {
+      color: red;
+    }
+  }
+</style>

+ 675 - 0
src/views/bpm/handleTask/components/inspectionProjectRequest/sampleReport.vue

@@ -0,0 +1,675 @@
+<!-- 用户编辑弹窗 -->
+<template>
+  <div>
+    <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
+        >
+        </el-input>
+      </template>
+      <template v-slot:lossNumber="{ row, $index }">
+        <el-input
+          v-model="row.lossNumber"
+          placeholder="请输入"
+          disabled
+          type="number"
+        >
+          <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="number"
+        >
+          <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="number"
+        >
+          <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="number"
+        >
+          <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
+                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
+                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
+                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
+                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="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
+            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
+            disabled
+          >
+            <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
+            disabled
+          >
+            <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>
+
+    <sampleListDialog
+      ref="detailRef"
+      @handleConfirm="handleConfirm"
+      @handleDispose="handleDispose"
+    ></sampleListDialog>
+  </div>
+</template>
+
+<script>
+  import dictMixins from '@/mixins/dictMixins';
+  import sampleListDialog from './sampleListDialog.vue';
+
+  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: [
+          {
+            label: '待检',
+            value: 0,
+            type: 'info'
+          },
+          {
+            label: '已检',
+            value: 1,
+            type: 'success'
+          },
+          {
+            label: '已派单',
+            value: 2,
+            type: 'warning'
+          },
+          {
+            label: '已请托',
+            value: 3,
+            type: 'warning'
+          },
+          {
+            label: '检验中',
+            value: 4,
+            type: ''
+          }
+        ],
+
+        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: '让步接收'
+          }
+        ],
+
+        sampleList: []
+      };
+    },
+    computed: {},
+
+    created() {
+      this.requestDict('质检计划类型');
+      this.requestDict('取样类型');
+      this.requestDict('质检标准类型');
+    },
+    methods: {
+      handleDetail(index, row, type) {
+        this.$refs.detailRef.openDia(
+          index,
+          row,
+          type,
+          [row],
+          null,
+          [],
+          this.pageName
+        );
+      },
+      initQms() {
+        this.form.sampleNoQualifiedNumber = 0;
+        this.form.sampleQualifiedNumber = 0;
+
+        this.sampleList
+          .filter((item) => item.status == 1)
+          .forEach((item) => {
+            if (item.qualityResults == 1) {
+              this.form.sampleQualifiedNumber += Number(item.measureQuantity);
+            } else {
+              this.form.sampleNoQualifiedNumber += Number(item.measureQuantity);
+            }
+          });
+        if (this.form.recordingMethod == 1) {
+          this.form.sampleQuantity =
+            this.form.sampleQualifiedNumber + this.form.sampleNoQualifiedNumber;
+        }
+      },
+
+      async open(row, type, pageName) {
+        this.form = JSON.parse(JSON.stringify(row));
+        this.sampleList = this.form.sampleList;
+        this.initQms();
+      }
+    }
+  };
+</script>
+
+<style scoped lang="scss">
+  ::v-deep .warn {
+    color: red;
+    .el-input__inner {
+      color: red;
+    }
+  }
+</style>

+ 1 - 1
vue.config.js

@@ -38,7 +38,7 @@ module.exports = {
         // target: 'http://124.71.68.31:50001', // 测试环境
         // target: 'http://124.71.68.31:50001',
         // target: 'http://192.168.1.105:18086',
-        target: 'http://192.168.1.125:18086',
+        target: 'http://192.168.1.102:18086',
         // target: 'http://192.168.1.116:18086',
         // target: 'http://192.168.1.3:18086',
         // target: 'http://192.168.1.251:18186',