InformationTable.vue
2.17 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
<template>
<div>
<lb-table :column="InformationTable" border :key="key" :heightNum="390" :pagination="false" heightNumSetting
:data="tableData">
</lb-table>
</div>
</template>
<script>
export default {
/**注册组件*/
components: {},
data () {
return {
key: 0,
tableData:[{
xm: '12',
zjzl: '32',
zjh: '123',
fr: "213123",
}],
InformationTable:[
{
width: '60',
renderHeader: (h, scope) => {
return <i class="el-icon-plus pointer" onClick={() => { this.handleAdd() }} style="color:#409EFF"></i>
},
render: (h, scope) => {
return (
<i class="el-icon-minus pointer" onClick={() => { this.handleMinus(scope.$index, scope.row) }}></i>
)
}
},
{
label: '身份证读卡器',
align: 'center',
render: (h, scope) => {
return <el-button type="text" icon="el-icon-delete" onClick={() => { this.readClick(scope) }}>读取</el-button>
}
},
{
prop: "xm",
label: "姓名/名称",
},
{
prop: "zjzl",
label: "证件种类",
},
{
prop: "zjh",
label: "证件号",
},
{
prop: "fr",
label: "法人",
},
{
label: '操作',
width: '80',
align: 'center',
fixed: 'right',
render: (h, scope) => {
return <el-button type="text" icon="el-icon-delete" onClick={() => { vm.editClick(scope) }}>修改</el-button>
}
}
]
};
},
watch: {
tableData: {
handler (newValue, oldValue) {
this.$emit('updateValue', newValue)
},
deep: true
}
},
created(){},
methods:{
// 添加
handleAdd () {
this.tableData.push(
{
xm: '22',
zjzl: '33',
zjh: '44',
fr: "55",
}
)
this.key++
},
// 减
handleMinus (index, row) {
this.tableData.splice(index, 1)
},
// 身份证读取
readClick(){},
// 修改
editClick(){},
}
}
</script>
<style scoped lang='scss'>
</style>