|
@@ -11,6 +11,30 @@
|
11
|
11
|
<el-form-item label="别名">
|
12
|
12
|
<el-input v-model="building.name"></el-input>
|
13
|
13
|
</el-form-item>
|
|
14
|
+ <el-form-item label="项目类型">
|
|
15
|
+ <el-button @click="showBuildingTag" icon="el-icon-circle-plus-outline" type="text"></el-button>
|
|
16
|
+ <el-row>
|
|
17
|
+ <el-col :span="12" v-for="(item, index) in buildingProjectTypeData" :key="item.buildingTypeId">
|
|
18
|
+ <el-card shadow="never">
|
|
19
|
+ <div slot="header" class="clearfix">
|
|
20
|
+ <span>{{ item.buildingTypeName }}</span>
|
|
21
|
+ <el-button style="float: right; padding: 3px 0" icon="el-icon-close" type="text" @click="closeCard(index)"></el-button>
|
|
22
|
+ </div>
|
|
23
|
+ <el-form ref="form" label-width="80px">
|
|
24
|
+ <el-form-item label="价格">
|
|
25
|
+ <el-input v-model="item.price" placeholder="元/㎡"></el-input>
|
|
26
|
+ </el-form-item>
|
|
27
|
+ <el-form-item label="装修标准">
|
|
28
|
+ <el-input v-model="item.decoration"></el-input>
|
|
29
|
+ </el-form-item>
|
|
30
|
+ <el-form-item label="产权年限">
|
|
31
|
+ <el-input v-model="item.rightsYear"></el-input>
|
|
32
|
+ </el-form-item>
|
|
33
|
+ </el-form>
|
|
34
|
+ </el-card>
|
|
35
|
+ </el-col>
|
|
36
|
+ </el-row>
|
|
37
|
+ </el-form-item>
|
14
|
38
|
<el-form-item label="均价">
|
15
|
39
|
<el-input v-model="building.price"></el-input>
|
16
|
40
|
</el-form-item>
|
|
@@ -306,6 +330,15 @@
|
306
|
330
|
</el-form>
|
307
|
331
|
</el-dialog>
|
308
|
332
|
</el-tab-pane>
|
|
333
|
+
|
|
334
|
+ <el-dialog
|
|
335
|
+ title="项目类型"
|
|
336
|
+ :visible.sync="showBuildingTagDialog"
|
|
337
|
+ width="30%"
|
|
338
|
+ :before-close="handleClose">
|
|
339
|
+ <el-checkbox v-for="(item, index) in buildingProjectTypeChecked" v-model="item.checked" :key="item.buildingTypeId" @change="appendProject(index)">{{ item.buildingTypeName }}</el-checkbox>
|
|
340
|
+ </el-dialog>
|
|
341
|
+
|
309
|
342
|
</el-tabs>
|
310
|
343
|
</template>
|
311
|
344
|
|
|
@@ -375,13 +408,19 @@ export default {
|
375
|
408
|
coordinate: e.lnglat.lat + "," + e.lnglat.lng
|
376
|
409
|
});
|
377
|
410
|
}
|
378
|
|
- }
|
|
411
|
+ },
|
|
412
|
+ showBuildingTagDialog: false, // 默认不显示项目类型tag
|
|
413
|
+ // 项目类型 多选框
|
|
414
|
+ buildingProjectTypeChecked: [],
|
|
415
|
+ // 项目类型 选中之后
|
|
416
|
+ buildingProjectTypeData: [] // 项目类型
|
379
|
417
|
};
|
380
|
418
|
},
|
381
|
419
|
computed: {
|
382
|
420
|
...mapBuildingState({
|
383
|
421
|
detail: x => x.detail,
|
384
|
|
- cityNameList: x => x.cityNameList
|
|
422
|
+ cityNameList: x => x.cityNameList,
|
|
423
|
+ buildingType: state => state.buildingTypeList
|
385
|
424
|
}),
|
386
|
425
|
...mapState({
|
387
|
426
|
dicts: x => x.dicts
|
|
@@ -410,7 +449,9 @@ export default {
|
410
|
449
|
"getDetail",
|
411
|
450
|
"getCityName",
|
412
|
451
|
"addBuilding",
|
413
|
|
- "editBuilding"
|
|
452
|
+ "editBuilding",
|
|
453
|
+ 'getBuildingTypeList',
|
|
454
|
+ 'deleteBuildingType'
|
414
|
455
|
]),
|
415
|
456
|
...mapApartmentActions([
|
416
|
457
|
"getApartments",
|
|
@@ -534,11 +575,14 @@ export default {
|
534
|
575
|
tagName: x
|
535
|
576
|
};
|
536
|
577
|
});
|
|
578
|
+
|
|
579
|
+
|
537
|
580
|
const building = {
|
538
|
581
|
...this.building,
|
539
|
582
|
img: imgs,
|
540
|
583
|
propertyType: this.buildingProperty.join(","),
|
541
|
|
- tag
|
|
584
|
+ tag,
|
|
585
|
+ buildingProjectType: this.buildingProjectTypeData
|
542
|
586
|
};
|
543
|
587
|
if (!building.buildingId) {
|
544
|
588
|
// 新增
|
|
@@ -654,12 +698,53 @@ export default {
|
654
|
698
|
};
|
655
|
699
|
});
|
656
|
700
|
this.tags = data.buildingTag.map(x => x.tagName);
|
|
701
|
+
|
|
702
|
+ // 项目类型
|
|
703
|
+ this.buildingProjectTypeData = data.buildingProjectType
|
|
704
|
+ this.buildingProjectTypeData.forEach((item, index) => {
|
|
705
|
+ this.buildingProjectTypeChecked.forEach((checkItem, index) => {
|
|
706
|
+ if (item.buildingId === checkItem.buildingId) {
|
|
707
|
+ checkItem.checked = true
|
|
708
|
+ }
|
|
709
|
+ })
|
|
710
|
+ })
|
657
|
711
|
});
|
658
|
712
|
}
|
659
|
|
- }
|
|
713
|
+ },
|
|
714
|
+ handleClose(done) { // 关闭项目类型的多选弹框
|
|
715
|
+ done()
|
|
716
|
+ },
|
|
717
|
+ showBuildingTag() { // 显示项目类型弹窗
|
|
718
|
+ this.showBuildingTagDialog = true
|
|
719
|
+ },
|
|
720
|
+ buildingTypeList() {
|
|
721
|
+ this.getBuildingTypeList({ pageNum: 1, pageSize: 999 }).then((res) => {
|
|
722
|
+ this.buildingProjectTypeChecked = res.records.map((item, index) => {
|
|
723
|
+ return { buildingTypeId: item.buildingTypeId, buildingTypeName: item.buildingTypeName,checked: false }
|
|
724
|
+ })
|
|
725
|
+ })
|
|
726
|
+ },
|
|
727
|
+ appendProject(index) { // 添加项目类型弹框
|
|
728
|
+ const _self = this
|
|
729
|
+ const current = this.buildingProjectTypeChecked[index]
|
|
730
|
+ this.buildingProjectTypeData.push({ // 住宅
|
|
731
|
+ buildingId: _self.building.buildingId,
|
|
732
|
+ buildingTypeId: current.buildingTypeId,
|
|
733
|
+ buildingTypeName: current.buildingTypeName,
|
|
734
|
+ status: 1,
|
|
735
|
+ price: '', // 价格
|
|
736
|
+ decoration: '', // 装修标准
|
|
737
|
+ rightsYear: '' // 产权年限
|
|
738
|
+ })
|
|
739
|
+ },
|
|
740
|
+ closeCard(index) { // 关闭项目类型的多选
|
|
741
|
+ delete this.buildingProjectTypeData[index]
|
|
742
|
+ this.buildingProjectTypeData = this.buildingProjectTypeData.filter(e => e !== undefined)
|
|
743
|
+ },
|
660
|
744
|
},
|
661
|
745
|
mounted() {
|
662
|
746
|
this.initData();
|
|
747
|
+ this.buildingTypeList()
|
663
|
748
|
}
|
664
|
749
|
};
|
665
|
750
|
</script>
|