Browse Source

2026-10-14

项目信息:保存编辑后筛条件不清除
master
fengyuan_yang 4 weeks ago
parent
commit
6e89dd21b0
  1. 2
      src/views/modules/project/projectInfo/com_project_info_part.vue
  2. 77
      src/views/modules/project/projectInfo/projectInfo.vue
  3. 33
      src/views/modules/project/projectInfo/projectInfoQuery.vue

2
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',

77
src/views/modules/project/projectInfo/projectInfo.vue

@ -249,7 +249,7 @@
<oss-components height="25vh" label="项目号" :columns="ossColumns" :order-ref1="currentRow.site" :order-ref2="currentRow.projectId"></oss-components>
</el-tab-pane>
<el-tab-pane label="项目物料" v-if="isAuth('101002001:part')" name="part">
<projectPart ref="projectPart" @refreshProjectList="search"></projectPart>
<projectPart ref="projectPart" @refreshProjectList="refreshProjectProductCategory"></projectPart>
</el-tab-pane>
<el-tab-pane label="询价信息" v-if="isAuth('101002001:quotation')" name="quotation">
<project-quotation ref="projectQuotation" ></project-quotation>
@ -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)
}

33
src/views/modules/project/projectInfo/projectInfoQuery.vue

@ -231,7 +231,7 @@
:save-visible="false" :remove-visible="false"></oss-components>
</el-tab-pane>
<el-tab-pane label="项目物料" name="part">
<projectPart ref="projectPart" @refreshProjectList="search"></projectPart>
<projectPart ref="projectPart" @refreshProjectList="refreshProjectProductCategory"></projectPart>
</el-tab-pane>
<el-tab-pane label="打样信息" name="sample">
<sample ref="sample"></sample>
@ -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));

Loading…
Cancel
Save