处理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>
<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-tabs">
<div
@ -44,6 +44,12 @@
</a-spin>
</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>
</template>
@ -173,7 +179,9 @@ export default {
getNewVal_addInfo(val) {
this.addInfo = val
},
handleCancel() {
this.visible = false
},
handleOk() {
let params = {
laboratory: this.newDetail.laboratory || '',

View File

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