فهرست منبع

优化样品数量计算逻辑并新增颜色字段显示

yusheng 5 ماه پیش
والد
کامیت
1045d29924
2فایلهای تغییر یافته به همراه18 افزوده شده و 6 حذف شده
  1. 6 0
      src/views/inspectionWork/index.vue
  2. 12 6
      src/views/inspectionWork/mixins/detailMixins.js

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

@@ -461,6 +461,12 @@
             align: 'center',
             showOverflowTooltip: true
           },
+          {
+            prop: 'colorKey',
+            label: '颜色',
+            align: 'center',
+            showOverflowTooltip: true
+          },
           {
             prop: 'produceTaskName',
             label: '工序',

+ 12 - 6
src/views/inspectionWork/mixins/detailMixins.js

@@ -52,7 +52,7 @@ export default {
           prop: 'inspectionStandardsName',
           span: 6
         },
-   
+
         {
           label: '接收人',
           prop: 'qualityName',
@@ -145,16 +145,15 @@ export default {
           prop: 'executeUserName',
           label: '执行人'
         },
-          {
+        {
           prop: 'executeDeptName',
           label: '执行部门'
         },
-        
+
         {
           prop: 'groupName',
           label: '接收人部门'
         }
-        
       ],
       disposeTypeMap: {
         1: '返工',
@@ -947,7 +946,7 @@ export default {
   methods: {
     //样品数操作
     isSampleQuantity(item, index) {
-      this.resetData(item, index, ['qualifiedQuantity', 'noQualifiedQuantity']);
+      // this.resetData(item, index, ['qualifiedQuantity', 'noQualifiedQuantity']);
       if (item.sampleQuantity > this.getSampleQuantityCount) {
         this.$message.error('样品数量不能大于当前质检剩余样品数');
         this.$set(
@@ -956,6 +955,12 @@ export default {
           this.getSampleQuantityCount
         );
       }
+      this.$set(
+        this.tableData[index],
+        'qualifiedQuantity',
+        item.sampleQuantity
+      );
+      this.isQualifiedQuantity(item, index, 'qualifiedQuantity');
     },
     //合格/不合格数操作
     isQualifiedQuantity(item, index, key) {
@@ -990,7 +995,8 @@ export default {
             : Number(item.lossNumberUnqualified) +
               Number(item.retainedSampleUnqualified)
       };
-      if (item[key] > item[keyObj.key]) {
+
+      if (+item[key] > item[keyObj.key]) {
         this.$message.error(
           title + keyObj.title + '不能大于样品' + keyObj.title
         );