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
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
<template>
<view class="detail wrap">
<view class="detail-bg"></view>
<view class="detail-main" v-if="boxInfo">
<view class="items items-border">
<view class="items-lf">
<image src="../../static/images/no.png" mode=""></image>
<text>{{$t('自编号')}}:</text>
</view>
<view class="items-rf">{{boxInfo.selfNo}}</view>
</view>
<!-- <view class="items">
<view class="items-lf">
<image src="../../static/images/xiegui-2.png" mode=""></image>
<text>{{$t('货柜号')}}:</text>
</view>
<view class="items-rf">{{boxInfo.cubNo}}</view>
</view> -->
<view class="items items-border">
<view class="items-lf">
<image src="../../static/images/xiegui-3.png" mode=""></image>
<text>{{$t('运输方式')}}:</text>
</view>
<view class="items-rf">
<dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="boxInfo.transportType" />
</view>
</view>
<!-- <view class="items items-border">-->
<!-- <view class="items-lf">-->
<!-- <image src="../../static/images/xiegui-4.png" mode=""></image>-->
<!-- <text>{{$t('柜型')}}:</text>-->
<!-- </view>-->
<!-- <view class="items-rf">{{boxInfo.cabinetRespVO ? boxInfo.cabinetRespVO.name : ''}}</view>-->
<!-- </view>-->
<view class="items items-border" v-if="boxInfo.transportType == 3 || boxInfo.transportType == 4">
<view class="items-lf">
<image src="../../static/images/xiegui-5.png" mode=""></image>
<text>{{$t('出货渠道')}}:</text>
</view>
<view class="items-rf">{{boxInfo.channelRespVO.nameZh}}</view>
</view>
<view class="items items-border">
<view class="items-lf">
<image src="../../static/images/xiegui-6.png" mode=""></image>
<text>{{$t('始发地')}}:</text>
</view>
<view class="items-rf">{{boxInfo.startWarehouseResp[isChinese ? 'titleZh' : 'titleEn']}}</view>
</view>
<view class="items">
<view class="items-lf">
<image src="../../static/images/xiegui-7.png" mode=""></image>
<text>{{$t('目的地')}}:</text>
</view>
<view class="items-rf">{{boxInfo.destWarehouseResp.titleZh}}</view>
</view>
<view class="items items-border">
<view class="items-lf">
<image src="../../static/images/xiegui-8.png" mode=""></image>
<text>{{$t('方数')}}({{$t('已装/已卸')}}):</text>
</view>
<view class="items-rf">{{boxInfo.boxStatistics.loadVolume}}/{{boxInfo.boxStatistics.unloadVolume}}</view>
</view>
<view class="items items-border">
<view class="items-lf">
<image src="../../static/images/xiegui-9.png" mode=""></image>
<text>{{$t('重量')}}({{$t('已装/已卸')}}):</text>
</view>
<view class="items-rf">{{boxInfo.boxStatistics.loadWeight}}/{{boxInfo.boxStatistics.unloadWeight}}</view>
</view>
<view class="items items-border">
<view class="items-lf">
<image src="../../static/images/xiegui-10.png" mode=""></image>
<text>{{$t('状态')}}:</text>
</view>
<view class="items-rf">{{boxInfo.shipmentStatusText}}</view>
</view>
<view class="items items-border">
<view class="items-lf">
<image src="../../static/images/xiegui-11.png" mode=""></image>
<text>{{$t('单证状态')}}:</text>
</view>
<view class="items-rf" v-if="boxInfo.documentInfo">
<dict-tag :type="DICT_TYPE.ECW_CUSTOMS_TYPE" :value="boxInfo.documentInfo" />
</view>
<view class="items-rf" v-else>/</view>
</view>
<view class="items" v-if="boxInfo.customsInfo&&boxInfo.customsInfo.overMachineStatus==2&&boxInfo.customsInfo.overMachineAbnormalStatus==2">
<view class="items-lf">
<image src="../../static/images/xiegui-5.png" mode=""></image>
<text style="color:#D9001B;width:90%" v-if="boxInfo.customsInfo.weightMisreport==1">
{{$t('过机重量异常')}}:{{$t('机场误差3%以内')}}
</text>
<text style="color:#D9001B;width:90%" v-if="boxInfo.customsInfo.weightMisreport==2">
{{$t('过机重量异常')}}:{{$t('我司误差超10kg')}}
</text>
<text style="color:#D9001B;width:90%" v-if="boxInfo.customsInfo.overWeight>0">
{{$t('过机重量异常')}}:{{$t('超过机场重量')}}{{boxInfo.customsInfo.overWeight}}kg
</text>
</view>
</view>
</view>
<view class="detail-order">
<view class="detail-order-title">
<view class="detail-order-title-lf">
<image src="../../static/images/xiegui-12.png" mode=""></image>
<text>{{$t('订单列表')}}</text>
</view>
<view class="detail-order-tab-rf" @click="allOrderUnload">
<image src="../../static/images/yijian.png" mode=""></image>
<text>{{$t('一键到仓')}}</text>
</view>
</view>
<template v-for="(i, v) in loadDetail">
<template v-if="i.sectionOrderList && i.sectionOrderList.length > 0">
<view class="detail-order-tab">
<view class="detail-order-tab-lf">{{$t("第{k}部分", {k: v+1})}}</view>
</view>
<view class="detail-order-items" v-for="(item, index) in i.sectionOrderList">
<view class="detail-order-items-no">{{$t('序号')}}:{{index+1}}</view>
<view :class="item.exceptionList ? 'detail-order-items-list no-border-bottom' : 'detail-order-items-list'">
<view class="detail-order-items-list-v">
<view class="">{{$t('订单号')}}: {{item.orderNo}}</view>
<view class="">{{$t('实装箱数')}}/{{$t('已卸箱数')}}: {{item.installNum}}/{{item.unloadNum}}</view>
<view class="">{{$t('提货点')}}: {{item.destWarehouseName}}</view>
<view class="">{{$t('重量')}}: {{item.weight}}</view>
<view class="">
{{$t('报关方式')}}:
<dict-tag :type="DICT_TYPE.ECW_CUSTOMS_TYPE" :value="item.customsType" />
</view>
</view>
<view class="detail-order-items-list-v">
<view class="">
{{$t('货物信息')}}:
<template>
<text v-for="(itm, idx) in item.goodsList">{{index + 1}}.{{itm.prodTitleZh}}</text>
</template>
</view>
<view class="">
<template v-if="item.unloadNum < 1">
{{$t('状态')}}: {{$t('待到仓')}}
<template v-if="item.exceptionList">,<text class="errorText">{{$t('存在异常')}}</text></template>
</template>
<template v-if="item.unloadNum > 1 && item.unloadNum < item.installNum">
{{$t('状态')}}: {{$t('部分到仓')}}
<template v-if="item.exceptionList">,<text class="errorText">{{$t('存在异常')}}</text></template>
</template>
<template v-if="item.unloadNum >= item.installNum">
{{$t('状态')}}: {{$t('已到仓')}}
<template v-if="item.exceptionList">,<text class="errorText">{{$t('存在异常')}}</text></template>
</template>
</view>
<view class="">{{$t('体积')}}: {{item.volume}}</view>
<view class="">{{$t('货值')}}: {{item.totalWorth}}</view>
<view class="">{{$t('报关费用')}}: {{item.customsFee}}</view>
</view>
</view>
<view class="detail-order-item-btns">
<view class="" @click="unloadApply(item)">{{$t('到仓')}}</view>
<view class="" @click="orderModelToggle(item.orderId, v, index)">{{$t('异常')}}</view>
</view>
</view>
</template>
</template>
<view class="detail-order-time">
<view class="detail-order-time-lf">
<image src="../../static/images/err-2.png" mode=""></image>
<text><span style="color: red">*</span>{{$t('到仓时间')}}</text>
</view>
<view class="detail-order-time-rf">
<leeDatetime @change="bindLeeDateTimeChange" :field="'ulBoxTime'" :placeholder="$t('请选择日期时间')" :value="date.ulBoxTime"></leeDatetime>
</view>
</view>
<view class="detail-order-title">
<image src="../../static/images/xiegui-13.png" mode=""></image>
<text>{{$t('到仓影像')}}</text>
</view>
<view class="img-wrap">
<uni-grid :column="4" :highlight="true" :show-border="false">
<uni-grid-item v-for="(item, index) in imageList" :index="index" :key="index">
<view class="grid-item-box" style="height: 100%;position: relative;">
<image :src="iconpath" style="position: absolute;top:4px;right:4px;height:24px;width:24px;z-index:9" @tap="delimage(index)" mode="widthFix"></image>
<image v-if="item.type === 'image'" :src="item.url" mode="scaleToFill" style="height: 100%" @tap="previewImage(item.url)" />
<video v-else-if="item.type === 'video'" :id="`video_${index}`" style="width: 100%;height: 100%" :src="item.url" @play="playVideo(index)" @tap="playVideo(index)" @fullscreenchange="fullscreenchange"></video>
</view>
</uni-grid-item>
<uni-grid-item>
<view class="grid-item-box" style="height: 100%">
<view class="grid-item-box-add" @tap="chooseVideoImage">
<uni-icons type="plusempty" size="30" color="#eae8eb"></uni-icons>
<!-- <text>添加视频或图片</text> -->
</view>
</view>
</uni-grid-item>
</uni-grid>
</view>
</view>
<view class="detailbtns">
<view class="">
<text @click="shipmentModelToggle">{{$t('转异')}}</text>
</view>
<view class="">
<text @click="allUnloadReply">{{$t('完成全部到仓')}}</text>
</view>
</view>
<!-- 订单异常柜型弹窗 -->
<view class="cu-modal" :class="orderModel ? 'show' : ''" style="z-index: 999;">
<view class="cu-main">
<view class="cu-title">{{$t('异常')}}</view>
<view class="cu-tips">
<image src="../../static/images/zhyi.png" mode=""></image>
<text>{{$t('异常类型')}}</text>
</view>
<view class="cu-reson">
<view class="" v-for="(i, v) in shippingUnloadingError" @click="shippingUnloadingChoose(i.value)">
<image :src="shippingUnloadingValue == i.value ? '../../static/images/radio-true.png' : '../../static/images/radio-false.png'" mode=""></image>
<text>{{i.label}}</text>
</view>
</view>
<view class="cu-goods-view">
<view class="cu-goods">
<image src="../../static/images/pinm.png" mode=""></image>
<text>{{$t('品名')}}</text>
</view>
<view class="cu-select">
<picker :value="goodsIndex" :range="goodsData" @change="goodsChange" v-if="goodsData.length > 0">
<view class="uni-input">{{goodsData[goodsIndex]}}</view>
</picker>
</view>
</view>
<view class="cu-goods-view">
<view class="cu-goods">
<image src="../../static/images/number.png" mode=""></image>
<text>{{$t('件数')}}</text>
</view>
<view class="cu-select">
<input type="number" v-model="productNum" :placeholder="$t('请输入件数')">
</view>
</view>
<view class="cu-goods-view no-border-bottom">
<view class="cu-goods-info">
<image src="../../static/images/yichang.png" mode=""></image>
<text>{{$t('异常详情')}}</text>
</view>
<view class="cu-goods-textarea">
<textarea name="" v-model="exceptionDetail"></textarea>
</view>
</view>
<view class="cu-btns">
<view class="">
<text @click="unloadCabinetOrderCreate">{{$t('提交')}}</text>
</view>
<view class="">
<text @click="orderModelToggle()">{{$t('关闭')}}</text>
</view>
</view>
</view>
</view>
<!-- 货柜异常柜型弹窗 -->
<view class="cu-modal" :class="shipmentModel ? 'show' : ''" style="z-index: 999;">
<view class="cu-main" style="top: 10%">
<view class="cu-title">{{$t('转异')}}</view>
<view class="cu-goods-view no-border-bottom">
<view class="cu-goods">
<image src="../../static/images/err-1.png" mode=""></image>
<text>{{$t('操作步骤')}}</text>
</view>
<view class="cu-select">
<picker :value="shippingProcessIndex" :range="shippingProcessData" @change="shippingProcessChange" v-if="shippingProcessData.length > 0">
<view class="uni-input">
<text>{{shippingProcessData[shippingProcessIndex]}}</text>
<image src="../../static/images/rgt.png" mode=""></image>
</view>
</picker>
</view>
</view>
<view class="cu-goods-view no-border-bottom">
<view class="cu-goods">
<image src="../../static/images/pinm.png" mode=""></image>
<text>{{$t('票异常')}}</text>
</view>
<view class="cu-select">
<picker :value="ticketIndex" :range="ticketData" @change="ticketChange" v-if="ticketData.length > 0">
<view class="uni-input">
<text>{{ticketData[ticketIndex]}}</text>
<image src="../../static/images/rgt.png" mode=""></image>
</view>
</picker>
</view>
</view>
<view class="cu-goods-view no-border-bottom">
<view class="cu-goods">
<image src="../../static/images/err-2.png" mode=""></image>
<text>{{$t('异常开始时间')}}</text>
</view>
<view class="cu-date">
<leeDatetime @change="bindLeeDateTimeChange" :field="'abnStartTime'" :placeholder="$t('请选择日期时间')" :value="date.abnStartTime"></leeDatetime>
</view>
</view>
<view class="cu-goods-view no-border-bottom">
<view class="cu-goods">
<image src="../../static/images/err-2.png" mode=""></image>
<text>{{$t('异常结束时间')}}</text>
</view>
<view class="cu-date">
<leeDatetime @change="bindLeeDateTimeChange" :field="'abnEndTime'" :placeholder="$t('请选择日期时间')" :value="date.abnEndTime"></leeDatetime>
</view>
</view>
<view class="cu-goods-view no-border-bottom">
<view class="cu-goods">
<image src="../../static/images/err-3.png" mode=""></image>
<text>{{$t('是否更新动态')}}</text>
</view>
<view class="cu-select">
<radio-group @change="orderStatusChange" >
<label class="radio" v-for="(i, v) in orderStatusData" style="margin-left: 20upx;display: flex;align-items: center;float: left;">
<radio :value="i.value" :checked="i.value === orderStatus" color="#FDB23D" style="transform:scale(0.6);margin-bottom: 0upx" />
<text>{{i.label}}</text>
</label>
</radio-group>
</view>
</view>
<view class="cu-goods-view no-border-bottom">
<view class="cu-goods-info">
<image src="../../static/images/yichang.png" mode=""></image>
<text>{{$t('异常情况')}}</text>
</view>
<view class="cu-goods-textarea">
<textarea name="" v-model="abnDetail"></textarea>
</view>
</view>
<view class="cu-goods-view no-border-bottom">
<view class="cu-goods-info">
<image src="../../static/images/yichang.png" mode=""></image>
<text>{{$t('中文内容')}}</text>
</view>
<view class="cu-goods-textarea">
<textarea name="" v-model="contentZh"></textarea>
</view>
</view>
<view class="cu-goods-view no-border-bottom">
<view class="cu-goods-info">
<image src="../../static/images/yichang.png" mode=""></image>
<text>{{$t('英文内容')}}</text>
</view>
<view class="cu-goods-textarea">
<textarea name="" v-model="contentEn"></textarea>
</view>
</view>
<view class="cu-btns">
<view class="">
<text @click="boxAbnormalCreate">{{$t('提交')}}</text>
</view>
<view class="">
<text @click="shipmentModelToggle">{{$t('关闭')}}</text>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import leeDatetime from "@/components/lee-datetime/lee-datetime.vue"
import * as types from '../../store/mutations-types.js';
import { uniLoadMore } from '@dcloudio/uni-ui';
import { cabinetUnloadDetail } from './api';
import { unloadCabinetOrder } from './api';
import { boxAbnormal } from './api';
import { allUnload } from './api';
import { unloadApply } from './api';
import { appSecret, apiBaseUrl } from '../../util/config.js'
import { updateImg } from '@/api/system';
import iconpath from '../../static/images/close.png'
export default {
name: 'detail',
components: { uniLoadMore, leeDatetime },
data() {
return {
boxInfo: null,
loadDetail: [],
iconpath:iconpath,
cabinetUnloadInfo: null,
shipmentId: 0,
page: 1,
loadDetailIndex: '', // 哪笔订单异常
sectionOrderListIndex: '', // 哪笔订单异常
shippingUnloadingError: [], //订单异常
shippingUnloadingValue: '', //订单异常值
orderModel: false, //订单异常弹框
orderId: 0, //异常订单ID
goodsData: [], //品名
goodsIndex: 0,
goodsIds: [],
productNum: '', //件数
exceptionDetail: '', //异常详情
// shippingTicketException: [], //票异常
ticketData: [], //票异常标签
ticketIndex: 0, //票异常索引
ticketValue: [], //票异常值
// shippingProcess: [], //步骤
shippingProcessData: [], //步骤
shippingProcessIndex: 0, //步骤索引
shippingProcessValue: [], //步骤值
shipmentModel: false,
date: {
abnStartTime: '', //异常开始时间
abnEndTime: '', //异常结束时间
ulBoxTime: '', //入仓时间
},
orderStatusData: [{label: this.$t('是'), value: '1'}, {label: this.$t('否'), value: '2'}],
contentZh: '', //中文内容,
contentEn: '', //英文内容,
abnDetail: '', //票异常详情
orderStatus: '', //是否更新订单状态
ulBoxTime: '', //整体提交时间
imageList: [], //整体提交图片,
}
},
onLoad (op) {
uni.setNavigationBarTitle({
title:this.$t('出货单详情')
})
this.shipmentId = op.shipmentId || 0
this.shippingUnloadingError = this.$store.getters.dict_datas.shipping_unloading_error
},
onShow () {
this.getDetail()
},
onPullDownRefresh() {
},
onReachBottom() {
},
methods: {
//一键卸柜
allOrderUnload () {
let t = this
let params = {shipmentId: this.shipmentId}
uni.showModal({
title: this.$t('提示'),
content: this.$t('确定一键卸柜操作'),
success: function (res) {
if (res.confirm) {
allUnload(params).then(res => {
if(res > 0){
uni.showModal({
title: this.$t('提示'),
content: res.msg || this.$t('操作成功'),
showCancel: false,
success: function (res) {
if (res.confirm) {
t.getDetail()
}
}
})
} else {
uni.showToast({
title: res.msg || this.$t('操作失败'),
icon: 'none'
})
}
})
}
}
})
},
delimage(index){
this.imageList.splice(index,1)
},
//订单卸柜
unloadApply (ob) {
uni.navigateTo({
url: '/pages/unloadCabinet/apply?orderId=' + ob.orderId + '&shipmentId=' + this.shipmentId
})
},
getDetail () {
cabinetUnloadDetail(this.shipmentId).then(res => {
console.log('111', res)
this.boxInfo = res.boxInfo
this.loadDetail = res.loadDetail
this.cabinetUnloadInfo = res.cabinetUnloadInfo || null
if(res.cabinetUnloadInfo) {
this.imageList = res.cabinetUnloadInfo.ulImgs ? res.cabinetUnloadInfo.ulImgs.split(',').map((srcStr)=>{
return {
type:"image",
url:srcStr
}
}) : [];
}
})
},
//订单异常显示
orderModelToggle (id, idx1 = -1, idx2 = -1) {
this.orderModel = !this.orderModel
this.orderId = id || 0
this.shippingUnloadingValue = ''
this.loadDetailIndex = idx1 || ''
this.sectionOrderListIndex = idx2 || ''
if(idx1 >= 0 && idx2 >= 0){
if(this.loadDetail[idx1].sectionOrderList[idx2]){
for(let i = 0; i < this.loadDetail[idx1].sectionOrderList[idx2].goodsList.length; i++){
this.goodsData.push(this.loadDetail[idx1].sectionOrderList[idx2].goodsList[i].prodTitleZh)
this.goodsIds.push(this.loadDetail[idx1].sectionOrderList[idx2].goodsList[i].orderItemId)
}
}
} else {
this.goodsData = []
this.goodsIds = []
this.productNum = ''
this.exceptionDetail = ''
}
},
shippingUnloadingChoose (e) {
this.shippingUnloadingValue = e
},
goodsChange (e) {
this.goodsIndex = e.detail.value
console.log('goodsid', this.goodsIds[this.goodsIndex])
},
//提交异常
unloadCabinetOrderCreate () {
if(this.shippingUnloadingValue == ''){
return uni.showToast({
title: this.$t('请选择异常类型'),
icon: 'error',
})
}
if(this.productNum == ''){
return uni.showToast({
title: this.$t('请输入件数'),
icon: 'error',
})
}
// if(this.exceptionDetail == ''){
// return uni.showToast({
// title: '请输入异常详情',
// icon: 'error',
// })
// }
let params = {
exceptionDetail: this.exceptionDetail,
exceptionType: this.shippingUnloadingValue,
orderId: this.orderId,
productId: this.goodsIds[this.goodsIndex],
productNum: this.productNum,
shipmentId: this.shipmentId
}
let t = this
unloadCabinetOrder(params).then(res => {
if(res > 0){
uni.showModal({
title: this.$t('提示'),
content: res.msg || this.$t('提交异常成功'),
showCancel: false,
success: function (res) {
if (res.confirm) {
t.orderModelToggle()
t.getDetail()
}
}
})
} else {
uni.showToast({
title: res.msg || this.$t('提交失败'),
icon: 'none'
})
}
})
},
//货柜异常
shipmentModelToggle() {
const shippingTicketException = this.$store.getters.dict_datas.shipping_ticket_exception
const shippingProcess = this.$store.getters.dict_datas.air_shipment_process
this.shipmentModel = !this.shipmentModel;
if(this.ticketData.length == 0){
for(let i = 0; i < shippingTicketException.length; i++){
this.ticketData.push(this.$lang.locale=='zh-Hans'? shippingTicketException[i].label:shippingTicketException[i].labelEn)
this.ticketValue.push(shippingTicketException[i].value)
}
}
if(this.shippingProcessData.length == 0){
for(let i = 0; i < shippingProcess.length; i++){
this.shippingProcessData.push(this.$lang.locale=='zh-Hans'?shippingProcess[i].label:shippingProcess[i].labelEn)
this.shippingProcessValue.push(shippingProcess[i].value)
}
}
if(!this.shipmentModel){
this.shippingProcessIndex = 0;
this.ticketIndex = 0;
this.orderStatus = '';
this.abnDetail = ''
this.contentEn = ''
this.contentZh = ''
}
},
ticketChange (e) {
this.ticketIndex = e.detail.value
},
shippingProcessChange (e) {
this.shippingProcessIndex = e.detail.value
},
bindLeeDateTimeChange (e) {
console.log(e)
this.date[e.field] = e.value
},
orderStatusChange (e) {
this.orderStatus = e.detail.value
},
boxAbnormalCreate () {
if(this.date.abnStartTime == ''){
return uni.showToast({
title: this.$t('请选择开始时间'),
icon: 'error',
})
}
if(this.date.abnEndTime == ''){
return uni.showToast({
title: this.$t('请选择结束时间'),
icon: 'error',
})
}
if(this.orderStatus == ''){
return uni.showToast({
title: this.$t('请选择是否更新动态'),
icon: 'error',
})
}
if(this.abnDetail == ''){
return uni.showToast({
title: this.$t('请输入异常详情'),
icon: 'error',
})
}
if(this.contentZh == ''){
return uni.showToast({
title: this.$t('请输入中文内容'),
icon: 'error',
})
}
if(this.contentEn == ''){
return uni.showToast({
title: this.$t('请输入英文内容'),
icon: 'error',
})
}
let params = {
abnDetail: this.abnDetail,
abnStartTime: this.date.abnStartTime,
abnEndTime: this.date.abnEndTime,
billAbnId: this.ticketValue[this.ticketIndex],
opStep: this.shippingProcessValue[this.shippingProcessIndex],
contentEn: this.contentEn,
contentZh: this.contentZh,
orderStatus: this.orderStatus,
shipmentId: this.shipmentId
}
let t = this
boxAbnormal(params).then(res => {
console.log(res)
if(res > 0){
uni.showModal({
title: this.$t('提示'),
content: res.msg || this.$t('提交异常成功'),
showCancel: false,
success: function (res) {
if (res.confirm) {
t.shipmentModelToggle()
t.getDetail()
}
}
})
} else {
uni.showToast({
title: res.msg || this.$t('提交失败'),
icon: 'none'
})
}
})
},
chooseVideoImage() {
uni.showActionSheet({
title: this.$t('选择上传类型'),
itemList: [this.$t('图片')/* , this.$t('视频') */],
success: res => {
console.log(res);
if (res.tapIndex == 0) {
this.chooseImages(true);
} else {
this.chooseVideo();
}
}
});
},
//上传图片
chooseImages(flag) {
uni.chooseImage({
count: 9, //默认是9张
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], //从相册选择
success: res => {
console.log(res, 'ddddsss')
let imgFile = res.tempFilePaths;
imgFile.forEach((item, index) => {
updateImg(item).then(data => {
console.log(data, '--------res--------');
if (flag) {
// const type = res.tempFiles[index].type.split('/')[0]
this.imageList.push({ type:'image', url: data.data })
}
})
})
}
})
},
//上传视频
chooseVideo(index) {
uni.chooseVideo({
maxDuration: 60, //拍摄视频最长拍摄时间,单位秒。最长支持 60 秒
count: 9,
success: res => {
let videoFile = res.tempFilePath;
console.log(res, 'ddddsss')
updateImg(videoFile).then(data => {
// const type = res.tempFile.type.split('/')[0]
this.imageList.push({ type:'video', url: data.data })
})
},
fail:(error)=>{
uni.hideLoading();
uni.showToast({
title: error,
icon: 'none'
})
}
})
},
previewImage(url) {
//uniapp预览轮播图
uni.previewImage({
current: 0, //预览图片的下标
urls: [url] //预览图片的地址,必须要数组形式,如果不是数组形式就转换成数组形式就可以
})
},
playVideo(index) {
setTimeout(() => {
this.videoContext = uni.createVideoContext(`video_${index}`)
this.videoContext.play()
this.videoContext.requestFullScreen()
}, 500)
},
fullscreenchange(event) {
if (!event.detail.fullScreen) {
this.videoContext.pause()
}
},
//提交整体卸柜
allUnloadReply () {
if(this.date.ulBoxTime == ''){
return uni.showToast({
title: this.$t('请选择到仓时间'),
icon: 'error',
})
}
// if(this.imageList.length == 0){
// return uni.showToast({
// title: '请上传卸柜影像',
// icon: 'error',
// })
// }
let ulImgs = []
this.imageList.forEach((item, index) => {
ulImgs.push(item.url)
})
let params = {
ulBoxTime: this.date.ulBoxTime,
ulImgs: ulImgs.join(','),
shipmentId: this.shipmentId
}
//有提交则带入ID
if(this.cabinetUnloadInfo) {
params.id = this.cabinetUnloadInfo.id
}
let t = this
unloadApply(params).then(res => {
if(res > 0){
uni.showModal({
title: this.$t('提示'),
content: res.msg || this.$t('操作成功'),
showCancel: false,
success: function (res) {
if (res.confirm) {
// t.getDetail()
setTimeout(() => {
uni.redirectTo({
url: "./list",
});
}, 500);
}
}
})
} else {
uni.showToast({
title: res.msg || this.$t('操作失败'),
icon: 'none'
})
}
})
}
},
computed: {
isChinese(){
return uni.getLocale() === 'zh-Hans'
}
}
}
</script>
<style>
@import url(../unloadCabinet/detail.css);
</style>