Przeglądaj źródła

库存台账详情添加库存明细

yijing 1 rok temu
rodzic
commit
887a3d3f0c

+ 130 - 121
src/views/warehouseManagement/stockLedger/batchDetails.vue

@@ -21,23 +21,22 @@
           <BatchDetail></BatchDetail>
         </el-tab-pane> -->
         <el-tab-pane label="入库单" name="second" lazy>
-          <InWarehouse :baseInfo="baseInfo" :baseParams="baseParams"
-        /></el-tab-pane>
+          <InWarehouse :baseInfo="baseInfo" :baseParams="baseParams" />
+        </el-tab-pane>
         <el-tab-pane label="调拨记录" name="third" lazy>
           <InventoryAllocation :baseInfo="baseInfo" :baseParams="baseParams" />
         </el-tab-pane>
         <el-tab-pane label="出库单" name="fourth" lazy>
-          <OutWarehouse :baseInfo="baseInfo" :baseParams="baseParams"
-        /></el-tab-pane>
+          <OutWarehouse :baseInfo="baseInfo" :baseParams="baseParams" />
+        </el-tab-pane>
         <el-tab-pane label="报损报溢" name="fifth" lazy>
           <ReportLoss :baseInfo="baseInfo" :baseParams="baseParams" />
         </el-tab-pane>
-        <el-tab-pane
-          label="质检单"
-          name="sixth"
-          lazy
-          v-if="baseInfo.assetType == 3"
-        ></el-tab-pane>
+        <el-tab-pane label="质检单" name="sixth" lazy v-if="baseInfo.assetType == 3"></el-tab-pane>
+
+        <el-tab-pane label="库存明细" name="seventeen" lazy>
+          <InventoryDetails :categoryCode="categoryCode" />
+        </el-tab-pane>
       </el-tabs>
 
       <template v-if="activeName === 'sixth'">
@@ -48,129 +47,139 @@
 </template>
 
 <script>
-  import BaseInfo from './components/details/BaseInfo.vue';
-  import OutWarehouse from './components/details/OutWarehouse.vue';
-  import InWarehouse from './components/details/InWarehouse.vue';
-  import ReportLoss from './components/details/ReportLoss.vue';
-  import InventoryAllocation from './components/details/InventoryAllocation.vue';
-  import WarehouseDetail from './components/details/WarehouseDetail.vue';
-  import BatchDetail from './components/details/BatchDetail.vue';
-  import warehouseConfigVue from './components/details/warehouseConfig.vue';
-  // import PageHeader from '@/components/PageHeader'
-  import BatchDetailDialog from './components/BatchDetailDialog.vue';
-  import {
-    getCateInfo,
-    getDetails,
-    ledgerdetailPage,
-    ledgerPage
-  } from '@/api/classifyManage/itemInformation';
-  // import outin from '@/api/warehouseManagement/outin';
-  export default {
-    components: {
-      // PageHeader,
-      BaseInfo,
-      BatchDetailDialog,
-      InWarehouse,
-      OutWarehouse,
-      InventoryAllocation,
-      ReportLoss,
-      BatchDetail,
-      WarehouseDetail,
-      warehouseConfigVue
+import BaseInfo from './components/details/BaseInfo.vue';
+import OutWarehouse from './components/details/OutWarehouse.vue';
+import InWarehouse from './components/details/InWarehouse.vue';
+import ReportLoss from './components/details/ReportLoss.vue';
+import InventoryDetails from './components/details/InventoryDetails.vue';
+import InventoryAllocation from './components/details/InventoryAllocation.vue';
+import WarehouseDetail from './components/details/WarehouseDetail.vue';
+import BatchDetail from './components/details/BatchDetail.vue';
+import warehouseConfigVue from './components/details/warehouseConfig.vue';
+// import PageHeader from '@/components/PageHeader'
+import BatchDetailDialog from './components/BatchDetailDialog.vue';
+import {
+  getCateInfo,
+  getDetails,
+  ledgerdetailPage,
+  ledgerPage
+} from '@/api/classifyManage/itemInformation';
+// import outin from '@/api/warehouseManagement/outin';
+export default {
+  components: {
+    // PageHeader,
+    BaseInfo,
+    BatchDetailDialog,
+    InWarehouse,
+    OutWarehouse,
+    InventoryAllocation,
+    ReportLoss,
+    BatchDetail,
+    WarehouseDetail,
+    warehouseConfigVue,
+    InventoryDetails
+  },
+  data() {
+    return {
+      activeName: 'zero',
+      categoryId: '',
+      tableData: {
+        first: [],
+        second: [],
+        third: [],
+        fourth: [],
+        fifth: [],
+        seventeen: []
+      },
+      certificate: '',
+      stockList: []
+    };
+  },
+  computed: {
+    dimension() {
+      return this.$route.query.dimension;
     },
-    data() {
-      return {
-        activeName: 'zero',
-        categoryId: '',
-        tableData: {
-          first: [],
-          second: [],
-          third: [],
-          fourth: [],
-          fifth: []
-        },
-        certificate: '',
-        stockList: []
-      };
+    categoryCode() {
+      return this.$route.query.categoryCode;
     },
-    computed: {
-      dimension() {
-        return this.$route.query.dimension;
-      },
-      baseInfo() {
-        return {};
-        // this.$store.state.stockManagement.stockLedgerBaseInfo[
-        //   this.$route.query.key
-        // ] || {}
-      },
-      tableColumn() {
-        return this.tableColumnConfig[this.activeName] || [];
-      },
-      baseParams() {
-        return {
-          // inventoryCode: this.baseInfo.assetCode,
-          // // name: this.baseInfo.assetName,
-          // // warehousingType: _warehousingType(this.baseInfo.assetType)
-          // //   .warehousingType,
-          categoryId: this.categoryId
-        };
-      }
+    baseInfo() {
+      return {};
+      // this.$store.state.stockManagement.stockLedgerBaseInfo[
+      //   this.$route.query.key
+      // ] || {}
     },
-    created() {
-      this.getDetailInfo(this.$route.query);
+    tableColumn() {
+      return this.tableColumnConfig[this.activeName] || [];
     },
-    methods: {
-      async getDetailInfo(row) {
-        console.log('===', row);
-        this.categoryId = row.id;
-        const res = await getDetails(row.id);
-        this.$nextTick(() => {
-          console.log(res);
-          // this.categoryId = res.categoryWms && res.categoryWms.categoryId;
-          this.$refs.baseInfoRef.getDetailInfoAugr(res.category); //基本信息
-          this.$refs.warehouseConfigRef.getDetailInfoAugr(res.categoryWms);
-        });
-        // const rep = await outin.getInventoryDetails({
-        //   pageNum: 1,
-        //   size: 10,
-        //   categoryId: row.id
-        // });
-        // console.log('===', rep);
-        // this.stockList = rep.list;
-      },
-      handleCellClick(row) {
-        this.$refs.batchDetailRef.open(this.activeName, {
-          ...row,
-          batchNum: this.baseInfo.batchNum
-        });
-      }
+    baseParams() {
+      return {
+        // inventoryCode: this.baseInfo.assetCode,
+        // // name: this.baseInfo.assetName,
+        // // warehousingType: _warehousingType(this.baseInfo.assetType)
+        // //   .warehousingType,
+        categoryId: this.categoryId
+      };
+    }
+  },
+  created() {
+    this.getDetailInfo(this.$route.query);
+  },
+  methods: {
+    async getDetailInfo(row) {
+      console.log('===', row);
+      this.categoryId = row.id;
+      const res = await getDetails(row.id);
+      this.$nextTick(() => {
+        console.log(res);
+        // this.categoryId = res.categoryWms && res.categoryWms.categoryId;
+        this.$refs.baseInfoRef.getDetailInfoAugr(res.category); //基本信息
+        this.$refs.warehouseConfigRef.getDetailInfoAugr(res.categoryWms);
+      });
+      // const rep = await outin.getInventoryDetails({
+      //   pageNum: 1,
+      //   size: 10,
+      //   categoryId: row.id
+      // });
+      // console.log('===', rep);
+      // this.stockList = rep.list;
+    },
+    handleCellClick(row) {
+      this.$refs.batchDetailRef.open(this.activeName, {
+        ...row,
+        batchNum: this.baseInfo.batchNum
+      });
     }
-  };
+  }
+};
 </script>
 
 <style lang="scss" scoped>
-  #stockLedger__batchDetails {
-    background: #fff;
-    margin: 10px;
-    height: calc(100vh - 116px);
-    overflow-y: auto;
-    .content-detail {
+#stockLedger__batchDetails {
+  background: #fff;
+  margin: 10px;
+  height: calc(100vh - 116px);
+  overflow-y: auto;
+
+  .content-detail {
+    height: 100%;
+    width: 100%;
+    padding: 10px 20px;
+    box-sizing: border-box;
+
+    ::v-deep .el-tabs {
       height: 100%;
       width: 100%;
-      padding: 10px 20px;
-      box-sizing: border-box;
-      ::v-deep .el-tabs {
-        height: 100%;
-        width: 100%;
-        display: flex;
-        flex-direction: column;
-        .el-tabs__content {
-          flex: 1;
-          .el-tab-pane {
-            height: 100%;
-          }
+      display: flex;
+      flex-direction: column;
+
+      .el-tabs__content {
+        flex: 1;
+
+        .el-tab-pane {
+          height: 100%;
         }
       }
     }
   }
+}
 </style>

+ 227 - 0
src/views/warehouseManagement/stockLedger/components/details/InventoryDetails.vue

@@ -0,0 +1,227 @@
+<!-- 入库 -->
+<template>
+    <div class="inWarehouse">
+        <ele-pro-table ref="table1" height="calc(100vh - 300px)" :columns="columns" :datasource="datasource"
+            :pageSize="20" row-key="id" :initLoad="false">
+        </ele-pro-table>
+    </div>
+</template>
+<script>
+import storageApi from '@/api/warehouseManagement/index.js';
+export default {
+    props: {
+        categoryCode: {
+            type: String,
+            default: ''
+        }
+    },
+    data() {
+        return {
+            columns: [
+                {
+                    columnKey: 'index',
+                    type: 'index',
+                    width: 50,
+                    align: 'center',
+                    label: '序号',
+                    showOverflowTooltip: true,
+                    fixed: 'left'
+                },
+                {
+                    prop: 'batchNo',
+                    label: '批次号',
+                    align: 'center'
+                },
+                {
+                    prop: 'categoryCode',
+                    label: '物品编码',
+                    align: 'center',
+                    showOverflowTooltip: true
+                },
+                {
+                    slot: 'categoryName',
+                    prop: 'categoryName',
+                    label: '物品名称',
+                    align: 'center',
+                    showOverflowTooltip: true,
+                    minWidth: 200
+                },
+                {
+                    prop: 'inventoryCycle',
+                    label: '存货周期(天)',
+                    align: 'center',
+                    width: 120,
+                    showOverflowTooltip: true
+                },
+                {
+                    prop: 'brandNum',
+                    label: '牌号',
+                    align: 'center',
+                    showOverflowTooltip: true
+                },
+                {
+                    prop: 'categoryModel',
+                    label: '型号',
+                    align: 'center',
+                    showOverflowTooltip: true
+                },
+                {
+                    prop: 'specification',
+                    label: '规格',
+                    align: 'center',
+                    showOverflowTooltip: true
+                },
+                {
+                    prop: 'level',
+                    label: '级别',
+                    showOverflowTooltip: true
+                },
+                {
+                    prop: 'measureQuantity',
+                    label: '计量数量',
+                    sortable: 'custom',
+                    showOverflowTooltip: true,
+                    width: 130,
+                    align: 'center'
+                },
+                {
+                    prop: 'measureUnit',
+                    label: '计量单位',
+                    align: 'center'
+                },
+                {
+                    prop: 'weight',
+                    label: '重量',
+                    showOverflowTooltip: true
+                },
+                {
+                    prop: 'weightUnit',
+                    label: '重量单位',
+                    showOverflowTooltip: true
+                },
+                {
+                    prop: 'packageNo',
+                    label: '包装编码',
+                    showOverflowTooltip: true
+                },
+                {
+                    prop: 'packingQuantity',
+                    label: '包装数量	',
+                    showOverflowTooltip: true
+                },
+                {
+                    prop: 'packingUnit',
+                    label: '包装单位	',
+                    showOverflowTooltip: true
+                },
+                {
+                    prop: 'warehouseName',
+                    label: '仓库	',
+                    showOverflowTooltip: true
+                },
+                {
+                    prop: 'areaName',
+                    label: '货区	',
+                    showOverflowTooltip: true
+                },
+                {
+                    prop: 'goodsAllocationName',
+                    label: '货架',
+                    showOverflowTooltip: true
+                },
+                {
+                    prop: 'goodsShelfName',
+                    label: '货位',
+                    showOverflowTooltip: true
+                },
+                {
+                    prop: 'productionDate',
+                    label: '生产日期',
+                    showOverflowTooltip: true
+                },
+                {
+                    prop: 'purchaseDate',
+                    label: '采购日期',
+                    showOverflowTooltip: true
+                },
+                {
+                    prop: 'barcodes',
+                    label: '发货条码	',
+                    showOverflowTooltip: true
+                },
+                {
+                    prop: 'clientCode',
+                    label: '客户代号',
+                    showOverflowTooltip: true
+                },
+                {
+                    prop: 'engrave',
+                    label: '刻码	',
+                    showOverflowTooltip: true
+                },
+                {
+                    prop: 'materielDesignation',
+                    label: '物料代号',
+                    width: 120,
+                    showOverflowTooltip: true
+                },
+                {
+                    prop: 'supplierCode',
+                    label: '供应商代号',
+                    width: 120,
+                    showOverflowTooltip: true
+                },
+                {
+                    prop: 'provenance',
+                    label: '产地',
+                    showOverflowTooltip: true
+                },
+            ]
+        }
+    },
+    created() {
+        this.reload({ keyWord: this.categoryCode });
+    },
+    methods: {
+        datasource({ page, limit, where }) {
+            const data = storageApi.getPackingList({ ...where, page, limit });
+            return data;
+        },
+        reload(where) {
+            this.$nextTick(() => {
+                if (this.$refs.table1 && this.$refs.table1.reload)
+                    this.$refs.table1.reload({ page: 1, where: where });
+            })
+        },
+
+
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.inWarehouse {
+    height: 100%;
+    width: 100%;
+    padding-top: 20px;
+    box-sizing: border-box;
+    display: flex;
+    flex-direction: column;
+
+    :deep(.table) {
+        flex: 1;
+        display: flex;
+        flex-direction: column;
+
+        .el-table__body-wrapper {
+            flex: 1;
+        }
+    }
+
+    .pagination {
+        flex: 0 0 50px;
+        display: flex;
+        align-items: center;
+    }
+}
+</style>

+ 2 - 1
src/views/warehouseManagement/stockLedger/components/item-list.vue

@@ -589,7 +589,8 @@ export default {
           // id: this.$refs.refSeavch.dimension != 3 ? row.id : row.categoryId,
           id: row.categoryId,
           assetId: row.assetId,
-          batchNo: row.batchNo
+          batchNo: row.batchNo,
+          categoryCode: row.categoryCode
         }
       });
     }