提交 50716570 authored 作者: BaoChunXian's avatar BaoChunXian

feat: 机房、井道巡检详情增加异常项和巡检时间,异常状态文案颜色调整

上级 464de427
...@@ -284,7 +284,7 @@ LIMIT 1;` ...@@ -284,7 +284,7 @@ LIMIT 1;`
let sql = `UPDATE ${table.inspectionRecordName} SET let sql = `UPDATE ${table.inspectionRecordName} SET
signImg = '${data.signImg}', signImg = '${data.signImg}',
synFlag = '${data.synFlag}', synFlag = '${data.synFlag}',
isException = '${data.isException}', isException = '${data.isException}'
WHERE id = ${data.id}`; WHERE id = ${data.id}`;
await sqllitedb.executeSQL(sql); await sqllitedb.executeSQL(sql);
} catch (e) { } catch (e) {
......
...@@ -27,10 +27,22 @@ ...@@ -27,10 +27,22 @@
></image> ></image>
</view> </view>
<view class="info"> <view class="info">
<view class="describe">
<view class="username">{{ userInfo.user }}</view> <view class="username">{{ userInfo.user }}</view>
<view v-if="abnormalLengths" class="abnormal"
>存在异常 {{ abnormalLengths }}</view
>
</view>
<view class="describe">
<view class="number" <view class="number"
>巡检编号:<text class="value">{{ inspectionCode }}</text></view >巡检编号:<text class="value">{{ inspectionCode }}</text></view
> >
<view v-if="isSign" class="number"
>巡检时间:<text class="value">
{{ updateDate }}
</text></view
>
</view>
</view> </view>
</view> </view>
<!-- v-if="allIsSubmitOne" --> <!-- v-if="allIsSubmitOne" -->
...@@ -284,6 +296,14 @@ export default { ...@@ -284,6 +296,14 @@ export default {
userInfo() { userInfo() {
return this.$store.state.now_user || {}; return this.$store.state.now_user || {};
}, },
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;
},
}, },
onLoad(options) { onLoad(options) {
this.options = options; this.options = options;
...@@ -774,6 +794,7 @@ export default { ...@@ -774,6 +794,7 @@ export default {
line-height: 22.4px; line-height: 22.4px;
font-weight: 500; font-weight: 500;
margin-bottom: 7.2px; margin-bottom: 7.2px;
margin-right: 10px;
} }
.number { .number {
...@@ -781,11 +802,23 @@ export default { ...@@ -781,11 +802,23 @@ export default {
color: #4a4a4a; color: #4a4a4a;
line-height: 22.4px; line-height: 22.4px;
font-weight: 400; font-weight: 400;
margin-right: 9.6px;
.value { .value {
color: #000000; color: #000000;
} }
} }
.describe {
display: flex;
.abnormal {
color: #fff;
line-height: 22.4px;
height: 22.4px;
padding: 0 8px;
font-size: 12px;
background-color: #f55a42;
border-radius: 11px;
}
}
} }
} }
.profile-right { .profile-right {
......
...@@ -29,10 +29,22 @@ ...@@ -29,10 +29,22 @@
></image> ></image>
</view> </view>
<view class="info"> <view class="info">
<view class="describe">
<view class="username">{{ userInfo.user }}</view> <view class="username">{{ userInfo.user }}</view>
<view v-if="isSign && abnormalLengths" class="abnormal"
>存在异常 {{ abnormalLengths }}</view
>
</view>
<view class="describe">
<view class="number" <view class="number"
>巡检编号:<text class="value">{{ inspectionCode }}</text></view >巡检编号:<text class="value">{{ inspectionCode }}</text></view
> >
<view v-if="isSign" class="number"
>巡检时间:<text class="value">
{{ updateDate }}
</text></view
>
</view>
</view> </view>
</view> </view>
<!-- {{ isSubmit }} {{ isSign }} --> <!-- {{ isSubmit }} {{ isSign }} -->
...@@ -52,7 +64,12 @@ ...@@ -52,7 +64,12 @@
v-else-if="detailsInfo.synchronization != 1" v-else-if="detailsInfo.synchronization != 1"
class="action-container" class="action-container"
> >
<image class="sign-img" :src="detailsInfo.signImg" mode="aspectFit"> <image
class="sign-img"
:src="detailsInfo.signImg"
mode="aspectFit"
@click="previewImage([detailsInfo.signImg], 0)"
>
</image> </image>
<button class="record-button small" @click="toSign">重签</button> <button class="record-button small" @click="toSign">重签</button>
<view class="inspection-button" @click="openDialog(true)" <view class="inspection-button" @click="openDialog(true)"
...@@ -131,9 +148,14 @@ ...@@ -131,9 +148,14 @@
<text v-if="position.isSubmit === 0" class="status-text" <text v-if="position.isSubmit === 0" class="status-text"
>草稿</text >草稿</text
> >
<text v-else class="status-text">{{ <text
position.statusLable v-else
}}</text> :class="{
'status-text': true,
error: position.status == 2,
}"
>{{ position.statusLable }}</text
>
</view> </view>
<view class="info-line"> <view class="info-line">
<text class="info-text" <text class="info-text"
...@@ -198,9 +220,14 @@ ...@@ -198,9 +220,14 @@
<text v-if="position.isSubmit === 0" class="status-text" <text v-if="position.isSubmit === 0" class="status-text"
>草稿</text >草稿</text
> >
<text v-else class="status-text">{{ <text
position.statusLable v-else
}}</text> :class="{
'status-text': true,
error: position.status == 2,
}"
>{{ position.statusLable }}</text
>
</view> </view>
<view class="info-line"> <view class="info-line">
<text class="info-text" <text class="info-text"
...@@ -294,6 +321,18 @@ export default { ...@@ -294,6 +321,18 @@ export default {
const { uid, createByName } = this.detailsInfo; const { uid, createByName } = this.detailsInfo;
return !uid || (uid && createByName == this.userInfo.user); return !uid || (uid && createByName == this.userInfo.user);
}, },
abnormalLengths() {
let allPoints = this.detailsInfo.originData.reduce((acc, cur) => {
acc.push(...cur.position);
return acc;
}, []);
return allPoints.filter((point) => point.status === 2).length;
},
updateDate() {
return moment(
Number(this.detailsInfo.updateTime || this.detailsInfo.createTime)
).format("YYYY-MM-DD");
},
}, },
onLoad(options) { onLoad(options) {
this.options = options; this.options = options;
...@@ -417,6 +456,7 @@ export default { ...@@ -417,6 +456,7 @@ export default {
return acc; return acc;
}, []) }, [])
.every((pos) => pos.isSubmit === "" || pos.isSubmit === 1); .every((pos) => pos.isSubmit === "" || pos.isSubmit === 1);
console.log(this.detailsInfo);
this.isSign = !!this.detailsInfo.signImg; this.isSign = !!this.detailsInfo.signImg;
this.cardsInfo.forEach((item) => { this.cardsInfo.forEach((item) => {
this.tabs.push(item.name); this.tabs.push(item.name);
...@@ -458,10 +498,10 @@ export default { ...@@ -458,10 +498,10 @@ export default {
handlePopupConfirm(summary) { handlePopupConfirm(summary) {
this.detailsInfo.isSign = this.isSign = true; // 回显到文字显示区域 this.detailsInfo.isSign = this.isSign = true; // 回显到文字显示区域
this.detailsInfo.signImg = summary; // 回显到文字显示区域 this.detailsInfo.signImg = summary; // 回显到文字显示区域
// const isException = this.detailsInfo.originData.some( const isException = this.detailsInfo.originData.some(
// (item) => item.status == 2 (item) => item.status == 2
// ); );
// this.detailsInfo.isException = isException ? 1 : 0; // 巡检异常 this.detailsInfo.isException = isException ? 1 : 0; // 巡检异常
this.submit( this.submit(
"sign", "sign",
this.detailsInfo.signImg, this.detailsInfo.signImg,
...@@ -548,6 +588,12 @@ export default { ...@@ -548,6 +588,12 @@ export default {
} }
this.showSyncDialog = val; this.showSyncDialog = val;
}, },
previewImage(images, index) {
uni.previewImage({
current: index,
urls: images,
});
},
}, },
}; };
</script> </script>
...@@ -638,6 +684,7 @@ export default { ...@@ -638,6 +684,7 @@ export default {
line-height: 22.4px; line-height: 22.4px;
font-weight: 500; font-weight: 500;
margin-bottom: 7.2px; margin-bottom: 7.2px;
margin-right: 10px;
} }
.number { .number {
...@@ -645,11 +692,23 @@ export default { ...@@ -645,11 +692,23 @@ export default {
color: #4a4a4a; color: #4a4a4a;
line-height: 22.4px; line-height: 22.4px;
font-weight: 400; font-weight: 400;
margin-right: 9.6px;
.value { .value {
color: #000000; color: #000000;
} }
} }
.describe {
display: flex;
.abnormal {
color: #fff;
line-height: 22.4px;
height: 22.4px;
padding: 0 8px;
font-size: 12px;
background-color: #f55a42;
border-radius: 11px;
}
}
} }
} }
...@@ -864,6 +923,9 @@ export default { ...@@ -864,6 +923,9 @@ export default {
text-align: center; text-align: center;
line-height: 16.5px; line-height: 16.5px;
font-weight: 400; font-weight: 400;
&.error {
color: #f55a42;
}
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论