处理RLR弹窗点击下载关闭的问题

This commit is contained in:
任珮宇 2023-09-13 19:43:08 +08:00
parent a289c1de9c
commit e1c30fd326
2 changed files with 91 additions and 78 deletions

View File

@ -1,5 +1,5 @@
<template> <template>
<custom-modal v-model="visible" :width="1280" title="NG Lab Report" :destroyOnClose="true" :okHandler="handleOk"> <custom-modal v-model="visible" :width="1280" title="NG Lab Report" :destroyOnClose="true" @cancel="handleCancel">
<div class="rlr"> <div class="rlr">
<div class="rlr-tabs"> <div class="rlr-tabs">
<div <div
@ -44,6 +44,12 @@
</a-spin> </a-spin>
</div> </div>
</div> </div>
<div slot="custom-footer" style="text-align: center">
<a-space :size="20">
<a-button type="primary" @click="handleOk">Save</a-button>
<a-button @click="handleCancel">Cancel</a-button>
</a-space>
</div>
</custom-modal> </custom-modal>
</template> </template>
@ -173,7 +179,9 @@ export default {
getNewVal_addInfo(val) { getNewVal_addInfo(val) {
this.addInfo = val this.addInfo = val
}, },
handleCancel() {
this.visible = false
},
handleOk() { handleOk() {
let params = { let params = {
laboratory: this.newDetail.laboratory || '', laboratory: this.newDetail.laboratory || '',

View File

@ -1,5 +1,11 @@
<template> <template>
<custom-modal v-model="visible" :width="1280" title="Mini Radionuclide Laboratory Reports" :destroyOnClose="true" @cancel="handleCancel"> <custom-modal
v-model="visible"
:width="1280"
title="Mini Radionuclide Laboratory Reports"
:destroyOnClose="true"
@cancel="handleCancel"
>
<a-spin :spinning="isLoading"> <a-spin :spinning="isLoading">
<div class="rlr"> <div class="rlr">
<div class="rlr-tabs"> <div class="rlr-tabs">
@ -35,7 +41,7 @@
<peaks-method :allData="allInfo" @valChange="getNewVal_peakMethod" /> <peaks-method :allData="allInfo" @valChange="getNewVal_peakMethod" />
</template> </template>
<template v-if="activeKey == 6"> <template v-if="activeKey == 6">
<peak-fit :tableData="allInfo.peakFit" @valChange="getNewVal_peakFit"/> <peak-fit :tableData="allInfo.peakFit" @valChange="getNewVal_peakFit" />
</template> </template>
<template v-if="activeKey == 7"> <template v-if="activeKey == 7">
<g-analysis-methods :allData="allInfo" @valChange="getNewVal_analyMethod" /> <g-analysis-methods :allData="allInfo" @valChange="getNewVal_analyMethod" />
@ -56,7 +62,7 @@
<g-coincidence-correction @valChange="getNewVal_nuclide" /> <g-coincidence-correction @valChange="getNewVal_nuclide" />
</template> </template>
<template v-if="activeKey == 13"> <template v-if="activeKey == 13">
<mda @valChange="getNewVal_mda"/> <mda @valChange="getNewVal_mda" />
</template> </template>
<template v-if="activeKey == 14"> <template v-if="activeKey == 14">
<conclusions :allData="allInfo" @valChange="getNewVal_conclusion" /> <conclusions :allData="allInfo" @valChange="getNewVal_conclusion" />
@ -68,7 +74,7 @@
</div> </div>
</div> </div>
</a-spin> </a-spin>
<div slot="custom-footer" style="text-align: center;"> <div slot="custom-footer" style="text-align: center">
<a-space :size="20"> <a-space :size="20">
<a-button type="primary" @click="handleSave">Save</a-button> <a-button type="primary" @click="handleSave">Save</a-button>
<a-button @click="handleCancel">Cancel</a-button> <a-button @click="handleCancel">Cancel</a-button>
@ -115,7 +121,7 @@ const tabs = [
'g_CoincidenceCorrection', 'g_CoincidenceCorrection',
'MDA', 'MDA',
'Conclusions', 'Conclusions',
'Comment' 'Comment',
] ]
export default { export default {
@ -137,7 +143,7 @@ export default {
Mda, Mda,
Conclusions, Conclusions,
Comment, Comment,
Custom Custom,
}, },
data() { data() {
this.tabs = tabs this.tabs = tabs
@ -162,11 +168,11 @@ export default {
mdaList: [], mdaList: [],
conclusionVal: {}, conclusionVal: {},
commentVal: {}, commentVal: {},
fileName: '' fileName: '',
} }
}, },
mounted () { mounted() {
sessionStorage.removeItem("isCellEmpty") sessionStorage.removeItem('isCellEmpty')
}, },
methods: { methods: {
getNewVal_header(val) { getNewVal_header(val) {
@ -221,119 +227,118 @@ export default {
this.commentVal = val this.commentVal = val
}, },
handleSave() { handleSave() {
let val = sessionStorage.getItem("isCellEmpty") let val = sessionStorage.getItem('isCellEmpty')
if (!val||val=="false") { if (!val || val == 'false') {
this.visible = false
// //
let params = { let params = {
header_msg_id:this.healderVal.msgId||this.allInfo.header_msg_id, header_msg_id: this.healderVal.msgId || this.allInfo.header_msg_id,
header_data_type:this.healderVal.dataType||this.allInfo.header_data_type, header_data_type: this.healderVal.dataType || this.allInfo.header_data_type,
header_priority_level:this.healderVal.priorityLevel||this.allInfo.header_priority_level, header_priority_level: this.healderVal.priorityLevel || this.allInfo.header_priority_level,
header_station_code:this.healderVal.stationCode||this.allInfo.header_station_code, header_station_code: this.healderVal.stationCode || this.allInfo.header_station_code,
header_srid:this.healderVal.srid||this.allInfo.header_srid, header_srid: this.healderVal.srid || this.allInfo.header_srid,
header_lab_code:this.healderVal.labCode||this.allInfo.header_lab_code, header_lab_code: this.healderVal.labCode || this.allInfo.header_lab_code,
header_lab_detector:this.healderVal.labDetector||this.allInfo.header_lab_detector, header_lab_detector: this.healderVal.labDetector || this.allInfo.header_lab_detector,
header_report_type:this.healderVal.reportType||this.allInfo.header_report_type, header_report_type: this.healderVal.reportType || this.allInfo.header_report_type,
header_report_number:this.healderVal.reportnumber||this.allInfo.header_report_number, header_report_number: this.healderVal.reportnumber || this.allInfo.header_report_number,
header_sample_category:this.healderVal.sampleCategory||this.allInfo.header_sample_category, header_sample_category: this.healderVal.sampleCategory || this.allInfo.header_sample_category,
header_transmission: this.healderVal.transmission||this.allInfo.header_transmission, header_transmission: this.healderVal.transmission || this.allInfo.header_transmission,
Obj_purpose: this.objVal.objPurpose||this.allInfo.Obj_purpose, Obj_purpose: this.objVal.objPurpose || this.allInfo.Obj_purpose,
Obj_authorized: this.objVal.objAuthorized||this.allInfo.Obj_authorized, Obj_authorized: this.objVal.objAuthorized || this.allInfo.Obj_authorized,
Obj_instruction: this.objVal.objInstruction||this.allInfo.Obj_instruction, Obj_instruction: this.objVal.objInstruction || this.allInfo.Obj_instruction,
collect_start: this.collectVal.collectStart||this.allInfo.collect_start, collect_start: this.collectVal.collectStart || this.allInfo.collect_start,
collect_stop: this.collectVal.collectStop||this.allInfo.collect_stop, collect_stop: this.collectVal.collectStop || this.allInfo.collect_stop,
collect_airVolume: this.collectVal.collectAirVolume||this.allInfo.collect_airVolume, collect_airVolume: this.collectVal.collectAirVolume || this.allInfo.collect_airVolume,
Receipt_srid: this.receiptVal.receiptSrid||this.allInfo.Receipt_srid, Receipt_srid: this.receiptVal.receiptSrid || this.allInfo.Receipt_srid,
Receipt_sealNum: this.receiptVal.receiptSealNum||this.allInfo.Receipt_sealNum, Receipt_sealNum: this.receiptVal.receiptSealNum || this.allInfo.Receipt_sealNum,
Receipt_sample_dateTime: this.receiptVal.receiptDateTime||this.allInfo.Receipt_sample_dateTime, Receipt_sample_dateTime: this.receiptVal.receiptDateTime || this.allInfo.Receipt_sample_dateTime,
Receipt_package: this.receiptVal.receiptPackage||this.allInfo.Receipt_package, Receipt_package: this.receiptVal.receiptPackage || this.allInfo.Receipt_package,
Receipt_seal: this.receiptVal.receiptSeal||this.allInfo.Receipt_seal, Receipt_seal: this.receiptVal.receiptSeal || this.allInfo.Receipt_seal,
Receipt_sample: this.receiptVal.receiptSample||this.allInfo.Receipt_sample, Receipt_sample: this.receiptVal.receiptSample || this.allInfo.Receipt_sample,
Test_type: this.testVal.testType||this.allInfo.Test_type, Test_type: this.testVal.testType || this.allInfo.Test_type,
Test_completion: this.testVal.testCompletion||this.allInfo.Test_completion, Test_completion: this.testVal.testCompletion || this.allInfo.Test_completion,
Test_person: this.testVal.testPerson||this.allInfo.Test_person, Test_person: this.testVal.testPerson || this.allInfo.Test_person,
Test_purpose: this.testVal.testPurpose||this.allInfo.Test_purpose, Test_purpose: this.testVal.testPurpose || this.allInfo.Test_purpose,
PeakMethod_software: this.peakMethodVal.peakMethodSoftware||this.allInfo.PeakMethod_software, PeakMethod_software: this.peakMethodVal.peakMethodSoftware || this.allInfo.PeakMethod_software,
PeakMethod_location: this.peakMethodVal.peakMethodLocation||this.allInfo.PeakMethod_location, PeakMethod_location: this.peakMethodVal.peakMethodLocation || this.allInfo.PeakMethod_location,
peakFit: this.peakList.length>0?this.peakList:this.allInfo.peakFit, peakFit: this.peakList.length > 0 ? this.peakList : this.allInfo.peakFit,
AnalyMethod_software: this.analyMethodVal.analyMethodSoftware||this.allInfo.AnalyMethod_software, AnalyMethod_software: this.analyMethodVal.analyMethodSoftware || this.allInfo.AnalyMethod_software,
AnalyMethod_nuclide: this.analyMethodVal.analyMethodNuclide||this.allInfo.AnalyMethod_nuclide, AnalyMethod_nuclide: this.analyMethodVal.analyMethodNuclide || this.allInfo.AnalyMethod_nuclide,
AnalyMethod_baseline: this.analyMethodVal.analyMethodBaseline||this.allInfo.AnalyMethod_baseline, AnalyMethod_baseline: this.analyMethodVal.analyMethodBaseline || this.allInfo.AnalyMethod_baseline,
AnalyMethod_lc: this.analyMethodVal.analyMethodLc||this.allInfo.AnalyMethod_lc, AnalyMethod_lc: this.analyMethodVal.analyMethodLc || this.allInfo.AnalyMethod_lc,
AnalyMethod_calib: this.analyMethodVal.analyMethodCalib||this.allInfo.AnalyMethod_calib, AnalyMethod_calib: this.analyMethodVal.analyMethodCalib || this.allInfo.AnalyMethod_calib,
Association: this.associationVal.length>0?this.associationVal:this.allInfo.Association, Association: this.associationVal.length > 0 ? this.associationVal : this.allInfo.Association,
Reference_samplePHD: this.referenceVal.referenceSamplePHD||this.allInfo.Reference_samplePHD, Reference_samplePHD: this.referenceVal.referenceSamplePHD || this.allInfo.Reference_samplePHD,
Reference_CalibPHD: this.referenceVal.referenceCalibPHD||this.allInfo.Reference_CalibPHD, Reference_CalibPHD: this.referenceVal.referenceCalibPHD || this.allInfo.Reference_CalibPHD,
Reference_physical: this.referenceVal.referencePhysical||this.allInfo.Reference_physical, Reference_physical: this.referenceVal.referencePhysical || this.allInfo.Reference_physical,
Result_act_ref: this.resultVal.activityReferenceTime||this.allInfo.Result_act_ref, Result_act_ref: this.resultVal.activityReferenceTime || this.allInfo.Result_act_ref,
Result_conc_ref: this.resultVal.Concentration||this.allInfo.Result_conc_ref, Result_conc_ref: this.resultVal.Concentration || this.allInfo.Result_conc_ref,
Result: this.resultList.length>0?this.resultList:this.allInfo.Result, Result: this.resultList.length > 0 ? this.resultList : this.allInfo.Result,
NuclideRatios: this.nuclideList, NuclideRatios: this.nuclideList,
g_CoincidenceCorrection: this.coincidenceList, g_CoincidenceCorrection: this.coincidenceList,
mda: this.mdaList, mda: this.mdaList,
conclusion_person: this.conclusionVal.conclusionPerson||this.allInfo.conclusion_person, conclusion_person: this.conclusionVal.conclusionPerson || this.allInfo.conclusion_person,
Conclusion_IDC: this.conclusionVal.conclusionIDC||this.allInfo.Conclusion_IDC, Conclusion_IDC: this.conclusionVal.conclusionIDC || this.allInfo.Conclusion_IDC,
Conclusion_Lab: this.conclusionVal.conclusionLab||this.allInfo.Conclusion_Lab, Conclusion_Lab: this.conclusionVal.conclusionLab || this.allInfo.Conclusion_Lab,
Conclusion_Res: this.conclusionVal.conclusionRes||this.allInfo.Conclusion_Res, Conclusion_Res: this.conclusionVal.conclusionRes || this.allInfo.Conclusion_Res,
Comment: this.commentVal.comment||this.allInfo.Comment, Comment: this.commentVal.comment || this.allInfo.Comment,
} }
postAction("/gamma/exportRLR", params).then(res => { postAction('/gamma/exportRLR', params).then((res) => {
const blob = new Blob([res]) const blob = new Blob([res])
let _this = this let _this = this
this.$confirm({ this.$confirm({
title: 'Please enter file name', title: 'Please enter file name',
content: h => <a-input v-model={_this.fileName} />, content: (h) => <a-input v-model={_this.fileName} />,
okText: 'Cancle', okText: 'Cancle',
cancelText: 'Save', cancelText: 'Save',
okButtonProps: {style: {backgroundColor: "#b98326", color: "#fff", borderColor: "transparent"}}, okButtonProps: { style: { backgroundColor: '#b98326', color: '#fff', borderColor: 'transparent' } },
cancelButtonProps: {style: {color: "#fff", backgroundColor: "#31aab0", borderColor: "transparent"}}, cancelButtonProps: { style: { color: '#fff', backgroundColor: '#31aab0', borderColor: 'transparent' } },
onOk() { onOk() {
console.log('Cancel'); console.log('Cancel')
}, },
onCancel() { onCancel() {
if (_this.fileName) { if (_this.fileName) {
saveAs(blob, `${_this.fileName}.RLR`) saveAs(blob, `${_this.fileName}.RLR`)
} }
}, },
}); })
}) })
} else { } else {
this.$message.warning("Please finishi ti edit new inserted row first.") this.$message.warning('Please finishi ti edit new inserted row first.')
} }
}, },
handleCancel() { handleCancel() {
this.visible = false this.visible = false
sessionStorage.removeItem("isCellEmpty") sessionStorage.removeItem('isCellEmpty')
}, },
handleChangeView(index) { handleChangeView(index) {
let val = sessionStorage.getItem("isCellEmpty") let val = sessionStorage.getItem('isCellEmpty')
if (val=="false"||!val) { if (val == 'false' || !val) {
this.activeKey = index this.activeKey = index
} else { } else {
this.$message.warning("Please finishi ti edit new inserted row first.") this.$message.warning('Please finishi ti edit new inserted row first.')
} }
}, },
beforeModalOpen() { beforeModalOpen() {
this.activeKey = 0 this.activeKey = 0
this.getGammaViewRLR(); this.getGammaViewRLR()
}, },
getGammaViewRLR() { getGammaViewRLR() {
this.isLoading = true this.isLoading = true
const { sampleId, inputFileName: fileName } = this.sampleData const { sampleId, inputFileName: fileName } = this.sampleData
let params = { let params = {
sampleId, sampleId,
fileName fileName,
} }
getAction("/gamma/viewRLR", params).then(res => { getAction('/gamma/viewRLR', params).then((res) => {
this.isLoading = false this.isLoading = false
if (res.success) { if (res.success) {
this.allInfo = res.result this.allInfo = res.result
} else { } else {
this.$message.warning("This operation fails. Contact your system administrator") this.$message.warning('This operation fails. Contact your system administrator')
} }
}) })
}, },
} },
} }
</script> </script>
@ -375,7 +380,7 @@ export default {
} }
} }
} }
/deep/.ant-modal-title{ /deep/.ant-modal-title {
letter-spacing: 1px; letter-spacing: 1px;
} }
</style> </style>