index.vue
14.3 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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
<template>
<el-tabs
:tab-position="tabPosition"
v-model="activeName"
id="tabs"
type="card"
class="eltabs"
@tab-click="handleClick">
<el-tab-pane class="eltabspane" v-if="!auth" label="宗地" name="zd">
<el-form :inline="true" :rules="rules" :model="ruleForm" ref="ruleForm" class="demo-form-inline">
<el-form-item label="行政区划" class="w100" prop="xzqbsm">
<el-col :span="7">
<el-form-item prop="xzqbsm">
<el-select v-model="ruleForm.xzqbsm" value-key="xzqbsm" placeholder="行政区" @change="changeXzq(ruleForm.xzqbsm)">
<el-option
v-for="item in xzq"
:key="item.bsm"
:label="item.mc"
:value="item.bsm">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="1"> </el-col>
<el-col :span="7">
<el-form-item prop="djqbsm">
<el-select v-model="ruleForm.djqbsm" placeholder="地籍区" @change="changeDjq(ruleForm.djqbsm)">
<el-option
v-for="item in djq"
:key="item.bsm"
:label="item.mc"
:value="item.bsm">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="1"> </el-col>
<el-col :span="8">
<el-form-item prop="djzqbsm" style="margin-right:0">
<el-select v-model="ruleForm.djzqbsm" placeholder="地籍子区">
<el-option
v-for="item in djzq"
:key="item.bsm"
:label="item.mc"
:value="item.bsm">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-form-item>
<el-form-item label="项目名称" class="w100" prop="xmmc">
<el-input
v-model="ruleForm.xmmc"
placeholder="项目名称"
></el-input>
</el-form-item>
<el-form-item label="所有权类型" class="w100" prop="syqlxbsm">
<el-select
v-model="ruleForm.syqlxbsm"
placeholder="所有权类型"
>
<el-option
v-for="item in syqlx"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="特征码" class="w100" prop="zdtzmbsm">
<el-select
v-model="ruleForm.zdtzmbsm"
placeholder="宗地特征码"
>
<el-option
v-for="item in $store.state.zdtzmList"
:key="item.bsm"
:label="item.mc"
:value="item.bsm"
>
</el-option>
</el-select>
</el-form-item>
</el-form>
<div class="handleBtn">
<el-button type="primary" class="w98 import">导入图形</el-button>
<el-button type="primary" class="w98 creat" @click="newZd">创建</el-button>
<el-button type="primary" class="w98 cancel" @click="close">取消</el-button>
</div>
</el-tab-pane>
<el-tab-pane class="eltabspane" v-if="!auth" label="宗海" name="zh">
<div class="handleBtn">
<el-button type="primary" class="w98 import">导入图形</el-button>
<el-button type="primary" class="w98 creat" @click="todo">创建</el-button>
<el-button type="primary" class="w98 cancel" @click="close">取消</el-button>
</div>
</el-tab-pane>
<el-tab-pane class="eltabspane" label="自然幢" name="zrz">
<el-form :inline="true" :rules="rules1" :model="ruleForm1" ref="ruleForm1" class="demo-form-inline">
<el-form-item label="项目名称" class="w100" prop="xmmc">
<el-input
v-model="ruleForm1.xmmc"
placeholder="项目名称"
></el-input>
</el-form-item>
</el-form>
<div class="handleBtn">
<el-button type="primary" class="w98 import">导入图形</el-button>
<el-button type="primary" class="w98 creat" @click="newZrz">创建</el-button>
<el-button type="primary" class="w98 cancel" @click="close">取消</el-button>
</div>
</el-tab-pane>
<el-tab-pane class="eltabspane" v-if="!createZrz" label="多幢" name="dz">
<el-form :inline="true" :rules="rules2" :model="ruleForm2" ref="ruleForm2" class="demo-form-inline">
<el-form-item label="项目名称" class="w100" prop="xmmc">
<el-input
v-model="ruleForm2.xmmc"
placeholder="项目名称"
></el-input>
</el-form-item>
</el-form>
<div class="handleBtn">
<el-button type="primary" class="w98 import">导入图形</el-button>
<el-button type="primary" class="w98 creat" @click="newDz">创建</el-button>
<el-button type="primary" class="w98 cancel" @click="close">取消</el-button>
</div>
</el-tab-pane>
<el-tab-pane class="eltabspane" v-if="!createZrz" label="林权" name="lq">
<div class="handleBtn">
<el-button type="primary" class="w98 import">导入图形</el-button>
<el-button type="primary" class="w98 creat" @click="todo">创建</el-button>
<el-button type="primary" class="w98 cancel" @click="close">取消</el-button>
</div>
</el-tab-pane>
<el-tab-pane class="eltabspane" label="构筑物" name="gzw">
<el-form :inline="true" :rules="rules4" :model="ruleForm4" ref="ruleForm4" class="demo-form-inline">
<el-form-item label="项目名称" class="w100" prop="xmmc">
<el-input
v-model="ruleForm4.xmmc"
placeholder="项目名称"
></el-input>
</el-form-item>
</el-form>
<div class="handleBtn">
<el-button type="primary" class="w98 import">导入图形</el-button>
<el-button type="primary" class="w98 creat" @click="newGzw">创建</el-button>
<el-button type="primary" class="w98 cancel" @click="close">取消</el-button>
</div>
</el-tab-pane>
</el-tabs>
</template>
<script>
import {
getAllList,
getListByXzqbsm,
getListByPbsm,
getDdicByMC,
} from "@api/common";
import { insertQjZdjbxx } from "@api/zd";
import { insertZrzjbxx } from "@api/zrz";
import { insertDzjbxx } from "@api/dz";
import { insertGzwjbxx } from "@api/gzw";
export default {
name: "",
components: {},
inject:['getRightTree','getTreeByBsm'],
props: {
auth: {
type: Boolean,
default: function () {
return false
}
},
createZrz: {
type: Boolean,
default: function () {
return false
}
},
},
data() {
return {
tabPosition: "left",
//默认第一个选项卡
activeName: "",
zrzProjectName: "",
xzq: [],
djq: [],
djzq: [],
ruleForm:{
djqbsm: "",
djzqbsm: "",
syqlxbsm: "",
userbsm: "",
xmmc: "",
xzqbsm: "",
zdtzmbsm: ""
},
ruleForm1:{
zdbsm:'',
xmmc:'',
userbsm:''
},
ruleForm2:{
zdbsm:'',
xmmc:'',
userbsm:''
},
ruleForm4:{
zdzhbsm:'',
xmmc:'',
userbsm:''
},
rules: {
xzqbsm: [
{ required: true, message: '请选择行政区', trigger: 'change' }
],
djqbsm: [
{ required: true, message: '请选择地籍区', trigger: 'change' }
],
djzqbsm: [
{ required: true, message: '请选择地籍子区', trigger: 'change' }
],
xmmc: [
{ required: true, message: '请输入项目名称', trigger: 'blur' },
],
syqlxbsm: [
{ required: true, message: '请选择所有权类型', trigger: 'change' }
],
zdtzmbsm: [
{ required: true, message: '请选择宗地特征码', trigger: 'change' }
]
},
rules1: {
xmmc: [
{ required: true, message: '请输入项目名称', trigger: 'blur' },
],
},
rules2: {
xmmc: [
{ required: true, message: '请输入项目名称', trigger: 'blur' },
],
},
rules4: {
xmmc: [
{ required: true, message: '请输入项目名称', trigger: 'blur' },
],
},
syqlx: [
{
label: "国家所有",
value: "G",
},
{
label: "集体所有",
value: "J",
},
{
label: "土地所有权未确定或有争议",
value: "Z",
},
],
};
},
created() {
this.getXzqList();
},
mounted() {
//判断是新建流程还是添加定着物唤起的弹框
this.activeName = this.auth ? 'zrz':'zd'
},
methods: {
// 重置
reset(){
if(this.$refs['ruleForm']){
this.$refs['ruleForm'].resetFields();
}
if(this.$refs["ruleForm1"]){
this.$refs["ruleForm1"].resetFields();
}
if (this.$refs["ruleForm2"]) {
this.$refs["ruleForm2"].resetFields();
}
},
handleClick(tab, event) {
console.log(tab, event);
console.log(tab.name);
},
newZd() {
this.$refs['ruleForm'].validate((valid) => {
if (valid) {
insertQjZdjbxx(this.ruleForm)
.then((res) => {
console.log(res.result);
if (res.code == "200") {
this.getRightTree(res.result,'0,1,2');
this.$message({
message: "创建成功!",
type: "success",
});
this.$store.state.zdbsm = res.result;
//todo 跳转到宗地基本信息内容表页面 (预留)
this.close();
this.$router.push({
path: '/zd', query:{
source: 2,
bsm:res.result
}
});
} else {
this.$message.error(res.message);
}
})
.catch((error) => {});
} else {
console.log('error submit!!');
return false;
}
});
},
newZrz() {
//todo 在新增时,如果是点击顶部新建里面的自然幢则不传zdbsm 如果是点击右键里面的添加定着物则传zdbsm
this.$refs['ruleForm1'].validate((valid) => {
if (valid) {
this.ruleForm1.zdbsm = this.auth ? this.$store.state.zdbsm : '';
this.ruleForm1.dzbsm = this.auth ? this.$store.state.dzbsm : '';
insertZrzjbxx(this.ruleForm1)
.then((res) => {
if (res.code == "200") {
//获取左侧树数据
this.getTreeByBsm(res.result.bsm,'zrz','0,1,2');
this.$message({
message: "创建成功!",
type: "success",
});
//todo 跳转到自然幢基本信息内容表页面 (预留)
this.$store.state.zdbsm=res.result.zdbsm;
this.$store.state.zrzbsm=res.result.bsm;
this.$store.state.xmmc=res.result.xmmc;
this.$store.state.newZdbsm = res.result.zdbsm;
this.close();
this.$router.push({
path: '/zrz', query:{
source: 1,
bsm:res.result.bsm,
auth: '0,1,2'
}
});
} else {
this.$message.error("创建失败!");
}
})
.catch((error) => {});
} else {
console.log('error submit!!');
return false;
}
});
},
newGzw(){
this.$refs['ruleForm4'].validate((valid) => {
if (valid) {
if(1>0){
this.ruleForm4.zdzhbsm = this.$store.state.zdbsm != '' ? this.$store.state.zdbsm : '';
insertGzwjbxx(this.ruleForm4)
.then((res)=>{
if(res.code === 200){
//获取左侧树数据
this.getTreeByBsm(res.result.bsm,'gzw','0,1,2');
this.close();
this.$router.push({
path: '/gzw', query:{
source: 1,
bsm:res.result.bsm,
auth: '0,1,2'
}
});
}
})
}else {
this.close();
this.$router.push({
path: '/gzw', query:{
source: 1,
bsm:"12345678901234567890",
auth: '0,1,2'
}
});
}
}
})
},
newDz() {
//todo 在新增时,如果是点击顶部新建里面的自然幢则不传zdbsm 如果是点击右键里面的添加定着物则传zdbsm
this.$refs['ruleForm2'].validate((valid) => {
if (valid) {
this.ruleForm2.zdbsm = this.$store.state.zdbsm != '' ? this.$store.state.zdbsm : '';
insertDzjbxx(this.ruleForm2)
.then((res) => {
if (res.code == "200") {
this.getTreeByBsm(res.result.bsm,'dz','0,1,2');
this.$message({
message: "创建成功!",
type: "success",
});
this.$store.state.zdbsm=res.result.zdbsm;
this.$store.state.dzbsm=res.result.bsm;
this.$store.state.xmmc=res.result.xmmc;
this.$store.state.newZdbsm = res.result.zdbsm;
this.close();
this.$router.push({
path: '/dz', query:{
source: 1,
bsm:res.result.bsm,
auth: '0,1,2'
}
});
} else {
this.$message.error("创建失败!");
}
})
.catch((error) => {});
} else {
console.log('error submit!!');
return false;
}
});
},
todo(){
this.$message({
message: "待开发",
type: "warning",
});
},
getXzqList() {
getAllList()
.then((res) => {
console.log(res.result);
this.xzq = res.result;
this.$store.state.xzqList = res.result;
})
.catch((error) => {});
},
changeXzq(id) {
this.djq = [];
this.djzq = [];
this.ruleForm.djqbsm = "";
this.ruleForm.djzqbsm = "";
getListByXzqbsm(id)
.then((res) => {
if (res.result == null) {
this.djq = null;
} else {
this.djq = res.result;
this.$store.state.djqList = res.result;
}
})
.catch((error) => {});
},
changeDjq(item) {
this.djzq = [];
this.ruleForm.djzqbsm = "";
if (item == null) {
console.log("llllllllllasdas");
} else {
console.log(item);
getListByPbsm(item)
.then((res) => {
console.log(res.result);
if (res.result == null) {
this.djzq = null;
} else {
this.djzq = res.result;
this.$store.state.djzqList = res.result;
}
})
.catch((error) => {});
}
},
close() {
this.reset();
this.$emit("closeDialog");
},
},
computed: {},
watch: {},
};
</script>
<style lang="less">
.eltabs {
height: 366px;
width: 100%;
position: relative;
margin-left: 20px;
margin-top: 20px;
.eltabspane {
height: 100%;
width: 100%;
.el-form--inline .el-form-item__label{
width: 100px;
}
.el-form-item{
margin-bottom: 20px;
}
.w100{
width: calc(100% - 40px);
.el-form-item{
margin-bottom: 0!important;
.el-form-item__content{
width: 100%;
}
}
.el-form-item__content{
width: calc(100% - 100px);
.el-select{
width: 100%;
}
}
}
.handleBtn{
width: 314;
position: absolute;
bottom: 0;
left: 50%;
margin-left: -250px;
.w98{
width: 98px;
}
}
.el-form{
margin-top: 10px;
box-sizing: border-box;
padding-left: 40px;
}
}
.el-tabs__content{
height: 100%;
}
/deep/.el-tabs__item {
font-size: 16px !important;
color: #333;
width: 140px;
height: 50px;
line-height: 50px;
text-align: center!important;
border-color: #E4E4E4!important;
}
/deep/ .is-active{
background-color: #E5F4FF;
color: #358BFF;
}
}
</style>