hCxlz.vue
6.35 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
<template>
<div class="main">
<el-dialog
title="户重新落宗"
:visible.sync="isVisible"
width="50%"
@close="close"
:modal-append-to-body="false"
>
<div class="content">
<div class="input-suffix">
宗 地:
<input
placeholder="请选择宗地" v-model="zdxx" readonly="readonly"
/>
<el-button type="primary" @click="xzzdVisible = true">选择宗地</el-button>
</div>
<div class="input-suffix">
自然幢:
<el-select v-model="hcxlzData.zrzbsm" filterable placeholder="请选择" @change="zrzChange">
<el-option
v-for="item in zrzList"
:key="item.xmmc"
:label="item.label"
:value="item.bsm">
</el-option>
</el-select>
</div>
<div class="input-suffix">
逻辑幢:
<el-select v-model="hcxlzData.ljzbsm" filterable placeholder="请选择" @change="ljzChange">
<el-option
v-for="item in ljzList"
:key="item.bsm"
:label="item.ljzmc"
:value="item.bsm">
</el-option>
</el-select>
</div>
<div class="input-suffix">
幢单元:
<el-select v-model="hcxlzData.zdybsm" filterable placeholder="请选择">
<el-option
v-for="item in zdyList"
:key="item.bsm"
:label="item.zdymc"
:value="item.bsm">
</el-option>
</el-select>
</div>
</div>
<div class="footer">
<el-button type="primary" @click="save">保存</el-button>
<el-button type="primary" @click="cancel">取消</el-button>
</div>
<query-data :centerDialogVisible="xzzdVisible" @close="xzzdClose" @getData="getZdxx"></query-data>
</el-dialog>
</div>
</template>
<script>
import queryData from './../../components/queryData/queryData'
import {zdXlcd, hzl} from './../../api/zd'
import {Message} from 'element-ui'
export default {
name: "hCxlz",
components: {queryData},
data() {
return {
zd: {},
zrz: {},
ljz: {},
zdy: {},
xzzdVisible: false,
isVisible: false,
zdxx: '', // 宗地信息
hcxlzData: {
bsms: [],
zrzbsm: '',
ljzbsm: '',
zdybsm: ''
},
total: 1,
zrzList: [],
ljzList: [],
zdyList: []
}
},
props: {
hCxlzVisble: {
type: Boolean,
default: false
},
bsms: {
type: Array
}
},
mounted() {
},
methods: {
ljzChange: function () {
const item = this.ljzList.find(i => i.bsm == this.hcxlzData.ljzbsm)
this.hcxlzData.zdybsm = ''
this.zdyList = item.list;
this.zdyList.push({
zdymc: '空',
bsm: ''
})
},
zrzChange: function () {
const item = this.zrzList.find(i => i.bsm == this.hcxlzData.zrzbsm);
this.hcxlzData.ljzbsm = ''
this.hcxlzData.zdybsm = ''
this.ljzList = item.ljzList;
this.ljzList.push({
ljzmc: '空',
bsm: ''
})
this.zdyList = item.zdyList;
this.zdyList.push({
zdymc: '空',
bsm: ''
})
},
getZrz: function (bsm) {
zdXlcd(bsm).then(res => {
this.zrzList = res.result;
})
},
getZdxx: function (val) {
console.log(val, "宗地信息")
this.zd = val
this.zdxx = val.xmmc + "(" + val.zddm + ")";
},
xzzdClose: function () {
this.xzzdVisible = false;
},
result: function () {
this.hcxlzData = {
bsms: [],
zrzbsm: '',
ljzbsm: '',
zdybsm: ''
};
},
cancel() {
console.log("cancel......")
this.close();
},
save() {
console.log("save.......")
if (this.hcxlzData.zrzbsm == '') {
Message.error("请选择自然幢")
return;
}
hzl(this.hcxlzData).then(res => {
if (res.success) {
this.close();
} else {
Message.error(res.message)
}
});
},
close() {
this.$emit('close', false);
this.result();
},
},
watch: {
hCxlzVisble: function (val) {
this.isVisible = val
},
zd: function (val) {
//this.getZrz(val.glbsm)
this.getZrz('815c80d0d5b35968432fdd9c654dd134')
}
}
}
</script>
<style scoped lang="less">
.input-suffix {
input {
width: 210px;
height: 30px;
border-radius: 3px;
border-color: #BBB;
}
}
.content {
text-align: center;
}
.footer {
margin-top: 20px;
text-align: center;
}
</style>