处理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">
@ -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,9 +227,8 @@ 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,
@ -277,63 +282,63 @@ export default {
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>