zhuguifei
2025-04-28 442928123f63ee497d766f9a7a14f0a6ee067e25
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<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>