Эх сурвалжийг харах

fix:库存台账详情中添加盘点工单和盘点计划列表

mlchen 6 өдөр өмнө
parent
commit
ffdae8739c

+ 10 - 0
src/views/warehouseManagement/stockLedger/batchDetails.vue

@@ -38,6 +38,12 @@
         <el-tab-pane label="报损报溢" name="fifth" lazy>
           <ReportLoss :baseInfo="baseInfo" :baseParams="baseParams" />
         </el-tab-pane>
+        <el-tab-pane label="盘点计划" name="stocktakingPlan" lazy>
+          <StocktakingPlan :categoryId="categoryId" />
+        </el-tab-pane>
+        <el-tab-pane label="盘点工单" name="stocktakingWork" lazy>
+          <StocktakingWorkOrder :categoryId="categoryId" />
+        </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>
@@ -59,6 +65,8 @@ 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 StocktakingPlan from './components/details/StocktakingPlan.vue';
+import StocktakingWorkOrder from './components/details/StocktakingWorkOrder.vue';
 import InventoryDetails from './components/details/InventoryDetails.vue';
 import InventoryAllocation from './components/details/InventoryAllocation.vue';
 import WarehouseDetail from './components/details/WarehouseDetail.vue';
@@ -82,6 +90,8 @@ export default {
     OutWarehouse,
     InventoryAllocation,
     ReportLoss,
+    StocktakingPlan,
+    StocktakingWorkOrder,
     BatchDetail,
     WarehouseDetail,
     warehouseConfigVue,

+ 163 - 0
src/views/warehouseManagement/stockLedger/components/details/StocktakingPlan.vue

@@ -0,0 +1,163 @@
+<!-- 盘点计划(库存台账非物品维度详情页签) -->
+<template>
+  <div id="stocktakingPlanTab">
+    <PlanSearch @search="reload"></PlanSearch>
+    <ele-pro-table
+      class="table_list"
+      ref="table"
+      height="calc(100vh - 300px)"
+      :columns="columns"
+      :datasource="datasource"
+      :pageSize="20"
+      row-key="id"
+    >
+      <template v-slot:code="{ row }">
+        <el-link type="primary" @click="goDetail(row)">{{ row.code }}</el-link>
+      </template>
+    </ele-pro-table>
+  </div>
+</template>
+
+<script>
+  import PlanSearch from '@/views/warehouseManagement/stocktaking/plan/components/plan-search.vue';
+  import { getInventoryPlanList } from '@/api/inventory';
+  export default {
+    components: { PlanSearch },
+    props: {
+      // 当前库存台账行的物料 id
+      categoryId: {
+        type: String,
+        default: ''
+      }
+    },
+    data() {
+      return {
+        // 0未派单;1已派单;2已完成;3已撤回
+        statusObj: {
+          0: '未派单',
+          1: '已派单',
+          2: '已完成',
+          3: '已撤回'
+        },
+        // 与「盘点计划」菜单列表同款列(去掉操作列:本页签只读)
+        columns: [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            slot: 'code',
+            prop: 'code',
+            label: '计划单号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            prop: 'name',
+            label: '计划名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'warehouseName',
+            label: '盘点仓库',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'ruleName',
+            label: '计划规则',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'planStatus',
+            label: '状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (row) => this.statusObj[Number(row.planStatus)] || ''
+          },
+          {
+            prop: 'createUserName',
+            label: '创建人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'createTime',
+            label: '生成时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 150
+          }
+        ]
+      };
+    },
+    watch: {
+      categoryId() {
+        this.reload();
+      }
+    },
+    methods: {
+      /* 表格数据源:盘点计划菜单同一接口,额外按当前物料收窄 */
+      async datasource({ page, limit, where }) {
+        if (!this.categoryId) {
+          return [];
+        }
+        try {
+          return await getInventoryPlanList({
+            pageNum: page,
+            size: limit,
+            categoryId: this.categoryId,
+            ...where
+          });
+        } catch (error) {
+          return [];
+        }
+      },
+      reload(where) {
+        this.$refs.table && this.$refs.table.reload({ page: 1, where });
+      },
+      // 与「盘点计划」菜单同一详情入口
+      goDetail(row) {
+        this.$router.push({
+          path: '/warehouseManagement/stocktaking/plan/details',
+          query: { id: row.id }
+        });
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  #stocktakingPlanTab {
+    height: 100%;
+    width: 100%;
+    padding-top: 10px;
+    box-sizing: border-box;
+    display: flex;
+    flex-direction: column;
+    :deep(.ele-pro-table) {
+      flex: 1;
+      display: flex;
+      flex-direction: column;
+      .el-table {
+        flex: 1;
+      }
+    }
+    .el-form-item {
+      margin-bottom: 5px !important;
+    }
+  }
+</style>

+ 177 - 0
src/views/warehouseManagement/stockLedger/components/details/StocktakingWorkOrder.vue

@@ -0,0 +1,177 @@
+<!-- 盘点工单(库存台账非物品维度详情页签) -->
+<template>
+  <div id="stocktakingWorkOrderTab">
+    <WorkSearch @search="reload"></WorkSearch>
+    <ele-pro-table
+      class="table_list"
+      ref="table"
+      height="calc(100vh - 300px)"
+      :columns="columns"
+      :datasource="datasource"
+      :pageSize="20"
+      row-key="id"
+    >
+      <template v-slot:code="{ row }">
+        <el-link type="primary" @click="goDetail(row)">{{ row.code }}</el-link>
+      </template>
+    </ele-pro-table>
+  </div>
+</template>
+
+<script>
+  import WorkSearch from '@/views/warehouseManagement/stocktaking/work/components/work-search.vue';
+  import { getPlanOrderList } from '@/api/inventory';
+  export default {
+    components: { WorkSearch },
+    props: {
+      // 当前库存台账行的物料 id
+      categoryId: {
+        type: String,
+        default: ''
+      }
+    },
+    data() {
+      return {
+        // 0-待处理,1-执行中,2-已完成
+        statusObj: {
+          0: '待处理',
+          1: '执行中',
+          2: '已完成'
+        },
+        // 与「盘点工单」菜单列表同款列(去掉操作列:本页签只读,报工仍在盘点工单菜单)
+        columns: [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            slot: 'code',
+            prop: 'code',
+            label: '盘点单号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            prop: 'status',
+            label: '状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            formatter: (row) => this.statusObj[Number(row.status)] || ''
+          },
+          {
+            prop: 'planCode',
+            label: '计划单号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+          {
+            prop: 'planName',
+            label: '计划名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'warehouseName',
+            label: '盘点仓库',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'executeGroupName',
+            label: '盘点部门',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'executorName',
+            label: '盘点人员',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'startTime',
+            label: '计划开始时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 150
+          },
+          {
+            prop: 'endTime',
+            label: '计划结束时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 150
+          }
+        ]
+      };
+    },
+    watch: {
+      categoryId() {
+        this.reload();
+      }
+    },
+    methods: {
+      /* 表格数据源:盘点工单菜单同一接口,额外按当前物料收窄 */
+      async datasource({ page, limit, where }) {
+        if (!this.categoryId) {
+          return [];
+        }
+        try {
+          return await getPlanOrderList({
+            pageNum: page,
+            size: limit,
+            categoryId: this.categoryId,
+            ...where
+          });
+        } catch (error) {
+          return [];
+        }
+      },
+      reload(where) {
+        this.$refs.table && this.$refs.table.reload({ page: 1, where });
+      },
+      // 与「盘点工单」菜单同一详情入口。只带工单 id:planId 是裸 Long(雪花 ID 到前端已丢精度),
+      // 后端 getOrderInfoByPlanId 支持按工单反查计划
+      goDetail(row) {
+        this.$router.push({
+          path: '/warehouseManagement/stocktaking/work/details',
+          query: { id: row.id }
+        });
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  #stocktakingWorkOrderTab {
+    height: 100%;
+    width: 100%;
+    padding-top: 10px;
+    box-sizing: border-box;
+    display: flex;
+    flex-direction: column;
+    :deep(.ele-pro-table) {
+      flex: 1;
+      display: flex;
+      flex-direction: column;
+      .el-table {
+        flex: 1;
+      }
+    }
+    .el-form-item {
+      margin-bottom: 5px !important;
+    }
+  }
+</style>