zlisen 4 gadus atpakaļ
vecāks
revīzija
17c8671f43

+ 1
- 1
src/layout/index.vue Parādīt failu

@@ -7,7 +7,7 @@
7 7
     <div class="lay-footer">
8 8
       <van-tabbar route>
9 9
         <van-tabbar-item replace to="/home" icon="home-o">首页</van-tabbar-item>
10
-        <van-tabbar-item replace to="/addhouse" icon="add-o">录入</van-tabbar-item>
10
+        <van-tabbar-item replace to="/house/add" icon="add-o">录入</van-tabbar-item>
11 11
         <van-tabbar-item replace to="/user" icon="user-o">我的</van-tabbar-item>
12 12
       </van-tabbar>
13 13
     </div>

+ 77
- 0
src/view/renting/detail/components/Auth.vue Parādīt failu

@@ -0,0 +1,77 @@
1
+<template>
2
+  <x-loading x-id="room.auth">
3
+    <p v-if="!roomAuth">暂无业主委托书</p>
4
+    <p v-else-if="roomAuth.status === '1'">当前委托书正在审核中</p>
5
+    <div v-else>
6
+      <shiro name="room:info:auth">
7
+        <template #callback>
8
+          <van-empty image="error" description="无委托书协议查看权限" />
9
+        </template>
10
+
11
+        <x-field label=" " v-if="roomAuthBox.isCreate">
12
+          <van-button size="small" type="danger">删除委托书</van-button>
13
+        </x-field>
14
+
15
+        <x-field label="上传人">
16
+          {{roomAuth.authUserName}} ({{roomAuth.authUserPhone}})
17
+        </x-field>
18
+
19
+        <x-field label="上传时间">
20
+          {{roomAuth.updateTime}}
21
+        </x-field>
22
+        
23
+        <x-field label="委托书编号">
24
+          {{roomAuth.serialNum}}
25
+        </x-field>
26
+        
27
+        <x-field label="起始时间">
28
+          {{roomAuth.startTime}}
29
+        </x-field>
30
+        
31
+        <x-field label="截止时间">
32
+          {{roomAuth.startTime || '售出为止'}}
33
+        </x-field>
34
+
35
+        <van-image width="100" height="100" :src="roomAuth.url" />
36
+      </shiro>
37
+
38
+      <div v-shiro="'room:info:addAuth'" v-if="!roomAuth">
39
+        <van-button size="small" type="warn">上传业主委托书</van-button>
40
+      </div>
41
+    </div>
42
+  </x-loading>
43
+</template>
44
+
45
+<script>
46
+import { Empty, Button, Image } from 'vant'
47
+import { useModel } from "@zjxpcyc/vue-tiny-store"
48
+import { computed, onMounted } from 'vue'
49
+
50
+export default {
51
+  components: {
52
+    [Empty.name]: Empty,
53
+    [Button.name]: Button,
54
+    [Image.name]: Image,
55
+  },
56
+  props: {
57
+    roomId: undefined
58
+  },
59
+  setup(props) {
60
+    const { detail, roomAuthBox, getAuth } = useModel("room")
61
+
62
+    const roomAuth = computed(() => roomAuthBox.roomAuth)
63
+
64
+    onMounted(() => {
65
+      if (!roomAuthBox.roomAuth) {
66
+        getAuth(props.roomId)
67
+      }
68
+    })
69
+
70
+    return {
71
+      detail,
72
+      roomAuthBox,
73
+      roomAuth,
74
+    }
75
+  }
76
+}
77
+</script>

+ 112
- 0
src/view/renting/detail/components/Base.vue Parādīt failu

@@ -0,0 +1,112 @@
1
+<template>
2
+  <div>
3
+    <x-field label="户型">
4
+      {{roomType}}
5
+    </x-field>
6
+
7
+    <x-field label="朝向">
8
+      {{getDictLabel(roomInfo.aspect, 'aspect')}}
9
+    </x-field>
10
+
11
+    <x-field label="装修">
12
+      {{getDictLabel(roomInfo.decoration, 'decoration')}}
13
+    </x-field>
14
+
15
+    <x-field label="房屋用途">
16
+      {{getDictLabel(roomInfo.purpose, 'purpose')}}
17
+    </x-field>
18
+
19
+    <x-field label="建筑类型">
20
+      {{getDictLabel(roomInfo.buildType, 'build_type')}}
21
+    </x-field>
22
+
23
+    <x-field label="配备电梯">
24
+      {{getDictLabel(roomInfo.elevator, 'elevator')}}
25
+    </x-field>
26
+
27
+    <x-field label="抵押信息">
28
+      {{getDictLabel(roomInfo.isMortgage, 'mortgage') || '无'}}
29
+    </x-field>
30
+
31
+    <x-field label="税费">
32
+      {{getDictLabel(roomInfo.buildTime, 'build_time') || '未知'}}
33
+    </x-field>
34
+
35
+    <x-field label="来源">
36
+      {{getDictLabel(roomInfo.sourceFrom, 'sourceFrom')}}
37
+    </x-field>
38
+
39
+  </div>
40
+</template>
41
+
42
+<script>
43
+import { computed } from 'vue'
44
+import { useModel } from '@zjxpcyc/vue-tiny-store'
45
+
46
+export default {
47
+  props: {
48
+    roomInfo: {
49
+      type: Object,
50
+      default: () => ({})
51
+    }
52
+  },
53
+  setup(props) {
54
+    const { dicts, getDict } = useModel('dicts')
55
+
56
+    // 朝向
57
+    if (!dicts.aspect || !dicts.aspect.length) {
58
+      getDict('aspect')
59
+    }
60
+
61
+    // 装修
62
+    if (!dicts.decoration || !dicts.decoration.length) {
63
+      getDict('decoration')
64
+    }
65
+
66
+    // 房屋用途
67
+    if (!dicts.purpose || !dicts.purpose.length) {
68
+      getDict('purpose')
69
+    }
70
+
71
+    // 建筑类型
72
+    if (!dicts['build_type'] || !dicts['build_type'].length) {
73
+      getDict('build_type')
74
+    }
75
+
76
+    // 电梯
77
+    if (!dicts.elevator || !dicts.elevator.length) {
78
+      getDict('elevator')
79
+    }
80
+
81
+    // 抵押信息
82
+    if (!dicts.mortgage || !dicts.mortgage.length) {
83
+      getDict('mortgage')
84
+    }
85
+
86
+    // 税费
87
+    if (!dicts['build_time'] || !dicts['build_time'].length) {
88
+      getDict('build_time')
89
+    }
90
+
91
+    // 来源
92
+    if (!dicts.sourceFrom || !dicts.sourceFrom.length) {
93
+      getDict('sourceFrom')
94
+    }
95
+
96
+    const roomType = computed(() => {
97
+      const [a, b, c, d] = (props.roomInfo.roomType || '').split(',')
98
+      return `${a || ''}室 ${b || '0'}厅 ${c || '0'}厨 ${d || '0'}卫`
99
+    })
100
+
101
+    // 获取字典对应名称
102
+    const getDictLabel = (val, key) => {
103
+      return dicts[key]?.filter(x => x.code === val)[0]?.name
104
+    }
105
+
106
+    return {
107
+      roomType,
108
+      getDictLabel,
109
+    }
110
+  }
111
+}
112
+</script>

+ 32
- 0
src/view/renting/detail/components/Estate.vue Parādīt failu

@@ -0,0 +1,32 @@
1
+<template>
2
+  <div v-if="buildInfo">
3
+    <x-field label="物业费">
4
+      {{buildInfo.propertyPrice}} 元/m²/月
5
+    </x-field>
6
+    <x-field label="建筑年代">
7
+      {{buildInfo.buildYear}}
8
+    </x-field>
9
+    <x-field label="均价">
10
+      {{buildInfo.averagePrice}}
11
+    </x-field>
12
+    <x-field label="开发商">
13
+      {{buildInfo.developer}}
14
+    </x-field>
15
+    <x-field label="物业公司">
16
+      {{buildInfo.propertyCompany}}
17
+    </x-field>
18
+  </div>
19
+  <p v-else>暂无物业信息</p>
20
+</template>
21
+
22
+<script>
23
+export default {
24
+  props: {
25
+    buildInfo: Object,
26
+    default: () => ({})
27
+  },
28
+  setup() {
29
+    //
30
+  }
31
+}
32
+</script>

+ 63
- 0
src/view/renting/detail/components/Follow.vue Parādīt failu

@@ -0,0 +1,63 @@
1
+<template>
2
+  <x-loading x-id="room.follow.list">
3
+    <p v-if="!list.length">暂无跟进记录</p>
4
+    <van-steps direction="vertical" :active="0" v-else>
5
+      <van-step v-for="(item, index) in list" :key="index">
6
+        <p>
7
+          {{item.followUserName}} {{item.createTime}}
8
+        </p>
9
+        <p>
10
+          {{item.followType === '0' ? '看房, ': ''}}
11
+          {{item.followDesc}}
12
+        </p>
13
+        <p v-if="item.followImg">
14
+          <van-image width="100" height="100" :src="item.followImg" />
15
+        </p>          
16
+      </van-step>
17
+    </van-steps>
18
+  </x-loading>
19
+</template>
20
+
21
+<script>
22
+import { onMounted, ref } from 'vue'
23
+import { List, Step, Steps, Image } from 'vant'
24
+import request from '@/utils/request'
25
+
26
+export default {
27
+  components: {
28
+    [List.name]: List,
29
+    [Steps.name]: Steps,
30
+    [Step.name]: Step,
31
+    [Image.name]: Image,
32
+  },
33
+  props: {
34
+    roomId: undefined,
35
+  },
36
+  setup(props) {
37
+    const list = ref([])
38
+
39
+    const handleLoad = () => {
40
+      request({
41
+        loadingId: 'room.follow.list',
42
+        url: '/room/follow/list',
43
+        params: {
44
+          roomId: props.roomId,
45
+          pageNo: 1,
46
+          pageSize: 100,
47
+        }
48
+      }).then(res => {
49
+        list.value = res.result
50
+      })
51
+    }
52
+
53
+    onMounted(() => {
54
+      handleLoad()
55
+    })
56
+
57
+    return {
58
+      list,
59
+      handleLoad,
60
+    }
61
+  }
62
+}
63
+</script>

+ 70
- 0
src/view/renting/detail/components/Key.vue Parādīt failu

@@ -0,0 +1,70 @@
1
+<template>
2
+  <x-loading x-id="room.key">
3
+    <p v-if="!roomKey">暂无钥匙信息</p>
4
+    <p v-else-if="roomKey.status === '1'">当前委托书正在审核中</p>
5
+    <div v-else>
6
+      <shiro name="room:info:key">
7
+        <template #callback>
8
+          <van-empty image="error" description="无钥匙协议查看权限" />
9
+        </template>
10
+
11
+        <x-field label=" " v-if="roomKeyBox.isCreate">
12
+          <van-button size="small" type="danger">删除钥匙</van-button>
13
+        </x-field>
14
+
15
+        <x-field label="上传人">
16
+          {{roomKey.keyUserName}} ({{roomKey.keyUserPhone}})
17
+        </x-field>
18
+
19
+        <x-field label="上传时间">
20
+          {{roomKey.updateTime}}
21
+        </x-field>
22
+
23
+        <x-field label="钥匙编号">
24
+          {{roomKey.keyNo}}
25
+        </x-field>
26
+
27
+        <x-field label="存储位置">
28
+          {{roomKey.address}}
29
+        </x-field>
30
+
31
+        <van-image width="100" height="100" :src="roomKey.url" />
32
+
33
+      </shiro>
34
+    </div>
35
+  </x-loading>
36
+</template>
37
+
38
+<script>
39
+import { Empty, Button, Image } from 'vant'
40
+import { useModel } from "@zjxpcyc/vue-tiny-store"
41
+import { computed, onMounted } from 'vue'
42
+
43
+export default {
44
+  components: {
45
+    [Empty.name]: Empty,
46
+    [Button.name]: Button,
47
+    [Image.name]: Image,
48
+  },
49
+  props: {
50
+    roomId: undefined
51
+  },
52
+  setup(props) {
53
+    const { detail, roomKeyBox, getKey } = useModel("room")
54
+
55
+    const roomKey = computed(() => roomKeyBox.roomKey)
56
+
57
+    onMounted(() => {
58
+      if (!roomKeyBox.roomKey) {
59
+        getKey(props.roomId)
60
+      }
61
+    })
62
+
63
+    return {
64
+      detail,
65
+      roomKeyBox,
66
+      roomKey,
67
+    }
68
+  }
69
+}
70
+</script>

+ 63
- 0
src/view/renting/detail/components/Look.vue Parādīt failu

@@ -0,0 +1,63 @@
1
+<template>
2
+  <x-loading x-id="room.look.list">
3
+    <p v-if="!list.length">暂无空看记录</p>
4
+    <van-steps direction="vertical" :active="0" v-else>
5
+      <van-step v-for="(item, index) in list" :key="index">
6
+        <p>
7
+          {{item.followUserName}} {{item.createTime}}
8
+        </p>
9
+        <p>
10
+          {{item.followType === '0' ? '看房, ': ''}}
11
+          {{item.followDesc}}
12
+        </p>
13
+        <p v-if="item.followImg">
14
+          <van-image width="100" height="100" :src="item.followImg" />
15
+        </p>          
16
+      </van-step>
17
+    </van-steps>
18
+  </x-loading>
19
+</template>
20
+
21
+<script>
22
+import { onMounted, ref } from 'vue'
23
+import { List, Step, Steps, Image } from 'vant'
24
+import request from '@/utils/request'
25
+
26
+export default {
27
+  components: {
28
+    [List.name]: List,
29
+    [Steps.name]: Steps,
30
+    [Step.name]: Step,
31
+    [Image.name]: Image,
32
+  },
33
+  props: {
34
+    roomId: undefined,
35
+  },
36
+  setup(props) {
37
+    const list = ref([])
38
+
39
+    const handleLoad = () => {
40
+      request({
41
+        loadingId: 'room.look.list',
42
+        url: '/room/look/list',
43
+        params: {
44
+          roomId: props.roomId,
45
+          pageNo: 1,
46
+          pageSize: 100,
47
+        }
48
+      }).then(res => {
49
+        list.value = res.result
50
+      })
51
+    }
52
+
53
+    onMounted(() => {
54
+      handleLoad()
55
+    })
56
+
57
+    return {
58
+      list,
59
+      handleLoad,
60
+    }
61
+  }
62
+}
63
+</script>

+ 223
- 0
src/view/renting/detail/components/Main.vue Parādīt failu

@@ -0,0 +1,223 @@
1
+<template>
2
+  <x-loading x-id="room.security">
3
+    <x-field label="房源ID"> {{ roomInfo.roomCode }}{{ roomInfo.id }} </x-field>
4
+
5
+    <x-field label="所属楼盘">
6
+      {{ roomInfo.buildingName }}
7
+    </x-field>
8
+
9
+    <x-field label="面积"> {{ roomInfo.acreage }} ㎡ </x-field>
10
+
11
+    <x-field label="居室">
12
+      {{ roomType }}
13
+    </x-field>
14
+
15
+    <x-field label="出租方式">
16
+      {{ leaseWay }}
17
+    </x-field>
18
+
19
+    <x-field label="付款方式">
20
+      {{ payWayOptions.filter((x) => x.value === roomInfo.payWay)[0]?.text }}
21
+    </x-field>
22
+
23
+    <x-field label="装修">
24
+      {{
25
+        decorationOptions.filter((x) => x.value === roomInfo.decoration)[0]
26
+          ?.text
27
+      }}
28
+    </x-field>
29
+
30
+    <x-field label="楼层">
31
+      {{ floor }}
32
+    </x-field>
33
+
34
+    <x-field label="创建方式">
35
+      {{ roomInfo.createMethod === "1" ? "外部录入" : "荟居录入" }}
36
+    </x-field>
37
+
38
+    <!-- 
39
+
40
+
41
+    <x-field label="所属区县">
42
+      {{ otherData.roomCity.areaName }}
43
+    </x-field>
44
+
45
+    <x-field label="所属商圈">
46
+      {{ otherData.roomBusi.areaName }}
47
+    </x-field>
48
+
49
+  
50
+
51
+    <x-field label="价格">
52
+      {{ roomInfo.totalPrice }} 万元 / {{ avgPrice }} 元/㎡
53
+    </x-field> -->
54
+
55
+    <x-field label="楼栋">
56
+      {{ securityInfo.roomBuild || "敏感信息" }}
57
+    </x-field>
58
+
59
+    <x-field label="单元">
60
+      {{ securityInfo.roomUnit || "敏感信息" }}
61
+    </x-field>
62
+
63
+    <x-field label="楼房号">
64
+      {{ securityInfo.roomNum || "敏感信息" }}
65
+    </x-field>
66
+
67
+    <x-field label="业主姓名">
68
+      {{ securityInfo.ownerName || "敏感信息" }}
69
+    </x-field>
70
+
71
+    <x-field label="业主电话">
72
+      {{ securityInfo.ownerTel || "敏感信息" }}
73
+    </x-field>
74
+
75
+    <x-field label=" " v-shiro="'room:info:security'">
76
+      <van-button
77
+        v-if="!unfollowRoom"
78
+        size="small"
79
+        type="warning"
80
+        @click="handleSecurityClick"
81
+        >查看敏感信息(剩余 {{ otherData.leftSecurityNum }} 次)</van-button
82
+      >
83
+      <van-button
84
+        v-else
85
+        size="small"
86
+        type="primary"
87
+        v-shiro="'room:info:addFollow'"
88
+        @click="goToAddFollow"
89
+        >去跟进</van-button
90
+      >
91
+    </x-field>
92
+  </x-loading>
93
+</template>
94
+
95
+<script>
96
+import { computed, ref } from "vue";
97
+import { useRouter } from "vue-router";
98
+import { Button, Dialog } from "vant";
99
+import request from "@/utils/request";
100
+import { showDanger } from "@/utils";
101
+import { useModel } from "@zjxpcyc/vue-tiny-store";
102
+
103
+const getSecurity = (roomId) => {
104
+  return request({
105
+    loadingId: "room.security",
106
+    url: "/room/security",
107
+    params: { roomId },
108
+  })
109
+    .then((res) => {
110
+      return res;
111
+    })
112
+    .catch((e) => {
113
+      return Promise.reject(e);
114
+    });
115
+};
116
+
117
+export default {
118
+  components: {
119
+    [Button.name]: Button,
120
+  },
121
+  props: {
122
+    roomInfo: {
123
+      type: Object,
124
+      default: () => ({}),
125
+    },
126
+    otherData: Object,
127
+  },
128
+  setup(props) {
129
+    const router = useRouter();
130
+    const securityInfo = ref({});
131
+    const unfollowRoom = ref();
132
+    const { dicts, getDict } = useModel("dicts");
133
+
134
+    const floor = computed(() => {
135
+      const [a, b, c] = (props.roomInfo.roomFloor || "").split(",");
136
+      return `${a || ""}/${b || ""}(${c || ""})`;
137
+    });
138
+
139
+    // 居室
140
+    const roomType = computed(() => {
141
+      const [a, b, c, d] = (props.roomInfo.roomType || "").split(",");
142
+      return `${a || 0}室${b || 0}厅${c || 0}厨${d || 0}卫`;
143
+    });
144
+    // 出租方式
145
+    const leaseWay = computed(() => {
146
+      console.log("出租方式", dicts["leaseWay"]);
147
+      return dicts["leaseWay"].filter(
148
+        (x) => x.value === props.roomInfo.leaseWay
149
+      )[0]?.text;
150
+    });
151
+
152
+    const avgPrice = computed(() => {
153
+      return Number(
154
+        (props.roomInfo.totalPrice * 10000) / props.roomInfo.acreage
155
+      ).toFixed(2);
156
+    });
157
+
158
+    // 支付方式
159
+    const payWayOptions = computed(() => {
160
+      const payWayDict = dicts.payWay || [];
161
+      if (!payWayDict.length) {
162
+        getDict("payWay");
163
+      }
164
+
165
+      return payWayDict;
166
+    });
167
+
168
+    const decorationOptions = computed(() => {
169
+      const decorationDict = dicts.decoration || [];
170
+      if (!decorationDict.length) {
171
+        getDict("decoration");
172
+      }
173
+
174
+      return decorationDict;
175
+    });
176
+
177
+    const goToAddFollow = () =>
178
+      router.push({
179
+        name: "secondhand.detail",
180
+        query: { roomId: unfollowRoom.value.id },
181
+      });
182
+
183
+    const handleSecurityClick = () => {
184
+      if (!securityInfo.value.roomBuild) {
185
+        getSecurity(props.roomInfo.id)
186
+          .then((res) => {
187
+            securityInfo.value = res || {};
188
+            unfollowRoom.value = undefined;
189
+          })
190
+          .catch((e) => {
191
+            if ("1003" === e.code) {
192
+              unfollowRoom.value = JSON.parse(e.message);
193
+
194
+              Dialog.alert({
195
+                title: "去跟进",
196
+                message: `您存在未跟进的房源,房源编号: ${unfollowRoom.value.id}`,
197
+              }).then(() => {
198
+                // todo
199
+              });
200
+            } else {
201
+              unfollowRoom.value = undefined;
202
+              showDanger("查看敏感信息失败");
203
+            }
204
+          });
205
+      }
206
+    };
207
+
208
+    return {
209
+      floor,
210
+      roomType,
211
+      avgPrice,
212
+      leaseWay,
213
+
214
+      securityInfo,
215
+      handleSecurityClick,
216
+      unfollowRoom,
217
+      goToAddFollow,
218
+      payWayOptions,
219
+      decorationOptions,
220
+    };
221
+  },
222
+};
223
+</script>

+ 128
- 0
src/view/renting/detail/components/Role.vue Parādīt failu

@@ -0,0 +1,128 @@
1
+<template>
2
+  <x-loading x-id="room.role">
3
+    <x-field label="首次录入人">
4
+      {{firstInputUser}}
5
+    </x-field>
6
+    <x-field label="首次录入时间">
7
+      {{roomRole.createTime}}
8
+    </x-field>
9
+    
10
+    <x-field label="录入人">
11
+      {{inputUser}}
12
+    </x-field>
13
+    <x-field label="录入时间">
14
+      {{roomRole.recordTime}}
15
+    </x-field>
16
+    
17
+    <x-field label="维护人">
18
+      {{getNameFormated(roomRole.belongName, roomRole.belongId)}}
19
+    </x-field>
20
+    <x-field label=" " v-shiro="'room:info:belongTel'">
21
+      <van-button size="small" type="warning">查看电话</van-button>
22
+    </x-field>
23
+    
24
+    <x-field label="实勘人">
25
+      {{getNameFormated(roomRole.rescName, roomRole.rescId)}}
26
+    </x-field>
27
+    <x-field label="达成时间">
28
+      {{roomRole.rescTime}}
29
+    </x-field>
30
+    
31
+    <x-field label="钥匙人">
32
+      {{getNameFormated(roomRole.keyName, roomRole.keyId)}}
33
+    </x-field>
34
+
35
+    <x-field label="委托人">
36
+      {{getNameFormated(roomRole.authName, roomRole.authId)}}
37
+    </x-field>
38
+    <x-field label="委托时间">
39
+      {{roomRole.authTime}}
40
+    </x-field>
41
+
42
+    <x-field label="最后修改人">
43
+      {{getNameFormated(roomRole.updateName, roomRole.updateId)}}
44
+    </x-field>
45
+    <x-field label="最后修改时间">
46
+      {{roomRole.updateTime}}
47
+    </x-field>
48
+
49
+    <template v-if="roomInfo.roomStatus === '8'">
50
+      <x-field label="成交人">
51
+        {{getNameFormated(roomRole.doneName, roomRole.doneId)}}
52
+      </x-field>
53
+      <x-field label="成交时间">
54
+        {{roomRole.doneTime}}
55
+      </x-field>
56
+    </template>
57
+
58
+    <template v-if="roomInfo.roomStatus !== '0' && roomInfo.roomStatus !== '8'">
59
+      <x-field label="申请关闭人">
60
+        {{getNameFormated(roomRole.applyCloseName, roomRole.applyCloseId)}}
61
+      </x-field>
62
+      <x-field label="申请关闭时间">
63
+        {{roomRole.applyCloseTime}}
64
+      </x-field>
65
+      <x-field label="关闭操作人">
66
+        {{getNameFormated(roomRole.closeName, roomRole.closeId)}}
67
+      </x-field>
68
+      <x-field label="关闭操作时间">
69
+        {{roomRole.closeTime}}
70
+      </x-field>
71
+    </template>
72
+
73
+  </x-loading>
74
+</template>
75
+
76
+<script>
77
+import { useModel } from '@zjxpcyc/vue-tiny-store'
78
+import { computed, onMounted } from 'vue'
79
+import { Button } from 'vant'
80
+
81
+export default {
82
+  components: {
83
+    [Button.name]: Button,
84
+  },
85
+  props: {
86
+    roomInfo: {
87
+      type: Object,
88
+      default: () => ({})
89
+    },
90
+  },
91
+  setup(props) {
92
+    const { roomRole, getRole } = useModel("room")
93
+
94
+    const getNameFormated = (name, id) => {
95
+      return name + (name ? `(ID:${id})` : '')
96
+    }
97
+    
98
+    const firstInputUser = computed(() => {
99
+      const createMethod = props.roomInfo?.createMethod
100
+      if (createMethod === '1') {
101
+        return '外部录入'
102
+      } else {
103
+        return getNameFormated(roomRole.createName, roomRole.createId)
104
+      }
105
+    })
106
+
107
+    const inputUser = computed(() => {
108
+      const createMethod = props.roomInfo?.createMethod
109
+      if (createMethod === '1') {
110
+        return '外部录入'
111
+      } else {
112
+        return getNameFormated(roomRole.recordName, roomRole.recordId)
113
+      }
114
+    })
115
+
116
+    onMounted(() => {
117
+      getRole(props.roomInfo.id)
118
+    })
119
+
120
+    return {
121
+      roomRole,
122
+      firstInputUser,
123
+      inputUser,
124
+      getNameFormated,
125
+    }
126
+  }
127
+}
128
+</script>

+ 159
- 363
src/view/renting/detail/index.vue Parādīt failu

@@ -1,115 +1,108 @@
1 1
 <template>
2 2
   <div class="secondhanddetail">
3
-    <div>
4
-      <Swiper></Swiper>
5
-    </div>
3
+    <!-- xId='room.view' -->
4
+    <x-loading x-id="room.view" tip="正在加载详情">
5
+      <div>
6
+        <Swiper></Swiper>
7
+      </div>
6 8
 
7
-    <div class="title">
8
-      <p>TITLE</p>
9
-    </div>
9
+      <div class="title">
10
+        <p class="body">{{ detail.roomInfo?.title }}</p>
11
+        
12
+        <van-popover
13
+          v-model:show="showPopover"
14
+          :actions="actions"
15
+          @select="onSelect"
16
+          placement="bottom-end"
17
+        >
18
+          <template #reference>
19
+            <div class="action">
20
+              <van-icon name="wap-nav" />
21
+            </div>
22
+          </template>
23
+        </van-popover>
24
+      </div>
10 25
 
11
-    <div class="detailcard">
12
-      <div class="detailcard-title">
13
-        <span>房源信息</span>
26
+      <van-cell-group title="房源信息">
27
+        <RoomMain :room-info="detail.roomInfo" :other-data="roomOtherData" />
28
+      </van-cell-group>
14 29
 
15
-        <div style="float:right">
16
-          <van-popover
17
-            v-model:show="showPopover"
18
-            :actions="actions"
19
-            @select="onSelect"
20
-            placement="bottom-end"
21
-          >
22
-            <template #reference>
23
-              <van-icon name="chat-o" />
30
+      <van-cell-group title="其他信息">
31
+        <van-collapse v-model="collapseItem" accordion>
32
+          <van-collapse-item name="1">
33
+            <template #title>
34
+              <div>基础信息</div>
24 35
             </template>
25
-          </van-popover>
26
-        </div>
27
-      </div>
28
-      <Contextc :options="housingInformationOptions"></Contextc>
29
-    </div>
30
-    <div class="detailcard">
31
-      <div class="detailcard-title">
32
-        <span>基础信息</span>
33
-      </div>
34
-      <Contextc :options="baseInformationOptions"></Contextc>
35
-    </div>
36
-    <!-- <div class="detailcard">
37
-      <div class="detailcard-title">
38
-        <span>物业信息</span>
39
-      </div>
40
-      <Contextc :options="propertyInformationOptions"></Contextc>
41
-    </div> -->
42
-    <div class="detailcard">
43
-      <div class="detailcard-title">
44
-        <span>角色人</span>
45
-      </div>
46
-      <Contextc :options="roleInformationOptions"></Contextc>
47
-    </div>
48
-    <!-- <div class="detailcard">
49
-      <div class="detailcard-title">
50
-        <span>委托书</span>
51
-      </div>
52
-      <Contextc :options="entrustOptions" nodata=""></Contextc>
53
-    </div> -->
54
-    <div class="detailcard">
55
-      <div class="detailcard-title">
56
-        <span>钥匙</span>
57
-      </div>
58
-      <Contextc :options="keyOptions" nodata=""></Contextc>
59
-    </div>
36
+            <RoomBase :room-info="detail.roomInfo" />
37
+          </van-collapse-item>
60 38
 
61
-    <div class="detailcard">
62
-      <div class="detailcard-title">
63
-        <van-row>
64
-          <van-col span="12"> <span>跟进记录</span></van-col>
65
-          <van-col span="12" style="line-height:26px;display: flex;">
66
-            <van-button type="default" color="#d75e3a" size="mini"
67
-              >添加跟进</van-button
68
-            ></van-col
69
-          >
70
-        </van-row>
71
-      </div>
72
-      <div>
73
-        <Stepc></Stepc>
74
-      </div>
75
-    </div>
39
+          <van-collapse-item name="2">
40
+            <template #title>
41
+              <div>物业信息</div>
42
+            </template>
43
+            <RoomEstate :build-info="detail.building" />
44
+          </van-collapse-item>
76 45
 
77
-    <div class="detailcard">
78
-      <div class="detailcard-title">
79
-        <van-row>
80
-          <van-col span="12"> <span>空看记录</span></van-col>
81
-          <van-col span="12" style="line-height:26px;display: flex;">
82
-            <van-button type="default" color="#d75e3a" size="mini"
83
-              >添加空看</van-button
84
-            ></van-col
85
-          >
86
-        </van-row>
87
-      </div>
88
-      <div>
89
-        <Stepc></Stepc>
90
-      </div>
91
-    </div>
46
+          <van-collapse-item name="role">
47
+            <template #title>
48
+              <div>角色人</div>
49
+            </template>
50
+            <RoomRole :room-info="detail.roomInfo" />
51
+          </van-collapse-item>
52
+          
53
+          <van-collapse-item name="auth">
54
+            <template #title>
55
+              <div>委托书</div>
56
+            </template>
57
+            <RoomAuth :room-id="roomId" />
58
+          </van-collapse-item>
59
+          
60
+          <van-collapse-item name="key">
61
+            <template #title>
62
+              <div>钥匙</div>
63
+            </template>
64
+            <RoomKey :room-id="roomId" />
65
+          </van-collapse-item>
92 66
 
93
-    <van-share-sheet
94
-      v-model:show="showShare"
95
-      title="立即分享给好友"
96
-      :options="shareOptions"
97
-      @select="onShareSelect"
98
-    />
67
+          <van-collapse-item name="follow">
68
+            <template #title>
69
+              <div>跟进记录</div>
70
+            </template>
71
+            <RoomFollow :room-id="roomId" />
72
+          </van-collapse-item>
73
+
74
+          <van-collapse-item name="look">
75
+            <template #title>
76
+              <div>空看记录</div>
77
+            </template>
78
+            <RoomLook :room-id="roomId" />
79
+          </van-collapse-item>
80
+          
81
+        </van-collapse>
82
+      </van-cell-group>
99 83
 
100
-    <van-dialog v-model:show="phoneShow" title="新增电话" show-cancel-button>
101
-      <van-field
102
-        v-model="phone"
103
-        type="tel"
104
-        label="业主电话"
105
-        placeholder="请输入电话"
84
+      <van-share-sheet
85
+        v-model:show="showShare"
86
+        title="立即分享给好友"
87
+        :options="shareOptions"
88
+        @select="onShareSelect"
106 89
       />
107
-    </van-dialog>
90
+
91
+      <van-dialog v-model:show="phoneShow" title="新增电话" show-cancel-button>
92
+        <van-field
93
+          v-model="phone"
94
+          type="tel"
95
+          label="业主电话"
96
+          placeholder="请输入电话"
97
+        />
98
+      </van-dialog>
99
+    </x-loading>
108 100
   </div>
109 101
 </template>
110 102
 
111 103
 <script>
112
-import { reactive, ref } from "vue";
104
+import { ref, onMounted, computed } from "vue";
105
+import { useRouter } from "vue-router";
113 106
 import { Swiper } from "../../../components/detailCompents";
114 107
 import {
115 108
   Icon,
@@ -123,15 +116,30 @@ import {
123 116
   ShareSheet,
124 117
   Toast,
125 118
   Field,
119
+  Cell,
120
+  CellGroup,
121
+  Collapse,
122
+  CollapseItem,
126 123
 } from "vant";
127
-import Contextc from "../../../components/contextC";
128
-import Stepc from "../../../components/stepC";
124
+import { useModel } from "@zjxpcyc/vue-tiny-store"
125
+import RoomMain from './components/Main'
126
+import RoomBase from './components/Base'
127
+import RoomEstate from './components/Estate'
128
+import RoomRole from './components/Role'
129
+import RoomAuth from './components/Auth'
130
+import RoomKey from './components/Key'
131
+import RoomFollow from './components/Follow'
132
+import RoomLook from './components/Look'
133
+// import Contextc from "../../../components/contextC"
129 134
 // import { router } from "../../../router";
130
-import { useRouter } from "vue-router";
131 135
 
132 136
 export default {
133 137
   name: "secondhanddetail",
134 138
   components: {
139
+    [CellGroup.name]: CellGroup,
140
+    [Cell.name]: Cell,
141
+    [Collapse.name]: Collapse,
142
+    [CollapseItem.name]: CollapseItem,
135 143
     [Row.name]: Row,
136 144
     [Col.name]: Col,
137 145
     [Popover.name]: Popover,
@@ -143,32 +151,42 @@ export default {
143 151
     [Field.name]: Field,
144 152
     [Dialog.Component.name]: Dialog.Component,
145 153
 
146
-    Stepc: Stepc,
147
-    Contextc: Contextc,
148 154
     Swiper: Swiper,
155
+    RoomMain,
156
+    RoomBase,
157
+    RoomEstate,
158
+    RoomRole,
159
+    RoomAuth,
160
+    RoomKey,
161
+    RoomFollow,
162
+    RoomLook,
149 163
   },
150 164
   data() {
151 165
     return {};
152 166
   },
153 167
 
154 168
   setup() {
155
-    const router = useRouter();
156
-    const showPopover = ref(false);
157
-    const showShare = ref(false);
158
-    const phoneShow = ref(false);
159
-    const phone = ref("");
169
+    const router = useRouter()
170
+    const roomId = router.currentRoute.value.query.roomId
171
+    const showPopover = ref(false)
172
+    const showShare = ref(false)
173
+    const phoneShow = ref(false)
174
+    const collapseItem = ref()
175
+    const phone = ref("")
160 176
 
161
-    const data = reactive({})
177
+    const { detail, getDetail } = useModel("room")
162 178
 
163
-  console.log(data)
179
+    onMounted(() => {
180
+      getDetail(roomId);
181
+    });
164 182
 
165 183
     // 通过 actions 属性来定义菜单选项
166 184
     const actions = [
167
-      // { text: "设置房源保护", value: "1" },
185
+      { text: "设置房源保护", value: "1" },
168 186
       { text: "新增业主电话", value: "2" },
169 187
       { text: "下架房源", value: "3" },
170 188
       { text: "修改房源", value: "4" },
171
-      // { text: "认领房源", value: "5" },
189
+      { text: "分享房源", value: "5" },
172 190
       { text: "房源实勘", value: "6" },
173 191
     ];
174 192
     // 设为房源保护后,只有录入人、同部门的上级以及上级部门的上级可以看到房源敏感信息。
@@ -197,7 +215,7 @@ export default {
197 215
         router.push("/closehouse");
198 216
       } else if (action.value == 4) {
199 217
         // 修改房源
200
-        router.push("/editrenting");
218
+        router.push("/editsecondhandhouse");
201 219
       } else if (action.value == 5) {
202 220
         // 分享房源
203 221
         showShare.value = true;
@@ -206,251 +224,7 @@ export default {
206 224
         router.push("/resc");
207 225
       }
208 226
     };
209
-    const onLookClick = () => {
210
-      console.log("onLookClick");
211
-    };
212
-
213
-    // 房源信息
214
-    const housingInformationOptions = [
215
-      {
216
-        name: "所属楼盘",
217
-        value: "123",
218
-        span: 24,
219
-      },
220
-      {
221
-        name: "房源id",
222
-        value: "123",
223
-      },
224
-      {
225
-        name: "租金",
226
-        value: "123",
227
-      },
228
-      {
229
-        name: "装修",
230
-        value: "123",
231
-      },
232
-      {
233
-        name: "出租方式",
234
-        value: "123",
235
-      },
236
-      {
237
-        name: "居室",
238
-        value: "123",
239
-      },
240
-      {
241
-        name: "付款方式",
242
-        value: "123",
243
-      },
244
-      {
245
-        name: "楼房号",
246
-        value: "123",
247
-      },
248
-      {
249
-        name: "单元",
250
-        value: "123",
251
-      },
252
-      {
253
-        name: "业主姓名",
254
-        value: "123",
255
-      },
256
-      {
257
-        name: "楼栋",
258
-        value: "123",
259
-      },
260
-      {
261
-        name: "业主电话",
262
-        value: "123",
263
-      },
264
-      {
265
-        name: "查看敏感信息",
266
-        value: "123",
267
-        type: "BUTTOM",
268
-        click: () => onLookClick(),
269
-      },
270
-    ];
271
-    // 基本信息
272
-    const baseInformationOptions = [
273
-      {
274
-        name: "楼层",
275
-        value: "123",
276
-      },
277
-      {
278
-        name: "朝向",
279
-        value: "123",
280
-      },
281
-      {
282
-        name: "居住现状",
283
-        value: "123",
284
-      },
285
-      {
286
-        name: "卧室",
287
-        value: "123",
288
-      },
289
-      {
290
-        name: "性别限制",
291
-        value: "123",
292
-      },
293
-      {
294
-        name: "建筑类型",
295
-        value: "123",
296
-      },
297
-      {
298
-        name: "抵押信息",
299
-        value: "123",
300
-      },
301
-      {
302
-        name: "建成年代",
303
-        value: "123",
304
-      },
305
-      {
306
-        name: "物业费",
307
-        value: "123",
308
-      },
309
-      {
310
-        name: "配备电梯",
311
-        value: "123",
312
-      },
313
-      {
314
-        name: "车位",
315
-        value: "123",
316
-      },
317
-      {
318
-        name: "地下室",
319
-        value: "123",
320
-      },
321
-      {
322
-        name: "管道燃气",
323
-        value: "123",
324
-      },
325
-      {
326
-        name: "家电",
327
-        value: "123",
328
-      },
329
-      {
330
-        name: "隔断",
331
-        value: "123",
332
-      },
333
-      {
334
-        name: "房源来源",
335
-        value: "123",
336
-      },
337
-      {
338
-        name: "优势推荐",
339
-        value: "123",
340
-      },
341
-    ];
342
-    // 物业信息
343
-    const propertyInformationOptions = [
344
-      {
345
-        name: "物业费",
346
-        value: "123",
347
-      },
348
-      {
349
-        name: "建筑年代",
350
-        value: "123",
351
-      },
352
-      {
353
-        name: "均价",
354
-        value: "123",
355
-      },
356
-      {
357
-        name: "开发商",
358
-        value: "123",
359
-      },
360
-      {
361
-        name: "物业公司",
362
-        value: "123",
363
-      },
364
-    ];
365
-    // 角色人
366
-    const roleInformationOptions = [
367
-      {
368
-        name: "首次录入人",
369
-        value: "123",
370
-      },
371
-      {
372
-        name: "时间",
373
-        value: "123",
374
-      },
375
-      {
376
-        name: "录入人",
377
-        value: "123",
378
-      },
379
-      {
380
-        name: "时间",
381
-        value: "123",
382
-      },
383
-      {
384
-        name: "维护人",
385
-        value: "123",
386
-      },
387
-      {
388
-        name: "查看电话",
389
-        value: "123",
390
-        type: "BUTTOM",
391
-        onClick: () => {},
392
-      },
393
-      {
394
-        name: "实勘人",
395
-        value: "123",
396
-      },
397
-      {
398
-        name: "时间",
399
-        value: "123",
400
-      },
401
-      {
402
-        name: "钥匙人",
403
-        value: "123",
404
-        span: 24,
405
-      },
406
-
407
-      {
408
-        name: "最后修改人",
409
-        value: "123",
410
-      },
411
-      {
412
-        name: "时间",
413
-        value: "123",
414
-      },
415
-    ];
416
-
417
-    // 委托书
418
-    const entrustOptions = [
419
-      {
420
-        name: "委托书编号",
421
-        value: "123",
422
-      },
423
-      {
424
-        name: "查看委托书",
425
-        value: "123",
426
-        type: "BUTTOM",
427
-        onClick: () => {},
428
-      },
429
-      {
430
-        name: "开始时间",
431
-        value: "123",
432
-      },
433
-      {
434
-        name: "截止时间",
435
-        value: "123",
436
-      },
437
-    ];
438
-
439
-    // 钥匙
440
-    const keyOptions = [
441
-      {
442
-        name: "钥匙编号",
443
-        value: "123",
444
-        span: 24,
445
-      },
446
-
447
-      {
448
-        name: "存放地址",
449
-        value: "123",
450
-        span: 24,
451
-      },
452
-    ];
453
-
227
+        
454 228
     const shareOptions = [
455 229
       { name: "微信", icon: "wechat" },
456 230
       { name: "微博", icon: "weibo" },
@@ -464,14 +238,16 @@ export default {
464 238
       showShare.value = false;
465 239
     };
466 240
 
241
+    const roomOtherData = computed(() => {
242
+      return {
243
+        leftSecurityNum: detail.leftSecurityNum,
244
+        roomCity: {},
245
+        roomBusi: {}
246
+      }
247
+    })
248
+
467 249
     return {
468 250
       phone,
469
-      housingInformationOptions,
470
-      baseInformationOptions,
471
-      propertyInformationOptions,
472
-      roleInformationOptions,
473
-      entrustOptions,
474
-      keyOptions,
475 251
       actions,
476 252
       onSelect,
477 253
       showPopover,
@@ -479,6 +255,10 @@ export default {
479 255
       phoneShow,
480 256
       onShareSelect,
481 257
       shareOptions,
258
+      detail,
259
+      collapseItem,
260
+      roomId,
261
+      roomOtherData,
482 262
     };
483 263
   },
484 264
 };
@@ -488,6 +268,22 @@ export default {
488 268
 <style lang="less">
489 269
 .secondhanddetail {
490 270
   text-align: left;
271
+
272
+  .title {
273
+    padding-left: 1em;
274
+    display: flex;
275
+    align-items: center;
276
+
277
+    .body {
278
+      flex: auto;
279
+    }
280
+
281
+    .action {
282
+      text-align: center;
283
+      width: 64px;
284
+      flex: none;
285
+    }
286
+  }
491 287
 }
492 288
 .secondhand-main::-webkit-scrollbar {
493 289
   display: none; /*隐藏滚动条*/