فهرست منبع

生成样品编码;来源列表详情不显示取样;

yijing 1 سال پیش
والد
کامیت
8dad8d7bcd
2فایلهای تغییر یافته به همراه31 افزوده شده و 28 حذف شده
  1. 19 16
      src/views/inspectionPlan/components/edit.vue
  2. 12 12
      src/views/inspectionWork/components/QualityContentTabs.vue

+ 19 - 16
src/views/inspectionPlan/components/edit.vue

@@ -14,7 +14,7 @@
           <!-- 来料列表表格 -->
           <ele-pro-table ref="table12" :columns="tableColumns" :datasource="datasource"
             @selection-change="handleSelectionChange" :initLoad="false">
-            <template v-slot:toolbar v-if="this.baseForm.qualityMode == 2">
+            <template v-slot:toolbar v-if="this.baseForm.qualityMode == 2 && btnType != 'detail'">
               <el-dropdown trigger="click" @command="handleSampleNumber">
                 <el-link type="primary" icon="el-icon-plus">取样</el-link>
                 <el-dropdown-menu slot="dropdown">
@@ -575,8 +575,7 @@ export default {
     },
     //获取样品编码
     async getSampleCode() {
-      const code = await getCode('sample_code');
-      this.sampleListCode = code;
+      return await getCode('sample_code');
     },
     async aaa() {
       console.log('aaa')
@@ -584,7 +583,7 @@ export default {
 
       if (this.baseForm.qualityMode == 1) {
         this.sampleList = [];
-
+        console.log('是否拆包', this.baseForm.isUnpack)
         if (this.baseForm.isUnpack != null && this.baseForm.isUnpack != undefined && this.baseForm.isUnpack != '') {
           if (this.baseForm.isUnpack == 2) {
             const num = Number(this.baseForm.productNumber || 0);
@@ -593,14 +592,13 @@ export default {
             }
           } else if (this.baseForm.isUnpack == 1) {
             if (this.baseForm.qualityMode == 1) {
-              this.sampleList = packingList;
-              this.samplePagination.currentPage = 1;
-              this.samplePagination.total = packingList.length;
+              await this.updatePackingList(packingList);
             } else {
               this.sampleList = [];
             }
           }
         } else {
+          console.log('isCheck', this.isCheck)
           if (!this.isCheck) {
             const num = Number(this.baseForm.productNumber || 0);
             if (num) {
@@ -608,10 +606,9 @@ export default {
             }
           } else {
             if (this.baseForm.qualityMode == 1) {
-              this.sampleList = packingList;
-              console.log(this.sampleList, 'this.sampleList222')
-              this.samplePagination.currentPage = 1;
-              this.samplePagination.total = packingList.length;
+
+              await this.updatePackingList(packingList);
+
             } else {
               this.sampleList = [];
             }
@@ -622,7 +619,16 @@ export default {
       }
 
     },
-    getUnpackSamList(list, num) {
+    async updatePackingList(list) {
+      for (let i = 0; i < list.length; i++) {
+        list[i].sampleCode = await this.getSampleCode();
+      }
+      this.sampleList = list;
+      console.log(this.sampleList, 'this.sampleList222')
+      this.samplePagination.currentPage = 1;
+      this.samplePagination.total = list.length;
+    },
+    async getUnpackSamList(list, num) {
       console.log('拆包getUnpackSamList')
       let data = [];
       list.forEach(oldItem => {
@@ -641,10 +647,7 @@ export default {
       });
 
       console.log(data, 'datadatadatadatadatadata', num)
-
-      this.sampleList = data;
-      this.samplePagination.currentPage = 1;
-      this.samplePagination.total = data.length;
+      await this.updatePackingList(data);
 
     },
     async getQualityTemplate(productCode, ids) {

+ 12 - 12
src/views/inspectionWork/components/QualityContentTabs.vue

@@ -13,7 +13,7 @@
         <ele-pro-table ref="sourceTable" :columns="tableColumns1" :datasource="datasource"
           @selection-change="handleSelectionChange" :initLoad="false" :pagination="true">
 
-          <template v-slot:toolbar v-if="form.qualityMode == 2">
+          <template v-slot:toolbar v-if="form.qualityMode == 2 && type != 'detail'">
             <el-dropdown trigger="click" @command="handleSampleNumber">
               <el-link type="primary" icon="el-icon-plus">取样</el-link>
               <el-dropdown-menu slot="dropdown">
@@ -82,18 +82,19 @@
                   </el-link>
                 </template>
                 <template v-else-if="column.prop === 'materielDesignation'">
-                  <el-input :disabled="scope.row.isMaterielDesignationEmpty"
-                    v-model="scope.row.materielDesignation"></el-input>
+                  <el-input :disabled="scope.row.isMaterielDesignationEmpty" v-model="scope.row.materielDesignation"
+                    size="mini"></el-input>
                 </template>
                 <template v-else-if="column.prop === 'clientCode'">
-                  <el-input :disabled="scope.row.isClientCodeEmpty" v-model="scope.row.clientCode"></el-input>
+                  <el-input :disabled="scope.row.isClientCodeEmpty" v-model="scope.row.clientCode"
+                    size="mini"></el-input>
                 </template>
                 <template v-else-if="column.prop === 'engrave'">
-                  <el-input :disabled="scope.row.isEngraveEmpty" v-model="scope.row.engrave"></el-input>
+                  <el-input :disabled="scope.row.isEngraveEmpty" v-model="scope.row.engrave" size="mini"></el-input>
                 </template>
                 <template v-else-if="column.prop === 'weight'">
                   <el-input type="number" v-model="scope.row.weight" :min="0"
-                    @input="inputWeight(scope.row, scope.$index)"></el-input>
+                    @input="inputWeight(scope.row, scope.$index)" size="mini"></el-input>
                 </template>
                 <template v-else>
                   {{ scope.row[column.prop] }}
@@ -201,10 +202,9 @@ export default {
       }],
       tableColumns: [
         {
-          columnKey: 'index',
-          label: '序号',
-          type: 'index',
-          width: 55,
+          label: '样品编码',
+          prop: 'sampleCode',
+          width: '160',
           align: 'center',
           fixed: 'left'
         },
@@ -234,8 +234,8 @@ export default {
         { label: '客户代号', prop: 'clientCode', align: 'center', slot: 'clientCode', width: '120' },
         { label: '刻码', prop: 'engrave', align: 'center', slot: 'engrave', width: '120' },
         { label: '重量', prop: 'weight', align: 'center', slot: 'weight', width: '120' },
-        { label: '重量单位', prop: 'weightUnit', align: 'center', width: "100" },
-        { label: '仓库', prop: 'warehouseName', align: 'center' },
+        { 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' },