clgzsd.vue
5.05 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
<!--
功能:登记情形设定
-->
<template>
<div class='该组件名称'>
<el-form :model="ruleForm" :rules="rules" label-width="135px">
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="登记业务编码" prop="djywbm">
<el-input v-model="ruleForm.djywbm"></el-input>
</el-form-item>
</el-col>
<el-col :span="16">
<el-form-item label="登记业务名称" prop="djywmc">
<el-input v-model="ruleForm.djywmc"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<lb-table :column="column" border :key="key" :heightNum="390" :pagination="false" heightNumSetting
:data="tableData">
</lb-table>
</div>
</template>
<script>
import { upward, down } from '@/utils/operation'
export default {
data () {
return {
key: 0,
ruleForm: {
djywbm: '',
djywmc: ''
},
cllxOptions: [
{
name: '买卖',
value: '1'
},
{
name: '买卖继承',
value: '2'
}
],
rules: {
djywbm: [
{ required: true, message: '登记业务编码', trigger: 'blur' },
],
djywmc: [
{ required: true, message: '登记业务名称', trigger: 'blur' },
],
},
column: [
{
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>
)
}
},
{
width: '60',
label: '序号',
type: 'index'
},
{
prop: 'sfbx',
label: '是否必须',
width: '80',
render: (h, scope) => {
return (
<el-input value={scope.row[scope.column.property]}
onInput={(val) => { scope.row[scope.column.property] = val }}></el-input>
)
}
},
{
prop: 'djqx',
label: '登记情形',
render: (h, scope) => {
return (
<el-input placeholder="登记情形" value={scope.row[scope.column.property]}
onInput={(val) => { scope.row[scope.column.property] = val }}></el-input>
)
}
},
{
prop: 'clbm',
label: '材料编码',
render: (h, scope) => {
return (
<el-input placeholder="材料编码" value={scope.row[scope.column.property]}
onInput={(val) => { scope.row[scope.column.property] = val }}></el-input>
)
}
},
{
prop: 'clmc',
label: '材料名称',
render: (h, scope) => {
return (
<el-input placeholder="材料名称" value={scope.row[scope.column.property]}
onInput={(val) => { scope.row[scope.column.property] = val }}></el-input>
)
}
},
{
prop: 'cllx',
label: '材料类型',
render: (h, scope) => {
return (
<el-select value={scope.row[scope.column.property]}
onChange={(val) => { scope.row[scope.column.property] = val }}>
{
this.cllxOptions.map(option => {
return (
<el-option label={option.name} value={option.value}></el-option>
)
})
}
</el-select>
)
}
},
{
label: '移动',
width: '90',
render: (h, scope) => {
return (
<div>
<i class="el-icon-top pointer move" disabled={scope.$index == 0} onClick={() => { this.moveUpward(scope.$index, scope.row) }}></i>
<i class="el-icon-bottom pointer move" disabled={(scope.$index + 1) == this.tableData.length} onClick={() => { this.moveDown(scope.$index, scope.row) }}></i>
</div>
)
}
}
],
tableData: [
{
sfbx: '',
djqx: '',
clbm: '',
clmc: '',
cllx: ''
}
]
}
},
watch: {
tableData: {
handler (newValue, oldValue) {
this.$emit('updateValue', newValue)
},
deep: true
}
},
methods: {
handleAdd () {
this.tableData.push(
{
sfbx: '',
djqx: '',
clbm: '',
clmc: '',
cllx: ''
}
)
this.key++
},
handleMinus (index, row) {
this.tableData.splice(index, 1)
},
// 上移下移
moveUpward (index, row) {
upward(index, this.tableData)
this.key++
},
moveDown (index, row) {
down(index, this.tableData)
this.key++
},
}
}
</script>
<style scoped lang='scss'>
</style>