huang_an 2 年之前
父节点
当前提交
68c912d163

+ 86 - 29
src/views/warehouseManagement/components/AssetsDialog.vue

@@ -44,23 +44,24 @@
             ></el-input>
           </el-form-item>
         </el-col> -->
-        <!-- <el-col :span="6">
+        <el-col :span="6">
           <el-form-item label="列表维度:" prop="dimension">
             <template>
               <el-select
                 style="width: 100%"
                 clearable
-                @change="$emit('handledime', $event)"
+                @change="changeDimension"
                 v-model="dimension"
                 placeholder="请选择"
               >
                 <el-option label="物品维度" value="1"> </el-option>
                 <el-option label="批次维度" value="2"> </el-option>
-                <el-option label="库存维度" value="3"> </el-option>
+                <el-option label="包装维度" value="3"> </el-option>
+                <el-option label="物料维度" value="4"> </el-option>
               </el-select>
             </template>
           </el-form-item>
-        </el-col> -->
+        </el-col>
         <el-col :span="6">
           <el-form-item label="物品编码">
             <el-input
@@ -103,16 +104,22 @@
           height="50vh"
           border
           row-key="id"
+          style="width: 100%"
           :header-cell-style="{ background: '#F0F3F3', border: 'none' }"
           @selection-change="handleSelectionChange"
         >
           <el-table-column
             prop="code"
-            label="物品编码"
-            min-width="150"
+            label="编码"
+            min-width="120"
+          ></el-table-column>
+          <el-table-column
+            prop="name"
+            width="200"
+            label="名称"
           ></el-table-column>
-          <el-table-column prop="name" label="物品名称"></el-table-column>
           <el-table-column
+            width="200"
             :prop="item.prop"
             :label="item.label"
             v-for="(item, index) in tableHeader"
@@ -125,18 +132,29 @@
               <template v-else>{{ row[item.prop] }}</template>
             </template></el-table-column
           >
+
           <el-table-column
-            prop="measuringUnit"
-            label="计量单位"
+            prop="availableCountBase"
+            label="包装库存数量"
           ></el-table-column>
           <el-table-column
-            prop="packingUnit"
+            prop="minUnit"
             label="包装单位"
+            width="90"
+          ></el-table-column>
+          <el-table-column
+            prop="packingCountBase"
+            label="计量库存数量"
+          ></el-table-column>
+          <el-table-column
+            prop="measuringUnit"
+            label="计量单位"
+            width="90"
           ></el-table-column>
 
-          <el-table-column prop="canUsedCount" label="可用库存">
-          </el-table-column>
+          <!-- <el-table-column prop="pathName" label="仓库"> </el-table-column> -->
           <el-table-column
+            fixed="right"
             type="selection"
             :reserve-selection="true"
             width="55"
@@ -176,6 +194,7 @@
   import outin from '@/api/warehouseManagement/outin';
   import { login } from '@/api/login';
   import { getWarehouseList } from '@/api/classifyManage/itemInformation';
+  import { getBatchDetails } from '@/api/classifyManage';
   export default {
     components: { AssetTree },
     props: {
@@ -214,14 +233,51 @@
         dimension: '1'
       };
     },
-    created() {
-      this.getArguInfo();
-    },
+    created() {},
     methods: {
-      //搜索数据源
-      async getArguInfo() {
-        const { data } = await getWarehouseList();
-        this.warehouseList = data;
+      async changeDimension(e) {
+        this.dimension = e;
+        let res = {};
+        const params = {
+          ...this.pages,
+          ...this.searchForm,
+          dimension: e
+        };
+        if (this.materialType) {
+          params.categoryLevelId = this.materialType;
+        }
+        if (e == 2) {
+          res = await getBatchDetails(params);
+          this.tableData = res.list;
+        } else if (e == 3) {
+          res = await outin.getInventoryDetails(params);
+          this.tableData = res.list;
+        } else if (e == 4) {
+          res = await outin.getMaterielDetails(params);
+          this.tableData = res.list;
+        } else {
+          res = await outin.getRealTimeInventory(params);
+          this.tableData = res.list;
+        }
+
+        if (res) {
+          this.total = res.count;
+          // this.selectionList = deepClone(this.warehousingMaterialList);
+
+          this.$nextTick(() => {
+            this.tableData.forEach((item) => {
+              if (this.warehousingMaterialList.length != 0) {
+                const index = this.warehousingMaterialList.findIndex(
+                  (i) => item.id == i.id
+                );
+                if (index > -1) {
+                  // 删除还给 multipleSelection
+                  this.$refs.multipleTable.toggleRowSelection(item, true);
+                }
+              }
+            });
+          });
+        }
       },
       selectable(row, index) {
         if (row.canUsedCount != 0) {
@@ -279,17 +335,16 @@
       async getList() {
         const params = {
           ...this.pages,
-          ...this.searchForm
-          // dimension: 3
+          ...this.searchForm,
+          dimension: this.dimension
           // code: 5
         };
 
         if (this.materialType) {
           params.categoryLevelId = this.materialType;
         }
-        console.log('params>>>', params);
 
-        const res = await outin.pageeLedger(params);
+        const res = await outin.getRealTimeInventory(params);
         console.log('111555==', res);
 
         if (res) {
@@ -299,12 +354,14 @@
 
           this.$nextTick(() => {
             this.tableData.forEach((item) => {
-              const index = this.warehousingMaterialList.findIndex(
-                (i) => item.id == i.id
-              );
-              if (index > -1) {
-                // 删除还给 multipleSelection
-                this.$refs.multipleTable.toggleRowSelection(item, true);
+              if (this.warehousingMaterialList.length != 0) {
+                const index = this.warehousingMaterialList.findIndex(
+                  (i) => item.id == i.id
+                );
+                if (index > -1) {
+                  // 删除还给 multipleSelection
+                  this.$refs.multipleTable.toggleRowSelection(item, true);
+                }
               }
             });
           });

+ 4 - 3
src/views/warehouseManagement/outgoingManagement/components/detailSelect.vue

@@ -304,13 +304,14 @@
       }
     },
     created() {
-      this.getArguInfo();
+      // this.getArguInfo();
     },
     methods: {
       //搜索数据源
       async getArguInfo() {
-        const { data } = await getWarehouseList();
-        this.warehouseList = data;
+        // console.log(111);
+        // const { data } = await getWarehouseList();
+        // this.warehouseList = data;
       },
       handleCurrentChange(val) {
         this.formData.pageNum = val;