From 87fce896046ec8e804810f75a90a62a5986e67ed Mon Sep 17 00:00:00 2001
From: ZN <zhang_12370@163.com>
Date: 星期二, 31 三月 2026 15:18:26 +0800
Subject: [PATCH] fix: 修正端口号、消息页签索引及生产报告表单字段

---
 src/pages/inventoryManagement/stockManagement/Qualified.vue |  151 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 151 insertions(+), 0 deletions(-)

diff --git a/src/pages/inventoryManagement/stockManagement/Qualified.vue b/src/pages/inventoryManagement/stockManagement/Qualified.vue
new file mode 100644
index 0000000..12b9060
--- /dev/null
+++ b/src/pages/inventoryManagement/stockManagement/Qualified.vue
@@ -0,0 +1,151 @@
+<template>
+  <view class="qualified-record-container">
+    <view class="search-section">
+      <view class="search-bar">
+        <view class="search-input">
+          <up-input
+            class="search-text"
+            placeholder="璇疯緭鍏ヤ骇鍝佸ぇ绫�"
+            v-model="searchForm.productName"
+            @confirm="handleQuery"
+            clearable
+          />
+        </view>
+        <view class="filter-button" @click="handleQuery">
+          <up-icon name="search" size="24" color="#999"></up-icon>
+        </view>
+      </view>
+    </view>
+
+    <scroll-view scroll-y class="ledger-list" v-if="tableData.length > 0" @scrolltolower="loadMore">
+      <view v-for="item in tableData" :key="item.id" class="ledger-item" :class="{ 'low-stock': isLowStock(item) }">
+        <view class="item-header">
+          <view class="item-left">
+            <view class="document-icon">
+              <up-icon name="file-text" size="16" color="#ffffff"></up-icon>
+            </view>
+            <text class="item-id">{{ item.productName }}</text>
+          </view>
+          <view class="item-right">
+            <text class="item-tag tag-type">鍚堟牸搴撳瓨</text>
+          </view>
+        </view>
+        
+        <up-divider></up-divider>
+
+        <view class="item-details">
+          <view class="detail-row">
+            <text class="detail-label">瑙勬牸鍨嬪彿</text>
+            <text class="detail-value">{{ item.model }}</text>
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">搴撳瓨鏁伴噺</text>
+            <text class="detail-value">{{ item.qualitity }} {{ item.unit }}</text>
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">閿佸畾/鍐荤粨</text>
+            <text class="detail-value">{{ item.lockedQuantity }} {{ item.unit }}</text>
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">鍙敤搴撳瓨</text>
+            <text class="detail-value" style="color: #2979ff; font-weight: bold;">{{ item.unLockedQuantity }} {{ item.unit }}</text>
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">搴撳瓨棰勮</text>
+            <text class="detail-value">{{ item.warnNum }}</text>
+          </view>
+          <view class="detail-row">
+            <text class="detail-label">鏇存柊鏃堕棿</text>
+            <text class="detail-value">{{ item.updateTime }}</text>
+          </view>
+        </view>
+      </view>
+      <up-loadmore :status="loadStatus" />
+    </scroll-view>
+    <view v-else-if="!loading" class="no-data">
+      <up-empty mode="data" text="鏆傛棤搴撳瓨鏁版嵁"></up-empty>
+    </view>
+  </view>
+</template>
+
+<script setup>
+import { ref, reactive, onMounted } from 'vue';
+import { getStockInventoryListPage } from "@/api/inventoryManagement/stockInventory.js";
+
+const tableData = ref([]);
+const loading = ref(false);
+const loadStatus = ref('loadmore');
+const page = reactive({ current: 1, size: 10 });
+const total = ref(0);
+const searchForm = reactive({ productName: '' });
+
+const handleQuery = () => {
+  page.current = 1;
+  tableData.value = [];
+  getList();
+};
+
+const getList = () => {
+  if (loading.value) return;
+  loading.value = true;
+  loadStatus.value = 'loading';
+  getStockInventoryListPage({ ...searchForm, ...page, type: 'qualified' }).then(res => {
+    loading.value = false;
+    const records = res.data.records || [];
+    tableData.value = page.current === 1 ? records : [...tableData.value, ...records];
+    total.value = res.data.total;
+    loadStatus.value = tableData.value.length >= total.value ? 'nomore' : 'loadmore';
+  }).catch(() => {
+    loading.value = false;
+    loadStatus.value = 'loadmore';
+  });
+};
+
+const loadMore = () => {
+  if (loadStatus.value === 'nomore' || loading.value) return;
+  page.current++;
+  getList();
+};
+
+const isLowStock = (row) => {
+  const stock = Number(row?.unLockedQuantity ?? 0);
+  const warn = Number(row?.warnNum ?? 0);
+  return Number.isFinite(stock) && Number.isFinite(warn) && stock < warn;
+};
+
+onMounted(() => {
+  getList();
+});
+</script>
+
+<style scoped lang="scss">
+@import '@/styles/sales-common.scss';
+
+.qualified-record-container {
+  height: 100%;
+  display: flex;
+  flex-direction: column;
+}
+
+.tag-type {
+  background-color: #e3f2fd;
+  color: #2196f3;
+  padding: 2px 8px;
+  border-radius: 4px;
+  font-size: 12px;
+}
+
+.ledger-list {
+  flex: 1;
+  overflow-y: auto;
+}
+
+.low-stock {
+  background-color: #fde2e2;
+  color: #c45656;
+}
+
+.no-data {
+  padding-top: 100px;
+}
+</style>

--
Gitblit v1.9.3