| | |
| | | import http from '@/http/api.js' |
| | | import { |
| | | devUrl, |
| | | prodUrl, |
| | | contentType |
| | | } from '@/common/setting' |
| | | |
| | | import { |
| | | clientId, |
| | | clientSecret |
| | | } from '@/common/setting'
|
| | | |
| | | export const getDoorplateAddressList = (code, type) => { |
| | | return http.request({ |
| | |
| | | }) |
| | | } |
| | | |
| | | export const uploadFile = (data) => { |
| | | return http.request({ |
| | | url: 'blade-resource/oss/endpoint/put-file', |
| | | method: 'post', |
| | | custom: { |
| | | Authorization: true |
| | | }, |
| | | data |
| | | export const uploadFile = (file) => {
|
| | | return uni.uploadFile({
|
| | | url: (process.env.NODE_ENV === 'development' ? devUrl : prodUrl ) + '/blade-resource/oss/endpoint/put-file', |
| | | filePath: file,
|
| | | name: 'file', |
| | | header: { |
| | | Authorization: uni.getStorageSync('accessToken') |
| | | }
|
| | | }) |
| | | } |
| | | |
| | |
| | |
|
| | |
|
| | | navTo() {
|
| | | if (this.curHouseCode === '') {
|
| | | uni.showToast({
|
| | | title: "请选择地址",
|
| | | icon: "error"
|
| | | })
|
| | | return
|
| | | }
|
| | | this.$u.func.globalNavigator(`/subPackage/bs/views/zhsb?houseCode=${this.curHouseCode}`, "navTo")
|
| | | },
|
| | |
|
| | |
| | | <u-button icon="calendar" class="btn-item" type="primary" plain text="续租"
|
| | | @click="xzHandleClick(item)"></u-button>
|
| | | <u-button icon="order" class="btn-item" type="primary" plain text="终止"
|
| | | @click="terminate(item)"></u-button>
|
| | | :disabled="item.status == 1 || item.status == 2" @click="terminate(item)"></u-button>
|
| | | </view>
|
| | |
|
| | | </view>
|
| | |
| | | istPickerShow: false,
|
| | | currentRentalId: '',
|
| | | isModelShow: false, |
| | | status: [ |
| | | { |
| | | status: [{
|
| | | name: '未到期', |
| | | value: 0 |
| | | }, |
| | |
| | | code,
|
| | | data
|
| | | } = await deleteRentalInfo(this.currentRentalId)
|
| | | console.log(code, data)
|
| | | if (code !== 200) { |
| | | uni.showToast({ |
| | | title: "删除失败", |
| | | icon: "error", |
| | | duration: 1500 |
| | | }) |
| | | return |
| | | }
|
| | | this.isModelShow = false
|
| | | this.$emit('refreshData')
|
| | | },
|
| | | pushPage(item) {
|
| | | const {
|
| | |
| | | id: this.currentRentalId,
|
| | | dueTime: time
|
| | | })
|
| | | if (res.code !== 200) {
|
| | | uni.showToast({
|
| | | title: "续租失败",
|
| | | icon: "error",
|
| | | duration: 1500
|
| | | }) |
| | | return
|
| | | }
|
| | | this.isPickerShow = false
|
| | | this.$emit('refreshData')
|
| | | },
|
| | | async terminate(item) {
|
| | | terminate(item) {
|
| | | this.currentRentalId = item.housingRentalId
|
| | | this.istPickerShow = true
|
| | | },
|
| | |
| | | id: this.currentRentalId,
|
| | | terminationTime: time
|
| | | })
|
| | | this.isPickerShow = false
|
| | | if (res.code !== 200) { |
| | | uni.showToast({ |
| | | title: "终止失败", |
| | | icon: "error", |
| | | duration: 1500 |
| | | }) |
| | | return |
| | | }
|
| | | this.istPickerShow = false
|
| | | this.$emit('refreshData')
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | <u-icon slot="right" name="arrow-right"></u-icon>
|
| | | </u-form-item>
|
| | | <u-form-item @click="showSelectBus(dataList.houseType, '房屋状态', 'houseTypeName', 'houseType')"
|
| | | class="form-item" labelWidth="100" label="房屋状态:" required prop="houseType">
|
| | | class="form-item" labelWidth="100" label="房屋状态:" required prop="houseTypeName">
|
| | | <u--input border="none" v-model="houseTypeName" disabled disabledColor="#ffffff" placeholder="请选择">
|
| | | </u--input>
|
| | | <u-icon slot="right" name="arrow-right"></u-icon>
|
| | | </u-form-item>
|
| | | <u-form-item @click="showSelectBus(dataList.rentalUse, '租房用途', 'rentalUseName', 'rentalUse')"
|
| | | class="form-item" labelWidth="100" label="租房用途:" required prop="rentalUse">
|
| | | class="form-item" labelWidth="100" label="租房用途:" required prop="rentalUseName">
|
| | | <u--input border="none" v-model="rentalUseName" disabled disabledColor="#ffffff" placeholder="请选择">
|
| | | </u--input>
|
| | | <u-icon slot="right" name="arrow-right"></u-icon>
|
| | |
| | | form: {
|
| | | relation: "",
|
| | | rentTime: "",
|
| | | houseTypeName: "", |
| | | rentalUseName: "",
|
| | | dueTime: "",
|
| | | },
|
| | | imagesList: [],
|
| | |
| | | required: true,
|
| | | message: '请选择租客关系'
|
| | | }],
|
| | | houseType: [{
|
| | | houseTypeName: [{
|
| | | required: true,
|
| | | message: '请选择房屋状态'
|
| | | }],
|
| | | rentalUse: [{
|
| | | rentalUseName: [{
|
| | | required: true,
|
| | | message: '请选择房屋用途'
|
| | | }],
|
| | |
| | | this.dueTimeShow = false
|
| | | },
|
| | | async afterReadImg(e) { |
| | | // const formData = new FormData() |
| | | // const { file } = e |
| | | // formData.append('file', file[0])
|
| | | // const res = await uploadFile(formData)
|
| | | console.log(this.$store); |
| | | |
| | | },
|
| | | addRentForm() {
|
| | | this.rentFormNum++
|
| | |
| | | }catch(e){ |
| | | uni.showToast({ |
| | | title: "删除失败", |
| | | icon: "success", |
| | | icon: "error", |
| | | duration: 1500 |
| | | }) |
| | | }
|
| | | },
|
| | | saveOrUpdate() {
|
| | | console.log(this.rentalUseName, this.houseTypeName);
|
| | | this.$refs.form.validate().then(res => {
|
| | | let rentFormValidGroup = []
|
| | | this.$refs.rentform.forEach(item => {
|
| | |
| | | relation: tenantRelationship,
|
| | | rentTime: rentalTime,
|
| | | dueTime: dueTime,
|
| | | houseTypeName: houseStatus, |
| | | rentalUseName: rentalUse
|
| | | }
|
| | | this.rentalUseName = this.findObjValue(rentalUse, this.dataList.rentalUse)
|
| | | this.relationName = this.findObjValue(tenantRelationship, this.dataList.relation)
|
| | |
| | | <view class="title">出租管理</view>
|
| | | </view>
|
| | | <view class="list">
|
| | | <rentList :list="rentList"></rentList>
|
| | | <rentList :list="rentList" @refreshData="refreshData"></rentList>
|
| | | </view>
|
| | | </view>
|
| | |
|
| | |
| | | this.rentList = []
|
| | | this.location = (!!aoiName ? aoiName : '') + buildingName
|
| | | this.room = (!!unitName ? unitName : '') + doorplateName + "室"
|
| | | this.num = 0
|
| | | houseRentalList !== 0 && houseRentalList.forEach(item => {
|
| | | const { houseTenantVOList, dueTime, rentalTime } = item |
| | | item.num = houseTenantVOList.length |
| | | this.num += item.num
|
| | | if (item.num !== 0) { |
| | | item.name = houseTenantVOList[0].name |
| | | item.housingRentalId = houseTenantVOList[0].housingRentalId |
| | | }
|
| | | this.rentList = houseRentalList
|
| | | })
|
| | | },
|
| | | addRent() {
|
| | | this.$u.func.globalNavigator("/subPackage/bs/views/rentDetail?houseCode=" + this.houseCode)
|
| | | }, |
| | | refreshData() { |
| | | this.getHouseRent() |
| | | }
|
| | | }
|
| | | }
|
| | |
| | | </u-form-item> |
| | | |
| | | <u-form-item class="form-item" labelWidth="100" label="地址" required> |
| | | <u--input border="none" v-model="form.address"> |
| | | <u--input border="none" v-model="form.address" disabled>
|
| | | </u--input> |
| | | </u-form-item> |
| | | |
| | | <u-form-item class="form-item" labelWidth="100" label="物业月费" required> |
| | | <u--input border="none" v-model="form.property_price"> |
| | | <u--input border="none" v-model="form.property_price" disabled>
|
| | | </u--input> |
| | | </u-form-item> |
| | | |
| | | <u-form-item class="form-item" labelWidth="100" label="到期时间" required> |
| | | <u--input border="none" v-model="form.service_due"> |
| | | <u--input border="none" v-model="form.service_due" disabled>
|
| | | </u--input> |
| | | </u-form-item> |
| | | </view> |
| | |
| | | <box-title title="房屋标签"></box-title> |
| | | <view class="mt-20 flex label-btn-box b-c-w"> |
| | | <view v-for="(item, index) in labelBtnList" :key="index"> |
| | | <u-button color="#000" size="mini" type="primary" :plain="true" :text="item.name" @click="showLabelPopup(item)"></u-button> |
| | | <u-button color="#000" size="mini" type="primary" :plain="true" :text="item.name"
|
| | | @click="showLabelPopup(item)"></u-button>
|
| | | </view> |
| | | </view> |
| | | </u-form> |
| | |
| | | </view> |
| | | </view> |
| | | |
| | | <u-modal style="flex: none;" :show="popupShow" :closeOnClickOverlay="true" showCancelButton @cancel="popupShow = false" @confirm="popupConfirm"> |
| | | <u-modal style="flex: none;" :show="popupShow" :closeOnClickOverlay="true" showCancelButton
|
| | | @cancel="popupShow = false" @confirm="popupConfirm">
|
| | | <view class="slot-content"> |
| | | <view class="flex_base"> |
| | | {{ labelModelInfo.title }} |
| | |
| | | import uploadMixin from "@/mixin/uploadMixin"; |
| | | import { |
| | | getHouseDetail, |
| | | getHouseLabelList |
| | | getHouseLabelList, |
| | | uploadFile
|
| | | } from "@/api/doorplateAddress/doorplateAddress"; |
| | | export default { |
| | | mixins: [uploadMixin], |
| | |
| | | |
| | | }, |
| | | onLoad(option) { |
| | | const { code } = option |
| | | const {
|
| | | code
|
| | | } = option
|
| | | this.houseCode = code |
| | | }, |
| | | onShow() { |
| | |
| | | async getLabelList() { |
| | | const res = await getHouseLabelList() |
| | | this.labelBtnList = res.data |
| | | },
|
| | | async afterReadImg(event) {
|
| | | let lists = [].concat(event.file) |
| | | lists.forEach(item => { |
| | | const { url } = item |
| | | uploadFile(item) |
| | | })
|
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | <view class="l flex-1 flex">
|
| | | <view class="flex_base">
|
| | | <view class="head-img flex_base">
|
| | | <u--image shape="circle" :showLoading="true" :src="item.src" width="120rpx"
|
| | | <u--image shape="circle" :showLoading="true" :src="item.src|| '/static/icon/user-01.png'" width="120rpx"
|
| | | height="120rpx"></u--image>
|
| | | </view>
|
| | | </view>
|
| | |
| | | {{item.rentalTime}} - {{item.dueTime}}
|
| | | </view>
|
| | | <view class="r">
|
| | | {{item.status == 1 ? '已到期' : '未到期'}}
|
| | | {{findObjValue(item.status, status)}}
|
| | | </view>
|
| | | </view>
|
| | | <view class="btn-box flex j-c-s-a">
|
| | | <u-button color="#CDF3DF" text="修改"></u-button>
|
| | | <u-button color="#DAE7FF" text="续租"></u-button>
|
| | | <u-button color="#FCCED3" text="终止"></u-button>
|
| | | <u-button color="#CDF3DF" text="修改" @click="editRent(item)"></u-button>
|
| | | <u-button color="#DAE7FF" text="续租" @click="reletRent(item)"></u-button>
|
| | | <u-button color="#FCCED3" text="终止" @click="deleteRent(item)"></u-button>
|
| | | </view>
|
| | | </view>
|
| | | </view>
|
| | |
|
| | | <u-datetime-picker :show="isPickerShow" @cancel="isPickerShow = false" mode="date" |
| | | @confirm="dueTimeConfirm"></u-datetime-picker> |
| | | <u-datetime-picker :show="istPickerShow" @cancel="istPickerShow = false" mode="date" |
| | | @confirm="terminateTimeConfirm"></u-datetime-picker>
|
| | | <u-divider text="已经到底了"></u-divider>
|
| | | </view>
|
| | |
|
| | |
| | | <u-button type="primary" :plain="true" text="添加租赁信息" @click="addRental"></u-button>
|
| | | </view>
|
| | | </view>
|
| | | |
| | | </view>
|
| | | </view>
|
| | | </template>
|
| | |
| | | import {
|
| | | getHouseRentInfo
|
| | | } from "@/api/doorplateAddress/doorplateAddress";
|
| | | import { |
| | | deleteRentalInfo, |
| | | updateDueTime |
| | | } from "@/api/houseRental/houseRental.js";
|
| | | export default {
|
| | | components: {},
|
| | |
|
| | |
| | | allNum: 0
|
| | | },
|
| | | ownerInfoList: [],
|
| | | rentOutList: []
|
| | | rentOutList: [], |
| | | isPickerShow: false, |
| | | istPickerShow: false, |
| | | currentRentalId: '', |
| | | isModelShow: false, |
| | | status: [{ |
| | | name: '未到期', |
| | | value: 0 |
| | | }, |
| | | { |
| | | name: '已到期', |
| | | value: 1 |
| | | }, |
| | | { |
| | | name: '已终止', |
| | | value: 2 |
| | | }, |
| | | ]
|
| | | }
|
| | | },
|
| | |
|
| | |
| | | houseName,
|
| | | unitName,
|
| | | houseRentalList,
|
| | | householdList
|
| | | householdList, |
| | | subAoi
|
| | | } = res.data
|
| | | this.houseCode = addressCode
|
| | | this.rentOutList = houseRentalList
|
| | | this.ownerInfoList = householdList
|
| | | this.houseInfo.houseName = houseName
|
| | | this.houseInfo.unitName = unitName
|
| | | this.houseInfo.houseTitle = aoiName + ':' + buildingName
|
| | | this.houseInfo.houseTitle =( aoiName || subAoi) + ':' + buildingName
|
| | | // 判断当前租客有没有过期
|
| | | this.rentOutList.forEach(item => {
|
| | | // 事件格式处理
|
| | |
| | | item.allNum = item.houseTenantVOList.length
|
| | | // 多人个租客将第一个作为显示
|
| | | item.tenant = item.houseTenantVOList.length > 0 ? item.houseTenantVOList[0].name : ''
|
| | | item.housingRentalId = item.houseTenantVOList[0]?.housingRentalId |
| | | })
|
| | | this.houseInfo.allNum = householdList.length
|
| | |
|
| | |
| | | }, |
| | | addMember() { |
| | | this.$u.func.globalNavigator('/subPackage/house/member/index') |
| | | }, |
| | | editRent(item) { |
| | | const { houseCode, id } = item |
| | | this.$u.func.globalNavigator(`/subPackage/bs/views/rentDetail?houseCode=${houseCode}&id=${id}`) |
| | | }, |
| | | reletRent(item) { |
| | | console.log(item); |
| | | this.currentRentalId = item.housingRentalId |
| | | this.isPickerShow = true |
| | | }, |
| | | |
| | | deleteRent(item) { |
| | | this.currentRentalId = item.housingRentalId |
| | | this.istPickerShow = true |
| | | }, |
| | | async dueTimeConfirm(e) { |
| | | const time = uni.$u.timeFormat(e.value, 'yyyy-mm-dd') |
| | | const res = await updateDueTime({ |
| | | id: this.currentRentalId, |
| | | dueTime: time |
| | | }) |
| | | if (res.code !== 200) { |
| | | uni.showToast({ |
| | | title: "续租失败", |
| | | icon: "error", |
| | | duration: 1500 |
| | | }) |
| | | return |
| | | }
|
| | | this.isPickerShow = false |
| | | this.getHouseRentInfoList() |
| | | }, |
| | | async terminateTimeConfirm(e) { |
| | | const time = uni.$u.timeFormat(e.value, 'yyyy-mm-dd') |
| | | const res = await updateDueTime({ |
| | | id: this.currentRentalId, |
| | | terminationTime: time |
| | | }) |
| | | if (res.code !== 200) { |
| | | uni.showToast({ |
| | | title: "终止失败", |
| | | icon: "error", |
| | | duration: 1500 |
| | | }) |
| | | return |
| | | } |
| | | this.istPickerShow = false |
| | | this.getHouseRentInfoList() |
| | | }, |
| | | findObjValue(value, obj) { |
| | | const res = obj.find(item => { |
| | | return item.value == value |
| | | }) |
| | | return res.name |
| | | },
|
| | | }
|
| | | }
|
| | | </script>
|