Просмотр исходного кода

Merge branch 'test' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-wms into tg

yusheng 7 месяцев назад
Родитель
Сommit
c830e671a5

+ 22 - 9
src/views/warehouseManagement/inventoryAllocation/add.vue

@@ -244,6 +244,7 @@
             :selection.sync="selection"
             row-key="id"
             :initLoad="false"
+            @done="onDone"
           >
           </ele-pro-table>
         </div>
@@ -813,10 +814,7 @@
       }
     },
     async created() {
-      const code = await getCode('transfer_no');
-      const name = await getCode('inventory_allocation_name');
-      this.params.name = name;
-      this.params.code = code;
+      
       // this.getTreeData();
       await this.getFactoryList();
       if (this.$route.query.isEdit) {
@@ -824,6 +822,10 @@
         this.isEdit = true;
         this.getEditInfo();
       } else {
+        const code = await getCode('transfer_no');
+        const name = await getCode('inventory_allocation_name');
+        this.params.name = name;
+        this.params.code = code;
         if(this.factoryList.find(item => item.id == this.userInfo.factoryId)?.id) {
           this.factoryId = this.userInfo.factoryId;
           this.params.targetFactoriesId = this.factoryId
@@ -837,6 +839,7 @@
     watch: {
       productList() {
         this.doLayout();
+        this.$refs.table.setSelectedRowKeys(this.selectionIds);
       }
     },
     methods: {
@@ -863,6 +866,14 @@
         });
         return data;
       },
+      onDone(res) {
+          console.log('res:', res);
+          this.$nextTick(() => {
+              // 回显选中的数据的复选框
+              console.log('data------data', this.selectionIds);
+              this.$refs.table.setSelectedRowKeys(this.selectionIds);
+          });
+      },
       /* 刷新表格 */
       reload(where) {
         this.$refs.table.reload({ page: 1, where });
@@ -938,9 +949,10 @@
         //   return this.selectionIds.includes(item.id);
         // });
         this.selection = dataList;
-        this.selection.forEach((item) => {
-          this.$refs.table.toggleRowSelection(item);
-        });
+        // this.selection.forEach((item) => {
+        //   this.$refs.table.toggleRowSelection(item);
+        // });
+        this.$refs.table.setSelectedRowKeys(this.selectionIds);
         console.log('this.selection------', this.selection);
         this.tableData = this.selection.map((item, index) => {
           // let filterObj = dataList.filter(
@@ -1401,7 +1413,7 @@
       deleted(row, index) {
         console.log('deleted~~~', row.id, index);
         this.tableData.splice(index, 1);
-        this.selectionIds = this.selectionIds.filter((item) => item != row.id);
+        this.selectionIds = this.selectionIds.filter((item) => item != row.outInDetailRecordId);
         this.selection = this.selection.filter((item) => item.id != row.id);
         this.$refs.table.setSelectedRowKeys(this.selectionIds);
         this.$forceUpdate()
@@ -1443,7 +1455,7 @@
                   goodsAllocationName: item.goodsAllocationName,
                   goodsShelfId: item.goodsShelfId,
                   goodsShelfName: item.goodsShelfName,
-                  outInDetailRecordId: item.id,
+                  outInDetailRecordId: item.outInDetailRecordId,
                   targetAreaId: item.targetAreaId,
                   targetAreaName: item.targetAreaName,
                   targetGoodsAllocationId: item.targetGoodsAllocationId,
@@ -1689,6 +1701,7 @@
                 console.log('this.params---------', this.params);
                 return {
                   ...item,
+                  outInDetailRecordId: item.id,
                   quantity: item.quantity || item.measureQuantity,
                   categoryId: item.categoryId,
                   warehouseId: this.params.outWarehouseId,

+ 7 - 0
src/views/warehouseManagement/inventoryAllocation/details.vue

@@ -89,6 +89,13 @@
               prop="categoryName"
               :show-overflow-tooltip="true"
             ></el-table-column>
+            <el-table-column
+              v-if="infoData.inventoryDimension != 1"
+              label="批次号"
+              prop="batchNo"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
             <el-table-column
               label="调出仓库"
               prop="warehouseName"

+ 9 - 4
src/views/warehouseManagement/stockManagement/add.vue

@@ -1663,9 +1663,14 @@
           let weight = 0;
           if (row.measureUnit == row.weightUnit) {
             weight = row.measureQuantity;
-            row.singleWeight =
-              Math.trunc((row.measureQuantity / row.packingQuantity) * 100) /
-              100;
+            //包装单位与重量单位相等时,单重重量为0
+            if (row.packingUnit == row.weightUnit) {
+              row.singleWeight = 0;
+            } else {
+              row.singleWeight =
+                Math.trunc((row.measureQuantity / row.packingQuantity) * 100) /
+                100;
+            }
           } else if (row.singleWeight) {
             weight = row.measureQuantity * Number(row.singleWeight);
           }
@@ -3292,7 +3297,7 @@
                 measureQuantity =
                   Math.trunc((row.weight / packingCodeList.length) * 100) / 100;
               } else {
-                 measureQuantity = row.packingSpecificationOption[1].packageCell;
+                measureQuantity = row.packingSpecificationOption[1].packageCell;
               }
             }
             console.log(

+ 0 - 3
src/views/warehouseManagement/warehouseDefinition/components/WarehouseEdit.vue

@@ -226,9 +226,6 @@ export default {
         ],
         ownerId: [
           { required: true, message: '请选择权属人', trigger: 'change' }
-        ],
-        warehouseType: [
-          { required: true, message: '请选择物品类型', trigger: 'change' }
         ]
         // status: [
         //   { required: true, message: '请选择仓库状态', trigger: 'blur' }