Merge branch 'main' of http://sl.vrgon.com:3000/LuYaShi/InspectionCleaning
This commit is contained in:
commit
d6a4b332fc
|
@ -17,7 +17,7 @@
|
||||||
<view class="label">保洁人员</view>
|
<view class="label">保洁人员</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="block">
|
<view class="block">
|
||||||
<view class="value">{{ dataInfo.cleanTime }}</view>
|
<view class="value">{{ dataInfo.completedTime }}</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="scaleToFill"
|
mode="aspectFill"
|
||||||
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,6 +43,7 @@
|
||||||
<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 {
|
||||||
|
@ -66,6 +67,16 @@ 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,
|
||||||
|
@ -73,6 +84,10 @@ 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"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -127,6 +142,7 @@ 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;
|
||||||
|
@ -135,12 +151,32 @@ export default {
|
||||||
.block:nth-child(n + 3) {
|
.block:nth-child(n + 3) {
|
||||||
margin-top: 14rpx;
|
margin-top: 14rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.label {
|
||||||
|
color: #5a6c88;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.images {
|
.images {
|
||||||
margin-top: 46rpx;
|
display: flex;
|
||||||
display: grid;
|
flex-wrap: wrap; /* 允许换行 */
|
||||||
grid-template-columns: repeat(auto-fill, 212rpx);
|
justify-content: flex-start; /* 从左开始排列 */
|
||||||
gap: 20rpx; // 图片间距
|
margin-top: 32rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,12 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="arealist" v-if="dataInfo.areas.length > 0">
|
<view class="arealist" v-if="dataInfo.areas.length > 0">
|
||||||
<view class="block-info" v-for="item in dataInfo.areas" :key="item.id" @click="toItemPage(item)">
|
<view
|
||||||
|
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
|
||||||
>
|
>
|
||||||
|
@ -247,7 +252,7 @@ export default {
|
||||||
|
|
||||||
const params = {
|
const params = {
|
||||||
planName: this.dataInfo.planName,
|
planName: this.dataInfo.planName,
|
||||||
areaId: this.dataInfo.areas[this.dataInfo.areas.length - 1].id,
|
id: 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);
|
||||||
|
@ -272,10 +277,27 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
toItemPage(item) {
|
toItemPage(item) {
|
||||||
console.log("%c%s", "color:red", "跳转至详情页");
|
console.log("%c%s", "color:red", "跳转至详情页", item);
|
||||||
|
|
||||||
|
const combinedData = {
|
||||||
|
...item, // 展开 item 的所有属性
|
||||||
|
planName: this.dataInfo.planName, // 添加 planName 属性
|
||||||
|
};
|
||||||
|
|
||||||
|
const params = encodeURIComponent(JSON.stringify(combinedData));
|
||||||
|
|
||||||
|
if (item.isCompleted) {
|
||||||
|
// 已保洁
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/pages/index/cleanDetails?params=" + encodeURIComponent(JSON.stringify(item)),
|
url: "/pages/index/cleanDetails?params=" + params,
|
||||||
});
|
});
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
// 未保洁
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pages/index/list?params=" + params,
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
openFn() {},
|
openFn() {},
|
||||||
|
@ -318,6 +340,9 @@ 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;
|
||||||
|
|
|
@ -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();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<u-cell-item
|
<u-cell-item
|
||||||
:arrow="false"
|
:arrow="false"
|
||||||
title="保洁人员"
|
title="保洁人员"
|
||||||
:value="baseInfo.cleaner"
|
:value="dataInfo.userName"
|
||||||
: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="baseInfo.reportTime"
|
:value="reportingTime"
|
||||||
: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="200"
|
label-width="400rpx"
|
||||||
:label-style="{ fontSize: '32rpx' }"
|
:label-style="{ fontSize: '32rpx' }"
|
||||||
>
|
>
|
||||||
<!-- 区域选择(多选) -->
|
<!-- 区域选择(多选) -->
|
||||||
<u-form-item :label="baseInfo.area" prop="areas">
|
<u-form-item :label="dataInfo.name" 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="notes" label-position="top">
|
<u-form-item label="备注" prop="note" label-position="top">
|
||||||
<u-input
|
<u-input
|
||||||
v-model="form.notes"
|
v-model="form.note"
|
||||||
placeholder="请对故障进行描述"
|
placeholder="请对故障进行描述"
|
||||||
autoHeight
|
autoHeight
|
||||||
maxlength="200"
|
maxlength="200"
|
||||||
|
@ -103,18 +103,16 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { ReportingNFCDanger } from "@/api/apiList";
|
import { ReportingNFCDanger, GetPlanInfoAre, UploadFiles } from "@/api/apiList";
|
||||||
|
|
||||||
|
import { dateFormat } from "@/utils/utils";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
baseInfo: {
|
reportingTime: "", // 当时时间 2025-4-14 10:00
|
||||||
cleaner: "小饼", // 保洁人员
|
|
||||||
reportTime: "2025.4.1", // 上报时间
|
|
||||||
area: "东大门操场", // 清洁区域
|
|
||||||
},
|
|
||||||
form: {
|
form: {
|
||||||
notes: "", // 备注
|
note: "", // 备注
|
||||||
url: "", // 图片
|
url: "", // 图片
|
||||||
},
|
},
|
||||||
areaOptions: [
|
areaOptions: [
|
||||||
|
@ -130,7 +128,7 @@ export default {
|
||||||
trigger: ["blur", "change"],
|
trigger: ["blur", "change"],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
reportTime: [
|
reportingTime: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: "请选择上报时间",
|
message: "请选择上报时间",
|
||||||
|
@ -155,17 +153,32 @@ 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);
|
||||||
},
|
},
|
||||||
|
@ -193,6 +206,17 @@ 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) {
|
||||||
|
@ -200,25 +224,35 @@ export default {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(this.form);
|
const res = await UploadFiles([this.form.url]);
|
||||||
|
if (!res.succeed) return;
|
||||||
|
|
||||||
return;
|
const params = {
|
||||||
|
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 res = await ReportingNFCDanger({
|
const res1 = await ReportingNFCDanger(params);
|
||||||
...this.form,
|
|
||||||
|
|
||||||
// 以下数据待获取
|
if (res1.succeed) {
|
||||||
id: "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
const queryParams = encodeURIComponent(JSON.stringify(this.params));
|
||||||
userId: "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
uni.showModal({
|
||||||
reportingTime: "2025-04-10T08:02:40.917Z",
|
title: "提示",
|
||||||
note: "string",
|
content: "任务已完成,快去上传图片吧",
|
||||||
url: "string",
|
confirmText: "去上传图片",
|
||||||
planInfoId: "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
showCancel: false,
|
||||||
|
success: function (res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pages/index/uploadPhoto?params=" + queryParams,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (res.succeed) {
|
|
||||||
console.log(res);
|
|
||||||
uni.showToast({ title: "上报成功", icon: "success" });
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -227,7 +261,7 @@ export default {
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
page {
|
page {
|
||||||
background-color: #f3f5fa;
|
background-color: #f3f5fa !important;
|
||||||
}
|
}
|
||||||
.content {
|
.content {
|
||||||
height: auto;
|
height: auto;
|
||||||
|
|
|
@ -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,23 +181,28 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
const params = {
|
const params = {
|
||||||
id: this.params.areaId,
|
id: this.params.id,
|
||||||
note: this.remark,
|
note: this.remark,
|
||||||
picturesDto: [],
|
picturesDto: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
const res = await UploadFiles(this.imageList);
|
const res = await UploadFiles(this.imageList);
|
||||||
if (res.succeed) {
|
if (!res.succeed) return;
|
||||||
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" });
|
uni.showToast({ title: "上传成功", icon: "success", duration: 1500 });
|
||||||
} else {
|
setTimeout(() => {
|
||||||
uni.showToast({ title: res2.error || "上传失败", icon: "none" });
|
uni.switchTab({
|
||||||
|
url: "/pages/index/index",
|
||||||
|
});
|
||||||
|
}, 1500);
|
||||||
}
|
}
|
||||||
|
// else {
|
||||||
|
// uni.showToast({ title: res2.error || "上传失败", icon: "none" });
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue