소스 검색

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

张延森 4 년 전
부모
커밋
9aaec9ef20

+ 5
- 4
src/store/models/renting.js 파일 보기

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

+ 118
- 20
src/view/renting/detail/components/Key.vue 파일 보기

@@ -1,68 +1,166 @@
1 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 24
     <div v-else>
6 25
       <shiro name="room:info:key">
7 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 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 51
         </x-field>
14 52
 
15 53
         <x-field label="上传人">
16
-          {{ rentKey.keyUserName }} ({{ rentKey.keyUserPhone }})
54
+          {{ roomKey.keyUserName }} ({{ roomKey.keyUserPhone }})
17 55
         </x-field>
18 56
 
19 57
         <x-field label="上传时间">
20
-          {{ rentKey.updateTime }}
58
+          {{ roomKey.updateTime }}
21 59
         </x-field>
22 60
 
23 61
         <x-field label="钥匙编号">
24
-          {{ rentKey.keyNo }}
62
+          {{ roomKey.keyNo }}
25 63
         </x-field>
26 64
 
27 65
         <x-field label="存储位置">
28
-          {{ rentKey.address }}
66
+          {{ roomKey.address }}
29 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 70
       </shiro>
33 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 90
   </x-loading>
35 91
 </template>
36 92
 
37 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 100
 export default {
43 101
   components: {
44
-    [Empty.name]: Empty,
45 102
     [Button.name]: Button,
46 103
     [Image.name]: Image,
47 104
   },
48 105
   props: {
49 106
     roomId: undefined,
107
+    roomInfo: {
108
+      type: Object,
109
+      default: () => ({}),
110
+    },
50 111
   },
51 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 152
     onMounted(() => {
57
-      if (!rentKeyBox.roomKey) {
153
+      if (!roomKeyBox.roomKey) {
58 154
         getKey(props.roomId)
59 155
       }
60 156
     })
61 157
 
62 158
     return {
63 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 파일 보기

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

+ 38
- 68
src/view/renting/detail/index.vue 파일 보기

@@ -9,23 +9,11 @@
9 9
       <div class="title">
10 10
         <p class="body">{{ detail.roomInfo?.title }}</p>
11 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 12
       </div>
25 13
 
26 14
       <van-cell-group title="房源信息">
27 15
         <RoomMain
28
-          :room-info="detail.roomInfo"
16
+          :roomInfo="detail.roomInfo"
29 17
           :building="detail.building"
30 18
           :roomLog="detail.roomLog || {}"
31 19
           :other-data="roomOtherData"
@@ -44,13 +32,6 @@
44 32
             />
45 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 35
           <van-collapse-item name="role">
55 36
             <template #title>
56 37
               <div>角色人</div>
@@ -58,13 +39,6 @@
58 39
             <RoomRole :room-info="detail.roomInfo" />
59 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 42
           <van-collapse-item name="key">
69 43
             <template #title>
70 44
               <div>钥匙</div>
@@ -108,9 +82,9 @@
108 82
 </template>
109 83
 
110 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 88
 import {
115 89
   Icon,
116 90
   Popover,
@@ -127,22 +101,18 @@ import {
127 101
   CellGroup,
128 102
   Collapse,
129 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 114
 export default {
145
-  name: "secondhanddetail",
115
+  name: 'secondhanddetail',
146 116
   components: {
147 117
     [CellGroup.name]: CellGroup,
148 118
     [Cell.name]: Cell,
@@ -181,36 +151,36 @@ export default {
181 151
     const showShare = ref(false)
182 152
     const phoneShow = ref(false)
183 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 160
     const getRescType = (val) => {
191
-      const rescTypes = dicts["roomResc_type"] || []
161
+      const rescTypes = dicts['roomResc_type'] || []
192 162
       return (rescTypes.filter((x) => x.value === val)[0] || {}).text
193 163
     }
194 164
 
195 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 168
         .map((x) => ({ image: x.url, text: getRescType(x.imgType) }))
199 169
     })
200 170
 
201 171
     onMounted(() => {
202 172
       getDetail(roomId)
203
-      getDict("roomResc_type")
173
+      getDict('roomResc_type')
204 174
     })
205 175
 
206 176
     // 通过 actions 属性来定义菜单选项
207 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 186
     const onSelect = (action) => {
@@ -218,10 +188,10 @@ export default {
218 188
       if (action.value == 1) {
219 189
         // 设置房源保护
220 190
         Dialog.confirm({
221
-          title: "提示",
191
+          title: '提示',
222 192
           message:
223
-            "设为房源保护后,只有录入人、同部门的上级以及上级部门的上级可以看到房源敏感信息。",
224
-          theme: "round-button",
193
+            '设为房源保护后,只有录入人、同部门的上级以及上级部门的上级可以看到房源敏感信息。',
194
+          theme: 'round-button',
225 195
         })
226 196
           .then(() => {
227 197
             // on close
@@ -235,25 +205,25 @@ export default {
235 205
       } else if (action.value == 3) {
236 206
         // 下架房源
237 207
 
238
-        router.push("/closehouse")
208
+        router.push('/closehouse')
239 209
       } else if (action.value == 4) {
240 210
         // 修改房源
241
-        router.push("/editsecondhandhouse")
211
+        router.push('/editsecondhandhouse')
242 212
       } else if (action.value == 5) {
243 213
         // 分享房源
244 214
         showShare.value = true
245 215
       } else if (action.value == 6) {
246 216
         // 房源实勘
247
-        router.push("/resc")
217
+        router.push('/resc')
248 218
       }
249 219
     }
250 220
 
251 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 229
     const onShareSelect = (option) => {

+ 87
- 47
src/view/renting/edithouse/components/Form.vue 파일 보기

@@ -69,6 +69,28 @@
69 69
       <template #extra> ㎡ </template>
70 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 94
     <van-field
73 95
       v-model="formData.innerAcreage"
74 96
       name="innerAcreage"
@@ -260,13 +282,13 @@
260 282
 </template>
261 283
 
262 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 293
 export default {
272 294
   components: {
@@ -277,31 +299,43 @@ export default {
277 299
     Proportion,
278 300
     Picker,
279 301
   },
280
-  emits: ["submit"],
302
+  emits: ['submit'],
281 303
   setup(props, { emit }) {
282
-    const buildingName = ref("")
304
+    const buildingName = ref('')
283 305
 
284 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 315
     const decorationOptions = computed(() => {
292 316
       const decorationDict = dicts.decoration || []
293 317
       if (!decorationDict.length) {
294
-        getDict("decoration")
318
+        getDict('decoration')
295 319
       }
296 320
 
297 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 335
     const aspectOptions = computed(() => {
302 336
       const aspectDict = dicts.aspect || []
303 337
       if (!aspectDict.length) {
304
-        getDict("aspect")
338
+        getDict('aspect')
305 339
       }
306 340
 
307 341
       return aspectDict
@@ -311,7 +345,7 @@ export default {
311 345
     const sourceFromOptions = computed(() => {
312 346
       const sourceFromDict = dicts.sourceFrom || []
313 347
       if (!sourceFromDict.length) {
314
-        getDict("sourceFrom")
348
+        getDict('sourceFrom')
315 349
       }
316 350
 
317 351
       return sourceFromDict
@@ -319,9 +353,9 @@ export default {
319 353
 
320 354
     // 建筑类型
321 355
     const buildTypeOptions = computed(() => {
322
-      const buildTypeDict = dicts["build_type"] || []
356
+      const buildTypeDict = dicts['build_type'] || []
323 357
       if (!buildTypeDict.length) {
324
-        getDict("build_type")
358
+        getDict('build_type')
325 359
       }
326 360
 
327 361
       return buildTypeDict
@@ -337,7 +371,7 @@ export default {
337 371
     const natureOptions = computed(() => {
338 372
       const natureDict = dicts.nature || []
339 373
       if (!natureDict.length) {
340
-        getDict("nature")
374
+        getDict('nature')
341 375
       }
342 376
 
343 377
       return natureDict
@@ -347,7 +381,7 @@ export default {
347 381
     const purposeOptions = computed(() => {
348 382
       const purposeDict = dicts.purpose || []
349 383
       if (!purposeDict.length) {
350
-        getDict("purpose")
384
+        getDict('purpose')
351 385
       }
352 386
 
353 387
       return purposeDict
@@ -357,7 +391,7 @@ export default {
357 391
     const mortgageOptions = computed(() => {
358 392
       const mortgageDict = dicts.mortgage || []
359 393
       if (!mortgageDict.length) {
360
-        getDict("mortgage")
394
+        getDict('mortgage')
361 395
       }
362 396
 
363 397
       return mortgageDict
@@ -365,9 +399,9 @@ export default {
365 399
 
366 400
     // 税费
367 401
     const buildTimeOptions = computed(() => {
368
-      const buildTimeDict = dicts["build_time"] || []
402
+      const buildTimeDict = dicts['build_time'] || []
369 403
       if (!buildTimeDict.length) {
370
-        getDict("build_time")
404
+        getDict('build_time')
371 405
       }
372 406
 
373 407
       return buildTimeDict
@@ -375,9 +409,9 @@ export default {
375 409
 
376 410
     // 付款方式
377 411
     const payWayOptions = computed(() => {
378
-      const payWayDict = dicts["payWay"] || []
412
+      const payWayDict = dicts['payWay'] || []
379 413
       if (!payWayDict.length) {
380
-        getDict("payWay")
414
+        getDict('payWay')
381 415
       }
382 416
 
383 417
       return payWayDict
@@ -385,9 +419,9 @@ export default {
385 419
 
386 420
     // 居住现状
387 421
     const liveStatusOptions = computed(() => {
388
-      const liveStatusDict = dicts["liveStatus"] || []
422
+      const liveStatusDict = dicts['liveStatus'] || []
389 423
       if (!liveStatusDict.length) {
390
-        getDict("liveStatus")
424
+        getDict('liveStatus')
391 425
       }
392 426
 
393 427
       return liveStatusDict
@@ -395,9 +429,9 @@ export default {
395 429
 
396 430
     //性别限制
397 431
     const limitSexOptions = computed(() => {
398
-      const limitSexDict = dicts["limitSex"] || []
432
+      const limitSexDict = dicts['limitSex'] || []
399 433
       if (!limitSexDict.length) {
400
-        getDict("limitSex")
434
+        getDict('limitSex')
401 435
       }
402 436
 
403 437
       return limitSexDict
@@ -405,9 +439,9 @@ export default {
405 439
 
406 440
     //房屋特色
407 441
     const roomSpecialOptions = computed(() => {
408
-      const roomSpecialDict = dicts["roomSpecial"] || []
442
+      const roomSpecialDict = dicts['roomSpecial'] || []
409 443
       if (!roomSpecialDict.length) {
410
-        getDict("roomSpecial")
444
+        getDict('roomSpecial')
411 445
       }
412 446
 
413 447
       return roomSpecialDict
@@ -415,9 +449,9 @@ export default {
415 449
 
416 450
     //车位
417 451
     const parkingOptions = computed(() => {
418
-      const parkingDict = dicts["parking"] || []
452
+      const parkingDict = dicts['parking'] || []
419 453
       if (!parkingDict.length) {
420
-        getDict("parking")
454
+        getDict('parking')
421 455
       }
422 456
 
423 457
       return parkingDict
@@ -425,9 +459,9 @@ export default {
425 459
 
426 460
     //地下室
427 461
     const basementOptions = computed(() => {
428
-      const basementDict = dicts["basement"] || []
462
+      const basementDict = dicts['basement'] || []
429 463
       if (!basementDict.length) {
430
-        getDict("basement")
464
+        getDict('basement')
431 465
       }
432 466
 
433 467
       return basementDict
@@ -435,9 +469,9 @@ export default {
435 469
 
436 470
     //燃气
437 471
     const gasOptions = computed(() => {
438
-      const gasDict = dicts["gas"] || []
472
+      const gasDict = dicts['gas'] || []
439 473
       if (!gasDict.length) {
440
-        getDict("gas")
474
+        getDict('gas')
441 475
       }
442 476
 
443 477
       return gasDict
@@ -445,9 +479,9 @@ export default {
445 479
 
446 480
     //家电
447 481
     const electricEquipmentOptions = computed(() => {
448
-      const electricEquipmentDict = dicts["electricEquipment"] || []
482
+      const electricEquipmentDict = dicts['electricEquipment'] || []
449 483
       if (!electricEquipmentDict.length) {
450
-        getDict("electricEquipment")
484
+        getDict('electricEquipment')
451 485
       }
452 486
 
453 487
       return electricEquipmentDict
@@ -455,9 +489,9 @@ export default {
455 489
 
456 490
     //隔断
457 491
     const separateOptions = computed(() => {
458
-      const separateDict = dicts["separate"] || []
492
+      const separateDict = dicts['separate'] || []
459 493
       if (!separateDict.length) {
460
-        getDict("separate")
494
+        getDict('separate')
461 495
       }
462 496
 
463 497
       return separateDict
@@ -466,13 +500,13 @@ export default {
466 500
     const validManually = () => {
467 501
       if (
468 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 506
         return false
473 507
       }
474 508
       if (!formData.decoration) {
475
-        showWarn("请选择装修")
509
+        showWarn('请选择装修')
476 510
         return false
477 511
       }
478 512
       if (!formData.aspect) {
@@ -480,7 +514,7 @@ export default {
480 514
         return false
481 515
       }
482 516
       if (!formData.sourceFrom) {
483
-        showWarn("请选择房源来源")
517
+        showWarn('请选择房源来源')
484 518
         return false
485 519
       }
486 520
 
@@ -493,8 +527,13 @@ export default {
493 527
       if (!validManually()) {
494 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,11 +549,12 @@ export default {
510 549
     )
511 550
 
512 551
     return {
513
-      // mustEdit,
552
+      mustEdit,
514 553
       buildingName,
515 554
       formData,
516 555
       handleSumbit,
517 556
       decorationOptions,
557
+      roomBuildOptions,
518 558
       aspectOptions,
519 559
       sourceFromOptions,
520 560
       buildTypeOptions,

+ 14
- 11
src/view/renting/edithouse/index.vue 파일 보기

@@ -11,15 +11,15 @@
11 11
 </template>
12 12
 
13 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 21
 export default {
22
-  name: "secondhanddetail",
22
+  name: 'secondhanddetail',
23 23
   components: {
24 24
     RoomBasic,
25 25
     RoomForm,
@@ -28,7 +28,7 @@ export default {
28 28
   setup() {
29 29
     const route = useRoute()
30 30
     const router = useRouter()
31
-    const { detail, getDetail, houseEdit } = useModel("renting")
31
+    const { detail, getDetail, houseEdit } = useModel('renting')
32 32
 
33 33
     watch(
34 34
       () => route.query.roomId,
@@ -40,10 +40,13 @@ export default {
40 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 48
         .then(() => {
46
-          alert("编辑成功").then(() => {
49
+          alert('编辑成功').then(() => {
47 50
             router.go(-1)
48 51
           })
49 52
         })

+ 14
- 13
src/view/room-key/index.vue 파일 보기

@@ -39,16 +39,16 @@
39 39
 </template>
40 40
 
41 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 50
 export default {
51
-  name: "lookrecord",
51
+  name: 'lookrecord',
52 52
   components: {
53 53
     [Form.name]: Form,
54 54
     [Button.name]: Button,
@@ -59,9 +59,10 @@ export default {
59 59
     const route = useRoute()
60 60
     const router = useRouter()
61 61
     const roomId = route.query.roomId
62
+    const type = route.query.type
62 63
     const imgUrl = ref([])
63 64
 
64
-    const { detail, getDetail } = useModel("room")
65
+    const { detail, getDetail } = useModel(type === 'rent' ? 'room' : 'rent')
65 66
     const formData = reactive({
66 67
       roomId: roomId,
67 68
       keyNo: undefined,
@@ -71,11 +72,11 @@ export default {
71 72
 
72 73
     const handleSubmit = () => {
73 74
       request({
74
-        url: "/room/key/save",
75
+        url: `/${type}/key/save`,
75 76
         data: formData,
76
-        toast: "请稍候...",
77
+        toast: '请稍候...',
77 78
       }).then(() => {
78
-        alert("添加成功").then(() => {
79
+        alert('添加成功').then(() => {
79 80
           router.go(-1)
80 81
         })
81 82
       })
@@ -83,7 +84,7 @@ export default {
83 84
 
84 85
     const handleUpload = (file) => {
85 86
       if (file && file.file) {
86
-        uploadImage(file.file, "", 1).then((url) => {
87
+        uploadImage(file.file, '', 1).then((url) => {
87 88
           formData.url = url
88 89
           imgUrl.value = [{ url: url }]
89 90
         })