瀏覽代碼

fix:修改bug

wangsisi 3 天之前
父節點
當前提交
680d6cd0a5

+ 24 - 2
src/components/pageComponents/FarmWorkPlanTimeline.vue

@@ -413,6 +413,12 @@ const getArrangeStatusClass = (fw) => {
 };
 
 const handleRowClick = (item) => {
+    // 记录当前页面滚动位置
+    if (timelineContainerRef.value) {
+        const scrollTop = timelineContainerRef.value.scrollTop || 0;
+        sessionStorage.setItem('timelineScrollTop', scrollTop.toString());
+    }
+    
     item.isEdit = shouldShowIncompleteStatus(item.farmWorkId);
     item.invalidIds = invalidIds.value;
     item.invalidArr = invalidArr.value;
@@ -522,8 +528,24 @@ const getFarmWorkPlan = () => {
                                         handleSeasonClick(currentSeason);
                                         isInitialLoad.value = false;
                                     }, 200);
-                                } else if (timelineContainerRef.value && savedScrollTop > 0) {
-                                    timelineContainerRef.value.scrollTop = savedScrollTop;
+                                } else {
+                                    // 尝试恢复之前保存的滚动位置
+                                    const savedScrollTopFromStorage = sessionStorage.getItem('timelineScrollTop');
+                                    if (savedScrollTopFromStorage) {
+                                        // 等待 DOM 完全渲染后再恢复滚动位置
+                                        nextTick(() => {
+                                            requestAnimationFrame(() => {
+                                                if (timelineContainerRef.value) {
+                                                    const scrollTop = Number(savedScrollTopFromStorage);
+                                                    timelineContainerRef.value.scrollTop = scrollTop;
+                                                    // 恢复后清除保存的位置,避免下次误恢复
+                                                    sessionStorage.removeItem('timelineScrollTop');
+                                                }
+                                            });
+                                        });
+                                    } else if (timelineContainerRef.value && savedScrollTop > 0) {
+                                        timelineContainerRef.value.scrollTop = savedScrollTop;
+                                    }
                                 }
                             });
                         });

+ 2 - 2
src/views/old_mini/mine/pages/message.vue

@@ -1,6 +1,6 @@
 <template>
     <div class="message-page">
-        <custom-header name="我的消息" bgColor="#f7f7f7"></custom-header>
+        <custom-header name="系统提醒" bgColor="#f7f7f7"></custom-header>
         <List
             v-model:loading="loading"
             :finished="finished"
@@ -12,7 +12,7 @@
                 <div class="message-item" v-for="(item, index) in messageList" :key="index" @click="handleItem(item)">
                     <el-badge class="badge" is-dot v-if="!item.status"> </el-badge>
                     <div class="message-content">
-                        <div class="title">{{ item.title }}</div>
+                        <div class="title">收到来自{{ item.farmData?.farmName }}的{{ item.farmData?.farmWorkName }}农事提醒</div>
                         <div class="desc">{{ item.desc }}</div>
                         <div class="footer">
                             <div class="footer-left">

+ 4 - 4
src/views/old_mini/modify_work/completedWork.vue

@@ -220,13 +220,13 @@
             </div>
 
             <!-- 农资,步骤:农资已执行,请求确认 -->
-            <div class="fixed-btn-wrap" :class="{ 'center': !getButtonText() }" v-if="curRole == 2 && !detailData?.expectedExecuteDate">
+            <div class="fixed-btn-wrap center" v-if="curRole == 2 && !detailData?.expectedExecuteDate">
                 <div class="fixed-btn orange primary-text" @click="handleRemindExecuteTime" v-if="getButtonText()">提醒确认执行时间</div>
-                <div class="fixed-btn orange" @click="selectExecuteTime">确认执行时间</div>
+                <div class="fixed-btn orange" v-else @click="selectExecuteTime">确认执行时间</div>
             </div>
-            <div class="fixed-btn-wrap" :class="{ 'center': !getButtonText() }" v-if="curRole == 2 && detailData?.expectedExecuteDate">
+            <div class="fixed-btn-wrap center" v-if="curRole == 2 && detailData?.expectedExecuteDate">
                 <div class="fixed-btn primary primary-text width-120" @click="handleExecute" v-if="getButtonText()">提醒执行</div>
-                <div class="fixed-btn primary" @click="showOfferPopup(detailData)">上传照片</div>
+                <div class="fixed-btn primary" v-else @click="showOfferPopup(detailData)">上传照片</div>
             </div>
 
             <!-- 农资,步骤:农事已确认 -->

+ 13 - 5
src/views/old_mini/modify_work/reviewWork.vue

@@ -57,7 +57,7 @@
                 <div class="info-box subject-content">
                     <div class="subject-box">
                         <div class="subject-item cost-l">
-                            <img class="subject-img" src="@/assets/img/home/nz.png" alt="" />
+                            <img class="subject-img" :src="workItem.agriculturalIcon" alt="" />
                             <div class="subject-tag">
                                 {{ workItem.serviceMain }}
                             </div>
@@ -246,9 +246,11 @@
             </div>
 
             <div class="fixed-btn-wrap" :class="{ center: !paramsPage.isBtn && !getButtonText() }">
-                    <div class="fixed-btn more" @click="handleMore" v-if="paramsPage.isBtn">查看更多农事</div>
-                    <div class="fixed-btn more" @click="handleRemindUser" v-if="getButtonText() && !paramsPage.isBtn">提醒复核</div>
-                    <div class="fixed-btn excute" @click="generateReport">生成成果报告</div>
+                <div class="fixed-btn-wrap-left">
+                    <div class="fixed-btn more second" @click="handleRemindUser" v-if="getButtonText()">提醒复核</div>
+                    <div class="fixed-btn more" @click="handleMore" v-if="paramsPage.isBtn">更多农事</div>
+                </div>
+                <div class="fixed-btn excute" @click="generateReport">生成成果报告</div>
             </div>
             <div
                 class="fixed-btn-wrap center"
@@ -379,7 +381,7 @@ onActivated(() => {
 });
 
 const getButtonText = () => {
-    return (agriculturalRole.value === 1 || workItem.value.executorUserId != userId.value) && !workItem.value?.reviewImage?.length;
+    return (agriculturalRole.value === 1 || (agriculturalRole.value === 2 && workItem.value.executorUserId != userId.value)) && !workItem.value?.reviewImage?.length;
 };
 
 const getDetail = () => {
@@ -662,6 +664,11 @@ const handleUpload = ({ imgArr }) => {
             justify-content: space-between;
             background: #fff;
             box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.4);
+            .fixed-btn-wrap-left{
+                display: flex;
+                align-items: center;
+                gap: 10px;
+            }
             &.center {
                 justify-content: center;
             }
@@ -690,6 +697,7 @@ const handleUpload = ({ imgArr }) => {
                     background: #ffffff;
                     border: 1px solid rgba(153, 153, 153, 0.5);
                     color: #666666;
+                    width: 100px;
                 }
                 &.second {
                     background: #ffffff;

+ 3 - 4
src/views/old_mini/monitor/subPages/plan.vue

@@ -337,8 +337,6 @@ const getFarmWorkPlanForPhenology = async () => {
                     });
                 }
             });
-
-            await getPhenologyList(containerSpaceTimeId.value);
         }
     } catch (error) {
         console.error("获取农事规划数据失败:", error);
@@ -349,7 +347,7 @@ const getFarmWorkPlanForPhenology = async () => {
 const showCopyPlan = ref(false);
 const showPhenologySetting = ref(false);
 const copyPlanName = ref("");
-const openCopyPlanPopup = () => {
+const openCopyPlanPopup = async () => {
     copyPlanName.value = "";
     showCopyPlan.value = true;
     if (active.value !== tabs.value[0]?.id) {
@@ -358,7 +356,8 @@ const openCopyPlanPopup = () => {
 };
 
 // 物候期设置弹窗
-const handlePhenologySetting = () => {
+const handlePhenologySetting = async () => {
+    await getPhenologyList();
     showPhenologySetting.value = true;
 };
 

+ 1 - 1
src/views/old_mini/task_condition/components/interact.vue

@@ -507,7 +507,7 @@ function handleRemindCustomer(item) {
                     display: flex;
                     align-items: center;
                     .farm-name{
-                        width: calc(100% - 133px);
+                        max-width: calc(100% - 133px);
                     }
                     .info-tag-wrap {
                         margin-left: 10px;

+ 5 - 1
src/views/old_mini/task_condition/components/task.vue

@@ -466,9 +466,13 @@ const onConfirmExecuteTime = (date) => {
 
 // 获取上传按钮的文本(计算属性方式)
 const getButtonText = (item) => {
-    return agriculturalRole.value === 1 || item.executorUserId != userId.value;
+    return agriculturalRole.value === 1 || (agriculturalRole.value === 2 && item.executorUserId != userId.value);
 };
 
+// const isShowPermission = (item) => {
+//     return agriculturalRole.value === 1 || agriculturalRole.value === 2 || item.executorUserId === userId.value;
+// };
+
 const priceSheetPopupRef = ref(null);
 const showPriceSheetPopup = (item) => {
     VE_API.z_farm_work_record.getDetail({ id: item.id }).then(({ data }) => {