diff --git a/src/views/modules/lab/labRecord.vue b/src/views/modules/lab/labRecord.vue index 5c837cd..78f62b0 100644 --- a/src/views/modules/lab/labRecord.vue +++ b/src/views/modules/lab/labRecord.vue @@ -210,7 +210,7 @@ - + 内部报告 @@ -858,7 +858,7 @@ export default { height: 400, secondHeight: 200, currentRow: {}, - currentDetail: this.buildDefaultModalData(), + currentDetail: this.buildEmptyDetailData(), currentDetailLoading: false, currentDetailRequestId: 0, nodeOptions: [], @@ -1014,9 +1014,9 @@ export default { } }) }, - buildDefaultModalData () { + buildDefaultModalData (useLoginSite = true) { return { - site: this.$store.state.user.site, + site: useLoginSite ? this.$store.state.user.site : '', referenceNo: '', applicant: '', applicantName: '', @@ -1062,6 +1062,9 @@ export default { propertyItemList: [] } }, + buildEmptyDetailData () { + return this.buildDefaultModalData(false) + }, fetchNodeOptions () { if (!this.menuId) { this.nodeOptions = [] @@ -1777,7 +1780,7 @@ export default { if (!nextSite || !nextReferenceNo) { this.currentDetailRequestId += 1 this.currentDetailLoading = false - this.currentDetail = this.buildDefaultModalData() + this.currentDetail = this.buildEmptyDetailData() this.currentJudgeCriteriaFileList = [] this.currentTestSpecFileList = [] this.currentTestReportFileList = [] @@ -1793,7 +1796,7 @@ export default { if (!row || !row.site || !row.referenceNo) { this.currentDetailRequestId += 1 this.currentDetailLoading = false - this.currentDetail = this.buildDefaultModalData() + this.currentDetail = this.buildEmptyDetailData() this.currentJudgeCriteriaFileList = [] this.currentTestSpecFileList = [] this.currentTestReportFileList = [] @@ -1813,7 +1816,7 @@ export default { if (data && data.code === 0) { const detail = data.data || {} const mergedDetail = { - ...this.buildDefaultModalData(), + ...this.buildEmptyDetailData(), ...row, ...detail } @@ -1823,7 +1826,7 @@ export default { this.currentDetail = mergedDetail } else { const fallbackDetail = { - ...this.buildDefaultModalData(), + ...this.buildEmptyDetailData(), ...row } this.fillDisplayFields(fallbackDetail, row || {}) @@ -1834,7 +1837,7 @@ export default { return } const fallbackDetail = { - ...this.buildDefaultModalData(), + ...this.buildEmptyDetailData(), ...row } this.fillDisplayFields(fallbackDetail, row || {}) @@ -1880,7 +1883,7 @@ export default { this.totalPage = 0 this.currentRow = {} this.currentDetailRequestId += 1 - this.currentDetail = this.buildDefaultModalData() + this.currentDetail = this.buildEmptyDetailData() this.currentDetailLoading = false this.currentJudgeCriteriaFileList = [] this.currentTestSpecFileList = [] @@ -1927,7 +1930,7 @@ export default { this.totalPage = 0 this.currentRow = {} this.currentDetailRequestId += 1 - this.currentDetail = this.buildDefaultModalData() + this.currentDetail = this.buildEmptyDetailData() this.currentDetailLoading = false this.currentJudgeCriteriaFileList = [] this.currentTestSpecFileList = [] @@ -1939,7 +1942,7 @@ export default { this.dataListSelections = [] this.currentRow = {} this.currentDetailRequestId += 1 - this.currentDetail = this.buildDefaultModalData() + this.currentDetail = this.buildEmptyDetailData() this.currentDetailLoading = false this.currentJudgeCriteriaFileList = [] this.currentTestSpecFileList = []