linwe
2024-08-08 3c738f4fe2762bba8087e5a22fc0dc06560eab0e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
<template>
    <view>
        <view class="content bgc-ff">
            <u-form labelPosition="left" :model="info" :rules="rules" ref="form" labelWidth="90"
                :labelStyle="{fontSize:'28rpx'}">
                <u-form-item label="姓名" prop="name" borderBottom required>
                    <u-input v-model="info.name" border="none" placeholder="请输入姓名" placeholderClass="f-28 c-99"
                        inputAlign="right"></u-input>
                </u-form-item>
                <u-form-item label="电话" prop="phone" borderBottom required>
                    <u-input v-model="info.phone" type="number" border="none" placeholder="请输入电话"
                        placeholderClass="f-28 c-99" inputAlign="right"></u-input>
                </u-form-item>
                <u-form-item label="身份证号码" prop="idCard" borderBottom required>
                    <u-input v-model="info.idCard" type="idcard" border="none" placeholder="请输入身份证号码"
                        placeholderClass="f-28 c-99" inputAlign="right"></u-input>
                </u-form-item>
                <u-form-item label="房东姓名" prop="landlordName" borderBottom required>
                    <u-input v-model="info.landlordName" border="none" disabled disabledColor="#fff"
                        placeholder="请输入房东姓名" placeholderClass="f-28 c-99" inputAlign="right"></u-input>
                </u-form-item>
                <u-form-item label="房东电话" prop="landlordPhone" borderBottom required>
                    <u-input v-model="info.landlordPhone" border="none" disabled disabledColor="#fff"
                        placeholder="请输入房东电话" placeholderClass="f-28 c-99" inputAlign="right"></u-input>
                </u-form-item>
                <u-form-item label="地址" prop="address" borderBottom required>
                    <u-textarea v-model="info.address" border="none" placeholder="请输入地址" placeholderClass="f-28 c-99"
                        inputAlign="right"></u-textarea>
                </u-form-item>
                <u-form-item label="申请事由" prop="remak" :borderBottom="false">
                    <u-textarea v-model="info.remak" border="none" placeholder="请输入申请事由" placeholderClass="f-28 c-99"
                        inputAlign="right"></u-textarea>
                </u-form-item>
            </u-form>
        </view>
 
 
 
        <view class="cell flex j-c-s-b a-i-c bgc-ff" @click="showPopup = true">
            <text class="f-28">须知说明</text>
            <u-icon name="arrow-right"></u-icon>
        </view>
 
 
        <button class="submit-btn" @click="sumitInfo">提交</button>
        <button class="list-btn" @click="navigatorPage">我申请的记录</button>
 
        <u-popup mode="center" :show="showPopup" :round="10" @close="showPopup = false" :closeable="true">
            <view class="explain">
                <view class="explain-title f-30 fw">
                    须知说明
                </view>
                <view class="explain-content">
                    <scroll-view class="explain-scroll" :scroll-y="true">
                        办理居住证需要先在居住地派出所办理居住登记,办理居住登记需填写《江西省流动人口居住登记表》并提供本人身份证或户口簿、本人近期两张一寸彩色相片和居住地址证明。居住登记满6个月后,可到居住地派出所申领居住证。居住地址证明包括:1、租房:租赁合同;房东房产证(不动产证、土地证或购房合同)及身份证。2、自有(亲属)房屋:房产证、不动产证、土地证或购房合同;如非本人房产还需提供与产权人关系证明。3、居住在单位、就读学校宿舍的:单位出具的住宿证明。
                        对于实际居住6个月以上,符合合法稳定住所、合法稳定就业、连续就读条件之一的;以及符合人才引进在居住地就业创业的,可以在办理完居住登记后直接到派出所申领居住证。1、以合法稳定住所为由申请的,需提交办理时间满6个月的房屋产权证明。2、以合法稳定就业为由申请的,需提交办理满6个月的工商营业执照或在居住地连续缴纳6个月以上的社保、公积金:养老保险、公积金之一;3、以连续就读为由申请的,需提交学生证或就读学校出具的其他能够证明连续就读满半年的材料。4、符合人才引进类的,需满足以下条件:
                        (一)具有国家承认大专及以上学历的人员,提供学历证书;
                        提
                        (二)具有中级及以上专业技术职称的人员,提供专业技术等级证书;
                        投
                        (三)持有高级工及以上国家职业资格证书的人员,提供职业资格证书;
                        (四)工业园区组织人事部门认定的企业急需人才,提供有关组织人事部门出具的认定文件;
                        (五)县级以上组织部门或人力资源社会保障部门认定的企业急需人才,提供有关组织人事部门出具的认定文件;
                        符合以上第(一)至第(五)条件的,还要提供以下材料:就业的,提供与用人单位签订的半年以上期限的劳动(聘用)合同或企业为其缴纳的社会保险凭证;创业的,提供工商营业执照或事业单位法人证书。
                        (六)个人在当地投资30万以上的人员,提供营业执照。
                    </scroll-view>
                </view>
            </view>
        </u-popup>
    </view>
</template>
 
<script>
    import {
        saveResideApply,
        getResideApplyDetail,
        updateResideApply
    } from "@/api/reside/reside.js"
 
    import {
        householdDetail,
        getHouseholdLists
    } from "@/api/house/household.js"
 
    export default {
        data() {
            return {
                info: {
                    name: "",
                    phone: "",
                    idCard: "",
                    address: "",
                    remak: "",
                    houseCode: "",
                    landlordPhone: "",
                    landlordName: ""
                },
                rules: {
                    name: [{
                        type: 'string',
                        required: true,
                        message: '请输入姓名',
                        trigger: ['blur', 'change']
                    }],
                    phone: [{
                            type: 'string',
                            required: true,
                            message: '请输入手机号',
                            trigger: ['blur', 'change']
                        },
                        {
                            validator: (rule, value, callback) => {
                                return uni.$u.test.mobile(value);
                            },
                            message: '手机号码不正确',
                            trigger: ['change', 'blur']
                        }
                    ],
                    idCard: [{
                            type: 'string',
                            required: false,
                            message: '请输入身份证号码',
                            trigger: ['change', 'blur']
                        },
                        {
                            validator: (rule, value, callback) => {
                                const idCardRegex =
                                    /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/
                                return idCardRegex.test(value)
                            },
 
                            message: '身份证号码有误',
                            trigger: ['change', 'blur']
                        }
                    ],
                    address: [{
                        type: 'string',
                        required: true,
                        message: '请选择地址',
                        trigger: ['blur', 'change']
                    }],
                },
                isEdit: false,
                houseHoldInfo: {},
                showPopup: false
            }
        },
 
        async onLoad(option) {
            if (option.id) {
                this.isEdit = true;
                this.getDetail(option.id)
            } else {
                let {
                    houseCode,
                    name
                } = uni.getStorageSync("siteInfo");
                this.$set(this.info, "houseCode", houseCode)
                this.$nextTick(() => {
                    this.$set(this.info, "address", name)
                })
                await this.getHouseholdList();
                this.getHouseholdInfo()
            }
        },
 
        onReady() {
            //onReady 为uni-app支持的生命周期之一
            this.$refs.form.setRules(this.rules)
        },
 
        methods: {
            getDetail(id) {
                getResideApplyDetail({
                    id
                }).then(res => {
                    if (res.code == 200) {
                        for (let i in this.info) {
                            this.info[i] = res.data[i];
                        }
                    }
                })
            },
 
            getHouseholdList() {
                getHouseholdLists({
                    houseCode: this.info.houseCode,
                    relationship: 1
                }).then(res => {
                    console.log(res)
                    if (res.code == 200) {
                        this.$nextTick(() => {
                            this.$set(this.info, "landlordName", res.data.records[0].name)
                            this.$set(this.info, "landlordPhone", res.data.records[0].phoneNumber)
                        })
                    }
                })
            },
 
            //获取租户信息
            getHouseholdInfo() {
                householdDetail({
                    houseCode: this.info.houseCode,
                    associatedUserId: uni.getStorageSync("userInfo").user_id
                }).then(res => {
                    console.log(res)
                    if (res.code == 200) {
                        for (let i in this.info) {
                            this.info[i] = res.data[i]
                        }
                        this.info.phone = res.data.phoneNumber;
                    }
 
 
                })
 
 
            },
 
 
 
 
 
 
            sumitInfo() {
                this.$refs.form.validate().then(valid => {
                    if (this.isEdit) {
                        this.updateInfoRequest();
                    } else {
                        this.addInfoRequst();
                    }
                })
            },
 
            addInfoRequst() {
                saveResideApply(this.info).then(res => {
                    if (res.code == 200) {
                        this.$showTips("提交成功", "success")
                        setTimeout(() => {
                            uni.navigateBack();
                        }, 300)
                    }
                })
            },
 
            updateInfoRequest() {
                updateResideApply(this.info).then(res => {
                    if (res.code == 200) {
                        this.$showTips("提交成功", "success")
                        setTimeout(() => {
                            uni.navigateBack();
                        }, 300)
                    }
                })
            },
 
            navigatorPage() {
                uni.navigateTo({
                    url: "record"
                })
            }
 
        }
    }
</script>
 
<style lang="less">
    page {
        background-color: #F5F5F5;
    }
 
    .content {
        margin: 20rpx 30rpx;
        padding: 0 30rpx;
    }
 
    .row {
        padding: 20rpx 0;
        border-bottom: 1px solid
    }
 
    .location-btn {
        width: 116rpx;
        height: 46rpx;
        line-height: 46rpx;
        border-radius: 4rpx;
        border: 1px solid currentColor;
        padding: 0;
        background-color: #fff;
    }
 
    .upload {
        margin: 0 30rpx;
        padding: 30rpx;
 
        .upload-item {
            width: 140rpx;
            height: 140rpx;
            border: 1px solid #EEEEEE;
        }
    }
 
    .address-row {
        flex: 1;
        justify-content: flex-end;
        align-items: center;
    }
 
    .address-content {
        width: calc(100% - 116rpx - 20rpx);
        margin-right: 20rpx;
        text-align: right;
    }
 
    .location-btn {
        width: 116rpx;
        height: 46rpx;
        line-height: 46rpx;
        border-radius: 4rpx;
        border: 1px solid currentColor;
        padding: 0;
        background-color: #fff;
        text-align: center;
    }
 
    .submit-btn {
        width: 690rpx;
        height: 78rpx;
        line-height: 78rpx;
        background: linear-gradient(163deg, #01BDFC 0%, #017BFC 100%);
        border-radius: 8rpx 8rpx 8rpx 8rpx;
        font-size: 32rpx;
        color: #fff;
        margin-top: 50rpx;
    }
 
    .list-btn {
        width: 690rpx;
        height: 78rpx;
        line-height: 78rpx;
        background: linear-gradient(163deg, #c7d7dc 0%, #c3cdd8 100%);
        border-radius: 8rpx 8rpx 8rpx 8rpx;
        font-size: 32rpx;
        color: #fff;
        margin-top: 50rpx;
    }
 
    .cell {
        padding: 20rpx;
        margin: 20rpx 30rpx 0;
 
    }
 
    .explain {
        padding: 20rpx;
        width: 650rpx;
 
        .explain-title {
            text-align: center;
            padding: 20rpx 0;
        }
 
        .explain-content {
            width: 100%;
            height: 750rpx;
            padding: 20rpx 0;
            box-sizing: border-box;
 
        }
    }
 
    .explain-scroll {
        width: 100%;
        height: 100%;
        padding: 0 30rpx;
        box-sizing: border-box;
        text-indent: 2em;
        text-align: justify;
        white-space: pre-line;
    }
</style>