<template>
|
<a-card :bordered='false'>
|
<!-- 查询区域 -->
|
<div class='table-page-search-wrapper'>
|
<a-form layout='inline' @keyup.enter.native='searchQuery'>
|
<a-row :gutter='24'>
|
<a-col :xl='6' :lg='7' :md='8' :sm='24'>
|
<a-form-item label='批次日期'>
|
<j-date :allow-clear='false' @change='dateChange' placeholder='请选择批次日期' v-model='queryParam.batchDate' style='width: 100%' />
|
</a-form-item>
|
</a-col>
|
|
<a-col :xl='6' :lg='7' :md='8' :sm='24'>
|
<a-form-item label='批次号'>
|
<a-select placeholder='请选择批次' v-model='batch'>
|
<a-select-option v-for='(item,index) in batchOptions' :key='index' :value='item.value'>{{ item.text }}</a-select-option>
|
</a-select>
|
</a-form-item>
|
</a-col>
|
<a-col :xl='6' :lg='7' :md='8' :sm='24'>
|
<span style='float: left;overflow: hidden;' class='table-page-search-submitButtons'>
|
<a-button type='primary' @click='searchQuery' icon='search'>查询</a-button>
|
<!-- <a-button type='primary' @click='searchReset' icon='reload' style='margin-left: 8px'>重置</a-button>-->
|
|
</span>
|
</a-col>
|
</a-row>
|
</a-form>
|
</div>
|
<!-- 查询区域-END -->
|
<div>
|
<iframe ref='report' class='report'></iframe>
|
</div>
|
</a-card>
|
</template>
|
|
<script>
|
|
import moment from 'moment'
|
import { getAction } from '@api/manage'
|
|
export default {
|
name: 'BatchDetailReport',
|
data() {
|
return {
|
moment,
|
dateFormat: 'YYYY-MM-DD',
|
queryParam: {
|
batchDate: (new Date()).Format('yyyy-MM-dd')
|
},
|
batch: null,
|
batchOptions: [],
|
url: {
|
batchList: '/lims/testing/batch/list'
|
}
|
}
|
},
|
mounted() {
|
this.queryBatchList()
|
|
},
|
methods: {
|
dateChange(datestr) {
|
this.batchOptions = []
|
this.batch = null
|
this.$forceUpdate()
|
this.queryBatchList()
|
},
|
searchQuery() {
|
if (!this.batch) {
|
this.$message.error('请选择一个批次!')
|
return false
|
}
|
console.info(this.reportUrl + '&arg1=' + this.batch)
|
this.$refs.report.src = this.reportUrl + '&arg1=' + this.batch
|
|
},
|
searchReset() {
|
|
},
|
queryBatchList() {
|
let params = {}
|
params.batchDate_begin = this.queryParam.batchDate
|
params.batchDate_end = this.queryParam.batchDate
|
getAction(this.url.batchList, params).then(res => {
|
console.info(res)
|
console.info(this.batchOptions)
|
if(res.success){
|
res.result.records.forEach(item => {
|
this.batchOptions.push({ 'text': item.batchCode, 'value': item.id })
|
})
|
}
|
|
})
|
}
|
},
|
computed: {
|
reportUrl: function() {
|
return `${window._CONFIG['domianREPORT']}/report/reportJsp/showReport.jsp?rpx=batch_detail.rpx`
|
}
|
}
|
}
|
</script>
|
|
<style lang='less' scoped>
|
.report {
|
width: 100%;
|
height: 100vh;
|
border: none;
|
}
|
|
</style>
|