yusheng 11 luni în urmă
părinte
comite
6cd4313a44

+ 8 - 1
src/api/inspectionWork/index.js

@@ -132,4 +132,11 @@ export async function closeWork(data) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
-}
+}
+// 关闭
+export async function verificationQualityInspector(id) {
+  const res = await request.post(`/qms/quality_work_order/verificationQualityInspector/${id}`);
+  return res.data.code
+  return Promise.reject(new Error(res.data.message));
+}
+

+ 73 - 26
src/views/inspectionPlan/components/new-edit.vue

@@ -541,7 +541,7 @@
         isPackingList: true,
         isSchemeList: true,
         newSampleList: [],
-        kkconditionType:''
+        kkconditionType: ''
       };
     },
     computed: {
@@ -904,7 +904,7 @@
         this.activeName = tab.name;
       },
       async open(type, row) {
-        this.kkconditionType=row?.conditionType
+        this.kkconditionType = row?.conditionType;
         this.visible = true;
         this.activeName = '1';
         this.btnType = type;
@@ -2089,7 +2089,7 @@
           //   sampleList: this.sampleList,
           //   planTemplateList: this.schemeList
           // };
-          
+
           let params = {
             ...this.baseForm,
             qualityInventoryList: qualityListData,
@@ -2172,8 +2172,6 @@
 
           console.log(params, 'params');
 
-          
-
           if (this.btnType == 'issued' && this.schemeList.length < 1) {
             this.$message.warning('质检方案不能为空!');
             this.loading = false;
@@ -2330,7 +2328,9 @@
           const sampleCount = Number(this.formData.portion);
           const measureQ = this.formData.number || 1;
           const unit = this.formData.sampleUnit;
-          console.log(this.conditionType, this.baseForm.inspectionStandards);
+          // console.log(this.conditionType, this.baseForm.inspectionStandards);
+          // console.log(this.isStandard1OrWeightSample())
+          // console.log(this.isWeightStandardFullSample())
           try {
             if (this.isStandard1OrWeightSample()) {
               //抽检计量整样小样或者抽检计重小样
@@ -2475,27 +2475,74 @@
       },
 
       async handleWeightFullSample(sampleCount) {
-        console.log(sampleCount, 'sampleCount');
-        console.log(this.selectedList, 'this.selectedList');
-        const list = this.selectedList.map((item) => ({
-          ...item,
-          // measureQuantity: sampleCount,
-          weight: item.singleWeight
-            ? (Number(item.singleWeight) * Number(sampleCount)).toFixed(2)
-            : item.outboundNum
-            ? (
-                (Number(item.weight) / Number(item.outboundNum)) *
-                Number(sampleCount)
-              ).toFixed(2)
-            : item.weight
+        // console.log(sampleCount, 'sampleCount');
+        // console.log(this.selectedList, 'this.selectedList');
+        let currentNum = sampleCount - this.selectedList.length;
+        let currentNum1 = sampleCount;
+        let list = [];
+        this.selectedList.forEach((item) => {
+          if (sampleCount >= this.selectedList.length) {
+            list.push({
+              ...item,
+              measureQuantity: 1, //作为计量数量
+              weight: item.singleWeight
+                ? (Number(item.singleWeight) * Number(sampleCount)).toFixed(2)
+                : item.outboundNum
+                ? (
+                    (Number(item.weight) / Number(item.outboundNum)) *
+                    Number(sampleCount)
+                  ).toFixed(2)
+                : item.weight
+            });
+          } else {
+            if (list.length < sampleCount) {
+              list.push({
+                ...item,
+                measureQuantity: currentNum1 > 1 ? 1 : currentNum1, //作为计量数量
+                weight: item.singleWeight
+                  ? (Number(item.singleWeight) * Number(sampleCount)).toFixed(2)
+                  : item.outboundNum
+                  ? (
+                      (Number(item.weight) / Number(item.outboundNum)) *
+                      Number(sampleCount)
+                    ).toFixed(2)
+                  : item.weight
+              });
+              currentNum1 -= 1;
+            }
+          }
+          if (sampleCount > this.selectedList.length) {
+            list.forEach((item) => {
+              if (currentNum > 0) {
+                let data = this.selectedList.find((val) => val.id == item.id);
+                item['measureQuantity'] =
+                  data.measureQuantity - 1 - currentNum > 0
+                    ? currentNum + 1
+                    : data.measureQuantity;
+                currentNum = currentNum - (data.measureQuantity - 1);
+              }
+            });
+          }
+
+          // ...item,
+          // // measureQuantity: sampleCount,
+          // weight: item.singleWeight
+          //   ? (Number(item.singleWeight) * Number(sampleCount)).toFixed(2)
+          //   : item.outboundNum
+          //   ? (
+          //       (Number(item.weight) / Number(item.outboundNum)) *
+          //       Number(sampleCount)
+          //     ).toFixed(2)
+          //   : item.weight
           // weight: item.singleWeight ? Number(item.singleWeight) : item.weight
-        }));
-        if (this.selectedList.length > sampleCount) {
-          const newList = list.splice(0, sampleCount);
-          await this.updatePackingList(newList);
-        } else {
-          await this.updatePackingList(list);
-        }
+        });
+        // if (this.selectedList.length > sampleCount) {
+        //   const newList = list.splice(0, sampleCount);
+        //   await this.updatePackingList(newList);
+        // } else {
+        //   await this.updatePackingList(list);
+        // }
+        await this.updatePackingList(list);
       },
       handDel(index) {
         console.log(index);

+ 4 - 9
src/views/inspectionWork/components/baseInfo.vue

@@ -11,7 +11,7 @@
           />
         </el-form-item>
       </el-col>
-      
+
       <!-- <el-col :span="6">
         <el-form-item label="质检类型:" prop="qualityType">
           <DictSelection
@@ -195,9 +195,7 @@
               style="width: 100%"
               v-model="form.inspectionStandards"
               placeholder="请选择"
-              :disabled="
-                parseInt(qualityType1) == 1 || parseInt(qualityType1) == 3
-              "
+              :disabled="true"
             >
               <el-option
                 v-for="item in inspectionStandardsList"
@@ -271,7 +269,7 @@
           </el-form-item>
         </el-col> -->
 
-             <el-col :span="6">
+        <el-col :span="6">
           <!-- <el-form-item label="质检结果:" prop="qualityResults" v-if="form.qualityMode == 2"> -->
           <el-form-item label="质检结果:" prop="qualityResults">
             <el-select
@@ -285,8 +283,6 @@
             </el-select>
           </el-form-item>
         </el-col>
-
-
       </el-row>
       <el-row>
         <el-col :span="6" v-if="parseInt(qualityType1) == 2">
@@ -328,8 +324,7 @@
             ></el-input>
           </el-form-item>
         </el-col> -->
-       
-   
+
         <el-col :span="6">
           <el-form-item label="备注:" prop="remark">
             <el-input

+ 16 - 3
src/views/inspectionWork/components/newQualityContentTabs.vue

@@ -285,7 +285,7 @@
             label="质检结果"
             prop="qualityResults"
             align="center"
-            width="100"
+            width="180"
             fixed="right"
             :show-overflow-tooltip="true"
           >
@@ -974,13 +974,26 @@
         const strings = this.templateList.map((item) => JSON.stringify(item));
         const removeDupList = [...new Set(strings)];
         const result = removeDupList.map((item) => JSON.parse(item));
-        this.templateList = result;
-        console.log(this.templateList);
+        this.templateList = result.map(item=>{
+          item['qualityResults']=1
+          return item
+        });
+        // console.log(this.templateList);
+        this.sampleList.forEach((item,index)=>{
+          this.$set(this.sampleList[index],'qualitySampleTemplateList',this.templateList)
+        })
         this.schemePagination.total = this.templateList.length;
       },
       handDel(index) {
         console.log(index);
         this.templateList.splice(index, 1);
+        this.sampleList.forEach((item,index)=>{
+          this.$set(this.sampleList[index],'qualitySampleTemplateList',this.templateList.map(item=>{
+            item['qualityResults']=1
+          return item
+          }))
+
+        })
       }
     }
   };

+ 265 - 163
src/views/inspectionWork/components/sampleListDialog.vue

@@ -1,182 +1,284 @@
 <!-- 用户编辑弹窗 -->
 <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">
-                            </el-table-column>
-                            <el-table-column label="质检方案名称" prop="qualitySchemeTemplateName"
-                                align="center"></el-table-column>
-                            <el-table-column label="质检类型" prop="categoryLevelClassName"
-                                align="center"></el-table-column>
-                            <el-table-column label="质检项编码" prop="inspectionCode" align="center"></el-table-column>
-                            <el-table-column label="质检项名称" prop="inspectionName" align="center"></el-table-column>
-                            <el-table-column label="工艺参数" prop="defaultValue" align="center">
-                            </el-table-column>
-                            <el-table-column label="质检工具" prop="" align="center">
-                                <template slot-scope="scope">
-                                    <toolButtom
-                                    v-model="scope.row.useTools"
-                                    :type="type"
-                                    :sList="scope.row.toolList"
-                                    />
-                                </template>
-                            </el-table-column>
-                            <el-table-column label="质检内容" prop="qualityResultContent" align="center" fixed="right"
-                                width="360">
-                                <template slot-scope="scope">
-                                    <el-input v-model="scope.row.qualityResultContent" placeholder="请输入内容"
-                                        :disabled="type == 'detail'"></el-input>
-                                </template>
-                            </el-table-column>
-                            <el-table-column label="质检结果" prop="qualityResults" align="center" fixed="right">
-                                <template slot-scope="scope">
-                                    <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>
-                        </el-table>
-                    </div>
+  <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"
+              >
+              </el-table-column>
+              <el-table-column
+                label="质检方案名称"
+                prop="qualitySchemeTemplateName"
+                align="center"
+              ></el-table-column>
+              <el-table-column
+                label="质检类型"
+                prop="categoryLevelClassName"
+                align="center"
+              ></el-table-column>
+              <el-table-column
+                label="质检项编码"
+                prop="inspectionCode"
+                align="center"
+              ></el-table-column>
+              <el-table-column
+                label="质检项名称"
+                prop="inspectionName"
+                align="center"
+              ></el-table-column>
+              <el-table-column
+                label="工艺参数"
+                prop="defaultValue"
+                align="center"
+              >
+              </el-table-column>
+              <el-table-column label="质检工具" prop="" align="center">
+                <template slot-scope="scope">
+                  <toolButtom
+                    v-model="scope.row.useTools"
+                    :type="type"
+                    :sList="scope.row.toolList"
+                  />
+                </template>
+              </el-table-column>
+              <el-table-column
+                label="质检内容"
+                prop="qualityResultContent"
+                align="center"
+                fixed="right"
+                width="360"
+              >
+                <template slot-scope="scope">
+                  <el-input
+                    v-model="scope.row.qualityResultContent"
+                    placeholder="请输入内容"
+                    :disabled="type == 'detail'"
+                  ></el-input>
                 </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">
-                </el-table-column>
-            </template>
-            <el-table-column label="操作" align="center" width="80">
+              </el-table-column>
+              <el-table-column
+                label="质检结果"
+                prop="qualityResults"
+                align="center"
+                fixed="right"
+              >
                 <template slot-scope="scope">
-                    <el-link :underline="false" type="primary"
-                        @click="handleDispose(scope.$index, scope.row, 'dispose')">
-                        处置
-                    </el-link>
+                  <el-select
+                    v-model="scope.row.qualityResults"
+                    placeholder="请选择"
+                    style="width: 100%"
+                    @change="qualityResultsListChange"
+                    :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>
-        </el-table>
-        <template v-slot:footer v-if="type == 'report'">
-            <el-button @click="handleClose">取消</el-button>
-            <el-button type="primary" @click="handleConfirm">
-                确认
-            </el-button>
+              </el-table-column>
+            </el-table>
+          </div>
         </template>
-    </ele-modal>
+      </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>
+    <template v-slot:footer v-if="type == 'report'">
+      <el-button @click="handleClose">取消</el-button>
+      <el-button type="primary" @click="handleConfirm"> 确认 </el-button>
+    </template>
+  </ele-modal>
 </template>
 
 <script>
-import toolButtom from './toolButtom.vue';
-export default {
+  import index from 'ele-admin/lib/ele-avatar-list';
+  import toolButtom from './toolButtom.vue';
+  export default {
     components: {
-        toolButtom
+      toolButtom
     },
     data() {
-
-        return {
-            title: '',
-            visible: false,
-            rowIndex: 0,
-            type: '',
-            tableData: [],
-            tableColumns: [
-                {
-                    label: '编码',
-                    prop: 'categoryCode',
-                    width: '150',
-                    align: 'center'
-                },
-                {
-                    label: '名称',
-                    prop: 'categoryName',
-                    width: '150',
-                    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: 'materielDesignation', align: 'center' },
-                { label: '客户代号', prop: 'clientCode', align: 'center' },
-                { label: '刻码', prop: 'engrave', align: 'center' },
-                { label: '重量', prop: 'weight', align: 'center' },
-                { label: '重量单位', prop: 'weightUnit', align: 'center' },
-                { label: '仓库', prop: 'warehouseName', align: 'center', },
-                {
-                    label: '质检结果', prop: 'qualityResults', align: 'center', 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: '让步接收'
-                },
-            ],
-            sList:[],//质检工具筛选
-        };
-    },
-    computed: {
+      return {
+        title: '',
+        visible: false,
+        rowIndex: 0,
+        type: '',
+        tableData: [],
+        tableColumns: [
+          {
+            label: '编码',
+            prop: 'categoryCode',
+            width: '150',
+            align: 'center'
+          },
+          {
+            label: '名称',
+            prop: 'categoryName',
+            width: '150',
+            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: 'materielDesignation', align: 'center' },
+          { label: '客户代号', prop: 'clientCode', align: 'center' },
+          { label: '刻码', prop: 'engrave', align: 'center' },
+          { 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: '让步接收'
+          }
+        ],
+        sList: [] //质检工具筛选
+      };
     },
+    computed: {},
 
-    created() { },
+    created() {},
     methods: {
-        async openDia(index, row, type, list, isStatus, sList) {
-            this.tableData = [];
-            this.rowIndex = index
-            this.type = type;
-            // 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
+      async openDia(index, row, type, list, isStatus, sList) {
+        this.tableData = [];
+        this.rowIndex = index;
+        this.type = type;
+        // 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;
+          }
+        }
+        this.tableData = list;
+        this.visible = true;
+      },
+      qualityResultsListChange() {
+        this.tableData.forEach((item, index) => {
+          this.$set(
+            this.tableData[index],
+            'qualityResults',
+            this.getQuality(item.qualitySampleTemplateList)
+          );
+        });
+      },
+      getQuality(arr) {
+        let getQualityValue = 1;
+        arr.forEach((item) => {
+          if (item.qualityResults == 2) {
+            getQualityValue = 2;
+          }
+        });
+        return getQualityValue;
+      },
 
-                }
-            }
-            this.tableData = list;
-            this.visible = true
-        },
-        handleClose() {
-            this.visible = false;
-        },
-        handleConfirm() {
-            this.visible = false;
-            this.$emit('handleConfirm', this.tableData, this.rowIndex);
-        },
-        handleDispose(index, row, type) {
-            this.$emit('handleDispose', index, row, type);
-        },
+      handleClose() {
+        this.visible = false;
+      },
+      handleConfirm() {
+        this.visible = false;
+        this.$emit('handleConfirm', this.tableData, this.rowIndex);
+      },
+      handleDispose(index, row, type) {
+        this.$emit('handleDispose', index, row, type);
+      },
 
-        //选择质检工具
-        openToolList(index, row) {
-            this.$emit('openToolList', index, row);
-        },
+      //选择质检工具
+      openToolList(index, row) {
+        this.$emit('openToolList', index, row);
+      }
     }
-};
+  };
 </script>

+ 48 - 13
src/views/inspectionWork/edit.vue

@@ -611,7 +611,9 @@
             console.log(222222222222222222);
             await this.handleWeightFullSample(sampleCount);
           }
-          this.activeName = '2';
+        this.activeName = '2';
+
+          this.$refs.tabsRef.tabsChange('2');
         } catch (error) {
           console.error('取样处理失败:', error);
           this.$message.error('取样处理失败');
@@ -630,6 +632,8 @@
           return;
         }
         this.activeName = '2';
+        this.$refs.tabsRef.tabsChange('2');
+
         if (this.form.isUnpack == 1) {
           // 1 拆包 2 不拆
           let measureQuantity = 1;
@@ -962,7 +966,7 @@
         } else {
           this.$set(this.sampleList, index, data);
         }
-        
+
         console.log(this.sampleList);
       },
       //确认质检
@@ -1290,23 +1294,54 @@
 
       async handleWeightFullSample(sampleCount) {
         const dataList = [];
+        let currentNum = sampleCount - this.selectedList.length;
+        let currentNum1 = sampleCount;
         for (const item of this.selectedList) {
           const qualitySampleTemplateList = item.qualitySampleTemplateList
             ?.length
             ? JSON.parse(JSON.stringify(item.qualitySampleTemplateList))
-            : JSON.parse(JSON.stringify(this.schemeList));
-          dataList.push({
-            ...item,
-            // measureQuantity: sampleCount, //作为计量数量
-            sampleCode: await this.getSampleCode(),
-            qualitySampleTemplateList
-          });
+            : JSON.parse(
+                JSON.stringify(
+                  this.schemeList.map((item) => {
+                    item['qualityResults'] = 1;
+                    return item;
+                  })
+                )
+              );
+
+          if (sampleCount >= this.selectedList.length) {
+            dataList.push({
+              ...item,
+              measureQuantity: 1, //作为计量数量
+              sampleCode: await this.getSampleCode(),
+              qualitySampleTemplateList
+            });
+          } else {
+            if (dataList.length < sampleCount) {
+              dataList.push({
+                ...item,
+                measureQuantity: currentNum1 > 1 ? 1 : currentNum1, //作为计量数量
+                sampleCode: await this.getSampleCode(),
+                qualitySampleTemplateList
+              });
+              currentNum1 -= 1;
+            }
+          }
         }
-        if (dataList.length > sampleCount) {
-          this.sampleList = dataList.splice(0, sampleCount);
-        } else {
-          this.sampleList = dataList;
+        if (sampleCount > this.selectedList.length) {
+          dataList.forEach((item) => {
+            if (currentNum > 0) {
+              let data = this.selectedList.find((val) => val.id == item.id);
+              item['measureQuantity'] =
+                data.measureQuantity - 1 - currentNum > 0
+                  ? currentNum + 1
+                  : data.measureQuantity;
+              currentNum = currentNum - (data.measureQuantity - 1);
+            }
+          });
         }
+
+        this.sampleList = dataList;
         this.sampleNumber = this.sampleList.length;
       },
 

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

@@ -137,7 +137,8 @@
     getList,
     removeItem,
     updateCertificateNumber,
-    closeWork
+    closeWork,
+    verificationQualityInspector
   } from '@/api/inspectionWork';
   import dictMixins from '@/mixins/dictMixins';
   import { getFile } from '@/api/system/file';
@@ -431,9 +432,15 @@
           page: 1
         });
       },
-      openEdit(type, row) {
+      async openEdit(type, row) {
         const menusList = this.$store.state.user.menus;
         let found = false;
+        if (type == 'edit') {
+          const code = await verificationQualityInspector(row.id);
+          if (code == '-1') {
+            return;
+          }
+        }
         for (const item of menusList) {
           if (item.children) {
             for (const item2 of item.children) {

+ 0 - 1
src/views/sample/samplemanagement/index.vue

@@ -124,7 +124,6 @@
             prop: 'categoryName',
             label: '物品名称',
             align: 'center',
-            width: 160,
             showOverflowTooltip: true
           },
           {

+ 12 - 6
src/views/unqualifiedProduct/unqualifiedList/detailList.vue

@@ -427,12 +427,18 @@
             label: '刻码',
             align: 'center'
           },
-          {
-            prop: 'unqualifiedQuantity',
-            label: '数量',
-            align: 'center',
-            width: 60
-          },
+          // {
+          //   prop: 'unqualifiedQuantity',
+          //   label: '数量',
+          //   align: 'center',
+          //   width: 60
+          // },
+          // { 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' },
           {
             prop: 'produceRoutingName',
             label: '工艺路线',

+ 0 - 1
src/views/unqualifiedProduct/unqualifiedList/index.vue

@@ -123,7 +123,6 @@
             prop: 'categoryName',
             label: '物品名称',
             align: 'center',
-            width: 160,
             showOverflowTooltip: true
           },
           {