From 6e89dd21b06c2f9b759e2d708f2da00f19ab49f8 Mon Sep 17 00:00:00 2001
From: fengyuan_yang <1976974459@qq.com>
Date: Wed, 14 Oct 2026 10:03:40 +0800
Subject: [PATCH] =?UTF-8?q?2026-10-14=20=E9=A1=B9=E7=9B=AE=E4=BF=A1?=
=?UTF-8?q?=E6=81=AF=EF=BC=9A=E4=BF=9D=E5=AD=98=E7=BC=96=E8=BE=91=E5=90=8E?=
=?UTF-8?q?=E7=AD=9B=E6=9D=A1=E4=BB=B6=E4=B8=8D=E6=B8=85=E9=99=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../projectInfo/com_project_info_part.vue | 2 +-
.../project/projectInfo/projectInfo.vue | 77 ++++++++++++++++---
.../project/projectInfo/projectInfoQuery.vue | 33 +++++++-
3 files changed, 100 insertions(+), 12 deletions(-)
diff --git a/src/views/modules/project/projectInfo/com_project_info_part.vue b/src/views/modules/project/projectInfo/com_project_info_part.vue
index 7da5344..a6bf9f6 100644
--- a/src/views/modules/project/projectInfo/com_project_info_part.vue
+++ b/src/views/modules/project/projectInfo/com_project_info_part.vue
@@ -2917,8 +2917,8 @@ import CodeGeneration from "../../code/generation.vue";
this.modalData.partItemInfoFlag = this.partItemInfoFlag
partInformationEdit2(this.modalData).then(({data}) => {
if (data && data.code === 0) {
- this.searchTable()
this.modalFlag = false
+ this.onProjectPartAdded(false)
this.$message({
message: '操作成功',
type: 'success',
diff --git a/src/views/modules/project/projectInfo/projectInfo.vue b/src/views/modules/project/projectInfo/projectInfo.vue
index 6543845..5767cd9 100644
--- a/src/views/modules/project/projectInfo/projectInfo.vue
+++ b/src/views/modules/project/projectInfo/projectInfo.vue
@@ -249,7 +249,7 @@
-
+
@@ -1652,11 +1652,19 @@
// 导出 end
// 获取数据列表
search2 (projectId) {
- this.searchData.projectId = projectId
- this.search()
+ this.refreshDataListKeepFilter(projectId)
},
- search () {
+ refreshDataListKeepFilter (projectId) {
+ const keepProjectId = projectId || (this.currentRow && this.currentRow.projectId)
+ if (this.isFilterSearch) {
+ this.projectInfoSearchByAnyField(this.filterSearchData, keepProjectId)
+ return
+ }
+ this.search(keepProjectId, true)
+ },
+
+ search (keepProjectId, keepFilter) {
this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex
this.searchData.userId = this.$store.state.user.id
@@ -1667,13 +1675,59 @@
this.pageIndex = data.page.currPage
this.pageSize = data.page.pageSize
this.totalPage = data.page.totalCount
- if(this.dataList1.length>0){
- this.$refs.mainTable.setCurrentRow(this.dataList1[0]);
- this.changeData(this.dataList1[0])
- }
+ this.applyCurrentListRow(keepProjectId)
}
this.dataListLoading = false
- this.isFilterSearch = false
+ if (!keepFilter) {
+ this.isFilterSearch = false
+ }
+ })
+ },
+ applyCurrentListRow (projectId) {
+ if (!this.dataList1 || !this.dataList1.length) {
+ return
+ }
+ const matched = projectId
+ ? this.dataList1.find(item => item.projectId === projectId)
+ : null
+ const row = matched || this.dataList1[0]
+ this.$nextTick(() => {
+ if (this.$refs.mainTable) {
+ this.$refs.mainTable.setCurrentRow(row)
+ }
+ this.changeData(row)
+ })
+ },
+ refreshProjectProductCategory () {
+ const current = this.currentRow || this.projectData
+ if (!current || !current.projectId) {
+ return
+ }
+ const query = {
+ site: current.site,
+ projectId: current.projectId,
+ page: 1,
+ limit: 1,
+ menuId: this.menuId,
+ userName: this.$store.state.user.name,
+ userId: this.$store.state.user.id
+ }
+ projectInfoSearch(query).then(({data}) => {
+ if (data.code !== 0 || !data.page || !Array.isArray(data.page.list) || data.page.list.length === 0) {
+ return
+ }
+ const latest = data.page.list.find(item => item.projectId === current.projectId && item.site === current.site) || data.page.list[0]
+ const productCategory = latest.productCategory
+ const target = (this.dataList1 || []).find(item => item.projectId === current.projectId && item.site === current.site)
+ if (target) {
+ this.$set(target, 'productCategory', productCategory)
+ }
+ if (this.currentRow && this.currentRow.projectId === current.projectId) {
+ this.$set(this.currentRow, 'productCategory', productCategory)
+ }
+ if (this.projectData && this.projectData.projectId === current.projectId) {
+ this.$set(this.projectData, 'productCategory', productCategory)
+ }
})
},
//单击切换订单
@@ -2456,7 +2510,7 @@
}).catch(() => {})
},
- projectInfoSearchByAnyField(params){
+ projectInfoSearchByAnyField(params, keepProjectId){
params.no = this.pageIndex
params.size = this.pageSize
params.site = this.$store.state.user.site
@@ -2466,6 +2520,9 @@
if (data && data.code === 0){
this.dataList1 = data.page.list
this.totalPage = data.page.totalCount
+ if (keepProjectId) {
+ this.applyCurrentListRow(keepProjectId)
+ }
}else {
this.$message.warning(data.msg)
}
diff --git a/src/views/modules/project/projectInfo/projectInfoQuery.vue b/src/views/modules/project/projectInfo/projectInfoQuery.vue
index 6c8eaf2..9c57e8b 100644
--- a/src/views/modules/project/projectInfo/projectInfoQuery.vue
+++ b/src/views/modules/project/projectInfo/projectInfoQuery.vue
@@ -231,7 +231,7 @@
:save-visible="false" :remove-visible="false">
-
+
@@ -938,6 +938,37 @@
this.isFilterSearch = false
})
},
+ refreshProjectProductCategory () {
+ const current = this.currentRow || this.projectData
+ if (!current || !current.projectId) {
+ return
+ }
+ const query = {
+ site: current.site,
+ projectId: current.projectId,
+ page: 1,
+ limit: 1,
+ userName: this.$store.state.user.name,
+ userId: this.$store.state.user.id
+ }
+ projectInfoSearchForQuery(query).then(({data}) => {
+ if (data.code !== 0 || !data.page || !Array.isArray(data.page.list) || data.page.list.length === 0) {
+ return
+ }
+ const latest = data.page.list.find(item => item.projectId === current.projectId && item.site === current.site) || data.page.list[0]
+ const productCategory = latest.productCategory
+ const target = (this.dataList1 || []).find(item => item.projectId === current.projectId && item.site === current.site)
+ if (target) {
+ this.$set(target, 'productCategory', productCategory)
+ }
+ if (this.currentRow && this.currentRow.projectId === current.projectId) {
+ this.$set(this.currentRow, 'productCategory', productCategory)
+ }
+ if (this.projectData && this.projectData.projectId === current.projectId) {
+ this.$set(this.projectData, 'productCategory', productCategory)
+ }
+ })
+ },
//单击切换订单
changeData(row) {
this.currentRow = JSON.parse(JSON.stringify(row));