Explorar o código

fix: 修改分区,保存地址

lxf hai 5 días
pai
achega
4006db8485

+ 6 - 0
src/api/modules/pheno.js

@@ -12,4 +12,10 @@ module.exports = {
         url: config.base_new_url + "pheno/soil_root_perception",
         type: "get",
     },
+    // 更新分区名称
+    updateZoneName: {
+        url: config.base_new_url + "questionnaire/update_zone_name",
+        type: "post",
+    },
+
 }

+ 1 - 0
src/components/pageComponents/locationSearch.vue

@@ -90,6 +90,7 @@ const handleSearchRes = (v) => {
         address: v.item?.title || v.item?.address,
         pointAddress: v.item?.province + v.item?.city + v.item?.district,
         city: v.item?.city + v.item?.district || '',
+        county_address: v.item?.county_address || "",
         adcode: v.item?.adcode != null ? String(v.item.adcode) : "",
         item: v.item,
     });

+ 3 - 0
src/utils/tiandituLocation.js

@@ -96,6 +96,7 @@ export function normalizeRegeoResult(payload) {
     return {
         address,
         formatted_addresses: { recommend: address },
+        county_address: `${city}${district}`,
         address_component: {
             province: ac.province || "",
             city,
@@ -149,6 +150,8 @@ function mapPoiItem(poi) {
         province: poi.province || "",
         city: poi.city || "",
         district: poi.county || "",
+        /** 市+区县,提交建档接口 addFarmInfo 用 */
+        county_address: `${poi.city || ""}${poi.county || ""}`,
         adcode: normalizeAdcode(poi.countyCode || poi.cityCode || poi.provinceCode || ""),
         location: { lat, lng },
         coordSys: "wgs84",

+ 11 - 0
src/views/old_mini/agri_file/components/addZoneInfoPopup.vue

@@ -97,6 +97,7 @@
                         :editable="false"
                         :clearable="false"
                         :prefix-icon="null"
+                        :disabled-date="disabledFutureDate"
                         popper-class="add-zone-info-date-popper"
                         style="width: 100%"
                     />
@@ -212,6 +213,13 @@ function getSelectedFarm() {
     }
 }
 
+/** 起种时间只能选今天及以前:返回 true 表示禁用(未来日期) */
+function disabledFutureDate(date) {
+    const endOfToday = new Date();
+    endOfToday.setHours(23, 59, 59, 999);
+    return date.getTime() > endOfToday.getTime();
+}
+
 /** 与 farmHeader / allGarden 保持一致的选中农场缓存 */
 function saveSelectedFarm(farm) {
     const id = farm?.farm_id ?? farm?.id;
@@ -960,6 +968,9 @@ linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 12%)
     .el-date-table td.today .el-date-table-cell__text {
         color: #e8c56a;
     }
+    .el-date-table td.disabled .el-date-table-cell {
+        background-color: #171717;
+    }
 
     .el-date-table td.disabled .el-date-table-cell__text {
         color: rgba(255, 255, 255, 0.25);

+ 61 - 66
src/views/old_mini/agri_file/components/patrolPanel.vue

@@ -3,13 +3,8 @@
         <!-- 品种切换 -->
         <div class="variety-bar">
             <div class="variety-bar__tags">
-                <div
-                    v-for="item in zoneList"
-                    :key="item.zone_id"
-                    class="variety-bar__tag"
-                    :class="{ active: item.zone_id === selectedZoneId }"
-                    @click="handleSelectZone(item)"
-                >
+                <div v-for="item in zoneList" :key="item.zone_id" class="variety-bar__tag"
+                    :class="{ active: item.zone_id === selectedZoneId }" @click="handleSelectZone(item)">
                     {{ item.zone_name }}
                 </div>
             </div>
@@ -25,66 +20,59 @@
             <span class="patrol-loading__text">加载中...</span>
         </div> -->
         <div v-loading="loading" element-loading-background="rgba(15, 15, 15, 0.55)" element-loading-text="加载中...">
-            <div
-                v-for="item in patrolList"
-                :key="item.id"
-                class="tracking-item"
-                @click="goGrowthTrack(item)"
-            >
-            <div class="tracking-item__header">
-                <div class="tracking-item__header-left">
-                    <img
-                        class="tracking-item__header-icon"
-                        :src="item.headerIcon || periodIcon"
-                        alt=""
-                    />
-                    <span class="tracking-item__title van-ellipsis">
-                        {{ item.title }}
-                    </span>
-                </div>
-                <div v-if="item.level" class="tracking-item__level" :class="'level-'+item.level_num">
-                    <el-icon><WarningFilled /></el-icon>
-                    <span>{{ item.level }}</span>
+            <div v-for="item in patrolList" :key="item.id" class="tracking-item" @click="goGrowthTrack(item)">
+                <div class="tracking-item__header">
+                    <div class="tracking-item__header-left">
+                        <img class="tracking-item__header-icon" :src="item.headerIcon || periodIcon" alt="" />
+                        <span class="tracking-item__title van-ellipsis">
+                            {{ item.title }}
+                        </span>
+                    </div>
+                    <div v-if="item.level" class="tracking-item__level" :class="'level-' + item.level_num">
+                        <el-icon>
+                            <WarningFilled />
+                        </el-icon>
+                        <span>{{ item.level }}</span>
+                    </div>
                 </div>
-            </div>
-            <div class="tracking-item__body">
-                <img class="tracking-item__thumb" :src="item.icon" alt="" />
-                <div class="tracking-item__content">
-                    <div class="tracking-item__subject van-ellipsis">{{ item.subject }}</div>
-                    <div class="tracking-item__issue">{{ item.issue || item.desc }}</div>
-                    <div
-                        class="tracking-item__urgency"
-                        :class="`tracking-item__urgency--${item.urgencyTone || 'danger'}`"
-                    >
-                        <img
-                            v-if="item.urgencyIcon"
-                            class="tracking-item__urgency-icon"
-                            :src="item.urgencyIcon"
-                            alt=""
-                        />
-                        <el-icon v-else><Clock /></el-icon>
-                        <span>{{ item.urgencyText || "建议 24 小时内处理" }}</span>
+                <div class="tracking-item__body">
+                    <img class="tracking-item__thumb" :src="item.icon" alt="" />
+                    <div class="tracking-item__content">
+                        <div class="tracking-item__subject van-ellipsis">{{ item.subject }}</div>
+                        <div class="tracking-item__issue">{{ item.issue || item.desc }}</div>
+                        <div class="tracking-item__urgency"
+                            :class="`tracking-item__urgency--${item.urgencyTone || 'danger'}`">
+                            <img v-if="item.urgencyIcon" class="tracking-item__urgency-icon" :src="item.urgencyIcon"
+                                alt="" />
+                            <el-icon v-else>
+                                <Clock />
+                            </el-icon>
+                            <span>{{ item.urgencyText || "建议 24 小时内处理" }}</span>
+                        </div>
                     </div>
                 </div>
-            </div>
-            <div class="tracking-item__footer">
-                <div class="tracking-item__actions">
-                    <div class="tracking-item__action" @click.stop="handleShare(item)">
-                        <Icon size="14" color="rgba(255,255,255,0.75)" name="share" />
-                        <span>{{ t("agriFile.forward") }}</span>
+                <div class="tracking-item__footer">
+                    <div class="tracking-item__actions">
+                        <div class="tracking-item__action" @click.stop="handleShare(item)">
+                            <Icon size="14" color="rgba(255,255,255,0.75)" name="share" />
+                            <span>{{ t("agriFile.forward") }}</span>
+                        </div>
+                        <span class="tracking-item__divider"></span>
+                        <div class="tracking-item__action" @click.stop="handleUploadClick(item)">
+                            <el-icon>
+                                <Camera />
+                            </el-icon>
+                            <span>上传巡园照片</span>
+                        </div>
                     </div>
-                    <span class="tracking-item__divider"></span>
-                    <div class="tracking-item__action" @click.stop="handleUploadClick(item)">
-                        <el-icon><Camera /></el-icon>
-                        <span>上传巡园照片</span>
+                    <div class="tracking-item__detail-btn" @click.stop="goGrowthTrack(item)">
+                        进入详情 <el-icon>
+                            <ArrowRightBold />
+                        </el-icon>
                     </div>
                 </div>
-                <div class="tracking-item__detail-btn" @click.stop="goGrowthTrack(item)">
-                    进入详情 <el-icon><ArrowRightBold /></el-icon>
-                </div>
             </div>
         </div>
-    </div>
         <div class="crop-archive">
             <!-- <div class="crop-archive__title">{{ t("agriFile.cropArchive") }}</div> -->
             <PhenologyTrackTimelineItem theme="dark" :list="cropArchiveList" />
@@ -195,8 +183,8 @@ const mapSectionToPatrol = (section = {}, type, ctx = {}) => {
     const title = isSoil
         ? "土壤根系感知"
         : isGrowth
-          ? t("agriFile.patrolGrowthTitle")
-          : t("agriFile.patrolAbnormalTitle");
+            ? t("agriFile.patrolGrowthTitle")
+            : t("agriFile.patrolAbnormalTitle");
     const subject =
         section.title ||
         section.interact_title ||
@@ -216,8 +204,8 @@ const mapSectionToPatrol = (section = {}, type, ctx = {}) => {
         (isSoil
             ? "土壤含水率偏高 · 已持续 5 天"
             : isGrowth
-              ? "最佳窗口待确认"
-              : "建议 24 小时内处理");
+                ? "最佳窗口待确认"
+                : "建议 24 小时内处理");
     const urgencyTone = isSoil ? "warn" : isGrowth ? "success" : "danger";
     const urgencyIcon = isSoil ? waterUrgencyIcon : isGrowth ? calendarUrgencyIcon : "";
     const headerIcon = isSoil ? soilIcon : isGrowth ? periodIcon : lightningIcon;
@@ -385,7 +373,7 @@ const fetchCropArchive = async () => {
         const list = [];
         for (const zone of zones) {
             const records = Array.isArray(zone.records) ? zone.records : [];
-            const zoneName = zone.crop_variety || zone.zone_name || String(zone.zone_id ?? "");
+            const zoneName = zone.zone_name || zone.crop_variety || String(zone.zone_id ?? "");
             for (const item of records) {
                 list.push(mapPhenoRecordToArchive(item, cursor, zoneName));
                 cursor += 1;
@@ -439,8 +427,8 @@ const goGrowthTrack = (item) => {
         type === "soil"
             ? "/soil_root_track"
             : type === "abnormal"
-              ? "/abnormal_track"
-              : "/growth_track";
+                ? "/abnormal_track"
+                : "/growth_track";
     router.push({
         path,
         query: {
@@ -589,6 +577,11 @@ defineExpose({
 <style lang="scss" scoped>
 .patrol-panel {
     padding-top: 8px;
+
+    .crop-archive {
+        margin-top: 16px;
+    }
+
     .variety-bar {
         display: flex;
         align-items: center;
@@ -738,11 +731,13 @@ defineExpose({
                 background-color: rgba(255, 212, 137, 0.16);
                 color: #FFD489;
             }
+
             &.level-2 {
                 border-color: rgba(255, 127, 20, 0.4);
                 background-color: rgba(255, 127, 20, 0.18);
                 color: #FF9B47;
             }
+
             &.level-3 {
                 border-color: rgba(126, 35, 33, 0.2);
                 background-color: rgba(126, 35, 33, 0.2);

+ 68 - 25
src/views/old_mini/agri_file/pages/regionAlbums.vue

@@ -71,6 +71,20 @@
             @confirm="handleUploadConfirm"
         />
 
+        <tip-popup
+            v-model:show="showSuccessPopup"
+            type="executeSuccess"
+            text="您已上传成功"
+            text2="诊断报告正在生成,请稍后..."
+            hideBtn
+        >
+            <template #footer>
+                <div class="bottom-btn-container">
+                    <div class="bottom-btn primary-btn" @click="handleComplete">完成</div>
+                </div>
+            </template>
+        </tip-popup>
+
         <RegionNamePopup
             v-model:show="showRenamePopup"
             theme="dark"
@@ -100,6 +114,7 @@ import { ArrowLeftBold, EditPen, Plus } from "@element-plus/icons-vue";
 import { base_img_url2, resize_300 } from "@/api/config";
 import { useI18n } from "@/i18n";
 import ImagePreviewPopup from "@/components/popup/ImagePreviewPopup.vue";
+import tipPopup from "@/components/popup/tipPopup.vue";
 import RegionNamePopup from "@/views/old_mini/recordDetails/components/RegionNamePopup.vue";
 import albumUploadPopup from "../components/albumUploadPopup.vue";
 
@@ -116,15 +131,11 @@ const showPreview = ref(false);
 const previewImages = ref([]);
 const previewIndex = ref(0);
 const showUploadPopup = ref(false);
+const showSuccessPopup = ref(false);
 const showRenamePopup = ref(false);
-/** 本地重命名(接口暂无改分区名能力),按 farm+zone 缓存 */
-const renamedZoneName = ref("");
 
 const farmId = computed(() => route.query.farm_id || "");
 const zoneId = computed(() => route.query.zone_id || "");
-const renameStorageKey = computed(
-    () => `REGION_ALBUMS_ZONE_NAME_${farmId.value}_${zoneId.value}`
-);
 
 const getSelectedFarm = () => {
     try {
@@ -135,11 +146,7 @@ const getSelectedFarm = () => {
 };
 
 const regionName = computed(
-    () =>
-        renamedZoneName.value ||
-        zoneNameFromApi.value ||
-        route.query.name ||
-        t("agriFile.zoneOne")
+    () => zoneNameFromApi.value || route.query.name || t("agriFile.zoneOne")
 );
 
 const totalCount = computed(() => imageCount.value);
@@ -272,28 +279,37 @@ const handleRemarkConfirm = ({ index, remark, image }) => {
     }
 };
 
-const readRenamedZoneName = () => {
-    try {
-        return localStorage.getItem(renameStorageKey.value) || "";
-    } catch {
-        return "";
-    }
-};
-
 const handleEditName = () => {
     showRenamePopup.value = true;
 };
 
-const handleRenameConfirm = (name) => {
+/** 修改分区名称:questionnaire/update_zone_name(zone_id / zone_name / farm_id) */
+const handleRenameConfirm = async (name) => {
     const next = String(name || "").trim();
     if (!next || next === regionName.value) return;
-    renamedZoneName.value = next;
+    const farm = getSelectedFarm();
+    const farmIdVal = farmId.value || farm.farm_id || farm.id || "";
+    const zoneIdVal = zoneId.value || farm.zone_id || farm.zoneId || "";
+    if (!farmIdVal || !zoneIdVal) {
+        ElMessage.warning("缺少农场或地块信息");
+        return;
+    }
     try {
-        localStorage.setItem(renameStorageKey.value, next);
+        const res = await VE_API.pheno.updateZoneName({
+            zone_id: zoneIdVal,
+            zone_name: next,
+            farm_id: farmIdVal,
+        });
+        if (res?.code === 200) {
+            // 先行更新标题,下次 fetchAlbumImages 会以服务端返回为准
+            zoneNameFromApi.value = next;
+            ElMessage.success(res?.msg || "修改成功");
+            return;
+        }
+        ElMessage.error(res?.msg || "修改失败,请稍后再试");
     } catch {
-        // ignore
+        ElMessage.error("修改失败,请稍后再试");
     }
-    ElMessage.success("修改成功");
 };
 
 const handleAdd = () => {
@@ -324,6 +340,7 @@ const handleUploadConfirm = async ({ images, date } = {}) => {
         });
         if (res?.code === 200) {
             await fetchAlbumImages();
+            showSuccessPopup.value = true;
             return;
         }
         ElMessage.error(res?.msg || "上传失败,请稍后再试");
@@ -332,13 +349,15 @@ const handleUploadConfirm = async ({ images, date } = {}) => {
     }
 };
 
+const handleComplete = () => {
+    showSuccessPopup.value = false;
+};
+
 const goBack = () => {
     router.back();
 };
 
 const syncAlbumByRoute = () => {
-    // 切换分区时重置并读取该分区的本地重命名
-    renamedZoneName.value = readRenamedZoneName();
     fetchAlbumImages();
 };
 
@@ -516,6 +535,30 @@ linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 72.1
     }
 }
 
+.bottom-btn-container {
+    display: flex;
+    justify-content: space-between;
+    gap: 12px;
+    width: 100%;
+
+    .bottom-btn {
+        padding: 0 25px;
+        border-radius: 4px;
+        font-size: 16px;
+        height: 40px;
+        line-height: 40px;
+        box-sizing: border-box;
+        font-weight: 500;
+        text-align: center;
+
+        &.primary-btn {
+            flex: 1;
+            background: linear-gradient(90deg, #FFEBC9 0%, #FFCA6D 100%);
+            color: #1A1408;
+        }
+    }
+}
+
 .album-group {
     & + & {
         margin-top: 18px;

+ 32 - 8
src/views/old_mini/entry_information/components/baInformation.vue

@@ -55,7 +55,7 @@
 </template>
 
 <script setup>
-import { nextTick, onActivated, onBeforeUnmount, onMounted, ref } from "vue";
+import { nextTick, onActivated, onBeforeUnmount, onMounted, ref, watch } from "vue";
 import { useRouter } from "vue-router";
 import { useStore } from "vuex";
 import { ElMessage } from "element-plus";
@@ -85,6 +85,8 @@ const farmName = ref("");
 const locationAddress = ref("");
 const locationPoint = ref("");
 const locationAdcode = ref("");
+/** 市+区县(county_address),建档接口提交用 */
+const locationCountyAddress = ref("");
 let previewMap = null;
 let addressReqId = 0;
 
@@ -112,10 +114,11 @@ function toPointWkt(coordinate) {
     return `POINT(${Number(coordinate[0])} ${Number(coordinate[1])})`;
 }
 
-function saveLocation(point, coordinate, address = "", adcode = "") {
+function saveLocation(point, coordinate, address = "", adcode = "", countyAddress = "") {
     locationPoint.value = point;
     if (address) locationAddress.value = address;
     if (adcode) locationAdcode.value = adcode;
+    if (countyAddress) locationCountyAddress.value = countyAddress;
     sessionStorage.setItem(
         LOCATION_KEY,
         JSON.stringify({
@@ -125,6 +128,7 @@ function saveLocation(point, coordinate, address = "", adcode = "") {
                 : convertPointToArray(point).map(Number),
             adcode: locationAdcode.value || "",
             address: locationAddress.value || "",
+            county_address: locationCountyAddress.value || "",
         })
     );
 }
@@ -146,7 +150,8 @@ async function fetchLocationAddress(point) {
         const adcode = result?.ad_info?.adcode;
         locationAddress.value = address || locationAddress.value;
         locationAdcode.value = adcode != null && adcode !== "" ? String(adcode) : locationAdcode.value;
-        saveLocation(point, coordinate, locationAddress.value, locationAdcode.value);
+        locationCountyAddress.value = result?.county_address || locationCountyAddress.value;
+        saveLocation(point, coordinate, locationAddress.value, locationAdcode.value, locationCountyAddress.value);
     } catch {
         // 逆地理失败时保留已有文案
     }
@@ -197,22 +202,35 @@ function initPreviewMap(point) {
     refreshMapSize();
 }
 
-function applyPoint(point, address = "", adcode = "") {
+function applyPoint(point, address = "", adcode = "", countyAddress = "") {
     if (!point) return;
     locationPoint.value = point;
     if (address) locationAddress.value = address;
     if (adcode) locationAdcode.value = String(adcode);
+    if (countyAddress) locationCountyAddress.value = String(countyAddress);
     nextTick(() => {
         initPreviewMap(point);
         if (!address) fetchLocationAddress(point);
-        else saveLocation(point, convertPointToArray(point), address, adcode);
+        else
+            saveLocation(
+                point,
+                convertPointToArray(point),
+                address,
+                adcode,
+                countyAddress
+            );
     });
 }
 
 function syncLocationFromSession() {
     const saved = readJson(LOCATION_KEY);
     if (saved?.point) {
-        applyPoint(saved.point, saved.address || "", saved.adcode || "");
+        applyPoint(
+            saved.point,
+            saved.address || "",
+            saved.adcode || "",
+            saved.county_address || ""
+        );
         return;
     }
     applyPoint(getDefaultPoint());
@@ -235,6 +253,11 @@ function saveFormDraft() {
     );
 }
 
+/** 输入即存草稿:即使没点「确认信息」就离开,回来也能恢复 */
+watch(farmName, () => {
+    saveFormDraft();
+});
+
 // ---------------------------------------------------------------------------
 // 事件处理 / 生命周期
 // ---------------------------------------------------------------------------
@@ -269,8 +292,9 @@ const handleNext = () => {
 };
 
 onMounted(() => {
-    // restoreFormDraft();
-    // syncLocationFromSession();
+    // 步骤用 v-if 切换,「上一步」回到本页是重新挂载,必须在 mounted 里恢复草稿
+    restoreFormDraft();
+    syncLocationFromSession();
 });
 
 onActivated(() => {

+ 2 - 0
src/views/old_mini/entry_information/components/selectCategory.vue

@@ -658,6 +658,8 @@ function buildFarmPayload(crop, variety) {
         user_id: getUserId(),
         farm_location: farmLocation,
         farm_address: location?.address || "",
+        /** 市+区县,来源:搜索选址 / 逆地理(tiandituLocation.county_address) */
+        county_address: location?.county_address || "",
         crop_big_type: detail.crop_group || crop.firstCrop || "",
         crops: [
             {

+ 12 - 3
src/views/old_mini/entry_information/selectLocation.vue

@@ -58,6 +58,8 @@ const userLocation = ref(
 const selectedAdcode = ref("");
 /** 搜索选中时带出的地址文案 */
 const selectedAddress = ref("");
+/** 搜索选中时带出的市+区县(county_address),建档接口用 */
+const selectedCountyAddress = ref("");
 
 const selectLocationMap = new SelectLocationMap({
     iconSrc,
@@ -83,7 +85,7 @@ function toPointWkt(coordinate) {
 }
 
 async function fetchLocationInfoByCoordinate(coordinate) {
-    if (!coordinate?.length) return { adcode: "", address: "" };
+    if (!coordinate?.length) return { adcode: "", address: "", county_address: "" };
     try {
         const { result } = await fetchRegeo({ lng: coordinate[0], lat: coordinate[1] });
         const adcode = result?.ad_info?.adcode;
@@ -96,9 +98,10 @@ async function fetchLocationInfoByCoordinate(coordinate) {
         return {
             adcode: adcode != null && adcode !== "" ? String(adcode) : "",
             address: address || "",
+            county_address: result?.county_address || "",
         };
     } catch {
-        return { adcode: "", address: "" };
+        return { adcode: "", address: "", county_address: "" };
     }
 }
 
@@ -115,16 +118,19 @@ const handleLocationChange = (payload) => {
     if (!payload?.coordinateArray) {
         selectedAdcode.value = "";
         selectedAddress.value = "";
+        selectedCountyAddress.value = "";
         return;
     }
     selectedAdcode.value = payload.adcode ? String(payload.adcode) : "";
     selectedAddress.value = payload.address || payload.pointAddress || "";
+    selectedCountyAddress.value = payload.county_address || payload.city || "";
     selectLocationMap.setMapPosition(payload.coordinateArray);
 };
 
 const handleLocate = () => {
     selectedAdcode.value = "";
     selectedAddress.value = "";
+    selectedCountyAddress.value = "";
     const point =
         localStorage.getItem("MINI_USER_LOCATION_POINT") ||
         store.state.home.miniUserLocationPoint ||
@@ -144,16 +150,19 @@ const handleSubmit = async () => {
     const point = toPointWkt(coordinate);
     let adcode = selectedAdcode.value;
     let address = selectedAddress.value;
-    if (!adcode || !address) {
+    let countyAddress = selectedCountyAddress.value;
+    if (!adcode || !address || !countyAddress) {
         const info = await fetchLocationInfoByCoordinate(coordinate);
         if (!adcode) adcode = info.adcode;
         if (!address) address = info.address;
+        if (!countyAddress) countyAddress = info.county_address;
     }
     const payload = {
         point,
         coordinate: [Number(coordinate[0]), Number(coordinate[1])],
         adcode: adcode || "",
         address: address || "",
+        county_address: countyAddress || "",
     };
     sessionStorage.setItem(sessionKey, JSON.stringify(payload));
     router.back();

+ 7 - 0
src/views/old_mini/growth_report/index.vue

@@ -502,6 +502,13 @@ const handleZoneChange = (zoneId) => {
 };
 
 async function getLocationName(point = currentMapPoint.value) {
+    // 已选农场且带 county_address:直接使用,不再请求逆地理
+    const farm = getSelectedFarm();
+    const farmCountyAddress = String(farm?.county_address ?? "").trim();
+    if (hasSelectedFarm() && farmCountyAddress) {
+        locationName.value = farmCountyAddress;
+        return;
+    }
     let locationParam = "";
     // 无农场:逆地理用登录点 MINI_USER_LOCATION(lng,lat)
     if (!hasSelectedFarm()) {