TallyMster.vue
27.4 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
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
<template>
<el-container>
<el-main style="background-color: white">
<!--航班信息部分-->
<el-row class="row-bg">
<el-col :span="24"><div class="grid-content content">航班信息</div></el-col>
<el-col :span="24">
<div class="grid-content co">
<el-col :span="1"><div class="grid-content"></div></el-col>
<el-col :span="20">
<div class="grid-content">
<span>航班号:{{defaultQuery.flightno}}</span>
<span>航班日期:{{defaultQuery.flightdate}}</span>
<span>航段:{{defaultQuery.originstation}}-{{defaultQuery.destinationstation}}</span>
</div>
</el-col>
</div>
</el-col>
<el-col :span="24"><div class="grid-content content">进港理货查询</div></el-col>
<el-col :span="24">
<div class="grid-content co" >
<el-col :span="1"><div class="grid-content"></div></el-col>
<el-col :span="22">
<div class="grid-content">
<el-col :span="4.5">
<div class="grid-content">
<el-input v-model="defaultQuery.awba" placeholder="请输入主单号" ></el-input>
</div>
</el-col>
<el-col :span="1.5"><div class="grid-content"><el-button type="primary" v-on:click="getMt5201List" size="mini">查询</el-button></div></el-col>
</div>
</el-col>
</div>
</el-col>
<el-col :span="24"><div class="grid-content content" style="margin-top: 6px">进港理货单明细</div></el-col>
</el-row>
<!--进港理货列表-->
<el-row>
<el-col :span="24">
<template>
<el-table
:data="tableData"
tooltip-effect="dark"
style="width: 100%"
@selection-change="handleSelectionChange"
row-key="uuid"
border
default-expand-all
:tree-props="{children: 'children', hasChildren: 'hasChildren'}">
<el-table-column
type="selection"
width="50">
</el-table-column>
<el-table-column
prop="waybill"
label="运单号"
width="160"
show-overflow-tooltip>
</el-table-column>
<el-table-column
prop="totalpiece"
label="舱单件数"
width="80"
show-overflow-tooltip>
</el-table-column>
<el-table-column
prop="totalweight"
label="舱单重量"
width="80"
show-overflow-tooltip>
</el-table-column>
<el-table-column
prop="piece"
label="理货件数"
width="80"
show-overflow-tooltip>
</el-table-column>
<el-table-column
prop="weight"
label="理货重量"
width="80"
show-overflow-tooltip>
</el-table-column>
<el-table-column
prop="starttime"
label="卸货时间"
type="date"
width="160">
</el-table-column>
<el-table-column
prop="status"
label="状态"
width="100">
</el-table-column>
<el-table-column
prop="receipt"
label="回执信息"
width="180">
</el-table-column>
<el-table-column
prop="operation"
label="操作"
width="450"
show-overflow-tooltip>
<template slot-scope="scope">
<el-button
size="mini"
type="primary"
@click="handleEdit(scope.$index, scope.row)">收发明细</el-button>
<el-button
v-if="scope.row.awbh==''||scope.row.awbh==null"
size="mini"
type="primary"
@click="handleMain(scope.$index, scope.row)">编辑主单</el-button>
<el-button
v-else
size="mini"
type="primary"
@click="handleFen(scope.$index, scope.row)">编辑分单
</el-button>
<el-button
size="mini"
type="primary"
@click="handleDelete(scope.$index, scope.row)">发送理货报</el-button>
<el-button
size="mini"
type="primary"
@click="handleDelete(scope.$index, scope.row)">发送舱单删除报</el-button>
</template>
</el-table-column>
</el-table>
</template>
</el-col>
</el-row>
<!--编辑主单-->
<el-dialog :title="'进港理货信息'+textMap[dialogStatus]" :visible.sync="outerVisible" width="90%">
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" :label-position="labelPosition"
label-width="78px" size="mini">
<!--航班信息部分-->
<el-row class="flightInfo">
<el-col :span="24">
<div class="grid-content content" style="margin-bottom: 10px;">航班信息</div>
</el-col>
<el-row class="flightInfo">
<el-col :span="6">
<el-form-item label="运单号" prop="awba">
<div v-if="dialogStatus === 'update'">
<el-input disabled="" v-model="ruleForm.awba"></el-input>
</div>
<div v-else>
<el-input v-model="ruleForm.awba"></el-input>
</div>
</el-form-item>
</el-col>
<el-col :span="6">
<div v-if="FenStatus === 'addAwbh'">
<el-form-item label="分单号" prop="awbh">
<el-input v-model="ruleForm.awbh"></el-input>
</el-form-item>
</div>
<div v-else>
<el-form-item style="display: none" label="分单号" prop="awbh">
<el-input v-model="ruleForm.awbh"></el-input>
</el-form-item>
</div>
</el-col>
<el-col :span="6">
<el-form-item label="航班号" prop="flightno">
<el-input disabled="" v-model="ruleForm.flightno"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="航班日期" required>
<el-col :span="24">
<el-form-item prop="flightdate">
<el-date-picker disabled="" type="date" placeholder="选择日期" :clearable="false"
v-model="ruleForm.flightdate"
style="width: 100%;"></el-date-picker>
</el-form-item>
</el-col>
</el-form-item>
</el-col>
</el-row>
<el-row class="flightInfo">
<el-col :span="6">
<el-form-item label="起始站" prop="originstation">
<el-input disabled="" v-model="ruleForm.originstation"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="目的站" prop="destinationstation">
<el-input disabled="" v-model="ruleForm.destinationstation"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-button size="mini" type="primary" @click="dialogStatus==='create'?createData('ruleForm'):updateData('ruleForm')" style="float: right">保存</el-button>
</el-col>
</el-row>
</el-row>
<!--货物信息部分-->
<el-row class="flightInfo">
<el-col :span="24">
<div class="grid-content content">货物信息</div>
</el-col>
</el-row>
<el-row style="margin-bottom: 0px;">
<el-row class="product">
<el-col :span="6">
<el-form-item label="舱单件数" prop="pcs">
<el-input v-model="ruleForm.pcs"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="舱单重量" prop="wei">
<el-input v-model="ruleForm.wei"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="理货件数" prop="piece">
<el-input v-model="ruleForm.piece"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="理货重量" prop="weight">
<el-input v-model="ruleForm.weight"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-row>
<el-row class="flightInfo">
<el-col :span="6">
<el-form-item label="海关关区" prop="customcode">
<el-select v-model="ruleForm.customcode" placeholder="" style="display:inline">
<el-option v-for="(item,index) in customcodes" :key="index" :label="item.label"
:value="item.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="卸货时间" required>
<el-col :span="24">
<el-form-item prop="starttime">
<el-date-picker type="datetime" placeholder="选择日期" :clearable="false" value-format="yyyy-MM-dd HH:mm:ss"
v-model="ruleForm.starttime"
style="width: 100%;"></el-date-picker>
</el-form-item>
</el-col>
</el-form-item>
</el-col>
</el-row>
<!--分单信息部分-->
<el-row class="flightInfo">
<el-col :span="24">
<div class="grid-content content" v-if="dialogStatus === 'update'">
<span>分单信息</span>
<el-button type="primary" v-on:click="addFen('ruleForm')" size="mini">新增分单</el-button>
</div>
<div class="grid-content content" v-else>
<span>分单信息</span>
<el-button type="primary" disabled="" @click="innerVisible = true" size="mini">新增分单</el-button>
</div>
</el-col>
</el-row>
<!--分单列表-->
<el-row>
<el-col :span="24">
<template>
<el-table
:data="tableData2"
style="width: 100%">
<el-table-column
prop="awbh"
label="分单号"
width="250">
</el-table-column>
<el-table-column
prop="piece"
label="舱单件数"
width="200">
</el-table-column>
<el-table-column
prop="weight"
label="舱单重量"
width="200">
</el-table-column>
<el-table-column
prop="goodsname"
label="卸货时间"
width="250">
</el-table-column>
<el-table-column
fixed="right"
label="操作"
width="230">
<template slot-scope="scope">
<el-button @click="handleClick(scope.row)" type="text" size="small">编辑
</el-button>
<el-button @click="handleClick(scope.row)" type="text" size="small">删除
</el-button>
</template>
</el-table-column>
</el-table>
</template>
</el-col>
</el-row>
</el-form>
</el-dialog>
<!--底部按钮及理货信息-->
<el-row>
<el-col :span="2.5"><div class="grid-content"><el-button type="primary" v-on:click="addTally" size="mini">新增进港理货</el-button></div></el-col>
<el-col :span="2.5"><div class="grid-content"><el-button type="primary" size="mini">批量发送删除报</el-button></div></el-col>
<el-col :span="2"><div class="grid-content"><el-button type="primary" size="mini">返回</el-button></div></el-col>
<el-col :span="2.5"><div class="grid-content"><span>主单数:{{sumNmmsCount}}</span></div></el-col>
<el-col :span="3.5"><div class="grid-content"><span>理货总件数:{{sumNmmsPrice}}</span></div></el-col>
<el-col :span="4"><div class="grid-content"><span>理货总重量:{{sumNmmsWeight}}</span></div></el-col>
</el-row>
<!--对话提示框-->
<el-row>
<el-dialog
title="系统提示"
:visible.sync="centerDialogVisible"
width="30%"
center>
<span>{{msg}}</span>
<span slot="footer" class="dialog-footer">
<el-button @click="centerDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="centerDialogVisible = false">确 定</el-button>
</span>
</el-dialog>
</el-row>
</el-main>
</el-container>
</template>
<style scoped>
.grid-content{height: 36px;line-height: 36px;margin-right: 5px;}
.content{border-left: 4px #409EFF solid;padding-left: 10px;background-color: #f9fafc;margin-bottom: 2px}
.row-bg,.co{background-color: white;}
span{font-weight: bold;margin-right: 35px;}
.el-table td,.el-table th{text-align: center}
.flightInfo {
margin-bottom: 0px
}
.el-form-item {
margin-bottom: 2px;
}
.flightInfo {
margin-bottom: 3px
}
.el-dialog__body {
padding: 10px 20px;
}
.el-col {
margin-right: 0px
}
.product {
margin-bottom: 5px;
}
.pub {
margin-right: 10px;
}
</style>
<script>
import { getMt5201List,addMt5201,ediMt5201,delMt5201} from '../../api/mt5201'
export default {
data() {
return {
defaultQuery:{
flightno:undefined,
flightdate:undefined,
originstation:undefined,
destinationstation:undefined,
awba:undefined
},
tableData: [],
tableData2: [],
multipleSelection: [],
outerVisible: false,
dialogStatus:'',
labelPosition: 'left',
textMap:{
update: '编辑',
create: '添加'
},
customcodes:[
{
value: '-1',
label: '请选择'
},
{
value: '4604',
label: '4604'
},
{
value: '4620',
label: '4620'
},
{
value: '4613',
label: '4613'
}],
ruleForm:{
awba:undefined,
awbh:undefined,
carrier:undefined,
flightno:undefined,
flightdate:undefined,
originstation:undefined,
destinationstation:undefined,
piece:undefined,
weight:undefined,
starttime:undefined,
endtime:undefined,
customcode:"-1",
goodsname:undefined,
actime:undefined,
rcfdep:"MT5201",
status:undefined,
isdelete:undefined,
pcs:undefined,
wei:undefined
},
FenStatus:'',
rules: {
awba: [{required: true, message: '请输入运单号', trigger: 'blur'}],
flightno: [{required: true, message: '航班号必须输入', trigger: 'blur'}],
flightdate: [{required: true, message: '航班日期必须选择', trigger: 'blur'}],
originstation: [{required: true, message: '航段必须输入', trigger: 'blur'}],
piece: [{required: true, message: '舱单件数必须输入且为数字', trigger: 'blur'}],
weight: [{required: true, message: '舱单重量必须输入且为数字', trigger: 'blur'}],
customcode:[{required: true, message: '海关关区必须选择', trigger: 'change'}],
goodsname:[{required: true, message: '货物描述必须填写', trigger: 'blur'}],
starttime: [{required: true, message: '卸货时间必须选择', trigger: 'blur'}]
},
centerDialogVisible:false,
msg:'',
sumNmmsCount:0,
sumNmmsPrice:0,
sumNmmsWeight:0,
}
},
methods: {
//批量选中事件
handleSelectionChange(val) {
this.multipleSelection = val;
},
//编辑主单
handleMain(index,row){
this.outerVisible = true;
this.dialogStatus='update';
this.FenStatus='ediAwbh';
this.ruleForm=row;
},
//编辑分单
handleFen(index,row){
this.outerVisible = true;
this.dialogStatus='update';
this.FenStatus='addAwbh';
this.ruleForm=row;
this.ruleForm.flightno=row.carrier+row.flightno;
},
//新增分单
addFen(formName){
this.dialogStatus="create";
this.outerVisible = true;
this.FenStatus='addAwbh';
},
//获取默认值
getDefaultData(){
this.defaultQuery.flightno=this.$route.params.flightno;
this.defaultQuery.flightdate=this.$route.params.flightdate;
this.defaultQuery.originstation=this.$route.params.originstation;
this.defaultQuery.destinationstation=this.$route.params.destinationstation;
},
//获取进港理货列表
getMt5201List(){
getMt5201List(this.defaultQuery).then(res =>{
this.sumNmmsCount=0;
this.sumNmmsPrice=0;
this.sumNmmsWeight=0;
let response=res.data.data;
this.tableData=response;
response.forEach((item,i) => {
if(item.awba!=null&&item.awbh=="");
this.sumNmmsCount=Number(this.sumNmmsCount)+1;
this.sumNmmsPrice=Number(this.sumNmmsPrice)+Number(item.piece);
this.sumNmmsWeight=Number(this.sumNmmsWeight)+Number(item.weight);
})
});
},
//新增理货按钮事件
addTally(){
this.outerVisible = true;
this.dialogStatus="create";
this.FenStatus='ediAwbh';
this.ruleForm.flightno=this.$route.params.flightno;
this.ruleForm.flightdate=this.$route.params.flightdate;
this.ruleForm.originstation=this.$route.params.originstation;
this.ruleForm.destinationstation=this.$route.params.destinationstation;
},
//新增原始舱单数据
createData(formName){
this.$refs[formName].validate((valid) => {
if (valid) {
addMt5201(this.ruleForm).then(res=>{
let response=res.data;
this.code=response.code;
if(this.code=='200'){
this.outerVisible = false;
this.$refs[formName].resetFields();
this.centerDialogVisible=true;
this.msg=response.msg;
this.getMt5201List();
}else{
this.outerVisible = false;
this.centerDialogVisible=true;
this.$refs[formName].resetFields();
this.msg=response.msg;
}
});
} else {
console.log('error submit!!');
return false;
}
});
},
//修改进港理货数据
updateData(formName){
this.$refs[formName].validate((valid) => {
if (valid) {
ediMt5201(this.ruleForm).then(res=>{
let response=res.data;
this.code=response.code;
if(this.code=='200'){
this.outerVisible = false;
this.centerDialogVisible=true;
this.msg=response.msg;
this.getMt5201List();
}else{
this.outerVisible = false;
this.centerDialogVisible=true;
this.msg=response.msg;
}
});
} else {
console.log('error submit!!');
return false;
}
});
},
},
//渲染方法
mounted(){
this.getDefaultData();
this.getMt5201List();
}
}
</script>