浏览代码

feat:对接果园报告接口和农情动态接口

wangsisi 2 周之前
父节点
当前提交
1def4f3609

+ 5 - 0
src/api/modules/home.js

@@ -63,4 +63,9 @@ module.exports = {
         url: config.base_dev_url + "work_code/phenology/quest/popupByAgriculturalUserFarms",
         url: config.base_dev_url + "work_code/phenology/quest/popupByAgriculturalUserFarms",
         type: "get",
         type: "get",
     },
     },
+    //预警 气象 农事 专家问答 分页列表
+    warningPageList: {
+        url: config.base_dev_url + "bbs_post/page/{page}/{limit}",
+        type: "get",
+    },
 }
 }

+ 5 - 0
src/api/modules/monitor.js

@@ -33,4 +33,9 @@ module.exports = {
         url: config.base_dev_url + "z_agricultural_store_farm/receive",
         url: config.base_dev_url + "z_agricultural_store_farm/receive",
         type: "post",
         type: "post",
     },
     },
+    //农场作用域:获取讲述信息接口(根据farmId、regionId、varietyId)
+    getFarmSpeakInfo: {
+        url: config.base_dev_url + "container_phenology_sample_files_speak_title/getFarmSpeakInfo",
+        type: "get",
+    },
 }
 }

二进制
src/assets/img/home/ns.png


+ 1 - 1
src/components/detailDialog.vue

@@ -52,7 +52,7 @@
                                             <div class="td">{{ subP.typeName }}</div>
                                             <div class="td">{{ subP.typeName }}</div>
                                             <div class="td width">{{ subP.name }}</div>
                                             <div class="td width">{{ subP.name }}</div>
                                             <div class="td">{{ subP.ratio }}</div>
                                             <div class="td">{{ subP.ratio }}</div>
-                                            <div class="td">--</div>
+                                            <div class="td">人工</div>
                                         </div>
                                         </div>
                                     </div>
                                     </div>
                                 </div>
                                 </div>

+ 27 - 3
src/components/popup/activeUploadPopup.vue

@@ -27,7 +27,7 @@
             <img class="example" src="@/assets/img/home/example-4.png" alt="" />
             <img class="example" src="@/assets/img/home/example-4.png" alt="" />
             <img class="example" src="@/assets/img/home/plus.png" alt="" />
             <img class="example" src="@/assets/img/home/plus.png" alt="" />
         </upload>
         </upload>
-        <div class="btn" @click="handleUpload">确认</div>
+        <div class="btn" :class="{ 'disabled': isUploading }" @click="handleUpload">{{ isUploading ? '提交中...' : '确认' }}</div>
     </popup>
     </popup>
 
 
     <!-- 上传成功提示弹窗 -->
     <!-- 上传成功提示弹窗 -->
@@ -54,6 +54,7 @@ const images = ref([]);
 const uploadDate = ref("");
 const uploadDate = ref("");
 const problemTitle = ref("请选择问题");
 const problemTitle = ref("请选择问题");
 const successShow = ref(false);
 const successShow = ref(false);
+const isUploading = ref(false); // 标记是否正在上传中
 onMounted(() => {
 onMounted(() => {
     eventBus.off("upload:changeArr", uploadChange);
     eventBus.off("upload:changeArr", uploadChange);
     eventBus.on("upload:changeArr", uploadChange);
     eventBus.on("upload:changeArr", uploadChange);
@@ -78,10 +79,12 @@ function handleShow({ gardenIdVal, problemTitleVal, typeVal ,arrangeIdVal}) {
     images.value = [];
     images.value = [];
     gardenId.value = gardenIdVal;
     gardenId.value = gardenIdVal;
     problemTitle.value = problemTitleVal || "请选择问题";
     problemTitle.value = problemTitleVal || "请选择问题";
-    uploadDate.value = formatDate(new Date());
+    uploadDate.value = (new Date());
     show.value = true;
     show.value = true;
     type.value = typeVal;
     type.value = typeVal;
     arrangeId.value = arrangeIdVal;
     arrangeId.value = arrangeIdVal;
+    // 重置上传状态
+    isUploading.value = false;
 }
 }
 
 
 function handleSuccess() {
 function handleSuccess() {
@@ -91,11 +94,14 @@ function handleSuccess() {
 const emit = defineEmits(["handleUploadSuccess"]);
 const emit = defineEmits(["handleUploadSuccess"]);
 
 
 const handleUpload = () => {
 const handleUpload = () => {
+    // 如果正在上传中,直接返回,防止重复调用
+    if (isUploading.value) return;
+    
     if (images.value.length === 0) return ElMessage.warning("请上传图片");
     if (images.value.length === 0) return ElMessage.warning("请上传图片");
     const paramsObj = {
     const paramsObj = {
         farmId: gardenId.value,
         farmId: gardenId.value,
         arrangeId: arrangeId.value,
         arrangeId: arrangeId.value,
-        executeDate: uploadDate.value,
+        executeDate: formatDate(uploadDate.value),
         imagePaths: images.value,
         imagePaths: images.value,
     };
     };
     if(type.value === "question"){
     if(type.value === "question"){
@@ -107,6 +113,12 @@ const handleUpload = () => {
 };
 };
 
 
 function triggerFarmWork(paramsObj,showSuccess) {
 function triggerFarmWork(paramsObj,showSuccess) {
+    // 如果正在上传中,直接返回,防止重复调用
+    if (isUploading.value) return;
+    
+    // 设置上传状态为 true
+    isUploading.value = true;
+    
     VE_API.monitor.triggerFarmWork(paramsObj).then((res) => {
     VE_API.monitor.triggerFarmWork(paramsObj).then((res) => {
         if (res.code === 0) {
         if (res.code === 0) {
             if(showSuccess){
             if(showSuccess){
@@ -115,6 +127,11 @@ function triggerFarmWork(paramsObj,showSuccess) {
                 emit("handleUploadSuccess", paramsObj);
                 emit("handleUploadSuccess", paramsObj);
             }
             }
         }
         }
+    }).catch((error) => {
+        console.error("触发农事失败:", error);
+    }).finally(() => {
+        // 无论成功或失败,都重置上传状态
+        isUploading.value = false;
     });
     });
 }
 }
 
 
@@ -188,6 +205,13 @@ onUnmounted(() => {
     color: #fff;
     color: #fff;
     font-size: 16px;
     font-size: 16px;
     text-align: center;
     text-align: center;
+    cursor: pointer;
+    transition: opacity 0.3s;
+    &.disabled {
+        opacity: 0.6;
+        cursor: not-allowed;
+        pointer-events: none;
+    }
 }
 }
 
 
 .success-popup {
 .success-popup {

+ 8 - 1
src/views/old_mini/agri_services/components/farmDynamics.vue

@@ -83,7 +83,7 @@
     <!-- 需求发送成功弹窗 -->
     <!-- 需求发送成功弹窗 -->
     <tip-popup v-model:show="showApplyPopup" type="success" text="需求发送成功" />
     <tip-popup v-model:show="showApplyPopup" type="success" text="需求发送成功" />
     <!-- 发起需求成功弹窗 -->
     <!-- 发起需求成功弹窗 -->
-    <fn-share-sheet class="share-sheet" v-model:show="showShare" @select="onSelect" :options="options" />
+    <fn-share-sheet :class="type === 'manage' ? '' : 'share-sheet'" v-model:show="showShare" @select="onSelect" :options="options" />
     <!-- 提醒对方执行弹窗 -->
     <!-- 提醒对方执行弹窗 -->
     <upload-execute ref="uploadExecuteRef" onlyShare />
     <upload-execute ref="uploadExecuteRef" onlyShare />
     <!-- 上传照片弹窗 -->
     <!-- 上传照片弹窗 -->
@@ -104,6 +104,13 @@ import { base_img_url2 } from "@/api/config";
 import reviewUploadPopup from "@/components/popup/reviewUploadPopup.vue";
 import reviewUploadPopup from "@/components/popup/reviewUploadPopup.vue";
 const router = useRouter();
 const router = useRouter();
 
 
+const props = defineProps({
+    type: {
+        type: String,
+        default: "",
+    },
+});
+
 const handleConfirmComplete = (section) => {
 const handleConfirmComplete = (section) => {
     ElMessage.warning("该功能正在升级中,敬请期待");
     ElMessage.warning("该功能正在升级中,敬请期待");
 };
 };

+ 1 - 1
src/views/old_mini/agri_services/index.vue

@@ -10,7 +10,7 @@
             </tab>
             </tab>
         </tabs>
         </tabs>
         <div v-else class="farm-dynamics-container">
         <div v-else class="farm-dynamics-container">
-            <farm-dynamics  />
+            <farm-dynamics :type="type" />
         </div>
         </div>
     </div>
     </div>
 </template>
 </template>

+ 1 - 2
src/views/old_mini/chat_frame/index.vue

@@ -34,8 +34,7 @@ onActivated(() => {
 
 
 function headerCallBack() {
 function headerCallBack() {
     const page = sessionStorage.getItem('chat_frame_page');
     const page = sessionStorage.getItem('chat_frame_page');
-    console.log('page', page);
-    if(page === 'messageList') {
+    if(page === 'messageList' || page === 'monitor') {
         VE_API.bbs.readUpdate({ targetUserId: userIdVal.value, farmId: route.query.farmId }).then((res) => {
         VE_API.bbs.readUpdate({ targetUserId: userIdVal.value, farmId: route.query.farmId }).then((res) => {
             if (res.code === 0) {
             if (res.code === 0) {
                 sessionStorage.removeItem('chat_frame_page');
                 sessionStorage.removeItem('chat_frame_page');

+ 79 - 112
src/views/old_mini/home/components/AgriculturalDynamics.vue

@@ -5,12 +5,12 @@
 
 
         <!-- 标签页导航 -->
         <!-- 标签页导航 -->
         <div class="tab-nav">
         <div class="tab-nav">
-            <div 
-                v-for="tab in tabs" 
-                :key="tab.value" 
-                class="tab-item" 
-                :class="{ active: activeTab === tab.value }" 
-                @click="activeTab = tab.value"
+            <div
+                v-for="tab in tabs"
+                :key="tab.value"
+                class="tab-item"
+                :class="{ active: activeTab === tab.value }"
+                @click="handleTabClick(tab.value)"
             >
             >
                 {{ tab.label }}
                 {{ tab.label }}
             </div>
             </div>
@@ -18,68 +18,36 @@
 
 
         <!-- 内容区域 -->
         <!-- 内容区域 -->
         <div class="content-area">
         <div class="content-area">
-            <!-- 气象预警内容 -->
-            <div v-if="activeTab === 'weather'" class="content-list">
-                <div 
-                    v-for="(item, index) in weatherList" 
-                    :key="index" 
-                    class="content-item"
-                    @click="handleItem(item)"
-                >
+            <!-- 气象预警内容/农事预警内容 -->
+            <div v-if="activeTab !== 4" class="content-list">
+                <div v-for="(item, index) in warningList" :key="index" class="content-item" @click="handleItem(item)">
                     <div class="item-image">
                     <div class="item-image">
-                        <img :src="require('@/assets/img/home/baoyu.jpg')" :alt="item.alt" />
+                        <img :src="item.media[0]" />
                     </div>
                     </div>
                     <div class="item-content">
                     <div class="item-content">
-                        <div class="item-text">{{ item.text }}</div>
-                        <div class="item-date">{{ item.date }}</div>
-                    </div>
-                </div>
-            </div>
-
-            <!-- 农事预警内容 -->
-            <div v-if="activeTab === 'agricultural'" class="content-list">
-                <div 
-                    v-for="(item, index) in agriculturalList" 
-                    :key="index" 
-                    class="content-item"
-                    @click="handleItem(item)"
-                >
-                    <div class="item-image">
-                        <img :src="require('@/assets/img/home/ns.png')" :alt="item.alt" />
-                    </div>
-                    <div class="item-content">
-                        <div class="item-text">{{ item.text }}</div>
-                        <div class="item-date">{{ item.date }}</div>
+                        <div class="item-text van-ellipsis" v-html="item.content"></div>
+                        <div class="item-date">{{ item.createTime.slice(0, 10)  }}</div>
                     </div>
                     </div>
                 </div>
                 </div>
             </div>
             </div>
 
 
             <!-- 专家问答内容 -->
             <!-- 专家问答内容 -->
-            <div v-if="activeTab === 'expert'" class="content-list expert-qa">
-                <div 
-                    v-for="(item, index) in expertQAList" 
-                    :key="index" 
-                    class="qa-item"
-                    @click="handleItem(item)"
-                >
+            <div v-else class="content-list expert-qa">
+                <div v-for="(item, index) in expertQAList" :key="index" class="qa-item" @click="handleItem(item)">
                     <div class="question-header">
                     <div class="question-header">
-                        <img class="question-icon" src="@/assets/img/home/ask-icon.png" alt="">
-                        <div class="question-title">{{ item.question }}</div>
+                        <img class="question-icon" src="@/assets/img/home/ask-icon.png" alt="" />
+                        <div class="question-title">{{ item.title }}</div>
                     </div>
                     </div>
                     <div class="expert-info">
                     <div class="expert-info">
-                        <el-avatar
-                            class="expert-avatar"
-                            :size="16"
-                            :src="item.expertAvatar"
-                        />
+                        <el-avatar class="expert-avatar" :size="16" src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png" />
                         <div class="expert-details">
                         <div class="expert-details">
-                            <span class="expert-name">{{ item.expertName }}</span>
+                            <span class="expert-name">{{ item.name }}</span>
                             <span class="expert-title">{{ item.expertTitle }}</span>
                             <span class="expert-title">{{ item.expertTitle }}</span>
-                            <span class="qa-date">{{ item.date }}</span>
+                            <span class="qa-date">{{ item.createTime.slice(0, 10) }}</span>
                         </div>
                         </div>
                     </div>
                     </div>
                     <div class="answer-content">
                     <div class="answer-content">
-                        {{ item.answer }}
+                        {{ item.content }}
                     </div>
                     </div>
                 </div>
                 </div>
             </div>
             </div>
@@ -88,66 +56,55 @@
 </template>
 </template>
 
 
 <script setup>
 <script setup>
-import { ref } from "vue";
+import { ref, onMounted } from "vue";
 import { useRouter } from "vue-router";
 import { useRouter } from "vue-router";
 
 
 const router = useRouter();
 const router = useRouter();
-const activeTab = ref("weather");
+const activeTab = ref(2);
 
 
 const tabs = [
 const tabs = [
-    { label: "气象预警", value: "weather" },
-    { label: "农事预警", value: "agricultural" },
-    { label: "专家问答", value: "expert" }
+    { label: "气象预警", value: 2 },
+    { label: "农事预警", value: 3 },
+    { label: "专家问答", value: 4 },
 ];
 ];
 
 
-// 气象预警数据
-const weatherList = ref([
-    {
-        image: "@/assets/img/home/baoyu.jpg",
-        alt: "气象预警",
-        text: "周边3km出现了暴雨预警, 请注意防范!",
-        date: "2025-10-10"
-    },
-]);
-
-// 农事预警数据
-const agriculturalList = ref([
-    {
-        image: "@/assets/img/home/banner.png",
-        alt: "农事预警",
-        text: "建议进行病虫害防治, 注意观察作物生长情况",
-        date: "2025-9-11"
-    }
-]);
+// 气象/农事预警数据
+const warningList = ref([]);
 
 
 // 专家问答数据
 // 专家问答数据
-const expertQAList = ref([
-    {
-        question: "怎么预估我的果园的今年荔枝的产量?",
-        expertName: "高小波",
-        expertTitle: "华南农业大学农业专家",
-        expertAvatar: "https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png",
-        date: "2024.11.01",
-        answer: "遇雨补喷: 选择在无风或微风天气进行, 以减少药物的漂移, 如果喷药后4小时内遇到雨水冲刷, 应重新..."
-    },
-    {
-        question: "果树病虫害防治的最佳时间是什么时候?",
-        expertName: "李教授",
-        expertTitle: "中国农业大学植保专家",
-        expertAvatar: "https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png",
-        date: "2024.10.28",
-        answer: "春季萌芽前是防治病虫害的关键时期, 建议在3月下旬至4月上旬进行第一次全面喷药..."
-    }
-]);
-
-const handleItem = (item) => {
-    console.log(item);
-    if(activeTab.value === 'expert'){
-        router.push('/expert_detail')
-    }else{
-        router.push('/warning_detail')
+const expertQAList = ref([]);
+
+const handleTabClick = (value) => {
+    activeTab.value = value;
+    getWarningList();
+};
+
+const handleItem = () => {
+    if (activeTab.value === 4) {
+        router.push("/expert_detail");
+    } else {
+        router.push("/warning_detail");
     }
     }
-}
+};
+
+onMounted(() => {
+    getWarningList();
+});
+
+const getWarningList = () => {
+    const params = {
+        page: 1,
+        limit: 10,
+        topicId: activeTab.value,
+    };
+    VE_API.home.warningPageList(params).then((res) => {
+        if(activeTab.value === 4){
+            expertQAList.value = res.data || [];
+        }else{
+            warningList.value = res.data || [];
+        }
+    });
+};
 </script>
 </script>
 
 
 <style scoped lang="scss">
 <style scoped lang="scss">
@@ -157,7 +114,7 @@ const handleItem = (item) => {
     .title {
     .title {
         font-size: 16px;
         font-size: 16px;
         font-weight: bold;
         font-weight: bold;
-        color: #1D2129;
+        color: #1d2129;
         margin-bottom: 16px;
         margin-bottom: 16px;
     }
     }
 
 
@@ -169,8 +126,8 @@ const handleItem = (item) => {
             margin-right: 20px;
             margin-right: 20px;
             padding-bottom: 6px;
             padding-bottom: 6px;
             &.active {
             &.active {
-                color: #2199F8;
-                border-bottom: 2px solid #2199F8;
+                color: #2199f8;
+                border-bottom: 2px solid #2199f8;
             }
             }
         }
         }
     }
     }
@@ -180,6 +137,7 @@ const handleItem = (item) => {
             .content-item {
             .content-item {
                 display: flex;
                 display: flex;
                 align-items: center;
                 align-items: center;
+                overflow-x: hidden;
                 .item-image {
                 .item-image {
                     width: 114px;
                     width: 114px;
                     height: 74px;
                     height: 74px;
@@ -196,19 +154,28 @@ const handleItem = (item) => {
 
 
                 .item-content {
                 .item-content {
                     flex: 1;
                     flex: 1;
+                    display: flex;
+                    flex-direction: column;
+                    justify-content: space-between;
+                    height: 68px;
+                    max-width: calc(100% - 130px);
 
 
                     .item-text {
                     .item-text {
-                        color: #1D2129;
-                        margin-bottom: 10px;
+                        color: #1d2129;
+                        ::v-deep {
+                            p{
+                                margin: 0;
+                            }
+                        }
                     }
                     }
 
 
                     .item-date {
                     .item-date {
-                        color: #86909C;
+                        color: #86909c;
                         font-size: 13px;
                         font-size: 13px;
                     }
                     }
                 }
                 }
             }
             }
-            .content-item + .content-item{
+            .content-item + .content-item {
                 margin-top: 12px;
                 margin-top: 12px;
             }
             }
 
 
@@ -250,12 +217,12 @@ const handleItem = (item) => {
 
 
                     .answer-content {
                     .answer-content {
                         color: #333333;
                         color: #333333;
-                        .font-bold{
+                        .font-bold {
                             font-weight: 500;
                             font-weight: 500;
                         }
                         }
-        }
+                    }
                 }
                 }
-                .qa-item + .qa-item{
+                .qa-item + .qa-item {
                     margin-top: 16px;
                     margin-top: 16px;
                 }
                 }
             }
             }

+ 3 - 3
src/views/old_mini/home/components/problemReminder.vue

@@ -176,11 +176,11 @@ function onBottomOptionClick(opt) {
             typeVal: "question",
             typeVal: "question",
         });
         });
     } else {
     } else {
-        saveQuestPopup();
+        saveQuestPopup(opt.label);
     }
     }
 }
 }
 
 
-function saveQuestPopup() {
+function saveQuestPopup(label) {
     const agriDate = getTodayStr();
     const agriDate = getTodayStr();
     const params = {
     const params = {
         farmId: farmIdVal.value,
         farmId: farmIdVal.value,
@@ -193,7 +193,7 @@ function saveQuestPopup() {
     VE_API.home.saveQuestPopup(params).then((res) => {
     VE_API.home.saveQuestPopup(params).then((res) => {
         if (res.code === 0) {
         if (res.code === 0) {
             show.value = false;
             show.value = false;
-            if (optValue.value != 1) {
+            if (optValue.value != 1 && label != '未知') {
                 noShow.value = true;
                 noShow.value = true;
             }
             }
         }
         }

+ 1 - 1
src/views/old_mini/home/subPages/expertList.vue

@@ -98,7 +98,7 @@
 <script setup>
 <script setup>
 import customHeader from "@/components/customHeader.vue";
 import customHeader from "@/components/customHeader.vue";
 import { Empty } from "vant";
 import { Empty } from "vant";
-import { onActivated, onMounted, ref } from "vue";
+import { onMounted, ref } from "vue";
 import { useRouter, useRoute } from "vue-router";
 import { useRouter, useRoute } from "vue-router";
 import { useStore } from "vuex";
 import { useStore } from "vuex";
 import { ElMessage } from "element-plus";
 import { ElMessage } from "element-plus";

+ 7 - 12
src/views/old_mini/modify_work/completedWork.vue

@@ -584,10 +584,7 @@ const showUploadExecutePopup = () => {
         onlyShare.value = false;
         onlyShare.value = false;
     }
     }
     setTimeout(() => {
     setTimeout(() => {
-        console.log('parmasPage.value', parmasPage.value);
-        if(parmasPage.value.farmMiniUserId){
-            uploadExecuteRef.value.showPopup(parmasPage.value);
-        }
+        uploadExecuteRef.value.showPopup(parmasPage.value);
     }, 10);
     }, 10);
 };
 };
 
 
@@ -617,14 +614,6 @@ onActivated(async () => {
         //查询农场现状信息
         //查询农场现状信息
         getFarmWorkArrangeDetail(detailData.value.farmWorkArrangeId);
         getFarmWorkArrangeDetail(detailData.value.farmWorkArrangeId);
     }
     }
-    parmasPage.value = {
-        farmMiniUserId: curRole.value == 2 ? detailData.value.farmMiniUserId : detailData.value.users[0]?.userId,
-        farmWorkOrderId: detailData.value.orderId,
-        farmId: detailData.value.farmId,
-        executeEvidence: JSON.stringify(detailData.value.executeEvidence),
-        farmWorkName: detailData.value.farmWorkName,
-        id: detailData.value.id,
-    };
     if (query.value?.farmWorkOrderId || detailData.value?.flowStatus === 4) {
     if (query.value?.farmWorkOrderId || detailData.value?.flowStatus === 4) {
         const farmWorkOrderId = query.value?.farmWorkOrderId || detailData.value.orderId;
         const farmWorkOrderId = query.value?.farmWorkOrderId || detailData.value.orderId;
         let priceDataObj = {};
         let priceDataObj = {};
@@ -804,6 +793,12 @@ const getDetail = async (id) => {
     if (data && data.length > 0) {
     if (data && data.length > 0) {
         detailData.value = data[0];
         detailData.value = data[0];
         currentStep.value = getCurrentStep(detailData.value.flowStatus);
         currentStep.value = getCurrentStep(detailData.value.flowStatus);
+        parmasPage.value = {
+            ...detailData.value,
+            farmMiniUserId: curRole.value == 2 ? detailData.value.farmMiniUserId : detailData.value.users[0]?.userId,
+            farmWorkOrderId: detailData.value.orderId,
+            executeEvidence: JSON.stringify(detailData.value.executeEvidence),
+        };
     }
     }
 };
 };
 
 

+ 1 - 1
src/views/old_mini/monitor/index.vue

@@ -397,7 +397,7 @@ function handlePage(url) {
         farmId: gardenId.value,
         farmId: gardenId.value,
     }
     }
     if(url === '/message_list') {
     if(url === '/message_list') {
-        query.from = route.query.from || 'monitor';
+        query.from = 'monitor';
     }
     }
     router.push({
     router.push({
         path: url,
         path: url,

+ 1 - 1
src/views/old_mini/monitor/subPages/reviewResults.vue

@@ -134,7 +134,7 @@ onMounted(() => {
     resetAndLoad();
     resetAndLoad();
 });
 });
 
 
-const handleClick = (section, index) => {
+const handleClick = (section) => {
     router.push({
     router.push({
         path: "/review_work",
         path: "/review_work",
         query: {
         query: {

+ 150 - 84
src/views/old_mini/report_detail/index.vue

@@ -1,12 +1,12 @@
 <template>
 <template>
     <div class="report-detail-page">
     <div class="report-detail-page">
-        <custom-header name="农场报告"></custom-header>
+        <custom-header name="农场报告" :isClose="!isMiniPage ? false : true"></custom-header>
         <div class="report-content">
         <div class="report-content">
             <div class="report-header">
             <div class="report-header">
-                <el-select class="header-item" v-model="value" placeholder="Select" style="width: 240px">
+                <el-select class="header-item" v-model="value" placeholder="时间筛选" style="width: 240px">
                     <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
                     <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
                 </el-select>
                 </el-select>
-                <el-select class="header-item" v-model="value1" placeholder="Select" style="width: 240px">
+                <el-select class="header-item" v-model="value1" placeholder="区域筛选" style="width: 240px">
                     <el-option v-for="item in options1" :key="item.value" :label="item.label" :value="item.value" />
                     <el-option v-for="item in options1" :key="item.value" :label="item.label" :value="item.value" />
                 </el-select>
                 </el-select>
             </div>
             </div>
@@ -56,41 +56,61 @@
                 </tab> -->
                 </tab> -->
                 <tab title="营养管理" class="tab-item">
                 <tab title="营养管理" class="tab-item">
                     <div class="item-title">营养管理</div>
                     <div class="item-title">营养管理</div>
-                    <div class="item-content">
-                        <div class="item-name">根肥</div>
-                        <div class="item-value">
-                            透光率体现树体自身郁闭程度,当前XX%的树体透光性较差,可能造成整体减产XX%,需立即执行剪枝农事;XX%的树体透光正常,建议继续保持现有管理措施并及时巡园。
-                        </div>
-                        <div class="map-wrap">
-                            <!-- <img class="map-img" src="@/assets/img/home/map.png" alt="" /> -->
-                            <!-- <div class="map-text">根肥农事地图</div> -->
+                    <template v-if="nutritionManagementInfo && nutritionManagementInfo.length > 0">
+                        <div class="item-content" v-for="item in nutritionManagementInfo" :key="item.id">
+                            <!-- <div class="item-name">根肥</div> -->
+                            <div class="item-value">
+                                {{ item.content.renderedContent }}
+                            </div>
+                            <!-- <div class="map-wrap">
+                            <img class="map-img" src="@/assets/img/home/map.png" alt="" />
+                            <div class="map-text">根肥农事地图</div>
+                        </div> -->
                         </div>
                         </div>
-                    </div>
+                    </template>
+                    <div class="item-content" v-else>暂无数据</div>
                 </tab>
                 </tab>
                 <tab title="病虫管理" class="tab-item">
                 <tab title="病虫管理" class="tab-item">
                     <div class="item-title">病虫管理</div>
                     <div class="item-title">病虫管理</div>
-                    <div class="item-content">
-                        <div class="item-value">
-                            透光率体现树体自身郁闭程度,当前XX%的树体透光性较差,可能造成整体减产XX%,需立即执行剪枝农事;XX%的树体透光正常,建议继续保持现有管理措施并及时巡园。
-                        </div>
-                        <div class="map-wrap">
-                            <!-- <img class="map-img" src="@/assets/img/home/map.png" alt="" /> -->
-                            <!-- <div class="map-text">防虫农事地图</div> -->
+                    <template v-if="pestManagementInfo && pestManagementInfo.length > 0">
+                        <div class="item-content" v-for="item in pestManagementInfo" :key="item.id">
+                            <div class="item-value">
+                                {{ item.content.renderedContent }}
+                            </div>
+                            <!-- <div class="map-wrap">
+                            <img class="map-img" src="@/assets/img/home/map.png" alt="" />
+                            <div class="map-text">防虫农事地图</div>
+                        </div> -->
                         </div>
                         </div>
-                    </div>
+                    </template>
+                    <div class="item-content" v-else>暂无数据</div>
                 </tab>
                 </tab>
                 <tab title="农事记录" class="tab-item">
                 <tab title="农事记录" class="tab-item">
                     <div class="item-title">农事记录</div>
                     <div class="item-title">农事记录</div>
-                    <div class="item-content">
-                        暂无数据
-                    </div>
+                    <template v-if="contentData && contentData.length > 0">
+                        <div v-for="(section, index) in contentData" :key="index" class="item-farm">
+                            <record-item
+                                :record-item-data="section"
+                                content-mode="serviceDetail"
+                                title-mode="default"
+                                class="recipe-item"
+                                titleRightDotText="全区"
+                                titleRightType="dot"
+                                showFarmImage
+                                @click="handleClick(section, index)"
+                            >
+                            </record-item>
+                        </div>
+                        <div class="view-more" @click.stop="handleSeeMore">查看更多</div>
+                    </template>
+                    <div class="item-content" v-else>暂无数据</div>
                 </tab>
                 </tab>
             </tabs>
             </tabs>
         </div>
         </div>
         <!-- 底部 -->
         <!-- 底部 -->
-        <div class="fixed-bottom">
-            <div class="btn bottom-l " @click="sharePopup">保存报告</div>
-            <div class="btn bottom-r">转发报告</div>
+        <div class="custom-bottom-fixed-btns">
+            <!-- <div class="bottom-btn secondary-btn" @click="sharePopup">保存报告</div> -->
+            <div class="bottom-btn primary-btn" @click="shareReport">转发报告</div>
         </div>
         </div>
     </div>
     </div>
     <!-- 报告弹窗 -->
     <!-- 报告弹窗 -->
@@ -100,44 +120,98 @@
 <script setup>
 <script setup>
 import customHeader from "@/components/customHeader.vue";
 import customHeader from "@/components/customHeader.vue";
 import { Tab, Tabs } from "vant";
 import { Tab, Tabs } from "vant";
-import { ref } from "vue";
+import wx from "weixin-js-sdk";
+import { ref, onMounted } from "vue";
+import recordItem from "@/components/recordItem.vue";
 import reportPopup from "@/components/reportPopup.vue";
 import reportPopup from "@/components/reportPopup.vue";
-import { useRouter } from "vue-router";
+import { useRouter, useRoute } from "vue-router";
+
+const route = useRoute();
+const farmId = ref(null);
+const isMiniPage = ref(false);
+onMounted(() => {
+    if(route.query.farmId){
+        farmId.value = route.query.farmId;
+    }
+    if(route.query.json){
+        isMiniPage.value = true;
+        const json = JSON.parse(route.query.json);
+        farmId.value = json.farmId;
+    }
+    getFarmSpeakInfo();
+    getFarmWorkList();
+});
+
+const pestManagementInfo = ref([]);
+const nutritionManagementInfo = ref([]);
+
+const getFarmSpeakInfo = () => {
+    VE_API.monitor.getFarmSpeakInfo({ farmId: farmId.value, code: "病虫管理" }).then((res) => {
+        pestManagementInfo.value = res.data || [];
+    });
+
+    VE_API.monitor.getFarmSpeakInfo({ farmId: farmId.value, code: "营养管理" }).then((res) => {
+        nutritionManagementInfo.value = res.data || [];
+    });
+};
+
+const contentData = ref([]);
+const getFarmWorkList = () => {
+    const params = {
+        farmId: farmId.value,
+        flowStatus: 5,
+        page: 1,
+        limit: 5,
+    };
+    VE_API.user.getDetailList(params).then((res) => {
+        contentData.value = res.data || [];
+    });
+};
 
 
 const router = useRouter();
 const router = useRouter();
 
 
-const value = ref("Option1");
-const options = [
-    {
-        value: "Option1",
-        label: "时间筛选",
-    },
-    {
-        value: "Option2",
-        label: "Option2",
-    },
-];
-const value1 = ref("Option1");
+const value = ref("");
+const options = [];
+const value1 = ref("");
 const options1 = [
 const options1 = [
     {
     {
         value: "Option1",
         value: "Option1",
-        label: "区域筛选",
-    },
-    {
-        value: "Option2",
-        label: "Option2",
+        label: "全区",
     },
     },
 ];
 ];
 
 
 const active = ref(0);
 const active = ref(0);
 
 
 const reportPopupRef = ref(null);
 const reportPopupRef = ref(null);
+-+
 function sharePopup() {
 function sharePopup() {
     reportPopupRef.value.handleShow();
     reportPopupRef.value.handleShow();
 }
 }
 
 
 const handleSeeMore = () => {
 const handleSeeMore = () => {
-    router.push("/farm_photo");
+    router.push("/review-results?farmId=" + farmId.value);
+};
+
+const handleClick = (section) => {
+    router.push({
+        path: "/review_work",
+        query: {
+            json: JSON.stringify({ id: section.id, goBack: true }),
+        },
+    });
+};
+
+const shareReport = () => {
+    const query = {
+        askInfo: { title: "分享报告", content: "是否分享该报告给好友" },
+        shareText: "我分享了农场报告,快来查看吧~",
+        farmId: farmId.value,
+        targetUrl: `farm_report`,
+        imageUrl: 'https://birdseye-img.sysuimars.com/birdseye-look-mini/share-lz-bg.png',
+    };
+    wx.miniProgram.navigateTo({
+        url: `/pages/subPages/share_page/index?pageParams=${JSON.stringify(query)}&type=sharePage`,
+    });
 };
 };
 </script>
 </script>
 
 
@@ -147,7 +221,7 @@ const handleSeeMore = () => {
     height: 100vh;
     height: 100vh;
     background-color: #f5f7fb;
     background-color: #f5f7fb;
     .report-content {
     .report-content {
-        height: calc(100% - 40px);
+        height: calc(100% - 40px - 76px);
         overflow: auto;
         overflow: auto;
         padding: 12px;
         padding: 12px;
         box-sizing: border-box;
         box-sizing: border-box;
@@ -157,8 +231,8 @@ const handleSeeMore = () => {
             gap: 10px;
             gap: 10px;
             .header-item {
             .header-item {
                 flex: 1;
                 flex: 1;
-                ::v-deep{
-                    .el-select__wrapper{
+                ::v-deep {
+                    .el-select__wrapper {
                         padding: 5px 0;
                         padding: 5px 0;
                         justify-content: center;
                         justify-content: center;
                         background: #fff;
                         background: #fff;
@@ -171,10 +245,10 @@ const handleSeeMore = () => {
                         position: static;
                         position: static;
                         transform: none;
                         transform: none;
                         width: fit-content;
                         width: fit-content;
-                        color: #4E5969;
+                        color: #4e5969;
                     }
                     }
                     .el-select__caret {
                     .el-select__caret {
-                        color: #4E5969;
+                        color: #4e5969;
                     }
                     }
                 }
                 }
             }
             }
@@ -184,15 +258,15 @@ const handleSeeMore = () => {
             ::v-deep {
             ::v-deep {
                 .van-tabs__nav {
                 .van-tabs__nav {
                     height: 70%;
                     height: 70%;
-                    .van-tab{
-                        border-bottom: 2px solid #E5E6EB;
+                    .van-tab {
+                        border-bottom: 2px solid #e5e6eb;
                     }
                     }
-                    .van-tab--active{
-                        color: #2199F8;
-                        border-bottom: 2px solid #2199F8;
+                    .van-tab--active {
+                        color: #2199f8;
+                        border-bottom: 2px solid #2199f8;
                     }
                     }
                 }
                 }
-                .van-tabs__line{
+                .van-tabs__line {
                     display: none;
                     display: none;
                 }
                 }
             }
             }
@@ -270,39 +344,31 @@ const handleSeeMore = () => {
                         margin-top: 5px;
                         margin-top: 5px;
                     }
                     }
                 }
                 }
+                .item-farm {
+                    margin-top: 10px;
+                    ::v-deep {
+                        .record-item {
+                            margin: 0;
+                            padding: 10px;
+                            background: rgba(238, 238, 238, 0.3);
+                        }
+                    }
+                }
+                .view-more {
+                    margin-top: 10px;
+                    text-align: center;
+                }
             }
             }
             .tab-item + .tab-item {
             .tab-item + .tab-item {
                 margin-top: 10px;
                 margin-top: 10px;
             }
             }
         }
         }
     }
     }
-    .fixed-bottom {
-        position: absolute;
-        bottom: 0;
-        left: 0;
-        width: 100%;
-        display: flex;
-        align-items: center;
-        justify-content: space-between;
-        padding: 15px 12px;
-        background: #fff;
-        box-sizing: border-box;
-        .btn{
-            width: 142px;
-            border-radius: 30px;
-            padding: 10px;
-            box-sizing: border-box;
-            display: flex;
-            align-items: center;
-            justify-content: center;
-        }
-        .bottom-l {
-            border: 1px solid rgba(133, 133, 133, 0.2);
-            color: #666666;
-        }
-        .bottom-r {
-            background: linear-gradient(160deg, #76C3FF, #2199F8);
-            color: #fff;
+    .custom-bottom-fixed-btns {
+        justify-content: center;
+        padding: 16px 12px 20px 12px;
+        .primary-btn {
+            padding: 10px 50px;
         }
         }
     }
     }
 }
 }

+ 0 - 1
src/views/old_mini/task_condition/components/uploadExecute.vue

@@ -75,7 +75,6 @@ function handleConfirm() {
                 const dataItem = data[0];
                 const dataItem = data[0];
                 farmData.value = {
                 farmData.value = {
                     farmMiniUserId: dataItem.farmMiniUserId || (dataItem.users && dataItem.users.length > 0 ? dataItem.users[0]?.userId : null),
                     farmMiniUserId: dataItem.farmMiniUserId || (dataItem.users && dataItem.users.length > 0 ? dataItem.users[0]?.userId : null),
-                    farmMiniUserName: dataItem.farmMiniUserName || dataItem.expertUserName,
                     farmWorkOrderId: dataItem.orderId,
                     farmWorkOrderId: dataItem.orderId,
                     farmId: dataItem.farmId,
                     farmId: dataItem.farmId,
                     executeEvidence:JSON.stringify(dataItem.executeEvidence),
                     executeEvidence:JSON.stringify(dataItem.executeEvidence),