fix: 修改arr和rrr页面,修改探测器表单

This commit is contained in:
orgin 2024-01-11 17:13:03 +08:00
parent 3add369ae1
commit 183c1e9683
3 changed files with 204 additions and 55 deletions

View File

@ -72,6 +72,16 @@ const columns = [
align: 'left',
dataIndex: 'sampleId',
},
{
title: 'Qualifie',
align: 'left',
dataIndex: 'spectralQualifie',
},
{
title: 'Analyst',
align: 'left',
dataIndex: 'analyst',
}
]
import { compareDate } from '../../commom'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
@ -210,6 +220,9 @@ export default {
this.queryParam.stationIds = []
}
},
handleQualifieChange(val){
this.queryParam.qualifie = val
},
getBeforeDate(n) {
var n = n
var d = new Date()
@ -238,7 +251,7 @@ export default {
computed: {
formItems() {
return [
{
/*{
type: 'a-input',
label: '',
name: 'search',
@ -251,7 +264,7 @@ export default {
style: {
width: 'auto',
},
},
},*/
{
type: 'custom-all-select',
label: 'Stations',
@ -307,6 +320,25 @@ export default {
width: 'auto',
},
},
{
type: 'a-select',
label: 'Qualifie',
name: 'qualifie',
props: {
allowClear: true,
placeholder: 'Select qualifie',
options: [{label: 'FULL', value: "FULL"}, {label: 'PREL', value: "PREL"}],
style: {
width: '200px',
},
},
on: {
change: this.handleQualifieChange,
},
style: {
width: 'auto',
},
}
]
},
},

View File

@ -72,6 +72,16 @@ const columns = [
align: 'left',
dataIndex: 'sampleId',
},
{
title: 'Qualifie',
align: 'left',
dataIndex: 'spectralQualifie',
},
{
title: 'Analyst',
align: 'left',
dataIndex: 'analyst',
}
]
import { compareDate } from '../../commom'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
@ -93,6 +103,7 @@ export default {
startTime: dateFormat(new Date(), 'yyyy-MM-dd'),
endTime: dateFormat(new Date(), 'yyyy-MM-dd'),
stationIds: [],
qualifie: ''
},
url: {
list: '/radionuclide/findReviewedPage',
@ -194,7 +205,6 @@ export default {
})
},
handleSelectChange(val) {
console.log(val)
let length = this.stationList.length
if (val.length === length) {
this.allChecked = true
@ -210,6 +220,9 @@ export default {
this.queryParam.stationIds = []
}
},
handleQualifieChange(val){
this.queryParam.qualifie = val
},
getBeforeDate(n) {
var n = n
var d = new Date()
@ -238,7 +251,7 @@ export default {
computed: {
formItems() {
return [
{
/*{
type: 'a-input',
label: '',
name: 'search',
@ -251,7 +264,7 @@ export default {
style: {
width: 'auto',
},
},
},*/
{
type: 'custom-all-select',
label: 'Stations',
@ -307,6 +320,25 @@ export default {
width: 'auto',
},
},
{
type: 'a-select',
label: 'Qualifie',
name: 'qualifie',
props: {
allowClear: true,
placeholder: 'Select qualifie',
options: [{label: 'FULL', value: "FULL"}, {label: 'PREL', value: "PREL"}],
style: {
width: '200px',
},
},
on: {
change: this.handleQualifieChange,
},
style: {
width: 'auto',
},
}
]
},
},

View File

@ -43,52 +43,92 @@
</div>
<!-- 列表结束 -->
<!-- 新增/编辑 -->
<custom-modal :title="isAdd ? 'Add' : 'Edit'" v-model="visible" :width="475" :okHandler="submit">
<custom-modal :title="isAdd ? 'Add' : 'Edit'" v-model="visible" :width="650" :okHandler="submit">
<a-form-model
ref="form"
layout="horizontal"
:model="model"
:rules="rules"
:colon="false"
:labelCol="{ style: { width: '115px' } }"
:wrapperCol="{ style: { width: '300px' } }"
:wrapperCol="{ style: { width: '150px' } }"
>
<a-form-model-item label="Detector Id" prop="detectorId">
<a-input v-model="model.detectorId" type="number"></a-input>
</a-form-model-item>
<a-form-model-item label="Detector Code" prop="detectorCode">
<a-input v-model="model.detectorCode"></a-input>
</a-form-model-item>
<a-form-model-item label="Lon" prop="lon">
<a-input v-model="model.lon" type="number"></a-input>
</a-form-model-item>
<a-form-model-item label="Lat" prop="lat">
<a-input v-model="model.lat" type="number"></a-input>
</a-form-model-item>
<a-form-model-item label="Type" prop="type">
<a-input v-model="model.type"></a-input>
</a-form-model-item>
<a-form-model-item label="Channels" prop="channels">
<a-input v-model="model.channels" type="number"></a-input>
</a-form-model-item>
<a-form-model-item label="Rated Efficiency" prop="ratedEfficiency">
<a-input v-model="model.ratedEfficiency" type="number"></a-input>
</a-form-model-item>
<a-form-model-item label="Rated Resolution" prop="ratedResolution">
<a-input v-model="model.ratedResolution" type="number"></a-input>
</a-form-model-item>
<a-form-model-item label="Ecal Range Max" prop="ecalRangeMax">
<a-input v-model="model.ecalRangeMax" type="number"></a-input>
</a-form-model-item>
<a-form-model-item label="Description" prop="description">
<a-textarea v-model="model.description" :rows="3"></a-textarea>
</a-form-model-item>
<a-form-model-item label="Moddate" prop="moddate">
<a-date-picker v-model="model.moddate" :rows="3"></a-date-picker>
</a-form-model-item>
<a-form-model-item label="Status" prop="status">
<j-dict-select-tag v-model="model.status" dictCode="STATION_STATUS"></j-dict-select-tag>
</a-form-model-item>
<a-row :gutter="24">
<!-- <a-col :span="12">
<a-form-model-item label="Detector Id" prop="detectorId">
<a-input :disabled='!isAdd' v-model="model.detectorId" type="number"></a-input>
</a-form-model-item>
</a-col>-->
<a-col :span="12">
<a-form-model-item label="Station" prop="stationId">
<a-select showSearch allowClear
:disabled='!isAdd'
:filterOption = this.filterOption
:options="stationOptions"
v-model="model.stationId">
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="Detector Code" prop="detectorCode">
<a-input :disabled='!isAdd' @input='enterCode' v-model="model.detectorCode"></a-input>
</a-form-model-item>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<a-form-model-item label="Status" prop="status">
<j-dict-select-tag v-model="model.status" dictCode="STATION_STATUS"></j-dict-select-tag>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="Type" prop="type">
<a-input v-model="model.type"></a-input>
</a-form-model-item>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<a-form-model-item label="Lon" prop="lon">
<a-input v-model="model.lon" type="number"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="Lat" prop="lat">
<a-input v-model="model.lat" type="number"></a-input>
</a-form-model-item>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<a-form-model-item label="Channels" prop="channels">
<a-input v-model="model.channels" type="number"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="Rated Efficiency" prop="ratedEfficiency">
<a-input v-model="model.ratedEfficiency" type="number"></a-input>
</a-form-model-item>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<a-form-model-item label="Rated Resolution" prop="ratedResolution">
<a-input v-model="model.ratedResolution" type="number"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="Ecal Range Max" prop="ecalRangeMax">
<a-input v-model="model.ecalRangeMax" type="number"></a-input>
</a-form-model-item>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="24">
<a-form-model-item label="Description" prop="description" :wrapperCol="{ style: { width: '77%' } }">
<a-textarea v-model="model.description" :rows="2"></a-textarea>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</custom-modal>
<!-- 新增/编辑 结束 -->
@ -198,23 +238,28 @@ export default {
data() {
this.columns = columns
const validateDetectorCode = (_, value, callback) => {
if (!value) {
callback(new Error('Please Enter Detector Code'))
} else {
if (value.length > 9) {
callback(new Error('Detector Code Limit 9'))
if(this.model.stationId){
if (value) {
if (value.length > 9) {
callback(new Error('Detector Code Limit 9'))
} else {
callback()
}
} else {
callback()
callback(new Error('Please Enter Code'))
}
}else {
callback('Select Station First');
}
}
return {
queryParam: {},
rules: {
detectorId: [{ required: true, message: 'Please Enter Detector Id' }],
// detectorId: [{ required: true, message: 'Please Enter Id' }, { validator: this.checkId }],
detectorCode: [{ required: true, validator: validateDetectorCode }],
moddate: [{ required: true, message: 'Please Select Moddate' }]
stationId: [{ required: true, message: 'Please Select Station' }],
status: [{ required: true, message: 'Please Select Status' }]
},
url: {
list: '/gardsDetectors/findPage',
@ -222,7 +267,8 @@ export default {
add: '/gardsDetectors/create',
edit: '/gardsDetectors/update'
},
typeList: []
typeList: [],
stationOptions: [],
}
},
created() {
@ -231,7 +277,7 @@ export default {
methods: {
async getTypeList() {
try {
const res = await getAction('/gardsDetectors/findType')
const res = await getAction( '/gardsDetectors/findType')
this.typeList = res.filter(item => item).map(item => ({ label: item, value: item }))
} catch (error) {
console.error(error)
@ -244,13 +290,15 @@ export default {
onAdd() {
this.isAdd = true
this.model = {}
this.model = { status: 'Operating' }
this.getStationList()
this.visible = true
},
onEdit() {
if (this.selectedRowKeys && this.selectedRowKeys.length) {
this.isAdd = false
this.visible = true
this.getStationList()
const find = this.dataSource.find(item => item.detectorId === this.selectedRowKeys[0])
this.model = cloneDeep(find)
} else {
@ -274,6 +322,43 @@ export default {
beforeSubmit() {
this.model.moddate = moment(this.model.moddate).format('yyyy-MM-DD HH:mm:ss')
},
async getStationList() {
await getAction('/webStatistics/findStationList', { menuName: '' }).then((res) => {
if (res.success) {
if (res.result.length > 0) {
this.stationOptions = res.result.map((item) => {
return {
label: item.stationCode,
value: item.stationId,
}
})
} else {
this.stationOptions = []
}
} else {
this.$message.warning('This operation fails. Contact your system administrator')
}
})
},
enterCode(){
let stationId = this.model.stationId
if (stationId){
let current = this.model.detectorCode
let stationCode = this.stationOptions.find(option => option.value === stationId).label;
let prefix = stationCode + "_"
if (!current.startsWith(prefix)){
this.model.detectorCode = prefix + current
}else {
if (prefix === current){
this.model.detectorCode = ''
}
}
}else {
this.model.detectorCode = ''
}
}
},
computed: {