|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <scroll-view scroll-y>
|
|
|
+ <scroll-view scroll-y class="grayBackgroundColor">
|
|
|
<view class="grayBackgroundColor">
|
|
|
<view>
|
|
|
<el-calendar
|
|
@@ -44,46 +44,65 @@
|
|
|
</el-calendar>
|
|
|
</view>
|
|
|
<view>
|
|
|
- <view class="padding-sm" style="display: flex; margin: 10px">
|
|
|
- <el-radio-group
|
|
|
- v-model="tabPosition"
|
|
|
- style="margin: auto"
|
|
|
- @change="tabPositionChange()"
|
|
|
- >
|
|
|
- <el-radio-button label="task">巡检任务</el-radio-button>
|
|
|
- <el-radio-button label="record">巡检记录</el-radio-button>
|
|
|
- </el-radio-group>
|
|
|
+ <view
|
|
|
+ class="padding-sm"
|
|
|
+ style="display: flex; margin: 10px; padding: 10px 5rem"
|
|
|
+ >
|
|
|
+ <u-subsection
|
|
|
+ :list="list"
|
|
|
+ :current="tabPosition"
|
|
|
+ inactiveColor="#303133"
|
|
|
+ activeColor="#3c9cff"
|
|
|
+ @change="tabPositionChange"
|
|
|
+ ></u-subsection>
|
|
|
</view>
|
|
|
<view>
|
|
|
- <el-timeline id="planTimeline" v-if="activities.length > 0">
|
|
|
- <view>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- style="margin: 0px -7.5px"
|
|
|
- link
|
|
|
- @click="activitiesSortClick()"
|
|
|
- >
|
|
|
- 排序
|
|
|
- </el-button>
|
|
|
+ <view id="planTimeline1" v-if="activities.length > 0">
|
|
|
+ <view
|
|
|
+ style="margin: 0px -3.5px; font-size: 13px; color: #409eff"
|
|
|
+ @click="activitiesSortClick()"
|
|
|
+ >
|
|
|
+ 排序
|
|
|
</view>
|
|
|
- <view v-if="tabPosition == 'task'">
|
|
|
- <el-timeline-item
|
|
|
- v-for="(activity, index) in activities"
|
|
|
- :key="index"
|
|
|
- :icon="activity.icon"
|
|
|
- :type="activity.type"
|
|
|
- :color="activity.color"
|
|
|
- :size="activity.size"
|
|
|
- :hollow="activity.hollow"
|
|
|
- >
|
|
|
- <view style="display: flex">
|
|
|
- <view style="font-size: 15px"> {{ activity.planName }}</view>
|
|
|
+ <view
|
|
|
+ v-for="(activity, index) in activities"
|
|
|
+ :key="index"
|
|
|
+ v-show="tabPosition == 0"
|
|
|
+ >
|
|
|
+ <view style="display: flex; height: 25px; line-height: 25px">
|
|
|
+ <view style="margin: auto 0">
|
|
|
+ <u-icon
|
|
|
+ name="info-circle-fill"
|
|
|
+ color="#409eff"
|
|
|
+ size="18"
|
|
|
+ ></u-icon>
|
|
|
+ </view>
|
|
|
+ <view style="display: flex; width: 100%; margin-left: 15px">
|
|
|
+ <view style="font-size: 15px; color: #000000">
|
|
|
+ {{ activity.planName }}
|
|
|
+ </view>
|
|
|
<view style="margin: auto"> </view>
|
|
|
- <view style="color: #b5b5b5"> {{ activity.timestamp }}</view>
|
|
|
+ <view style="font-size: 14px; color: #b5b5b5">
|
|
|
+ {{ activity.timestamp }}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view style="display: flex">
|
|
|
+ <view style="width: 18px; display: flex">
|
|
|
+ <viwe
|
|
|
+ v-if="index != activities.length - 1"
|
|
|
+ style="
|
|
|
+ width: 2px;
|
|
|
+ background-color: #e4e7ed;
|
|
|
+ margin: -5px auto;
|
|
|
+ "
|
|
|
+ ></viwe>
|
|
|
</view>
|
|
|
<view
|
|
|
style="
|
|
|
- margin-top: 15px;
|
|
|
+ width: 100%;
|
|
|
+ margin: 15px 0px 15px 15px;
|
|
|
padding: 15px;
|
|
|
background-color: #fff;
|
|
|
border-radius: 10px;
|
|
@@ -93,20 +112,17 @@
|
|
|
<view>
|
|
|
<view>巡检任务结束</view>
|
|
|
<br />
|
|
|
- <view>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- link
|
|
|
- style="padding: 0"
|
|
|
- @click="reportClick(activity.id)"
|
|
|
- >
|
|
|
- 点击查看
|
|
|
- </el-button>
|
|
|
+ <view
|
|
|
+ style="padding: 0; font-size: 14px; color: #409eff"
|
|
|
+ @click="reportClick(activity)"
|
|
|
+ >
|
|
|
+ 点击查看
|
|
|
</view>
|
|
|
</view>
|
|
|
<view style="margin: auto"></view>
|
|
|
- <view>
|
|
|
+ <view style="display: flex">
|
|
|
<el-progress
|
|
|
+ style="margin: auto"
|
|
|
type="circle"
|
|
|
:percentage="activity.completion"
|
|
|
:width="50"
|
|
@@ -120,20 +136,17 @@
|
|
|
{{ activity.undetectedSiteCount }}个
|
|
|
</view>
|
|
|
<br />
|
|
|
- <view>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- link
|
|
|
- style="padding: 0"
|
|
|
- @click="reportClick(activity.id)"
|
|
|
- >
|
|
|
- 点击巡检
|
|
|
- </el-button>
|
|
|
+ <view
|
|
|
+ @click="reportClick(activity)"
|
|
|
+ style="padding: 0; font-size: 14px; color: #409eff"
|
|
|
+ >
|
|
|
+ 点击巡检
|
|
|
</view>
|
|
|
</view>
|
|
|
<view style="margin: auto"></view>
|
|
|
- <view>
|
|
|
+ <view style="display: flex">
|
|
|
<el-progress
|
|
|
+ style="margin: auto"
|
|
|
type="circle"
|
|
|
:percentage="activity.completion"
|
|
|
:width="50"
|
|
@@ -160,8 +173,9 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view style="margin: auto"></view>
|
|
|
- <view>
|
|
|
+ <view style="display: flex">
|
|
|
<el-progress
|
|
|
+ style="margin: auto"
|
|
|
type="circle"
|
|
|
:percentage="activity.completion"
|
|
|
:width="50"
|
|
@@ -169,61 +183,78 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </el-timeline-item>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
|
|
|
- <view v-if="tabPosition == 'record'">
|
|
|
- <el-timeline-item
|
|
|
- v-for="(activity, index) in activities"
|
|
|
- :key="index"
|
|
|
- :icon="activity.icon"
|
|
|
- :type="activity.type"
|
|
|
- :color="activity.color"
|
|
|
- :size="activity.size"
|
|
|
- :hollow="activity.hollow"
|
|
|
- >
|
|
|
- <view style="display: flex">
|
|
|
- <view style="font-size: 15px"> {{ activity.siteName }}</view>
|
|
|
+ <view
|
|
|
+ v-for="(activity, index) in activities"
|
|
|
+ :key="index"
|
|
|
+ v-show="tabPosition == 1"
|
|
|
+ >
|
|
|
+ <view style="display: flex; height: 25px; line-height: 25px">
|
|
|
+ <view style="margin: auto 0">
|
|
|
+ <u-icon
|
|
|
+ name="info-circle-fill"
|
|
|
+ color="#409eff"
|
|
|
+ size="18"
|
|
|
+ ></u-icon>
|
|
|
+ </view>
|
|
|
+ <view style="display: flex; width: 100%; margin-left: 15px">
|
|
|
+ <view style="font-size: 15px; color: #000000">
|
|
|
+ {{ activity.areaName }}
|
|
|
+ </view>
|
|
|
<view style="margin: auto"> </view>
|
|
|
- <view style="color: #b5b5b5"> {{ activity.createTime }}</view>
|
|
|
+ <view style="font-size: 14px; color: #b5b5b5">
|
|
|
+ {{ activity.createTime }}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view style="display: flex">
|
|
|
+ <view style="width: 18px; display: flex">
|
|
|
+ <viwe
|
|
|
+ v-if="index != activities.length - 1"
|
|
|
+ style="
|
|
|
+ width: 2px;
|
|
|
+ background-color: #e4e7ed;
|
|
|
+ margin: -5px auto;
|
|
|
+ "
|
|
|
+ ></viwe>
|
|
|
</view>
|
|
|
<view
|
|
|
style="
|
|
|
- margin-top: 15px;
|
|
|
+ width: 100%;
|
|
|
+ margin: 15px 0px 15px 15px;
|
|
|
padding: 15px;
|
|
|
background-color: #fff;
|
|
|
border-radius: 10px;
|
|
|
"
|
|
|
>
|
|
|
- <view>已检查{{ activity.contentCount }}项内容</view>
|
|
|
- <view
|
|
|
- :style="{
|
|
|
- color:
|
|
|
- activity.siteStatus == 0
|
|
|
- ? '#f07d28'
|
|
|
- : activity.siteStatus == 1
|
|
|
- ? '#00cdac'
|
|
|
- : '',
|
|
|
- textAlign: 'right',
|
|
|
- }"
|
|
|
- >
|
|
|
- {{
|
|
|
- activity.siteStatus == 0
|
|
|
- ? "未定位"
|
|
|
- : activity.siteStatus == 1
|
|
|
- ? "已定位"
|
|
|
- : ""
|
|
|
- }}
|
|
|
- </view>
|
|
|
- <view>
|
|
|
- <el-button type="primary" link style="padding: 0">
|
|
|
- 点击查看
|
|
|
- </el-button>
|
|
|
+ <view style="display: flex">
|
|
|
+ <view>
|
|
|
+ <view>已检查{{ activity.contentCount }}项内容</view>
|
|
|
+ <br />
|
|
|
+ <view
|
|
|
+ style="padding: 0; font-size: 14px; color: #409eff"
|
|
|
+ @click="reportClick(activity)"
|
|
|
+ >
|
|
|
+ 点击查看
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view style="margin: auto"></view>
|
|
|
+ <view
|
|
|
+ style="display: flex; font-size: 15px; color: #30bb00"
|
|
|
+ >
|
|
|
+ <view style="margin: auto">
|
|
|
+ {{ activity.siteStatus == 0 ? "未定位" : "已定位" }}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </el-timeline-item>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- </el-timeline>
|
|
|
+ </view>
|
|
|
+
|
|
|
<view
|
|
|
id="planTimeline"
|
|
|
style="text-align: center; color: #bdbdbd; font-size: 14px"
|
|
@@ -235,12 +266,16 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
- <img
|
|
|
- src="@/static/inspection/plan-scan.png"
|
|
|
- alt=""
|
|
|
- style="position: fixed; right: 0; bottom: 50px"
|
|
|
- @click="scanClick()"
|
|
|
- />
|
|
|
+ <view style="position: fixed; right: 0; bottom: 50px">
|
|
|
+ <u-image
|
|
|
+ width="67"
|
|
|
+ height="67"
|
|
|
+ src="@/static/inspection/plan-scan.png"
|
|
|
+ shape="circle"
|
|
|
+ @click="scanClick()"
|
|
|
+ ></u-image>
|
|
|
+ </view>
|
|
|
+
|
|
|
<drawer
|
|
|
v-if="scanArray.length > 0"
|
|
|
:scanArray="scanArray"
|
|
@@ -253,20 +288,67 @@
|
|
|
<script setup>
|
|
|
import drawer from "./components/drawer.vue";
|
|
|
|
|
|
-import { onLoad, onShow } from "@dcloudio/uni-app";
|
|
|
+import { onLoad, onShow, onLaunch } from "@dcloudio/uni-app";
|
|
|
import { ref, onMounted, inject, shallowRef } from "vue";
|
|
|
const myRequest = inject("$myRequest");
|
|
|
|
|
|
import useXunJianStore from "@/store/modules/xunJian";
|
|
|
const settingsStore = useXunJianStore(); //全局变量值Store
|
|
|
|
|
|
-import { MoreFilled } from "@element-plus/icons-vue";
|
|
|
+/**
|
|
|
+ * @点击巡检
|
|
|
+ * @点击事件
|
|
|
+ */
|
|
|
+async function reportClick(obj) {
|
|
|
+ if (tabPosition.value == 0) {
|
|
|
+ settingsStore.planSonId = obj.id;
|
|
|
+ uni.navigateTo({
|
|
|
+ url: "/pages/xunJian/plan/components/report",
|
|
|
+ });
|
|
|
+ } else if (tabPosition.value == 1) {
|
|
|
+ const res = await myRequest({
|
|
|
+ url: "/service-fire/appPatrolInspection/recordList",
|
|
|
+ header: {
|
|
|
+ "Content-Type": "application/json;charset=utf-8",
|
|
|
+ },
|
|
|
+ method: "GET",
|
|
|
+ data: {
|
|
|
+ siteId: obj.id,
|
|
|
+ planSonId: obj.planSonId,
|
|
|
+ },
|
|
|
+ });
|
|
|
|
|
|
-function reportClick(id) {
|
|
|
- settingsStore.planSonId1 = id;
|
|
|
- uni.navigateTo({
|
|
|
- url: "/pages/xunJian/plan/components/report",
|
|
|
- });
|
|
|
+ if (res.data.status == "SUCCESS") {
|
|
|
+ if (res.data.data.length > 0) {
|
|
|
+ const res1 = await myRequest({
|
|
|
+ url: "/service-fire/appPatrolInspection/recordOption",
|
|
|
+ header: {
|
|
|
+ "Content-Type": "application/json;charset=utf-8",
|
|
|
+ },
|
|
|
+ method: "GET",
|
|
|
+ data: {
|
|
|
+ siteId: res.data.data[0].siteId,
|
|
|
+ recordId: res.data.data[0].id,
|
|
|
+ },
|
|
|
+ });
|
|
|
+
|
|
|
+ res.data.data[0].inspectionStatus = 2;
|
|
|
+ res.data.data[0].pictureUrl = obj.pictureUrl;
|
|
|
+
|
|
|
+ settingsStore.contentArray = {
|
|
|
+ contentList: [res1.data.data.contentList],
|
|
|
+ siteList: res.data.data[0],
|
|
|
+ };
|
|
|
+ settingsStore.siteId = undefined;
|
|
|
+ settingsStore.siteNubmber = undefined;
|
|
|
+
|
|
|
+ uni.navigateTo({
|
|
|
+ url: "/pages/xunJian/plan/components/siteDetails",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -275,43 +357,53 @@ function reportClick(id) {
|
|
|
*/
|
|
|
const scanArray = ref([]);
|
|
|
const scanBool = ref(false);
|
|
|
-async function scanClick() {
|
|
|
+function scanClick() {
|
|
|
uni.scanCode({
|
|
|
- success: (res) => {
|
|
|
- console.log("扫码成功", res);
|
|
|
+ success: async (e) => {
|
|
|
+ uni.showToast({
|
|
|
+ title: "扫码成功",
|
|
|
+ icon: "none",
|
|
|
+ });
|
|
|
+ settingsStore.inspectionStatus = 1;
|
|
|
+ let res = await myRequest({
|
|
|
+ url: "/service-fire/appPatrolInspection/planList",
|
|
|
+ header: {
|
|
|
+ "Content-Type": "application/json;charset=utf-8",
|
|
|
+ },
|
|
|
+ method: "GET",
|
|
|
+ data: {
|
|
|
+ siteNubmber: e.result,
|
|
|
+ },
|
|
|
+ });
|
|
|
+
|
|
|
+ if (res.data.status == "SUCCESS") {
|
|
|
+ if (res.data.data.length > 0) {
|
|
|
+ scanArray.value = res.data.data;
|
|
|
+ scanBool.value = true;
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: "此点位下暂无数据,请切换点位重试!",
|
|
|
+ icon: "none",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ }
|
|
|
},
|
|
|
fail: (err) => {
|
|
|
+ uni.showToast({
|
|
|
+ title: "扫码失败",
|
|
|
+ icon: "none",
|
|
|
+ });
|
|
|
console.log("扫码失败", err);
|
|
|
},
|
|
|
complete: () => {
|
|
|
+ // uni.showToast({
|
|
|
+ // title: "扫码结束",
|
|
|
+ // icon: "none",
|
|
|
+ // });
|
|
|
console.log("扫码结束");
|
|
|
},
|
|
|
});
|
|
|
-
|
|
|
- settingsStore.inspectionStatus = 1;
|
|
|
- let res = await myRequest({
|
|
|
- url: "/service-fire/appPatrolInspection/planList",
|
|
|
- header: {
|
|
|
- "Content-Type": "application/json;charset=utf-8",
|
|
|
- },
|
|
|
- method: "GET",
|
|
|
- data: {
|
|
|
- siteNubmber: "0000000000",
|
|
|
- },
|
|
|
- });
|
|
|
-
|
|
|
- if (res.data.status == "SUCCESS") {
|
|
|
- if (res.data.data.length > 0) {
|
|
|
- scanArray.value = res.data.data;
|
|
|
- scanBool.value = true;
|
|
|
- } else {
|
|
|
- uni.showToast({
|
|
|
- title: "此点位下暂无数据,请切换点位重试!",
|
|
|
- icon: "none",
|
|
|
- });
|
|
|
- }
|
|
|
- } else {
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -330,7 +422,7 @@ function scanClose(flag) {
|
|
|
const activities = ref([]);
|
|
|
async function activitiesApi() {
|
|
|
activities.value = [];
|
|
|
- if (tabPosition.value == "task") {
|
|
|
+ if (tabPosition.value == 0) {
|
|
|
let res = await myRequest({
|
|
|
url: "/service-fire/appPatrolInspection/patrolInspectionPlan",
|
|
|
header: {
|
|
@@ -367,7 +459,7 @@ async function activitiesApi() {
|
|
|
});
|
|
|
} else {
|
|
|
}
|
|
|
- } else if (tabPosition.value == "record") {
|
|
|
+ } else if (tabPosition.value == 1) {
|
|
|
let res = await myRequest({
|
|
|
url: "/service-fire/appPatrolInspection/recordList",
|
|
|
header: {
|
|
@@ -383,22 +475,16 @@ async function activitiesApi() {
|
|
|
if (res.data.status == "SUCCESS") {
|
|
|
res.data.data.forEach((el) => {
|
|
|
activities.value.push({
|
|
|
+ areaName: el.areaName,
|
|
|
siteName: el.siteName,
|
|
|
contentCount: el.contentCount,
|
|
|
- createTime:
|
|
|
- el.createTime.split("T")[0] + " " + el.createTime.split("T")[1],
|
|
|
+ createTime: el.createTime.replace("T", " "),
|
|
|
siteStatus: el.siteStatus,
|
|
|
});
|
|
|
});
|
|
|
} else {
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- activities.value.forEach((el) => {
|
|
|
- el.size = "large";
|
|
|
- el.type = "primary";
|
|
|
- el.icon = shallowRef(MoreFilled);
|
|
|
- });
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -435,7 +521,7 @@ async function currentApi() {
|
|
|
/**
|
|
|
* @排序按钮
|
|
|
*/
|
|
|
-const activitiesSort = ref("ASC");
|
|
|
+const activitiesSort = ref("DESC");
|
|
|
function activitiesSortClick() {
|
|
|
if (activitiesSort.value == "ASC") {
|
|
|
activitiesSort.value = "DESC";
|
|
@@ -448,8 +534,10 @@ function activitiesSortClick() {
|
|
|
/**
|
|
|
* @tabs切换change事件
|
|
|
*/
|
|
|
+const list = ref(["巡检任务", "巡检记录"]);
|
|
|
const tabPosition = ref(settingsStore.planTabs);
|
|
|
-function tabPositionChange() {
|
|
|
+function tabPositionChange(index) {
|
|
|
+ tabPosition.value = index;
|
|
|
activitiesApi();
|
|
|
}
|
|
|
|
|
@@ -504,6 +592,12 @@ function touchEnd(e) {
|
|
|
onLoad((options) => {
|
|
|
currentApi();
|
|
|
activitiesApi();
|
|
|
+
|
|
|
+ // 从详情页返回该页面的获取数据
|
|
|
+ uni.$on("planSelect", () => {
|
|
|
+ currentApi();
|
|
|
+ activitiesApi();
|
|
|
+ });
|
|
|
});
|
|
|
|
|
|
onMounted(() => {});
|
|
@@ -516,6 +610,7 @@ onMounted(() => {});
|
|
|
</style>
|
|
|
|
|
|
<style scoped>
|
|
|
+body,
|
|
|
uni-page-body,
|
|
|
uni-page-refresh,
|
|
|
.grayBackgroundColor {
|