qlr.vue
4.74 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<template>
<div class="temp">
<table class="tempTable" cellspacing="0" cellpadding="0" border="1">
<tr>
<td colspan="2" width="50px">权利</td>
<td colspan="2">共有方式</td>
<td colspan="8">
<el-row>
<el-col :span="12" class="fl">
<el-radio v-model="radio" label="1">单独所有</el-radio>
<el-radio v-model="radio" label="2">共同所有</el-radio>
<el-radio v-model="radio" label="3">按份共有</el-radio>
<el-radio v-model="radio" label="4">其他共有</el-radio>
</el-col>
<el-col :span="4" class="fr">
<span class="span" @click="addRow">新增</span>
<span class="span" @click="changeRow">修改</span>
<span class="span" @click="delRow">删除</span>
</el-col>
</el-row>
</td>
</tr>
</table>
<el-table
class="qlrTable"
:data="tableData"
style="width: 100%"
@selection-change="handleSelectionChange"
border
>
<el-table-column type="selection" width="40" align="center">
</el-table-column>
<el-table-column prop="qlrmc" label="权利人名称" align="center">
<template slot-scope="scope">
<el-input size="small" v-model="scope.row.qlrmc"></el-input>
</template>
</el-table-column>
<el-table-column prop="qlrlx" label="权利人类型" align="center">
<template slot-scope="scope">
<el-input size="small" v-model="scope.row.qlrlx"></el-input>
</template>
</el-table-column>
<el-table-column prop="zjzl" label="证件种类" align="center">
<template slot-scope="scope">
<el-input size="small" v-model="scope.row.zjzl"></el-input>
</template>
</el-table-column>
<el-table-column prop="zjh" label="证件号" align="center">
<template slot-scope="scope">
<el-input size="small" v-model="scope.row.zjh"></el-input>
</template>
</el-table-column>
<el-table-column prop="txdz" label="通讯地址" align="center">
<template slot-scope="scope">
<el-input size="small" v-model="scope.row.txdz"></el-input>
</template>
</el-table-column>
<el-table-column prop="lxdh" label="联系电话" align="center">
<template slot-scope="scope">
<el-input size="small" v-model="scope.row.lxdh"></el-input>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
export default {
props: {
widtd: {
type: String,
default: "70%",
},
title: {
type: String,
default: "",
},
topHeight: {
type: String,
default: "15vh",
},
},
data() {
return {
radio: "1",
tableData: [
{
id: "1",
qlrmc: "",
qlrlx: "",
zjzl: "",
zjh: "",
txdz: "",
lxdh: "",
},
],
//表格选中项
multipleSelection: {},
};
},
methods: {
//新增行数据
addRow() {
this.tableData.push({
id: Math.random(),
qlrmc: "",
qlrlx: "",
zjzl: "",
zjh: "",
txdz: "",
lxdh: "",
});
},
//修改行数据
changeRow() {},
//删除行数据
delRow() {
for (var i = 0; i < this.multipleSelection.length; i++) {
this.deleteArrOption(this.tableData, this.multipleSelection[i].id);
}
},
//选中表格某一项
handleSelectionChange(val) {
this.multipleSelection = val;
},
//根据id删除多重数组中的某一项
deleteArrOption(arr, id) {
for (var i = arr.length; i > 0; i--) {
if (arr[i - 1].id == id) {
arr.splice(i - 1, 1);
}
}
},
//供父组件调用来获取共有方式
getQlgyfsData(){
return this.radio
},
//供父组件调用来获取权利人表格数据
getQlrxxData(){
return this.tableData
}
},
};
</script>
<style lang="less">
.temp {
width: 100%;
table {
border-bottom: 0;
background-color: #fff;
font-size: 14px;
width: 100%;
.span {
color: #409eff;
margin-right: 10px;
cursor: pointer;
}
.el-radio {
margin-right: 20px !important;
}
td {
text-align: center;
padding: 10px 0;
}
}
.el-table th {
background-color: #fff !important;
}
el-table td,
.el-table th.is-leaf,
.el-table--border,
.el-table--group {
border-color: black;
}
.el-table--border::after,
.el-table--group::after,
.el-table::before {
background-color: black;
}
.el-table--border td,
.el-table--border th,
.el-table__body-wrapper
.el-table--border.is-scrolling-left
~ .el-table__fixed {
border-right: 1px solid #000;
}
.el-table td,
.el-table th {
padding: 6px 0;
color: #333 !important;
font-weight: normal;
}
.el-table td,
.el-table th.is-leaf {
border-bottom: 1px solid #000;
}
.qlrTable {
.el-input__inner {
height: 20px;
margin: 0;
line-height: 20px;
outline: none;
border: none;
color: #606764;
overflow: visible;
cursor: text;
text-align: center;
}
}
}
</style>