index.vue
10.8 KB
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
<template>
<div class="container">
<div class="searchSty">
<el-form :inline="true" :model="queryForm"
class="demo-form-inline">
<el-form-item label="充装气站:">
<el-select v-model="queryForm.qzId" placeholder="请选择">
<el-option v-for="item in qzOption" :key="item.id_" :label="item.f_czmc" :value="item.id_">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="气瓶编号:">
<el-input v-model="queryForm.qpbh" clearable placeholder="请输入气瓶编号"></el-input>
</el-form-item>
<el-form-item label="充装次数:">
<div style="display: flex;">
<el-select v-model="queryForm.timeType" placeholder="请选择">
<el-option v-for="item in timeTypeOptions" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
<el-input v-model="queryForm.num" style="margin-left: 10px" @input="handleInput" placeholder="多少次"></el-input>
<div style="margin-left: 10px">次</div>
</div>
</el-form-item>
<el-form-item label="充装时间:">
<el-date-picker
value-formate="yyyy-MM-dd"
formate="yyyy-MM-dd"
@change="handleTimeChange"
v-model="queryForm.fillTime"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
placeholder="请选择充装时间">
</el-date-picker>
</el-form-item>
<el-form-item style="float: right">
<el-button type="primary" icon="el-icon-refresh"
style="border: 1px solid #5875eb; background: #ffffff; color: #5875eb; border-radius: 5px;"
@click="handleReset" plain>重置
</el-button>
<el-button type="primary" style="background: #5875eb; border: 1px solid #5875eb; border-radius: 5px;"
icon="el-icon-search" @click="handleSearch"> 查询
</el-button>
</el-form-item>
</el-form>
</div>
<div class="tableSty">
<el-table
:data="tableData"
@selection-change="handleSelectionChange"
style="width: 100%">
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column
type="index"
label="序号"
width="80">
</el-table-column>
<el-table-column
prop="F_qpbh"
label="气瓶编号"
min-width="120">
</el-table-column>
<el-table-column
prop="F_ssczmc"
label="充装气站"
min-width="120">
</el-table-column>
<el-table-column
prop="cs"
label="条码充装总次数"
min-width="120">
<template slot-scope="scope">
<span style="color: #2f54eb;cursor: pointer" @click="handleCsClick(scope.row)">{{scope.row.cs}}</span>
</template>
</el-table-column>
</el-table>
<el-row>
<el-col :span="24" style="display:flex; justify-content: end;margin-top: 10px;">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="pageParams.page"
:page-sizes="[10, 20, 30, 50]"
:page-size="pageParams.size"
layout="total, sizes, prev, pager, next, jumper"
:total="pageParams.total">
</el-pagination>
</el-col>
</el-row>
</div>
<el-dialog v-if="dialogForm.showDialog" title="充装记录" :visible.sync="dialogForm.dialogFormVisible" width="1000px">
<el-table
:data="recordDataList"
style="width: 100%">
<el-table-column
prop="fFormDataRev"
label="充装枪号"
min-width="80">
</el-table-column>
<el-table-column
prop="fQpbh"
label="充装工位"
min-width="160">
</el-table-column>
<el-table-column
prop="fQpbh"
label="气瓶编号"
min-width="160">
</el-table-column>
<el-table-column
prop="fQptm"
label="二维码"
min-width="120">
<templaate slot-scope="scope">
<span>{{scope.row.fQptm}}</span>
</templaate>
</el-table-column>
<el-table-column
prop="fQpgg"
label="气瓶规格"
min-width="120">
</el-table-column>
<el-table-column
prop="fCzjz"
label="充装介质"
min-width="120">
</el-table-column>
<el-table-column
prop="fCzqz"
label="充装前"
min-width="80">
</el-table-column>
<el-table-column
prop="fCzhsjczl"
label="充装量"
min-width="80">
</el-table-column>
<el-table-column
prop="fCzhz"
label="充装后"
min-width="80">
</el-table-column>
<el-table-column
prop="fCzsj"
label="充装开始时间"
min-width="160">
</el-table-column>
<el-table-column
prop="fCzjssj"
label="充装结束时间"
min-width="160">
</el-table-column>
</el-table>
<el-row>
<el-col :span="24" style="display: flex; justify-content: end;margin-top: 10px; ">
<el-pagination
@size-change="handleDialogSizeChange"
@current-change="handleDialogCurrentChange"
:current-page.sync="dialogForm.page"
:page-size="dialogForm.size"
layout="prev, pager, next, jumper"
:total="dialogForm.total">
</el-pagination>
</el-col>
</el-row>
</el-dialog>
</div>
</template>
<script>
import {getOverClockingTableData,getPlantStationPort,fillRecordDataInfo} from '@/api/earlyWarningManage'
export default {
name: "index",
data(){
return{
tableData:[],
recordDataList:[],
qzOption:[],
timeTypeOptions:[
{
label:'>=',
value:'1'
},
{
label:'<=',
value:'2'
},
{
label:'=',
value:'3'
}
],
queryForm:{
lastValidValue:'',
qzId:'',
qpbh:'',
timeType:'1',
num:2,
fillTime:[new Date().toISOString().substr(0, 10),new Date().toISOString().substr(0, 10)],
startDate:new Date().toISOString().substr(0, 10),
endDate: new Date().toISOString().substr(0, 10)
},
pageParams:{
size:10,
page:1,
total:0
},
dialogForm:{
showDialog:false,
dialogFormVisible:false,
qpbh:'',
startDate:'',
endDate:'',
size:10,
page:1,
total:0
}
}
},
mounted() {
this.getStationList();
this.getTableList();
console.log('打印this.queryParams',this.queryForm.fillTime);
},
methods:{
async getTableList(){
let params ={
times:this.queryForm.num?this.queryForm.num:2,
operator:this.queryForm.timeType?this.queryForm.timeType:'1',
startDate:this.queryForm.startDate?this.queryForm.startDate:'',
endDate:this.queryForm.endDate?this.queryForm.endDate:'',
size:this.pageParams.size,
current:this.pageParams.page,
fQpbh:this.queryForm.qpbh,
fSsczid:this.queryForm.qzId?this.queryForm.qzId:''
}
await getOverClockingTableData(params).then((res)=>{
const { value } = res;
const { records, total} = value;
this.tableData = records;
this.pageParams.total = total;
console.log('打印table黎贝澳的数据====》',res);
})
},
async getStationList(){
let params = {
pageBean:{
page:1,
pageSize:10,
showTotal:true
}
}
await getPlantStationPort(params).then((res)=>{
const {rows} = res;
this.qzOption = rows;
})
},
async getfillRecord(){
let params ={
size:this.dialogForm.size,
current:this.dialogForm.page,
fQpbh:this.dialogForm.qpbh,
startDate:this.queryForm.startDate,
endDate:this.queryForm.endDate
}
await fillRecordDataInfo(params).then((res)=>{
console.log('打印res',res);
const { value } = res;
const { records,total} = value;
this.recordDataList = records;
this.dialogForm.total = total;
})
},
//次数输入的事件
handleInput(value){
const integerRegex = /^[1-9]\d*$|^0$/;
if (integerRegex.test(value)) {
this.queryForm.lastValidValue = value;
this.queryForm.num = value;
} else {
this.$nextTick(() => {
this.queryForm.num = this.queryForm.lastValidValue;
});
}
},
//重置事件
handleReset(){},
//查询事件
handleSearch(){
this.getTableList();
},
//充装时间改变的事件
handleTimeChange(val){
if(val){
let startTime = this.parseTime(val[0],'{y}-{m}-{d}');
let endTime = this.parseTime(val[1],'{y}-{m}-{d}');
this.queryForm.endDate = endTime;
this.queryForm.startDate = startTime;
console.log('打印qu',endTime,startTime)
}else{
this.queryForm.fillTime=[new Date().toISOString().substr(0, 10),new Date().toISOString().substr(0, 10)];
this.queryForm.startDate=new Date().toISOString().substr(0, 10);
this.queryForm.endDate=new Date().toISOString().substr(0, 10);
}
},
//table表格的多选框事件
handleSelectionChange(){},
//分页的size改变事件
handleSizeChange(val){
this.pageParams.size = val;
this.handleSearch();
},
//分页的page改变事件
handleCurrentChange(val){
this.pageParams.page = val;
this.handleSearch();
},
//次数点击事件
handleCsClick(row){
console.log('打印row',row);
this.dialogForm.qpbh = row.F_qpbh;
this.dialogForm.showDialog = true;
this.$nextTick(()=>{
this.dialogForm.dialogFormVisible = true;
this.getfillRecord();
})
},
//弹窗size改变事件
handleDialogSizeChange(val){
this.dialogForm.size = val;
this.getfillRecord();
},
//弹窗page改变事件
handleDialogCurrentChange(val){
this.dialogForm.page = val;
this.getfillRecord();
},
}
}
</script>
<style lang="scss" scoped>
.container{
height: 100%;
.searchSty {
background: #ffffff;
padding: 0 20px;
padding-top: 20px;
}
.tableSty{
padding: 20px;
margin-top: 20px;
background: #ffffff;
}
}
</style>