|
|
|
@ -1059,14 +1059,62 @@ export default { |
|
|
|
mounted () { |
|
|
|
this.fetchNodeOptions() |
|
|
|
if (this.authSearch) { |
|
|
|
this.getDataList() |
|
|
|
this.handleRouteQuery() |
|
|
|
} |
|
|
|
this.$nextTick(() => { |
|
|
|
this.height = window.innerHeight / 2 - 30 |
|
|
|
this.secondHeight = window.innerHeight / 2 - 186 |
|
|
|
}) |
|
|
|
}, |
|
|
|
activated () { |
|
|
|
this.handleRouteQuery() |
|
|
|
}, |
|
|
|
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 () { |
|
|
|
const currentSite = this.modalData && this.modalData.site ? this.modalData.site : this.$store.state.user.site |
|
|
|
return { |
|
|
|
@ -2153,7 +2201,7 @@ export default { |
|
|
|
this.currentTestReportFileList = [] |
|
|
|
this.approvalList = [] |
|
|
|
this.isFilterSearch = false |
|
|
|
return |
|
|
|
return Promise.resolve([]) |
|
|
|
} |
|
|
|
this.dataListSelections = [] |
|
|
|
this.dataListLoading = true |
|
|
|
@ -2167,7 +2215,8 @@ export default { |
|
|
|
currentApprover: this.searchData.currentApprover, |
|
|
|
nodeId: this.searchData.nodeId |
|
|
|
} |
|
|
|
api.getLabList(params).then(({data}) => { |
|
|
|
this.isFilterSearch = false |
|
|
|
return api.getLabList(params).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
const list = data.page.list || [] |
|
|
|
this.dataList = list.map(item => ({ |
|
|
|
@ -2202,6 +2251,7 @@ export default { |
|
|
|
this.approvalList = [] |
|
|
|
} |
|
|
|
this.dataListLoading = false |
|
|
|
return this.dataList |
|
|
|
}).catch(() => { |
|
|
|
this.dataListSelections = [] |
|
|
|
this.currentRow = {} |
|
|
|
@ -2213,8 +2263,8 @@ export default { |
|
|
|
this.currentTestReportFileList = [] |
|
|
|
this.approvalList = [] |
|
|
|
this.dataListLoading = false |
|
|
|
return [] |
|
|
|
}) |
|
|
|
this.isFilterSearch = false |
|
|
|
}, |
|
|
|
sizeChangeHandle (val) { |
|
|
|
this.pageSize = val |
|
|
|
@ -2372,12 +2422,12 @@ export default { |
|
|
|
this.modalData[field] = value |
|
|
|
} |
|
|
|
}, |
|
|
|
addOrUpdateHandle (row) { |
|
|
|
if (!row && !this.authUpdate) { |
|
|
|
addOrUpdateHandle (row, forceOpen = false) { |
|
|
|
if (!forceOpen && !row && !this.authUpdate) { |
|
|
|
this.$message.warning('没有新增权限') |
|
|
|
return |
|
|
|
} |
|
|
|
if (row && !this.authUpdate && !this.authDataEntry) { |
|
|
|
if (!forceOpen && row && !this.authUpdate && !this.authDataEntry) { |
|
|
|
this.$message.warning('没有编辑权限') |
|
|
|
return |
|
|
|
} |
|
|
|
|