提交 4c1091e0 authored 作者: JaxBBLL's avatar JaxBBLL

fix: bugs

上级 c4437ca2
......@@ -15,13 +15,24 @@
@click="setInspectionResult(index, 0, item.lableArr[0])"
>
{{ item.lableArr[0] }}
</view>
<view
:class="['status-btn', { active: item.inspectionResult === 1 }]"
@click="setInspectionResult(index, 1, item.lableArr[1])"
>
{{ item.lableArr[1] }}
</view>
</view>
<template v-if="item.lableArr[1] === '无监控'">
<view
:class="['status-btn', { active: item.inspectionResult === 2 }]"
@click="setInspectionResult(index, 2, item.lableArr[1])"
>
{{ item.lableArr[1] }}
</view>
</template>
<template v-else>
<view
:class="['status-btn', { active: item.inspectionResult === 1 }]"
@click="setInspectionResult(index, 1, item.lableArr[1])"
>
{{ item.lableArr[1] }}
</view>
</template>
</view>
</view>
<template v-if="item.inspectionResult === 1">
......@@ -201,12 +212,6 @@ export default {
deletePhoto(index, itemIndex) {
this.itemData.detail[index].photos.splice(itemIndex, 1);
},
// 设置巡检结论
setInspectionResult(index, value, label) {
this.itemData.detail[index].inspectionResult = value; // 0正常 1异常
this.itemData.detail[index].inspectionResultLable = label;
},
// 处理弹窗确认
handlePopupConfirm(summary) {
this.itemData.detail[this.currentIndex].conclusion = summary; // 回显到文字显示区域
......@@ -259,7 +264,7 @@ export default {
},
areAllInspectionResultsOne(details) {
const thirdItemResult = details[2].inspectionResult;
const shouldCheckAll = !(thirdItemResult === 1 || thirdItemResult === "");
const shouldCheckAll = !(thirdItemResult === 1 || thirdItemResult === "" || thirdItemResult === 2);
const checkItems = shouldCheckAll ? details : details.slice(0, 3);
let hasEmpty = false;
let hasZero = false;
......
......@@ -143,7 +143,7 @@ export default {
display: flex;
align-items: center;
justify-content: center;
z-index: 99999;
z-index: 999999;
.synchronous-content {
padding: 3% 20px 32px 24px;
width: 400px;
......
......@@ -44,22 +44,24 @@
:min="-100"
placeholder="请输入"
/>
<NumberInput
v-if="index == 1"
class="input"
v-model="item.value"
type="number"
:max="100"
:min="0"
placeholder="请输入"
/>
<NumberInput
v-else
class="input"
v-model="item.value"
type="number"
placeholder="请输入"
/>
<template v-else>
<NumberInput
v-if="index == 1"
class="input"
v-model="item.value"
type="number"
:max="100"
:min="0"
placeholder="请输入"
/>
<NumberInput
v-else
class="input"
v-model="item.value"
type="number"
placeholder="请输入"
/>
</template>
</template>
{{ item.unit }}
......@@ -246,12 +248,6 @@ export default {
deletePhoto(index, itemIndex) {
this.itemData.detail[index].photos.splice(itemIndex, 1);
},
// 设置巡检结论
setInspectionResult(index, value, label) {
this.itemData.detail[index].inspectionResult = value; // 0正常 1异常
this.itemData.detail[index].inspectionResultLable = label;
},
// 处理弹窗确认
handlePopupConfirm(summary) {
this.itemData.detail[this.currentIndex].conclusion = summary; // 回显到文字显示区域
......@@ -283,8 +279,9 @@ export default {
// 遍历每一项进行检查
for (const item of details) {
if (item.inspectionResult === 0) {
// 如果 inspectionResult 为 0,跳过此项的其他检查
continue;
if (!item.value) {
return false;
}
} else if (item.inspectionResult === 1) {
// 如果 inspectionResult 为 1,检查 conclusion 和 photos
if (!item.conclusion || item.photos.length === 0 || !item.value) {
......
......@@ -9,13 +9,13 @@
<view class="switch-container">
<view
:class="['status-btn', { active: item.inspectionResult === 0 }]"
@click="setInspectionResult(index, 0)"
@click="setInspectionResult(index, 0, item.lableArr[0])"
>
正常
</view>
<view
:class="['status-btn', { active: item.inspectionResult === 1 }]"
@click="setInspectionResult(index, 1)"
@click="setInspectionResult(index, 1, item.lableArr[1])"
>
异常
</view>
......@@ -177,11 +177,6 @@ export default {
deletePhoto(index, itemIndex) {
this.itemData.detail[index].photos.splice(itemIndex, 1);
},
// 设置巡检结论
setInspectionResult(index, value) {
this.itemData.detail[index].inspectionResult = value; // 0正常 1异常
},
// 处理弹窗确认
handlePopupConfirm(summary) {
this.itemData.detail[this.currentIndex].conclusion = summary; // 回显到文字显示区域
......
......@@ -215,12 +215,6 @@ export default {
deletePhoto(index, itemIndex) {
this.itemData.detail[index].photos.splice(itemIndex, 1);
},
// 设置巡检结论
setInspectionResult(index, value, label) {
this.itemData.detail[index].inspectionResult = value; // 0正常 1异常
this.itemData.detail[index].inspectionResultLable = label;
},
// 处理弹窗确认
handlePopupConfirm(summary) {
this.itemData.detail[this.currentIndex].conclusion = summary; // 回显到文字显示区域
......@@ -253,8 +247,9 @@ export default {
// 遍历每一项进行检查
for (const item of details) {
if (item.inspectionResult === 0) {
// 如果 inspectionResult 为 0,跳过此项的其他检查
continue;
if (!item.value) {
return false;
}
} else if (item.inspectionResult === 1) {
// 如果 inspectionResult 为 1,检查 conclusion 和 photos
if (!item.conclusion || item.photos.length === 0 || !item.value) {
......
export default {
methods: {
methods: {
setInspectionResult(index, value, label) {
console.log("setInspectionResult",index, value, label);
this.itemData.detail[index].inspectionResult = value; // 0正常 1异常
this.itemData.detail[index].inspectionResultLable = label;
if(value == 0) {
this.itemData.detail[index].conclusion = ''
this.itemData.detail[index].photos = []
}
},
showPopup(item, index) {
console.log("showPopup", item);
this.currentIndex = index;
......
......@@ -248,12 +248,6 @@ export default {
deletePhoto(index, itemIndex) {
this.itemData.detail[index].photos.splice(itemIndex, 1);
},
// 设置巡检结论
setInspectionResult(index, value, label) {
this.itemData.detail[index].inspectionResult = value; // 0正常 1异常
this.itemData.detail[index].inspectionResultLable = label;
},
// 处理弹窗确认
handlePopupConfirm(summary) {
this.itemData.detail[this.currentIndex].conclusion = summary; // 回显到文字显示区域
......
......@@ -199,16 +199,6 @@ export default {
deletePhoto(index, itemIndex) {
this.itemData.detail[index].photos.splice(itemIndex, 1);
},
// 设置巡检结论
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].inspectionResultLable = label;
},
// 处理弹窗确认
handlePopupConfirm(summary) {
this.itemData.detail[this.currentIndex].conclusion = summary; // 回显到文字显示区域
......
......@@ -225,12 +225,6 @@ export default {
deletePhoto(index, itemIndex) {
this.itemData.detail[index].photos.splice(itemIndex, 1);
},
// 设置巡检结论
setInspectionResult(index, value, label) {
this.itemData.detail[index].inspectionResult = value; // 0正常 1异常
this.itemData.detail[index].inspectionResultLable = label;
},
// 处理弹窗确认
handlePopupConfirm(summary) {
this.itemData.detail[this.currentIndex].conclusion = summary; // 回显到文字显示区域
......
......@@ -9,13 +9,13 @@
<view class="switch-container">
<view
:class="['status-btn', { active: item.inspectionResult === 0 }]"
@click="setInspectionResult(index, 0)"
@click="setInspectionResult(index, 0, item.lableArr[0])"
>
正常
</view>
<view
:class="['status-btn', { active: item.inspectionResult === 1 }]"
@click="setInspectionResult(index, 1)"
@click="setInspectionResult(index, 1, item.lableArr[1])"
>
异常
</view>
......@@ -178,11 +178,6 @@ export default {
deletePhoto(index, itemIndex) {
this.itemData.detail[index].photos.splice(itemIndex, 1);
},
// 设置巡检结论
setInspectionResult(index, value) {
this.itemData.detail[index].inspectionResult = value; // 0正常 1异常
},
// 处理弹窗确认
handlePopupConfirm(summary) {
this.itemData.detail[this.currentIndex].conclusion = summary; // 回显到文字显示区域
......
......@@ -207,8 +207,23 @@ export default {
updateDate() {
return moment(Number(this.detailsInfo.updateTime || this.detailsInfo.createTime)).format('YYYY-MM-DD');
},
abnormalLengths() {
return this.detailsInfo?.originData?.filter((t) => t.status === 2).length;
abnormalLengths() {
const originData = this.detailsInfo?.originData;
let ret = 0;
(originData || []).forEach(jf => {
const details = jf.details || {}
Object.keys(details).forEach(key => {
const item = details[key]
console.log('x', key, item);
(item.detail || []).forEach(current =>{
if(current.inspectionResult === 1) {
ret++
}
})
})
})
console.log('ret', ret);
return ret
}
},
onLoad(options) {
......@@ -587,7 +602,8 @@ export default {
}
}
.nav-right {
width: 192px;
width: 192px;
z-index: 10;
}
.header-buttons {
display: flex;
......
......@@ -16,7 +16,7 @@
<!-- Tab 操作区域 -->
<view class="module">
<view class="location">{{ location }}</view>
<view class="action-btn complete-btn" @click="submit(1)"> 完成巡检 </view>
<view class="tab-buttons">
<view
v-for="(tab, index) in tabs"
......@@ -124,7 +124,8 @@
>
下一项
</view>
<!-- v-if="value > 2" -->
<!-- v-if="value > 2" -->
<view class="action-btn complete-btn" @click="submit(1)"> 完成巡检 </view>
<view class="action-btn" @click="normal"> 一键正常 </view>
</view>
<startDialog
......@@ -871,7 +872,7 @@ export default {
margin-bottom: 14.4px;
}
.action-btn {
width: 145.6px;
width: 118px;
height: 38.4px;
line-height: 38.4px;
background: #ffffff;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论