From 32839a5ba6ae4cbf800cb0e54c93588366a93b61 Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Fri, 03 Nov 2023 17:39:37 +0800
Subject: [PATCH] Merge branch 'master' of http://s16s652780.51mypc.cn:49896/r/jczz_app
---
static/icon/user-02.png | 0
api/doorplateAddress/doorplateAddress.js | 200 +++++----
subPackage/bs/views/zhsb.vue | 9
subPackage/bs/components/form/rentForm.vue | 20
subPackage/bs/views/rentDetail.vue | 156 ++++++-
subPackage/bs/components/list/rentList.vue | 61 ++
subPackage/house/roomControl/index.vue | 505 ++++++++++++-----------
static/img/login-bg.png | 0
pages/user/center.vue | 24
static/icon/user-03.png | 0
static/icon/user-01.png | 0
subPackage/house/roomDetails/index.vue | 138 +++++
pages/home/index.vue | 25
subPackage/user/components/roleList.vue | 19
subPackage/user/role/index.vue | 33 +
subPackage/house/family/index.vue | 21
subPackage/house/list/index.vue | 6
17 files changed, 774 insertions(+), 443 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 4dbf1dc..2e99774 100644
--- a/pages/home/index.vue
+++ b/pages/home/index.vue
@@ -7,7 +7,7 @@
<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">
@@ -301,7 +301,9 @@
title: '-',
useSlot: true
}],
- menuList: []
+ menuList: [],
+ curHouseCode: ''
+
}
},
@@ -326,7 +328,6 @@
}
}
},
-
methods: {
//初始化
@@ -376,7 +377,7 @@
} else {
this.curSelectSite = dataList[0];
}
-
+ this.curHouseCode = this.curSelectSite.id
}
},
@@ -420,7 +421,8 @@
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) {
@@ -523,7 +525,14 @@
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() {
@@ -567,8 +576,7 @@
obj[arr[0]] = arr[1];
}
return obj
- }
-
+ },
}
}
</script>
@@ -576,6 +584,7 @@
<style lang="scss" scoped>
.top {
width: 530rpx;
+
.top-text {
max-width: 85%;
margin-right: 20rpx;
diff --git a/pages/user/center.vue b/pages/user/center.vue
index 7024487..747c3f8 100644
--- a/pages/user/center.vue
+++ b/pages/user/center.vue
@@ -1,10 +1,15 @@
<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>
@@ -47,10 +52,17 @@
title:"退出登录",
url:""
},
-
- ]
+ ],
+ // userInfo:{}
}
},
+
+ onShow() {
+
+
+ },
+
+
methods:{
change(index) {
let url = index
diff --git a/static/icon/user-01.png b/static/icon/user-01.png
new file mode 100644
index 0000000..49a5e9c
--- /dev/null
+++ b/static/icon/user-01.png
Binary files differ
diff --git a/static/icon/user-02.png b/static/icon/user-02.png
new file mode 100644
index 0000000..a4a0dab
--- /dev/null
+++ b/static/icon/user-02.png
Binary files differ
diff --git a/static/icon/user-03.png b/static/icon/user-03.png
new file mode 100644
index 0000000..8546b27
--- /dev/null
+++ b/static/icon/user-03.png
Binary files differ
diff --git a/static/img/login-bg.png b/static/img/login-bg.png
new file mode 100644
index 0000000..88ba1dc
--- /dev/null
+++ b/static/img/login-bg.png
Binary files differ
diff --git a/subPackage/bs/components/form/rentForm.vue b/subPackage/bs/components/form/rentForm.vue
index 987b39b..c7eb16c 100644
--- a/subPackage/bs/components/form/rentForm.vue
+++ b/subPackage/bs/components/form/rentForm.vue
@@ -1,5 +1,5 @@
<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>
@@ -37,9 +37,21 @@
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'],
}]
}
diff --git a/subPackage/bs/components/list/rentList.vue b/subPackage/bs/components/list/rentList.vue
index 775b31a..c9c35de 100644
--- a/subPackage/bs/components/list/rentList.vue
+++ b/subPackage/bs/components/list/rentList.vue
@@ -12,7 +12,7 @@
<view class="line">
<view class="l">{{item.rentalTime}} - {{item.dueTime}}</view>
<view class="r status">
- {{item.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,10 +57,29 @@
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
@@ -69,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 {
@@ -93,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
},
@@ -104,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 5d2a033..26a79a2 100644
--- a/subPackage/bs/views/rentDetail.vue
+++ b/subPackage/bs/views/rentDetail.vue
@@ -3,31 +3,31 @@
<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>
@@ -48,8 +48,8 @@
<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" />
@@ -65,9 +65,9 @@
: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">
@@ -103,13 +103,37 @@
},
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,
@@ -175,6 +199,9 @@
}
},
+ mounted() {
+ this.currentRole = uni.getStorageSync("activeRole")
+ },
methods: {
showSelectBus(data, title, model, key) {
this.selectBusList = data
@@ -199,22 +226,52 @@
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 = []
@@ -225,6 +282,7 @@
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,
@@ -233,8 +291,28 @@
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 = []
@@ -255,6 +333,24 @@
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 => {
@@ -280,16 +376,18 @@
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
+ })
})
}
}
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 0ab9ad1..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()
- },
- 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 313f698..930c966 100644
--- a/subPackage/house/roomDetails/index.vue
+++ b/subPackage/house/roomDetails/index.vue
@@ -11,7 +11,7 @@
{{ 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>
@@ -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,43 +77,52 @@
{{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: '',
@@ -124,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
+ },
+ ]
}
},
@@ -141,20 +167,30 @@
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 => {
// 事件格式处理
@@ -164,14 +200,76 @@
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>
diff --git a/subPackage/user/components/roleList.vue b/subPackage/user/components/roleList.vue
index cedcfe7..dd0512e 100644
--- a/subPackage/user/components/roleList.vue
+++ b/subPackage/user/components/roleList.vue
@@ -2,13 +2,16 @@
<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>
@@ -21,8 +24,12 @@
roleData: {
type: Array,
default: () => []
+ },
+ currentId:{
+ type:[Number,String]
}
},
+
data() {
return {}
},
@@ -52,11 +59,9 @@
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;
diff --git a/subPackage/user/role/index.vue b/subPackage/user/role/index.vue
index 1b66bac..987f8b8 100644
--- a/subPackage/user/role/index.vue
+++ b/subPackage/user/role/index.vue
@@ -1,10 +1,10 @@
<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>
@@ -45,18 +45,27 @@
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
},
@@ -107,7 +116,7 @@
height: 100%;
display: flex;
flex-direction: column;
- background: #F9F9FA;
+ // background: #F9F9FA;
}
--
Gitblit v1.9.3