zlisen 4 年前
父节点
当前提交
4d9e597e81

+ 7
- 6
src/store/models/renting.js 查看文件

3
   ref
3
   ref
4
 } from "vue"
4
 } from "vue"
5
 import request from '@/utils/request'
5
 import request from '@/utils/request'
6
+import { showDanger } from '@/utils'
6
 
7
 
7
 export default () => {
8
 export default () => {
8
   const loading = ref(false)
9
   const loading = ref(false)
43
   const getDetail = data => {
44
   const getDetail = data => {
44
     // loading.value = true
45
     // loading.value = true
45
     request({
46
     request({
46
-      loadingId: 'room.view',
47
-      url: '/rent/detail',
47
+      loadingId: 'rent.view',
48
+      url: '/rent/view',
48
       params: {
49
       params: {
49
 
50
 
50
         id:data,
51
         id:data,
53
       console.log(res, 'res')
54
       console.log(res, 'res')
54
 
55
 
55
     Object.assign(detail, res)
56
     Object.assign(detail, res)
56
-      // const { pageNo, pageSize, endRow, result } = res || {}
57
-      // Object.assign(page, {pageNo, pageSize, endRow})
58
-      // list.value = pageNo <= 1 ? result : list.value.concat(list.value)
59
-      // loading.value = false
57
+    
60
     }).catch(e => {
58
     }).catch(e => {
61
       console.error(e)
59
       console.error(e)
62
       // loading.value = false
60
       // loading.value = false
61
+      showDanger('获取详情失败')
63
     })
62
     })
64
   }
63
   }
65
 
64
 
65
+  
66
+
66
 
67
 
67
 
68
 
68
   return {
69
   return {

+ 1
- 1
src/utils/plugins/shiro.js 查看文件

3
 const shiro = {
3
 const shiro = {
4
   install: (app) => {
4
   install: (app) => {
5
 
5
 
6
-    const removeNode = el => el.parentNode.removeChild(el)
6
+    const removeNode = el => el.parentNode && el.parentNode.removeChild(el)
7
 
7
 
8
     app.directive('shiro', (el, binding) => {      
8
     app.directive('shiro', (el, binding) => {      
9
       const { permissions, getPermission } = store.getState('shiro')
9
       const { permissions, getPermission } = store.getState('shiro')

+ 150
- 37
src/view/renting/detail/components/Base.vue 查看文件

1
 <template>
1
 <template>
2
   <div>
2
   <div>
3
-    <x-field label="户型">
4
-      {{roomType}}
3
+    <x-field label="楼层">
4
+      {{ floor }}
5
+    </x-field>
6
+
7
+    <x-field label="居住现状">
8
+      {{ getDictLabel(roomInfo.liveStatus, "liveStatus") }}
5
     </x-field>
9
     </x-field>
6
 
10
 
7
     <x-field label="朝向">
11
     <x-field label="朝向">
8
-      {{getDictLabel(roomInfo.aspect, 'aspect')}}
12
+      {{ getDictLabel(roomInfo.aspect, "aspect") }}
9
     </x-field>
13
     </x-field>
10
 
14
 
11
-    <x-field label="装修">
12
-      {{getDictLabel(roomInfo.decoration, 'decoration')}}
15
+    <x-field label="卧室">
16
+      {{ getDictLabel(roomInfo.livingRoom, "liveRoom") }}
13
     </x-field>
17
     </x-field>
14
 
18
 
15
-    <x-field label="房屋用途">
16
-      {{getDictLabel(roomInfo.purpose, 'purpose')}}
19
+    <x-field label="性别限制">
20
+      {{ getDictLabel(roomInfo.limitSex, "limitSex") }}
21
+    </x-field>
22
+
23
+    <x-field label="房屋特色">
24
+      {{ getDictLabel(roomInfo.roomSpecial, "roomSpecial") }}
25
+    </x-field>
26
+
27
+    <x-field label="梯户比例">
28
+      {{ proportion }}
17
     </x-field>
29
     </x-field>
18
 
30
 
19
     <x-field label="建筑类型">
31
     <x-field label="建筑类型">
20
-      {{getDictLabel(roomInfo.buildType, 'build_type')}}
32
+      {{ getDictLabel(roomInfo.buildType, "build_type") }}
21
     </x-field>
33
     </x-field>
22
 
34
 
23
-    <x-field label="配备电梯">
24
-      {{getDictLabel(roomInfo.elevator, 'elevator')}}
35
+    <x-field label="房屋用途">
36
+      {{ getDictLabel(roomInfo.purpose, "purpose") }}
25
     </x-field>
37
     </x-field>
26
 
38
 
27
     <x-field label="抵押信息">
39
     <x-field label="抵押信息">
28
-      {{getDictLabel(roomInfo.isMortgage, 'mortgage') || '无'}}
40
+      {{ getDictLabel(roomInfo.isMortgage, "mortgage") || "无" }}
41
+    </x-field>
42
+
43
+    <x-field label="建成年代">
44
+      {{ roomInfo.buildYear }}
45
+    </x-field>
46
+
47
+    <x-field label="配备电梯">
48
+      {{ getDictLabel(roomInfo.elevator, "elevator") }}
49
+    </x-field>
50
+
51
+    <x-field label="车位">
52
+      {{ getDictLabel(roomInfo.parking, "parking") }}
53
+    </x-field>
54
+
55
+    <x-field label="地下室">
56
+      {{ getDictLabel(roomInfo.buildTime, "build_time") }}
57
+    </x-field>
58
+
59
+ <x-field label="物业费">
60
+      {{building.propertyPrice}} 元/m²/月
29
     </x-field>
61
     </x-field>
30
 
62
 
31
-    <x-field label="税费">
32
-      {{getDictLabel(roomInfo.buildTime, 'build_time') || '未知'}}
63
+    
64
+<x-field label="燃气管道">
65
+      {{ getDictLabel(roomInfo.gas, "gas") }}
33
     </x-field>
66
     </x-field>
34
 
67
 
68
+    <x-field label="家电">
69
+      {{ getDictLabel(roomInfo.electricEquipment, "electricEquipment") }}
70
+    </x-field>
71
+
72
+    <x-field label="隔断">
73
+      {{ getDictLabel(roomInfo.separate, "separate") }}
74
+    </x-field>
75
+    
76
+
77
+
35
     <x-field label="来源">
78
     <x-field label="来源">
36
-      {{getDictLabel(roomInfo.sourceFrom, 'sourceFrom')}}
79
+      {{ getDictLabel(roomInfo.sourceFrom, "sourceFrom") }}
37
     </x-field>
80
     </x-field>
38
 
81
 
82
+        <x-field label="优势推荐">
83
+      {{ roomInfo.specialDesc }}
84
+    </x-field>
85
+    
39
   </div>
86
   </div>
40
 </template>
87
 </template>
41
 
88
 
42
 <script>
89
 <script>
43
-import { computed } from 'vue'
44
-import { useModel } from '@zjxpcyc/vue-tiny-store'
90
+import { computed } from "vue";
91
+import { useModel } from "@zjxpcyc/vue-tiny-store";
45
 
92
 
46
 export default {
93
 export default {
47
   props: {
94
   props: {
48
     roomInfo: {
95
     roomInfo: {
49
       type: Object,
96
       type: Object,
50
-      default: () => ({})
51
-    }
97
+      default: () => ({}),
98
+    },
99
+    building: {
100
+      type: Object,
101
+      default: () => ({}),
102
+    },
52
   },
103
   },
53
   setup(props) {
104
   setup(props) {
54
-    const { dicts, getDict } = useModel('dicts')
105
+    const { dicts, getDict } = useModel("dicts");
55
 
106
 
56
     // 朝向
107
     // 朝向
57
     if (!dicts.aspect || !dicts.aspect.length) {
108
     if (!dicts.aspect || !dicts.aspect.length) {
58
-      getDict('aspect')
109
+      getDict("aspect");
59
     }
110
     }
60
 
111
 
61
     // 装修
112
     // 装修
62
     if (!dicts.decoration || !dicts.decoration.length) {
113
     if (!dicts.decoration || !dicts.decoration.length) {
63
-      getDict('decoration')
114
+      getDict("decoration");
64
     }
115
     }
65
 
116
 
66
     // 房屋用途
117
     // 房屋用途
67
     if (!dicts.purpose || !dicts.purpose.length) {
118
     if (!dicts.purpose || !dicts.purpose.length) {
68
-      getDict('purpose')
119
+      getDict("purpose");
69
     }
120
     }
70
 
121
 
71
     // 建筑类型
122
     // 建筑类型
72
-    if (!dicts['build_type'] || !dicts['build_type'].length) {
73
-      getDict('build_type')
123
+    if (!dicts["build_type"] || !dicts["build_type"].length) {
124
+      getDict("build_type");
74
     }
125
     }
75
 
126
 
76
     // 电梯
127
     // 电梯
77
     if (!dicts.elevator || !dicts.elevator.length) {
128
     if (!dicts.elevator || !dicts.elevator.length) {
78
-      getDict('elevator')
129
+      getDict("elevator");
79
     }
130
     }
80
 
131
 
81
     // 抵押信息
132
     // 抵押信息
82
     if (!dicts.mortgage || !dicts.mortgage.length) {
133
     if (!dicts.mortgage || !dicts.mortgage.length) {
83
-      getDict('mortgage')
134
+      getDict("mortgage");
84
     }
135
     }
85
 
136
 
86
     // 税费
137
     // 税费
87
-    if (!dicts['build_time'] || !dicts['build_time'].length) {
88
-      getDict('build_time')
138
+    if (!dicts["build_time"] || !dicts["build_time"].length) {
139
+      getDict("build_time");
89
     }
140
     }
90
 
141
 
91
     // 来源
142
     // 来源
92
     if (!dicts.sourceFrom || !dicts.sourceFrom.length) {
143
     if (!dicts.sourceFrom || !dicts.sourceFrom.length) {
93
-      getDict('sourceFrom')
144
+      getDict("sourceFrom");
145
+    }
146
+
147
+    //居住现状
148
+    if (!dicts.liveStatus || !dicts.liveStatus.length) {
149
+      getDict("liveStatus");
94
     }
150
     }
95
 
151
 
152
+    // 性别限制
153
+    if (!dicts.limitSex || !dicts.limitSex.length) {
154
+      getDict("limitSex");
155
+    }
156
+
157
+    //卧室
158
+    if (!dicts.liveRoom || !dicts.liveRoom.length) {
159
+      getDict("liveRoom");
160
+    }
161
+    // 房屋特色
162
+    if (!dicts.roomSpecial || !dicts.roomSpecial.length) {
163
+      getDict("roomSpecial");
164
+    }
165
+
166
+    //车位
167
+    if (!dicts.parking || !dicts.parking.length) {
168
+      getDict("parking");
169
+    }
170
+
171
+// 地下室
172
+     if (!dicts.build_time || !dicts.build_time.length) {
173
+      getDict("build_time");
174
+    }
175
+// 物业费
176
+      if (!dicts.basement || !dicts.basement.length) {
177
+      getDict("basement");
178
+    }
179
+
180
+    // 燃气管道
181
+      if (!dicts.gas || !dicts.gas.length) {
182
+      getDict("gas");
183
+    }
184
+
185
+// 家电
186
+    if (!dicts.electricEquipment || !dicts.electricEquipment.length) {
187
+      getDict("electricEquipment");
188
+    }
189
+
190
+// 隔断
191
+    if (!dicts.separate || !dicts.separate.length) {
192
+      getDict("separate");
193
+    }
194
+    
195
+
96
     const roomType = computed(() => {
196
     const roomType = computed(() => {
97
-      const [a, b, c, d] = (props.roomInfo.roomType || '').split(',')
98
-      return `${a || ''}室 ${b || '0'}厅 ${c || '0'}厨 ${d || '0'}卫`
99
-    })
197
+      const [a, b, c, d] = (props.roomInfo.roomType || "").split(",");
198
+      return `${a || ""}室 ${b || "0"}厅 ${c || "0"}厨 ${d || "0"}卫`;
199
+    });
200
+
201
+    const floor = computed(() => {
202
+      const [a, b, c] = (props.roomInfo.roomFloor || "").split(",");
203
+      return `${a || ""}/${b || ""}(${c || ""})`;
204
+    });
205
+
206
+    // 梯户比例
207
+    const proportion = computed(() => {
208
+      const [a, b] = (props.roomInfo.proportion || "").split(",");
209
+      return `${a || ""}梯${b || ""}户`;
210
+    });
100
 
211
 
101
     // 获取字典对应名称
212
     // 获取字典对应名称
102
     const getDictLabel = (val, key) => {
213
     const getDictLabel = (val, key) => {
103
-      return dicts[key]?.filter(x => x.code === val)[0]?.name
104
-    }
214
+      return dicts[key]?.filter((x) => x.value === val)[0]?.text;
215
+    };
105
 
216
 
106
     return {
217
     return {
218
+      floor,
107
       roomType,
219
       roomType,
220
+      proportion,
108
       getDictLabel,
221
       getDictLabel,
109
-    }
110
-  }
111
-}
222
+    };
223
+  },
224
+};
112
 </script>
225
 </script>

+ 6
- 8
src/view/renting/detail/components/Main.vue 查看文件

27
       }}
27
       }}
28
     </x-field>
28
     </x-field>
29
 
29
 
30
-    <x-field label="楼层">
31
-      {{ floor }}
32
-    </x-field>
30
+
33
 
31
 
34
     <x-field label="创建方式">
32
     <x-field label="创建方式">
35
       {{ roomInfo.createMethod === "1" ? "外部录入" : "荟居录入" }}
33
       {{ roomInfo.createMethod === "1" ? "外部录入" : "荟居录入" }}
131
     const unfollowRoom = ref();
129
     const unfollowRoom = ref();
132
     const { dicts, getDict } = useModel("dicts");
130
     const { dicts, getDict } = useModel("dicts");
133
 
131
 
134
-    const floor = computed(() => {
135
-      const [a, b, c] = (props.roomInfo.roomFloor || "").split(",");
136
-      return `${a || ""}/${b || ""}(${c || ""})`;
137
-    });
132
+    // const floor = computed(() => {
133
+    //   const [a, b, c] = (props.roomInfo.roomFloor || "").split(",");
134
+    //   return `${a || ""}/${b || ""}(${c || ""})`;
135
+    // });
138
 
136
 
139
     // 居室
137
     // 居室
140
     const roomType = computed(() => {
138
     const roomType = computed(() => {
206
     };
204
     };
207
 
205
 
208
     return {
206
     return {
209
-      floor,
207
+      // floor,
210
       roomType,
208
       roomType,
211
       avgPrice,
209
       avgPrice,
212
       leaseWay,
210
       leaseWay,

+ 2
- 2
src/view/renting/detail/index.vue 查看文件

33
             <template #title>
33
             <template #title>
34
               <div>基础信息</div>
34
               <div>基础信息</div>
35
             </template>
35
             </template>
36
-            <RoomBase :room-info="detail.roomInfo" />
36
+            <RoomBase :room-info="detail.roomInfo" :building="detail.building" />
37
           </van-collapse-item>
37
           </van-collapse-item>
38
 
38
 
39
           <van-collapse-item name="2">
39
           <van-collapse-item name="2">
174
     const collapseItem = ref()
174
     const collapseItem = ref()
175
     const phone = ref("")
175
     const phone = ref("")
176
 
176
 
177
-    const { detail, getDetail } = useModel("room")
177
+    const { detail, getDetail } = useModel("renting")
178
 
178
 
179
     onMounted(() => {
179
     onMounted(() => {
180
       getDetail(roomId);
180
       getDetail(roomId);

+ 1
- 1
vue.config.js 查看文件

12
     proxy: {
12
     proxy: {
13
       '/mp': {
13
       '/mp': {
14
         target: 'http://10.161.7.66:8080/',
14
         target: 'http://10.161.7.66:8080/',
15
-        target: 'http://localhost:8080/',
15
+        // target: 'http://localhost:8080/',
16
         ws: true,
16
         ws: true,
17
         changeOrigin: true,
17
         changeOrigin: true,
18
         // pathRewrite: {'^/mp': ''}
18
         // pathRewrite: {'^/mp': ''}