| | |
| | | <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|| '/static/icon/user-01.png'" width="120rpx"
|
| | | <u--image shape="circle" :showLoading="true"
|
| | | :src="item.src|| '/static/icon/user-01.png'" width="120rpx"
|
| | | height="120rpx"></u--image>
|
| | | </view>
|
| | | </view>
|
| | |
| | | </view>
|
| | | <view class="r flex f-d-c j-c-s-a">
|
| | | <view>
|
| | | <u-button size='small' type="primary" :plain="true" text="资料管理" |
| | | @click="addOrupdateMember(2,item)"></u-button>
|
| | | <u-button size='small' type="primary" :plain="true" text="资料管理"
|
| | | @click="addOrupdateMember(2,item)"></u-button>
|
| | | </view>
|
| | | <view>
|
| | | <u-button size='small' type="primary" :plain="true" text="标签管理" |
| | | @click="goToHouseholdLabel(item)"></u-button>
|
| | | <u-button size='small' type="primary" :plain="true" text="标签管理"
|
| | | @click="goToHouseholdLabel(item)"></u-button>
|
| | | </view>
|
| | | </view>
|
| | | </view>
|
| | |
| | | </view>
|
| | |
|
| | | </view>
|
| | | <u-modal :show="isHouseholdModelShow" width="auto" :showCancelButton="true" title="提示" content="请确认是否删除当前住户信息"
|
| | | @cancel="isHouseholdModelShow = false" @confirm="deleteHousehold()"></u-modal>
|
| | | <u-modal :show="isHouseholdModelShow" width="auto" :showCancelButton="true" title="提示"
|
| | | content="请确认是否删除当前住户信息" @cancel="isHouseholdModelShow = false"
|
| | | @confirm="deleteHousehold()"></u-modal>
|
| | |
|
| | | <view class="mt-20 rent-out-box">
|
| | | <box-title :title="'出租管理'"></box-title>
|
| | |
| | | </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" |
| | | <u-datetime-picker v-model="currentTime" v-if="isPickerShow" :closeOnClickOverlay="true"
|
| | | @close="isPickerShow = false" :show="isPickerShow" @cancel="isPickerShow = false" mode="date"
|
| | | @confirm="dueTimeConfirm"></u-datetime-picker>
|
| | | <u-datetime-picker v-model="currentTime" v-if="istPickerShow" :closeOnClickOverlay="true"
|
| | | @close="istPickerShow = false" :show="istPickerShow" @cancel="istPickerShow = false" mode="date"
|
| | | @confirm="terminateTimeConfirm"></u-datetime-picker>
|
| | | <u-divider text="已经到底了"></u-divider> |
| | | <u-modal :show="isModelShow" width="auto" :showCancelButton="true" title="提示" content="请确认是否删除当前租户信息" |
| | | <u-divider text="已经到底了"></u-divider>
|
| | | <u-modal :show="isModelShow" width="auto" :showCancelButton="true" title="提示" content="请确认是否删除当前租户信息"
|
| | | @cancel="isModelShow = false" @confirm="deleteRentalConfirm"></u-modal>
|
| | | </view>
|
| | |
|
| | |
| | | <u-button type="primary" :plain="true" text="添加租赁信息" @click="addRental"></u-button>
|
| | | </view>
|
| | | </view>
|
| | | |
| | | </view> |
| | |
|
| | | </view>
|
| | | </view>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import {
|
| | | getHouseRentInfo
|
| | | } from "@/api/doorplateAddress/doorplateAddress"; |
| | | import { |
| | | deleteRentalInfo, |
| | | updateDueTime |
| | | } from "@/api/doorplateAddress/doorplateAddress";
|
| | | import {
|
| | | deleteRentalInfo,
|
| | | updateDueTime
|
| | | } from "@/api/houseRental/houseRental.js";
|
| | | import {
|
| | | removeHousehold
|
| | |
| | |
|
| | | data() {
|
| | | return {
|
| | | householdId:'',
|
| | | isHouseholdModelShow:false,
|
| | | householdId: '',
|
| | | isHouseholdModelShow: false,
|
| | | currentId: '',
|
| | | houseCode: '',
|
| | | houseInfo: {
|
| | |
| | | allNum: 0
|
| | | },
|
| | | ownerInfoList: [],
|
| | | rentOutList: [], |
| | | isPickerShow: false, |
| | | istPickerShow: false, |
| | | currentRentalId: '', |
| | | isModelShow: false, |
| | | status: [{ |
| | | name: '未到期', |
| | | value: 0 |
| | | }, |
| | | { |
| | | name: '已到期', |
| | | value: 1 |
| | | }, |
| | | { |
| | | name: '已终止', |
| | | value: 2 |
| | | }, |
| | | rentOutList: [],
|
| | | isPickerShow: false,
|
| | | istPickerShow: false,
|
| | | currentRentalId: '',
|
| | | isModelShow: false,
|
| | | status: [{
|
| | | name: '未到期',
|
| | | value: 0
|
| | | },
|
| | | {
|
| | | name: '已到期',
|
| | | value: 1
|
| | | },
|
| | | {
|
| | | name: '已终止',
|
| | | value: 2
|
| | | },
|
| | | ],
|
| | | currentTime: null
|
| | | }
|
| | | },
|
| | | onLoad(e) {
|
| | |
| | | },
|
| | | methods: {
|
| | | // 跳转住户标签管理页面
|
| | | goToHouseholdLabel(data){
|
| | | goToHouseholdLabel(data) {
|
| | | data['houseCode'] = this.houseCode
|
| | | var navData = JSON.stringify(data);
|
| | | this.$u.func.globalNavigator(`/subPackage/house/member/householdLabel?data=${navData}`)
|
| | | },
|
| | | // 删除住户弹出
|
| | | removeHouseholdSub(data){
|
| | | removeHouseholdSub(data) {
|
| | | this.householdId = data.id
|
| | | this.isHouseholdModelShow = true
|
| | | },
|
| | | // 删除住户信息
|
| | | deleteHousehold(){
|
| | | removeHousehold(this.householdId).then(res=>{
|
| | | const {code,data} = res
|
| | | deleteHousehold() {
|
| | | removeHousehold(this.householdId).then(res => {
|
| | | const {
|
| | | code,
|
| | | data
|
| | | } = res
|
| | | if (code !== 200) {
|
| | | uni.showToast({
|
| | | title: "删除失败",
|
| | |
| | | title: "数据加载失败",
|
| | | icon: "error",
|
| | | duration: 1500
|
| | | }) |
| | | })
|
| | | return
|
| | | }
|
| | | const {
|
| | |
| | | houseName,
|
| | | unitName,
|
| | | houseRentalList,
|
| | | householdList, |
| | | householdList,
|
| | | subAoi
|
| | | } = res.data
|
| | | this.houseCode = addressCode
|
| | |
| | | this.ownerInfoList = householdList
|
| | | this.houseInfo.houseName = houseName
|
| | | this.houseInfo.unitName = unitName
|
| | | this.houseInfo.houseTitle =( aoiName || subAoi) + ':' + 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 |
| | | item.housingRentalId = item.houseTenantVOList[0]?.housingRentalId
|
| | | })
|
| | | this.houseInfo.allNum = householdList.length
|
| | |
|
| | |
| | | const url = `/subPackage/bs/views/rentDetail?houseCode=${this.houseCode}`
|
| | | this.$u.func.globalNavigator(url, "navTo")
|
| | | },
|
| | | // 用户资料管理页面跳转 1:新增 2:修改 |
| | | addOrupdateMember(type,data={}) {
|
| | | if(type==1){
|
| | | // 用户资料管理页面跳转 1:新增 2:修改
|
| | | addOrupdateMember(type, data = {}) {
|
| | | if (type == 1) {
|
| | | data['type'] = 1
|
| | | data['houseCode'] = this.houseCode
|
| | | }
|
| | | if(type==2){
|
| | | if (type == 2) {
|
| | | data['type'] = 2
|
| | | }
|
| | | var navData = JSON.stringify(data); |
| | | this.$u.func.globalNavigator(`/subPackage/house/member/index?data=${navData}`) |
| | | }, |
| | | 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 |
| | | }, |
| | | |
| | | 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') |
| | | 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() |
| | | }, |
| | | 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 |
| | | }) |
| | | return res.name |
| | | var navData = JSON.stringify(data);
|
| | | this.$u.func.globalNavigator(`/subPackage/house/member/index?data=${navData}`)
|
| | | },
|
| | | editRent(item) {
|
| | | const {
|
| | | houseCode,
|
| | | id
|
| | | } = item
|
| | | this.$u.func.globalNavigator(`/subPackage/bs/views/rentDetail?houseCode=${houseCode}&id=${id}`)
|
| | | },
|
| | | reletRent(item) {
|
| | | this.currentTime = item.dueTime
|
| | | this.currentRentalId = item.housingRentalId
|
| | | this.isPickerShow = true
|
| | | },
|
| | |
|
| | | terRent(item) {
|
| | | this.currentTime = item.dueTime
|
| | | 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')
|
| | | 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()
|
| | | },
|
| | | 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
|
| | | })
|
| | | return res.name
|
| | | },
|
| | | }
|
| | | }
|
| | |
| | | &>.u-button {
|
| | | margin: 0 16rpx;
|
| | | }
|
| | | |
| | |
|
| | | .btn-item {
|
| | | margin: 0 10rpx;
|
| | | border: 0;
|