Sfoglia il codice sorgente

质检工单样品清单新增样品编码自动生成功能

yusheng 7 mesi fa
parent
commit
24c682bd74

+ 5 - 1
src/views/inspectionWork/components/newQualityContentTabs.vue

@@ -472,6 +472,8 @@
     queryQualityInventory
     queryQualityInventory
   } from '@/api/inspectionWork';
   } from '@/api/inspectionWork';
   import { getQualityTemplateByIds } from '@/api/inspectionTemplate';
   import { getQualityTemplateByIds } from '@/api/inspectionTemplate';
+  import { getCodeList } from '@/api/login';
+
   export default {
   export default {
     components: {
     components: {
       inspectionTemplateDialog
       inspectionTemplateDialog
@@ -883,7 +885,7 @@
     },
     },
     methods: {
     methods: {
       //合格数量变化设置样品清单 全减并且不拆包才执行
       //合格数量变化设置样品清单 全减并且不拆包才执行
-      setSampleList(val, total) {
+      async setSampleList(val, total) {
         this.$set(this.sampleList[0], 'measureQuantity', val);
         this.$set(this.sampleList[0], 'measureQuantity', val);
         let weight = this.form.totalWeight / total;
         let weight = this.form.totalWeight / total;
 
 
@@ -896,6 +898,8 @@
           data['qualitySampleTemplateList'] = [];
           data['qualitySampleTemplateList'] = [];
           data['id'] = '';
           data['id'] = '';
           data['weight'] = parseFloat(weight).toFixed(2);
           data['weight'] = parseFloat(weight).toFixed(2);
+          let code=await getCodeList('sample_code',{count:1});
+          data['sampleCode'] = code[0]
           arr.push(data);
           arr.push(data);
         }
         }
         this.$set(
         this.$set(