|
@@ -1,12 +1,16 @@
|
1
|
1
|
<template>
|
|
2
|
+ <van-nav-bar
|
|
3
|
+ title="关闭房源"
|
|
4
|
+ left-text="返回"
|
|
5
|
+ left-arrow
|
|
6
|
+ @click-left="$router.go(-1)"
|
|
7
|
+ />
|
2
|
8
|
<div class="closehouse">
|
3
|
|
- <van-form @submit="onSubmit">
|
|
9
|
+ <van-form @submit="handleSumbit">
|
4
|
10
|
<van-field
|
5
|
|
- v-model="state.id"
|
6
|
|
- name="id"
|
7
|
|
- label="房源编号"
|
8
|
11
|
readonly
|
9
|
|
- placeholder="房源编号"
|
|
12
|
+ v-model="roomCode"
|
|
13
|
+ label="房源编号"
|
10
|
14
|
/>
|
11
|
15
|
<van-field
|
12
|
16
|
v-model="state.building"
|
|
@@ -22,35 +26,23 @@
|
22
|
26
|
label="所属楼盘"
|
23
|
27
|
readonly
|
24
|
28
|
placeholder="所属楼盘"
|
25
|
|
-
|
26
|
29
|
/>
|
27
|
|
-
|
28
|
30
|
<van-field
|
29
|
|
- v-model="pickerState.value"
|
30
|
|
- readonly
|
31
|
|
- clickable
|
32
|
|
- required
|
33
|
|
- name="address"
|
34
|
|
- label="所属楼盘"
|
35
|
|
- placeholder="所属楼盘"
|
36
|
|
- @click="pickerState.showPicker = true"
|
37
|
|
- :rules="[{ required: true, message: '请选择所属楼盘' }]"
|
38
|
|
- />
|
39
|
|
- <van-popup v-model:show="pickerState.showPicker" position="bottom">
|
40
|
|
- <van-picker
|
41
|
|
- :columns="columns"
|
42
|
|
- @confirm="onConfirm"
|
43
|
|
- @cancel="pickerState.showPicker = false"
|
44
|
|
- />
|
45
|
|
- </van-popup>
|
46
|
|
- <!-- <van-field
|
47
|
|
- v-model="state.building"
|
48
|
31
|
required
|
49
|
32
|
name="type"
|
50
|
33
|
label="关闭类型"
|
51
|
34
|
placeholder="请选择"
|
52
|
35
|
:rules="[{ required: true, message: '请填写密码' }]"
|
53
|
|
- /> -->
|
|
36
|
+ >
|
|
37
|
+ <template #input>
|
|
38
|
+ <van-radio-group v-model="checked" direction="horizontal">
|
|
39
|
+ <van-radio name="0">暂不出售</van-radio>
|
|
40
|
+ <van-radio name="1">无效</van-radio>
|
|
41
|
+ <van-radio name="2">他售</van-radio>
|
|
42
|
+ </van-radio-group>
|
|
43
|
+ </template>
|
|
44
|
+ </van-field>
|
|
45
|
+
|
54
|
46
|
<van-field
|
55
|
47
|
v-model="state.explain"
|
56
|
48
|
required
|
|
@@ -63,7 +55,7 @@
|
63
|
55
|
:rules="[{ required: true, message: '请填写关闭说明' }]"
|
64
|
56
|
/>
|
65
|
57
|
<div style="margin: 16px;">
|
66
|
|
- <van-button round block type="primary" native-type="submit">
|
|
58
|
+ <van-button block type="warning" native-type="submit">
|
67
|
59
|
提交
|
68
|
60
|
</van-button>
|
69
|
61
|
</div>
|
|
@@ -72,27 +64,37 @@
|
72
|
64
|
</template>
|
73
|
65
|
|
74
|
66
|
<script>
|
75
|
|
-import { reactive } from "vue";
|
76
|
|
-import { Form, Button, Field, Picker, Popup } from "vant";
|
|
67
|
+import { computed, reactive } from "vue"
|
|
68
|
+import { NavBar, Form, Button, Field, Picker, Popup, RadioGroup, Radio } from "vant"
|
|
69
|
+import { useModel } from '@zjxpcyc/vue-tiny-store/dist'
|
77
|
70
|
|
78
|
71
|
export default {
|
79
|
72
|
name: "closehouse",
|
80
|
73
|
components: {
|
|
74
|
+ [NavBar.name]: NavBar,
|
81
|
75
|
[Form.name]: Form,
|
82
|
76
|
[Button.name]: Button,
|
83
|
77
|
[Field.name]: Field,
|
84
|
78
|
[Popup.name]: Popup,
|
85
|
79
|
[Picker.name]: Picker,
|
|
80
|
+ [RadioGroup.name]: RadioGroup,
|
|
81
|
+ [Radio.name]: Radio,
|
86
|
82
|
// Secondhand:secondhand,
|
87
|
83
|
},
|
88
|
|
- data() {
|
89
|
|
- return {};
|
90
|
|
- },
|
91
|
84
|
setup() {
|
92
|
|
- const state = reactive({
|
93
|
|
- id: "",
|
94
|
|
- building: "",
|
|
85
|
+ const { detail } = useModel('room')
|
|
86
|
+
|
|
87
|
+ const formData = reactive({
|
|
88
|
+ roomId: undefined,
|
|
89
|
+ type: undefined,
|
|
90
|
+ reason: undefined,
|
|
91
|
+ content: undefined,
|
95
|
92
|
});
|
|
93
|
+
|
|
94
|
+ const roomCode = () => computed(() => {
|
|
95
|
+ return `${detail.roomInfo?.roomCode}${detail.roomInfo?.id}`
|
|
96
|
+ })
|
|
97
|
+
|
96
|
98
|
const onSubmit = (values) => {
|
97
|
99
|
console.log("submit", values);
|
98
|
100
|
};
|
|
@@ -109,7 +111,8 @@ export default {
|
109
|
111
|
};
|
110
|
112
|
|
111
|
113
|
return {
|
112
|
|
- state,
|
|
114
|
+ formData,
|
|
115
|
+ roomCode,
|
113
|
116
|
pickerState,
|
114
|
117
|
columns,
|
115
|
118
|
onConfirm,
|
|
@@ -120,4 +123,9 @@ export default {
|
120
|
123
|
</script>
|
121
|
124
|
|
122
|
125
|
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
123
|
|
-<style lang="less" scoped></style>
|
|
126
|
+<style lang="less" scoped>
|
|
127
|
+.closehouse {
|
|
128
|
+ padding: 1em;
|
|
129
|
+ padding-top: 2em;
|
|
130
|
+}
|
|
131
|
+</style>
|