index.vue
3.41 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
<template>
<div>
<el-table :data="tableData" style="width: 100%" border height="220px">
<el-table-column prop="index" label="序号" width="80"></el-table-column>
<el-table-column prop="productNumber" label="企业商品编号" width="150"></el-table-column>
<el-table-column prop="productName" label="商品企业商品名称" width="180"></el-table-column>
<el-table-column prop="description" label="企业商品描述" width="150"></el-table-column>
<el-table-column prop="code" label="条码" width="150"></el-table-column>
<el-table-column prop="unit" label="计量单位" width="100">
<template slot-scope="scope">
<span>{{ scope.row.unit }}</span>
<i class="el-icon-top" style="margin-left: 5px;"></i>
</template>
</el-table-column>
<el-table-column prop="currency" label="币制" width="80"></el-table-column>
<el-table-column prop="quantity" label="数量" width="80"></el-table-column>
<el-table-column prop="unitPrice" label="单价" width="100"></el-table-column>
<el-table-column prop="totalPrice" label="总价" width="100"></el-table-column>
<el-table-column prop="notes" label="备注" width="300"></el-table-column>
<el-table-column label="操作" width="100" fixed="right">
<template slot-scope="scope">
<el-link type="primary" @click="handleExpand(scope.$index)">展开</el-link>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
export default {
name: "ProductDetailTable",
data() {
return {
tableData: [
{
index: 1,
productNumber: "6704200000",
productName: "真人发发夹",
description: "测试内容",
code: "485607096",
unit: "↑",
currency: "美元",
quantity: 1,
unitPrice: "645.78",
totalPrice: "645.78",
notes: "山东电子口岸已写,加签后上传"
},
{
index: 2,
productNumber: "6704200000",
productName: "真人发发夹",
description: "测试内容",
code: "2145860720",
unit: "↑",
currency: "美元",
quantity: 2,
unitPrice: "645.78",
totalPrice: "645.78",
notes: "山东电子口岸已写,加签后上传"
},
{
index: 3,
productNumber: "6704200000",
productName: "真人发发夹",
description: "测试内容",
code: "2145860720",
unit: "↑",
currency: "美元",
quantity: 3,
unitPrice: "645.78",
totalPrice: "645.78",
notes: "山东电子口岸已写,加签后上传"
},
{
index: 4,
productNumber: "6704200000",
productName: "真人发发夹",
description: "测试内容",
code: "2145860720",
unit: "↑",
currency: "美元",
quantity: 1,
unitPrice: "635.78",
totalPrice: "635.78",
notes: "山东电子口岸已写,加签后上传"
}
// 更多数据项...
]
};
},
methods: {
handleExpand(index) {
console.log(`展开第 ${index + 1} 行数据`);
}
}
}
</script>
<style scoped lang="scss">
.el-table {
font-size: 14px;
//border: 1px solid red;
//height: 180px;
overflow: auto;
}
.el-icon-top {
color: #409eff;
font-size: 12px;
}
</style>