处理打开beta RLR 弹窗直接点击save字段无数据的问题

This commit is contained in:
任珮宇 2023-09-14 11:41:34 +08:00
parent e1c30fd326
commit 56e1c9130e
6 changed files with 180 additions and 47 deletions

View File

@ -7,7 +7,7 @@
<component
:is="column.type"
v-bind="column.attrs"
v-model="detail[column.dataIndex]"
v-model="currData[column.dataIndex]"
:disabled="column.disabled"
v-on="column.on"
/>
@ -18,6 +18,7 @@
</template>
<script>
import { cloneDeep } from 'lodash'
export default {
computed: {
columns() {
@ -142,13 +143,24 @@ export default {
type: Object,
},
},
watch: {
detail: {
handler(val, old) {
this.currData = cloneDeep(val)
},
immediate: true,
deep: true,
},
},
data() {
return {}
return {
currData: {},
}
},
methods: {
handleValChange(val) {
console.log('valval', val)
this.$emit('valChange', this.detail)
this.$emit('valChange', this.currData)
},
},
}

View File

@ -1,6 +1,6 @@
<template>
<div class="general-infomation">
<a-textarea :rows="14" v-model="detail.text"></a-textarea>
<a-textarea :rows="14" v-model="currData.text"></a-textarea>
<div class="form">
<a-row v-for="(column, index) in columns" :key="index">
<a-col class="label" :span="10"> {{ column.label }} </a-col>
@ -8,7 +8,7 @@
<component
:is="column.type"
v-bind="column.attrs"
v-model="detail[column.dataIndex]"
v-model="currData[column.dataIndex]"
:disabled="column.disabled"
v-on="column.on"
/>
@ -19,6 +19,8 @@
</template>
<script>
import { cloneDeep } from 'lodash'
import dateFormat from '@/components/jeecg/JEasyCron/format-date'
export default {
computed: {
columns() {
@ -139,13 +141,29 @@ export default {
type: Object,
},
},
watch: {
detail: {
handler(val, old) {
this.currData = cloneDeep(val)
this.currData.laboratory = 'CNL06'
this.currData.receiptDate = dateFormat(new Date(), 'yyyy-MM-dd')
this.currData.receiptTime = dateFormat(new Date(), 'hh:mm:ss')
this.currData.reportTransmissionDate = dateFormat(new Date(), 'yyyy-MM-dd')
this.currData.reportTransmissionTime = dateFormat(new Date(), 'hh:mm:ss')
this.$emit('valChange', this.currData)
},
immediate: true,
deep: true,
},
},
data() {
return {}
return {
currData: {},
}
},
methods: {
handleValChange(val) {
console.log('valval', val)
this.$emit('valChange', this.detail)
this.$emit('valChange', this.currData)
},
},
}

View File

@ -16,6 +16,11 @@
<script>
export default {
props: {
detail: {
type: Object,
},
},
data() {
return {
methodsInfo: {
@ -25,9 +30,14 @@ export default {
},
}
},
mounted() {
this.methodsInfo.samplingHandling = this.detail.samplingHandling
this.methodsInfo.equipmentUsed = this.detail.equipmentUsed
this.methodsInfo.softwareUsed = this.detail.softwareUsed
},
methods: {
handleValueChange() {
this.$emit('valChange', this.transInfo)
this.$emit('valChange', this.methodsInfo)
},
},
}

View File

@ -1,13 +1,13 @@
<template>
<div>
<a-table :columns="columns" :dataSource="list" :pagination="false">
<template v-for="slotName in slots" :slot="slotName" slot-scope="text, record">
<a-table :columns="columns" :dataSource="rationsList" :pagination="false">
<!-- <template v-for="slotName in slots" :slot="slotName" slot-scope="text, record">
<a-input
v-model="record[slotName]"
:key="slotName"
@change="(e) => cellChange(e.target.value, record, slotName)"
></a-input>
</template>
</template> -->
</a-table>
</div>
</template>
@ -28,57 +28,63 @@ const columns = [
dataIndex: 'nuclide1',
align: 'center',
width: 100,
scopedSlots: {
customRender: 'nuclide1',
},
// scopedSlots: {
// customRender: 'nuclide1',
// },
},
{
title: 'Nuclide2',
dataIndex: 'nuclide2',
align: 'center',
width: 150,
scopedSlots: {
customRender: 'nuclide2',
},
// scopedSlots: {
// customRender: 'nuclide2',
// },
},
{
title: 'Isotope ratio',
dataIndex: 'isotopeRatio',
align: 'center',
width: 100,
scopedSlots: {
customRender: 'isotopeRatio',
},
// scopedSlots: {
// customRender: 'isotopeRatio',
// },
},
{
title: 'Uncert.Ratio [%]',
dataIndex: 'uncertRatio',
align: 'center',
width: 200,
scopedSlots: {
customRender: 'uncertRatio',
},
// scopedSlots: {
// customRender: 'uncertRatio',
// },
},
]
export default {
props: {
rationsList: {
type: Object,
},
},
data() {
this.columns = columns
return {
list: [],
}
},
computed: {
slots() {
return columns.filter((item) => item.scopedSlots).map((item) => item.scopedSlots.customRender)
},
},
methods: {
cellChange(val, record, key) {
record[key] = val
this.$emit('valChange', this.list)
},
return {}
},
// mounted() {
// this.$emit('valChange', this.list)
// },
// computed: {
// slots() {
// return columns.filter((item) => item.scopedSlots).map((item) => item.scopedSlots.customRender)
// },
// },
// methods: {
// cellChange(val, record, key) {
// record[key] = val
// this.$emit('valChange', this.list)
// },
// },
}
</script>

View File

@ -21,6 +21,11 @@
<script>
export default {
props: {
detail: {
type: Object,
},
},
data() {
return {
transInfo: {
@ -29,6 +34,10 @@ export default {
},
}
},
mounted() {
this.transInfo.comments = this.detail.comments
this.transInfo.otherComments = this.detail.otherComments
},
methods: {
handleValueChange() {
this.$emit('valChange', this.transInfo)

View File

@ -29,7 +29,7 @@
<nuclides :detail="detail" @valChange="getNewVal_nuclidesList" />
</template>
<template v-if="activeKey == 4">
<ratios :detail="detail" @valChange="getNewVal_rationsList" />
<ratios :rationsList="rationsList" @valChange="getNewVal_rationsList" />
</template>
<template v-if="activeKey == 5">
<methods :detail="detail" @valChange="getNewVal_methodsInfo" />
@ -65,8 +65,33 @@ import AdditionalInfo from './components/AdditionalInfo.vue'
import Notes from './components/Notes.vue'
import { getAction, postFileAction } from '@/api/manage'
import { saveAs } from 'file-saver'
import dateFormat from '@/components/jeecg/JEasyCron/format-date'
import { TagsInputCell } from '@/components/jeecg/JVxeTable/components/cells/JVxeTagsCell'
const nameMapper = [
{ name: 'Xe-131m', mapTo: 'xe131m' },
{ name: 'Xe-133m', mapTo: 'xe133m' },
{ name: 'Xe-133', mapTo: 'xe133' },
{ name: 'Xe-135', mapTo: 'xe135' },
]
const columnNameMapper = [
{
name: 'concentration',
mapTo: 'conc',
},
{
name: 'uncertConcentration',
mapTo: 'uncert_conc',
},
{
name: 'mdc',
mapTo: 'MDC',
},
{
name: 'lc',
mapTo: 'LC',
},
]
const tabs = [
'General Infomation',
'Transport Infomation',
@ -105,8 +130,39 @@ export default {
transInfo: {},
methodsInfo: {},
addInfo: {},
nuclidesList: [],
rationsList: [],
nuclidesList: null,
rationsList: [
{
nuclide1: 'Xe-131m',
nuclide2: 'Xe-133',
isotopeRatio: '',
uncertRatio: '10.0',
},
{
nuclide1: 'Xe-133m',
nuclide2: 'Xe-133',
isotopeRatio: '',
uncertRatio: '10.0',
},
{
nuclide1: 'Xe-133m',
nuclide2: 'Xe-131m',
isotopeRatio: '',
uncertRatio: '10.0',
},
{
nuclide1: 'Xe-135',
nuclide2: 'Xe-133',
isotopeRatio: '',
uncertRatio: '10.0',
},
{
nuclide1: 'Xe-135',
nuclide2: 'Xe-131m',
isotopeRatio: '',
uncertRatio: '10.0',
},
],
fileName: '',
text:
'- All dates and times shall be given in UTC \n' +
@ -150,6 +206,15 @@ export default {
if (success) {
this.detail = result
this.detail.text = this.text
this.detail.comments = ''
this.detail.otherComments = 'good.'
this.detail.stableXeMeasStartDate = dateFormat(new Date(), 'yyyy-MM-dd')
this.detail.stableXeMeasStartTime = dateFormat(new Date(), 'hh:mm:ss')
this.detail.nuclidesList = this.getList()
this.detail.samplingHandling = 'Sample was transfered by a transfer setup from archive bottle to cell.'
this.detail.equipmentUsed = 'transfer setup, GC(Agilent6890) and HPGe detector.'
this.detail.softwareUsed = 'Gammavision'
console.log(this.detail)
this.isLoading = false
} else {
this.$message.error(message)
@ -182,6 +247,19 @@ export default {
handleCancel() {
this.visible = false
},
getList() {
return nameMapper.map((item) => {
const obj = { name: item.name }
columnNameMapper.forEach((it) => {
const key = `${item.mapTo}_${it.mapTo}`
obj[it.name] = this.detail[key]
obj.activity = ''
obj.uncertActivity = ''
obj.mda = ''
})
return obj
})
},
handleOk() {
let params = {
laboratory: this.newDetail.laboratory || '',
@ -194,8 +272,8 @@ export default {
receiptTime: this.newDetail.receiptTime || '',
reportTransmissionDate: this.newDetail.reportTransmissionDate || '',
reportTransmissionTime: this.newDetail.reportTransmissionTime || '',
comments: this.transInfo.comments || '',
otherComments: this.transInfo.otherComments || '',
comments: this.transInfo.comments || this.detail.comments,
otherComments: this.transInfo.otherComments || this.detail.otherComments,
pressureInTheArchiveBottle: this.newDetail.pressureInTheArchiveBottle || '',
volumeOfArchiveBottle: this.newDetail.volumeOfArchiveBottle || '',
gasComposition: this.newDetail.gasComposition || '',
@ -208,11 +286,11 @@ export default {
acq_start_date: this.newDetail.acq_start_date || this.detail.acq_start_date,
acq_start_time: this.newDetail.acq_start_time || this.detail.acq_start_time,
acq_live_time: this.newDetail.acq_live_time || this.detail.acq_live_time,
nuclides: this.nuclidesList,
nuclides: this.nuclidesList || this.detail.nuclidesList,
rations: this.rationsList,
samplingHandling: this.methodsInfo.samplingHandling || '',
equipmentUsed: this.methodsInfo.equipmentUsed || '',
softwareUsed: this.methodsInfo.softwareUsed || '',
samplingHandling: this.methodsInfo.samplingHandling || this.detail.samplingHandling,
equipmentUsed: this.methodsInfo.equipmentUsed || this.detail.equipmentUsed,
softwareUsed: this.methodsInfo.softwareUsed || this.detail.softwareUsed,
xeTransfer: this.addInfo.xeTransfer || '',
uncertaintyOfXe: this.addInfo.uncertaintyOfXe || '',
commentsInfo: this.addInfo.commentsInfo || '',