Browse Source

2026-06-30

RoHS和lab配置【搜索】功能
master
fengyuan_yang 4 weeks ago
parent
commit
45049e1f3e
  1. 3
      src/api/lab/lab.js
  2. 3
      src/api/rohs/rohs.js
  3. 84
      src/views/modules/lab/labRecord.vue
  4. 86
      src/views/modules/rohs/rohsRecord.vue

3
src/api/lab/lab.js

@ -3,6 +3,9 @@ import { createAPI } from '@/utils/httpRequest.js'
// 获取列表 // 获取列表
export const getLabList = params => createAPI(`/lab/list`, 'get', params) export const getLabList = params => createAPI(`/lab/list`, 'get', params)
// 获取高级搜索列表
export const getLabListAny = data => createAPI(`/lab/list/any`, 'post', data)
// 获取详情 // 获取详情
export const getLabDetail = (site, referenceNo) => createAPI(`/lab/info`, 'get', { site, referenceNo }) export const getLabDetail = (site, referenceNo) => createAPI(`/lab/info`, 'get', { site, referenceNo })

3
src/api/rohs/rohs.js

@ -3,6 +3,9 @@ import { createAPI } from "@/utils/httpRequest.js";
// 获取列表 // 获取列表
export const getRohsList = params => createAPI(`/rohs/list`, 'get', params); export const getRohsList = params => createAPI(`/rohs/list`, 'get', params);
// 获取高级搜索列表
export const getRohsListAny = data => createAPI(`/rohs/list/any`, 'post', data);
// 获取详情 // 获取详情
export const getRohsDetail = (site, referenceNo) => createAPI(`/rohs/info`, 'get', { site, referenceNo }); export const getRohsDetail = (site, referenceNo) => createAPI(`/rohs/info`, 'get', { site, referenceNo });

84
src/views/modules/lab/labRecord.vue

@ -869,6 +869,7 @@
</el-tabs> </el-tabs>
<ChooseList ref="baseList" @getBaseData="getBaseData"></ChooseList> <ChooseList ref="baseList" @getBaseData="getBaseData"></ChooseList>
<filter-search :visible.sync="filterVisible" @search="queryByAnyField"></filter-search>
</div> </div>
</template> </template>
@ -885,13 +886,15 @@ import ChooseList from '@/views/modules/common/Chooselist'
import DictDataSelect from '../sys/dict-data-select.vue' import DictDataSelect from '../sys/dict-data-select.vue'
import ApprovalInformation from '../changeManagement/approvalInformation.vue' import ApprovalInformation from '../changeManagement/approvalInformation.vue'
import ossComponents from '../oss/ossComponents.vue' import ossComponents from '../oss/ossComponents.vue'
import FilterSearch from '../../common/filterSearch.vue'
export default { export default {
components: { components: {
ChooseList, ChooseList,
DictDataSelect, DictDataSelect,
ApprovalInformation, ApprovalInformation,
ossComponents
ossComponents,
FilterSearch
}, },
data () { data () {
return { return {
@ -915,6 +918,9 @@ export default {
pageSize: 20, pageSize: 20,
totalPage: 0, totalPage: 0,
dataListLoading: false, dataListLoading: false,
filterVisible: false,
isFilterSearch: false,
filterSearchData: {},
activeTable: 'basicInfo', activeTable: 'basicInfo',
menuId: '', menuId: '',
@ -2134,6 +2140,7 @@ export default {
this.currentTestSpecFileList = [] this.currentTestSpecFileList = []
this.currentTestReportFileList = [] this.currentTestReportFileList = []
this.approvalList = [] this.approvalList = []
this.isFilterSearch = false
return return
} }
this.dataListSelections = [] this.dataListSelections = []
@ -2195,22 +2202,93 @@ export default {
this.approvalList = [] this.approvalList = []
this.dataListLoading = false this.dataListLoading = false
}) })
this.isFilterSearch = false
}, },
sizeChangeHandle (val) { sizeChangeHandle (val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
if (this.isFilterSearch === false) {
this.getDataList() this.getDataList()
} else {
this.queryByAnyField(this.filterSearchData)
}
}, },
currentChangeHandle (val) { currentChangeHandle (val) {
this.pageIndex = val this.pageIndex = val
if (this.isFilterSearch === false) {
this.getDataList() this.getDataList()
} else {
this.queryByAnyField(this.filterSearchData)
}
}, },
searchHandle () { searchHandle () {
if (!this.authSearch) { if (!this.authSearch) {
return return
} }
this.pageIndex = 1
this.getDataList()
this.filterVisible = true
},
queryByAnyField (params) {
const queryParams = {
...(params || {})
}
queryParams.no = this.pageIndex
queryParams.size = this.pageSize
queryParams.userId = this.$store.state.user.id.toString()
queryParams.site = this.searchData.site || ''
queryParams.menuId = this.menuId
this.dataListSelections = []
this.dataListLoading = true
api.getLabListAny(queryParams).then(({data}) => {
if (data && data.code === 0) {
const list = (data.page && data.page.list) || []
this.dataList = list.map(item => ({
applicantName: '',
customerName: '',
projectName: '',
testerName: '',
nodeId: '',
nodeName: '',
currentApprover: '',
...item
}))
this.totalPage = data.page.totalCount
this.$nextTick(() => {
if (this.$refs.labTable && this.dataList.length > 0) {
this.$refs.labTable.setCurrentRow(this.dataList[0])
} else if (this.$refs.labTable) {
this.$refs.labTable.setCurrentRow()
}
})
} else {
this.$message.warning((data && data.msg) || '搜索失败')
this.dataList = []
this.totalPage = 0
this.currentRow = {}
this.currentDetailRequestId += 1
this.currentDetail = this.buildEmptyDetailData()
this.currentDetailLoading = false
this.currentJudgeCriteriaFileList = []
this.currentTestSpecFileList = []
this.currentTestReportFileList = []
this.approvalList = []
}
this.dataListLoading = false
}).catch(() => {
this.dataList = []
this.totalPage = 0
this.currentRow = {}
this.currentDetailRequestId += 1
this.currentDetail = this.buildEmptyDetailData()
this.currentDetailLoading = false
this.currentJudgeCriteriaFileList = []
this.currentTestSpecFileList = []
this.currentTestReportFileList = []
this.approvalList = []
this.dataListLoading = false
})
this.filterSearchData = JSON.parse(JSON.stringify(queryParams))
this.isFilterSearch = true
this.filterVisible = false
}, },
buildExportName () { buildExportName () {
const now = new Date() const now = new Date()

86
src/views/modules/rohs/rohsRecord.vue

@ -1015,6 +1015,7 @@
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<ChooseList ref="baseList" @getBaseData="getBaseData"></ChooseList> <ChooseList ref="baseList" @getBaseData="getBaseData"></ChooseList>
<filter-search :visible.sync="filterVisible" @search="queryByAnyField"></filter-search>
</div> </div>
</template> </template>
@ -1030,6 +1031,7 @@ import ossComponents from '../oss/ossComponents.vue'
import ChooseList from '@/views/modules/common/Chooselist' import ChooseList from '@/views/modules/common/Chooselist'
import DictDataSelect from "../sys/dict-data-select.vue" import DictDataSelect from "../sys/dict-data-select.vue"
import ApprovalInformation from "../changeManagement/approvalInformation.vue" import ApprovalInformation from "../changeManagement/approvalInformation.vue"
import FilterSearch from "../../common/filterSearch.vue"
export default { export default {
components: { components: {
@ -1037,7 +1039,8 @@ export default {
ossComponents, ossComponents,
ChooseList, ChooseList,
DictDataSelect, DictDataSelect,
ApprovalInformation
ApprovalInformation,
FilterSearch
}, },
data () { data () {
return { return {
@ -1256,6 +1259,9 @@ export default {
operatorId: '', operatorId: '',
operatorName: '' operatorName: ''
}, },
filterVisible: false,
isFilterSearch: false,
filterSearchData: {},
approvalList: [], approvalList: [],
plmRohsAuthorityArr: [], plmRohsAuthorityArr: [],
nodeAuthorityLoaded: false, nodeAuthorityLoaded: false,
@ -2345,6 +2351,7 @@ export default {
this.totalPage = 0 this.totalPage = 0
this.currentRow = {} this.currentRow = {}
this.approvalList = [] this.approvalList = []
this.isFilterSearch = false
return return
} }
this.dataListLoading = true this.dataListLoading = true
@ -2407,24 +2414,97 @@ export default {
this.approvalList = [] this.approvalList = []
this.dataListLoading = false this.dataListLoading = false
}) })
this.isFilterSearch = false
}, },
// //
sizeChangeHandle (val) { sizeChangeHandle (val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
if (this.isFilterSearch === false) {
this.getDataList() this.getDataList()
} else {
this.queryByAnyField(this.filterSearchData)
}
}, },
currentChangeHandle (val) { currentChangeHandle (val) {
this.pageIndex = val this.pageIndex = val
if (this.isFilterSearch === false) {
this.getDataList() this.getDataList()
} else {
this.queryByAnyField(this.filterSearchData)
}
}, },
// //
searchHandle () { searchHandle () {
if (!this.authSearch) { if (!this.authSearch) {
return return
} }
this.pageIndex = 1
this.getDataList()
this.filterVisible = true
},
queryByAnyField (params) {
const queryParams = {
...(params || {})
}
queryParams.no = this.pageIndex
queryParams.size = this.pageSize
queryParams.userId = this.$store.state.user.id.toString()
queryParams.site = this.$store.state.user.site
queryParams.menuId = this.menuId
this.dataListLoading = true
api.getRohsListAny(queryParams).then(({data}) => {
if (data && data.code === 0) {
const list = (data.page && data.page.list) || []
this.dataList = list.map(item => {
return {
applicantName: '',
pmName: '',
npdEngineerName: '',
technicalPlanName: '',
buyerName: '',
endCustomerName: '',
projectName: '',
nodeId: '',
nodeName: '',
currentApprover: '',
commGroup1Desc: '',
commGroup2Desc: '',
commGroup3Desc: '',
hsfApproverName: '',
relatedPeopleName: '',
...item
}
})
this.dataListSelections = []
this.totalPage = data.page.totalCount
this.$nextTick(() => {
if (this.$refs.rohsTable) {
this.$refs.rohsTable.clearSelection()
}
if (this.$refs.rohsTable && this.dataList.length > 0) {
this.$refs.rohsTable.setCurrentRow(this.dataList[0])
} else if (this.$refs.rohsTable) {
this.$refs.rohsTable.setCurrentRow()
}
})
} else {
this.$message.warning((data && data.msg) || '搜索失败')
this.dataList = []
this.dataListSelections = []
this.totalPage = 0
this.currentRow = {}
this.approvalList = []
}
this.dataListLoading = false
}).catch(() => {
this.dataList = []
this.dataListSelections = []
this.currentRow = {}
this.approvalList = []
this.dataListLoading = false
})
this.filterSearchData = JSON.parse(JSON.stringify(queryParams))
this.isFilterSearch = true
this.filterVisible = false
}, },
buildExportName () { buildExportName () {
const now = new Date() const now = new Date()

Loading…
Cancel
Save