|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="work-wrap">
|
|
<div class="work-wrap">
|
|
|
<custom-header name="农事成效"></custom-header>
|
|
<custom-header name="农事成效"></custom-header>
|
|
|
- <div class="work-content recheck-title">
|
|
|
|
|
|
|
+ <div class="work-content recheck-title" v-loading="loading">
|
|
|
<div class="tabs-content-item">
|
|
<div class="tabs-content-item">
|
|
|
<div class="common-card-title">
|
|
<div class="common-card-title">
|
|
|
<img class="icon" src="@/assets/img/home/label-icon.png" alt="" />
|
|
<img class="icon" src="@/assets/img/home/label-icon.png" alt="" />
|
|
@@ -261,7 +261,7 @@
|
|
|
<script setup>
|
|
<script setup>
|
|
|
import { Tab, Tabs } from "vant";
|
|
import { Tab, Tabs } from "vant";
|
|
|
import customHeader from "@/components/customHeader.vue";
|
|
import customHeader from "@/components/customHeader.vue";
|
|
|
-import { onMounted, ref, onDeactivated, onActivated } from "vue";
|
|
|
|
|
|
|
+import { onMounted, ref, onDeactivated, onActivated, onUnmounted } from "vue";
|
|
|
import { useRoute, useRouter } from "vue-router";
|
|
import { useRoute, useRouter } from "vue-router";
|
|
|
import upload from "@/components/upload";
|
|
import upload from "@/components/upload";
|
|
|
import AlbumCarousel from "@/components/album_compoents/albumCarousel";
|
|
import AlbumCarousel from "@/components/album_compoents/albumCarousel";
|
|
@@ -273,6 +273,7 @@ const workItem = ref({});
|
|
|
const curRole = ref("");
|
|
const curRole = ref("");
|
|
|
// 农事规划页面-显示上传农事凭证按钮
|
|
// 农事规划页面-显示上传农事凭证按钮
|
|
|
const isPlan = ref(false);
|
|
const isPlan = ref(false);
|
|
|
|
|
+const loading = ref(false);
|
|
|
|
|
|
|
|
const diffInDays = (date, type = "minus") => {
|
|
const diffInDays = (date, type = "minus") => {
|
|
|
const targetDate = new Date(date);
|
|
const targetDate = new Date(date);
|
|
@@ -297,9 +298,12 @@ onActivated(() => {
|
|
|
|
|
|
|
|
const getDetail = () => {
|
|
const getDetail = () => {
|
|
|
if (!paramsPage.value.id) return;
|
|
if (!paramsPage.value.id) return;
|
|
|
|
|
+ loading.value = true;
|
|
|
VE_API.z_farm_work_record.getDetail({ id: paramsPage.value.id }).then(({ data }) => {
|
|
VE_API.z_farm_work_record.getDetail({ id: paramsPage.value.id }).then(({ data }) => {
|
|
|
workItem.value = data[0];
|
|
workItem.value = data[0];
|
|
|
getTriggerImg(workItem.value.id);
|
|
getTriggerImg(workItem.value.id);
|
|
|
|
|
+ }).finally(() => {
|
|
|
|
|
+ loading.value = false;
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -325,8 +329,23 @@ const handleSubmit = () => {
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-onDeactivated(() => {
|
|
|
|
|
|
|
+// 清理数据的函数
|
|
|
|
|
+const clearData = () => {
|
|
|
workItem.value = {};
|
|
workItem.value = {};
|
|
|
|
|
+ triggerImg.value = [];
|
|
|
|
|
+ imageArr.value = [];
|
|
|
|
|
+ paramsPage.value = {};
|
|
|
|
|
+ isPlan.value = false;
|
|
|
|
|
+ curRole.value = "";
|
|
|
|
|
+ loading.value = false;
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+onDeactivated(() => {
|
|
|
|
|
+ clearData();
|
|
|
|
|
+});
|
|
|
|
|
+
|
|
|
|
|
+onUnmounted(() => {
|
|
|
|
|
+ clearData();
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
// //联系专家
|
|
// //联系专家
|