Ver código fonte

Merge branch 'master' of http://git.ycjcjy.com/ershoufang/mp-agent into master

张延森 4 anos atrás
pai
commit
9aaec9ef20

+ 5
- 4
src/store/models/renting.js Ver arquivo

13
   const page = reactive({})
13
   const page = reactive({})
14
   const detail = reactive({})
14
   const detail = reactive({})
15
   const rentRole = reactive({})
15
   const rentRole = reactive({})
16
-  const rentKeyBox = reactive({})
16
+  const roomKeyBox = reactive({})
17
   const getList = (data) => {
17
   const getList = (data) => {
18
     loading.value = true
18
     loading.value = true
19
     request({
19
     request({
95
         },
95
         },
96
       })
96
       })
97
       .then((res) => {
97
       .then((res) => {
98
-        Object.assign(rentKeyBox, res)
98
+        Object.assign(roomKeyBox, res)
99
       })
99
       })
100
       .catch((e) => {
100
       .catch((e) => {
101
         console.error(e)
101
         console.error(e)
145
   }
145
   }
146
 
146
 
147
   // 房源编辑
147
   // 房源编辑
148
-  const houseEdit = (data) => {
148
+  const houseEdit = (query, data) => {
149
     return request({
149
     return request({
150
       url: "/rent/save",
150
       url: "/rent/save",
151
+      query,
151
       data,
152
       data,
152
       toast: "请稍候...",
153
       toast: "请稍候...",
153
     })
154
     })
238
     getRole,
239
     getRole,
239
     rentRole,
240
     rentRole,
240
     getKey,
241
     getKey,
241
-    rentKeyBox,
242
+    roomKeyBox,
242
     addOwnerTel,
243
     addOwnerTel,
243
     getBuilding,
244
     getBuilding,
244
     closeHouse,
245
     closeHouse,

+ 118
- 20
src/view/renting/detail/components/Key.vue Ver arquivo

1
 <template>
1
 <template>
2
-  <x-loading x-id="rent.key.view">
3
-    <p v-if="!rentKey">暂无钥匙信息</p>
4
-    <p v-else-if="rentKey.status === '1'">当前委托书正在审核中</p>
2
+  <x-loading x-id="room.key">
3
+    <div v-if="!roomKey">
4
+      <p>暂无钥匙信息</p>
5
+      <!-- <template v-if="roomInfo.status !== '7'"> -->
6
+      <template v-if="roomInfo.status === '0'">
7
+        <van-button
8
+          block
9
+          size="small"
10
+          type="warning"
11
+          v-shiro="'room:info:addKey'"
12
+          @click="
13
+            $router.push({
14
+              name: 'room.key',
15
+              query: { roomId: roomInfo.id, type: 'rent' },
16
+            })
17
+          "
18
+        >
19
+          上传钥匙委托
20
+        </van-button>
21
+      </template>
22
+    </div>
23
+    <p v-else-if="roomKey.status === '1'">当前钥匙协议正在审核中</p>
5
     <div v-else>
24
     <div v-else>
6
       <shiro name="room:info:key">
25
       <shiro name="room:info:key">
7
         <template #callback>
26
         <template #callback>
8
-          <van-empty image="error" description="无钥匙协议查看权限" />
27
+          <div v-if="!roomKeyBox.isCreate">
28
+            <x-field label="上传人">
29
+              {{ roomKey.keyUserName }} ({{ roomKey.keyUserPhone }})
30
+            </x-field>
31
+
32
+            <x-field label="上传时间">
33
+              {{ roomKey.updateTime }}
34
+            </x-field>
35
+          </div>
36
+          <p>无钥匙协议查看权限</p>
9
         </template>
37
         </template>
10
 
38
 
11
-        <x-field label=" " v-if="rentKeyBox.isCreate">
12
-          <van-button size="small" type="danger">删除钥匙</van-button>
39
+        <x-field
40
+          label=" "
41
+          v-if="
42
+            roomKeyBox.isCreate &&
43
+            roomKey.status === '0' &&
44
+            roomInfo.status === '0'
45
+          "
46
+          v-shiro="'room:info:delKey'"
47
+        >
48
+          <van-button block size="small" type="danger" @click="toggleDialog"
49
+            >删除钥匙</van-button
50
+          >
13
         </x-field>
51
         </x-field>
14
 
52
 
15
         <x-field label="上传人">
53
         <x-field label="上传人">
16
-          {{ rentKey.keyUserName }} ({{ rentKey.keyUserPhone }})
54
+          {{ roomKey.keyUserName }} ({{ roomKey.keyUserPhone }})
17
         </x-field>
55
         </x-field>
18
 
56
 
19
         <x-field label="上传时间">
57
         <x-field label="上传时间">
20
-          {{ rentKey.updateTime }}
58
+          {{ roomKey.updateTime }}
21
         </x-field>
59
         </x-field>
22
 
60
 
23
         <x-field label="钥匙编号">
61
         <x-field label="钥匙编号">
24
-          {{ rentKey.keyNo }}
62
+          {{ roomKey.keyNo }}
25
         </x-field>
63
         </x-field>
26
 
64
 
27
         <x-field label="存储位置">
65
         <x-field label="存储位置">
28
-          {{ rentKey.address }}
66
+          {{ roomKey.address }}
29
         </x-field>
67
         </x-field>
30
 
68
 
31
-        <van-image width="100" height="100" :src="rentKey.url" />
69
+        <van-image width="100" height="100" :src="roomKey.url" />
32
       </shiro>
70
       </shiro>
33
     </div>
71
     </div>
72
+
73
+    <!-- 删除钥匙 -->
74
+    <van-dialog
75
+      v-model:show="showDialog"
76
+      title="删除钥匙"
77
+      @confirm="handleDelete"
78
+      @cancel="toggleDialog"
79
+    >
80
+      <van-field
81
+        v-model="delReason"
82
+        rows="3"
83
+        autosize
84
+        label="留言"
85
+        type="textarea"
86
+        placeholder="请输入留言"
87
+        required
88
+      />
89
+    </van-dialog>
34
   </x-loading>
90
   </x-loading>
35
 </template>
91
 </template>
36
 
92
 
37
 <script>
93
 <script>
38
-import { Empty, Button, Image } from "vant"
39
-import { useModel } from "@zjxpcyc/vue-tiny-store"
40
-import { computed, onMounted } from "vue"
94
+import { Button, Image } from 'vant'
95
+import { useModel } from '@zjxpcyc/vue-tiny-store'
96
+import { computed, onMounted, ref } from 'vue'
97
+import { showDanger, showSuccess, showWarn } from '@/utils'
98
+import request from '@/utils/request'
41
 
99
 
42
 export default {
100
 export default {
43
   components: {
101
   components: {
44
-    [Empty.name]: Empty,
45
     [Button.name]: Button,
102
     [Button.name]: Button,
46
     [Image.name]: Image,
103
     [Image.name]: Image,
47
   },
104
   },
48
   props: {
105
   props: {
49
     roomId: undefined,
106
     roomId: undefined,
107
+    roomInfo: {
108
+      type: Object,
109
+      default: () => ({}),
110
+    },
50
   },
111
   },
51
   setup(props) {
112
   setup(props) {
52
-    const { detail, rentKeyBox, getKey } = useModel("renting")
113
+    const { detail, roomKeyBox, getKey } = useModel('renting')
114
+
115
+    const roomKey = computed(() => roomKeyBox.roomKey)
116
+
117
+    const delReason = ref()
118
+    const showDialog = ref(false)
119
+
120
+    const toggleDialog = () => {
121
+      showDialog.value = !showDialog.value
122
+    }
53
 
123
 
54
-    const rentKey = computed(() => rentKeyBox.roomKey)
124
+    const handleDelete = () => {
125
+      if (!delReason.value) {
126
+        showWarn('请填写删除原因')
127
+        return
128
+      }
129
+
130
+      showDialog.value = false
131
+
132
+      const params = {
133
+        id: roomKey.value.id,
134
+        reason: delReason.value,
135
+        roomId: props.roomInfo.id,
136
+      }
137
+
138
+      request({
139
+        url: '/rent/key/delete',
140
+        params,
141
+        toast: '请稍候...',
142
+      })
143
+        .then(() => {
144
+          roomKeyBox.roomKey = undefined
145
+          showSuccess('删除成功')
146
+        })
147
+        .catch((e) => {
148
+          showDanger(e.message)
149
+        })
150
+    }
55
 
151
 
56
     onMounted(() => {
152
     onMounted(() => {
57
-      if (!rentKeyBox.roomKey) {
153
+      if (!roomKeyBox.roomKey) {
58
         getKey(props.roomId)
154
         getKey(props.roomId)
59
       }
155
       }
60
     })
156
     })
61
 
157
 
62
     return {
158
     return {
63
       detail,
159
       detail,
64
-      rentKeyBox,
65
-      rentKey,
160
+      roomKeyBox,
161
+      roomKey,
162
+      toggleDialog,
163
+      handleDelete,
66
     }
164
     }
67
   },
165
   },
68
 }
166
 }

+ 29
- 28
src/view/renting/detail/components/Main.vue Ver arquivo

28
     </x-field>
28
     </x-field>
29
 
29
 
30
     <x-field label="创建方式">
30
     <x-field label="创建方式">
31
-      {{ roomInfo.createMethod === "1" ? "外部录入" : "荟居录入" }}
31
+      {{ roomInfo.createMethod === '1' ? '外部录入' : '荟居录入' }}
32
     </x-field>
32
     </x-field>
33
 
33
 
34
     <div
34
     <div
39
       "
39
       "
40
     >
40
     >
41
       <x-field label="关闭原因">
41
       <x-field label="关闭原因">
42
-        {{ getDictLabel(roomLog.type, "closeType")
42
+        {{ getDictLabel(roomLog.type, 'closeType')
43
         }}<span v-show="roomLog.type == '1'"
43
         }}<span v-show="roomLog.type == '1'"
44
-          >({{ getDictLabel(roomLog.reason, "closeReason") }})</span
44
+          >({{ getDictLabel(roomLog.reason, 'closeReason') }})</span
45
         >
45
         >
46
       </x-field>
46
       </x-field>
47
 
47
 
55
     </div>
55
     </div>
56
 
56
 
57
     <x-field label="楼栋">
57
     <x-field label="楼栋">
58
-      {{ securityInfo.roomBuild || "敏感信息" }}
58
+      {{ securityInfo.roomBuild || '敏感信息' }}
59
     </x-field>
59
     </x-field>
60
 
60
 
61
     <x-field label="单元">
61
     <x-field label="单元">
62
-      {{ securityInfo.roomUnit || "敏感信息" }}
62
+      {{ securityInfo.roomUnit || '敏感信息' }}
63
     </x-field>
63
     </x-field>
64
 
64
 
65
     <x-field label="楼房号">
65
     <x-field label="楼房号">
66
-      {{ securityInfo.roomNum || "敏感信息" }}
66
+      {{ securityInfo.roomNum || '敏感信息' }}
67
     </x-field>
67
     </x-field>
68
 
68
 
69
     <x-field label="业主姓名">
69
     <x-field label="业主姓名">
70
-      {{ securityInfo.ownerName || "敏感信息" }}
70
+      {{ securityInfo.ownerName || '敏感信息' }}
71
     </x-field>
71
     </x-field>
72
 
72
 
73
     <x-field label="业主电话">
73
     <x-field label="业主电话">
74
-      {{ securityInfo.ownerTel || "敏感信息" }}
74
+      {{ securityInfo.ownerTel || '敏感信息' }}
75
     </x-field>
75
     </x-field>
76
 
76
 
77
     <x-field label=" " v-shiro="'room:info:security'">
77
     <x-field label=" " v-shiro="'room:info:security'">
95
 </template>
95
 </template>
96
 
96
 
97
 <script>
97
 <script>
98
-import { computed, ref } from "vue"
99
-import { useRouter } from "vue-router"
100
-import { Button, Dialog } from "vant"
101
-import request from "@/utils/request"
102
-import { showDanger } from "@/utils"
103
-import { useModel } from "@zjxpcyc/vue-tiny-store"
98
+import { computed, ref } from 'vue'
99
+import { useRouter } from 'vue-router'
100
+import { Button, Dialog } from 'vant'
101
+import request from '@/utils/request'
102
+import { showDanger } from '@/utils'
103
+import { useModel } from '@zjxpcyc/vue-tiny-store'
104
 
104
 
105
 const getSecurity = (roomId) => {
105
 const getSecurity = (roomId) => {
106
   return request({
106
   return request({
107
-    loadingId: "room.security",
108
-    url: "/room/security",
107
+    loadingId: 'room.security',
108
+    url: '/room/security',
109
     params: { roomId },
109
     params: { roomId },
110
   })
110
   })
111
     .then((res) => {
111
     .then((res) => {
142
     const router = useRouter()
142
     const router = useRouter()
143
     const securityInfo = ref({})
143
     const securityInfo = ref({})
144
     const unfollowRoom = ref()
144
     const unfollowRoom = ref()
145
-    const { dicts, getDict } = useModel("dicts")
145
+    const { dicts, getDict } = useModel('dicts')
146
 
146
 
147
     // 关闭类型
147
     // 关闭类型
148
     if (!dicts.closeType || !dicts.closeType.length) {
148
     if (!dicts.closeType || !dicts.closeType.length) {
149
-      getDict("closeType")
149
+      getDict('closeType')
150
     }
150
     }
151
 
151
 
152
     // 关闭原因
152
     // 关闭原因
153
     if (!dicts.closeReason || !dicts.closeReason.length) {
153
     if (!dicts.closeReason || !dicts.closeReason.length) {
154
-      getDict("closeReason")
154
+      getDict('closeReason')
155
     }
155
     }
156
 
156
 
157
     // 居室
157
     // 居室
158
     const roomType = computed(() => {
158
     const roomType = computed(() => {
159
-      const [a, b, c, d] = (props.roomInfo.roomType || "").split(",")
159
+      console.log(props,'---------console.log(props)----- ----')
160
+      const [a, b, c, d] = (props.roomInfo.roomType || '').split(',')
160
       return `${a || 0}室${b || 0}厅${c || 0}厨${d || 0}卫`
161
       return `${a || 0}室${b || 0}厅${c || 0}厨${d || 0}卫`
161
     })
162
     })
162
     // 出租方式
163
     // 出租方式
163
     const leaseWay = computed(() => {
164
     const leaseWay = computed(() => {
164
-      console.log("出租方式", dicts["leaseWay"])
165
-      return dicts["leaseWay"].filter(
165
+      console.log('出租方式', dicts['leaseWay'])
166
+      return dicts['leaseWay'].filter(
166
         (x) => x.value === props.roomInfo.leaseWay
167
         (x) => x.value === props.roomInfo.leaseWay
167
       )[0]?.text
168
       )[0]?.text
168
     })
169
     })
177
     const payWayOptions = computed(() => {
178
     const payWayOptions = computed(() => {
178
       const payWayDict = dicts.payWay || []
179
       const payWayDict = dicts.payWay || []
179
       if (!payWayDict.length) {
180
       if (!payWayDict.length) {
180
-        getDict("payWay")
181
+        getDict('payWay')
181
       }
182
       }
182
 
183
 
183
       return payWayDict
184
       return payWayDict
186
     const decorationOptions = computed(() => {
187
     const decorationOptions = computed(() => {
187
       const decorationDict = dicts.decoration || []
188
       const decorationDict = dicts.decoration || []
188
       if (!decorationDict.length) {
189
       if (!decorationDict.length) {
189
-        getDict("decoration")
190
+        getDict('decoration')
190
       }
191
       }
191
 
192
 
192
       return decorationDict
193
       return decorationDict
194
 
195
 
195
     const goToAddFollow = () =>
196
     const goToAddFollow = () =>
196
       router.push({
197
       router.push({
197
-        name: "secondhand.detail",
198
+        name: 'secondhand.detail',
198
         query: { roomId: unfollowRoom.value.id },
199
         query: { roomId: unfollowRoom.value.id },
199
       })
200
       })
200
 
201
 
206
             unfollowRoom.value = undefined
207
             unfollowRoom.value = undefined
207
           })
208
           })
208
           .catch((e) => {
209
           .catch((e) => {
209
-            if ("1003" === e.code) {
210
+            if ('1003' === e.code) {
210
               unfollowRoom.value = JSON.parse(e.message)
211
               unfollowRoom.value = JSON.parse(e.message)
211
 
212
 
212
               Dialog.alert({
213
               Dialog.alert({
213
-                title: "去跟进",
214
+                title: '去跟进',
214
                 message: `您存在未跟进的房源,房源编号: ${unfollowRoom.value.id}`,
215
                 message: `您存在未跟进的房源,房源编号: ${unfollowRoom.value.id}`,
215
               }).then(() => {
216
               }).then(() => {
216
                 // todo
217
                 // todo
217
               })
218
               })
218
             } else {
219
             } else {
219
               unfollowRoom.value = undefined
220
               unfollowRoom.value = undefined
220
-              showDanger("查看敏感信息失败")
221
+              showDanger('查看敏感信息失败')
221
             }
222
             }
222
           })
223
           })
223
       }
224
       }

+ 38
- 68
src/view/renting/detail/index.vue Ver arquivo

9
       <div class="title">
9
       <div class="title">
10
         <p class="body">{{ detail.roomInfo?.title }}</p>
10
         <p class="body">{{ detail.roomInfo?.title }}</p>
11
         <MoreActions :room-info="detail.roomInfo" />
11
         <MoreActions :room-info="detail.roomInfo" />
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>
12
       </div>
25
 
13
 
26
       <van-cell-group title="房源信息">
14
       <van-cell-group title="房源信息">
27
         <RoomMain
15
         <RoomMain
28
-          :room-info="detail.roomInfo"
16
+          :roomInfo="detail.roomInfo"
29
           :building="detail.building"
17
           :building="detail.building"
30
           :roomLog="detail.roomLog || {}"
18
           :roomLog="detail.roomLog || {}"
31
           :other-data="roomOtherData"
19
           :other-data="roomOtherData"
44
             />
32
             />
45
           </van-collapse-item>
33
           </van-collapse-item>
46
 
34
 
47
-          <!-- <van-collapse-item name="2">
48
-            <template #title>
49
-              <div>物业信息</div>
50
-            </template>
51
-            <RoomEstate :build-info="detail.building" />
52
-          </van-collapse-item> -->
53
-
54
           <van-collapse-item name="role">
35
           <van-collapse-item name="role">
55
             <template #title>
36
             <template #title>
56
               <div>角色人</div>
37
               <div>角色人</div>
58
             <RoomRole :room-info="detail.roomInfo" />
39
             <RoomRole :room-info="detail.roomInfo" />
59
           </van-collapse-item>
40
           </van-collapse-item>
60
 
41
 
61
-          <!-- <van-collapse-item name="auth">
62
-            <template #title>
63
-              <div>委托书</div>
64
-            </template>
65
-            <RoomAuth :room-id="roomId" />
66
-          </van-collapse-item> -->
67
-
68
           <van-collapse-item name="key">
42
           <van-collapse-item name="key">
69
             <template #title>
43
             <template #title>
70
               <div>钥匙</div>
44
               <div>钥匙</div>
108
 </template>
82
 </template>
109
 
83
 
110
 <script>
84
 <script>
111
-import { ref, onMounted, computed } from "vue"
112
-import { useRouter } from "vue-router"
113
-import { Swiper } from "../../../components/detailCompents"
85
+import { ref, onMounted, computed } from 'vue'
86
+import { useRouter } from 'vue-router'
87
+import { Swiper } from '../../../components/detailCompents'
114
 import {
88
 import {
115
   Icon,
89
   Icon,
116
   Popover,
90
   Popover,
127
   CellGroup,
101
   CellGroup,
128
   Collapse,
102
   Collapse,
129
   CollapseItem,
103
   CollapseItem,
130
-} from "vant"
131
-import { useModel } from "@zjxpcyc/vue-tiny-store"
132
-import MoreActions from "./components/MoreActions"
133
-import RoomMain from "./components/Main"
134
-import RoomBase from "./components/Base"
135
-// import RoomEstate from './components/Estate'
136
-import RoomRole from "./components/Role"
137
-// import RoomAuth from './components/Auth'
138
-import RoomKey from "./components/Key"
139
-import RoomFollow from "./components/Follow"
140
-import RoomLook from "./components/Look"
141
-// import Contextc from "../../../components/contextC"
142
-// import { router } from "../../../router";
104
+} from 'vant'
105
+import { useModel } from '@zjxpcyc/vue-tiny-store'
106
+import MoreActions from './components/MoreActions'
107
+import RoomMain from './components/Main'
108
+import RoomBase from './components/Base'
109
+import RoomRole from './components/Role'
110
+import RoomKey from './components/Key'
111
+import RoomFollow from './components/Follow'
112
+import RoomLook from './components/Look'
143
 
113
 
144
 export default {
114
 export default {
145
-  name: "secondhanddetail",
115
+  name: 'secondhanddetail',
146
   components: {
116
   components: {
147
     [CellGroup.name]: CellGroup,
117
     [CellGroup.name]: CellGroup,
148
     [Cell.name]: Cell,
118
     [Cell.name]: Cell,
181
     const showShare = ref(false)
151
     const showShare = ref(false)
182
     const phoneShow = ref(false)
152
     const phoneShow = ref(false)
183
     const collapseItem = ref()
153
     const collapseItem = ref()
184
-    const phone = ref("")
154
+    const phone = ref('')
185
 
155
 
186
-    const { detail, getDetail } = useModel("renting")
156
+    const { detail, getDetail } = useModel('renting')
187
 
157
 
188
-    const { dicts, getDict } = useModel("dicts")
158
+    const { dicts, getDict } = useModel('dicts')
189
 
159
 
190
     const getRescType = (val) => {
160
     const getRescType = (val) => {
191
-      const rescTypes = dicts["roomResc_type"] || []
161
+      const rescTypes = dicts['roomResc_type'] || []
192
       return (rescTypes.filter((x) => x.value === val)[0] || {}).text
162
       return (rescTypes.filter((x) => x.value === val)[0] || {}).text
193
     }
163
     }
194
 
164
 
195
     const imageList = computed(() => {
165
     const imageList = computed(() => {
196
-      return (detail.RoomResc || [])
197
-        .filter((x) => x.imgType !== "0")
166
+      return (detail.rescList || [])
167
+        .filter((x) => x.imgType !== '0')
198
         .map((x) => ({ image: x.url, text: getRescType(x.imgType) }))
168
         .map((x) => ({ image: x.url, text: getRescType(x.imgType) }))
199
     })
169
     })
200
 
170
 
201
     onMounted(() => {
171
     onMounted(() => {
202
       getDetail(roomId)
172
       getDetail(roomId)
203
-      getDict("roomResc_type")
173
+      getDict('roomResc_type')
204
     })
174
     })
205
 
175
 
206
     // 通过 actions 属性来定义菜单选项
176
     // 通过 actions 属性来定义菜单选项
207
     const actions = [
177
     const actions = [
208
-      { text: "设置房源保护", value: "1" },
209
-      { text: "新增业主电话", value: "2" },
210
-      { text: "下架房源", value: "3" },
211
-      { text: "修改房源", value: "4" },
212
-      { text: "分享房源", value: "5" },
213
-      { text: "房源实勘", value: "6" },
178
+      { text: '设置房源保护', value: '1' },
179
+      { text: '新增业主电话', value: '2' },
180
+      { text: '下架房源', value: '3' },
181
+      { text: '修改房源', value: '4' },
182
+      { text: '分享房源', value: '5' },
183
+      { text: '房源实勘', value: '6' },
214
     ]
184
     ]
215
     // 设为房源保护后,只有录入人、同部门的上级以及上级部门的上级可以看到房源敏感信息。
185
     // 设为房源保护后,只有录入人、同部门的上级以及上级部门的上级可以看到房源敏感信息。
216
     const onSelect = (action) => {
186
     const onSelect = (action) => {
218
       if (action.value == 1) {
188
       if (action.value == 1) {
219
         // 设置房源保护
189
         // 设置房源保护
220
         Dialog.confirm({
190
         Dialog.confirm({
221
-          title: "提示",
191
+          title: '提示',
222
           message:
192
           message:
223
-            "设为房源保护后,只有录入人、同部门的上级以及上级部门的上级可以看到房源敏感信息。",
224
-          theme: "round-button",
193
+            '设为房源保护后,只有录入人、同部门的上级以及上级部门的上级可以看到房源敏感信息。',
194
+          theme: 'round-button',
225
         })
195
         })
226
           .then(() => {
196
           .then(() => {
227
             // on close
197
             // on close
235
       } else if (action.value == 3) {
205
       } else if (action.value == 3) {
236
         // 下架房源
206
         // 下架房源
237
 
207
 
238
-        router.push("/closehouse")
208
+        router.push('/closehouse')
239
       } else if (action.value == 4) {
209
       } else if (action.value == 4) {
240
         // 修改房源
210
         // 修改房源
241
-        router.push("/editsecondhandhouse")
211
+        router.push('/editsecondhandhouse')
242
       } else if (action.value == 5) {
212
       } else if (action.value == 5) {
243
         // 分享房源
213
         // 分享房源
244
         showShare.value = true
214
         showShare.value = true
245
       } else if (action.value == 6) {
215
       } else if (action.value == 6) {
246
         // 房源实勘
216
         // 房源实勘
247
-        router.push("/resc")
217
+        router.push('/resc')
248
       }
218
       }
249
     }
219
     }
250
 
220
 
251
     const shareOptions = [
221
     const shareOptions = [
252
-      { name: "微信", icon: "wechat" },
253
-      { name: "微博", icon: "weibo" },
254
-      { name: "复制链接", icon: "link" },
255
-      { name: "分享海报", icon: "poster" },
256
-      { name: "二维码", icon: "qrcode" },
222
+      { name: '微信', icon: 'wechat' },
223
+      { name: '微博', icon: 'weibo' },
224
+      { name: '复制链接', icon: 'link' },
225
+      { name: '分享海报', icon: 'poster' },
226
+      { name: '二维码', icon: 'qrcode' },
257
     ]
227
     ]
258
 
228
 
259
     const onShareSelect = (option) => {
229
     const onShareSelect = (option) => {

+ 87
- 47
src/view/renting/edithouse/components/Form.vue Ver arquivo

69
       <template #extra> ㎡ </template>
69
       <template #extra> ㎡ </template>
70
     </van-field>
70
     </van-field>
71
 
71
 
72
+    <van-field v-show="mustEdit != '1'" name="roomBuild" label="栋号" required>
73
+      <template #input>
74
+        <Picker
75
+          :options="roomBuildOptions"
76
+          v-model="formData.roomBuild"
77
+          placeholder="请选择"
78
+        />
79
+      </template>
80
+    </van-field>
81
+
82
+    <van-field
83
+      v-model="formData.acreage"
84
+      name="acreage"
85
+      label="面积"
86
+      placeholder="请输入"
87
+      required
88
+      type="number"
89
+      :rules="[{ required: true, message: '请填写面积' }]"
90
+    >
91
+      <template #extra> ㎡ </template>
92
+    </van-field>
93
+
72
     <van-field
94
     <van-field
73
       v-model="formData.innerAcreage"
95
       v-model="formData.innerAcreage"
74
       name="innerAcreage"
96
       name="innerAcreage"
260
 </template>
282
 </template>
261
 
283
 
262
 <script>
284
 <script>
263
-import { reactive, computed, watch, ref } from "vue"
264
-import { Form, Field, Button } from "vant"
265
-import { useModel } from "@zjxpcyc/vue-tiny-store"
266
-import Picker from "@/components/Picker"
267
-import { showWarn } from "@/utils"
268
-import RoomType from "./RoomType"
269
-import Proportion from "./Proportion"
285
+import { reactive, computed, watch, ref } from 'vue'
286
+import { Form, Field, Button } from 'vant'
287
+import { useModel } from '@zjxpcyc/vue-tiny-store'
288
+import Picker from '@/components/Picker'
289
+import { showWarn } from '@/utils'
290
+import RoomType from './RoomType'
291
+import Proportion from './Proportion'
270
 
292
 
271
 export default {
293
 export default {
272
   components: {
294
   components: {
277
     Proportion,
299
     Proportion,
278
     Picker,
300
     Picker,
279
   },
301
   },
280
-  emits: ["submit"],
302
+  emits: ['submit'],
281
   setup(props, { emit }) {
303
   setup(props, { emit }) {
282
-    const buildingName = ref("")
304
+    const buildingName = ref('')
283
 
305
 
284
     const formData = reactive({})
306
     const formData = reactive({})
285
-    const { dicts, getDict } = useModel("dicts")
286
-    const { detail } = useModel("renting")
307
+    const { dicts, getDict } = useModel('dicts')
308
+    const { detail } = useModel('renting')
287
 
309
 
288
-    //  const mustEdit = computed(()=>detail.building.is)
310
+    const mustEdit = computed(() =>
311
+      detail.building.IsLock == '1' && detail.lockRoom == null ? '1' : '0'
312
+    )
289
 
313
 
290
     // 装修
314
     // 装修
291
     const decorationOptions = computed(() => {
315
     const decorationOptions = computed(() => {
292
       const decorationDict = dicts.decoration || []
316
       const decorationDict = dicts.decoration || []
293
       if (!decorationDict.length) {
317
       if (!decorationDict.length) {
294
-        getDict("decoration")
318
+        getDict('decoration')
295
       }
319
       }
296
 
320
 
297
       return decorationDict
321
       return decorationDict
298
     })
322
     })
299
 
323
 
324
+    // 栋号
325
+    const roomBuildOptions = computed(() => {
326
+      const roomBuildDict = dicts.roomBuild || []
327
+      if (!roomBuildDict.length) {
328
+        getDict('roomBuild')
329
+      }
330
+
331
+      return roomBuildDict
332
+    })
333
+
300
     // 朝向
334
     // 朝向
301
     const aspectOptions = computed(() => {
335
     const aspectOptions = computed(() => {
302
       const aspectDict = dicts.aspect || []
336
       const aspectDict = dicts.aspect || []
303
       if (!aspectDict.length) {
337
       if (!aspectDict.length) {
304
-        getDict("aspect")
338
+        getDict('aspect')
305
       }
339
       }
306
 
340
 
307
       return aspectDict
341
       return aspectDict
311
     const sourceFromOptions = computed(() => {
345
     const sourceFromOptions = computed(() => {
312
       const sourceFromDict = dicts.sourceFrom || []
346
       const sourceFromDict = dicts.sourceFrom || []
313
       if (!sourceFromDict.length) {
347
       if (!sourceFromDict.length) {
314
-        getDict("sourceFrom")
348
+        getDict('sourceFrom')
315
       }
349
       }
316
 
350
 
317
       return sourceFromDict
351
       return sourceFromDict
319
 
353
 
320
     // 建筑类型
354
     // 建筑类型
321
     const buildTypeOptions = computed(() => {
355
     const buildTypeOptions = computed(() => {
322
-      const buildTypeDict = dicts["build_type"] || []
356
+      const buildTypeDict = dicts['build_type'] || []
323
       if (!buildTypeDict.length) {
357
       if (!buildTypeDict.length) {
324
-        getDict("build_type")
358
+        getDict('build_type')
325
       }
359
       }
326
 
360
 
327
       return buildTypeDict
361
       return buildTypeDict
337
     const natureOptions = computed(() => {
371
     const natureOptions = computed(() => {
338
       const natureDict = dicts.nature || []
372
       const natureDict = dicts.nature || []
339
       if (!natureDict.length) {
373
       if (!natureDict.length) {
340
-        getDict("nature")
374
+        getDict('nature')
341
       }
375
       }
342
 
376
 
343
       return natureDict
377
       return natureDict
347
     const purposeOptions = computed(() => {
381
     const purposeOptions = computed(() => {
348
       const purposeDict = dicts.purpose || []
382
       const purposeDict = dicts.purpose || []
349
       if (!purposeDict.length) {
383
       if (!purposeDict.length) {
350
-        getDict("purpose")
384
+        getDict('purpose')
351
       }
385
       }
352
 
386
 
353
       return purposeDict
387
       return purposeDict
357
     const mortgageOptions = computed(() => {
391
     const mortgageOptions = computed(() => {
358
       const mortgageDict = dicts.mortgage || []
392
       const mortgageDict = dicts.mortgage || []
359
       if (!mortgageDict.length) {
393
       if (!mortgageDict.length) {
360
-        getDict("mortgage")
394
+        getDict('mortgage')
361
       }
395
       }
362
 
396
 
363
       return mortgageDict
397
       return mortgageDict
365
 
399
 
366
     // 税费
400
     // 税费
367
     const buildTimeOptions = computed(() => {
401
     const buildTimeOptions = computed(() => {
368
-      const buildTimeDict = dicts["build_time"] || []
402
+      const buildTimeDict = dicts['build_time'] || []
369
       if (!buildTimeDict.length) {
403
       if (!buildTimeDict.length) {
370
-        getDict("build_time")
404
+        getDict('build_time')
371
       }
405
       }
372
 
406
 
373
       return buildTimeDict
407
       return buildTimeDict
375
 
409
 
376
     // 付款方式
410
     // 付款方式
377
     const payWayOptions = computed(() => {
411
     const payWayOptions = computed(() => {
378
-      const payWayDict = dicts["payWay"] || []
412
+      const payWayDict = dicts['payWay'] || []
379
       if (!payWayDict.length) {
413
       if (!payWayDict.length) {
380
-        getDict("payWay")
414
+        getDict('payWay')
381
       }
415
       }
382
 
416
 
383
       return payWayDict
417
       return payWayDict
385
 
419
 
386
     // 居住现状
420
     // 居住现状
387
     const liveStatusOptions = computed(() => {
421
     const liveStatusOptions = computed(() => {
388
-      const liveStatusDict = dicts["liveStatus"] || []
422
+      const liveStatusDict = dicts['liveStatus'] || []
389
       if (!liveStatusDict.length) {
423
       if (!liveStatusDict.length) {
390
-        getDict("liveStatus")
424
+        getDict('liveStatus')
391
       }
425
       }
392
 
426
 
393
       return liveStatusDict
427
       return liveStatusDict
395
 
429
 
396
     //性别限制
430
     //性别限制
397
     const limitSexOptions = computed(() => {
431
     const limitSexOptions = computed(() => {
398
-      const limitSexDict = dicts["limitSex"] || []
432
+      const limitSexDict = dicts['limitSex'] || []
399
       if (!limitSexDict.length) {
433
       if (!limitSexDict.length) {
400
-        getDict("limitSex")
434
+        getDict('limitSex')
401
       }
435
       }
402
 
436
 
403
       return limitSexDict
437
       return limitSexDict
405
 
439
 
406
     //房屋特色
440
     //房屋特色
407
     const roomSpecialOptions = computed(() => {
441
     const roomSpecialOptions = computed(() => {
408
-      const roomSpecialDict = dicts["roomSpecial"] || []
442
+      const roomSpecialDict = dicts['roomSpecial'] || []
409
       if (!roomSpecialDict.length) {
443
       if (!roomSpecialDict.length) {
410
-        getDict("roomSpecial")
444
+        getDict('roomSpecial')
411
       }
445
       }
412
 
446
 
413
       return roomSpecialDict
447
       return roomSpecialDict
415
 
449
 
416
     //车位
450
     //车位
417
     const parkingOptions = computed(() => {
451
     const parkingOptions = computed(() => {
418
-      const parkingDict = dicts["parking"] || []
452
+      const parkingDict = dicts['parking'] || []
419
       if (!parkingDict.length) {
453
       if (!parkingDict.length) {
420
-        getDict("parking")
454
+        getDict('parking')
421
       }
455
       }
422
 
456
 
423
       return parkingDict
457
       return parkingDict
425
 
459
 
426
     //地下室
460
     //地下室
427
     const basementOptions = computed(() => {
461
     const basementOptions = computed(() => {
428
-      const basementDict = dicts["basement"] || []
462
+      const basementDict = dicts['basement'] || []
429
       if (!basementDict.length) {
463
       if (!basementDict.length) {
430
-        getDict("basement")
464
+        getDict('basement')
431
       }
465
       }
432
 
466
 
433
       return basementDict
467
       return basementDict
435
 
469
 
436
     //燃气
470
     //燃气
437
     const gasOptions = computed(() => {
471
     const gasOptions = computed(() => {
438
-      const gasDict = dicts["gas"] || []
472
+      const gasDict = dicts['gas'] || []
439
       if (!gasDict.length) {
473
       if (!gasDict.length) {
440
-        getDict("gas")
474
+        getDict('gas')
441
       }
475
       }
442
 
476
 
443
       return gasDict
477
       return gasDict
445
 
479
 
446
     //家电
480
     //家电
447
     const electricEquipmentOptions = computed(() => {
481
     const electricEquipmentOptions = computed(() => {
448
-      const electricEquipmentDict = dicts["electricEquipment"] || []
482
+      const electricEquipmentDict = dicts['electricEquipment'] || []
449
       if (!electricEquipmentDict.length) {
483
       if (!electricEquipmentDict.length) {
450
-        getDict("electricEquipment")
484
+        getDict('electricEquipment')
451
       }
485
       }
452
 
486
 
453
       return electricEquipmentDict
487
       return electricEquipmentDict
455
 
489
 
456
     //隔断
490
     //隔断
457
     const separateOptions = computed(() => {
491
     const separateOptions = computed(() => {
458
-      const separateDict = dicts["separate"] || []
492
+      const separateDict = dicts['separate'] || []
459
       if (!separateDict.length) {
493
       if (!separateDict.length) {
460
-        getDict("separate")
494
+        getDict('separate')
461
       }
495
       }
462
 
496
 
463
       return separateDict
497
       return separateDict
466
     const validManually = () => {
500
     const validManually = () => {
467
       if (
501
       if (
468
         !formData.roomType ||
502
         !formData.roomType ||
469
-        formData.roomType.split(",").filter(Boolean).length != 5
503
+        formData.roomType.split(',').filter(Boolean).length != 5
470
       ) {
504
       ) {
471
-        showWarn("请正确设置户型")
505
+        showWarn('请正确设置户型')
472
         return false
506
         return false
473
       }
507
       }
474
       if (!formData.decoration) {
508
       if (!formData.decoration) {
475
-        showWarn("请选择装修")
509
+        showWarn('请选择装修')
476
         return false
510
         return false
477
       }
511
       }
478
       if (!formData.aspect) {
512
       if (!formData.aspect) {
480
         return false
514
         return false
481
       }
515
       }
482
       if (!formData.sourceFrom) {
516
       if (!formData.sourceFrom) {
483
-        showWarn("请选择房源来源")
517
+        showWarn('请选择房源来源')
484
         return false
518
         return false
485
       }
519
       }
486
 
520
 
493
       if (!validManually()) {
527
       if (!validManually()) {
494
         return
528
         return
495
       }
529
       }
496
-      console.log(formData, "console.log(formData)")
497
-      emit("submit", formData)
530
+      console.log(formData, 'console.log(formData)')
531
+      const query = {
532
+        lockRoomNo: detail.roomInfo?.roomNum,
533
+        leaseWaySelect: formData.leaseWay,
534
+        type: formData,
535
+      }
536
+      emit('submit', query, formData)
498
     }
537
     }
499
 
538
 
500
     //
539
     //
510
     )
549
     )
511
 
550
 
512
     return {
551
     return {
513
-      // mustEdit,
552
+      mustEdit,
514
       buildingName,
553
       buildingName,
515
       formData,
554
       formData,
516
       handleSumbit,
555
       handleSumbit,
517
       decorationOptions,
556
       decorationOptions,
557
+      roomBuildOptions,
518
       aspectOptions,
558
       aspectOptions,
519
       sourceFromOptions,
559
       sourceFromOptions,
520
       buildTypeOptions,
560
       buildTypeOptions,

+ 14
- 11
src/view/renting/edithouse/index.vue Ver arquivo

11
 </template>
11
 </template>
12
 
12
 
13
 <script>
13
 <script>
14
-import { watch } from "vue"
15
-import { useModel } from "@zjxpcyc/vue-tiny-store"
16
-import { useRoute, useRouter } from "vue-router"
17
-import { alert, showDanger } from "@/utils"
18
-import RoomBasic from "./components/Basic"
19
-import RoomForm from "./components/Form"
14
+import { watch } from 'vue'
15
+import { useModel } from '@zjxpcyc/vue-tiny-store'
16
+import { useRoute, useRouter } from 'vue-router'
17
+import { alert, showDanger } from '@/utils'
18
+import RoomBasic from './components/Basic'
19
+import RoomForm from './components/Form'
20
 
20
 
21
 export default {
21
 export default {
22
-  name: "secondhanddetail",
22
+  name: 'secondhanddetail',
23
   components: {
23
   components: {
24
     RoomBasic,
24
     RoomBasic,
25
     RoomForm,
25
     RoomForm,
28
   setup() {
28
   setup() {
29
     const route = useRoute()
29
     const route = useRoute()
30
     const router = useRouter()
30
     const router = useRouter()
31
-    const { detail, getDetail, houseEdit } = useModel("renting")
31
+    const { detail, getDetail, houseEdit } = useModel('renting')
32
 
32
 
33
     watch(
33
     watch(
34
       () => route.query.roomId,
34
       () => route.query.roomId,
40
       { immediate: true }
40
       { immediate: true }
41
     )
41
     )
42
 
42
 
43
-    const handleSumbit = (values) => {
44
-      houseEdit(values)
43
+    const handleSumbit = (query,values) => {
44
+      values.lockRoomNo = detail.roomInfo?.roomNum
45
+  
46
+      console.log(query, values, 'values')
47
+      houseEdit(query, values)
45
         .then(() => {
48
         .then(() => {
46
-          alert("编辑成功").then(() => {
49
+          alert('编辑成功').then(() => {
47
             router.go(-1)
50
             router.go(-1)
48
           })
51
           })
49
         })
52
         })

+ 14
- 13
src/view/room-key/index.vue Ver arquivo

39
 </template>
39
 </template>
40
 
40
 
41
 <script>
41
 <script>
42
-import { reactive, ref, onMounted } from "vue"
43
-import { Form, Button, Field, Uploader } from "vant"
44
-import { useRoute, useRouter } from "vue-router"
45
-import { useModel } from "@zjxpcyc/vue-tiny-store"
46
-import uploadImage from "@/utils/uploadImage"
47
-import request from "@/utils/request"
48
-import { alert } from "@/utils"
42
+import { reactive, ref, onMounted } from 'vue'
43
+import { Form, Button, Field, Uploader } from 'vant'
44
+import { useRoute, useRouter } from 'vue-router'
45
+import { useModel } from '@zjxpcyc/vue-tiny-store'
46
+import uploadImage from '@/utils/uploadImage'
47
+import request from '@/utils/request'
48
+import { alert } from '@/utils'
49
 
49
 
50
 export default {
50
 export default {
51
-  name: "lookrecord",
51
+  name: 'lookrecord',
52
   components: {
52
   components: {
53
     [Form.name]: Form,
53
     [Form.name]: Form,
54
     [Button.name]: Button,
54
     [Button.name]: Button,
59
     const route = useRoute()
59
     const route = useRoute()
60
     const router = useRouter()
60
     const router = useRouter()
61
     const roomId = route.query.roomId
61
     const roomId = route.query.roomId
62
+    const type = route.query.type
62
     const imgUrl = ref([])
63
     const imgUrl = ref([])
63
 
64
 
64
-    const { detail, getDetail } = useModel("room")
65
+    const { detail, getDetail } = useModel(type === 'rent' ? 'room' : 'rent')
65
     const formData = reactive({
66
     const formData = reactive({
66
       roomId: roomId,
67
       roomId: roomId,
67
       keyNo: undefined,
68
       keyNo: undefined,
71
 
72
 
72
     const handleSubmit = () => {
73
     const handleSubmit = () => {
73
       request({
74
       request({
74
-        url: "/room/key/save",
75
+        url: `/${type}/key/save`,
75
         data: formData,
76
         data: formData,
76
-        toast: "请稍候...",
77
+        toast: '请稍候...',
77
       }).then(() => {
78
       }).then(() => {
78
-        alert("添加成功").then(() => {
79
+        alert('添加成功').then(() => {
79
           router.go(-1)
80
           router.go(-1)
80
         })
81
         })
81
       })
82
       })
83
 
84
 
84
     const handleUpload = (file) => {
85
     const handleUpload = (file) => {
85
       if (file && file.file) {
86
       if (file && file.file) {
86
-        uploadImage(file.file, "", 1).then((url) => {
87
+        uploadImage(file.file, '', 1).then((url) => {
87
           formData.url = url
88
           formData.url = url
88
           imgUrl.value = [{ url: url }]
89
           imgUrl.value = [{ url: url }]
89
         })
90
         })