fix: 保洁bug

This commit is contained in:
yangzhe 2025-05-08 16:57:01 +08:00
parent 4d49bb990d
commit 3d82baf9a0
4 changed files with 82 additions and 21 deletions

View File

@ -26,7 +26,11 @@
dataInfo.planDate ? dataInfo.planDate.split("T")[0] : ""
}}</view>
<view class="position">
<span v-if="dataInfo.beginTime && dataInfo.endTime">
<span
v-if="
(dataInfo.beginTime || dataInfo.beginTime == 0) && dataInfo.endTime
"
>
{{ minutesToTime(dataInfo.beginTime) }}~{{
minutesToTime(dataInfo.endTime)
}}
@ -202,10 +206,14 @@ export default {
},
onLoad(options) {
// debugger
// this.paramsId = options.id;
this.dropdownValue = options.id;
window.nfcFn = this.nfcResFn;
// this.nfcResFn();
if(options.type == 'all'){
this.selectIdx = 0
}
},
created() {
@ -297,10 +305,11 @@ export default {
toItemPage(item) {
console.log("%c%s", "color:red", "跳转至详情页", item);
const combinedData = {
...item, // item
planName: this.dataInfo.planName, // planName
beginTime: this.dataInfo.beginTime,
endTime: this.dataInfo.endTime,
};
const params = encodeURIComponent(JSON.stringify(combinedData));

View File

@ -74,7 +74,7 @@
:percent="(todayCompletion.completed / todayCompletion.total) * 100"
></u-line-progress>
</view>
<view class="unfinish">
<view class="unfinish" @click="handleTaskClick2">
<view class="point"></view>
<view class="title">待保洁区域</view>
<view class="count-rate">
@ -222,12 +222,25 @@ export default {
}
},
handleTaskClick(item) {
console.log(item);
// console.log(item);
uni.navigateTo({
url: `/pages/index/cleanPlan?id=${item.id}`,
});
},
handleTaskClick2() {
if (this.planList.length == 0) return;
const firstIncompletePlan = this.planList.find(
(item) => item.isCompleted === 0
);
if (firstIncompletePlan) {
uni.navigateTo({
url: `/pages/index/cleanPlan?id=${firstIncompletePlan.id}`,
});
}
},
//
async getPlanByDate() {

View File

@ -287,20 +287,47 @@ export default {
const res1 = await ReportingNFCDanger(params);
if (res1.succeed) {
const queryParams = encodeURIComponent(JSON.stringify(this.params));
uni.showModal({
title: "提示",
content: "清扫工作已完成,上传图片记录",
confirmText: "去上传图片",
showCancel: false,
success: function (res) {
if (res.confirm) {
uni.navigateTo({
url: "/pages/index/uploadPhoto?params=" + queryParams,
});
}
},
});
const currentMinutes = this.reportingTime
.split(" ")[1]
.split(":")
.reduce((h, m) => Number(h) * 60 + Number(m));
const inRange =
currentMinutes >= Number(this.params.beginTime) &&
currentMinutes <= Number(this.params.endTime);
if (inRange) {
//
const queryParams = encodeURIComponent(JSON.stringify(this.params));
uni.showModal({
title: "提示",
content: "清扫工作已完成,上传图片记录",
confirmText: "去上传图片",
showCancel: false,
success: function (res) {
if (res.confirm) {
uni.navigateTo({
url: "/pages/index/uploadPhoto?params=" + queryParams,
});
}
},
});
} else {
//
uni.showModal({
title: "提示",
content: "异常上报已完成,当前时间不在保洁计划时间内",
confirmText: "返回首页",
showCancel: false,
success: function (res) {
if (res.confirm) {
uni.navigateTo({
url: "/pages/index/index",
});
}
},
});
}
}
},
},

View File

@ -69,6 +69,7 @@
? completedPlanList
: incompletePlanList"
:key="index"
@click="toItemPage(item)"
>
<view class="plan-header">
<image
@ -83,7 +84,7 @@
<view class="plan-content">
<view class="plan-content-top">
<view class="place">{{ item.name }}</view>
<u-tag text="9:00~12:00" type="info" border-color="transparent" />
<u-tag :text="item.time" type="info" border-color="transparent" />
</view>
<view class="plan-content-main">
{{ item.areas }}
@ -117,6 +118,8 @@ import { GetPlanList } from "@/api/apiList";
import { GetNowTime } from "@/utils/common";
import { getDateDiff } from "@/utils/utils";
import dayjs from "@/uni_modules/uview-ui/libs/util/dayjs";
export default {
data() {
const todayStr = GetNowTime(new Date());
@ -192,6 +195,15 @@ export default {
}
}
},
toItemPage(item) {
// const isToday = dayjs(item.date).isSame(dayjs(), "day");
// if (!isToday) return;
uni.navigateTo({
url: `/pages/index/cleanPlan?id=${item.id}&type=all`,
});
},
},
};
</script>
@ -216,7 +228,7 @@ page {
padding: 32rpx 0;
margin: 0 32rpx 32rpx;
border-bottom: none;
-webkit-border-bottom: none; // WebKit
-webkit-border-bottom: none; // WebKit
.tab-item {
flex: 1;
@ -226,7 +238,7 @@ page {
position: relative;
z-index: 1;
border-bottom: none;
-webkit-border-bottom: none; // WebKit
-webkit-border-bottom: none; // WebKit
.label {
font-size: 28rpx;