From 4b9403d9f405d11342290a02a0c5148d01a033b3 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期二, 17 三月 2026 16:06:23 +0800
Subject: [PATCH] fix: 库存报表页面未做页码分页(仓储物流的入库管理也没有分页)

---
 src/views/basicData/product/ProductSelectDialog.vue |   29 ++++++++++++++++++++++++-----
 1 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/src/views/basicData/product/ProductSelectDialog.vue b/src/views/basicData/product/ProductSelectDialog.vue
index 229cf87..6a30381 100644
--- a/src/views/basicData/product/ProductSelectDialog.vue
+++ b/src/views/basicData/product/ProductSelectDialog.vue
@@ -2,7 +2,13 @@
   <el-dialog v-model="visible" title="閫夋嫨浜у搧" width="900px" destroy-on-close :close-on-click-modal="false">
     <el-form :inline="true" :model="query" class="mb-2">
       <el-form-item label="浜у搧澶х被">
-        <el-input v-model="query.productName" placeholder="杈撳叆浜у搧澶х被" clearable @keyup.enter="onSearch" />
+        <el-input
+          v-model="query.productName"
+          placeholder="杈撳叆浜у搧澶х被"
+          clearable
+          :disabled="Boolean(props.fixedProductName)"
+          @keyup.enter="onSearch"
+        />
       </el-form-item>
 
       <el-form-item label="鍨嬪彿鍚嶇О">
@@ -44,7 +50,7 @@
 <script setup lang="ts">
 import { computed, onMounted, reactive, ref, watch, nextTick } from "vue";
 import { ElMessage } from "element-plus";
-import { productModelList } from '@/api/basicData/productModel'
+import { productModelList } from "../../../api/basicData/productModel.js";
 
 export type ProductRow = {
   id: number;
@@ -56,6 +62,8 @@
 const props = defineProps<{
   modelValue: boolean;
   single?: boolean; // 鏄惁鍙兘閫夋嫨涓�涓紝榛樿false锛堝彲閫夋嫨澶氫釜锛�
+  fixedProductName?: string; // 鍥哄畾鈥滀骇鍝佸ぇ绫烩�濈瓫閫夛紙渚嬪锛氳�楁潗锛夛紝浼犲叆鍚庝笉鍙紪杈戜笖閲嶇疆涓嶆竻绌�
+  excludeParentNames?: string[]; // 鎺掗櫎鈥滅被鍨嬧��(parentName)锛屼緥濡傦細['鑰楁潗']锛堜粎浼犲叆鏃剁敓鏁堬級
 }>();
 
 const emit = defineEmits(['update:modelValue', 'confirm']);
@@ -128,7 +136,7 @@
 }
 
 function onReset() {
-  query.productName = "";
+  query.productName = props.fixedProductName ? props.fixedProductName : "";
   query.model = "";
   page.pageNum = 1;
   loadData();
@@ -161,8 +169,13 @@
       current: page.pageNum,
       size: page.pageSize,
     });
-    tableData.value = res.records;
-    total.value = res.total;
+    const records = (res?.records || []) as any[];
+    const exclude = (props.excludeParentNames || []).filter(Boolean);
+    const filtered = exclude.length
+      ? records.filter((r) => !exclude.includes(String(r?.parentName ?? "")))
+      : records;
+    tableData.value = filtered;
+    total.value = exclude.length ? filtered.length : res.total;
   } finally {
     loading.value = false;
   }
@@ -172,6 +185,12 @@
 watch(() => props.modelValue, (visible) => {
   if (visible) {
     multipleSelection.value = [];
+    // 鍙湁浼犱簡 fixedProductName 鎵嶅惎鐢ㄢ�滃浐瀹氬ぇ绫荤瓫閫夆�濈殑鐗规畩閫昏緫锛屽叾瀹冨満鏅繚鎸佸師琛屼负涓嶅彉
+    if (props.fixedProductName) {
+      query.productName = props.fixedProductName;
+      page.pageNum = 1;
+      loadData();
+    }
   }
 });
 

--
Gitblit v1.9.3