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
<template>
<el-dialog :title="title" visible :before-close="closeDialog" :close-on-click-modal="false" v-loading="loading">
<el-timeline v-if="list.length">
<el-timeline-item v-for="item in list" :timestamp="item.pickTime|parseTime" placement="top" :key="item.id">
<div> {{item.deleted ? $t('已撤销') : $t('已提货')}} <el-button v-if="!item.deleted" :disabled="loading" size="mini" @click="deletePickup(item.id)" class="ml-10">{{$t('撤销')}}</el-button></div>
<div>{{$t('提货箱数')}}:{{item.pickNum}}箱</div>
<div>{{$t('操作人')}}:{{item.creator}}</div>
<div v-if="item.deleted">{{$t('撤销人')}}:{{item.updater}}</div>
</el-timeline-item>
</el-timeline>
<el-empty v-if="!loading && !list.length" :description="$t('暂无提货日志')"></el-empty>
</el-dialog>
</template>
<script>
import {deletePickup, getAllPickUpListByOrderNo} from '@/api/ecw/orderPickup'
import {parseTime} from '@/utils/ruoyi'
export default {
filters: {parseTime},
props:{
orderNo: String
},
data(){
return {
show: false,
list:[],
loading: false
}
},
computed:{
title(){
return this.$t('提货日志') + '-' + this.orderNo
}
},
created(){
this.getList()
},
methods:{
getList(){
this.loading = true
getAllPickUpListByOrderNo({orderNo: this.orderNo}).then(res => {
this.list = res.data
})
.finally(() => {
this.loading = false
})
},
deletePickup(id){
this.$confirm('确定要撤销此提货么?').then(res => {
return deletePickup({id})
}).then(res => {
this.$message.success('操作成功')
this.$emit('delete', id)
this.getList()
})
},
closeDialog(){
this.show = false
this.$emit('close');
}
}
}
</script>