| | |
| | | // 续租 |
| | | export const updateRetalInfo = (data) => { |
| | | return http.request({ |
| | | url: '/blade-houseRental/houseRental/updateHouseRental', |
| | | url: 'blade-houseRental/houseRental/updateHouseRental', |
| | | method: 'POST', |
| | | custom: { |
| | | 'Authorization': true |
| | | }, |
| | | data |
| | | }) |
| | | } |
| | | |
| | | // 房屋标签修改 |
| | | export const updateHouseLabel = (data) => { |
| | | return http.request({ |
| | | url: 'blade-houseLabel/houseLabel/saveOrUpdateHouseLabel', |
| | | method: 'POST', |
| | | data |
| | | }) |
| | | } |
| | | |
| | | // 房屋标签撤销 |
| | | export const removeHouseLabel = (ids) => { |
| | | return http.request({ |
| | | url: 'blade-houseLabel/houseLabel/remove', |
| | | method: 'POST', |
| | | params: { |
| | | ids |
| | | } |
| | | }) |
| | | } |
| | |
| | | import uploadMixin from "@/mixin/uploadMixin";
|
| | | import {
|
| | | getHouseDetail,
|
| | | getHouseLabelList, |
| | | uploadFile
|
| | | getHouseLabelList,
|
| | | uploadFile,
|
| | | } from "@/api/doorplateAddress/doorplateAddress";
|
| | | import {
|
| | | updateHouseLabel,
|
| | | removeHouseLabel
|
| | | } from "@/api/houseRental/houseRental.js";
|
| | | export default {
|
| | | mixins: [uploadMixin],
|
| | | data() {
|
| | |
| | | color: '#EE0A24'
|
| | | }
|
| | | ],
|
| | | currentLabelInfo: {},
|
| | | currentColorInfo: {},
|
| | | labelModelInfo: {
|
| | | title: '',
|
| | | selectedColor: ''
|
| | |
| | | showLabelPopup(item) {
|
| | | this.popupShow = true
|
| | | this.labelModelInfo.title = item.name
|
| | | this.currentLabelInfo = item
|
| | | },
|
| | |
|
| | | popupConfirm() {
|
| | |
| | | },
|
| | |
|
| | | radioChange(item) {
|
| | |
|
| | | this.currentColorInfo = item
|
| | | },
|
| | | async popupConfirm() {
|
| | | const {
|
| | | id
|
| | | } = this.currentLabelInfo
|
| | | const {
|
| | | color,
|
| | | name
|
| | | } = this.currentColorInfo
|
| | | let res = null
|
| | | if (name === '撤销') {
|
| | | res = await removeHouseLabel(id)
|
| | | } else {
|
| | | res = await updateHouseLabel({
|
| | | houseCode: this.houseCode,
|
| | | labelId: id,
|
| | | color
|
| | | })
|
| | | }
|
| | | if (res.code !== 200) {
|
| | | uni.showToast({
|
| | | title: "修改失败",
|
| | | icon: "error",
|
| | | duration: 1500
|
| | | })
|
| | | return
|
| | | }
|
| | | this.getLabelList()
|
| | | this.popupShow = false
|
| | | },
|
| | | async getHouseDetailInfo() {
|
| | | const res = await getHouseDetail()
|
| | | // const { phone, address, property_price, service_due, image_urls } = res.data
|
| | | // this.form = {
|
| | | // phone,
|
| | | // address,
|
| | | // property_price,
|
| | | // service_due,
|
| | | // image_urls: [
|
| | | // image_urls
|
| | | // ]
|
| | | // }
|
| | | const {
|
| | | phone,
|
| | | address,
|
| | | property_price,
|
| | | service_due,
|
| | | image_urls
|
| | | } = res.data
|
| | | this.form = {
|
| | | phone,
|
| | | address,
|
| | | property_price,
|
| | | service_due,
|
| | | image_urls: [
|
| | | image_urls
|
| | | ]
|
| | | }
|
| | | },
|
| | | 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) |
| | | })
|
| | | |
| | | // let lists = [].concat(event.file)
|
| | | // lists.forEach(item => {
|
| | | // const { url } = item
|
| | | // uploadFile(item)
|
| | | // })
|
| | |
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | 租客:{{item.tenant}}(共{{item.allNum}}人)
|
| | | </view>
|
| | | <view class="r">
|
| | | <u-icon name="trash-fill" color="red"></u-icon>
|
| | | <u-icon name="trash-fill" color="red" @click="deleteRent(item)"></u-icon>
|
| | | </view>
|
| | | </view>
|
| | | <view class="t flex j-c-s-b a-i-c">
|
| | |
| | | <view class="btn-box flex j-c-s-a">
|
| | | <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>
|
| | | <u-button color="#FCCED3" text="终止" @click="terRent(item)"></u-button>
|
| | | </view>
|
| | | </view>
|
| | | </view>
|
| | |
| | | @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>
|
| | | <u-divider text="已经到底了"></u-divider> |
| | | <u-modal :show="isModelShow" width="auto" :showCancelButton="true" title="提示" content="请确认是否删除当前租户信息" |
| | | @cancel="isModelShow = false" @confirm="deleteRentalConfirm"></u-modal>
|
| | | </view>
|
| | |
|
| | | <view class="edit-btn">
|
| | |
| | | this.isPickerShow = true |
| | | }, |
| | | |
| | | deleteRent(item) { |
| | | terRent(item) { |
| | | this.currentRentalId = item.housingRentalId |
| | | this.istPickerShow = true |
| | | }, |
| | | deleteRent(item) { |
| | | this.currentRentalId = item.housingRentalId |
| | | this.isModelShow = true |
| | | }, |
| | | async dueTimeConfirm(e) { |
| | | const time = uni.$u.timeFormat(e.value, 'yyyy-mm-dd') |
| | |
| | | this.istPickerShow = false |
| | | this.getHouseRentInfoList() |
| | | }, |
| | | async deleteRentalConfirm() { |
| | | const { |
| | | code, |
| | | data |
| | | } = await deleteRentalInfo(this.currentRentalId) |
| | | if (code !== 200) { |
| | | uni.showToast({ |
| | | title: "删除失败", |
| | | icon: "error", |
| | | duration: 1500 |
| | | }) |
| | | return |
| | | } |
| | | this.isModelShow = false |
| | | this.getHouseRentInfoList() |
| | | }, |
| | | findObjValue(value, obj) { |
| | | const res = obj.find(item => { |
| | | return item.value == value |