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

---
 src/views/inventoryManagement/receiptManagement/Record.vue |  108 ++++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 93 insertions(+), 15 deletions(-)

diff --git a/src/views/inventoryManagement/receiptManagement/Record.vue b/src/views/inventoryManagement/receiptManagement/Record.vue
index ec64f17..8e65c3c 100644
--- a/src/views/inventoryManagement/receiptManagement/Record.vue
+++ b/src/views/inventoryManagement/receiptManagement/Record.vue
@@ -15,6 +15,16 @@
                   style="width: 240px"
                   placeholder="璇疯緭鍏�"
                   clearable/>
+        <span class="search_title ml10">鏉ユ簮锛�</span>
+        <el-select v-model="searchForm.recordType"
+                  style="width: 240px"
+                  placeholder="璇烽�夋嫨"
+                  clearable>
+          <el-option v-for="item in stockRecordTypeOptions"
+                     :key="item.value"
+                     :label="item.label"
+                     :value="item.value"/>
+        </el-select>
         <el-button type="primary"
                    @click="handleQuery"
                    style="margin-left: 10px">鎼滅储
@@ -63,16 +73,58 @@
         <el-table-column label="鍏ュ簱鏁伴噺"
                          prop="stockInNum"
                          show-overflow-tooltip/>
+        <el-table-column label="杞︾墝鍙�"
+                         prop="licensePlateNo"
+                         v-if="type === '0'"
+                         show-overflow-tooltip/>
+        <el-table-column label="姣涢噸(鍚�)"
+                         prop="grossWeight"
+                         v-if="type === '0'"
+                         show-overflow-tooltip/>
+        <el-table-column label="鐨噸(鍚�)"
+                         prop="tareWeight"
+                         v-if="type === '0'"
+                         show-overflow-tooltip/>
+        <el-table-column label="鍑�閲�(鍚�)"
+                         prop="netWeight"
+                         v-if="type === '0'"
+                         show-overflow-tooltip/>
         <el-table-column label="鍏ュ簱浜�"
                          prop="createBy"
                          show-overflow-tooltip/>
+        <el-table-column label="鏉ユ簮"
+                         prop="recordType"
+                         show-overflow-tooltip>
+          <template #default="scope">
+            {{ getRecordType(scope.row.recordType) }}
+          </template>
+        </el-table-column>
+        <el-table-column label="杩囩鏃ユ湡"
+                         prop="weighingDate"
+                         v-if="type === '0'"
+                         show-overflow-tooltip/>
+        <el-table-column label="杩囩鍛�"
+                         prop="weighingOperator"
+                         v-if="type === '0'"
+                         show-overflow-tooltip/>
+        <el-table-column label="鎿嶄綔"
+                         width="120"
+                         align="center">
+          <template #default="scope">
+            <el-button type="primary"
+                       size="mini"
+                       @click="handlePreview(scope.row)">瀵煎嚭杩囩鍗�</el-button>
+          </template>
+        </el-table-column>
       </el-table>
-      <pagination v-show="total > 0"
-                  :total="total"
-                  layout="total, sizes, prev, pager, next, jumper"
-                  :page="page.current"
-                  :limit="page.size"
-                  @pagination="pageProductChange"/>
+      <div style="margin-top: 12px; display: flex; justify-content: flex-end;">
+        <pagination v-show="total > 0"
+                    :total="total"
+                    layout="total, sizes, prev, pager, next, jumper"
+                    :page="page.current"
+                    :limit="page.size"
+                    @pagination="pageProductChange"/>
+      </div>
     </div>
   </div>
 </template>
@@ -85,13 +137,15 @@
   toRefs,
   onMounted,
   getCurrentInstance,
-  nextTick,
 } from "vue";
 import {ElMessageBox} from "element-plus";
 import {
   getStockInRecordListPage,
   batchDeleteStockInRecords,
 } from "@/api/inventoryManagement/stockInRecord.js";
+import {
+  findAllQualifiedStockInRecordTypeOptions, findAllUnQualifiedStockInRecordTypeOptions,
+} from "@/api/basicData/enum.js";
 
 const {proxy} = getCurrentInstance();
 
@@ -106,11 +160,11 @@
 const tableData = ref([]);
 const selectedRows = ref([]);
 const tableLoading = ref(false);
-const activeTab = ref("production"); // 褰撳墠婵�娲荤殑 tab
-
+// 鏉ユ簮绫诲瀷閫夐」
+const stockRecordTypeOptions = ref([]);
 const page = reactive({
   current: 1,
-  size: 100,
+  size: 10,
 });
 const total = ref(0);
 
@@ -118,6 +172,7 @@
   searchForm: {
     productName: "",
     timeStr: "",
+    recordType: "",
   },
 });
 const {searchForm} = toRefs(data);
@@ -127,6 +182,10 @@
   page.current = 1;
   getList();
 };
+
+const getRecordType = (recordType) => {
+  return stockRecordTypeOptions.value.find(item => item.value === recordType)?.label || ''
+}
 
 const pageProductChange = obj => {
   page.current = obj.page;
@@ -139,13 +198,30 @@
   const params = {...page, type: props.type};
   params.timeStr = searchForm.value.timeStr;
   params.productName = searchForm.value.productName;
+  params.recordType = searchForm.value.recordType;
   getStockInRecordListPage(params)
       .then(res => {
         tableData.value = res.data.records;
+        total.value = res.data.total ?? 0;
       }).finally(() => {
     tableLoading.value = false;
   })
 };
+
+// 鑾峰彇鏉ユ簮绫诲瀷閫夐」
+const fetchStockRecordTypeOptions = () => {
+  if (props.type === '0') {
+    findAllQualifiedStockInRecordTypeOptions()
+        .then(res => {
+          stockRecordTypeOptions.value = res.data;
+        })
+    return
+  }
+  findAllUnQualifiedStockInRecordTypeOptions()
+      .then(res => {
+        stockRecordTypeOptions.value = res.data;
+      })
+}
 
 // 琛ㄦ牸閫夋嫨鏁版嵁
 const handleSelectionChange = selection => {
@@ -153,6 +229,11 @@
 };
 
 const expandedRowKeys = ref([]);
+
+// 瀵煎嚭杩囩鍗�
+const handlePreview = (row) => {
+  proxy.$download.name(row.weighbridgeDocPath);
+}
 
 // 瀵煎嚭
 const handleOut = () => {
@@ -163,11 +244,7 @@
   })
       .then(() => {
         // 鏍规嵁涓嶅悓鐨� tab 绫诲瀷璋冪敤涓嶅悓鐨勫鍑烘帴鍙�
-        let exportUrl = "/stockin/export";
-        if (activeTab.value === "production") {
-          exportUrl = "/stockin/exportOne";
-        }
-        proxy.download(exportUrl, {}, "鍏ュ簱鍙拌处.xlsx");
+        proxy.download("/stockInRecord/exportStockInRecord", {type: props.type}, props.type === '0' ? "鍚堟牸鍏ュ簱.xlsx" : "涓嶅悎鏍煎叆搴�.xlsx");
       })
       .catch(() => {
         proxy.$modal.msg("宸插彇娑�");
@@ -204,6 +281,7 @@
 
 onMounted(() => {
   getList();
+  fetchStockRecordTypeOptions();
 });
 </script>
 

--
Gitblit v1.9.3