yijing 1 rok pred
rodič
commit
3b15e74923

+ 5 - 4
src/api/inspectionPlan/index.js

@@ -94,10 +94,11 @@ export async function getQualityTemplateList(params) {
   const res = await request.get(`/qms/qualitytemplate/getQualityTemplateList`, {
     params
   });
-  if (res.data.code == 0) {
-    return res.data.data;
-  }
-  return Promise.reject(new Error(res.data.message));
+  return res.data.data;
+  // if (res.data.code == 0) {
+  //   return res.data.data;
+  // }
+  // return Promise.reject(new Error(res.data.message));
 }
 
 

+ 119 - 89
src/views/inspectionPlan/components/edit.vue

@@ -89,7 +89,7 @@
 import baseInfo from './baseInfo.vue';
 
 import { getCode } from '@/api/login';
-import {save, update, planIssued} from '@/api/inspectionPlan';
+import { save, update, planIssued } from '@/api/inspectionPlan';
 import {
   getPurchaseWarehouseGoods,
   getQualityTemplateList,
@@ -205,7 +205,8 @@ export default {
       listPage: [],
 
       activeName: '1',
-      selectedList: []
+      selectedList: [],
+      isCheck: false
     };
   },
   computed: {
@@ -236,9 +237,6 @@ export default {
     // 切换质检内容
     handleClick(tab) {
       this.activeName = tab.name;
-      // if (this.activeName === '2') {
-      //   this.updateSampleList();
-      // }
     },
 
     checkSelectable(row, index) {
@@ -332,50 +330,43 @@ export default {
       this.schemePagination.currentPage = 1;
       this.schemePagination.total = this.schemeList.length;
     },
-    async getList(receiveNo, productCode, productCategoryId, productCategoryName,categoryid,batchNo) {
+    async getList(receiveNo, productCode, productCategoryId, productCategoryName, categoryid, batchNo) {
       //通过来源和产品 获取来料清单
-      await this.getGoodsList(receiveNo, productCode, null, productCategoryId, productCategoryName,categoryid,batchNo);
+      await this.getGoodsList(receiveNo, productCode, null, productCategoryId, productCategoryName, categoryid, batchNo);
 
-      //通过抽样方式获取样品列表 全检 样品列表等于来料清单列表
-      if (this.baseForm.qualityMode == 1) {
-        this.sampleList = this.packingList;
-        this.samplePagination.currentPage = 1;
-        this.samplePagination.total = this.packingList.length;
-      }
       //通过来源和产品 获取质检方案
       this.getQualityTemplate(productCode);
     },
-    async getGoodsList(receiveNo, productCode, ids, productCategoryId, productCategoryName,categoryid,batchNo) {
+    async getGoodsList(receiveNo, productCode, ids, productCategoryId, productCategoryName, categoryid, batchNo) {
       let res;
-      // 根据物品id 编码查询主数据中物品编码是否需要拆包 是走 包装明细表  否 走获取产品表
-      let cateRes = await getByCategoryId({
-        categoryId: categoryid
-      })
-      if (cateRes) {
-        if (cateRes.isUnpack == 1) {
-          res = await outInRecordsPage({
-            // receiveNo: receiveNo,
-            sourceBizNo: receiveNo,
-            categoryCode: productCode,
-            categoryId: categoryid,
-            qualityQlanId: ids,
-            size:-1
-          });
-        }else{
-          // 获取没有拆包的产品数据 --- 等接口
-         let resData = await getBatchInfoData({
-            sourceBizNo: receiveNo,
-            categoryCode: productCode,
-            batchNo: batchNo,
-          });
-         res.list = resData;
+      const res1 = await outInRecordsPage({
+        sourceBizNo: receiveNo,
+        categoryCode: productCode,
+        categoryId: categoryid,
+        qualityQlanId: ids,
+        size: -1
+      });
+      console.log(res1, 'res1')
+      if (res1.list.length > 0) {
+        res = res1.list
+        this.isCheck = true;
+      } else {
+        let resData = await getBatchInfoData({
+          sourceBizNo: receiveNo,
+          categoryCode: productCode,
+          batchNo: batchNo,
+        });
+        console.log(resData, 'resData')
+        if (resData) {
+          this.isCheck = false;
+          res = [resData];
         }
       }
 
       console.log(res, '来料清单');
-      if (Array.isArray(res?.list)) {
+      if (res.length > 0) {
         let _arr1 = [];
-        _arr1 = res.list.map((m) => {
+        _arr1 = res.map((m) => {
           m.sourceId = m.id;
           m.productCategoryId = productCategoryId;
           m.productCategoryName = productCategoryName;
@@ -387,41 +378,70 @@ export default {
         this.packingList = _arr1;
         this.pagination.total = this.packingList.length;
         console.log(this.packingList, '来料清单');
+        this.aaa();
       } else {
         this.packingList = [];
       }
     },
+    aaa() {
+      this.sampleList = [];
+      if (!this.isCheck) {
+        console.log(111111111111111, this.baseForm.productNumber)
+        let num = Number(this.baseForm.productNumber || 0);
+        if (num) {
+          let data = [];
+          for (let i = 0; i < num; i++) {
+            data.push(this.packingList[0]);
+          }
+
+          console.log(data, 'datadatadatadatadatadata', num)
+          this.sampleList = data;
+          this.samplePagination.currentPage = 1;
+          this.samplePagination.total = data.length;
+        }
+      } else {
+        this.sampleList = this.packingList;
+        this.samplePagination.currentPage = 1;
+        this.samplePagination.total = this.packingList.length;
+      }
+
+    },
     async getQualityTemplate(productCode, ids) {
-      let res = await getQualityTemplateList({
+
+      await getQualityTemplateList({
         productCode: productCode,
         qualityQlanId: ids
+      }).then((res) => {
+        console.log(res, 'resresresresresresresresresresresresresresresresresresresresresres')
+        this.baseForm.inspectionStandards = res?.inspectionStandards;
+
+        let combinedList = [];
+        for (let i = 0; i < res.qualityTemplateVOList.length; i++) {
+
+          res.qualityTemplateVOList[i].inspectionItemVOList = res.qualityTemplateVOList[i]?.inspectionItemVOList.map(
+            (item) => {
+              item.templateId = res.qualityTemplateVOList[i]?.id;
+              item.qualitySchemeTemplateCode =
+                res.qualityTemplateVOList[i]?.qualitySchemeTemplateCode;
+              item.qualitySchemeTemplateName =
+                res.qualityTemplateVOList[i]?.qualitySchemeTemplateName;
+
+              delete item.id;
+
+              return {
+                ...item
+              };
+            }
+          );
+          combinedList = combinedList.concat(res.qualityTemplateVOList[i].inspectionItemVOList);
+          console.log(combinedList, '质检方案');
+          this.schemeList = combinedList;
+          this.schemePagination.currentPage = 1;
+          this.schemePagination.total = this.schemeList.length;
+        }
       });
-      this.baseForm.inspectionStandards = res?.inspectionStandards;
 
-      let combinedList = [];
-      for (let i = 0; i < res.qualityTemplateVOList.length; i++) {
 
-        res.qualityTemplateVOList[i].inspectionItemVOList = res.qualityTemplateVOList[i]?.inspectionItemVOList.map(
-          (item) => {
-            item.templateId = res.qualityTemplateVOList[i]?.id;
-            item.qualitySchemeTemplateCode =
-              res.qualityTemplateVOList[i]?.qualitySchemeTemplateCode;
-            item.qualitySchemeTemplateName =
-              res.qualityTemplateVOList[i]?.qualitySchemeTemplateName;
-
-            delete item.id;
-
-            return {
-              ...item
-            };
-          }
-        );
-        combinedList = combinedList.concat(res.qualityTemplateVOList[i].inspectionItemVOList);
-      }
-      console.log(combinedList, '质检方案');
-      this.schemeList = combinedList;
-      this.schemePagination.currentPage = 1;
-      this.schemePagination.total = this.schemeList.length;
     },
     handleSelectionChange(selection) {
       console.log(selection, '勾选列表');
@@ -463,26 +483,14 @@ export default {
     },
     changeModel(val) {
       this.baseForm.qualityMode = val;
-      this.updateSampleList();
-    },
-    updateSampleList() {
-      if (this.baseForm.qualityMode === 1) {
-        // 全检
-        this.sampleList = this.packingList;
-        this.samplePagination.currentPage = 1;
-        this.samplePagination.total = this.packingList.length;
-        this.baseForm.sampleNumber = '';
-      } else if (this.btnType != 'add' && this.baseForm.qualityMode === 2) {
-        // 抽检
-        if (this.selectedList.length > 0) {
-          this.sampleList = this.selectedList;
-          this.samplePagination.currentPage = 1;
-          this.samplePagination.total = this.sampleList.length;
-          this.baseForm.sampleNumber = this.sampleList.length;
-        }
+      console.log(this.baseForm.productNumber, 'productNumberproductNumber数量')
+      if (this.baseForm.qualityMode == 1) {
+        this.aaa()
+      } else {
+        this.sampleList = [];
       }
-      console.log(this.sampleList, '样品列表更新完成');
     },
+
     changeNumber(val) {
       if (this.baseForm.qualityMode !== 2) {
         return;
@@ -491,15 +499,37 @@ export default {
         this.$refs.showPackingListTable.clearSelection();
         return;
       }
+      console.log('取样数量', val)
 
-      if (val > this.packingList.length) {
-        this.$message.warning('取样数量不能大于物料明细总数!');
-        return;
+      if (this.isCheck) {
+        if (val > this.packingList.length) {
+          this.$message.warning('取样数量不能大于物料明细总数!');
+          return;
+        }
+        const rows = this.packingList.slice(0, val);
+        rows.forEach((row) => {
+          this.$refs.showPackingListTable.toggleRowSelection(row);
+        });
+      } else {
+        if (val > this.packingList[0].packingQuantity) {
+          this.$message.warning('取样数量不能大于包装数量!');
+          return;
+        }
       }
-      const rows = this.packingList.slice(0, val);
-      rows.forEach((row) => {
-        this.$refs.showPackingListTable.toggleRowSelection(row);
-      });
+      this.sampleLis = [];
+      let num = Number(val);
+      if (num) {
+        let data = [];
+        for (let i = 0; i < num; i++) {
+          data.push(this.packingList[0]);
+        }
+
+        console.log(data, 'datadatadatadatadatadata', num)
+        this.sampleList = data;
+        this.samplePagination.currentPage = 1;
+        this.samplePagination.total = data.length;
+      }
+
     },
 
     resetTable() {
@@ -633,7 +663,7 @@ export default {
 .el-pagination {
   padding: 12px 16px;
   background: #fff;
-  border: 1px solid #ebeef5;
+  border: 1px solid#ebeef5;
   border-top: none;
 }
 </style>

+ 34 - 21
src/views/inspectionWork/components/baseInfo.vue

@@ -59,7 +59,7 @@
       </el-col>
       <el-col :span="6">
         <el-form-item label="总数量:" prop="total">
-          <el-input type="number" v-model="form.total" @input="inputTotal" disabled/>
+          <el-input type="number" v-model="form.total" @input="inputTotal" disabled />
         </el-form-item>
       </el-col>
     </el-row>
@@ -119,12 +119,12 @@
     <el-row>
       <el-col :span="6">
         <el-form-item label="合格率:" prop="qualificationRate">
-          <el-input type="number" v-model="form.qualificationRate" disabled/>
+          <el-input type="number" v-model="form.qualificationRate" disabled />
         </el-form-item>
       </el-col>
       <el-col :span="6">
         <el-form-item label="不合格率:" prop="noQualificationRate">
-          <el-input type="number" v-model="form.noQualificationRate" disabled/>
+          <el-input type="number" v-model="form.noQualificationRate" disabled />
         </el-form-item>
       </el-col>
       <el-col :span="6">
@@ -138,7 +138,8 @@
           message: '请输入取样数量',
           trigger: 'blur'
         }">
-          <el-input type="number" v-model="form.sampleNumber" />
+          <el-input type="number" v-model="form.sampleNumber"
+            :disabled="form.qualityMode == 1 || (form.qualityMode == 2 && form.sampleNumber) ? true : false" />
         </el-form-item>
       </el-col>
     </el-row>
@@ -146,30 +147,27 @@
       <el-col :span="6">
         <el-form-item label="检验标准" prop="inspectionStandards">
           <!-- 计量 计重 -->
-          <el-select
-            style="width: 100%"
-            v-model="form.inspectionStandards"
-            placeholder="请选择"
-          >
-            <el-option
-              v-for="item in inspectionStandardsList"
-              :label="item.label"
-              :value="item.value"
-              :key="item.value"
-            >
+          <el-select style="width: 100%" v-model="form.inspectionStandards" placeholder="请选择"
+            :disabled="qualityType == 1">
+            <el-option v-for="item in inspectionStandardsList" :label="item.label" :value="item.value"
+              :key="item.value">
             </el-option>
           </el-select>
         </el-form-item>
       </el-col>
       <el-col :span="6">
         <el-form-item label="检验方式:" prop="qualityMode">
-          <DictSelection dictName="取样类型" v-model="form.qualityMode" ></DictSelection>
+          <!-- <DictSelection dictName="取样类型" v-model="form.qualityMode" :disabled="qualityType == 1"></DictSelection> -->
+          <el-select style="width: 100%" v-model="form.qualityMode" placeholder="请选择" :disabled="qualityType == 1">
+            <el-option v-for="item in qualityModeList" :label="item.label" :value="item.value" :key="item.value">
+            </el-option>
+          </el-select>
         </el-form-item>
       </el-col>
       <el-col :span="6">
         <el-form-item label="质检状态:" prop="qualityResults">
-          <el-select v-model="form.qualityResults" placeholder="请选择" style="width: 100%"
-                     :disabled="btnType == 'issued'" clearable>
+          <el-select v-model="form.qualityResults" placeholder="请选择" style="width: 100%" :disabled="btnType == 'issued'"
+            clearable>
             <el-option label="合格" :value=1 />
             <el-option label="不合格" :value=2 />
           </el-select>
@@ -179,8 +177,7 @@
     <el-row>
       <el-col :span="24">
         <el-form-item label="备注:" prop="remark">
-          <el-input type="textarea" v-model="form.remark" placeholder="请输入"
-            :disabled="btnType == 'issued'" />
+          <el-input type="textarea" v-model="form.remark" placeholder="请输入" :disabled="btnType == 'issued'" />
         </el-form-item>
       </el-col>
     </el-row>
@@ -205,7 +202,7 @@ import EquipmentDialog from './EquipmentDialog.vue';
 import { getUserPage } from '@/api/system/organization';
 
 import { getProduceTaskList } from '@/api/aps';
-import {getByCode} from "@/api/system/dictionary-data";
+import { getByCode } from "@/api/system/dictionary-data";
 
 export default {
   components: {
@@ -222,6 +219,10 @@ export default {
     btnType: {
       type: String,
       default: ''
+    },
+    qualityType: {
+      type: Number,
+      default: 1
     }
   },
   watch: {
@@ -255,10 +256,12 @@ export default {
       },
       produceTaskList: [],
       inspectionStandardsList: [],
+      qualityModeList: []
     };
   },
   created() {
     this.getDictListIqoCode('iqo_code');
+    this.getQualityModeList('quality_method_code');
   },
   methods: {
     async getDictListIqoCode(code) {
@@ -271,6 +274,16 @@ export default {
         };
       });
     },
+    async getQualityModeList(code) {
+      let { data: res } = await getByCode(code);
+      this.qualityModeList = res.map((item) => {
+        let values = Object.keys(item);
+        return {
+          value: Number(values[0]),
+          label: item[values[0]]
+        };
+      });
+    },
     // 打开工艺路线弹窗
     openVersion() {
       this.$refs.versionRefs.open();

+ 47 - 36
src/views/inspectionWork/edit.vue

@@ -2,14 +2,15 @@
   <div class="ele-body">
     <el-card shadow="never">
       <header-title title="基本信息">
-        <el-button @click="cancel" >返回</el-button>
+        <el-button @click="cancel">返回</el-button>
         <el-button type="primary" @click="save" :loading="loading" v-if="type != 'detail'">保存</el-button>
         <el-button type="primary" @click="handleReporting" :loading="loading" v-if="type != 'detail'">报工完成</el-button>
       </header-title>
-      <base-info ref="baseInfoRefs" v-if="form" :form="form" :btnType="type"></base-info>
+      <base-info ref="baseInfoRefs" v-if="form" :form="form" :btnType="type" :qualityType="qualityType"></base-info>
       <el-row>
         <header-title title="质检内容">
-          <el-button type="primary" :loading="loading" v-if="type != 'detail'" @click="batchQuality(null,null,'report')">批量质检</el-button>
+          <el-button type="primary" :loading="loading" v-if="type != 'detail'"
+            @click="batchQuality(null, null, 'report')">批量质检</el-button>
         </header-title>
         <el-tabs v-model="activeName" @tab-click="handleClick">
           <el-tab-pane label="来源清单" name="1"></el-tab-pane>
@@ -34,51 +35,57 @@
           <el-table-column label="序号" type="index" width="50" align="center" fixed="left"></el-table-column>
 
           <template v-for="column in tableColumns">
-            <el-table-column :key="column.prop" :label="column.label" :prop="column.prop" :fixed="column.fixed" :show-overflow-tooltip="true"
-              :width="column.width" :align="column.align">
+            <el-table-column :key="column.prop" :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 === 'weight'">-->
-<!--                  <el-input v-model="scope.row.weight"></el-input>-->
-<!--                </template>-->
+                <!--                <template v-else-if="column.prop === 'weight'">-->
+                <!--                  <el-input v-model="scope.row.weight"></el-input>-->
+                <!--                </template>-->
                 <template v-else>
                   {{ scope.row[column.prop] }}
                 </template>
               </template>
             </el-table-column>
           </template>
-          <el-table-column label="重量" prop="weight" align="center" width="100" fixed="right" :show-overflow-tooltip="true">
+          <el-table-column label="重量" prop="weight" align="center" width="100" fixed="right"
+            :show-overflow-tooltip="true">
             <template slot-scope="scope">
               <el-input type="number" v-model="scope.row.weight" :min="0"></el-input>
             </template>
           </el-table-column>
-          <el-table-column label="重量单位" prop="weightUnit" align="center" width="80" fixed="right" :show-overflow-tooltip="true"></el-table-column>
-          <el-table-column label="处置状态" prop="disposalStatus" align="center" width="80" fixed="right" :show-overflow-tooltip="true">
+          <el-table-column label="重量单位" prop="weightUnit" align="center" width="80" fixed="right"
+            :show-overflow-tooltip="true"></el-table-column>
+          <el-table-column label="处置状态" prop="disposalStatus" align="center" width="80" fixed="right"
+            :show-overflow-tooltip="true">
             <template slot-scope="scope">
               <span v-if="scope.row.disposalStatus == 1 && form.qualityType == 2">返工</span>
-              <span v-if="scope.row.disposalStatus == 2 && form.qualityType == 2 ">返修</span>
-              <span v-if="scope.row.disposalStatus == 3 ">报废</span>
+              <span v-if="scope.row.disposalStatus == 2 && form.qualityType == 2">返修</span>
+              <span v-if="scope.row.disposalStatus == 3">报废</span>
               <span v-if="scope.row.disposalStatus == 4 && form.qualityType == 2">降级使用</span>
               <span v-if="scope.row.disposalStatus == 5 && form.qualityType == 2">让步接收</span>
-              <span v-if="scope.row.disposalStatus == 6 ">留样</span>
-              <span v-if="scope.row.disposalStatus == 7 ">消耗</span>
-              <span v-if="scope.row.disposalStatus == 8 ">回用</span>
+              <span v-if="scope.row.disposalStatus == 6">留样</span>
+              <span v-if="scope.row.disposalStatus == 7">消耗</span>
+              <span v-if="scope.row.disposalStatus == 8">回用</span>
             </template>
           </el-table-column>
-          <el-table-column label="处置时间" prop="disposeTime" align="center" width="100" fixed="right" :show-overflow-tooltip="true">
+          <el-table-column label="处置时间" prop="disposeTime" align="center" width="100" fixed="right"
+            :show-overflow-tooltip="true">
           </el-table-column>
-          <el-table-column label="质检状态" prop="qualityStatus" align="center" width="120" fixed="right" :show-overflow-tooltip="true">
+          <el-table-column label="质检状态" prop="qualityStatus" align="center" width="120" 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>
+              <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="110" fixed="right" :show-overflow-tooltip="true">
+          <el-table-column label="质检结果" prop="qualityResults" align="center" width="110" fixed="right"
+            :show-overflow-tooltip="true">
             <template slot-scope="scope">
               <el-select v-model="scope.row.qualityResults" placeholder="请选择" style="width: 100%;"
                 :disabled="type == 'detail'" size="mini">
@@ -93,7 +100,8 @@
                 @click="handleDetail(scope.$index, scope.row, 'report')">
                 质检
               </el-link>
-              <el-link type='primary' :underline="false" @click="handleDispose(scope.$index, scope.row, 'dispose')"> 处置 </el-link>
+              <el-link type='primary' :underline="false" @click="handleDispose(scope.$index, scope.row, 'dispose')"> 处置
+              </el-link>
             </template>
           </el-table-column>
         </el-table>
@@ -191,6 +199,7 @@ export default {
       // 表单验证规则
       categoryParamList: [],
       type: '',
+      qualityType: null,
       title: '',
       loading: false,
 
@@ -214,7 +223,7 @@ export default {
           prop: 'categoryCode',
           width: '160',
           align: 'center',
-          fixed:'left'
+          fixed: 'left'
         },
         {
           label: '名称',
@@ -314,6 +323,7 @@ export default {
     },
     async open(type) {
       this.type = this.$route.query.type;
+      this.qualityType = this.$route.query.qualityType;
       this.title = this.type == 'add' ? '新增' : type == 'edit' ? '报工' : '详情';
 
       if (this.type == 'add') {
@@ -322,6 +332,7 @@ export default {
       }
     },
     async getDetail() {
+
       getById(this.$route.query.id).then((res) => {
         this.form = res.data;
 
@@ -358,7 +369,7 @@ export default {
           ...item
         }
       })
-      console.log(addStatus, 'addStatus')
+      console.log(addStatus, '样品清单')
       //样品
       this.sampleList = addStatus;
       this.samplePagination.currentPage = 1;
@@ -448,16 +459,16 @@ export default {
       const selectedData = [];
       selectedData.push(this.sampleList[index])
       console.log(index, row, type, selectedData, 'index, row, type, mergedData')
-      this.$refs.detailRef.openDia(index, row, type, selectedData,null);
+      this.$refs.detailRef.openDia(index, row, type, selectedData, null);
     },
     handleDispose(index, row, type) {
-      if (!this.sampleList[index] ) {
+      if (!this.sampleList[index]) {
         return;
       }
       // const selectedData = [];
       // selectedData.push(this.sampleList[index])
       // console.log(index, row, type, selectedData, 'index, row, type, mergedData')
-      this.$refs.disposeRef.openDispose(index, row, type, null,this.form.qualityType);
+      this.$refs.disposeRef.openDispose(index, row, type, null, this.form.qualityType);
     },
     // 报工
     handleReporting(index, row) {
@@ -487,9 +498,9 @@ export default {
     },
     // 处理确认事件
     handleDisposeConfirm(list, index) {
-      if (index != null){
+      if (index != null) {
         this.$set(this.sampleList, index, list[0]);
-      }else{
+      } else {
         this.$set(this.sampleList, null, list);
       }
     },
@@ -513,23 +524,23 @@ export default {
         if (item.qualitySampleTemplateList.some(child => child.qualityResults === 2)) {
           item.isValid = false;
           item.qualityResults = 2;
-        }else{
+        } else {
           item.isValid = true;
           item.qualityResults = 1;
         }
         item.qualityStatus = 1;
       })
-      if (index != null){
+      if (index != null) {
         this.$set(this.sampleList, index, list[0]);
-      }else{
+      } else {
         this.$set(this.sampleList, null, list);
       }
-      console.log(this.sampleList,  '222表')
+      console.log(this.sampleList, '222表')
 
     },
     // 批量质检
-    batchQuality(index, row,type){
-      this.$refs.detailRef.openDia(null, null,type, this.sampleList, null)
+    batchQuality(index, row, type) {
+      this.$refs.detailRef.openDia(null, null, type, this.sampleList, null)
     }
   }
 };

+ 10 - 6
src/views/inspectionWork/index.vue

@@ -4,11 +4,11 @@
       <search ref="search" @search="search"></search>
       <ele-pro-table ref="table" :columns="columns" :datasource="datasource">
         <!-- 表头工具栏 -->
-<!--        <template v-slot:toolbar>-->
-<!--          <el-button size="small" type="primary" icon="el-icon-plus" class="ele-btn-icon" @click="openEdit('add')">-->
-<!--            添加-->
-<!--          </el-button>-->
-<!--        </template>-->
+        <!--        <template v-slot:toolbar>-->
+        <!--          <el-button size="small" type="primary" icon="el-icon-plus" class="ele-btn-icon" @click="openEdit('add')">-->
+        <!--            添加-->
+        <!--          </el-button>-->
+        <!--        </template>-->
 
         <template v-slot:code="{ row }">
           <el-link type="primary" :underline="false" @click="openEdit('detail', row)">
@@ -268,15 +268,19 @@ export default {
     },
     openEdit(type, row) {
       let id = '';
+      let qualityType = '';
       if (type != 'add') {
         id = row.id;
+        qualityType = row.qualityType;
+
       }
       // this.$refs.edit.open(type, row);
       this.$router.push({
         path: '/inspectionWork/edit',
         query: {
           type: type,
-          id: id || ''
+          id: id || '',
+          qualityType: qualityType
         }
       });
     },