From c247a506d95bbe4ec66d92d08096c7107e799e21 Mon Sep 17 00:00:00 2001
From: Lou <luzhiping@qqyjz.com>
Date: Fri, 03 Nov 2023 17:44:22 +0800
Subject: [PATCH] Merge branch 'master' of http://s16s652780.51mypc.cn:49896/r/jczz_app
---
api/doorplateAddress/doorplateAddress.js | 200 ++++++-----
subPackage/house/roomDetails/index.vue | 105 +++++
pages/home/index.vue | 15
subPackage/bs/views/zhsb.vue | 9
subPackage/bs/views/rentDetail.vue | 27
subPackage/house/family/index.vue | 21 +
subPackage/bs/components/list/rentList.vue | 79 +++-
subPackage/house/roomControl/index.vue | 505 +++++++++++++++--------------
subPackage/house/list/index.vue | 6
9 files changed, 563 insertions(+), 404 deletions(-)
diff --git a/api/doorplateAddress/doorplateAddress.js b/api/doorplateAddress/doorplateAddress.js
index 44c1482..96a2322 100644
--- a/api/doorplateAddress/doorplateAddress.js
+++ b/api/doorplateAddress/doorplateAddress.js
@@ -1,98 +1,108 @@
import http from '@/http/api.js'
+import {
+ devUrl,
+ prodUrl,
+ contentType
+} from '@/common/setting'
-export const getDoorplateAddressList = (code, type) => {
- return http.request({
- url: 'blade-doorplateAddress/doorplateAddress/getDoorplateAddressList',
- method: 'GET',
- params: {
- code,
- type
- }
- })
-}
-
-
-
-export const getFuncList = (type, roleName) => {
- return http.request({
- url: 'blade-doorplateAddress/doorplateAddress/getFuncList',
- method: 'GET',
- params: {
- type,
- roleName
- }
- })
-}
-// 获取社区信息
-export const getHouseList = (param) => {
- return http.request({
- url: 'blade-doorplateAddress/doorplateAddress/getHousesList',
- method: 'GET',
- params: param
- })
-}
-
-// 获取当前房屋出租信息
-export const getHouseRentInfo = (code) => {
- return http.request({
- url: 'blade-doorplateAddress/doorplateAddress/getHouseRentInfo',
- method: 'GET',
- params: {
- code
- }
- })
-}
-
-// 获取房屋标签信息
-export const getHouseLabelList = () => {
- return http.request({
- url: 'blade-label/label/getLabelList',
- method: 'GET',
- params: {
- parentId: 1001
- }
- })
-}
-
-// 获取房屋详细信息
-export const getHouseDetail = (houseCode) => {
- return http.request({
- url: 'blade-house/house/getHouseDetail',
- method: 'GET',
- params: {
- houseCode
- }
- })
-}
-
-
-// 获取房屋详细信息
-export const addHouseRental = (data) => {
- return http.request({
- url: 'blade-houseRental/houseRental/add',
- method: 'POST',
- data
- })
-}
-
-export const uploadFile = (data) => {
- return http.request({
- url: 'blade-resource/oss/endpoint/put-file',
- method: 'post',
- custom: {
- Authorization: true
- },
- data
- })
-}
-
-// 获取门牌地址
-export const getDoorplateAddressDetail = (params) => {
- return http.request({
- url: 'blade-doorplateAddress/doorplateAddress/getDoorplateAddressDetail',
- method: 'GET',
- params: {
- ...params
- }
- })
+import {
+ clientId,
+ clientSecret
+} from '@/common/setting'
+
+export const getDoorplateAddressList = (code, type) => {
+ return http.request({
+ url: 'blade-doorplateAddress/doorplateAddress/getDoorplateAddressList',
+ method: 'GET',
+ params: {
+ code,
+ type
+ }
+ })
+}
+
+
+
+export const getFuncList = (type, roleName) => {
+ return http.request({
+ url: 'blade-doorplateAddress/doorplateAddress/getFuncList',
+ method: 'GET',
+ params: {
+ type,
+ roleName
+ }
+ })
+}
+// 获取社区信息
+export const getHouseList = (param) => {
+ return http.request({
+ url: 'blade-doorplateAddress/doorplateAddress/getHousesList',
+ method: 'GET',
+ params: param
+ })
+}
+
+// 获取当前房屋出租信息
+export const getHouseRentInfo = (code) => {
+ return http.request({
+ url: 'blade-doorplateAddress/doorplateAddress/getHouseRentInfo',
+ method: 'GET',
+ params: {
+ code
+ }
+ })
+}
+
+// 获取房屋标签信息
+export const getHouseLabelList = () => {
+ return http.request({
+ url: 'blade-label/label/getLabelList',
+ method: 'GET',
+ params: {
+ parentId: 1001
+ }
+ })
+}
+
+// 获取房屋详细信息
+export const getHouseDetail = (houseCode) => {
+ return http.request({
+ url: 'blade-house/house/getHouseDetail',
+ method: 'GET',
+ params: {
+ houseCode
+ }
+ })
+}
+
+
+// 获取房屋详细信息
+export const addHouseRental = (data) => {
+ return http.request({
+ url: 'blade-houseRental/houseRental/add',
+ method: 'POST',
+ 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')
+ }
+ })
+}
+
+// 获取门牌地址
+export const getDoorplateAddressDetail = (params) => {
+ return http.request({
+ url: 'blade-doorplateAddress/doorplateAddress/getDoorplateAddressDetail',
+ method: 'GET',
+ params: {
+ ...params
+ }
+ })
}
\ No newline at end of file
diff --git a/pages/home/index.vue b/pages/home/index.vue
index b80ce01..55318eb 100644
--- a/pages/home/index.vue
+++ b/pages/home/index.vue
@@ -301,9 +301,9 @@
title: '-',
useSlot: true
}],
- menuList: [],
- curHouseCode: ''
-
+ menuList: [],
+ curHouseCode: ''
+
}
},
@@ -421,7 +421,7 @@
console.log('confirm', e)
this.curSelectSite = e.value[e.value.length - 1]
this.selectBoxShow = false
- this.getHouseDataList(e.value[1]?.id)
+ this.getHouseDataList(e.value[1]?.id)
this.curHouseCode = e.value[0].id
console.log("curSite=>", this.curSelectSite);
},
@@ -525,6 +525,13 @@
navTo() {
+ if (this.curHouseCode === '') {
+ uni.showToast({
+ title: "请选择地址",
+ icon: "error"
+ })
+ return
+ }
this.$u.func.globalNavigator(`/subPackage/bs/views/zhsb?houseCode=${this.curHouseCode}`, "navTo")
},
diff --git a/subPackage/bs/components/list/rentList.vue b/subPackage/bs/components/list/rentList.vue
index 3fd1ebd..c9c35de 100644
--- a/subPackage/bs/components/list/rentList.vue
+++ b/subPackage/bs/components/list/rentList.vue
@@ -11,7 +11,7 @@
<view class="line">
<view class="l">{{item.rentalTime}} - {{item.dueTime}}</view>
- <view class="r status">
+ <view class="r status">
{{ findObjValue(item.status, status) }}
</view>
</view>
@@ -22,7 +22,7 @@
<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>
@@ -57,29 +57,28 @@
isPickerShow: false,
istPickerShow: false,
currentRentalId: '',
- isModelShow: false,
- status: [
- {
- name: '未到期',
- value: 0
- },
- {
- name: '已到期',
- value: 1
- },
- {
- name: '已终止',
- value: 2
- },
+ isModelShow: false,
+ status: [{
+ name: '未到期',
+ value: 0
+ },
+ {
+ name: '已到期',
+ value: 1
+ },
+ {
+ name: '已终止',
+ value: 2
+ },
]
}
},
- methods: {
- findObjValue(value, obj) {
- const res = obj.find(item => {
- return item.value == value
- })
- return res.name
+ methods: {
+ findObjValue(value, obj) {
+ const res = obj.find(item => {
+ return item.value == value
+ })
+ return res.name
},
deleteRental(item) {
this.currentRentalId = item.housingRentalId
@@ -89,9 +88,17 @@
const {
code,
data
- } = await deleteRentalInfo(this.currentRentalId)
- console.log(code, data)
+ } = await deleteRentalInfo(this.currentRentalId)
+ if (code !== 200) {
+ uni.showToast({
+ title: "删除失败",
+ icon: "error",
+ duration: 1500
+ })
+ return
+ }
this.isModelShow = false
+ this.$emit('refreshData')
},
pushPage(item) {
const {
@@ -113,9 +120,18 @@
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
},
@@ -124,8 +140,17 @@
const res = await updateDueTime({
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')
}
}
}
diff --git a/subPackage/bs/views/rentDetail.vue b/subPackage/bs/views/rentDetail.vue
index 424245f..26a79a2 100644
--- a/subPackage/bs/views/rentDetail.vue
+++ b/subPackage/bs/views/rentDetail.vue
@@ -9,13 +9,13 @@
<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>
@@ -106,7 +106,9 @@
currentRole: '',
form: {
relation: "",
- rentTime: "",
+ rentTime: "",
+ houseTypeName: "",
+ rentalUseName: "",
dueTime: "",
},
imagesList: [],
@@ -115,11 +117,11 @@
required: true,
message: '请选择租客关系'
}],
- houseType: [{
+ houseTypeName: [{
required: true,
message: '请选择房屋状态'
}],
- rentalUse: [{
+ rentalUseName: [{
required: true,
message: '请选择房屋用途'
}],
@@ -225,10 +227,8 @@
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++
@@ -252,12 +252,13 @@
}catch(e){
uni.showToast({
title: "删除失败",
- icon: "success",
+ icon: "error",
duration: 1500
})
}
},
- saveOrUpdate() {
+ saveOrUpdate() {
+ console.log(this.rentalUseName, this.houseTypeName);
this.$refs.form.validate().then(res => {
let rentFormValidGroup = []
this.$refs.rentform.forEach(item => {
@@ -375,7 +376,9 @@
this.form = {
relation: tenantRelationship,
rentTime: rentalTime,
- dueTime: dueTime,
+ dueTime: dueTime,
+ houseTypeName: houseStatus,
+ rentalUseName: rentalUse
}
this.rentalUseName = this.findObjValue(rentalUse, this.dataList.rentalUse)
this.relationName = this.findObjValue(tenantRelationship, this.dataList.relation)
diff --git a/subPackage/bs/views/zhsb.vue b/subPackage/bs/views/zhsb.vue
index a603a03..2ae5da5 100644
--- a/subPackage/bs/views/zhsb.vue
+++ b/subPackage/bs/views/zhsb.vue
@@ -22,7 +22,7 @@
<view class="title">出租管理</view>
</view>
<view class="list">
- <rentList :list="rentList"></rentList>
+ <rentList :list="rentList" @refreshData="refreshData"></rentList>
</view>
</view>
@@ -79,19 +79,24 @@
} = res.data
this.rentList = []
this.location = (!!aoiName ? aoiName : '') + buildingName
- this.room = (!!unitName ? unitName : '') + doorplateName + "室"
+ 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()
}
}
}
diff --git a/subPackage/house/family/index.vue b/subPackage/house/family/index.vue
index feb43cd..ff570b8 100644
--- a/subPackage/house/family/index.vue
+++ b/subPackage/house/family/index.vue
@@ -47,13 +47,13 @@
</view>
</view>
</u-collapse-item>
- <u-collapse-item v-show="isShowShop" style="border: none;" title="商铺"
+ <u-collapse-item class="sp-list" v-show="isShowShop" style="border: none;" title="商铺"
>
- <view class="house-list-box" v-for="(item, index) in shopList" :name="index" :key="index" @click.native="pushShopPage(item)">
+ <view class="house-list-box flex" v-for="(item, index) in shopList" :name="index" :key="index" @click.native="pushShopPage(item)">
<view class="l">
<u-icon name="home" color="#fff"></u-icon>
</view>
- <view class="r">
+ <view class="r nowrap-ellipsis-hidden">
{{item.floor}}
</view>
</view>
@@ -105,7 +105,7 @@
type:3,
code:this.currentId,
name: this.addressType==1?"":this.neiCode,
- addressType :this.addressType
+ addressType :this.addressType==3?2:1
}
const res = await getHouseList(param)
const aoiList = res.data.aoiList
@@ -219,7 +219,20 @@
color: #fff;
background: linear-gradient(to right, #417BE9, #6D9FFB);
box-sizing: border-box;
+
+ .r {
+ width: 0;
+ flex: 1;
+ }
}
}
}
+
+ .sp-list {
+ /deep/ .u-collapse-item__content__text {
+ display: flex;
+ flex-direction: row;
+ flex-wrap: wrap;
+ }
+ }
</style>
\ No newline at end of file
diff --git a/subPackage/house/list/index.vue b/subPackage/house/list/index.vue
index e829ec1..4c2e089 100644
--- a/subPackage/house/list/index.vue
+++ b/subPackage/house/list/index.vue
@@ -92,14 +92,16 @@
},
pushPage(value) {
const { id, title,addressType } = value
- if(addressType == 1){
+ // addressType == 3 街路巷
+ if(addressType == 1 || addressType == 3){
if (id !== void 0) {
let url = `/subPackage/house/family/index?id=${id}&housingName=${this.curHouseTitle}
&buildingName=${title}&addressType=${addressType}&neiCode=${this.currentId}`
this.$u.func.globalNavigator(url, "navTo")
}
}else{
- // 跳转场所页面
+ // 跳转场所页面 addressType == 2
+
}
}
}
diff --git a/subPackage/house/roomControl/index.vue b/subPackage/house/roomControl/index.vue
index d255440..ebf76f8 100644
--- a/subPackage/house/roomControl/index.vue
+++ b/subPackage/house/roomControl/index.vue
@@ -1,247 +1,260 @@
-<template>
- <view class="container">
- <view class="main">
- <view class="content">
- <u-form labelWidth="70" :model="form" ref="form">
- <box-title title=""></box-title>
-
- <view class="basic-info mt-20">
- <u-form-item class="form-item" labelWidth="100" label="绑定手机" required>
- <u--input border="none" v-model="form.phone" placeholder="请输入">
- </u--input>
- </u-form-item>
-
- <u-form-item class="form-item" labelWidth="100" label="地址" required>
- <u--input border="none" v-model="form.address">
- </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>
- </u-form-item>
-
- <u-form-item class="form-item" labelWidth="100" label="到期时间" required>
- <u--input border="none" v-model="form.service_due">
- </u--input>
- </u-form-item>
- </view>
-
- <box-title class="mt-20" title="房屋外观"></box-title>
- <view class="pic mt-20">
- <u-upload :fileList="form.image_urls" :previewFullImage="uploadConfig.previewFullImage"
- :accept="uploadConfig.acceptImg" :multiple="uploadConfig.multiple"
- :maxCount="uploadConfig.maxCount" :capture="uploadConfig.capture" @afterRead="afterReadImg"
- @delete="deletePic">
- </u-upload>
- </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>
- </view>
- </view>
- </u-form>
- </view>
-
- <view class="edit-btn">
- <u-button type="primary" text="修改数据"></u-button>
- </view>
- </view>
-
- <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 }}
- </view>
-
- <u-radio-group class="mt-40" v-model="labelValue" placement="row">
- <u-radio :customStyle="{marginBottom: '8px'}" v-for="(item, index) in labelList" :key="index"
- :label="item.name" :name="item.name" :activeColor="item.color" @change="radioChange(item)">
- </u-radio>
- </u-radio-group>
-
- <u--textarea class="mt-40" v-model="value1" placeholder="请输入内容"></u--textarea>
- </view>
- </u-modal>
-
-
- <!-- 租客关系下拉框 -->
- <my-select v-if="showList.relation" :show="showList.relation" v-model="form.relation" type="radio"
- popupTitle="请选择租客关系" :dataLists="dataList.relation" @cancel="showList.relation = false">
- </my-select>
- </view>
-</template>
-
-<script>
- import uploadMixin from "@/mixin/uploadMixin";
- import {
- getHouseDetail,
- getHouseLabelList
- } from "@/api/doorplateAddress/doorplateAddress";
- export default {
- mixins: [uploadMixin],
- data() {
- return {
- houseCode: '',
- form: {
- phone: "",
- address: "",
- property_price: "",
- service_due: "",
- image_urls: []
- },
- showList: {
- relation: false
- },
- nameList: {
- relation: ""
- },
- dataList: {
- relation: []
- },
-
- popupShow: false,
-
- labelBtnList: [],
-
- // 安置房弹框中
- labelList: [{
- name: '撤销',
- disabled: false,
- color: '#EBEDF0'
- },
- {
- name: '绿',
- disabled: false,
- color: '#07C160'
- },
- {
- name: '黄',
- disabled: false,
- color: '#FF976A'
- }, {
- name: '红',
- disabled: false,
- color: '#EE0A24'
- }
- ],
- labelModelInfo: {
- title: '',
- selectedColor: ''
- },
- labelValue: '苹果',
- value1: ''
- }
- },
- created() {
-
- },
- mounted() {
-
- },
- onLoad(option) {
- const { code } = option
- this.houseCode = code
- },
- onShow() {
- this.getLabelList()
- this.getHouseDetailInfo()
- },
- methods: {
- showLabelPopup(item) {
- this.popupShow = true
- this.labelModelInfo.title = item.name
- },
-
- popupConfirm(){
- this.popupShow = false
- },
-
- radioChange(item) {
-
- },
- 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
- // ]
- // }
- },
- async getLabelList() {
- const res = await getHouseLabelList()
- this.labelBtnList = res.data
- }
- }
- }
-</script>
-
-<style scoped lang="scss">
- .container {
- position: relative;
- width: 100%;
- height: 100%;
- display: flex;
- flex-direction: column;
- background: #F9F9FA;
-
- .main {
- position: relative;
- height: 0;
- flex: 1;
- display: flex;
- flex-direction: column;
-
- .content {
- height: 0;
- flex: 1;
- overflow-y: auto;
-
- .basic-info {
-
- .form-item {
- background-color: #ffffff;
- padding: 5rpx 20rpx;
- border-bottom: 1px solid #eff1f3;
- }
-
- }
-
- .pic {
- background-color: #ffffff;
- padding: 40rpx 30rpx;
- }
-
- .label-btn-box {
- padding: 10rpx 0;
-
- &>view {
- margin: 0 10rpx;
-
- .u-button {
- padding: 6rpx 8rpx;
- }
- }
- }
-
- }
-
- .edit-btn {
- padding: 0 20rpx;
- height: 116rpx;
- display: flex;
- justify-content: space-around;
- align-items: center;
- background: #fff;
- border-top: 1rpx solid #ccc;
- }
- }
- }
+<template>
+ <view class="container">
+ <view class="main">
+ <view class="content">
+ <u-form labelWidth="70" :model="form" ref="form">
+ <box-title title=""></box-title>
+
+ <view class="basic-info mt-20">
+ <u-form-item class="form-item" labelWidth="100" label="绑定手机" required>
+ <u--input border="none" v-model="form.phone" placeholder="请输入">
+ </u--input>
+ </u-form-item>
+
+ <u-form-item class="form-item" labelWidth="100" label="地址" required>
+ <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" 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" disabled>
+ </u--input>
+ </u-form-item>
+ </view>
+
+ <box-title class="mt-20" title="房屋外观"></box-title>
+ <view class="pic mt-20">
+ <u-upload :fileList="form.image_urls" :previewFullImage="uploadConfig.previewFullImage"
+ :accept="uploadConfig.acceptImg" :multiple="uploadConfig.multiple"
+ :maxCount="uploadConfig.maxCount" :capture="uploadConfig.capture" @afterRead="afterReadImg"
+ @delete="deletePic">
+ </u-upload>
+ </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>
+ </view>
+ </view>
+ </u-form>
+ </view>
+
+ <view class="edit-btn">
+ <u-button type="primary" text="修改数据"></u-button>
+ </view>
+ </view>
+
+ <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 }}
+ </view>
+
+ <u-radio-group class="mt-40" v-model="labelValue" placement="row">
+ <u-radio :customStyle="{marginBottom: '8px'}" v-for="(item, index) in labelList" :key="index"
+ :label="item.name" :name="item.name" :activeColor="item.color" @change="radioChange(item)">
+ </u-radio>
+ </u-radio-group>
+
+ <u--textarea class="mt-40" v-model="value1" placeholder="请输入内容"></u--textarea>
+ </view>
+ </u-modal>
+
+
+ <!-- 租客关系下拉框 -->
+ <my-select v-if="showList.relation" :show="showList.relation" v-model="form.relation" type="radio"
+ popupTitle="请选择租客关系" :dataLists="dataList.relation" @cancel="showList.relation = false">
+ </my-select>
+ </view>
+</template>
+
+<script>
+ import uploadMixin from "@/mixin/uploadMixin";
+ import {
+ getHouseDetail,
+ getHouseLabelList,
+ uploadFile
+ } from "@/api/doorplateAddress/doorplateAddress";
+ export default {
+ mixins: [uploadMixin],
+ data() {
+ return {
+ houseCode: '',
+ form: {
+ phone: "",
+ address: "",
+ property_price: "",
+ service_due: "",
+ image_urls: []
+ },
+ showList: {
+ relation: false
+ },
+ nameList: {
+ relation: ""
+ },
+ dataList: {
+ relation: []
+ },
+
+ popupShow: false,
+
+ labelBtnList: [],
+
+ // 安置房弹框中
+ labelList: [{
+ name: '撤销',
+ disabled: false,
+ color: '#EBEDF0'
+ },
+ {
+ name: '绿',
+ disabled: false,
+ color: '#07C160'
+ },
+ {
+ name: '黄',
+ disabled: false,
+ color: '#FF976A'
+ }, {
+ name: '红',
+ disabled: false,
+ color: '#EE0A24'
+ }
+ ],
+ labelModelInfo: {
+ title: '',
+ selectedColor: ''
+ },
+ labelValue: '苹果',
+ value1: ''
+ }
+ },
+ created() {
+
+ },
+ mounted() {
+
+ },
+ onLoad(option) {
+ const {
+ code
+ } = option
+ this.houseCode = code
+ },
+ onShow() {
+ this.getLabelList()
+ this.getHouseDetailInfo()
+ },
+ methods: {
+ showLabelPopup(item) {
+ this.popupShow = true
+ this.labelModelInfo.title = item.name
+ },
+
+ popupConfirm() {
+ this.popupShow = false
+ },
+
+ radioChange(item) {
+
+ },
+ 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
+ // ]
+ // }
+ },
+ 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)
+ })
+
+ }
+ }
+ }
+</script>
+
+<style scoped lang="scss">
+ .container {
+ position: relative;
+ width: 100%;
+ height: 100%;
+ display: flex;
+ flex-direction: column;
+ background: #F9F9FA;
+
+ .main {
+ position: relative;
+ height: 0;
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+
+ .content {
+ height: 0;
+ flex: 1;
+ overflow-y: auto;
+
+ .basic-info {
+
+ .form-item {
+ background-color: #ffffff;
+ padding: 5rpx 20rpx;
+ border-bottom: 1px solid #eff1f3;
+ }
+
+ }
+
+ .pic {
+ background-color: #ffffff;
+ padding: 40rpx 30rpx;
+ }
+
+ .label-btn-box {
+ padding: 10rpx 0;
+
+ &>view {
+ margin: 0 10rpx;
+
+ .u-button {
+ padding: 6rpx 8rpx;
+ }
+ }
+ }
+
+ }
+
+ .edit-btn {
+ padding: 0 20rpx;
+ height: 116rpx;
+ display: flex;
+ justify-content: space-around;
+ align-items: center;
+ background: #fff;
+ border-top: 1rpx solid #ccc;
+ }
+ }
+ }
</style>
\ No newline at end of file
diff --git a/subPackage/house/roomDetails/index.vue b/subPackage/house/roomDetails/index.vue
index 9b76e5f..930c966 100644
--- a/subPackage/house/roomDetails/index.vue
+++ b/subPackage/house/roomDetails/index.vue
@@ -22,7 +22,7 @@
<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>
@@ -77,17 +77,20 @@
{{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>
@@ -100,14 +103,19 @@
<u-button type="primary" :plain="true" text="添加租赁信息" @click="addRental"></u-button>
</view>
</view>
- </view>
+
+ </view>
</view>
</template>
<script>
import {
getHouseRentInfo
- } from "@/api/doorplateAddress/doorplateAddress";
+ } from "@/api/doorplateAddress/doorplateAddress";
+ import {
+ deleteRentalInfo,
+ updateDueTime
+ } from "@/api/houseRental/houseRental.js";
export default {
components: {},
@@ -125,7 +133,24 @@
allNum: 0
},
ownerInfoList: [],
- rentOutList: []
+ rentOutList: [],
+ isPickerShow: false,
+ istPickerShow: false,
+ currentRentalId: '',
+ isModelShow: false,
+ status: [{
+ name: '未到期',
+ value: 0
+ },
+ {
+ name: '已到期',
+ value: 1
+ },
+ {
+ name: '已终止',
+ value: 2
+ },
+ ]
}
},
@@ -157,14 +182,15 @@
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 => {
// 事件格式处理
@@ -174,6 +200,7 @@
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
@@ -188,7 +215,61 @@
},
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>
--
Gitblit v1.9.3