|
|
@@ -82,7 +82,15 @@
|
|
|
<PhenologyTrackTimelineItem theme="dark" :list="cropArchiveList" />
|
|
|
</div>
|
|
|
<album-upload-popup v-model:show="showUploadPopup" @confirm="handleUploadConfirm" />
|
|
|
- <tip-popup class="restore-planting-success-popup" :zIndex="20000" v-model:show="showSuccessPopup" type="executeSuccess" text="您已上传成功" text2="诊断报告正在生成,请稍后..." hideBtn>
|
|
|
+ <tip-popup
|
|
|
+ class="restore-planting-success-popup"
|
|
|
+ :zIndex="20000"
|
|
|
+ v-model:show="showSuccessPopup"
|
|
|
+ type="executeSuccess"
|
|
|
+ text="您已上传成功"
|
|
|
+ :text2="uploadSuccessText2"
|
|
|
+ hideBtn
|
|
|
+ >
|
|
|
<template #footer>
|
|
|
<div class="bottom-btn-container">
|
|
|
<div class="bottom-btn primary-btn" @click="handleComplete">完成</div>
|
|
|
@@ -93,7 +101,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { nextTick, onActivated, onMounted, ref } from "vue";
|
|
|
+import { computed, nextTick, onActivated, onMounted, ref } from "vue";
|
|
|
import { useRoute, useRouter } from "vue-router";
|
|
|
import { Icon } from "vant";
|
|
|
import { ElMessage } from "element-plus";
|
|
|
@@ -598,10 +606,18 @@ const tryContinueUpload = () => {
|
|
|
router.replace({ path: route.path, query: restQuery });
|
|
|
};
|
|
|
|
|
|
-/** 异常态势 / 土壤根系:与 abnormalTrack 相同,走巡检上传 */
|
|
|
+/** 异常态势 / 土壤根系:与 abnormalTrack 相同,走巡检上传;物候走 growthTrack 相册上传 */
|
|
|
const isInspectUploadType = (type) => type === "abnormal" || type === "soil";
|
|
|
|
|
|
+/** 成功提示副文案:物候看相册;异常 / 土壤看诊断报告 */
|
|
|
+const uploadSuccessText2 = computed(() =>
|
|
|
+ isInspectUploadType(uploadCardType.value)
|
|
|
+ ? "诊断报告正在生成,请稍后..."
|
|
|
+ : "可在 农事档案-农情相册 中查看"
|
|
|
+);
|
|
|
+
|
|
|
const handleUploadConfirm = async ({ images, date } = {}) => {
|
|
|
+ // 异常 / 土壤:同 abnormalTrack → uploadAbnormalPhoto
|
|
|
if (isInspectUploadType(uploadCardType.value)) {
|
|
|
const imageList = (Array.isArray(images) ? images : [])
|
|
|
.filter(Boolean)
|
|
|
@@ -633,17 +649,25 @@ const handleUploadConfirm = async ({ images, date } = {}) => {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ // 物候:同 growthTrack → uploadImages
|
|
|
const cloud_url = Array.isArray(images) ? images : [];
|
|
|
if (!cloud_url.length) {
|
|
|
ElMessage.warning("请先上传照片");
|
|
|
return;
|
|
|
}
|
|
|
const farm = getSelectedFarm();
|
|
|
+ const { farmId, zoneId } = await resolvePairedFarmZone(
|
|
|
+ uploadZoneId.value || selectedZoneId.value
|
|
|
+ );
|
|
|
+ if (farmId == null || zoneId == null || zoneId === "") {
|
|
|
+ ElMessage.warning("当前农场与分区不匹配,请返回后重试");
|
|
|
+ return;
|
|
|
+ }
|
|
|
try {
|
|
|
const res = await VE_API.questionnaire.uploadImages({
|
|
|
cloud_url,
|
|
|
- farm_id: farm.farm_id ?? farm.id ?? "",
|
|
|
- zone_id: uploadZoneId.value || selectedZoneId.value || "",
|
|
|
+ farm_id: farmId,
|
|
|
+ zone_id: zoneId,
|
|
|
category_code: farm.category_code || "",
|
|
|
zone_name: selectedZoneName.value || farm.variety_name || "",
|
|
|
create_time: date,
|