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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
| <template>
| <div class="app-container">
| <el-card class="box-card">
| <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
| <el-form-item label="按月份统计" prop="queryMonth">
| <el-date-picker
| v-model="queryParams.queryMonth"
| type="month"
| @change = changeMonth
| value-format="yyyy-MM"
| placeholder="选择月份">
| </el-date-picker>
| </el-form-item>
| <el-form-item label="按日期统计" prop="queryDate">
| <el-date-picker
| v-model="queryParams.queryDate"
| type="date"
| @change = changeDate
| value-format="yyyy-MM-dd"
| placeholder="选择日期">
| </el-date-picker>
| </el-form-item>
| <el-form-item>
| <el-button type="primary" icon="el-icon-download" style="background-color: #6dbf6d;" @click="exportReport">导出报表</el-button>
| </el-form-item>
| </el-form>
|
| <el-table v-loading="loading" border :data="productNumList" v-if="productNumList.length > 0">
| <el-table-column label="机型" align="center" prop="model">
| </el-table-column>
| <el-table-column label="产量" align="center" prop="num" width="150">
| </el-table-column>
| </el-table>
| <el-empty v-else>
| <span slot="description">暂无数据</span>
| </el-empty>
| </el-card>
| </div>
| </template>
|
| <script>
| import {
| getProductNum
| } from "../../../../api/main/da/passingStationCollection/passingStationCollection";
|
| export default {
| name: "productNum",
| data() {
| return {
| // 遮罩层
| loading: true,
| queryParams: {
| queryDate: '',
| queryMonth: '',
| pageNum: 1,
| pageSize: 10,
| },
| // 表单参数
| form: {},
| showSearch: true,
| productNumList: [],
| // 总条数
| total: 0,
| };
| },
| created() {
| const date = new Date();
| const year = date.getFullYear();
| let month = date.getMonth() + 1;
| let day = date.getDate();
| month = (month > 9) ? month : ("0" + month);
| day = (day < 10) ? ("0" + day) : day;
| this.queryParams.queryDate = year + "-" + month + "-" + day;
| this.queryParams.queryMonth = year + "-" + month;
| this.getList();
| },
| methods: {
| //导出
| exportReport(){
| this.download('bs/beatSetting/productNumExport', {
| ...this.queryParams
| }, `产量报表_${new Date().getTime()}.xlsx`)
|
| },
| /** 查询产品过站采集列表 */
| getList: function () {
| this.loading = true;
| getProductNum(this.queryParams).then(response => {
| console.log('res', response)
| this.productNumList = response.data;
| this.loading = false;
| });
| },
| changeMonth (){
| this.queryParams.queryDate = ''
| this.getList()
| },
| changeDate(){
| console.log('000000')
| if (this.queryParams.queryDate !== null && this.queryParams.queryDate !==''){
| let split = this.queryParams.queryDate.split('-');
| this.queryParams.queryMonth = split[0]+"-"+split[1]
| }
| this.getList()
| },
| // 取消按钮
| cancel() {
| this.open = false;
| this.reset();
| },
| // 表单重置
| reset() {
| this.form = {
| id: null,
| workOrderNo: null,
| sfcCode: null,
| productCode: null,
| productionLine: null,
| locationCode: null,
| equipmentNo: null,
| inboundTime: null,
| outboundTime: null,
| inRsSign: null,
| inMsgSign: null,
| outRsSign: null,
| outMsgSign: null,
| collectionTime: null,
| spareField1: null,
| spareField2: null,
| createUser: null,
| createTime: null,
| updateUser: null,
| updateTime: null,
| beatTime: null
| };
| this.resetForm("form");
| },
| /** 搜索按钮操作 */
| handleQuery() {
| this.queryParams.pageNum = 1;
| this.getList();
| },
| /** 重置按钮操作 */
| resetQuery() {
| this.resetForm("queryForm");
| this.handleQuery();
| },
| }
| };
| </script>
|
| <style scoped>
|
| </style>
|
|