From f32cff008d5ebdf1fdf3c8369fb8f7b0c2b4448e Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Thu, 02 Nov 2023 18:47:29 +0800
Subject: [PATCH] Merge branch 'master' of http://s16s652780.51mypc.cn:49896/r/jczz_app
---
static/icon/nav-bg-05.png | 0
static/icon/menu-center-04.png | 0
subPackage/bs/views/rentDetail.vue | 259 ++++++--
static/icon/menu-07.png | 0
static/icon/cell-03.png | 0
static/icon/menu-03.png | 0
static/icon/menu-center-03.png | 0
pages/home/index2.vue | 0
pages/home/index.vue | 568 ++++++++++++++++++--
static/icon/cell-02.png | 0
static/icon/nav-05.png | 0
static/icon/menu-02.png | 0
static/icon/menu-center-02.png | 0
static/icon/menu-06.png | 0
api/doorplateAddress/doorplateAddress.js | 12
subPackage/bs/views/zhsb.vue | 252 ++++----
pages.json | 12
static/icon/floor.png | 0
static/icon/menu-center-01.png | 0
static/icon/menu-01.png | 0
static/base.css | 13
static/img/tabbar-01.png | 0
subPackage/bs/components/list/rentList.vue | 251 +++++---
static/icon/cell-01.png | 0
static/icon/menu-05.png | 0
static/icon/menu-04.png | 0
pages/user/center.vue | 123 +--
static/icon/menu-09.png | 0
static/icon/nav-bg-04.png | 0
static/icon/nav-06.png | 0
pages/user/center2.vue | 129 ++++
common/setting.js | 3
static/icon/menu-08.png | 0
api/houseRental/houseRental.js | 37 +
34 files changed, 1,228 insertions(+), 431 deletions(-)
diff --git a/api/doorplateAddress/doorplateAddress.js b/api/doorplateAddress/doorplateAddress.js
index ce4a044..d3a4618 100644
--- a/api/doorplateAddress/doorplateAddress.js
+++ b/api/doorplateAddress/doorplateAddress.js
@@ -26,7 +26,7 @@
// 获取社区信息
export const getHouseList = (type, name) => {
return http.request({
- url: '/blade-doorplateAddress/doorplateAddress/getHousesList',
+ url: 'blade-doorplateAddress/doorplateAddress/getHousesList',
method: 'GET',
params: {
type,
@@ -38,7 +38,7 @@
// 获取当前楼栋信息
export const getHouseInfoList = (type, code) => {
return http.request({
- url: '/blade-doorplateAddress/doorplateAddress/getHousesList',
+ url: 'blade-doorplateAddress/doorplateAddress/getHousesList',
method: 'GET',
params: {
type,
@@ -50,7 +50,7 @@
// 获取当前房屋出租信息
export const getHouseRentInfo = (code) => {
return http.request({
- url: '/blade-doorplateAddress/doorplateAddress/getHouseRentInfo',
+ url: 'blade-doorplateAddress/doorplateAddress/getHouseRentInfo',
method: 'GET',
params: {
code
@@ -61,7 +61,7 @@
// 获取房屋标签信息
export const getHouseLabelList = () => {
return http.request({
- url: '/blade-label/label/getLabelList',
+ url: 'blade-label/label/getLabelList',
method: 'GET',
params: {
parentId: 1001
@@ -72,7 +72,7 @@
// 获取房屋详细信息
export const getHouseDetail = (houseCode) => {
return http.request({
- url: '/blade-house/house/getHouseDetail',
+ url: 'blade-house/house/getHouseDetail',
method: 'GET',
params: {
houseCode
@@ -92,7 +92,7 @@
export const uploadFile = (data) => {
return http.request({
- url: '/blade-resource/oss/endpoint/put-file',
+ url: 'blade-resource/oss/endpoint/put-file',
method: 'post',
custom: {
Authorization: true
diff --git a/api/houseRental/houseRental.js b/api/houseRental/houseRental.js
new file mode 100644
index 0000000..76917c0
--- /dev/null
+++ b/api/houseRental/houseRental.js
@@ -0,0 +1,37 @@
+import http from '@/http/api.js'
+
+//删除
+export const deleteRentalInfo = (id) => {
+ return http.request({
+ url: 'blade-houseRental/houseRental/removeHouseRental',
+ method: 'POST',
+ params: {
+ id
+ }
+ })
+}
+
+// 续租
+export const updateDueTime = (data) => {
+ return http.request({
+ url: 'blade-houseRental/houseRental/update',
+ method: 'POST',
+ custom: {
+ 'Authorization': true
+ },
+ data
+ })
+}
+
+// 修改数据
+// 续租
+export const updateRetalInfo = (data) => {
+ return http.request({
+ url: '/blade-houseRental/houseRental/updateHouseRental',
+ method: 'POST',
+ custom: {
+ 'Authorization': true
+ },
+ data
+ })
+}
\ No newline at end of file
diff --git a/common/setting.js b/common/setting.js
index 82cbf3f..9184fc1 100644
--- a/common/setting.js
+++ b/common/setting.js
@@ -10,7 +10,8 @@
version: '2.0.0',
// 开发环境接口Url
// devUrl: 'https://sk.hubeishuiyi.cn',
- devUrl: 'http://192.168.1.156:9528',
+ // devUrl: 'http://192.168.1.156:9528',
+ devUrl:'http://192.168.0.207:9528',
// 数据中台接口url
// dataCenterUrl: 'http://10.10.2.192/services',
dataCenterUrl: 'https://sk.hubeishuiyi.cn/services',
diff --git a/pages.json b/pages.json
index a15d4b4..8cf16d0 100644
--- a/pages.json
+++ b/pages.json
@@ -106,9 +106,9 @@
{
"path": "views/zhsb",
"style": {
- "navigationBarTitleText": "出租管理",
- "navigationBarBackgroundColor": "#4586fe",
- "navigationBarTextStyle": "white",
+ "navigationBarTitleText": "租客上报",
+ "navigationBarBackgroundColor": "#fff",
+ "navigationBarTextStyle": "black",
"enablePullDownRefresh": false
}
},
@@ -116,8 +116,8 @@
"path": "views/rentDetail",
"style": {
"navigationBarTitleText": "租户详情",
- "navigationBarBackgroundColor": "#4586fe",
- "navigationBarTextStyle": "white",
+ "navigationBarBackgroundColor": "#fff",
+ "navigationBarTextStyle": "black",
"enablePullDownRefresh": false
}
}
@@ -195,7 +195,7 @@
"list": [{
"pagePath": "pages/home/index",
"selectedIconPath": "static/img/tabbar-01-selected.png",
- "iconPath": "static/img/tabbar-01-selected.png",
+ "iconPath": "static/img/tabbar-01.png",
"text": "首页"
},
{
diff --git a/pages/home/index.vue b/pages/home/index.vue
index 6f7be6c..92f6867 100644
--- a/pages/home/index.vue
+++ b/pages/home/index.vue
@@ -1,8 +1,8 @@
<template>
<view class="">
- <u-navbar height="48" :autoBack="false" safeAreaInsetTop placeholder>
+ <u-navbar height="48" :autoBack="false" safeAreaInsetTop placeholder @leftClick="selectBoxShow = !selectBoxShow">
<view slot="left" class="flex">
- <text class="top">万达华府26栋1903室</text>
+ <text class="top">{{curSelectSite.name?curSelectSite.name:'暂无绑定' +roleTypeName+'信息'}}</text>
<u-icon name="/static/icon/change-icon.png"></u-icon>
</view>
</u-navbar>
@@ -10,34 +10,124 @@
<view class="swiper">
<u-swiper :list="swiperList"></u-swiper>
</view>
- <view class="">
- <u-grid :border="false" col="4">
- <u-grid-item v-for="(i,k) in menuList" :key="k" >
- <u-icon :name="i.icon" :size="45"></u-icon>
+ <view class="" v-if="roleType != 1">
+ <u-grid :border="false" col="4">
+ <u-grid-item v-for="(i,k) in cellList" :key="k">
+ <u-icon :name="i.icon" :size="45"></u-icon>
<text class="f-26 mt-20">{{i.text}}</text>
</u-grid-item>
</u-grid>
+
<view class="section flex j-c-s-b mt-40">
- <view class="section-item" v-for="i in navList">
- <image class="section-item-bg" src="/static/icon/nav-bg-01.png" mode="aspectFill"></image>
+ <view class="section-item" v-for="i in navList">
+ <image class="section-item-bg" :src="i.bgImg" mode="aspectFill"></image>
<view class="item-box">
<view class="f-28">{{i.title}}</view>
<view class="flex j-c-s-b">
<text class="f-22">{{i.name}}</text>
- <u-icon :name="i.icon"></u-icon>
+ <u-icon :name="i.icon"></u-icon>
</view>
</view>
</view>
</view>
</view>
-
- <view class="notic">
- <view class="notic-caption flex a-i-c j-c-s-b">
+
+ <view class="block flex a-i-c j-c-s-b" v-if="roleType == 1">
+ <view class="block-item">
+ <image class="block-item-bg" src="/static/icon/nav-bg-04.png" mode="aspectFill" />
+ <view class="block-item-box flex a-i-c ">
+ <u-icon name="/static/icon/nav-05.png" width="90rpx" height="90rpx"></u-icon>
+ <view class="item-text flex f-d-c j-c-s-b">
+ <text class="f-32 fw">扫一扫</text>
+ <text class="f-26 opacity">场所采集</text>
+ </view>
+ </view>
+ </view>
+
+ <view class="block-item">
+ <image class="block-item-bg" src="/static/icon/nav-bg-05.png" mode="aspectFill" />
+ <view class="block-item-box flex a-i-c">
+ <u-icon name="/static/icon/nav-06.png" width="90rpx" height="90rpx"></u-icon>
+ <view class="item-text flex f-d-c j-c-s-b">
+ <text class="f-32 fw">打卡登记</text>
+ <text class="f-26 opacity">在线打卡</text>
+ </view>
+ </view>
+ </view>
+ </view>
+
+ <view class="" v-if="hasMenu('楼盘表').length>0">
+ <view class="caption">
+ <view class="flex a-i-c">
+ <view class="line"></view>
+ <text class="f-32 fw">楼盘表</text>
+ </view>
+ </view>
+ <view class="flex flex-wrap">
+ <view class="cell bgc-main flex a-i-c" v-for="(item, index) in houseDataList.slice(0, 6)" @click.native="pushPage(item)">
+ <u-icon name="/static/icon/floor.png" width="32rpx" height="32rpx"></u-icon>
+ <text class="cell-text f-26 c-ff">{{item.title}}</text>
+ </view>
+ </view>
+ </view>
+
+ <view class="" v-if="roleType == 1 && jobList.length>0">
+ <view class="caption">
+ <view class="flex a-i-c">
+ <view class="line"></view>
+ <text class="f-32 fw">工作台</text>
+ </view>
+ </view>
+ <u-grid :border="false" col="4">
+ <u-grid-item v-for="(item, index) in jobList" :index="index" :key="index"
+ :customStyle="{paddingTop:20+'rpx'}">
+ <view class="grid-item flex f-d-c a-i-c" :style="{background:item.style.background}">
+ <u-icon :name="item.imgUrl" width="60rpx" height="60rpx"></u-icon>
+ <text class="grid-text f-24">{{item.title}}</text>
+ </view>
+
+ </u-grid-item>
+ </u-grid>
+ </view>
+
+ <view class="mt-40" v-if="roleType != 3">
+ <view class="caption">
+ <view class="flex a-i-c">
+ <view class="line"></view>
+ <text class="f-32 fw">我的任务</text>
+ </view>
+ </view>
+
+ <view class="row flex j-c-s-b">
+ <view class="row-item flex_base">
+ <u-icon></u-icon>
+ <view class="flex f-d-c fw">
+ <text class="f-28">一次性</text>
+ <text class="f-36">8</text>
+ </view>
+ </view>
+ <view class="row-item flex_base">
+ <u-icon></u-icon>
+ <view class="flex f-d-c fw">
+ <text class="f-28">周期性</text>
+ <text class="f-36">8</text>
+ </view>
+ </view>
+ </view>
+
+ <u-cell-group>
+ <u-cell :icon="i.icon" :iconStyle="{width:'40rpx',height:'40rpx',marginRight:'18rpx'}"
+ :title="i.title" v-for="i in taskList" :value="i.status"></u-cell>
+ </u-cell-group>
+ </view>
+
+ <view class="notic" v-if="roleType == 3">
+ <view class="caption flex a-i-c j-c-s-b">
<view class="flex a-i-c">
<view class="line"></view>
<text class="f-32">通知公告</text>
</view>
- <u-icon name="arrow-right"></u-icon>
+ <u-icon name="arrow-right"></u-icon>
</view>
<view class="notic-list" v-for="i in 3">
<view class="f-28 mb-30">
@@ -46,26 +136,31 @@
<view class="flex a-i-c j-c-s-b">
<view class="f-28 flex a-i-c">
<view class="flex a-i-c mr-30">
- <u-icon name="thumb-up-fill" size="24" color="#CECECE"></u-icon>
+ <u-icon name="thumb-up-fill" size="24" color="#CECECE"></u-icon>
<text class="f-24 c-99 ml-10">121</text>
</view>
<view class="flex a-i-c">
- <u-icon name="eye-fill" size="24" color="#CECECE"></u-icon>
+ <u-icon name="eye-fill" size="24" color="#CECECE"></u-icon>
<text class="f-24 c-99 ml-10">121</text>
</view>
</view>
<text class="f-24 c-99">2023-08-21</text>
</view>
-
+
</view>
</view>
-
+ <u-picker :title="roleTypeName" :show="selectBoxShow" keyName="name" ref="uPicker" :columns="siteColumns"
+ @confirm="confirmSite" @change="changeSite" @cancel="selectBoxShow = false"></u-picker>
</view>
</view>
</template>
<script>
+ import {
+ getFuncList,
+ getHouseList
+ } from "@/api/doorplateAddress/doorplateAddress";
export default {
data() {
return {
@@ -74,7 +169,7 @@
'https://cdn.uviewui.com/uview/swiper/swiper2.png',
'https://cdn.uviewui.com/uview/swiper/swiper3.png',
],
- menuList: [{
+ cellList: [{
icon: "/static/icon/nav-01.png",
text: "扫一扫"
},
@@ -91,26 +186,316 @@
text: "租客上报"
}
],
- navList: [
- {
- title:"物业",
- name:"张三",
- icon:"/static/icon/tel-green.png",
- bgImg:"/static/nav-bg-01.png"
+ navList: [{
+ title: "物业",
+ name: "张三",
+ icon: "/static/icon/tel-green.png",
+ bgImg: "/static/nav-bg-01.png"
},
{
- title:"综治网格",
- name:"张三",
- icon:"/static/icon/tel-orange.png",
- bgImg:"/static/nav-bg-02.png"
+ title: "综治网格",
+ name: "张三",
+ icon: "/static/icon/tel-orange.png",
+ bgImg: "/static/nav-bg-02.png"
},
{
- title:"公安网格",
- name:"张三",
- icon:"/static/icon/tel-blue.png",
- bgImg:"/static/nav-bg-03.png"
+ title: "公安网格",
+ name: "张三",
+ icon: "/static/icon/tel-blue.png",
+ bgImg: "/static/nav-bg-03.png"
},
- ]
+ ],
+ jobList: [{
+ icon: "/static/icon/menu-01.png",
+ text: "场所记录",
+ style: {
+ background: 'linear-gradient(133deg, #FFFCF9 0%, rgba(255,252,249,0) 100%)',
+ }
+ },
+ {
+ icon: "/static/icon/menu-02.png",
+ text: "场所采集",
+ style: {
+ background: 'linear-gradient(133deg, #F9FAFE 0%, rgba(249,250,254,0) 100%)',
+ }
+ },
+ {
+ icon: "/static/icon/menu-03.png",
+ text: "出租房管理",
+ style: {
+ background: 'linear-gradient(131deg, #FCF8FF 0%, rgba(252,248,255,0) 100%)',
+ }
+ },
+ {
+ icon: "/static/icon/menu-04.png",
+ text: "出租房管理",
+ style: {
+ background: 'linear-gradient(133deg, #F9FAFE 0%, rgba(249,250,254,0) 100%)',
+ }
+ },
+ {
+ icon: "/static/icon/menu-05.png",
+ text: "场所维护",
+ style: {
+ background: 'linear-gradient(133deg, #F9FAFE 0%, rgba(249,250,254,0) 100%)',
+ }
+ },
+ {
+ icon: "/static/icon/menu-06.png",
+ text: "报事审核",
+ style: {
+ background: 'linear-gradient(137deg, #FFF4F3 0%, rgba(255,244,243,0) 100%)',
+ }
+ },
+ {
+ icon: "/static/icon/menu-07.png",
+ text: "校园安全",
+ style: {
+ background: 'linear-gradient(133deg, #F9FAFE 0%, rgba(249,250,254,0) 100%)',
+ }
+ },
+ {
+ icon: "/static/icon/menu-08.png",
+ text: "旅馆安全",
+ style: {
+ background: 'linear-gradient(131deg, #FCF8FF 0%, rgba(252,248,255,0) 100%)',
+ }
+ },
+ {
+ icon: "/static/icon/menu-09.png",
+ text: "取保候审",
+ style: {
+ background: 'linear-gradient(137deg, #FFF4F3 0%, rgba(255,244,243,0) 100%)',
+ }
+ },
+ ],
+ taskList: [{
+ icon: "/static/icon/cell-01.png",
+ title: "综治任务",
+ status: "待处理0"
+ },
+ {
+ icon: "/static/icon/cell-02.png",
+ title: "住建任务",
+ status: "待处理0"
+ },
+ {
+ icon: "/static/icon/cell-03.png",
+ title: "公安任务",
+ status: "待处理0"
+ }
+ ],
+ roleType: 1, // 1网格员/系统管理员 、2场所负责人、 3居民
+ roleTypeName:"街道社区网格",
+ selectBoxShow: false,
+ siteColumns: [],
+ curSelectSite: {},
+ columnData: [],
+ houseDataList: [{
+ title: '-',
+ useSlot: true
+ }],
+ jobList:[],
+ menuList:[]
+ }
+ },
+
+ onLoad() {
+ console.log(uni.getStorageSync("activeRole"))
+
+ },
+ onShow() {
+ this.init()
+ },
+ computed: {
+ hasMenu() {
+ return (name) => {
+ let resultArr = []
+ resultArr = this.getMenu(name, this.menuList, resultArr)
+ if (resultArr.length > 0) {
+ return resultArr
+ } else {
+ return []
+ }
+
+ }
+ }
+ },
+
+ methods: {
+
+ //初始化
+ init() {
+ this.curSelectSite = {}
+ this.menuList = uni.getStorageSync("menu")
+ this.selectRole = uni.getStorageSync("activeRole")
+ console.log(uni.getStorageSync("activeRole"))
+ this.getMenuList()
+ this.getSiteList()
+ // uni.hideTabBar()
+ },
+
+ //获取场所列表
+ async getSiteList() {
+ console.log(this.selectRole)
+ let type = null
+ let roleName = this.selectRole.roleName
+ console.log("roleName", roleName)
+ if (roleName == '网格员' || roleName == '系统管理员') {
+ type = 1
+ this.roleType = 1;
+ this.roleTypeName = "街道社区网格"
+ } else if (roleName == '场所负责人') {
+ type = 2
+ this.roleType = 2
+ this.roleTypeName = "场所"
+ } else if (roleName == '居民') {
+ type = 3
+ this.roleType = 3
+ this.roleTypeName = "居民"
+ }
+
+ const res = await getFuncList(type, roleName)
+ console.log(res, "-----------")
+ let data = res.data
+ this.siteColumns = []
+
+ this.buildSiteColumn(data, 0)
+ console.log(this.siteColumns)
+
+ },
+
+ buildSiteColumn(dataList, index) {
+ if (dataList.length > 0) {
+ this.siteColumns[index] = dataList
+ if (dataList[0].children && dataList[0].children.length > 0) {
+ this.buildSiteColumn(dataList[0].children, index + 1)
+ }
+ }
+ },
+
+
+ // 获取楼盘
+ async getHouseDataList(name) {
+ const res = await getHouseList(1, name)
+ console.log(res);
+ res.data.forEach(item => {
+ item.title = item.name
+ item.useSlot = true
+ delete item.name
+ })
+ this.houseDataList = res.data || [{
+ title: '-',
+ useSlot: true
+ }]
+ },
+
+
+ changeSite(e) {
+ const {
+ columnIndex,
+ value,
+ values, // values为当前变化列的数组内容
+ index,
+ // 微信小程序无法将picker实例传出来,只能通过ref操作
+ picker = this.$refs.uPicker
+ } = e
+ // 当第一列值发生变化时,变化第二列(后一列)对应的选项
+ if (columnIndex === 0 && this.columnData.length > 0) {
+ // picker为选择器this实例,变化第二列对应的选项
+ picker.setColumnValues(1, this.columnData[index])
+ }
+ },
+ // 回调参数为包含columnIndex、value、values
+ confirmSite(e) {
+ console.log('confirm', e)
+ this.curSelectSite = e.value[e.value.length - 1]
+ this.selectBoxShow = false
+ this.getHouseDataList(e.value[1].name)
+ },
+ getMenu(menuName, menuList, resultArr) {
+ // console.log(menuList, menuName)
+ for (var i = 0; i < menuList.length; i++) {
+ if (menuList[i].name == menuName) {
+ resultArr.push(menuList[i])
+ } else {
+ if (menuList[i].children && menuList[i].children.length) {
+ this.getMenu(menuName, menuList[i].children, resultArr);
+ }
+ }
+ }
+
+ return resultArr
+
+ },
+
+ //获取首页菜单
+ getMenuList() {
+ console.log("当前角色菜单", this.menuList)
+ this.getPhoneList()
+ this.getLiveList()
+ this.getWorkbenchList()
+ },
+ getPhoneList() {
+ this.gridDataList = []
+ const resultArr = this.hasMenu('快捷拨号')
+ if (resultArr.length == 0) {
+ return
+ }
+
+ const topMenu = resultArr[0]
+
+ topMenu.children.forEach(menu => {
+ this.gridDataList.push({
+ title: menu.name,
+ data: "无数据",
+ phone: "无"
+ })
+ })
+ },
+
+ //获取生活菜单
+ getLiveList() {
+ this.liveList = []
+ const resultArr = this.hasMenu('生活')
+ if (resultArr.length == 0) {
+ return
+ }
+
+ const topMenu = resultArr[0]
+
+ topMenu.children.forEach(menu => {
+ this.liveList.push({
+ imgUrl: menu.source,
+ title: menu.name,
+ })
+ })
+ },
+
+ //获取工作台菜单
+ getWorkbenchList() {
+ this.jobList = []
+ const resultArr = this.hasMenu('工作台')
+ if (resultArr.length == 0) {
+ return
+ }
+
+ const topMenu = resultArr[0]
+
+ topMenu.children.forEach(menu => {
+ this.jobList.push({
+ imgUrl: menu.source,
+ title: menu.name,
+ })
+ })
+ },
+
+ // 页面跳转
+ pushPage({id, title}) {
+ if (id !== void 0) {
+ let url = `/subPackage/house/list/index?id=${id}&title=${title}`
+ this.$u.func.globalNavigator(url, "navTo")
+ }
}
}
}
@@ -131,41 +516,110 @@
.content {
padding: 0 30rpx;
}
- .section{
- .section-item{
+
+ .section {
+ .section-item {
width: 216rpx;
- height:120rpx;
+ height: 120rpx;
position: relative;
}
- .section-item-bg{
+
+ .section-item-bg {
width: 216rpx;
- height:120rpx;
+ height: 120rpx;
}
- .item-box{
- width:216rpx;
- height:120rpx;
+
+ .item-box {
+ width: 216rpx;
+ height: 120rpx;
position: absolute;
- top:0;
- left:0;
- padding:20rpx 20rpx 0;
+ top: 0;
+ left: 0;
+ padding: 20rpx 20rpx 0;
box-sizing: border-box;
}
}
- .notic{
- width:100%;
- .notic-caption{
- width:100%;
- padding:40rpx 0 0;
+
+ .notic {
+ width: 100%;
+
+ .notic-list {
+ padding: 30rpx 0;
+ border-bottom: 1px solid #f5f5f5;
}
- .line{
- width:6rpx;
- height:29rpx;
- background-color:#017BFC;
- margin-right:14rpx;
+ }
+
+ .caption {
+ width: 100%;
+ padding: 40rpx 0 0;
+
+ .line {
+ width: 6rpx;
+ height: 29rpx;
+ background-color: #017BFC;
+ margin-right: 14rpx;
}
- .notic-list{
- padding:30rpx 0;
- border-bottom:1px solid #f5f5f5;
+ }
+
+ .block {
+ .block-item {
+ position: relative;
+ }
+
+ .block-item,
+ .block-item-bg,
+ .block-item-box {
+ width: 334rpx;
+ height: 170rpx;
+ }
+
+ .block-item-box {
+ padding: 0 30rpx;
+ box-sizing: border-box;
+ position: absolute;
+ top: 0;
+ left: 0;
+ }
+
+ .item-text {
+ height: 90rpx;
+ margin-left: 22rpx;
+ color: #fff;
+ }
+
+ .opacity {
+ opacity: .4;
+ }
+ }
+
+ .cell {
+ padding: 0 16rpx;
+ height: 64rpx;
+ border-radius: 8rpx;
+ margin-right: 20rpx;
+ margin-top: 30rpx;
+
+ .cell-text {
+ margin-left: 16rpx;
+ }
+ }
+
+ .grid-item {
+ width: 153rpx;
+ height: 153rpx;
+ border-radius: 16rpx 16rpx 16rpx 16rpx;
+ justify-content: center;
+ }
+
+ .row {
+ width: 100%;
+ margin: 30rpx 0;
+
+ .row-item {
+ width: 330rpx;
+ height: 134rpx;
+ box-shadow: 0rpx 10rpx 10rpx 0rpx rgba(0, 0, 0, 0.02);
+ border-radius: 16rpx 16rpx 16rpx 16rpx;
}
}
</style>
\ No newline at end of file
diff --git a/pages/home/index.vue.bak b/pages/home/index2.vue
similarity index 100%
rename from pages/home/index.vue.bak
rename to pages/home/index2.vue
diff --git a/pages/user/center.vue b/pages/user/center.vue
index 7d90422..7024487 100644
--- a/pages/user/center.vue
+++ b/pages/user/center.vue
@@ -1,85 +1,72 @@
<template>
- <view class="container">
- <u-navbar height="48" bgColor="#5887f9" :autoBack="false" safeAreaInsetTop placeholder>
- <view slot="left">
- <u--text color="#ffffff" text="基层智治" size="18" />
+ <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>
</view>
- </u-navbar>
-
+ </view>
+
<view class="main">
- <view class="main-bg">
-
- </view>
-
-
<view class="main-cell">
<view class="cell-content">
<u-cell-group :border="false">
- <u-cell @click="navigator(item)" v-for="(item, index) in cellGroupData" :icon="item.icon"
- :title="item.title" :key="index" :border="false"></u-cell>
+ <u-cell @click="navigator(item)" v-for="(item, index) in menuList" :icon="item.icon"
+ :title="item.title" :key="index" :border="false" :iconStyle="{width:'48rpx',height:'48rpx'}" :isLink="true" ></u-cell>
</u-cell-group>
</view>
</view>
-
+
</view>
-
- <tabBar @change='change' :currentTab="1"></tabBar>
</view>
</template>
<script>
- import tabBar from "@/components/tabBar/tabBar.vue";
-
export default {
- components: {
- tabBar,
- },
-
- data() {
+ data(){
return {
- cellGroupData: [{
- title: '我的家人',
- icon: 'account-fill',
- url: ''
+ menuList:[
+ {
+ icon:"/static/icon/menu-center-01.png",
+ title:"我的家人",
+ url:""
},
{
- title: '切换角色',
- icon: 'account-fill',
- url: '/subPackage/user/role/index'
+ icon:"/static/icon/menu-center-02.png",
+ title:"切换角色",
+ url:"/subPackage/user/role/index"
},
{
- title: '修改密码',
- icon: 'account-fill',
- url: ''
+ icon:"/static/icon/menu-center-03.png",
+ title:"修改密码",
+ url:""
},
{
- title: '退出登录',
- icon: 'account-fill',
- url: ''
- }
+ icon:"/static/icon/menu-center-04.png",
+ title:"退出登录",
+ url:""
+ },
+
]
}
},
- onShow() {
- uni.hideTabBar()
- },
-
- methods: {
+ methods:{
change(index) {
let url = index
this.$u.func.globalNavigator(url, "switchTab")
},
-
+
navigator(item) {
-
+
if (item.title == '退出登录') {
this.logOut()
} else {
this.$u.func.globalNavigator(item.url)
}
-
+
},
-
+
logOut() {
uni.setStorageSync("responIndex", 0)
uni.clearStorageSync()
@@ -91,39 +78,15 @@
}
</script>
-<style lang="scss" scoped>
- .container {
- width: 100%;
- height: 100%;
-
- display: flex;
- flex-direction: column;
- background: #F9F9FA;
-
- .main {
- position: relative;
- height: 0;
- flex: 1;
- overflow-y: auto;
-
- .main-bg {
- height: 36%;
- background: royalblue;
- }
-
- .main-cell {
- position: absolute;
- top: 34%;
- width: 100%;
- height: 66%;
- border-radius: 10rpx 10rpx 0 0;
- z-index: 11;
- background: #fff;
-
- .cell-content {
- margin-top: 240rpx;
- }
- }
- }
+<style>
+ page{
+ width:100%;
+ height:100%;
+ background: linear-gradient(96deg, #E2EFFF 0%, rgba(255,255,255,0) 100%);
+ }
+ .header{
+ width:100%;
+ padding:120rpx 38rpx 80rpx;
+ box-sizing: border-box;
}
</style>
\ No newline at end of file
diff --git a/pages/user/center2.vue b/pages/user/center2.vue
new file mode 100644
index 0000000..7d90422
--- /dev/null
+++ b/pages/user/center2.vue
@@ -0,0 +1,129 @@
+<template>
+ <view class="container">
+ <u-navbar height="48" bgColor="#5887f9" :autoBack="false" safeAreaInsetTop placeholder>
+ <view slot="left">
+ <u--text color="#ffffff" text="基层智治" size="18" />
+ </view>
+ </u-navbar>
+
+ <view class="main">
+ <view class="main-bg">
+
+ </view>
+
+
+ <view class="main-cell">
+ <view class="cell-content">
+ <u-cell-group :border="false">
+ <u-cell @click="navigator(item)" v-for="(item, index) in cellGroupData" :icon="item.icon"
+ :title="item.title" :key="index" :border="false"></u-cell>
+ </u-cell-group>
+ </view>
+ </view>
+
+ </view>
+
+ <tabBar @change='change' :currentTab="1"></tabBar>
+ </view>
+</template>
+
+<script>
+ import tabBar from "@/components/tabBar/tabBar.vue";
+
+ export default {
+ components: {
+ tabBar,
+ },
+
+ data() {
+ return {
+ cellGroupData: [{
+ title: '我的家人',
+ icon: 'account-fill',
+ url: ''
+ },
+ {
+ title: '切换角色',
+ icon: 'account-fill',
+ url: '/subPackage/user/role/index'
+ },
+ {
+ title: '修改密码',
+ icon: 'account-fill',
+ url: ''
+ },
+ {
+ title: '退出登录',
+ icon: 'account-fill',
+ url: ''
+ }
+ ]
+ }
+ },
+ onShow() {
+ uni.hideTabBar()
+ },
+
+ methods: {
+ change(index) {
+ let url = index
+ this.$u.func.globalNavigator(url, "switchTab")
+ },
+
+ navigator(item) {
+
+ if (item.title == '退出登录') {
+ this.logOut()
+ } else {
+ this.$u.func.globalNavigator(item.url)
+ }
+
+ },
+
+ logOut() {
+ uni.setStorageSync("responIndex", 0)
+ uni.clearStorageSync()
+ uni.reLaunch({
+ url: "/pages/login/login-account"
+ })
+ },
+ }
+ }
+</script>
+
+<style lang="scss" scoped>
+ .container {
+ width: 100%;
+ height: 100%;
+
+ display: flex;
+ flex-direction: column;
+ background: #F9F9FA;
+
+ .main {
+ position: relative;
+ height: 0;
+ flex: 1;
+ overflow-y: auto;
+
+ .main-bg {
+ height: 36%;
+ background: royalblue;
+ }
+
+ .main-cell {
+ position: absolute;
+ top: 34%;
+ width: 100%;
+ height: 66%;
+ border-radius: 10rpx 10rpx 0 0;
+ z-index: 11;
+ background: #fff;
+
+ .cell-content {
+ margin-top: 240rpx;
+ }
+ }
+ }
+ }
+</style>
\ No newline at end of file
diff --git a/static/base.css b/static/base.css
index 446be63..0e8594d 100644
--- a/static/base.css
+++ b/static/base.css
@@ -52,6 +52,9 @@
.boder-f7f8f9-1 {
border: 1rpx solid #F7F8F9;
}
+.fw{
+ font-weight: bold;
+}
.f-20{
font-size:20rpx;
}
@@ -84,4 +87,14 @@
}
.c-99{
color:#999;
+}
+.c-ff{
+ color:#fff;
+}
+/**主色调**/
+.c-main{
+ color:#017BFC;
+}
+.bgc-main{
+ background-color:#017BFC;
}
\ No newline at end of file
diff --git a/static/icon/cell-01.png b/static/icon/cell-01.png
new file mode 100644
index 0000000..d038578
--- /dev/null
+++ b/static/icon/cell-01.png
Binary files differ
diff --git a/static/icon/cell-02.png b/static/icon/cell-02.png
new file mode 100644
index 0000000..ea47d05
--- /dev/null
+++ b/static/icon/cell-02.png
Binary files differ
diff --git a/static/icon/cell-03.png b/static/icon/cell-03.png
new file mode 100644
index 0000000..44f45d8
--- /dev/null
+++ b/static/icon/cell-03.png
Binary files differ
diff --git a/static/icon/floor.png b/static/icon/floor.png
new file mode 100644
index 0000000..8de3754
--- /dev/null
+++ b/static/icon/floor.png
Binary files differ
diff --git a/static/icon/menu-01.png b/static/icon/menu-01.png
new file mode 100644
index 0000000..3223d4e
--- /dev/null
+++ b/static/icon/menu-01.png
Binary files differ
diff --git a/static/icon/menu-02.png b/static/icon/menu-02.png
new file mode 100644
index 0000000..9201479
--- /dev/null
+++ b/static/icon/menu-02.png
Binary files differ
diff --git a/static/icon/menu-03.png b/static/icon/menu-03.png
new file mode 100644
index 0000000..ccdb59e
--- /dev/null
+++ b/static/icon/menu-03.png
Binary files differ
diff --git a/static/icon/menu-04.png b/static/icon/menu-04.png
new file mode 100644
index 0000000..d8b0af7
--- /dev/null
+++ b/static/icon/menu-04.png
Binary files differ
diff --git a/static/icon/menu-05.png b/static/icon/menu-05.png
new file mode 100644
index 0000000..707f905
--- /dev/null
+++ b/static/icon/menu-05.png
Binary files differ
diff --git a/static/icon/menu-06.png b/static/icon/menu-06.png
new file mode 100644
index 0000000..4ab960d
--- /dev/null
+++ b/static/icon/menu-06.png
Binary files differ
diff --git a/static/icon/menu-07.png b/static/icon/menu-07.png
new file mode 100644
index 0000000..8ccf93e
--- /dev/null
+++ b/static/icon/menu-07.png
Binary files differ
diff --git a/static/icon/menu-08.png b/static/icon/menu-08.png
new file mode 100644
index 0000000..6c44b1a
--- /dev/null
+++ b/static/icon/menu-08.png
Binary files differ
diff --git a/static/icon/menu-09.png b/static/icon/menu-09.png
new file mode 100644
index 0000000..7641b04
--- /dev/null
+++ b/static/icon/menu-09.png
Binary files differ
diff --git a/static/icon/menu-center-01.png b/static/icon/menu-center-01.png
new file mode 100644
index 0000000..26cadfe
--- /dev/null
+++ b/static/icon/menu-center-01.png
Binary files differ
diff --git a/static/icon/menu-center-02.png b/static/icon/menu-center-02.png
new file mode 100644
index 0000000..a994741
--- /dev/null
+++ b/static/icon/menu-center-02.png
Binary files differ
diff --git a/static/icon/menu-center-03.png b/static/icon/menu-center-03.png
new file mode 100644
index 0000000..8cede76
--- /dev/null
+++ b/static/icon/menu-center-03.png
Binary files differ
diff --git a/static/icon/menu-center-04.png b/static/icon/menu-center-04.png
new file mode 100644
index 0000000..b07ce0d
--- /dev/null
+++ b/static/icon/menu-center-04.png
Binary files differ
diff --git a/static/icon/nav-05.png b/static/icon/nav-05.png
new file mode 100644
index 0000000..0cefa77
--- /dev/null
+++ b/static/icon/nav-05.png
Binary files differ
diff --git a/static/icon/nav-06.png b/static/icon/nav-06.png
new file mode 100644
index 0000000..1cacf00
--- /dev/null
+++ b/static/icon/nav-06.png
Binary files differ
diff --git a/static/icon/nav-bg-04.png b/static/icon/nav-bg-04.png
new file mode 100644
index 0000000..ccdd5cb
--- /dev/null
+++ b/static/icon/nav-bg-04.png
Binary files differ
diff --git a/static/icon/nav-bg-05.png b/static/icon/nav-bg-05.png
new file mode 100644
index 0000000..ca5eb71
--- /dev/null
+++ b/static/icon/nav-bg-05.png
Binary files differ
diff --git a/static/img/tabbar-01.png b/static/img/tabbar-01.png
new file mode 100644
index 0000000..d149d96
--- /dev/null
+++ b/static/img/tabbar-01.png
Binary files differ
diff --git a/subPackage/bs/components/list/rentList.vue b/subPackage/bs/components/list/rentList.vue
index 204c455..775b31a 100644
--- a/subPackage/bs/components/list/rentList.vue
+++ b/subPackage/bs/components/list/rentList.vue
@@ -1,92 +1,161 @@
-<template>
- <view class="list-container">
-
- <view class="item" v-for="(item, index) in list" :key="index">
- <view class="line">
- <view class="l">租客:{{item.name}} {{`(共${item.num}人)`}}</view>
- <view class="r">
- <u-icon name="trash-fill" color="#ff0000" size="18"></u-icon>
- </view>
- </view>
-
- <view class="line">
- <view class="l">{{item.startTime}} - {{item.endTime}}</view>
- <view class="r status">
- {{item.status}}
- </view>
- </view>
-
- <view class="list-btn">
- <u-button :customStyle="btnCustomStyle" color="#cdf3df" type="primary" text="修改"></u-button>
- </view>
-
- </view>
-
- <view class="tip">
- <u-divider text="已经到底了"></u-divider>
- </view>
- </view>
-</template>
-
-<script>
- export default {
- props: {
- list: {
- type: Array,
- default: () => []
- }
- },
- data() {
- return {
- btnCustomStyle: {
- color: "#6dc160",
- fontWeight: "700"
- }
- }
- },
- created() {
-
- },
- mounted() {
-
- },
- onLoad(option) {
-
- },
- onShow() {
-
- },
- methods: {
-
- }
- }
-</script>
-
-<style scoped lang="scss">
- .list-container {
-
- .item {
- background-color: #ffffff;
- margin: 20rpx 0;
-
- .line {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 14rpx;
-
- .status {
- color: #6dc160
- }
-
- }
-
- .list-btn {
- padding: 24rpx;
- }
- }
-
- .tip {}
-
- }
+<template>
+ <view class="list-container">
+
+ <view class="item" v-for="(item, index) in list" :key="index">
+ <view class="line">
+ <view class="l">租客:{{item.name}} (<text>{{`共${item.num}人`}}</text>)</view>
+ <view class="r">
+ <u-icon name="trash-fill" color="#ff0000" size="18" @click="deleteRental(item)"></u-icon>
+ </view>
+ </view>
+
+ <view class="line">
+ <view class="l">{{item.rentalTime}} - {{item.dueTime}}</view>
+ <view class="r status">
+ {{item.status}}
+ </view>
+ </view>
+
+ <view class="list-btn">
+ <u-button icon="edit-pen" class="btn-item" type="primary" plain text="修改"
+ @click="pushPage(item)"></u-button>
+ <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>
+ </view>
+
+ </view>
+
+ <view class="tip">
+ <u-divider text="已经到底了"></u-divider>
+ </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-modal :show="isModelShow" width="auto" :showCancelButton="true" title="提示" content="请确认是否删除当前租户信息"
+ @cancel="isModelShow = false" @confirm="deleteRentalConfirm"></u-modal>
+ </view>
+</template>
+
+<script>
+ import {
+ deleteRentalInfo,
+ updateDueTime
+ } from "@/api/houseRental/houseRental.js";
+ export default {
+ props: {
+ list: {
+ type: Array,
+ default: () => []
+ }
+ },
+ data() {
+ return {
+ isPickerShow: false,
+ istPickerShow: false,
+ currentRentalId: '',
+ isModelShow: false
+ }
+ },
+ methods: {
+ deleteRental(item) {
+ this.currentRentalId = item.housingRentalId
+ this.isModelShow = true
+ },
+ async deleteRentalConfirm() {
+ const {
+ code,
+ data
+ } = await deleteRentalInfo(this.currentRentalId)
+ console.log(code, data)
+ this.isModelShow = false
+ },
+ pushPage(item) {
+ const {
+ houseCode
+ } = this.$route.query
+ const {
+ id
+ } = item
+ this.$u.func.globalNavigator(
+ `/subPackage/bs/views/rentDetail?houseCode=${houseCode}&id=${id}`)
+ },
+ xzHandleClick(item) {
+ this.currentRentalId = item.housingRentalId
+ this.isPickerShow = true
+ },
+ async dueTimeConfirm(e) {
+ const time = uni.$u.timeFormat(e.value, 'yyyy-mm-dd')
+ const res = await updateDueTime({
+ id: this.currentRentalId,
+ dueTime: time
+ })
+ this.isPickerShow = false
+ },
+ async terminate(item) {
+ this.currentRentalId = item.housingRentalId
+ this.istPickerShow = true
+ },
+ async terminateTimeConfirm(e) {
+ const time = uni.$u.timeFormat(e.value, 'yyyy-mm-dd')
+ const res = await updateDueTime({
+ id: this.currentRentalId,
+ terminationTime: time
+ })
+ this.isPickerShow = false
+ }
+ }
+ }
+</script>
+
+<style scoped lang="scss">
+ .list-container {
+
+ .item {
+ background-color: #ffffff;
+ margin: 20rpx 0;
+
+ .line {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: 20rpx;
+
+ &:nth-child(1) {
+ border: 1rpx solid #F6F6F6;
+ }
+
+ .l {
+ font-weight: 700;
+
+ text {
+ color: #0682EF;
+ }
+ }
+
+ .status {
+ color: #6dc160
+ }
+
+ }
+
+ .list-btn {
+ padding: 24rpx;
+ display: flex;
+
+ .btn-item {
+ margin: 0 10rpx;
+ border: 0;
+ color: #009FFF;
+ font-weight: 700;
+ }
+ }
+ }
+
+ .tip {}
+
+ }
</style>
\ No newline at end of file
diff --git a/subPackage/bs/views/rentDetail.vue b/subPackage/bs/views/rentDetail.vue
index 738aa9e..5d2a033 100644
--- a/subPackage/bs/views/rentDetail.vue
+++ b/subPackage/bs/views/rentDetail.vue
@@ -1,23 +1,20 @@
<template>
<view class="container">
<u-form labelWidth="70" :model="form" :rules="rules" ref="form">
- <view class="box-title">
- <box-title title="基础信息"></box-title>
- </view>
<view class="basic-info">
- <u-form-item @click="showSelectBus(dataList.relation, '租客关系', 'relationName','relation')"
+ <u-form-item @click="showSelectBus(dataList.relation, '租客关系', 'relationName', 'relation')"
class="form-item" labelWidth="100" label="租客关系" required prop="type">
<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')"
+ <u-form-item @click="showSelectBus(dataList.houseType, '房屋状态', 'houseTypeName', 'houseType')"
class="form-item" labelWidth="100" label="房屋状态:" required prop="type">
<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')"
+ <u-form-item @click="showSelectBus(dataList.rentalUse, '租房用途', 'rentalUseName', 'rentalUse')"
class="form-item" labelWidth="100" label="租房用途:" required prop="type">
<u--input border="none" v-model="rentalUseName" disabled disabledColor="#ffffff" placeholder="请选择">
</u--input>
@@ -29,28 +26,31 @@
</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">
+ <u--input border="none" v-model="form.dueTime" disabled disabledColor="#ffffff" placeholder="请选择">
+ </u--input>
+ <u-icon slot="right" name="arrow-right"></u-icon>
+ </u-form-item>
+ <view class="pic">
+ <view class="title">合同上传</view>
+ <u-upload :fileList="imagesList" :previewFullImage="uploadConfig.previewFullImage"
+ :accept="uploadConfig.acceptImg" :multiple="uploadConfig.multiple"
+ :maxCount="uploadConfig.maxCount" :capture="uploadConfig.capture" @afterRead="afterReadImg"
+ @delete="deletePic">
+ </u-upload>
+ </view>
</view>
- <view class="box-title">
- <box-title title="合同上传"></box-title>
- </view>
-
- <view class="pic">
-
- <u-upload :fileList="imagesList"
- :previewFullImage="uploadConfig.previewFullImage" :accept="uploadConfig.acceptImg"
- :multiple="uploadConfig.multiple" :maxCount="uploadConfig.maxCount" :capture="uploadConfig.capture"
- @afterRead="afterReadImg" @delete="deletePic">
- </u-upload>
- </view>
-
<view class="rent-info">
- <view v-for="item in rentFormNum" :key="item">
+ <view v-for="(item, index) in rentFormNum" :key="item" class="rent-box">
<view class="box-title">
- <box-title :title="'租客信息-#'+item">
- <template #titleMore v-if="item !== 1">
- <u-icon size="25" name="trash" color='#EF0724'></u-icon>
- </template>
- </box-title>
+ <view class="l">
+ <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>
</view>
<rentForm ref="rentform" />
</view>
@@ -65,17 +65,15 @@
:popupTitle="selectBusTitle" :dataLists="selectBusList" @cancel="typeShow = false" @submit="typeSelect">
</select-bus>
<!--出租时间选择-->
- <u-datetime-picker :show="rentTimeShow" v-model="form.rentTime" mode="date"
- @confirm="rentTimeShow = false"></u-datetime-picker>
-
+ <u-datetime-picker :show="rentTimeShow" mode="date" @confirm="rentTimeConfirm"
+ @cancel="rentTimeShow = false"></u-datetime-picker>
+ <u-datetime-picker :show="dueTimeShow" mode="date" @confirm="dueTimeConfirm"
+ @cancel="dueTimeShow = false"></u-datetime-picker>
<view class="bottom-tools">
- <u-button plain class="btn-item" type="success" @click="addRentForm">再加一人</u-button>
- <u-button class="btn-item" type="error" @click="decRentForm">删除</u-button>
- <u-button class="btn-item" type="primary" @click="save">保存</u-button>
+ <u-button class="btn-item" @click="addRentForm">再加一人</u-button>
+ <u-button class="btn-item" @click="saveOrUpdate">{{ rentId === '' ? "保存" : "确认修改" }}</u-button>
</view>
-
-
</view>
</template>
@@ -84,9 +82,19 @@
import rentForm from '../components/form/rentForm.vue'
import uploadMixin from "@/mixin/uploadMixin";
import {
- uploadFile,
- addHouseRental
+ uploadFile,
+ addHouseRental,
+ getHouseRentInfo,
} from "@/api/doorplateAddress/doorplateAddress";
+ import {
+ updateRetalInfo
+ } from '@/api/houseRental/houseRental.js'
+ import {
+ data
+ } from "uview-ui/libs/mixin/mixin";
+ import {
+ update
+ } from "../../../api/system/role";
export default {
mixins: [uploadMixin],
components: {
@@ -98,10 +106,12 @@
form: {
relation: "",
rentTime: "",
+ dueTime: "",
},
imagesList: [],
rules: {},
rentTimeShow: false,
+ dueTimeShow: false,
rentFormNum: 1,
relationName: "",
houseTypeName: "",
@@ -148,19 +158,21 @@
selectBusModel: '',
selectBusKey: '',
typeShow: false,
- houseCode: ''
+ houseCode: '',
+ rentId: ''
}
},
- created() {
-
- },
- mounted() {
-
- },
onLoad(option) {
- this.houseCode = option.houseCode
- },
- onShow() {
+ const {
+ id,
+ houseCode
+ } = option
+ this.houseCode = houseCode
+ // 使用id来判断是不是修改
+ if (id !== void 0) {
+ this.rentId = id
+ this.getCurrentRentInfo()
+ }
},
methods: {
@@ -177,6 +189,16 @@
this.form[this.selectBusKey] = item.value
this.typeShow = !this.typeShow
},
+ rentTimeConfirm(e) {
+ const time = uni.$u.timeFormat(e.value, 'yyyy-mm-dd')
+ this.form.rentTime = time
+ this.rentTimeShow = false
+ },
+ dueTimeConfirm(e) {
+ const time = uni.$u.timeFormat(e.value, 'yyyy-mm-dd')
+ this.form.dueTime = time
+ this.dueTimeShow = false
+ },
beforeUpload(e) {
console.log(e)
return false
@@ -187,25 +209,88 @@
decRentForm() {
this.rentFormNum > 1 && this.rentFormNum--
},
+ saveOrUpdate() {
+ if (this.rentId === '') {
+ this.save()
+ return
+ }
+ this.update()
+ },
async save() {
let houseTenantVOList = []
this.$refs.rentform.forEach(item => {
houseTenantVOList.push(item.form)
- })
- const relationIndex = this.dataList.relation.findIndex(item => item.name === this.relationName)
- const statusIndex = this.dataList.houseType.findIndex(item => item.name === this.houseTypeName)
+ })
+ const relationIndex = this.dataList.relation.findIndex(item => item.name === this.relationName)
+ const statusIndex = this.dataList.houseType.findIndex(item => item.name === this.houseTypeName)
const rentalIndex = this.dataList.rentalUse.findIndex(item => item.name === this.rentalUseName)
let params = {
houseCode: this.houseCode,
tenantRelationship: this.dataList.relation[relationIndex].value,
- rentalTime: this.form.rentalTime,
+ rentalTime: this.form.rentTime,
+ dueTime: this.form.dueTime,
houseStatus: this.dataList.houseType[statusIndex].value,
rentalUse: this.dataList.rentalUse[rentalIndex].value,
houseTenantVOList
- }
-
- const res = await addHouseRental(params)
- console.log(res)
+ }
+
+ const res = await addHouseRental(params)
+ },
+ async update() {
+ let houseTenantVOList = []
+ this.$refs.rentform.forEach(item => {
+ houseTenantVOList.push(item.form)
+ })
+ const relationIndex = this.dataList.relation.findIndex(item => item.name === this.relationName)
+ const statusIndex = this.dataList.houseType.findIndex(item => item.name === this.houseTypeName)
+ const rentalIndex = this.dataList.rentalUse.findIndex(item => item.name === this.rentalUseName)
+ let data = {
+ id: this.rentId,
+ houseCode: this.houseCode,
+ tenantRelationship: this.dataList.relation[relationIndex].value,
+ rentalTime: this.form.rentTime,
+ dueTime: this.form.dueTime,
+ houseStatus: this.dataList.houseType[statusIndex].value,
+ rentalUse: this.dataList.rentalUse[rentalIndex].value,
+ houseTenantVOList
+ }
+ const res = await updateRetalInfo(data)
+ },
+ findObjValue(value, obj) {
+ const res = obj.find(item => {
+ return item.value == value
+ })
+ return res.name
+ },
+ async getCurrentRentInfo() {
+ const {
+ code,
+ data: {
+ houseRentalList
+ }
+ } = await getHouseRentInfo(this.houseCode)
+ const {
+ houseStatus,
+ tenantRelationship,
+ rentalUse,
+ rentalTime,
+ dueTime,
+ houseTenantVOList
+ } = houseRentalList.find(item => item.id === this.rentId)
+ this.form = {
+ relation: tenantRelationship,
+ rentTime: rentalTime,
+ dueTime: dueTime,
+ }
+ 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
+ })
+ })
}
}
}
@@ -214,30 +299,59 @@
<style scoped lang="scss">
.container {
position: relative;
- width: 100%;
display: flex;
flex-direction: column;
- background: #F9F9FA;
+ background: #F8F8F9;
+ padding: 20rpx 30rpx;
padding-bottom: 200rpx;
- .box-title {
- padding: 10px 0;
- }
-
.basic-info {
+ background-color: #ffffff;
+ padding: 20rpx;
.form-item {
- background-color: #ffffff;
padding: 5rpx 20rpx;
border-bottom: 1px solid #eff1f3;
}
+ .pic {
+
+ // padding: 40rpx 30rpx;
+ .title {
+ font-size: 30rpx;
+ margin: 20rpx 0;
+ }
+ }
}
- .pic {
- background-color: #ffffff;
- padding: 40rpx 30rpx;
+ .rent-info {
+ .rent-box {
+ padding: 20rpx;
+ background-color: #ffffff;
+ margin-top: 30rpx;
+
+ .box-title {
+ display: flex;
+ justify-content: space-between;
+
+ .l {
+ display: flex;
+
+ .line {
+ width: 8rpx;
+ margin-right: 10rpx;
+ background-color: #2978FF;
+ }
+
+ .title {
+ font-size: 30rpx;
+ font-weight: 700;
+ }
+ }
+ }
+ }
}
+
.btn-group {
padding: 30rpx;
@@ -250,17 +364,34 @@
}
}
+
+
.bottom-tools {
display: flex;
background-color: #ffffff;
position: fixed;
bottom: 0;
+ left: 0;
width: 100%;
- border-top: 1rpx solid #e4e4e4;
+ // border-top: 1rpx solid #e4e4e4;
z-index: 999;
.btn-item {
margin: 40rpx;
+ color: #ffffff;
+ font-weight: 700;
+ border: 0;
+
+ &:nth-child(1) {
+ flex: 1;
+ background-color: #2CD5C0;
+ }
+
+ &:nth-child(2) {
+ flex: 3;
+ background: linear-gradient(to right, #06B0FD, #027BFE);
+ margin-left: 0rpx;
+ }
}
}
}
diff --git a/subPackage/bs/views/zhsb.vue b/subPackage/bs/views/zhsb.vue
index c8f8019..a603a03 100644
--- a/subPackage/bs/views/zhsb.vue
+++ b/subPackage/bs/views/zhsb.vue
@@ -2,22 +2,24 @@
<view class="container">
<view class="content-box">
<view class="info">
- <view class="item location">
- <u-icon name="map" color="#000000" size="16"></u-icon>
+ <view class="item location">
+ <u-icon name="map" color="#AAAAAA" size="15"></u-icon>
+ <text>当前小区:</text>
<view class="location">
- {{location}}
+ {{ location }}{{ room }}{{ `(共${num}人)` }}
</view>
</view>
- <view class="item statistics">
- <view class="room">{{room}}</view>
- <view class="num">{{`(共${num}人)`}}</view>
- </view>
+ <!-- <view class="item statistics">
+ <view class="room">{{ room }}</view>
+ <view class="num">{{ `(共${num}人)` }}</view>
+ </view> -->
</view>
<view class="box-title">
- <box-title title="出租管理"></box-title>
+ <view class="line"></view>
+ <view class="title">出租管理</view>
</view>
<view class="list">
<rentList :list="rentList"></rentList>
@@ -34,136 +36,134 @@
</template>
<script>
- import rentList from "@/subPackage/bs/components/list/rentList.vue"
- import {
- getHouseRentInfo
- } from "@/api/doorplateAddress/doorplateAddress";
- import {
- logAdd
- } from "../../../api/system/logManage";
- export default {
- components: {
- rentList
- },
- data() {
- return {
- houseCode: '',
- location: "万达晶座:11栋楼",
- room: "一单元303室",
- num: "1",
+import rentList from "@/subPackage/bs/components/list/rentList.vue"
+import {
+ getHouseRentInfo
+} from "@/api/doorplateAddress/doorplateAddress";
+import {
+ logAdd
+} from "../../../api/system/logManage";
+export default {
+ components: {
+ rentList
+ },
+ data() {
+ return {
+ houseCode: '',
+ location: "",
+ room: "",
+ num: 0,
- //出租列表
- rentList: [{
- name: "张三",
- num: "1",
- startTime: "2022-01-01",
- endTime: "2023-12-23",
- status: "未到期"
- }]
- }
- },
- created() {
-
- },
- mounted() {
- console.log(this.$store)
- },
- onLoad(option) {
+ //出租列表
+ rentList: []
+ }
+ },
+ onLoad(option) {
+ const {
+ houseCode
+ } = option
+ this.houseCode = houseCode
+ },
+ onShow() {
+ this.getHouseRent()
+ },
+ methods: {
+ async getHouseRent() {
+ const res = await getHouseRentInfo(this.houseCode)
const {
- houseCode
- } = option
- this.houseCode = houseCode
+ aoiName,
+ buildingName,
+ doorplateName,
+ unitName,
+ houseRentalList
+ } = res.data
+ this.rentList = []
+ this.location = (!!aoiName ? aoiName : '') + buildingName
+ this.room = (!!unitName ? unitName : '') + doorplateName + "室"
+ 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
+ }
+ this.rentList = houseRentalList
+ })
},
- onShow() {
- this.getHouseRent()
- },
- methods: {
- async getHouseRent() {
- const res = await getHouseRentInfo(this.houseCode)
- const {
- aoiName,
- buildingName,
- doorplateName,
- unitName,
- houseRentalList: {
- houseTenantVOList
- }
- } = res.data
- console.log(res.data)
- this.location = aoiName + buildingName
- this.room = unitName + doorplateName + "室"
- this.rentList = houseTenantVOList || []
- this.rentList.length !== 0 && this.rentList.forEach(item => {
- if (!item.houseTenantVOList) {
- num += item.houseTenantVOList.length
- }
- // 事件格式处理
- item.startTime = item.rentalTime.split(' ')[0]
- item.endTime = item.dueTime.split(' ')[0]
- item.status === 1 ? '未到期' : '到期'
- item.num = item.houseTenantVOList.length
- })
- },
- addRent() {
- this.$u.func.globalNavigator("/subPackage/bs/views/rentDetail?houseCode="+this.houseCode)
- }
+ addRent() {
+ this.$u.func.globalNavigator("/subPackage/bs/views/rentDetail?houseCode=" + this.houseCode)
}
}
+}
</script>
<style scoped lang="scss">
- .container {
- position: relative;
- width: 100%;
- height: 100%;
+.container {
+ position: relative;
+ width: 100%;
+ height: 100%;
+ display: flex;
+ flex-direction: column;
+ background: #F6F6F6;
+
+ .content-box {
+ height: 0;
+ flex: 1;
+ overflow-y: auto;
+ margin: 20rpx 30rpx;
+ }
+
+ .list {
+ // padding-bottom: 20px;
+ }
+
+ .item {
display: flex;
- flex-direction: column;
- background: #F9F9FA;
-
- .content-box {
- height: 0;
- flex: 1;
- overflow-y: auto;
- }
-
- .list {
- // padding-bottom: 20px;
- }
-
- .item {
- display: flex;
- padding: 30rpx 20rpx;
- background-color: #ffffff;
- border-bottom: 1px solid #eff1f3;
- }
-
- .location {
- font-weight: 700;
- }
-
- .room {
- font-weight: 700;
- }
-
- .bottom {
- padding: 20rpx;
- background-color: #ffffff;
- display: flex;
- justify-content: center;
- align-items: center;
-
- .btn {
- // width: calc(100% - 40rpx);
- }
- }
-
+ padding: 30rpx 20rpx;
+ background-color: #ffffff;
+ border-bottom: 1px solid #eff1f3;
}
- .box-title {
- padding: 40rpx 0;
+ .location {
+ font-weight: 700;
+ font-size: 27rpx;
+ text {
+ color: #AAAAAA;
+ }
}
- view {
- font-size: 32rpx;
+ .room {
+ font-weight: 700;
}
+
+ .bottom {
+ padding: 20rpx;
+ background-color: #ffffff;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+
+ .btn {
+ // width: calc(100% - 40rpx);
+ }
+ }
+
+}
+
+.box-title {
+ margin: 25rpx 0;
+ display: flex;
+ .line {
+ width: 8rpx;
+ margin-right: 10rpx;
+ background-color: #2978FF;
+ }
+ .title {
+ font-weight: 700;
+ }
+}
+
+view {
+ font-size: 32rpx;
+}
</style>
\ No newline at end of file
--
Gitblit v1.9.3