Browse Source

2026-07-08

RoHS优化,OA代办跳转问题
master
fengyuan_yang 3 weeks ago
parent
commit
6761190b72
  1. 64
      src/views/modules/lab/labRecord.vue
  2. 64
      src/views/modules/rohs/rohsRecord.vue

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

@ -1059,14 +1059,62 @@ export default {
mounted () { mounted () {
this.fetchNodeOptions() this.fetchNodeOptions()
if (this.authSearch) { if (this.authSearch) {
this.getDataList()
this.handleRouteQuery()
} }
this.$nextTick(() => { this.$nextTick(() => {
this.height = window.innerHeight / 2 - 30 this.height = window.innerHeight / 2 - 30
this.secondHeight = window.innerHeight / 2 - 186 this.secondHeight = window.innerHeight / 2 - 186
}) })
}, },
activated () {
this.handleRouteQuery()
},
methods: { methods: {
resolveRouteReferenceNo () {
const routeParams = this.$route.params || {}
const routeQuery = this.$route.query || {}
const referenceNo = routeParams.referenceNo || routeParams.labNo || routeParams.docNo || routeParams.documentNo ||
routeQuery.referenceNo || routeQuery.labNo || routeQuery.docNo || routeQuery.documentNo || ''
return String(referenceNo || '').trim()
},
handleRouteQuery () {
if (!this.authSearch) {
return
}
const routeParams = this.$route.params || {}
const isTokenLogin = routeParams.type === 'tokenLogin'
const referenceNo = this.resolveRouteReferenceNo()
if (isTokenLogin) {
if (!referenceNo) {
this.getDataList()
return
}
if (this.modalFlag && String(this.modalData.referenceNo || '').trim() === referenceNo) {
return
}
this.searchData.referenceNo = referenceNo
this.getDataList().then((rows) => {
const rowList = Array.isArray(rows) ? rows : (this.dataList || [])
if (!rowList.length) {
if (this.$refs.labTable) {
this.$refs.labTable.setCurrentRow()
}
return
}
this.$nextTick(() => {
if (this.$refs.labTable) {
this.$refs.labTable.setCurrentRow(rowList[0])
}
this.addOrUpdateHandle(rowList[0], true)
})
})
return
}
if (referenceNo) {
this.searchData.referenceNo = referenceNo
}
this.getDataList()
},
buildDefaultPropertyChooseData () { buildDefaultPropertyChooseData () {
const currentSite = this.modalData && this.modalData.site ? this.modalData.site : this.$store.state.user.site const currentSite = this.modalData && this.modalData.site ? this.modalData.site : this.$store.state.user.site
return { return {
@ -2153,7 +2201,7 @@ export default {
this.currentTestReportFileList = [] this.currentTestReportFileList = []
this.approvalList = [] this.approvalList = []
this.isFilterSearch = false this.isFilterSearch = false
return
return Promise.resolve([])
} }
this.dataListSelections = [] this.dataListSelections = []
this.dataListLoading = true this.dataListLoading = true
@ -2167,7 +2215,8 @@ export default {
currentApprover: this.searchData.currentApprover, currentApprover: this.searchData.currentApprover,
nodeId: this.searchData.nodeId nodeId: this.searchData.nodeId
} }
api.getLabList(params).then(({data}) => {
this.isFilterSearch = false
return api.getLabList(params).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
const list = data.page.list || [] const list = data.page.list || []
this.dataList = list.map(item => ({ this.dataList = list.map(item => ({
@ -2202,6 +2251,7 @@ export default {
this.approvalList = [] this.approvalList = []
} }
this.dataListLoading = false this.dataListLoading = false
return this.dataList
}).catch(() => { }).catch(() => {
this.dataListSelections = [] this.dataListSelections = []
this.currentRow = {} this.currentRow = {}
@ -2213,8 +2263,8 @@ export default {
this.currentTestReportFileList = [] this.currentTestReportFileList = []
this.approvalList = [] this.approvalList = []
this.dataListLoading = false this.dataListLoading = false
return []
}) })
this.isFilterSearch = false
}, },
sizeChangeHandle (val) { sizeChangeHandle (val) {
this.pageSize = val this.pageSize = val
@ -2372,12 +2422,12 @@ export default {
this.modalData[field] = value this.modalData[field] = value
} }
}, },
addOrUpdateHandle (row) {
if (!row && !this.authUpdate) {
addOrUpdateHandle (row, forceOpen = false) {
if (!forceOpen && !row && !this.authUpdate) {
this.$message.warning('没有新增权限') this.$message.warning('没有新增权限')
return return
} }
if (row && !this.authUpdate && !this.authDataEntry) {
if (!forceOpen && row && !this.authUpdate && !this.authDataEntry) {
this.$message.warning('没有编辑权限') this.$message.warning('没有编辑权限')
return return
} }

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

@ -2191,7 +2191,7 @@ export default {
mounted () { mounted () {
this.fetchNodeOptions() this.fetchNodeOptions()
if (this.authSearch) { if (this.authSearch) {
this.getDataList()
this.handleRouteQuery()
} }
this.$nextTick(() => { this.$nextTick(() => {
this.height = window.innerHeight / 2 - 30 this.height = window.innerHeight / 2 - 30
@ -2199,6 +2199,9 @@ export default {
this.secondHeight = window.innerHeight / 2 - 186 this.secondHeight = window.innerHeight / 2 - 186
}) })
}, },
activated () {
this.handleRouteQuery()
},
watch: { watch: {
activeName (val) { activeName (val) {
if (val === 'attachmentInfo' || val === 'npdInfo') { if (val === 'attachmentInfo' || val === 'npdInfo') {
@ -2229,6 +2232,51 @@ export default {
} }
}, },
methods: { methods: {
resolveRouteReferenceNo () {
const routeParams = this.$route.params || {}
const routeQuery = this.$route.query || {}
const referenceNo = routeParams.referenceNo || routeParams.rohsNo || routeParams.docNo || routeParams.documentNo ||
routeQuery.referenceNo || routeQuery.rohsNo || routeQuery.docNo || routeQuery.documentNo || ''
return String(referenceNo || '').trim()
},
handleRouteQuery () {
if (!this.authSearch) {
return
}
const routeParams = this.$route.params || {}
const isTokenLogin = routeParams.type === 'tokenLogin'
const referenceNo = this.resolveRouteReferenceNo()
if (isTokenLogin) {
if (!referenceNo) {
this.getDataList()
return
}
if (this.modalFlag && String(this.modalData.referenceNo || '').trim() === referenceNo) {
return
}
this.searchData.referenceNo = referenceNo
this.getDataList().then((rows) => {
const rowList = Array.isArray(rows) ? rows : (this.dataList || [])
if (!rowList.length) {
if (this.$refs.rohsTable) {
this.$refs.rohsTable.setCurrentRow()
}
return
}
this.$nextTick(() => {
if (this.$refs.rohsTable) {
this.$refs.rohsTable.setCurrentRow(rowList[0])
}
this.addOrUpdateHandle(rowList[0], true)
})
})
return
}
if (referenceNo) {
this.searchData.referenceNo = referenceNo
}
this.getDataList()
},
fetchNodeOptions () { fetchNodeOptions () {
if (!this.searchData.site || !this.menuId) { if (!this.searchData.site || !this.menuId) {
this.nodeOptions = [] this.nodeOptions = []
@ -3267,7 +3315,7 @@ export default {
this.currentRow = {} this.currentRow = {}
this.approvalList = [] this.approvalList = []
this.isFilterSearch = false this.isFilterSearch = false
return
return Promise.resolve([])
} }
this.dataListLoading = true this.dataListLoading = true
let params = { let params = {
@ -3283,7 +3331,8 @@ export default {
ifsPartNo: this.searchData.ifsPartNo, ifsPartNo: this.searchData.ifsPartNo,
materialDesc: this.searchData.materialDesc materialDesc: this.searchData.materialDesc
} }
api.getRohsList(params).then(({data}) => {
this.isFilterSearch = false
return api.getRohsList(params).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
const list = data.page.list || [] const list = data.page.list || []
this.dataList = list.map(item => { this.dataList = list.map(item => {
@ -3328,13 +3377,14 @@ export default {
this.approvalList = [] this.approvalList = []
} }
this.dataListLoading = false this.dataListLoading = false
return this.dataList
}).catch(() => { }).catch(() => {
this.dataListSelections = [] this.dataListSelections = []
this.currentRow = {} this.currentRow = {}
this.approvalList = [] this.approvalList = []
this.dataListLoading = false this.dataListLoading = false
return []
}) })
this.isFilterSearch = false
}, },
// //
sizeChangeHandle (val) { sizeChangeHandle (val) {
@ -3507,12 +3557,12 @@ export default {
} }
}, },
// / // /
addOrUpdateHandle (row) {
if (!row && !this.authUpdate) {
addOrUpdateHandle (row, forceOpen = false) {
if (!forceOpen && !row && !this.authUpdate) {
this.$message.warning('没有新增权限') this.$message.warning('没有新增权限')
return return
} }
if (row && !this.authUpdate && !this.authDataEntry) {
if (!forceOpen && row && !this.authUpdate && !this.authDataEntry) {
this.$message.warning('没有编辑权限') this.$message.warning('没有编辑权限')
return return
} }

Loading…
Cancel
Save