|
|
|
@ -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) |
|
|
|
} |
|
|
|
|