Merge branch 'master' of http://s16s652780.51mypc.cn:49896/r/jczz_app
13 files modified
4 files added
| | |
| | | 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
|
| | | }
|
| | | })
|
| | | } |
| | |
| | | <view class="top-text f-30 fw">{{curSelectSite.name?curSelectSite.name:'暂无绑定' +roleTypeName+'信息'}}
|
| | | </view>
|
| | | <u-icon name="/static/icon/change-icon.png"></u-icon>
|
| | | </view>
|
| | | </view>
|
| | | </u-navbar>
|
| | | <view class="content">
|
| | | <view class="swiper">
|
| | |
| | | title: '-',
|
| | | useSlot: true
|
| | | }],
|
| | | menuList: []
|
| | | menuList: [],
|
| | | curHouseCode: ''
|
| | |
|
| | | }
|
| | | },
|
| | |
|
| | |
| | | }
|
| | | }
|
| | | },
|
| | |
|
| | | methods: {
|
| | |
|
| | | //初始化
|
| | |
| | | } else {
|
| | | this.curSelectSite = dataList[0];
|
| | | }
|
| | |
|
| | | this.curHouseCode = this.curSelectSite.id
|
| | | }
|
| | | },
|
| | |
|
| | |
| | | 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);
|
| | | },
|
| | | getMenu(menuName, menuList, resultArr) {
|
| | |
| | |
|
| | |
|
| | | navTo() {
|
| | | this.$u.func.globalNavigator("/subPackage/bs/views/zhsb", "navTo")
|
| | | if (this.curHouseCode === '') {
|
| | | uni.showToast({
|
| | | title: "请选择地址",
|
| | | icon: "error"
|
| | | })
|
| | | return
|
| | | }
|
| | | this.$u.func.globalNavigator(`/subPackage/bs/views/zhsb?houseCode=${this.curHouseCode}`, "navTo")
|
| | | },
|
| | |
|
| | | navigatorPage() {
|
| | |
| | | obj[arr[0]] = arr[1];
|
| | | }
|
| | | return obj
|
| | | }
|
| | |
|
| | | },
|
| | | }
|
| | | }
|
| | | </script>
|
| | |
| | | <style lang="scss" scoped>
|
| | | .top {
|
| | | width: 530rpx;
|
| | |
|
| | | .top-text {
|
| | | max-width: 85%;
|
| | | margin-right: 20rpx;
|
| | |
| | | <template> |
| | | <view class=""> |
| | | <view class="header flex a-i-c"> |
| | | <u-avatar size="80"></u-avatar> |
| | | <view class="flex f-d-c ml-20"> |
| | | <text class="f-36 mb-20 fw">张三</text> |
| | | <text class="f-28 c-99">您好业主,欢迎回家</text> |
| | | <u-avatar :src="userInfo.avatar" size="80"></u-avatar> |
| | | <view class="flex f-d-c ml-20" v-if="isLogin"> |
| | | <text class="f-36 mb-20 fw" v-if="userInfo.nick_name">{{userInfo.nick_name}}</text> |
| | | <text class="f-36 mb-20 fw" v-else>{{userInfo.user_name}}</text> |
| | | <!-- <text class="f-28 c-99">您好业主,欢迎回家</text> --> |
| | | </view> |
| | | <view class="flex f-d-c ml-20" v-if="!isLogin"> |
| | | <text class="f-36 mb-20 fw">未登录</text> |
| | | <!-- <text class="f-28 c-99">您好业主,欢迎回家</text> --> |
| | | </view> |
| | | </view> |
| | | |
| | |
| | | title:"退出登录", |
| | | url:"" |
| | | }, |
| | | |
| | | ] |
| | | ], |
| | | // userInfo:{} |
| | | } |
| | | }, |
| | | |
| | | onShow() { |
| | | |
| | | |
| | | }, |
| | | |
| | | |
| | | methods:{ |
| | | change(index) { |
| | | let url = index |
| | |
| | | <template>
|
| | | <u-form :model="form" class="form-box" :rules="rules">
|
| | | <u-form :model="form" class="form-box" :rules="rules" ref="refForm">
|
| | | <u-form-item class="form-item" label="姓名" required prop="name" labelWidth="80">
|
| | | <u-input v-model="form.name" border="none" placeholder="姓名" />
|
| | | </u-form-item>
|
| | |
| | | trigger: ['change', 'blur'],
|
| | | }],
|
| | | idCard: [{
|
| | | required: true, |
| | | message: '请输入身份证号', |
| | | // 可以单个或者同时写两个触发验证方式 |
| | | required: true,
|
| | | message: '请输入身份证号',
|
| | | // 可以单个或者同时写两个触发验证方式 |
| | | trigger: ['change', 'blur'],
|
| | | }, {
|
| | | // 自定义验证函数,见上说明
|
| | | validator: (rule, value, callback) => {
|
| | | const reg = /^\d{6}((((((19|20)\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|(((19|20)\d{2})(0[13578]|1[02])31)|((19|20)\d{2})02(0[1-9]|1\d|2[0-8])|((((19|20)([13579][26]|[2468][048]|0[48]))|(2000))0229))\d{3})|((((\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|((\d{2})(0[13578]|1[02])31)|((\d{2})02(0[1-9]|1\d|2[0-8]))|(([13579][26]|[2468][048]|0[048])0229))\d{2}))(\d|X|x)$/
|
| | | if (reg.test(value)) { |
| | | return true |
| | | } |
| | | return false |
| | | },
|
| | | message: '请输入正确的身份证号',
|
| | | // 触发器可以同时用blur和change
|
| | | trigger: ['change', 'blur'],
|
| | | }]
|
| | | }
|
| | |
| | | <view class="line">
|
| | | <view class="l">{{item.rentalTime}} - {{item.dueTime}}</view>
|
| | | <view class="r status">
|
| | | {{item.status}}
|
| | | {{ findObjValue(item.status, status) }}
|
| | | </view>
|
| | | </view>
|
| | |
|
| | |
| | | <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>
|
| | |
| | | isPickerShow: false,
|
| | | istPickerShow: false,
|
| | | currentRentalId: '',
|
| | | isModelShow: false
|
| | | 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
|
| | | },
|
| | | deleteRental(item) {
|
| | | this.currentRentalId = item.housingRentalId
|
| | | this.isModelShow = true
|
| | |
| | | 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 {
|
| | |
| | | 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
|
| | | },
|
| | |
| | | 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')
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | <u-form labelWidth="70" :model="form" :rules="rules" ref="form">
|
| | | <view class="basic-info">
|
| | | <u-form-item @click="showSelectBus(dataList.relation, '租客关系', 'relationName', 'relation')"
|
| | | class="form-item" labelWidth="100" label="租客关系" required prop="type">
|
| | | class="form-item" labelWidth="100" label="租客关系" required prop="relation">
|
| | | <u--input border="none" v-model="relationName" disabled disabledColor="#ffffff" placeholder="请选择">
|
| | | </u--input>
|
| | | <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="type">
|
| | | 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="type">
|
| | | 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>
|
| | | </u-form-item>
|
| | | <u-form-item @click="rentTimeShow = true" class="form-item" labelWidth="100" label="租房时间:" required
|
| | | prop="type">
|
| | | prop="rentTime">
|
| | | <u--input border="none" v-model="form.rentTime" disabled disabledColor="#ffffff" placeholder="请选择">
|
| | | </u--input>
|
| | | <u-icon slot="right" name="arrow-right"></u-icon>
|
| | | </u-form-item>
|
| | | <u-form-item @click="dueTimeShow = true" class="form-item" labelWidth="100" label="到期时间:" required
|
| | | prop="type">
|
| | | prop="dueTime">
|
| | | <u--input border="none" v-model="form.dueTime" disabled disabledColor="#ffffff" placeholder="请选择">
|
| | | </u--input>
|
| | | <u-icon slot="right" name="arrow-right"></u-icon>
|
| | |
| | | <view class="line"></view>
|
| | | <view class="title">{{ '租客信息-#' + item }}</view>
|
| | | </view>
|
| | | <view class="r" v-if="index === 1">
|
| | | <u-icon name="trash-fill" color="#ff0000" size="20" @click="decRentForm"></u-icon>
|
| | | <view class="r" v-if="item > 1">
|
| | | <u-icon name="trash-fill" color="#ff0000" size="20" @click="decRentForm(index)"></u-icon>
|
| | | </view>
|
| | | </view>
|
| | | <rentForm ref="rentform" />
|
| | |
| | | :popupTitle="selectBusTitle" :dataLists="selectBusList" @cancel="typeShow = false" @submit="typeSelect">
|
| | | </select-bus>
|
| | | <!--出租时间选择-->
|
| | | <u-datetime-picker :show="rentTimeShow" mode="date" @confirm="rentTimeConfirm"
|
| | | <u-datetime-picker :closeOnClickOverlay="true" @close="rentTimeShow = false" :show="rentTimeShow" mode="date" @confirm="rentTimeConfirm"
|
| | | @cancel="rentTimeShow = false"></u-datetime-picker>
|
| | | <u-datetime-picker :show="dueTimeShow" mode="date" @confirm="dueTimeConfirm"
|
| | | <u-datetime-picker :closeOnClickOverlay="true" @close="dueTimeShow = false" :show="dueTimeShow" mode="date" @confirm="dueTimeConfirm"
|
| | | @cancel="dueTimeShow = false"></u-datetime-picker>
|
| | |
|
| | | <view class="bottom-tools">
|
| | |
| | | },
|
| | | data() {
|
| | | return {
|
| | | currentRole: '',
|
| | | form: {
|
| | | relation: "",
|
| | | rentTime: "",
|
| | | rentTime: "", |
| | | houseTypeName: "", |
| | | rentalUseName: "",
|
| | | dueTime: "",
|
| | | },
|
| | | imagesList: [],
|
| | | rules: {},
|
| | | rules: {
|
| | | relation: [{
|
| | | required: true,
|
| | | message: '请选择租客关系'
|
| | | }],
|
| | | houseTypeName: [{
|
| | | required: true,
|
| | | message: '请选择房屋状态'
|
| | | }],
|
| | | rentalUseName: [{
|
| | | required: true,
|
| | | message: '请选择房屋用途'
|
| | | }],
|
| | | rentTime: [{
|
| | | required: true,
|
| | | message: '请选择租房时间'
|
| | | }],
|
| | | dueTime: [{
|
| | | required: true,
|
| | | message: '请选择到期时间'
|
| | | }]
|
| | | },
|
| | | rentTimeShow: false,
|
| | | dueTimeShow: false,
|
| | | rentFormNum: 1,
|
| | |
| | | }
|
| | |
|
| | | },
|
| | | mounted() {
|
| | | this.currentRole = uni.getStorageSync("activeRole")
|
| | | },
|
| | | methods: {
|
| | | showSelectBus(data, title, model, key) {
|
| | | this.selectBusList = data
|
| | |
| | | this.form.dueTime = time
|
| | | this.dueTimeShow = false
|
| | | },
|
| | | beforeUpload(e) {
|
| | | console.log(e)
|
| | | return false
|
| | | async afterReadImg(e) { |
| | | console.log(this.$store); |
| | | |
| | | },
|
| | | addRentForm() {
|
| | | this.rentFormNum++
|
| | | },
|
| | | decRentForm() {
|
| | | this.rentFormNum > 1 && this.rentFormNum--
|
| | | },
|
| | | saveOrUpdate() {
|
| | | if (this.rentId === '') {
|
| | | this.save()
|
| | | return
|
| | | decRentForm(i) {
|
| | | try{ |
| | | let formData = [] |
| | | this.$refs.rentform.forEach(vc => { |
| | | formData.push(vc.form) |
| | | }) |
| | | formData.splice(i, 1) |
| | | formData.forEach((sform, i) => { |
| | | this.$refs.rentform[i].form = sform |
| | | }) |
| | | this.rentFormNum > 1 && this.rentFormNum-- |
| | | uni.showToast({ |
| | | title: "删除成功", |
| | | icon: "success", |
| | | duration: 1500 |
| | | }) |
| | | }catch(e){ |
| | | uni.showToast({ |
| | | title: "删除失败", |
| | | icon: "error", |
| | | duration: 1500 |
| | | }) |
| | | }
|
| | | this.update()
|
| | | },
|
| | | saveOrUpdate() { |
| | | console.log(this.rentalUseName, this.houseTypeName);
|
| | | this.$refs.form.validate().then(res => {
|
| | | let rentFormValidGroup = []
|
| | | this.$refs.rentform.forEach(item => {
|
| | | rentFormValidGroup.push(item.$refs.refForm.validate());
|
| | | })
|
| | | Promise.all(rentFormValidGroup).then(result => {
|
| | | if (this.rentId === '') {
|
| | | this.save()
|
| | | return
|
| | | }
|
| | | this.update()
|
| | | })
|
| | | })
|
| | | },
|
| | | async save() {
|
| | | let houseTenantVOList = []
|
| | |
| | | const statusIndex = this.dataList.houseType.findIndex(item => item.name === this.houseTypeName)
|
| | | const rentalIndex = this.dataList.rentalUse.findIndex(item => item.name === this.rentalUseName)
|
| | | let params = {
|
| | | audit_status: this.currentRole.roleAlias === 'inhabitant' ? 0 : 1,
|
| | | houseCode: this.houseCode,
|
| | | tenantRelationship: this.dataList.relation[relationIndex].value,
|
| | | rentalTime: this.form.rentTime,
|
| | |
| | | rentalUse: this.dataList.rentalUse[rentalIndex].value,
|
| | | houseTenantVOList
|
| | | }
|
| | |
|
| | | const res = await addHouseRental(params)
|
| | | const {
|
| | | code,
|
| | | data
|
| | | } = await addHouseRental(params)
|
| | | if (code !== 200) {
|
| | | uni.showToast({
|
| | | title: "添加租户信息失败",
|
| | | icon: "error",
|
| | | duration: 1500
|
| | | })
|
| | | return
|
| | | }
|
| | | uni.showToast({
|
| | | title: "添加租户信息成功",
|
| | | icon: "success",
|
| | | duration: 1500,
|
| | | success: () => {
|
| | | setTimeout(() => {
|
| | | uni.navigateBack()
|
| | | }, 1500)
|
| | | }
|
| | | })
|
| | | },
|
| | | async update() {
|
| | | let houseTenantVOList = []
|
| | |
| | | houseTenantVOList
|
| | | }
|
| | | const res = await updateRetalInfo(data)
|
| | | if (res.code !== 200) {
|
| | | uni.showToast({
|
| | | title: "修改租户信息失败",
|
| | | icon: "error",
|
| | | duration: 1500
|
| | | })
|
| | | return
|
| | | }
|
| | | uni.showToast({
|
| | | title: "修改租户信息成功",
|
| | | icon: "success",
|
| | | duration: 1500,
|
| | | success: () => {
|
| | | setTimeout(() => {
|
| | | uni.navigateBack()
|
| | | }, 1500)
|
| | | }
|
| | | })
|
| | | },
|
| | | findObjValue(value, obj) {
|
| | | const res = obj.find(item => {
|
| | |
| | | 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)
|
| | | this.houseTypeName = this.findObjValue(houseStatus, this.dataList.houseType)
|
| | | this.rentFormNum = houseTenantVOList.length
|
| | | this.$nextTick(() => { |
| | | houseTenantVOList.forEach((item, index) => { |
| | | this.$refs.rentform[index].form = item |
| | | }) |
| | | this.$nextTick(() => {
|
| | | houseTenantVOList.forEach((item, index) => {
|
| | | this.$refs.rentform[index].form = item
|
| | | })
|
| | | })
|
| | | }
|
| | | }
|
| | |
| | | <view class="title">出租管理</view>
|
| | | </view>
|
| | | <view class="list">
|
| | | <rentList :list="rentList"></rentList>
|
| | | <rentList :list="rentList" @refreshData="refreshData"></rentList>
|
| | | </view>
|
| | | </view>
|
| | |
|
| | |
| | | } = 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() |
| | | }
|
| | | }
|
| | | }
|
| | |
| | | </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>
|
| | |
| | | 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
|
| | |
| | | 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> |
| | |
| | | },
|
| | | 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
|
| | | |
| | | }
|
| | | }
|
| | | }
|
| | |
| | | <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() |
| | | }, |
| | | 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> |
| | |
| | | {{ houseInfo.unitName }}单元 {{ houseInfo.houseName }}室(共{{ houseInfo.allNum }}人)
|
| | | </view>
|
| | | <view class="flex a-i-c">
|
| | | <u-button @click="pushPage" size='small' shape="circle" type="primary" :plain="true"
|
| | | <u-button @click="rommManage" size='small' shape="circle" type="primary" :plain="true"
|
| | | text="房屋管理"></u-button>
|
| | | </view>
|
| | | </view>
|
| | |
| | | <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>
|
| | |
|
| | | <view class="edit-btn">
|
| | | <view>
|
| | | <u-button type="primary" text="添加成员"></u-button>
|
| | | <u-button type="primary" text="添加成员" @click="addMember"></u-button>
|
| | | </view>
|
| | |
|
| | | <view>
|
| | | <u-button type="primary" :plain="true" text="添加租赁信息"></u-button>
|
| | | <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: {},
|
| | |
|
| | | data() {
|
| | | return {
|
| | | currentId: '',
|
| | | houseCode: '',
|
| | | houseInfo: {
|
| | | // 房间号
|
| | | houseName: '',
|
| | |
| | | allNum: 0
|
| | | },
|
| | | ownerInfoList: [],
|
| | | rentOutList: []
|
| | | rentOutList: [], |
| | | isPickerShow: false, |
| | | istPickerShow: false, |
| | | currentRentalId: '', |
| | | isModelShow: false, |
| | | status: [{ |
| | | name: '未到期', |
| | | value: 0 |
| | | }, |
| | | { |
| | | name: '已到期', |
| | | value: 1 |
| | | }, |
| | | { |
| | | name: '已终止', |
| | | value: 2 |
| | | }, |
| | | ]
|
| | | }
|
| | | },
|
| | |
|
| | |
| | | methods: {
|
| | | async getHouseRentInfoList() {
|
| | | const res = await getHouseRentInfo(this.currentId)
|
| | | if (res.code !== 200) {
|
| | | uni.showToast({
|
| | | title: "数据加载失败",
|
| | | icon: "error",
|
| | | duration: 1500
|
| | | }) |
| | | return
|
| | | }
|
| | | const {
|
| | | addressCode,
|
| | | aoiName,
|
| | | buildingName,
|
| | | houseName,
|
| | | unitName,
|
| | | houseRentalList,
|
| | | householdList
|
| | | } = res.data |
| | | console.log(res.data)
|
| | | 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 |
| | | console.log(res.data)
|
| | | this.houseInfo.allNum = householdList.length
|
| | |
|
| | | },
|
| | | pushPage() {
|
| | | rommManage() {
|
| | | const url = `/subPackage/house/roomControl/index?code=${this.currentId}`
|
| | | this.$u.func.globalNavigator(url, "navTo")
|
| | | }
|
| | | },
|
| | | addRental() {
|
| | | const url = `/subPackage/bs/views/rentDetail?houseCode=${this.houseCode}`
|
| | | this.$u.func.globalNavigator(url, "navTo")
|
| | | }, |
| | | 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>
|
| | |
| | | <view class="role-container"> |
| | | <view @click="enableRole(item)" v-for="(item, index) in roleData" :key="index" :class="item.active?'active':''"> |
| | | <view class="l"> |
| | | <u-icon :name="item.iconName"></u-icon> |
| | | <u-icon :name="item.icon" width="80rpx" height="80rpx"></u-icon> |
| | | <view class="role-name"> |
| | | {{item.roleName}} |
| | | </view> |
| | | </view> |
| | | |
| | | <view v-if="item.active" class="r"> |
| | | <!-- <view v-if="item.active" class="r"> |
| | | <u-icon name="checkmark" color="#2979ff"></u-icon> |
| | | </view> --> |
| | | <view v-if="item.id == currentId" class="r"> |
| | | <u-icon name="checkmark" color="#2979ff"></u-icon> |
| | | </view> |
| | | </view> |
| | |
| | | roleData: { |
| | | type: Array, |
| | | default: () => [] |
| | | }, |
| | | currentId:{ |
| | | type:[Number,String] |
| | | } |
| | | }, |
| | | |
| | | data() { |
| | | return {} |
| | | }, |
| | |
| | | display: flex; |
| | | justify-content: flex-start; |
| | | align-items: center; |
| | | margin-top: 16rpx; |
| | | padding: 0 16rpx; |
| | | background: #fff; |
| | | height: 80rpx; |
| | | |
| | | margin:0 30rpx; |
| | | padding:30rpx 0; |
| | | border-bottom:1px solid #F5F5F5; |
| | | .l { |
| | | flex: 1; |
| | | display: flex; |
| | |
| | | <template> |
| | | <view class="container"> |
| | | <view> |
| | | <role-list :roleData="roleData" @select="select"></role-list> |
| | | <role-list :roleData="roleData" :current-id="selectRole.id" @select="select"></role-list> |
| | | </view> |
| | | |
| | | <view class="cur-btn"> |
| | | <view class="cur-btn" v-if="roleData.length"> |
| | | <u-button @click="submit" type="primary" text="确定"></u-button> |
| | | </view> |
| | | |
| | |
| | | const res = await getRoleListByIds({ |
| | | roleIds: this.userInfo.role_id |
| | | }) |
| | | this.roleData = [] |
| | | let data = res.data |
| | | console.log(data) |
| | | data.forEach(e => { |
| | | this.roleData.push({ |
| | | id: e.id, |
| | | iconName: 'account-fill', |
| | | roleName: e.roleName, |
| | | active: e.id == this.selectRole.id ? true : false |
| | | }) |
| | | data.forEach(item => { |
| | | if(item.roleName == "居民"){ |
| | | item.icon = "/static/icon/user-01.png" |
| | | }else if (item.roleName == "场所负责人"){ |
| | | item.icon = "/static/icon/user-02.png" |
| | | }else { |
| | | item.icon = "/static/icon/user-03.png" |
| | | } |
| | | |
| | | |
| | | // this.roleData.push({ |
| | | // id: e.id, |
| | | // iconName: 'account-fill', |
| | | // roleName: e.roleName, |
| | | // active: e.id == this.selectRole.id ? true : false |
| | | // }) |
| | | }) |
| | | |
| | | |
| | | this.roleData = data; |
| | | this.loading = !this.loading |
| | | |
| | | }, |
| | |
| | | height: 100%; |
| | | display: flex; |
| | | flex-direction: column; |
| | | background: #F9F9FA; |
| | | // background: #F9F9FA; |
| | | |
| | | |
| | | } |