Compare commits

..

No commits in common. "077aaabb14f1419216d507733eb85f72ca7390ef" and "ba7cf7562eefc8fd9074bb25fe2e1dede8313a58" have entirely different histories.

5 changed files with 57 additions and 157 deletions

View File

@ -17,7 +17,7 @@
<view class="label">保洁人员</view> <view class="label">保洁人员</view>
</view> </view>
<view class="block"> <view class="block">
<view class="value">{{ dataInfo.completedTime }}</view> <view class="value">{{ dataInfo.cleanTime }}</view>
<view class="label">清扫时间</view> <view class="label">清扫时间</view>
</view> </view>
<view class="block"> <view class="block">
@ -31,9 +31,9 @@
class="image" class="image"
v-for="(v, i) in dataInfo.pictures" v-for="(v, i) in dataInfo.pictures"
:key="i" :key="i"
mode="aspectFill" mode="scaleToFill"
style="width: 180rpx; height: 180rpx; border-radius: 18rpx"
:src="BASE_URL + '/uploads/' + v.path" :src="BASE_URL + '/uploads/' + v.path"
@click="previewImage(i)"
></image> ></image>
</view> </view>
</view> </view>
@ -43,7 +43,6 @@
<script> <script>
import BASE_URL from "@/api/env.js"; // import BASE_URL from "@/api/env.js"; //
import { GetPlanInfoAre } from "@/api/apiList"; import { GetPlanInfoAre } from "@/api/apiList";
import { dateFormat } from "@/utils/utils.js";
export default { export default {
data() { data() {
return { return {
@ -67,16 +66,6 @@ export default {
}, },
methods: { methods: {
dateFormat,
//
previewImage(index) {
uni.previewImage({
urls: this.dataInfo.pictures.map((v) => BASE_URL + "/uploads/" + v.path),
current: index,
});
},
async getAreaInfo() { async getAreaInfo() {
const res = await GetPlanInfoAre({ const res = await GetPlanInfoAre({
id: this.params.id, id: this.params.id,
@ -84,10 +73,6 @@ export default {
if (res.succeed) { if (res.succeed) {
this.dataInfo = res.data; this.dataInfo = res.data;
this.dataInfo.completedTime = dateFormat(
new Date(this.dataInfo.completedTime),
"YYYY/MM/DD HH:mm:ss"
);
} }
}, },
}, },
@ -142,7 +127,6 @@ export default {
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
gap: 10rpx;
width: 48.5%; width: 48.5%;
height: 160rpx; height: 160rpx;
background: #f1f7fe; background: #f1f7fe;
@ -151,32 +135,12 @@ export default {
.block:nth-child(n + 3) { .block:nth-child(n + 3) {
margin-top: 14rpx; margin-top: 14rpx;
} }
.label {
color: #5a6c88;
}
} }
.images { .images {
display: flex; margin-top: 46rpx;
flex-wrap: wrap; /* 允许换行 */ display: grid;
justify-content: flex-start; /* 从左开始排列 */ grid-template-columns: repeat(auto-fill, 212rpx);
margin-top: 32rpx; gap: 20rpx; //
}
.image {
/* 设置宽度,留出间隙 */
width: calc((100% - 40rpx) / 3); /* 假设间隙为 20rpx */
height: 210rpx; /* 或根据需要调整高度 */
border-radius: 18rpx;
background-color: #eee;
overflow: hidden;
margin-right: 20rpx; /* 右边间隙 */
margin-bottom: 20rpx; /* 下边间隙 */
}
/* 清除每行最后一个元素的右边距 */
.image:nth-child(3n) {
margin-right: 0;
} }
} }
} }

View File

@ -41,12 +41,7 @@
</view> </view>
</view> </view>
<view class="arealist" v-if="dataInfo.areas.length > 0"> <view class="arealist" v-if="dataInfo.areas.length > 0">
<view <view class="block-info" v-for="item in dataInfo.areas" :key="item.id" @click="toItemPage(item)">
class="block-info"
v-for="item in dataInfo.areas"
:key="item.id"
@click="toItemPage(item)"
>
<view v-if="!item.isCompleted" class="schedule schedule-wait" <view v-if="!item.isCompleted" class="schedule schedule-wait"
>待保洁</view >待保洁</view
> >
@ -252,7 +247,7 @@ export default {
const params = { const params = {
planName: this.dataInfo.planName, planName: this.dataInfo.planName,
id: this.dataInfo.areas[this.dataInfo.areas.length - 1].id, areaId: this.dataInfo.areas[this.dataInfo.areas.length - 1].id,
aeraNmae: this.dataInfo.areas[this.dataInfo.areas.length - 1].aeraNmae, aeraNmae: this.dataInfo.areas[this.dataInfo.areas.length - 1].aeraNmae,
}; };
console.log(params); console.log(params);
@ -277,27 +272,10 @@ export default {
}, },
toItemPage(item) { toItemPage(item) {
console.log("%c%s", "color:red", "跳转至详情页", item); console.log("%c%s", "color:red", "跳转至详情页");
uni.navigateTo({
const combinedData = { url: "/pages/index/cleanDetails?params=" + encodeURIComponent(JSON.stringify(item)),
...item, // item });
planName: this.dataInfo.planName, // planName
};
const params = encodeURIComponent(JSON.stringify(combinedData));
if (item.isCompleted) {
//
uni.navigateTo({
url: "/pages/index/cleanDetails?params=" + params,
});
return;
} else {
//
uni.navigateTo({
url: "/pages/index/list?params=" + params,
});
}
}, },
openFn() {}, openFn() {},
@ -340,9 +318,6 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
page {
background-color: #f3f5fa !important;
}
.content { .content {
// height: 100vh; // height: 100vh;
background: #f7f8fc; background: #f7f8fc;

View File

@ -132,7 +132,7 @@ export default {
}, },
mounted() { mounted() {
console.log("%c%s", "color:red", "mounted--"); console.log('%c%s', 'color:red', 'mounted--')
this.getPlanByDate(); this.getPlanByDate();
}, },

View File

@ -5,7 +5,7 @@
<u-cell-item <u-cell-item
:arrow="false" :arrow="false"
title="保洁人员" title="保洁人员"
:value="dataInfo.userName" :value="baseInfo.cleaner"
:title-style="{ :title-style="{
color: '#303133', color: '#303133',
fontSize: '32rpx', fontSize: '32rpx',
@ -18,7 +18,7 @@
<u-cell-item <u-cell-item
:arrow="false" :arrow="false"
title="上报时间" title="上报时间"
:value="reportingTime" :value="baseInfo.reportTime"
:title-style="{ :title-style="{
color: '#303133', color: '#303133',
fontSize: '32rpx', fontSize: '32rpx',
@ -38,11 +38,11 @@
:model="form" :model="form"
:rules="rules" :rules="rules"
ref="uForm" ref="uForm"
label-width="400rpx" label-width="200"
:label-style="{ fontSize: '32rpx' }" :label-style="{ fontSize: '32rpx' }"
> >
<!-- 区域选择多选 --> <!-- 区域选择多选 -->
<u-form-item :label="dataInfo.name" prop="areas"> <u-form-item :label="baseInfo.area" prop="areas">
<!-- <u-input v-model="form.cleaner" placeholder="请输入故障" /> --> <!-- <u-input v-model="form.cleaner" placeholder="请输入故障" /> -->
<view style="width: 100%; font-size: 32rpx; text-align: right" <view style="width: 100%; font-size: 32rpx; text-align: right"
>NFC卡损坏</view >NFC卡损坏</view
@ -50,9 +50,9 @@
</u-form-item> </u-form-item>
<!-- 备注文本域 --> <!-- 备注文本域 -->
<u-form-item label="备注" prop="note" label-position="top"> <u-form-item label="备注" prop="notes" label-position="top">
<u-input <u-input
v-model="form.note" v-model="form.notes"
placeholder="请对故障进行描述" placeholder="请对故障进行描述"
autoHeight autoHeight
maxlength="200" maxlength="200"
@ -103,16 +103,18 @@
</template> </template>
<script> <script>
import { ReportingNFCDanger, GetPlanInfoAre, UploadFiles } from "@/api/apiList"; import { ReportingNFCDanger } from "@/api/apiList";
import { dateFormat } from "@/utils/utils";
export default { export default {
data() { data() {
return { return {
reportingTime: "", // 2025-4-14 10:00 baseInfo: {
cleaner: "小饼", //
reportTime: "2025.4.1", //
area: "东大门操场", //
},
form: { form: {
note: "", // notes: "", //
url: "", // url: "", //
}, },
areaOptions: [ areaOptions: [
@ -128,7 +130,7 @@ export default {
trigger: ["blur", "change"], trigger: ["blur", "change"],
}, },
], ],
reportingTime: [ reportTime: [
{ {
required: true, required: true,
message: "请选择上报时间", message: "请选择上报时间",
@ -153,32 +155,17 @@ export default {
}, },
], ],
}, },
params: {},
dataInfo: {},
}; };
}, },
onLoad(options) {
console.log("options", JSON.parse(decodeURIComponent(options.params)));
this.params = JSON.parse(decodeURIComponent(options.params));
},
created() {
this.reportingTime = dateFormat(new Date(), "YYYY-MM-DD HH:mm");
this.getAreaInfo();
},
methods: { methods: {
// //
handleImageUpload(event) { handleImageUpload(event) {
const files = event.file; const files = event.file;
// //
this.form.images.push(...files.map((file) => ({ url: file.url }))); this.form.images.push(...files.map((file) => ({ url: file.url })));
}, },
// //
handleImageDelete(index) { handleImageDelete(index) {
this.form.images.splice(index, 1); this.form.images.splice(index, 1);
}, },
@ -206,17 +193,6 @@ export default {
this.form.url = ""; this.form.url = "";
}, },
//
async getAreaInfo() {
const res = await GetPlanInfoAre({
id: this.params.id,
});
if (res.succeed) {
this.dataInfo = res.data;
}
},
// //
async submitForm() { async submitForm() {
if (!this.form.url) { if (!this.form.url) {
@ -224,35 +200,25 @@ export default {
return; return;
} }
const res = await UploadFiles([this.form.url]); console.log(this.form);
if (!res.succeed) return;
const params = { return;
note: this.form.note,
planInfoId: this.dataInfo.planInfoId,
reportingTime: this.reportingTime.replace(" ", "T"),
userId: this.dataInfo.userId,
id: this.dataInfo.id,
url: res.data[0].path,
};
const res1 = await ReportingNFCDanger(params); const res = await ReportingNFCDanger({
...this.form,
if (res1.succeed) { //
const queryParams = encodeURIComponent(JSON.stringify(this.params)); id: "3fa85f64-5717-4562-b3fc-2c963f66afa6",
uni.showModal({ userId: "3fa85f64-5717-4562-b3fc-2c963f66afa6",
title: "提示", reportingTime: "2025-04-10T08:02:40.917Z",
content: "任务已完成,快去上传图片吧", note: "string",
confirmText: "去上传图片", url: "string",
showCancel: false, planInfoId: "3fa85f64-5717-4562-b3fc-2c963f66afa6",
success: function (res) { });
if (res.confirm) {
uni.navigateTo({ if (res.succeed) {
url: "/pages/index/uploadPhoto?params=" + queryParams, console.log(res);
}); uni.showToast({ title: "上报成功", icon: "success" });
}
},
});
} }
}, },
}, },
@ -261,7 +227,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
page { page {
background-color: #f3f5fa !important; background-color: #f3f5fa;
} }
.content { .content {
height: auto; height: auto;

View File

@ -22,7 +22,7 @@
:background="{ backgroundColor: '#F7F8FC' }" :background="{ backgroundColor: '#F7F8FC' }"
:border-bottom="false" :border-bottom="false"
> >
<!-- <view slot="right"> <view slot="right">
<view class="menu-wrapper"> <view class="menu-wrapper">
<image <image
src="/static/iconfont/more.svg" src="/static/iconfont/more.svg"
@ -31,7 +31,7 @@
@click="toggleMenu" @click="toggleMenu"
/> />
</view> </view>
</view> --> </view>
</u-navbar> </u-navbar>
<view class="content-header"> <view class="content-header">
@ -181,28 +181,23 @@ export default {
} }
const params = { const params = {
id: this.params.id, id: this.params.areaId,
note: this.remark, note: this.remark,
picturesDto: [], picturesDto: [],
}; };
const res = await UploadFiles(this.imageList); const res = await UploadFiles(this.imageList);
if (!res.succeed) return; if (res.succeed) {
params.picturesDto = res.data; params.picturesDto = res.data;
}
const res2 = await UploadArea(params); const res2 = await UploadArea(params);
if (res2.succeed) { if (res2.succeed) {
// //
uni.showToast({ title: "上传成功", icon: "success", duration: 1500 }); uni.showToast({ title: "上传成功", icon: "success" });
setTimeout(() => { } else {
uni.switchTab({ uni.showToast({ title: res2.error || "上传失败", icon: "none" });
url: "/pages/index/index",
});
}, 1500);
} }
// else {
// uni.showToast({ title: res2.error || "", icon: "none" });
// }
}, },
}, },
}; };