Explorar o código

feat:修改bug

wangsisi hai 1 día
pai
achega
87f3575999

+ 30 - 0
src/components/pageComponents/ArchivesFarmTimeLine.vue

@@ -995,6 +995,34 @@ const phenologyHasFarmWorkOnOrBeforeToday = (phenology) => {
     return reproductives.some((r) => reproductiveHasFarmWorkOnOrBeforeToday(r));
 };
 
+// 该生育期下:存在农事且「凡有有效展示日期的卡片」全部严格晚于今天 → 左侧本行不因节气规则变蓝(与右侧 future-card 一致)
+const reproductiveAllDatedFarmWorksStrictlyFuture = (reproductive) => {
+    const fws = Array.isArray(reproductive?.farmWorkArrangeList) ? reproductive.farmWorkArrangeList : [];
+    if (fws.length === 0) return false;
+    const dated = fws.filter((fw) => {
+        const ms = getFarmWorkTimelineDateMs(fw);
+        return !Number.isNaN(ms) && ms > 0;
+    });
+    if (dated.length === 0) return false;
+    return dated.every((fw) => isFarmWorkTimelineStrictlyFuture(fw));
+};
+
+// 物候期内:至少有一条农事带有效日期,且全部带有效日期的农事均为「严格未来」(无一 ≤ 今天)→ 最外层标题不因节气单独变蓝
+const phenologyAllDatedFarmWorksStrictlyFuture = (phenology) => {
+    const reproductives = Array.isArray(phenology?.reproductiveList) ? phenology.reproductiveList : [];
+    let anyDated = false;
+    for (const r of reproductives) {
+        const fws = Array.isArray(r?.farmWorkArrangeList) ? r.farmWorkArrangeList : [];
+        for (const fw of fws) {
+            const ms = getFarmWorkTimelineDateMs(fw);
+            if (Number.isNaN(ms) || ms <= 0) continue;
+            anyDated = true;
+            if (isFarmWorkDateOnOrBeforeToday(ms)) return false;
+        }
+    }
+    return anyDated;
+};
+
 // 仅农事记录页(agri_record):该物候期内存在待认证农事时,左侧最外层物候期与各生育期/物候期文案均高亮为蓝;农事规划(agri_plan)不生效
 const agriRecordHasPendingAuthInPhenology = (phenology) => {
     if (props.pageType !== "agri_record") return false;
@@ -1061,6 +1089,7 @@ const shouldShowBlueBase = (phenology) => {
 const shouldShowBlue = (phenology) => {
     if (phenologyHasFarmWorkOnOrBeforeToday(phenology)) return true;
     if (agriRecordHasPendingAuthInPhenology(phenology)) return true;
+    if (phenologyAllDatedFarmWorksStrictlyFuture(phenology)) return false;
     return shouldShowBlueBase(phenology);
 };
 
@@ -1068,6 +1097,7 @@ const shouldShowBlue = (phenology) => {
 const shouldShowBlueLeft = (phenology, reproductive) => {
     if (agriRecordHasPendingAuthInPhenology(phenology)) return true;
     if (reproductiveHasFarmWorkOnOrBeforeToday(reproductive)) return true;
+    if (reproductiveAllDatedFarmWorksStrictlyFuture(reproductive)) return false;
     return shouldShowBlueBase(phenology);
 };
 

+ 14 - 8
src/views/old_mini/interactionList/index.vue

@@ -121,7 +121,7 @@
                     </div>
 
                     <!-- 输入框 -->
-                    <div class="input-wrapper">
+                    <div class="input-wrapper" v-if="item.questionStatus === 3 || item.replyText">
                         <el-input v-model="item.replyText" :disabled="item.questionStatus !== 3" placeholder="请输入您咨询的问题"
                             clearable />
                     </div>
@@ -156,12 +156,17 @@
                 <div class="proportion-info" v-show="item.questionStatus !== 3"
                     :style="{ justifyContent: item.expanded ? 'center' : 'space-between' }">
                     <template v-if="!item.expanded">
-                        <span class="proportion-text">{{(item.questionList && item.questionList.length
-                            ? item.questionList.map((q, i) => q + ':' + (item.answerValues[i] ?? '') +
-                                (item.indicators[i]?.unit
-                                    ?? item.indicators[0]?.unit ?? '%')).join('')
-                            : item.question + ':' + (item.answerValues[0] ?? '') + (item.indicators[0]?.unit ?? '%'))
-                        }}</span>
+                        <template v-if="!item.isConfirmed && item.questionStatus === 2">
+                            <span class="proportion-text">{{(item.questionList && item.questionList.length
+                                ? item.questionList.map((q, i) => q + ':' + (item.answerValues[i] ?? '') +
+                                    (item.indicators[i]?.unit
+                                        ?? item.indicators[0]?.unit ?? '%')).join('')
+                                : item.question + ':' + (item.answerValues[0] ?? '') + (item.indicators[0]?.unit ?? '%'))
+                            }}</span>
+                        </template>
+                        <template v-else>
+                            <span class="proportion-text">{{ item.cancelButtonName }}</span>
+                        </template>
                     </template>
                     <div class="toggle-btn" @click="toggleExpand(item)">
                         <span>{{ item.expanded ? "收起" : "展开" }}</span>
@@ -615,7 +620,8 @@ const handleConfirm = async (item, isConfirm) => {
         interactionId: item.id,
         replyText: item.replyText,
         answerValues: item.answerValues,
-        regionId: ''
+        regionId: '',
+        isConfirmed: isConfirm ? true : false
     }
     const key = getItemSubmitKey(item);
     const submitKind = isConfirm ? "confirm" : "cancel";