提交 e69ada18 authored 作者: caodi\cd's avatar caodi\cd

fix:提交

上级 846dfc08
<template>
<view class="detail-box">
<!-- <image
class="weitu"
src="@/static/img/add-img/weitu.png"
mode="aspectFit"
></image> -->
<view class="container">
<!-- 物理环境 -->
<view v-if="detailsItem.wlhj" class="container-item">
<view class="title">物理环境</view>
<view class="cards">
<view
v-for="(item, index) in detailsItem.wlhj.detail"
:key="index"
class="cards-item"
>
<view class="name"
>{{ item.label
}}<text
class="status"
:class="{ warning: item.inspectionResult === 1 }"
>{{ item.inspectionResultLable }}</text
></view
>
<view class="list">
<view class="label">情况描述:</view>
<view class="content">
{{ item.conclusion }}
</view>
</view>
<view class="list">
<view class="label">情况描述:</view>
<view v-if="item.photos.length === 0" class="content">
未拍摄照片
</view>
<view v-else class="content">
<image
v-for="(url, urlIndex) in item.photos"
:key="urlIndex"
class="image-item"
:src="url"
mode="aspectFit"
></image>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
props: {
// 父组件传递的详情
detailsItem: {
type: Object,
default: () => {},
},
},
data() {
return {};
},
mounted() {
console.log("this.detailsItem", this.detailsItem);
},
methods: {},
};
</script>
<style scoped lang="less">
.detail-box {
height: calc(100vh - 225px);
border-radius: 0 0 12px 12px;
background-color: #fff;
padding: 0 24px 24px;
.weitu {
width: 100%;
margin-bottom: 24px;
height: 350px;
}
.container {
.container-item {
margin-bottom: 24px;
.title {
font-size: 16px;
color: #000000;
line-height: 24px;
font-weight: 500;
margin-bottom: 12px;
}
.cards {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.cards-item {
width: calc(50% - 8px);
margin-bottom: 16px;
background: #f9f9f9;
border-radius: 8px;
padding: 16px;
.name {
font-size: 16px;
color: #000000;
line-height: 24px;
font-weight: 500;
margin-bottom: 12px;
.status {
margin-left: 8px;
padding: 0 8px;
font-size: 12px;
background: #e6f9f3;
border-radius: 11px;
color: #0cc991;
line-height: 20px;
font-weight: 400;
&.warning {
background: #fdebe9;
color: #f55a42;
}
}
}
.list {
display: flex;
align-items: flex-start; /* 让内容垂直对齐在顶部 */
margin-bottom: 12px;
&:last-child {
margin-bottom: 0;
}
.label {
width: 70px; /* 设置左侧 label 的宽度 */
font-size: 14px;
color: #7c7c7c;
line-height: 22px;
font-weight: 400;
}
.content {
flex: 1; /* 右侧内容占据剩余空间 */
word-wrap: break-word; /* 使文本自动换行 */
font-size: 14px;
color: #000000;
line-height: 22px;
font-weight: 400;
&.img {
display: flex;
flex-wrap: nowrap;
justify-content: space-between;
.image-item {
width: 72px;
height: 72px;
margin-right: 8px;
border-radius: 4px;
}
}
}
}
}
}
}
}
}
</style>
...@@ -9,15 +9,15 @@ ...@@ -9,15 +9,15 @@
<view class="switch-container"> <view class="switch-container">
<view <view
:class="['status-btn', { active: item.inspectionResult === 0 }]" :class="['status-btn', { active: item.inspectionResult === 0 }]"
@click="setInspectionResult(index, 0)" @click="setInspectionResult(index, 0, item.lableArr[0])"
> >
正常 {{ item.lableArr[0] }}
</view> </view>
<view <view
:class="['status-btn', { active: item.inspectionResult === 1 }]" :class="['status-btn', { active: item.inspectionResult === 1 }]"
@click="setInspectionResult(index, 1)" @click="setInspectionResult(index, 1, item.lableArr[1])"
> >
异常 {{ item.lableArr[1] }}
</view> </view>
</view> </view>
</view> </view>
...@@ -94,30 +94,40 @@ export default { ...@@ -94,30 +94,40 @@ export default {
{ {
label: "地板、墙壁破损", label: "地板、墙壁破损",
inspectionResult: 0, inspectionResult: 0,
inspectionResultLable: "正常",
lableArr: ["正常", "异常"],
conclusion: "", conclusion: "",
photos: [], photos: [],
}, },
{ {
label: "机房清洁", label: "机房清洁",
inspectionResult: 0, inspectionResult: 0,
inspectionResultLable: "正常",
lableArr: ["正常", "异常"],
conclusion: "", conclusion: "",
photos: [], photos: [],
}, },
{ {
label: "机房通风", label: "机房通风",
inspectionResult: 0, inspectionResult: 0,
inspectionResultLable: "正常",
lableArr: ["正常", "异常"],
conclusion: "", conclusion: "",
photos: [], photos: [],
}, },
{ {
label: "机房照明", label: "机房照明",
inspectionResult: 0, inspectionResult: 0,
inspectionResultLable: "正常",
lableArr: ["正常", "异常"],
conclusion: "", conclusion: "",
photos: [], photos: [],
}, },
{ {
label: "漏水检测", label: "漏水检测",
inspectionResult: 0, inspectionResult: 0,
inspectionResultLable: "正常",
lableArr: ["正常", "异常"],
conclusion: "", conclusion: "",
photos: [], photos: [],
}, },
...@@ -195,8 +205,10 @@ export default { ...@@ -195,8 +205,10 @@ export default {
}, },
// 设置巡检结论 // 设置巡检结论
setInspectionResult(index, value) { setInspectionResult(index, value, label) {
console.log("this.itemData.detail[index].inspectionResult",this.itemData.detail[index].inspectionResult)
this.itemData.detail[index].inspectionResult = value; // 0正常 1异常 this.itemData.detail[index].inspectionResult = value; // 0正常 1异常
this.itemData.detail[index].inspectionResultLable = label;
}, },
// 显示弹窗 // 显示弹窗
showPopup(index) { showPopup(index) {
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
> >
</view> </view>
</view> </view>
<view class="card-box"> <view class="card-box">
<view <view
class="card-row" class="card-row"
:class="{ right: rowIndex % 2 !== 0 }" :class="{ right: rowIndex % 2 !== 0 }"
...@@ -91,6 +91,45 @@ ...@@ -91,6 +91,45 @@
</view> </view>
</view></view </view></view
> >
<view class="card-box">
<view
class="card-row"
:class="{ right: rowIndex % 2 !== 0 }"
v-for="(row, rowIndex) in rows"
:key="rowIndex"
>
<view
class="card-wrapper"
v-for="(card, cardIndex) in row"
:key="cardIndex"
@click="getDetailsItem(card.name, card.jfType, card.value)"
>
<view class="card">
<view class="card-content">
<view class="first-row">
<image
class="icon"
src="@/static/img/add-img/home1.png"
></image>
<text class="status">{{ card.statusLable }}</text>
</view>
<view class="second-row">
<text class="location">{{ card.name }}</text>
</view>
</view>
<view class="spacer-image right" v-if="cardIndex < row.length - 1">
<!-- <image src="@/static/img/arr2.svg" mode="aspectFit"></image> -->
</view>
<view class="spacer-image bottom" v-if="rowIndex < rows.length - 1">
<view v-if="cardIndex == 0 || cardIndex == 4">
<!-- <image src="@/static/img/arr2.svg" mode="aspectFit"></image> -->
</view>
</view>
</view>
</view>
</view></view
>
<detail ref="detail" :detailsItem="detailsItem"></detail>
<signDialog ref="signDialog" @confirm="handlePopupConfirm"></signDialog> <signDialog ref="signDialog" @confirm="handlePopupConfirm"></signDialog>
</view> </view>
</template> </template>
...@@ -105,9 +144,11 @@ import { ...@@ -105,9 +144,11 @@ import {
} from "@/utils/IoReadingAndWriting.js"; } from "@/utils/IoReadingAndWriting.js";
import { getInspectionDetails } from "@/request/index.js"; import { getInspectionDetails } from "@/request/index.js";
import signDialog from "@/components/signDialog.vue"; import signDialog from "@/components/signDialog.vue";
import detail from "./components/detail.vue";
export default { export default {
components: { components: {
signDialog, signDialog,
detail
}, },
data() { data() {
return { return {
...@@ -116,6 +157,7 @@ export default { ...@@ -116,6 +157,7 @@ export default {
baseInfo: {}, // 基础信息 baseInfo: {}, // 基础信息
inspectionNumber: 0, // 已巡检的井道数量 inspectionNumber: 0, // 已巡检的井道数量
detailsInfo: {}, // 详情 detailsInfo: {}, // 详情
detailsItem:{},
isDisable: false, // 禁用 isDisable: false, // 禁用
isSign: false, //签名状态 isSign: false, //签名状态
isSubmit: 0, //提交状态 isSubmit: 0, //提交状态
...@@ -144,6 +186,7 @@ export default { ...@@ -144,6 +186,7 @@ export default {
this.init(); this.init();
} }
this.all_data = this.$store.state.all_data; this.all_data = this.$store.state.all_data;
console.log("onShow",this.all_data)
}, },
methods: { methods: {
init() { init() {
...@@ -195,6 +238,7 @@ export default { ...@@ -195,6 +238,7 @@ export default {
this.cardsInfo = detailsInfo.originData; this.cardsInfo = detailsInfo.originData;
this.isSubmit = this.detailsInfo.isSubmit; this.isSubmit = this.detailsInfo.isSubmit;
this.isSign = this.detailsInfo.isSign; this.isSign = this.detailsInfo.isSign;
this.detailsItem = detailsInfo.originData[0].details;
const group1 = this.cardsInfo.slice(0, 5); const group1 = this.cardsInfo.slice(0, 5);
const group2 = this.cardsInfo.slice(5, 10); const group2 = this.cardsInfo.slice(5, 10);
...@@ -214,6 +258,11 @@ export default { ...@@ -214,6 +258,11 @@ export default {
uni.hideLoading(); uni.hideLoading();
}); });
}, },
// 获取机房详情
getDetailsItem(location, jfType, value){
this.detailsItem = this.detailsInfo.originData[value - 1].details;
console.log("this.detailsItem",this.detailsItem)
},
// 跳转到具体的机房 // 跳转到具体的机房
toShaftInspection(location, jfType, value) { toShaftInspection(location, jfType, value) {
uni.navigateTo({ uni.navigateTo({
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论