工作端小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

304 lines
8.1 KiB

1 month ago
<template>
<scroll-view class="content" scroll-y="true">
<image src="/static/img/workBac1.png" class="bacImg1"></image>
<image src="/static/img/workBac2.png" class="bacImg2"></image>
<!-- 房源模块 -->
<view class="conItem" style="margin-top: 100rpx" v-if="showCheckOut">
1 month ago
<view class="conItem-title">房源</view>
<view class="conItem-cont">
<view
class="conItem-cont-item"
v-for="(item, index) in fyList"
:key="index"
@click="handelFyClick(item)"
>
1 month ago
<image :src="item.image" class="itemImg"></image>
1 month ago
<text class="itemText">{{ item.text }}</text>
1 month ago
</view>
</view>
</view>
<!-- 巡检模块 -->
<view
class="conItem"
:style="!showCheckOut && showInspection ? 'margin-top:100rpx' : ''"
v-if="showInspection"
>
1 month ago
<view class="conItem-title">巡检</view>
<view class="conItem-cont">
<view
class="conItem-cont-item"
v-for="(item, index) in xjList"
:key="index"
@click="handelXjClick(item)"
>
1 month ago
<image :src="item.image" class="itemImg"></image>
1 month ago
<text class="itemText">{{ item.text }}</text>
1 month ago
</view>
</view>
</view>
<view class="conItem" v-if="showElectric || showWater">
<view class="conItem-title">水电</view>
<view class="conItem-cont">
<view
class="conItem-cont-item"
v-for="(item, index) in sdList"
:key="index"
@click="handelSdClick(item)"
>
<image :src="item.image" class="itemImg"></image>
1 month ago
<text class="itemText">{{ item.text }}</text>
</view>
</view>
1 month ago
</view>
<view class="conItem" v-if="showBx">
<view class="conItem-title">报修</view>
<view class="conItem-cont">
<view
class="conItem-cont-item"
v-for="(item, index) in bxList"
:key="index"
@click="handleBxClick(item)"
>
<image :src="item.image" class="itemImg"></image>
1 month ago
<text class="itemText">{{ item.text }}</text>
</view>
</view>
</view>
1 month ago
<view class="conItem" v-if="showBs">
<view class="conItem-title">报事</view>
<view class="conItem-cont">
<view
class="conItem-cont-item"
v-for="(item, index) in bsList"
:key="index"
@click="handleBsClick(item)"
>
<image :src="item.image" class="itemImg"></image>
1 month ago
<text class="itemText">{{ item.text }}</text>
</view>
</view>
1 month ago
</view>
</scroll-view>
</template>
<script>
import { getRouters } from "../../../pages/api";
1 month ago
export default {
data() {
1 month ago
return {
4 weeks ago
showCheckOut: false, // 控制房源模块显示
showInspection: false, // 控制巡检模块显示
showElectric: false, // 控制电量上报模块显示
showWater: false, // 控制水量上报模块显示
showBx: false, // 控制报修模块显示
showBs: false, // 控制报事模块显示
1 month ago
fyList: [
// { image: '/static/img/看房.png', text: '看房确认' },
{ image: "/static/img/退房检查.png", text: "退房检查" },
{ image: "/static/img/释放.png", text: "释放房源检查" },
{ image: '/static/img/预约.png', text: '预约看房' },
{ image: "/static/img/强制清退.png", text: "强制清退" },
],
xjList: [
{ image: "/static/img/巡查.png", text: "巡检上报" },
{ image: "/static/img/记录.png", text: "巡检记录" },
],
1 month ago
sdList: [
4 weeks ago
{ image: "/static/img/水费.png", text: "水量上报" },
{ image: "/static/img/电费.png", text: "电量上报" },
1 month ago
],
bxList: [
// { image: '/static/img/上报.png', text: '上报' },
{ image: '/static/img/处理.png', text: '处理' },
],
bsList: [
// { image: '/static/img/上报.png', text: '上报' },
{ image: '/static/img/处理.png', text: '处理' },
],
};
1 month ago
},
onLoad() {
this.getRouter();
4 weeks ago
if (!this.$store.state.user.token) {
1 month ago
uni.redirectTo({
url: "/pages/login/login",
});
1 month ago
}
1 month ago
},
methods: {
// 获取路由
async getRouter() {
const res = await getRouters();
// 递归查找
function hasMenu(menu, name) {
if (!menu) return false;
if (Array.isArray(menu)) {
4 weeks ago
return menu.some((item) => hasMenu(item, name));
}
if (menu.name === name) return true;
if (menu.children) return hasMenu(menu.children, name);
return false;
}
console.log('resdata',res.data)
this.showCheckOut = hasMenu(res.data || res, "Check_out");
this.showInspection = hasMenu(res.data || res, "Inspection");
this.showElectric = hasMenu(res.data || res, "ElectricMeterRecord");
this.showWater = hasMenu(res.data || res, "WaterMeterRecord");
this.showBx = hasMenu(res.data || res, "Repair");
this.showBs = hasMenu(res.data || res, "Report");
uni.setStorageSync("showCheckOut", this.showCheckOut);
uni.setStorageSync("showInspection", this.showInspection);
uni.setStorageSync("showElectric", this.showElectric);
uni.setStorageSync("showWater", this.showWater);
uni.setStorageSync("showBx", this.Repair);
uni.setStorageSync("showBs", this.Report);
},
handelFyClick(item) {
if (item.text == "退房检查") {
uni.navigateTo({
url: "/pagesA/checkout/list/list",
});
1 month ago
} else if (item.text == "释放房源检查") {
uni.navigateTo({
url: "/pagesA/release/list/list",
});
} else if (item.text == "强制清退") {
uni.navigateTo({
url: "/pagesA/force/list/list",
});
}else if (item.text == "预约看房"){
uni.navigateTo({
url: "/pagesA/kfPage/list"
})
}
},
handleBxClick(item) {
if (item.text === "处理") {
uni.navigateTo({
url: "/pagesA/bxPage/bxRecord",
});
} else {
uni.navigateTo({
url:"/pagesA/bxPage/bxReport"
})
}
},
handleBsClick(item) {
if (item.text === "处理") {
// 记录
uni.navigateTo({
url: "/pagesA/bsPage/bsRecord",
});
} else {
// 上报
uni.navigateTo({
url: "/pagesA/bsPage/bsReport",
});
}
1 month ago
},
handelXjClick(item) {
if (item.text === "巡检上报") {
1 month ago
// 列表
uni.navigateTo({
url: "/pagesA/xjPage/xj",
});
1 month ago
} else {
uni.navigateTo({
url: "/pagesA/xjPage/xjRecord",
});
1 month ago
}
1 month ago
},
handelSdClick(item) {
if (item.text === "水量上报") {
1 month ago
uni.navigateTo({
url: "/pagesA/sdPage/sfReport",
});
} else if (item.text === "电量上报") {
1 month ago
uni.navigateTo({
url: "/pagesA/sdPage/dfReport",
});
1 month ago
}
},
},
};
1 month ago
</script>
<style lang="scss" scoped>
.content {
width: 100%;
height: 100vh;
}
.conItem {
1 month ago
width: calc(100% - 40rpx);
1 month ago
border-radius: 10rpx;
1 month ago
margin-left: 20rpx;
1 month ago
background-color: rgba(255, 255, 255, 1);
box-shadow: 2rpx 2rpx 4rpx rgba(0, 0, 0, 0.2);
margin-bottom: 20rpx;
padding: 20rpx;
box-sizing: border-box;
}
.conItem-title {
color: rgb(64, 64, 64);
1 month ago
font-size: 32rpx;
1 month ago
text-align: left;
1 month ago
font-weight: bold;
1 month ago
}
.conItem-cont {
display: flex;
flex-direction: row;
justify-content: flex-start;
flex-wrap: wrap;
margin-top: 20rpx;
}
.conItem-cont-item {
width: 23%;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
margin-right: 2%;
margin-bottom: 20rpx;
.itemImg {
width: 100rpx;
height: 100rpx;
1 month ago
}
.itemText {
color: rgb(64, 64, 64);
font-size: 28rpx;
1 month ago
margin-top: 15rpx;
white-space: nowrap;
1 month ago
}
}
.conItem-cont-item:nth-child(4n) {
margin-right: 0;
}
.bacImg1 {
width: 100%;
height: 17%;
position: absolute;
top: 0;
z-index: -1;
}
.bacImg2 {
width: 100%;
height: 80%;
position: absolute;
top: 12%;
z-index: -1;
}
1 month ago
</style>