jinhui.wang

货物查询

1 +import request from '@/utils/request'
2 +
3 +// 货物查询查询条件数据
4 +export function findConditionData(data) {
5 + return request({
6 + url: '/cargo/findConditionData',
7 + method: 'post',
8 + data: data
9 + })
10 +}
11 +
12 +//货物查询
13 +export function findCargoData(data) {
14 + return request({
15 + url: '/cargo/findCargoData',
16 + method: 'post',
17 + data: data
18 + })
19 +}
20 +
1 +<template>
2 + <div>
3 + <el-form
4 + ref="cargoForm"
5 + size="mini"
6 + inline
7 + :model="formData"
8 + label-position="right"
9 + label-width="105px"
10 + style="margin: 15px"
11 + >
12 + <el-row>
13 + <el-col :span="6">
14 + <el-form-item label="航班日期:">
15 + <el-date-picker
16 + v-model="flightTime"
17 + type="daterange"
18 + range-separator="至"
19 + start-placeholder="开始日期"
20 + end-placeholder="结束日期"
21 + :value-format="valueFormat"
22 + >
23 + </el-date-picker>
24 + </el-form-item>
25 + </el-col>
26 + <el-col :span="6">
27 + <el-form-item label="预配航班日期:">
28 + <el-date-picker
29 + v-model="prepalyFlightTime"
30 + type="daterange"
31 + range-separator="至"
32 + start-placeholder="开始日期"
33 + end-placeholder="结束日期"
34 + :value-format="valueFormat"
35 + >
36 + </el-date-picker>
37 + </el-form-item>
38 + </el-col>
39 + <el-col :span="6">
40 + <el-form-item label="创建日期:">
41 + <el-date-picker
42 + v-model="createDate"
43 + type="daterange"
44 + range-separator="至"
45 + start-placeholder="开始日期"
46 + end-placeholder="结束日期"
47 + :value-format="valueFormat"
48 + >
49 + </el-date-picker>
50 + </el-form-item>
51 + </el-col>
52 + <el-col :span="6">
53 + <el-form-item label="取件日期:">
54 + <el-date-picker
55 + v-model="formData.pickUpDate"
56 + type="date"
57 + placeholder="选择日期"
58 + :value-format="valueFormat"
59 + >
60 + </el-date-picker>
61 + </el-form-item>
62 + </el-col>
63 + <el-col :span="6">
64 + <el-form-item label="运单号:">
65 + <el-input
66 + size="small"
67 + type="text"
68 + v-model="formData.waybillNo"
69 + ></el-input>
70 + </el-form-item>
71 + </el-col>
72 + <el-col :span="6">
73 + <el-form-item label="站点:">
74 + <el-input
75 + size="small"
76 + type="text"
77 + v-model="formData.siteName"
78 + ></el-input>
79 + </el-form-item>
80 + </el-col>
81 + <el-col :span="6">
82 + <el-form-item label="航班号:">
83 + <el-input
84 + size="small"
85 + type="text"
86 + v-model="upCase"
87 + ></el-input>
88 + </el-form-item>
89 + </el-col>
90 + <el-col :span="6">
91 + <el-form-item label="航班序列单号:">
92 + <el-input
93 + size="small"
94 + type="text"
95 + v-model="formData.mawbCode"
96 + ></el-input>
97 + </el-form-item>
98 + </el-col>
99 + <el-col :span="6">
100 + <el-form-item label="URSA:">
101 + <el-input
102 + size="small"
103 + type="text"
104 + v-model="formData.ursa"
105 + ></el-input>
106 + </el-form-item>
107 + </el-col>
108 + <el-col :span="6">
109 + <el-form-item label="申报类别:">
110 + <el-select
111 + placeholder="不限"
112 + v-model="formData.typeId"
113 + clearable
114 + >
115 + <el-option
116 + v-for="item in findConditionData.cargoType"
117 + :label="item.chineseName"
118 + :value="item.id"
119 + :key="item.id"
120 + >
121 + </el-option>
122 + </el-select>
123 + </el-form-item>
124 + </el-col>
125 + <el-col :span="6">
126 + <el-form-item label="货物状态:">
127 + <el-select
128 + placeholder="不限"
129 + v-model="formData.statusId"
130 + clearable
131 + >
132 + <el-option
133 + v-for="item in findConditionData.cargoStatus"
134 + :label="item.chineseName"
135 + :value="item.id"
136 + :key="item.id"
137 + >
138 + </el-option>
139 + </el-select>
140 + </el-form-item>
141 + </el-col>
142 + <el-col :span="6">
143 + <el-form-item label="配置航班类型:">
144 + <el-select
145 + placeholder="不限"
146 + v-model="formData.kindToAllocFlightId"
147 + clearable
148 + >
149 + <el-option
150 + v-for="item in findConditionData.configureFlightType"
151 + :label="item.chineseName"
152 + :value="item.id"
153 + :key="item.id"
154 + >
155 + </el-option>
156 + </el-select>
157 + </el-form-item>
158 + </el-col>
159 + <el-col :span="6">
160 + <el-form-item label="历史货物状态:">
161 + <el-select
162 + placeholder="不限"
163 + v-model="formData.historyAllocaCargoTypeId"
164 + clearable
165 + >
166 + <el-option
167 + v-for="item in findConditionData.cargoStatusHistory"
168 + :label="item.chineseName"
169 + :value="item.id"
170 + :key="item.id"
171 + >
172 + </el-option>
173 + </el-select>
174 + </el-form-item>
175 + </el-col>
176 + <el-col :span="6">
177 + <el-form-item label="海关回执状态:">
178 + <el-select
179 + placeholder="不限"
180 + v-model="formData.customsReceiptStatusId"
181 + clearable
182 + >
183 + <el-option
184 + v-for="item in findConditionData.cargoCustomsReturnStatus"
185 + :label="item.chineseName"
186 + :value="item.id"
187 + :key="item.id"
188 + >
189 + </el-option>
190 + </el-select>
191 + </el-form-item>
192 + </el-col>
193 + <el-col :span="6">
194 + <el-form-item label="服务类型:">
195 + <el-select
196 + placeholder="不限"
197 + v-model="formData.serviceTypeId"
198 + clearable
199 + >
200 + <el-option
201 + v-for="item in findConditionData.cargoServiceType"
202 + :label="item.chineseName"
203 + :value="item.id"
204 + :key="item.id"
205 + >
206 + </el-option>
207 + </el-select>
208 + </el-form-item>
209 + </el-col>
210 + <el-col :span="6">
211 + <el-form-item label="数据源:">
212 + <el-select
213 + placeholder="不限"
214 + v-model="formData.dataSources"
215 + clearable
216 + >
217 + <el-option label="人工导入" value="1"> </el-option>
218 + <el-option label="系统导入" value="2"> </el-option>
219 + </el-select>
220 + </el-form-item>
221 + </el-col>
222 + <el-col :span="6">
223 + <el-form-item label="是否大货:">
224 + <el-select
225 + placeholder="不限"
226 + v-model="formData.big"
227 + clearable
228 + >
229 + <el-option label="是" value="1"> </el-option>
230 + <el-option label="否" value="0"> </el-option>
231 + </el-select>
232 + </el-form-item>
233 + </el-col>
234 + <el-col :span="6">
235 + <el-form-item label="是否自动:">
236 + <el-select
237 + placeholder="不限"
238 + v-model="formData.allocationTypeId"
239 + clearable
240 + >
241 + <el-option
242 + v-for="item in findConditionData.cargoAllocationType"
243 + :label="item.chineseName"
244 + :value="item.id"
245 + :key="item.id"
246 + >
247 + </el-option>
248 + </el-select>
249 + </el-form-item>
250 + </el-col>
251 + </el-row>
252 + <div style="paddingleft: 10px">
253 + <el-button
254 + type="primary"
255 + icon="el-icon-search"
256 + size="small"
257 + @click="select"
258 + >查询</el-button
259 + >
260 + <el-button type="primary" size="small" @click="checks(tableDate)"
261 + >全选/全否</el-button
262 + >
263 + <el-button type="primary" size="small" @click="xlse(limitStart)"
264 + >导出本页查询结果</el-button
265 + >
266 + <el-button type="primary" size="small" @click="xlse(0)"
267 + >导出全部查询结果</el-button
268 + >
269 + <div class="tips">
270 + <span style="paddingright: 50px">总重量:{{ allWeight }}</span
271 + > <span>总件数:{{ allQty }}</span>
272 + </div>
273 + </div>
274 + </el-form>
275 + <el-table
276 + ref="cargoTable"
277 + :data="tableDate"
278 + style="width: 100%"
279 + size="small"
280 + height="500"
281 + v-loading="tableLoading"
282 + fit
283 + @select="cheacked"
284 + >
285 + <el-table-column type="selection" width="55" fixed> </el-table-column>
286 + <el-table-column type="index" label="序号">
287 + <template slot-scope="scope">{{scope.$index+1}}</template>
288 + </el-table-column>
289 + <el-table-column
290 + v-for="item in tableHeader"
291 + :prop="item.value"
292 + :label="item.name"
293 + :key="item.name"
294 + width="100%"
295 + header-align="center"
296 + align="center"
297 + >
298 + </el-table-column>
299 + </el-table>
300 + <el-pagination
301 + :total="totalCount"
302 + hide-on-single-page
303 + :page-size.sync="limitSize"
304 + background
305 + style="margin-top: 40px; text-align: right"
306 + @next-click="nextClick"
307 + @prev-click="prevClick"
308 + @current-change="currentChange"
309 + >
310 + </el-pagination>
311 + </div>
312 +</template>
313 +
314 +<script>
315 +import { findConditionData, findCargoData } from "@/api/cargoSelect";
316 +import { downLoadZip } from "@/utils/zipdownload";
317 +
318 +export default {
319 + data() {
320 + return {
321 + formData: {
322 + fltDateStart: "",
323 + fltDateEnd: "",
324 + prematchFltDateStart: "",
325 + prematchFltDateEnd: "",
326 + createTimeStart: null,
327 + createTimeEnd: null,
328 + pickUpDate: null,
329 + waybillNo: "",
330 + siteName: "",
331 + fltNo: "",
332 + mawbCode: "",
333 + ursa: "",
334 + typeId: null,
335 + statusId: null,
336 + serviceTypeId: null,
337 + allocationTypeId: null,
338 + kindToAllocFlightId: null,
339 + historyAllocaCargoTypeId: null,
340 + dataSources: "",
341 + customsReceiptStatusId: null,
342 + big: null,
343 + }, //表单数据
344 + tableHeader: [
345 + { name: "配置航班类型", value: "kindIdToAllocFlightName" },
346 + { name: "取件日期", value: "pickUpDate" },
347 + { name: "取件扫描号", value: "pickUpScanNo" },
348 + { name: "服务类型", value: "serviceTypeName" },
349 + { name: "运单号", value: "waybillNo" },
350 + { name: "状态", value: "statusName" },
351 + { name: "航班号", value: "fltNo" },
352 + { name: "航班日期", value: "fltDate" },
353 + { name: "原航班", value: "sourceFlt" },
354 + { name: "已选目的航班", value: "fltSet" },
355 + { name: "件数", value: "qty" },
356 + { name: "实际重量", value: "actualWeight" },
357 + { name: "航班序号单", value: "mawbCode" },
358 + { name: "申报类型", value: "typeName" },
359 + { name: "历史货物状态", value: "historyAllocaCargoTypeName" },
360 + { name: "预配航班日期", value: "prematchFltDate" },
361 + { name: "品名描述", value: "nameDescription" },
362 + { name: "站点", value: "siteName" },
363 + { name: "收件地", value: "destinationSiteName" },
364 + { name: "目的国家", value: "countryName" },
365 + { name: "Bagging ID", value: "baggingId" },
366 + { name: "URSA", value: "ursa" },
367 + { name: "selection Code", value: "selectionCode" },
368 + { name: "尺寸", value: "sizeStr" },
369 + { name: "体积", value: "volume" },
370 + { name: "是否大货", value: "big" },
371 + { name: "历史航班号", value: "historyFltNo" },
372 + { name: "海关回执状态", value: "customsReceiptStatusName" },
373 + { name: "海关回执时间", value: "customsReceiptTime" },
374 + { name: "CA预审意见", value: "caPretrialOpinion" },
375 + { name: "CA回执时间", value: "caPretrialTime" },
376 + {
377 + name: "大货预审意见(是否可以配置CA航班)",
378 + value: "bigPretrialOpinion",
379 + },
380 + { name: "大货预审时间", value: "bigPretrialTime" },
381 + { name: "是否已经传送到图像系统", value: "transmitFlg" },
382 + { name: "传送时间", value: "transmitUploadTime" },
383 + { name: "图像系统反馈结果", value: "transmitFeedbackTime" },
384 + { name: "图像系统反馈时间", value: "transmitFeedbackResult" },
385 + { name: "创建人", value: "createUserId" },
386 + { name: "创建时间", value: "createTime" },
387 + { name: "数据源", value: "dataSources" },
388 + { name: "是否自动", value: "allocationTypeName" },
389 + ], //表头数据
390 + findConditionData: {}, //货物查询条件
391 + tableDate: [], //表格数据
392 + allWeight: 0,
393 + allQty: 0,
394 + shiftKey: false,
395 + start: -1,
396 + valueFormat:'yyyy-MM-dd',
397 + tableLoading:false,
398 + totalCount:0,
399 + selectTable: [],
400 + flightTime: [],
401 + prepalyFlightTime: [],
402 + createDate: [],
403 + limitStart: 0,
404 + limitSize: 100,//无限制-1
405 + };
406 + },
407 +
408 + created() {
409 + //查询条件
410 + findConditionData().then((res) => {
411 + if (res.code == 200) {
412 + this.findConditionData = res.data;
413 + }else{
414 + this.$message({
415 + message: '查询条件不存在',
416 + type: 'warning',
417 + });
418 + }
419 + });
420 + },
421 +
422 + mounted() {
423 + window.addEventListener("keydown", (code) => {
424 + if (code.keyCode === 16 && code.shiftKey) {
425 + this.shiftKey = true;
426 + }
427 + });
428 + window.addEventListener("keyup", (code) => {
429 + if (code.keyCode === 16) {
430 + this.shiftKey = false;
431 + }
432 + });
433 + },
434 +
435 + methods: {
436 + clear(){
437 + this.$refs.cargoForm.resetFields()
438 + },
439 + //查询
440 + select() {
441 + this.tableLoading = true;
442 + if(this.createDate.length > 0){
443 + this.formData.createTimeStart = this.createDate[0];
444 + this.formData.createTimeEnd = this.createDate[1];
445 + }
446 + if(this.prepalyFlightTime.length > 0){
447 + this.formData.prematchFltDateStart = this.prepalyFlightTime[0];
448 + this.formData.prematchFltDateEnd = this.prepalyFlightTime[1];
449 + }
450 + if(this.flightTime.length > 0){
451 + this.formData.fltDateStart = this.flightTime[0];
452 + this.formData.fltDateEnd = this.flightTime[1];
453 + }
454 +
455 + this.formData.limitStart = this.limitStart;
456 + this.formData.limitSize = this.limitSize;
457 + findCargoData(this.formData).then((res) => {
458 + if (res.code == 200) {
459 + if(res.data.list.length > 0 ){
460 + this.tableDate = res.data.list;
461 + this.totalCount = res.data.totalCount;
462 + for (let i = 0; i < this.tableDate.length; i++) {
463 + this.tableDate[i].index = i;
464 + }
465 + }else{
466 + this.$message({
467 + message: '未查询到数据',
468 + type: 'warning',
469 + });
470 + }
471 + }else{
472 + this.$message({
473 + message: res.msg,
474 + type: 'warning',
475 + });
476 + }
477 + this.tableLoading = false;
478 + });
479 + },
480 + //全选反选
481 + checks(rows) {
482 + if (rows) {
483 + rows.forEach((row) => {
484 + this.$refs.cargoTable.toggleRowSelection(row);
485 + });
486 + } else {
487 + this.$refs.cargoTable.clearSelection();
488 + }
489 + },
490 + //下一页
491 + nextClick(){
492 + this.limitStart = this.limitStart + 100;
493 + },
494 + //上一页
495 + prevClick(){
496 + this.limitStart = this.limitStart - 100;
497 + },
498 + //指定页数
499 + currentChange(page){
500 + this.limitStart = (page-1)*100;
501 + this.select()
502 + },
503 + //表单项选中操作
504 + cheacked(sl, row) {
505 + if (this.shiftKey) {
506 + if (this.start == -1) {
507 + for (let i = 0; i <= row.index; i++) {
508 + this.$refs.cargoTable.toggleRowSelection(this.tableDate[i], true);
509 + this.selectTable.push(this.tableDate[i]);
510 + }
511 + } else {
512 + for (let i = this.start + 1; i <= row.index; i++) {
513 + this.$refs.cargoTable.toggleRowSelection(this.tableDate[i], true);
514 + }
515 + }
516 + } else {
517 + this.start = row.index;
518 + if (this.selectTable.length == 0) {
519 + this.selectTable.push(row);
520 + } else {
521 + let newselect = [];
522 + newselect.push(row);
523 + for (let i = 0; i < this.selectTable.length; i++) {
524 + if (this.selectTable[i].id != row.id) {
525 + newselect.push(this.selectTable[i])
526 + }else{
527 + newselect.splice(0, 1);
528 + }
529 + }
530 + this.selectTable = newselect
531 + }
532 + }
533 + this.allWeight = 0;
534 + this.allQty = 0;
535 + for (let i = 0; i < this.selectTable.length; i++) {
536 + this.allWeight = this.allWeight + this.selectTable[i].actualWeight;
537 + this.allQty = this.allQty + this.selectTable[i].qty;
538 + }
539 + this.allQty = this.allQty.toFixed(0);
540 + this.allWeight = this.allWeight.toFixed(1);
541 + },
542 + // 全部、当前页面
543 + xlse(page) {
544 + if(page > 0 ){
545 +
546 + }else{
547 +
548 + }
549 + console.log(page);
550 + },
551 + },
552 + computed:{
553 + upCase:{
554 + get: function(){
555 + return this.formData.fltNo;
556 + },
557 + set: function(val){
558 + this.formData.fltNo = val.toUpperCase();
559 + }
560 + }
561 + }
562 +};
563 +</script>
564 +
565 +<style>
566 +.tips {
567 + float: right;
568 + color: #606266;
569 + font-size: 14px;
570 + margin-right: 20px;
571 +}
572 +</style>
...\ No newline at end of file ...\ No newline at end of file