Просмотр исходного кода

feat(web-admin): show brand on inventory ledger and transactions

Co-authored-by: Cursor <cursoragent@cursor.com>
zlwu 3 месяцев назад
Родитель
Сommit
e7d7e731ba
2 измененных файлов с 24 добавлено и 2 удалено
  1. 13 2
      web-admin/src/api/pl/index.ts
  2. 11 0
      web-admin/src/views/pl/inventory/ledger.vue

+ 13 - 2
web-admin/src/api/pl/index.ts

@@ -1086,6 +1086,8 @@ export const freightApi = {
 export interface InventoryRecord {
   id: string
   productId: string
+  brandId?: string
+  brandName?: string
   productNo: string
   productName: string
   model?: string
@@ -1100,6 +1102,8 @@ export interface InventoryRecord {
 export interface InventoryTransaction {
   id: string
   productId: string
+  brandId?: string
+  brandName?: string
   productName: string
   transactionType: string
   planId?: string
@@ -1114,6 +1118,8 @@ export interface InventoryTransaction {
 export interface InventoryWarning {
   id: string
   productId: string
+  brandId?: string
+  brandName?: string
   productName: string
   warningType: string
   currentQty: number
@@ -1167,8 +1173,13 @@ export const inventoryApi = {
     request.get<InventoryWarning[]>('/transport/inventory/warnings', { params: { status } }),
   updateWarning: (id: string, data: { status: string; resolveRemark?: string }) =>
     request.put<InventoryWarning>(`/transport/inventory/warnings/${id}`, data),
-  setWarningThreshold: (data: { productId: string; lowStockWarning?: number; highStockWarning?: number }) =>
-    request.post('/transport/inventory/warning-threshold', data),
+  setWarningThreshold: (data: {
+    productId: string
+    brandId?: string
+    brandName?: string
+    lowStockWarning?: number
+    highStockWarning?: number
+  }) => request.post('/transport/inventory/warning-threshold', data),
   documentReminders: (status?: string) =>
     request.get<DocumentReminder[]>('/transport/inventory/document-reminders', { params: { status } }),
   documentReminderStats: () =>

+ 11 - 0
web-admin/src/views/pl/inventory/ledger.vue

@@ -73,6 +73,16 @@
             :index="(index) => (pagination.page - 1) * pagination.pageSize + index + 1"
           />
           <el-table-column prop="productName" label="产品名称" min-width="180" show-overflow-tooltip />
+          <el-table-column
+            v-if="isColumnVisible('brandName')"
+            label="品牌"
+            min-width="110"
+            show-overflow-tooltip
+          >
+            <template #default="{ row }">
+              {{ row.brandName || '—' }}
+            </template>
+          </el-table-column>
           <el-table-column
             v-if="isColumnVisible('productNo')"
             prop="productNo"
@@ -167,6 +177,7 @@ import { usePersistedListColumns } from '@/composables/usePersistedListColumns'
 import { useDbInstantSearch } from '@/composables/useDbInstantSearch'
 
 const listColumnDefs = [
+  { prop: 'brandName', label: '品牌' },
   { prop: 'productNo', label: '产品编号' },
   { prop: 'model', label: '规格型号' },
   { prop: 'unit', label: '单位' },