lxf 3 дней назад
Родитель
Сommit
bff7ce507b

+ 1 - 1
src/api/modules/report.js

@@ -3,7 +3,7 @@ const config = require("../config")
 module.exports = {
     // 今日巡园重点
     todayPatrolFocus: {
-        url: config.base_dev_url + "container_phenology_interaction/todayPatrolFocus",
+        url: config.base_dev_url + "container_phenology_interaction/todayFocus",
         type: "get",
     },
     // 待执行农事

+ 15 - 9
src/components/popup/agriExecutePopup.vue

@@ -1,15 +1,18 @@
 <template>
     <popup v-model:show="showValue" round class="agri-execute-popup" :z-index="zIndex" teleport="body">
         <div class="popup-content">
-            <div class="popup-tips">为了处方体系更加适应您当前的果园管理</div>
             <!-- 头部区域 -->
             <div class="popup-header">
-                <img class="expert-logo" :src="popupData?.expertAvatar" alt="" />
+                <img class="expert-logo" src="@/assets/img/home/bird.png" alt="" />
+                <!-- <img class="expert-logo" :src="popupData?.expertAvatar" alt="" /> -->
                 <div class="expert-info">
-                    <span>{{ popupData?.expertName || "韦帮稳" }}专家</span>
+                    <!-- <span>{{ popupData?.expertName || "韦帮稳" }}专家</span> -->
+                    <span>飞鸟</span>
                     <span class="invite-text">邀请您进行农情互动</span>
                 </div>
             </div>
+            <div class="popup-tips">为了更好校准您的农事执行时间</div>
+
 
             <!-- 标题 -->
             <div class="popup-title">{{ popupData.subjectName }}</div>
@@ -102,7 +105,8 @@ defineExpose({
     }
 
     .popup-tips {
-        color: rgba(93, 93, 93, 0.8);
+        color: #000;
+        font-size: 16px;
         margin-bottom: 5px;
     }
 
@@ -113,24 +117,26 @@ defineExpose({
         gap: 6px;
 
         .expert-logo {
-            width: 26px;
-            height: 26px;
+            width: 22px;
+            height: 22px;
             border-radius: 50%;
             object-fit: cover;
         }
 
         .expert-info {
-            font-size: 16px;
+            font-size: 12px;
+            color: #000;
 
             .invite-text {
                 margin-left: 6px;
+                color: rgba(0, 0, 0, 0.4);
             }
         }
     }
 
     .popup-title {
         font-size: 26px;
-        margin-bottom: 14px;
+        // margin-bottom: 14px;
         font-family: "PangMenZhengDao";
         color: #0785E8;
     }
@@ -142,7 +148,7 @@ defineExpose({
         padding: 3px 9px 9px;
         border-radius: 8px;
         position: relative;
-        margin-top: 5px;
+        margin-top: 15px;
 
         // 三角形小尖尖
         &::before {

+ 13 - 7
src/components/popup/startInteractPopup.vue

@@ -7,16 +7,19 @@
         z-index="9999"
     >
         <div class="popup-content">
-            <div class="popup-tips">为了处方体系更加适应您当前的果园管理</div>
             <!-- 头部区域 -->
             <div class="popup-header">
-                <img class="expert-logo" :src="popupData?.expertAvatar" alt="" />
+                <img class="expert-logo" src="@/assets/img/home/bird.png" alt="" />
+                <!-- <img class="expert-logo" :src="popupData?.expertAvatar" alt="" /> -->
                 <!-- <el-avatar :size="26" :src="popupData?.expertAvatar" /> -->
                 <div class="expert-info">
-                    <span>{{ popupData?.expertName || "韦帮稳" }}专家</span>
+                    <!-- <span>{{ popupData?.expertName || "韦帮稳" }}专家</span> -->
+                    <span>飞鸟</span>
                     <span class="invite-text">邀请您进行农情互动</span>
                 </div>
             </div>
+            <div class="popup-tips">为了将农事方案与您的品种匹配,请您录入品种信息</div>
+
 
             <!-- 标题 -->
             <div class="popup-title">农情互动</div>
@@ -87,7 +90,8 @@ defineExpose({
     }
 
     .popup-tips{
-        color: rgba(93, 93, 93, 0.8);
+        color: #000;
+        font-size: 16px;
         margin-bottom: 5px;
     }
 
@@ -97,16 +101,18 @@ defineExpose({
         align-items: center;
         gap: 6px;
         .expert-logo {
-            width: 26px;
-            height: 26px;
+            width: 22px;
+            height: 22px;
             border-radius: 50%;
             object-fit: cover;
         }
 
         .expert-info {
-            font-size: 16px;
+            font-size: 12px;
+            color: #000;
             .invite-text {
                 margin-left: 6px;
+                color: rgba(0, 0, 0, 0.4);
             }
         }
     }

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

@@ -36,7 +36,7 @@
                                         v-for="(card, cardI) in todayPatrolFocus"
                                         :key="cardI"
                                         class="status-card"
-                                        :class="card.type"
+                                        :class="'today-'+card.color"
                                         @click="handleTodayPatrolFocusClick(card)"
                                         >
                                         <!-- <badge class="status-badge" dot 
@@ -202,7 +202,7 @@ const handleMaskClick = () => {
 
 const currentFarmName = ref('');
 // 切换农场时,更新报告数据
-const changeGarden = ({ id, name }) => {
+const changeGarden = async ({ id, name }) => {
     if (!id) return;
     currentFarmName.value = name;
     swipeRef.value && swipeRef.value.swipeTo(0, {immediate:true});
@@ -213,10 +213,7 @@ const changeGarden = ({ id, name }) => {
     };
     // 初始化品种/大物候期转换
     startInteractPopupRef.value.getPhenologyInitOrConfirmStatus();
-    getRegions();
-    if(regionsData.value.length && !route.query.hideInteraction) {
-        agriExecutePopupRef.value.showPopup(regionsData.value[currentIndex.value].farmId);
-    }
+    await getRegions();
 };
 
 onActivated(() => {
@@ -286,7 +283,8 @@ const handlePendingFarmWorkClick = (card) => {
 }
 // 点击今日巡园重点
 const handleTodayPatrolFocusClick = (card) => {
-    router.push(`/interaction_list?farmId=${paramsPage.value.farmId}&regionId=${paramsPage.value.regionId}&interactionTypeId=${card.interactionTypeId || 1}`);
+    if (!card.interactionTypeId) return;
+    router.push(`/interaction_list?farmId=${paramsPage.value.farmId}&regionId=${paramsPage.value.regionId}&interactionTypeId=${card.interactionTypeId}`);
 }
 
 const getTodayPatrolFocus = () => {
@@ -342,6 +340,12 @@ const getRegions = async () => {
                 localStorage.setItem(guideKey, "1");
             }
             hasReport.value = true;
+
+            // 如果不是点击农情报告已生成弹窗过来的,则显示农情互动弹窗
+            if(!route.query.hideInteraction) {
+                agriExecutePopupRef.value.showPopup(regionsData.value[currentIndex.value].farmId);
+            }
+
             paramsPage.value = {
                 ...(paramsPage.value || {}),
                 farmId: regionsData.value[currentIndex.value].farmId,
@@ -785,6 +789,14 @@ linear-gradient(0deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2));
                     align-items: center;
                     justify-content: center;
 
+                    &.today-red {
+                        background: #FF6A6A;
+                        color: #fff;
+                        .status-sub {
+                            color: #fff;
+                        }
+                    }
+
                     &.pending-card {
                         color: #fff;
                         position: relative;

+ 22 - 3
src/views/old_mini/interaction/index.vue

@@ -44,7 +44,8 @@
                     <div class="field-row">
                         <div class="field-label">当下物候期</div>
                         <div class="field-value">
-                            <el-select v-model="region.phenologyId" class="select-input" placeholder="选择物候期">
+                            <el-select
+                            v-model="region.phenologyId" @change="handlePhenologyChange(crop, region)" class="select-input" placeholder="选择物候期">
                                 <el-option v-for="(item, index) in crop.phenologyOptions" :key="index"
                                     :label="item.phenologyName" :value="item.phenologyId" />
                             </el-select>
@@ -202,11 +203,29 @@ const getPhenologyLabel = (farm, phenologyId) => {
     return found?.startDateLabel || "选择时间";
 };
 
-// 禁用今天之后的日期:只能选择今天及之前
+const getStartDate = (farm, phenologyId) => {
+    if (!farm?.phenologyOptions) return "";
+    const found = farm.phenologyOptions.find(
+        (item) => item.id === phenologyId || item.phenologyId === phenologyId
+    );
+    return found?.startDate || "";
+};
+
+const handlePhenologyChange = (crop, region) => {
+    region.phenologyStartDate = getStartDate(crop, region.phenologyId);
+};
+
+// 禁用今天之后的日期;最早只能选到前 3 个月
 const disabledFutureDate = (time) => {
     const today = new Date();
     today.setHours(0, 0, 0, 0);
-    return time.getTime() > today.getTime();
+
+    // 三个月前的同一天(简单按 3 个月回退)
+    const threeMonthsAgo = new Date(today);
+    threeMonthsAgo.setMonth(threeMonthsAgo.getMonth() - 3);
+
+    const t = time.getTime();
+    return t > today.getTime() || t < threeMonthsAgo.getTime();
 };
 
 const showTipPopup = ref(false);