Browse Source

Revert "新增入库,根据物品类型获取仓库"

This reverts commit f3cc90146f576d07ef7283df47684ac6c567c170.
huang_an 1 year ago
parent
commit
3f02a38eeb

+ 0 - 11
src/api/warehouseManagement/warehouseDefinition.js

@@ -15,18 +15,7 @@ import request from '@/utils/request';
 // export async function warehouseSave(data) {
 //   return request.post('/warehouseGoodsshelves/newWarehouse/save', data);
 // }
-
 export default {
-  // 根据type查分类树组
-  getTreeByGroup: async (params) => {
-    const res = await request.get('/main/categoryLevel/getProduceTreeByPid', {
-      params
-    });
-    if (res.data.code == 0) {
-      return res.data.data;
-    }
-    return Promise.reject(new Error(res.data.message));
-  },
   //条件查询工厂
   getFactoryarea: async (params) => {
     const res = await request.get('/main/factoryarea/page', { params });

+ 2 - 12
src/views/warehouseManagement/components/WarehousingDialog.vue

@@ -86,6 +86,7 @@
           0
         );
         if (total == this.packingQuantity) {
+          console.log(this.tableDate);
           this.$emit('selection', this.tableDate, this.currentIndex);
           this.visible = false;
         } else {
@@ -124,24 +125,13 @@
           return { ...item, name: item.factoryName + '-' + item.name };
         });
       },
-      open(packingQuantity, idx, warehouseId, warehouseName) {
-        console.log('仓库id', warehouseId, warehouseName);
-
+      open(packingQuantity, idx) {
         this.warehouseId = '';
         this.tableDate = [];
         this.currentIndex = idx;
         this.packingQuantity = packingQuantity;
         this.visible = true;
         this.getWarehouseList();
-        if (warehouseId && warehouseName) {
-          this.warehouseId = warehouseId;
-          this.tableDate.push({
-            packingQuantity: this.packingQuantity,
-            warehouseName: warehouseName,
-            warehouseId: warehouseId
-          });
-          // this.$emit('selection', this.tableDate, this.currentIndex);
-        }
       }
     }
   };

+ 15 - 50
src/views/warehouseManagement/stockManagement/add.vue

@@ -267,7 +267,6 @@
                     <el-input
                       :ref="'packingQuantity' + $index"
                       type="number"
-                      placeholder="请输入"
                       @keyup.native="
                         moveFocus(
                           $event,
@@ -1002,8 +1001,7 @@
         pageSize: 20, // 物料和包装列表条数
         pickingPageNum: 1, // 包装虚拟分页页数
         materielPageNum: 1, // 物料虚拟分页页数
-        packingSpecificationOption: [], // 包装规格下拉
-        proData: {}
+        packingSpecificationOption: [] // 包装规格下拉
       };
     },
     computed: {
@@ -1185,11 +1183,14 @@
         )[0].name;
       },
       // 计算最小单元数量
-      async computeNum(row, index, isClear) {
+      computeNum(row, index, isClear) {
+        console.log(row);
+        console.log(row.packingQuantity);
+        console.log(row.packingUnit);
         // 清空仓库(包装数量输入)
         if (isClear) {
-          // this.$set(this.productList[index], 'warehouseId', '');
-          // this.$set(this.productList[index], 'warehouseName', '');
+          this.$set(this.productList[index], 'warehouseId', '');
+          this.$set(this.productList[index], 'warehouseName', '');
           if (row.packingQuantity < 0) {
             this.$set(this.productList[index], 'packingQuantity', 1);
           } else if (row.packingQuantity > 9999) {
@@ -1209,16 +1210,8 @@
           // }
         }
         if (row.packingQuantity && row.packingUnit) {
-          //获取仓库
-          const res = await warehouseDefinition.list({
-            inventoryType: this.proData[0]?.categoryLevelPathIdParent
-          });
-          if (res.length > 0) {
-            let name = res[0]?.factoryName + '-' + res[0]?.name;
-            console.log('仓库-----------------------------', res);
-            this.$set(this.productList[index], 'warehouseId', res[0].id);
-            this.$set(this.productList[index], 'warehouseName', name);
-          }
+          console.log(index);
+          console.log(row.packingSpecificationOption);
           let startIndex = row.packingSpecificationOption.findIndex((ite) => {
             return (
               row.measuringUnit == ite.packingUnit &&
@@ -1416,8 +1409,8 @@
       },
       // 获取物品列表
       async getListItems() {
-        const res2 = await warehouseDefinition.getTreeByGroup({ type: 1 });
-        this.goodsLists = res2;
+        const { data } = await getTreeByGroup({ type: 2 });
+        this.goodsLists = data;
       },
       // 打开单据来源弹窗
       openDocumentSourceDialog() {
@@ -1764,8 +1757,6 @@
         });
         obj.warehouseIds = warehouseId;
         obj.warehouseNames = warehouseName;
-        console.log('入库数据', obj);
-        return;
         // 是否需要审核(0审核 1跳过审核)
         if (obj.bizType == '12') {
           obj.isSkip = 1;
@@ -2074,7 +2065,6 @@
       },
       // 添加物品明细
       async addGoods(data) {
-        this.proData = data;
         // 获取批次号
         const batchNo = await getCode('lot_number_code');
         // 获取供应商
@@ -2436,20 +2426,6 @@
           ]);
           this.generateWrappers(row, index, data);
           this.$set(this.productList[index], 'isSave', true);
-          this.$set(this.productList[index], 'warehouseId', row.warehouseId);
-          this.$set(
-            this.productList[index],
-            'warehouseName',
-            row.warehouseName
-          );
-
-          this.$set(this.productList[index], 'warehouseIds', row.warehouseId);
-          this.$set(
-            this.productList[index],
-            'warehouseNames',
-            row.warehouseName
-          );
-
           // 加载虚拟列表数据(分页)
           // this.pickingFetchData();
           // this.materielFetchData();
@@ -2482,12 +2458,7 @@
               let num = Math.ceil(
                 row.packingQuantity / filterArr[0].packageCell
               );
-              this.$refs.wareHouseDailogRef.open(
-                num,
-                idx,
-                row.warehouseId,
-                row.warehouseName + ''
-              );
+              this.$refs.wareHouseDailogRef.open(num, idx);
             } else {
               let num = row.packingQuantity;
               if (measureBoolen) {
@@ -2513,9 +2484,7 @@
                     ? num
                     : row.measureQuantity
                   : row.packingQuantity,
-                idx,
-                row.warehouseId,
-                row.warehouseName + ''
+                idx
               );
             }
           } else {
@@ -2731,12 +2700,8 @@
           }
           let item = {
             index: row.index + '-' + index, // 包装索引
-            warehouseId: row.warehouseIds
-              ? row.warehouseIds[index]
-              : row.warehouseIds, // 仓库id
-            warehouseName: row.warehouseNames
-              ? row.warehouseNames[index]
-              : row.warehouseNames, // 仓库名称
+            warehouseId: row.warehouseIds[index], // 仓库id
+            warehouseName: row.warehouseNames[index], // 仓库名称
             categoryName: row.categoryName, // 产品名称
             categoryCode: row.categoryCode, // 产品编码
             categoryModel: row.categoryModel, // 物品型号

+ 1 - 1
src/views/warehouseManagement/stockManagement/components/selectType.vue

@@ -267,7 +267,7 @@
         this.initData();
       },
       onConfirm() {
-        console.log([...this.memoSelection, ...this.multipleSelection], '确认');
+        console.log([...this.memoSelection, ...this.multipleSelection]);
         this.$emit('selectTableData', [
           ...this.memoSelection,
           ...this.multipleSelection

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

@@ -28,27 +28,11 @@
         ></el-input>
       </el-form-item>
       <el-form-item label="仓库类型" prop="inventoryType">
-        <!-- <DictSelection
+        <DictSelection
           dictName="仓库类型"
           clearable
           v-model="formData.inventoryType"
-        /> -->
-        <el-select
-          filterable
-          size="small"
-          class="w100"
-          v-model="formData.inventoryType"
-          placeholder="请选择"
-          @visible-change="changeInventoryType"
-        >
-          <el-option
-            v-for="item in inventoryTypeList"
-            :key="item.id"
-            :label="item.name"
-            :value="item.id"
-          >
-          </el-option>
-        </el-select>
+        />
       </el-form-item>
       <el-form-item label="所属工厂" prop="factoryId">
         <el-select
@@ -167,7 +151,6 @@
           code: '',
           name: '',
           inventoryType: '',
-          inventoryName: '',
           remarks: '',
           factoryId: '',
           status: 1,
@@ -201,7 +184,6 @@
         type: '新建',
         userList: [],
         deptList: [], //部门集合
-        inventoryTypeList: [],
         factoryList: [], //工厂集合
         locationOptions: city,
         loadingVis: false
@@ -223,7 +205,6 @@
               code: '',
               name: '',
               inventoryType: '',
-              inventoryName: '',
               remarks: '',
               factoryId: '',
               status: 1,
@@ -267,6 +248,7 @@
                 ],
                 inventoryType: warehouseVO.inventoryType + ''
               };
+              console.log(this.formData);
               this.loadingVis = false;
             }, 2000);
           });
@@ -275,7 +257,6 @@
             code: '',
             name: '',
             inventoryType: '',
-            inventoryName: '',
             remarks: '',
             factoryId: '',
             status: 1,
@@ -317,17 +298,6 @@
 
         // let data = org.factorys({ status: true });
         this.factoryList = res.list;
-
-        const res2 = await warehouseDefinition.getTreeByGroup({ type: 1 });
-        this.inventoryTypeList = res2;
-      },
-      changeInventoryType(val) {
-        console.log(val, '1');
-        let data = this.inventoryTypeList.find((item) => {
-          return item.id == this.formData.inventoryType;
-        });
-        this.formData.inventoryName = data?.name;
-        console.log(this.formData.inventoryName);
       },
 
       handleSave() {

+ 10 - 30
src/views/warehouseManagement/warehouseDefinition/index.vue

@@ -14,27 +14,11 @@
           ></el-col>
           <el-col :span="4">
             <el-form-item label="仓库类型" prop="inventoryType">
-              <!-- <DictSelection
+              <DictSelection
                 dictName="仓库类型"
                 clearable
                 v-model="formData.inventoryType"
-              /> -->
-              <el-select
-                filterable
-                size="small"
-                class="w100"
-                v-model="formData.inventoryType"
-                placeholder="请选择"
-                :clearable="true"
-              >
-                <el-option
-                  v-for="item in inventoryTypeList"
-                  :key="item.id"
-                  :label="item.name"
-                  :value="item.id"
-                >
-                </el-option>
-              </el-select> </el-form-item
+              /> </el-form-item
           ></el-col>
           <el-col :span="4">
             <el-form-item label="所属工厂" prop="factoryId">
@@ -212,12 +196,12 @@
           </el-table-column>
           <el-table-column
             label="仓库类型"
-            prop="inventoryName"
+            prop="inventoryType"
             :show-overflow-tooltip="true"
           >
-            <!-- <template slot-scope="{ row, $index }">
+            <template slot-scope="{ row, $index }">
               {{ getDictValue('仓库类型', row.inventoryType) }}
-            </template> -->
+            </template>
           </el-table-column>
           <el-table-column
             label="库区数"
@@ -311,18 +295,17 @@
           },
           {
             label: '仓库类型',
-            key: 'inventoryName'
-            // filter: (value) => {
-            //   return this.getDictValue('仓库类型', value);
-            // }
+            key: 'inventoryType',
+            filter: (value) => {
+              return this.getDictValue('仓库类型', value);
+            }
           },
           { label: '库区数', key: 'areaNumber' },
           { label: '货架数', key: 'goodNumber' },
           { label: '货位数', key: 'allocationNumber' },
           { label: '空货位数', key: 'emptyAllocationNumber' },
           { label: '所属工厂', key: 'factoryId' }
-        ],
-        inventoryTypeList: []
+        ]
       };
     },
     async created() {
@@ -340,9 +323,6 @@
         this.isTable = !this.isTable;
       },
       async initData() {
-        const res2 = await warehouseDefinition.getTreeByGroup({ type: 1 });
-        this.inventoryTypeList = res2;
-
         //获取工厂车间列表
         const res = await warehouseDefinition.getFactoryarea({
           pageNum: 1,