MealCombo.vue
3.12 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
<template>
<div class="meal-components gl-form-page">
<div class="title">套餐信息</div>
<template>
<div class="detail_pannel">
<div class="wrap flex_sc">
<div v-for="(item, index) in editDetail" :key="index">
<div class="line_widget flex_sc">
<div class="label">
<span class="text">{{ item.label }}</span>
<span class="text">:</span>
</div>
<div class="value">{{ item.isPrice ? (priceFilter(item.value) || '-') : item.value || '-' }}</div>
</div>
</div>
</div>
</div>
</template>
</div>
</template>
<script>
export default {
name: 'MealCombo',
props: {
editForm: Object,
},
data() {
return {
editDetail: []
}
},
mounted() {
this.handlerDetail()
},
methods: {
handlerDetail() {
this.editDetail = [
{
label: '套餐名称',
value: this.editForm.packageName
},
{
label: '售价(元)',
value: this.editForm.sellPrice,
isPrice: true
},
{
label: '最低售价(元)',
value: this.editForm.minSellPrice,
isPrice: true
},
{
label: '产品、升级成本(元)',
value: this.editForm.upgradeProductCost,
isPrice: true
},
{
label: '回收成本(元)',
value: this.editForm.recoveryCost,
isPrice: true
},
{
label: '虚拟对账成本(元)',
value: this.editForm.virtualAccountCost,
isPrice: true
},
{
label: '嘀加成本(元)',
value: this.editForm.djCost,
isPrice: true
},
{
label: '第三方成本(元)',
value: this.editForm.thirdPartyCost,
isPrice: true
}
]
},
// 处理金额补零
priceFilter(num) {
var pow = Math.pow(10, 2)
if (this.filterEmpty(num)) return '-'
return (Math.round(num * pow) / pow).toFixed(2)
},
filterEmpty(data) {
return (data ?? '') === ''
}
}
}
</script>
<style lang="scss" scoped>
.meal-components {
background: white;
.title {
padding: 0 20px;
font-size: 16px;
font-weight: bold;
height: 58px;
line-height: 58px;
border-bottom: 1px solid #d8d8d8;
margin: 0 0;
color: #333;
}
.edit-form-container {
padding: 32px 0 12px;
}
/deep/ .el-form-item {
display: flex;
.el-textarea {
textarea {
font-family: auto;
}
}
}
}
.detail_pannel {
padding: 20px;
.wrap {
flex-wrap: wrap;
}
.line_widget {
margin-bottom: 20px;
.label {
width: 154px;
text-align: right;
.required {
color: #eb4e4e;
font-size: 6px;
margin-right: 4px;
}
.text {
font-size: 14px;
font-weight: 400;
color: #666666;
line-height: 20px;
}
}
.value {
width: 348px;
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
}
}
}
</style>