zu-table.vue
3.93 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
<template>
<div class="mt20" />
<el-table :data="list" border style="width: 100%">
<el-table-column :label="language==0?'序号':'Index'" type="index" width="70" align="center" />
<el-table-column :label="language==0?'组别代码':'EVENT code'" width="120px" align="center" prop="project.code" />
<el-table-column :label="language==0?'组别':'EVENT'" min-width="150px" header-align="center" prop="project.name">
<template #default="scope">
<el-tooltip effect="dark" :content="scope.row.project.name">
<div class="esp">{{ scope.row.project.name }}</div>
</el-tooltip>
</template>
</el-table-column>
<el-table-column :label="language==0?'舞种':'DISCIPLINE'" align="center" width="120px" prop="project.danceType" />
<el-table-column :label="language==0?'参赛说明':'Participation Instructions'" header-align="center" min-width="160px">
<template #default="scope">
<el-tooltip effect="dark" :content="scope.row.project.remarks">
<div class="esp" v-html="scope.row.project.remarks" />
</el-tooltip>
</template>
</el-table-column>
<el-table-column :label="language==0?'参赛运动员':'PARTICIPATING ATHLETES'" header-align="center" min-width="140px">
<template #default="scope">
<el-tooltip effect="dark">
<template #content>
<span v-for="s in scope.row.athletes" :key="s">{{ s.name }},</span>
</template>
<div class="esp">
<span v-for="s in scope.row.athletes" :key="s">{{ s.name }},</span>
</div>
</el-tooltip>
</template>
</el-table-column>
<el-table-column :label="language==0?'参赛服务费':'REGISTRATION FEE'" align="center" width="150px" prop="">
<template #default="scope">
<div class="text-primary">
<!-- // chargeType 0 按项目收费 1按人数收费-->
{{ payType!=3?'¥':'€' }}
<span v-if="scope.row.project.chargeType == '0'">
{{ payType!=3? scope.row.project.serviceFee:scope.row.project.serviceFeeEn }}
</span>
<span v-else>
{{ payType!=3? scope.row.project.serviceFee * scope.row.athletes.length:scope.row.project.serviceFeeEn * scope.row.athletes.length }}
</span>
<!-- {{ scope.row.project.chargeType == '0'?scope.row.project.serviceFee : scope.row.project.serviceFee * scope.row.athletes.length }}-->
</div>
</template>
</el-table-column>
<el-table-column v-if="hasAction" :label="language==0?'操作':'Actions'" fixed="right" width="150" align="center">
<template #default="scope">
<el-button type="primary" link @click="remove(scope.row.signId)">
{{ language == 0 ? '删除' : 'Delete' }}
</el-button>
</template>
</el-table-column>
</el-table>
<div v-if="showSummary" class="rowSummary">
<div>
{{ language==0?'总报项数':'Count' }}: <span class="mr20">{{ list.length }}</span>
{{ language==0?'金额小计':'Amount' }}: <span>{{ payType!=3?'¥':'€' }}{{ total }}</span>
</div>
</div>
</template>
<script setup>
import { useStorage } from '@vueuse/core/index'
const emit = defineEmits(['delete'])
const props = defineProps({
list: {
type: Array,
required: true
},
hasAction: {
type: Boolean,
required: false,
default: true
},
showSummary: {
type: Boolean,
required: false,
default: false
},
total: {
type: Number,
required: false,
default: 0
},
payType: {
type: String,
required: false,
default: ''
}
})
const language = useStorage('language', 0)
const remove = (id) => {
emit('delete', id)
}
</script>
<style scoped lang="scss">
.rowSummary{text-align: right;padding: 0 20px;
height: 40px;line-height: 40px;
background: #FAFBFD;font-size: 16px;
color: #95A1A6;
border: 1px solid #EEEFF0;
span{font-size: 18px;font-family: DIN Alternate;color: #000;}
}
</style>