From 65f419121190fb159166d64caad736eebca118f0 Mon Sep 17 00:00:00 2001 From: Teo <2642673902@qq.com> Date: Thu, 21 Aug 2025 21:39:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- src/api/materials/materialsInventory/types.ts | 5 ++- .../component/MaterialsInventoryAddDialog.vue | 7 +++-- .../usageMaterials/material/index.vue | 28 +++++------------ .../usageMaterials/material/indexSon.vue | 20 +++++++++--- .../usageMaterials/purchase/index.vue | 27 ++++++---------- .../usageMaterials/purchase/indexSon.vue | 31 +++++++++---------- 7 files changed, 57 insertions(+), 63 deletions(-) diff --git a/.env.development b/.env.development index 6e07116..d905b86 100644 --- a/.env.development +++ b/.env.development @@ -5,7 +5,7 @@ VITE_APP_TITLE = 煤科建管平台 VITE_APP_ENV = 'development' # 开发环境 -VITE_APP_BASE_API = 'http://192.168.110.149:8899' +VITE_APP_BASE_API = 'http://192.168.110.209:8899' # 无人机接口地址 diff --git a/src/api/materials/materialsInventory/types.ts b/src/api/materials/materialsInventory/types.ts index 1f727ae..e7c2110 100644 --- a/src/api/materials/materialsInventory/types.ts +++ b/src/api/materials/materialsInventory/types.ts @@ -82,7 +82,10 @@ export interface MaterialsInventoryForm extends BaseEntity { * 主键id */ id?: string | number; - + /** + * 使用部位 + */ + usePart?: string; /** * 材料id */ diff --git a/src/views/materials/materials/component/MaterialsInventoryAddDialog.vue b/src/views/materials/materials/component/MaterialsInventoryAddDialog.vue index 48d1db3..116b9fc 100644 --- a/src/views/materials/materials/component/MaterialsInventoryAddDialog.vue +++ b/src/views/materials/materials/component/MaterialsInventoryAddDialog.vue @@ -24,13 +24,16 @@ + + + - + diff --git a/src/views/materials/usageMaterials/material/index.vue b/src/views/materials/usageMaterials/material/index.vue index a4008b8..f94ef0f 100644 --- a/src/views/materials/usageMaterials/material/index.vue +++ b/src/views/materials/usageMaterials/material/index.vue @@ -75,20 +75,7 @@ - - - 共 {{ total }} 条记录,当前显示第 {{ (currentPage - 1) * pageSize + 1 }} 至 {{ Math.min(currentPage * pageSize, total) }} 条 - - - + { const fetchData = async () => { loading.value = true; try { - const res = await useMaterialsQueryList({ - projectId: currentProject.value?.id, - findType: 2 - }); - + const res = await useMaterialsQueryList(queryParams); tableData.value = res.rows; total.value = res.total; loading.value = false; diff --git a/src/views/materials/usageMaterials/material/indexSon.vue b/src/views/materials/usageMaterials/material/indexSon.vue index 79d28b7..440cfde 100644 --- a/src/views/materials/usageMaterials/material/indexSon.vue +++ b/src/views/materials/usageMaterials/material/indexSon.vue @@ -168,9 +168,14 @@ - - 共 {{ total }} 条记录,当前显示第 {{ (currentPage - 1) * pageSize + 1 }} 至 {{ Math.min(currentPage * pageSize, total) }} 条 - + + { form.id = ''; }; +const queryParams = reactive({ + pageSize: 10, + pageNum: 1, + physicalsupplyId: routeParams.value.id +}); + const handleEdit2 = (row) => { dialogType2.value = 'editSon'; currentRow2.value = row; @@ -573,9 +584,10 @@ const handleSubmit = async () => { }; const materialsUsageDetails1 = () => { loading.value = true; - materialsUsageDetails({ physicalsupplyId: routeParams.value.id }) + materialsUsageDetails(queryParams) .then((res) => { tableData.value = res.rows; + total.value = res.total; }) .catch(() => { loading.value = false; diff --git a/src/views/materials/usageMaterials/purchase/index.vue b/src/views/materials/usageMaterials/purchase/index.vue index f5df9ee..f8e60ea 100644 --- a/src/views/materials/usageMaterials/purchase/index.vue +++ b/src/views/materials/usageMaterials/purchase/index.vue @@ -88,20 +88,7 @@ - - - 共 {{ total }} 条记录,当前显示第 {{ (currentPage - 1) * pageSize + 1 }} 至 {{ Math.min(currentPage * pageSize, total) }} 条 - - - + { if (!dateString) return '-'; @@ -289,10 +283,7 @@ const tableRowClassName = ({ row, rowIndex }) => { const fetchData = async () => { loading.value = true; try { - const res = await useMaterialsQueryList({ - projectId: currentProject.value?.id, - findType: 1 - }); + const res = await useMaterialsQueryList(queryParams); tableData.value = res.rows; total.value = res.total; diff --git a/src/views/materials/usageMaterials/purchase/indexSon.vue b/src/views/materials/usageMaterials/purchase/indexSon.vue index 75915de..4611d85 100644 --- a/src/views/materials/usageMaterials/purchase/indexSon.vue +++ b/src/views/materials/usageMaterials/purchase/indexSon.vue @@ -166,21 +166,13 @@ - - - 共 {{ total }} 条记录,当前显示第 {{ (currentPage - 1) * pageSize + 1 }} 至 {{ Math.min(currentPage * pageSize, total) }} 条 - - - + @@ -503,7 +495,11 @@ const resetForm = () => { form.findType = 1; form.id = ''; }; - +const queryParams = reactive({ + pageSize: 10, + pageNum: 1, + physicalsupplyId: routeParams.value.id +}); const handleEdit2 = (row) => { dialogType2.value = 'editSon'; currentRow2.value = row; @@ -596,8 +592,9 @@ const handleSubmit = async () => { } }; const materialsUsageDetails1 = () => { - materialsUsageDetails({ physicalsupplyId: routeParams.value.id }).then((res) => { + materialsUsageDetails(queryParams).then((res) => { tableData.value = res.rows; + total.value = res.total; }); }; // 格式化日期