This commit is contained in:
xiaoguangbin 2023-11-01 11:04:17 +08:00
commit 9e1377d5df
2 changed files with 87 additions and 56 deletions

View File

@ -1,18 +1,18 @@
<template>
<div style="height: 100%;">
<div style="height: 100%">
<List :stationList="stationList" :columns="columns" :dataType="dataType" fileName="DETBKPHD" pageType="ACQ"></List>
</div>
</template>
<script>
import List from "../../../list.vue"
import List from '../../../list.vue'
import { getAction } from '../../../../../api/manage'
const columns = [
{
title: 'NO',
align: 'left',
width:80,
width: 80,
scopedSlots: {
customRender: 'index',
},
@ -68,24 +68,23 @@ export default {
},
stationList: [],
columns,
dataType:"D"
dataType: 'D',
}
},
mounted() {
console.log(this.dataType);
this.findStationList();
this.findStationList()
},
methods: {
findStationList() {
getAction(this.url.findStationList, { menuName: 'Particulate' }).then((res) => {
if (res.success) {
if (res.result.length>0) {
if (res.result.length > 0) {
this.stationList = res.result.map((res) => ({ label: res.stationCode, value: res.stationId }))
} else {
this.stationList=[]
this.stationList = []
}
} else {
this.$message.warning("This operation fails. Contact your system administrator")
this.$message.warning('This operation fails. Contact your system administrator')
}
})
},
@ -94,5 +93,4 @@ export default {
</script>
<style lang="less" scoped>
</style>

View File

@ -1,5 +1,5 @@
<template>
<div style="height: 100%;">
<div style="height: 100%">
<a-spin :spinning="spinning">
<a-card v-if="!isDetail" :bordered="false" style="margin-left: 20px">
<search-form :items="formItems" v-model="queryParam" @search="searchQueryData">
@ -32,54 +32,67 @@
</div>
</template>
<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { getAction,getFileAction } from '../../api/manage'
import { getAction, getFileAction } from '../../api/manage'
import dateFormat from '../../components/jeecg/JEasyCron/format-date'
import Detail from "./detail.vue"
import Detail from './detail.vue'
export default {
name: 'menuTree',
props: {
stationList: {
type: Array,
default: ()=>[]
default: () => [],
},
columns: {
type: Array,
default: ()=>[]
default: () => [],
},
dataType: {
type: String,
default:""
default: '',
},
fileName: {
type: String,
default:""
default: '',
},
spectralQualifie: {
type: String,
default:""
default: '',
},
pageType: {
type: String,
default:""
}
default: '',
},
},
mixins: [JeecgListMixin],
components: {
Detail,
},
watch: {
fileName: {
handler: function (val) {
if (val === 'QCPHD' || val === 'SPHDF' || val === 'SPHDP') {
console.log(56, this)
console.log(this.getBeforeDate(6))
this.$nextTick(() => {
this.queryParam.startTime = this.getBeforeDate(6)
})
}
},
immediate: true,
},
},
data() {
return {
spinning: false,
isImmediate:true,
isDetail:false,
isImmediate: true,
isDetail: false,
queryParam: {
dataType: this.dataType,
startTime: dateFormat(new Date(), 'yyyy-MM-dd'),
endTime: dateFormat(new Date(), 'yyyy-MM-dd'),
stationIds: [],
spectralQualifie:this.spectralQualifie
spectralQualifie: this.spectralQualifie,
},
url: {
list: '/webStatistics/findParticulatePage',
@ -90,21 +103,21 @@ export default {
dataSource: [],
detailJson: {},
allChecked: false,
currSampleId:""
currSampleId: '',
}
},
methods: {
handleExcel() {
if (this.dataSource.length>0) {
if (this.dataSource.length > 0) {
let params = {
...this.queryParam,
pageType:this.pageType
pageType: this.pageType,
}
getFileAction("/webStatistics/radionuclideExport", params).then(res => {
getFileAction('/webStatistics/radionuclideExport', params).then((res) => {
if (res.code && res.code == 500) {
this.$message.warning("This operation fails. Contact your system administrator")
this.$message.warning('This operation fails. Contact your system administrator')
} else {
const blob = new Blob([res], { type: "application/vnd.ms-excel" })
const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
let link = document.createElement('a')
link.href = window.URL.createObjectURL(blob)
link.download = this.fileName
@ -115,7 +128,7 @@ export default {
}
})
} else {
this.$message.warning("No downloadable data")
this.$message.warning('No downloadable data')
}
},
searchQueryData() {
@ -124,7 +137,7 @@ export default {
let params = {
...this.queryParam,
pageNo: 1,
pageSize: 10
pageSize: 10,
}
getAction(this.url.list, params).then((res) => {
this.loading = false
@ -134,25 +147,27 @@ export default {
this.ipagination.total = res.result.total
this.dataSource = res.result.records
} else {
this.$message.warning("This operation fails. Contact your system administrator")
this.$message.warning('This operation fails. Contact your system administrator')
}
})
},
handleDetail(record) {
this.spinning = true
this.currSampleId = record.sampleId
getAction("webStatistics/findGeneratedReport", { sampleId: record.sampleId }).then(res => {
this.spinning = false
if (res.success){
this.detailJson = res.result
this.detailJson = JSON.parse(JSON.stringify(this.detailJson))
this.isDetail = true
} else {
this.$message.warning("This operation fails. Contact your system administrator")
}
}).catch(err => {
this.spinning = false
})
getAction('webStatistics/findGeneratedReport', { sampleId: record.sampleId })
.then((res) => {
this.spinning = false
if (res.success) {
this.detailJson = res.result
this.detailJson = JSON.parse(JSON.stringify(this.detailJson))
this.isDetail = true
} else {
this.$message.warning('This operation fails. Contact your system administrator')
}
})
.catch((err) => {
this.spinning = false
})
},
handleBack(flag) {
this.isDetail = flag
@ -168,15 +183,35 @@ export default {
handleSelectChangeAll(val) {
this.allChecked = val
if (val) {
this.queryParam.stationIds = this.stationList.map(item => item.value)
this.queryParam.stationIds = this.stationList.map((item) => item.value)
} else {
this.queryParam.stationIds =[]
this.queryParam.stationIds = []
}
},
filterOption(input, option) {
return (
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
);
return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
// n
getBeforeDate(n) {
var n = n
var d = new Date()
var year = d.getFullYear()
var mon = d.getMonth() + 1
var day = d.getDate()
if (day <= n) {
if (mon > 1) {
mon = mon - 1
} else {
year = year - 1
mon = 12
}
}
d.setDate(d.getDate() - n)
year = d.getFullYear()
mon = d.getMonth() + 1
day = d.getDate()
var s = year + '-' + (mon < 10 ? '0' + mon : mon) + '-' + (day < 10 ? '0' + day : day)
return s
},
},
computed: {
@ -202,20 +237,18 @@ export default {
name: 'stationIds',
props: {
allChecked: this.allChecked,
filterOption:this.filterOption,
filterOption: this.filterOption,
placeholder: 'select stations',
mode: 'multiple',
maxTagCount: 1,
options: [
...this.stationList,
],
options: [...this.stationList],
style: {
width: '200px',
},
},
on: {
change: this.handleSelectChange,
changeAll: this.handleSelectChangeAll
changeAll: this.handleSelectChangeAll,
},
style: {
width: 'auto',
@ -259,7 +292,7 @@ export default {
}
</script>
<style lang="less" scoped>
.icon-edit{
.icon-edit {
margin-right: 10px;
}
</style>