4
0

2 Revīzijas 44bc4b77f7 ... 30ddce1273

Autors SHA1 Ziņojums Datums
  刘秀芳 30ddce1273 Merge branch 'master' of http://www.sysuimars.cn:3000/feiniao/feiniao-farm-h5 1 dienu atpakaļ
  刘秀芳 d6e2cfaa1e feat: 对接农资农事服务 1 dienu atpakaļ

+ 7 - 0
package-lock.json

@@ -40,6 +40,7 @@
         "proj4": "^2.19.10",
         "qs": "^6.11.0",
         "qweather-icons": "^1.6.0",
+        "solarlunar": "^2.0.7",
         "vant": "^4.9.4",
         "vue": "^3.2.13",
         "vue-router": "^4.1.0",
@@ -19087,6 +19088,12 @@
         "npm": ">= 3.0.0"
       }
     },
+    "node_modules/solarlunar": {
+      "version": "2.0.7",
+      "resolved": "https://registry.npmjs.org/solarlunar/-/solarlunar-2.0.7.tgz",
+      "integrity": "sha512-2SfuCCgAAxFU5MTMYuKGbRgRLcPTJQf3azMEw/GmBpHXA7N2eAQJStSqktZJjnq4qRCboBPnqEB866+PCregag==",
+      "license": "ISC"
+    },
     "node_modules/sort-asc": {
       "version": "0.1.0",
       "resolved": "https://registry.npmjs.org/sort-asc/-/sort-asc-0.1.0.tgz",

+ 1 - 0
package.json

@@ -43,6 +43,7 @@
     "proj4": "^2.19.10",
     "qs": "^6.11.0",
     "qweather-icons": "^1.6.0",
+    "solarlunar": "^2.0.7",
     "vant": "^4.9.4",
     "vue": "^3.2.13",
     "vue-router": "^4.1.0",

+ 9 - 0
src/api/modules/z_farm_work_order.js

@@ -0,0 +1,9 @@
+const config = require("../config")
+const url = config.base_dev_url + "z_farm_work_order"
+
+module.exports = {
+    pesticideFertilizersList: {
+        url: url + "/pesticideFertilizers",
+        type: "get",
+    },
+}

+ 13 - 0
src/api/modules/z_farm_work_record.js

@@ -0,0 +1,13 @@
+const config = require("../config")
+const url = config.base_dev_url + "z_farm_work_record"
+
+module.exports = {
+    getSimpleList: {
+        url: url + "/getSimpleList",
+        type: "get",
+    },
+    getDetail: {
+        url: url + "/detail-list",
+        type: "get",
+    },
+}

BIN
src/assets/img/home/qrcode.png


+ 587 - 0
src/components/popup/priceSheetPopup.vue

@@ -0,0 +1,587 @@
+<template>
+    <popup class="price-sheet-popup" v-model:show="showPopup" :close-on-click-overlay="false">
+        <div class="price-sheet-content">
+            <div class="price-sheet-content-inner">
+                <!-- 顶部标题区域 -->
+                <div class="header-section">
+                    <div class="header-left">
+                        <div class="main-title">服务报价单</div>
+                    </div>
+                    <div class="header-right">
+                        <div class="qr-icon">
+                            <img src="@/assets/img/home/qrcode.png" alt="" />
+                        </div>
+                        <div class="qr-text">扫码查看详情</div>
+                    </div>
+                </div>
+                <div class="sheet-content">
+                    
+                    <!-- 报价详情区域 -->
+                    <div class="quotation-info">
+                        <div class="info-item">
+                            <span class="info-label">报价组织</span>
+                            <span class="info-value">{{ quotationData.organization || '河南农资农服组织' }}</span>
+                        </div>
+                        <div class="info-item">
+                            <span class="info-label">报价农事</span>
+                            <span class="info-value">{{ quotationData.farmWorkName || '梢期杀虫' }}</span>
+                        </div>
+                        <div class="info-item catalog-label">
+                            <span class="info-label">报价目录</span>
+                        </div>
+                        <div class="total-bar">
+                            <span class="total-label">报价合计:</span>
+                            <span class="total-value">{{ quotationData.totalPrice || '1258' }}</span>
+                            <span class="total-unit">元</span>
+                        </div>
+                    </div>
+    
+                    <!-- 肥药费用区域 -->
+                    <div class="fertilizer-cost-section">
+                        <div class="section-header">
+                            <div class="section-title">肥药费用</div>
+                            <div class="section-total">{{ quotationData.fertilizerTotal || '1582' }}<span class="unit-text">元</span></div>
+                        </div>
+                        <div class="cost-table">
+                            <div class="table-header">
+                                <div class="col-1">功效</div>
+                                <div class="col-2">名称</div>
+                                <div class="col-3">品牌</div>
+                                <div class="col-4">单价</div>
+                                <div class="col-5">用量</div>
+                                <div class="col-6">总价</div>
+                            </div>
+                            <div 
+                                class="table-row"
+                                v-for="(item, index) in prescriptionList"
+                                :key="index"
+                            >
+                                <div class="col-1">{{ item.typeName || '营养' }}</div>
+                                <div class="col-2">{{ item.defaultName || '乙烯利' }}</div>
+                                <div class="col-3">{{ item.brand || '国光' }}</div>
+                                <div class="col-4">{{ item.price || '5元/ml' }}</div>
+                                <div class="col-5">{{ item.dosage || '300ml' }}</div>
+                                <div class="col-6">{{ item.total || '500' }}元</div>
+                            </div>
+                        </div>
+                    </div>
+    
+                    <!-- 服务费用区域 -->
+                    <div class="service-cost-section">
+                        <div class="section-header">
+                            <div class="section-title">服务费用</div>
+                            <div class="section-total">{{ quotationData.serviceTotal || '1582' }}<span class="unit-text">元</span></div>
+                        </div>
+                        <div class="service-details">
+                            <div class="detail-item">
+                                <div class="detail-value">{{ quotationData.executionMethod || '无人机' }}</div>
+                                <div class="detail-label">执行方式</div>
+                            </div>
+                            <div class="detail-item">
+                                <div class="detail-value">{{ quotationData.muPrice || '500元/亩' }}</div>
+                                <div class="detail-label">亩单价</div>
+                            </div>
+                            <div class="detail-item">
+                                <div class="detail-value">{{ quotationData.muCount || '10亩' }}</div>
+                                <div class="detail-label">亩数</div>
+                            </div>
+                        </div>
+                        <div class="edit-btn-box">
+                            <div class="edit-btn" @click="handleEdit">编辑报价</div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+
+            <!-- 底部操作按钮 -->
+            <div class="bottom-actions">
+                <div class="action-buttons">
+                    <div class="action-btn blue-btn">
+                        <div class="icon-circle">
+                            <el-icon :size="24"><Star /></el-icon>
+                        </div>
+                        <span class="btn-label">飞鸟用户</span>
+                    </div>
+                    <div class="action-btn green-btn">
+                        <div class="icon-circle">
+                            <el-icon :size="24"><ChatDotRound /></el-icon>
+                        </div>
+                        <span class="btn-label">微信</span>
+                    </div>
+                    <div class="action-btn orange-btn">
+                        <div class="icon-circle">
+                            <el-icon :size="24"><Download /></el-icon>
+                        </div>
+                        <span class="btn-label">保存图片</span>
+                    </div>
+                </div>
+                <div class="cancel-btn" @click="handleCancel">取消</div>
+            </div>
+        </div>
+    </popup>
+</template>
+
+<script setup>
+import { Popup } from "vant";
+import { ref, computed } from "vue";
+
+const showPopup = ref(true);
+
+// 报价数据
+const quotationData = ref({
+    organization: "河南农资农服组织",
+    farmWorkName: "梢期杀虫",
+    totalPrice: "1258",
+    fertilizerTotal: "1582",
+    serviceTotal: "1582",
+    executionMethod: "无人机",
+    muPrice: "500元/亩",
+    muCount: "10亩"
+});
+
+// 处方列表
+const prescriptionList = ref([
+    {
+        typeName: "营养",
+        defaultName: "乙烯利",
+        brand: "国光",
+        price: "5元/ml",
+        dosage: "300ml",
+        total: "500"
+    },
+    {
+        typeName: "营养",
+        defaultName: "乙烯利",
+        brand: "国光",
+        price: "5元/ml",
+        dosage: "600ml",
+        total: "500"
+    }
+]);
+
+const handleShowPopup = (data) => {
+    if (data) {
+        quotationData.value = { ...quotationData.value, ...data };
+        if (data.prescriptionList) {
+            prescriptionList.value = data.prescriptionList;
+        }
+    }
+    showPopup.value = true;
+};
+
+const handleEdit = () => {
+    // 编辑报价逻辑
+    // 可以触发编辑事件或打开编辑页面
+};
+
+const handleCancel = () => {
+    showPopup.value = false;
+};
+
+defineExpose({
+    handleShowPopup,
+});
+</script>
+
+<style lang="scss" scoped>
+.price-sheet-popup {
+    width: 90%;
+    max-height: 90vh;
+    background: none;
+    border-radius: 12px;
+    overflow: hidden;
+    display: flex;
+    flex-direction: column;
+    backdrop-filter: 4px;
+
+    ::v-deep {
+        .van-popup__close-icon {
+            color: #000;
+            font-size: 18px;
+            top: 12px;
+            right: 12px;
+        }
+    }
+}
+
+.price-sheet-content {
+    display: flex;
+    flex-direction: column;
+    max-height: 95vh;
+    height: 95vh;
+    .price-sheet-content-inner {
+        background: #fff;
+        border-radius: 12px;
+        display: flex;
+        flex-direction: column;
+        height: 100%;
+        overflow: hidden;
+    }
+}
+
+// 顶部标题区域
+.header-section {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    padding: 16px 10px 12px 16px;
+    // background: linear-gradient(180deg, rgba(33, 153, 248, 0) 8%, rgba(139, 199, 252, 0.519) 94%, rgba(237, 241, 255, 1) 100%);
+    background: linear-gradient(180deg, rgba(33, 153, 248, 0) 2%, rgba(139, 199, 252, 0.519) 50%, #c4e3fd);
+    flex-shrink: 0;
+
+    .header-left {
+        flex: 1;
+
+        .main-title {
+            font-family: "PangMenZhengDao";
+            font-size: 28px;
+            color: #0387EF;
+        }
+    }
+
+    .header-right {
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+        margin-left: 16px;
+
+        .qr-icon {
+            color: #2199F8;
+            margin-bottom: 4px;
+            img {
+                width: 40px;
+                height: 40px;
+            }
+        }
+
+        .qr-text {
+            font-size: 12px;
+            color: #171717;
+        }
+    }
+}
+
+.sheet-content {
+    padding: 24px 16px 12px 16px;
+    flex: 1;
+    overflow-y: auto;
+    overflow-x: hidden;
+}
+
+// 报价详情区域
+.quotation-info {
+    margin-bottom: 12px;
+
+    .info-item {
+        font-size: 16px;
+        color: #000;
+        margin-bottom: 8px;
+
+        .info-label {
+            padding-right: 8px;
+            color: rgba(0, 0, 0, 0.5);
+        }
+
+        .info-value {
+            color: #000;
+        }
+
+        &.catalog-label {
+            font-weight: bold;
+            margin-top: 10px;
+            margin-bottom: 10px;
+
+            .info-label {
+                color: #000;
+            }
+        }
+    }
+
+    .total-bar {
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        background: rgba(33, 153, 248, 0.1);
+        border: 1px solid rgba(33, 153, 248, 0.5);
+        height: 38px;
+        border-radius: 4px;
+
+        .total-label {
+            font-size: 14px;
+            color: #000000;
+        }
+
+        .total-value {
+            font-size: 22px;
+            font-weight: bold;
+            color: #2199F8;
+        }
+
+        .total-unit {
+            font-size: 14px;
+            color: #000;
+            margin-left: 4px;
+        }
+    }
+}
+
+// 肥药费用区域
+.fertilizer-cost-section {
+    margin-bottom: 10px;
+
+    .section-header {
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+        margin-bottom: 8px;
+
+        .section-title {
+            font-size: 14px;
+            color: #000;
+        }
+
+        .section-total {
+            font-size: 16px;
+            font-weight: bold;
+            color: #000;
+
+            .unit-text {
+                padding-left: 2px;
+                font-size: 12px;
+                font-weight: normal;
+            }
+        }
+    }
+
+    .cost-table {
+        border: 1px solid rgba(225, 225, 225, 0.5);
+        border-radius: 5px;
+        overflow: hidden;
+
+        .table-header {
+            display: flex;
+            background: rgba(241, 241, 241, 0.4);
+            padding: 8px 6px;
+            font-size: 12px;
+            color: #767676;
+            border-bottom: 1px solid rgba(225, 225, 225, 0.5);
+
+            .col-1 {
+                width: 40px;
+                text-align: center;
+            }
+
+            .col-2 {
+                flex: 1;
+                text-align: center;
+            }
+
+            .col-3 {
+                width: 52px;
+                text-align: center;
+            }
+
+            .col-4 {
+                width: 56px;
+                text-align: center;
+            }
+
+            .col-5 {
+                width: 52px;
+                text-align: center;
+            }
+
+            .col-6 {
+                width: 52px;
+                text-align: center;
+            }
+        }
+
+        .table-row {
+            display: flex;
+            padding: 8px 6px;
+            font-size: 11px;
+            color: rgba(0, 0, 0, 0.6);
+            background: #fff;
+            border-bottom: 1px solid rgba(225, 225, 225, 0.3);
+
+            &:last-child {
+                border-bottom: none;
+            }
+
+            .col-1,
+            .col-2,
+            .col-3,
+            .col-4,
+            .col-5,
+            .col-6 {
+                display: flex;
+                align-items: center;
+                justify-content: center;
+            }
+
+            .col-1 {
+                width: 40px;
+            }
+
+            .col-2 {
+                flex: 1;
+            }
+
+            .col-3 {
+                width: 52px;
+            }
+
+            .col-4 {
+                width: 56px;
+            }
+
+            .col-5 {
+                width: 52px;
+            }
+
+            .col-6 {
+                width: 52px;
+            }
+        }
+    }
+}
+
+// 服务费用区域
+.service-cost-section {
+    position: relative;
+
+    .section-header {
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+        margin-bottom: 12px;
+
+        .section-title {
+            font-size: 14px;
+            color: #000;
+        }
+
+        .section-total {
+            font-size: 16px;
+            font-weight: bold;
+            color: #000;
+
+            .unit-text {
+                padding-left: 2px;
+                font-size: 12px;
+                font-weight: normal;
+            }
+        }
+    }
+
+    .service-details {
+        display: flex;
+        align-items: center;
+        border: 1px solid rgba(206, 206, 206, 0.5);
+        padding: 8px 0;
+        border-radius: 4px;
+        margin-bottom: 10px;
+
+        .detail-item {
+            font-size: 14px;
+            flex: 1;
+            text-align: center;
+
+            .detail-label {
+                color: rgba(0, 0, 0, 0.2);
+                margin-top: 6px;
+            }
+
+            .detail-value {
+                color: rgba(0, 0, 0, 0.8);
+            }
+        }
+        .detail-item + .detail-item {
+            position: relative;
+            &::before {
+                content: '';
+                position: absolute;
+                left: 0;
+                top: 50%;
+                transform: translateY(-50%);
+                width: 1px;
+                height: 20px;
+                background: rgba(0, 0, 0, 0.1);
+            }
+        }
+    }
+    .edit-btn-box {
+        display: flex;
+        justify-content: end;
+    }
+    .edit-btn {
+        background: rgba(33, 153, 248, 0.1);
+        color: #2199F8;
+        padding: 6px 16px;
+        border-radius: 20px;
+        font-size: 14px;
+        width: fit-content;
+        cursor: pointer;
+    }
+}
+
+// 底部操作按钮
+.bottom-actions {
+    padding: 16px 16px 20px 16px;
+    flex-shrink: 0;
+
+    .action-buttons {
+        display: flex;
+        justify-content: space-around;
+        margin-bottom: 16px;
+
+        .action-btn {
+            display: flex;
+            flex-direction: column;
+            align-items: center;
+            cursor: pointer;
+
+            .icon-circle {
+                width: 48px;
+                height: 48px;
+                border-radius: 50%;
+                display: flex;
+                align-items: center;
+                justify-content: center;
+                color: #fff;
+                margin-bottom: 4px;
+
+                .el-icon {
+                    color: #fff;
+                }
+            }
+
+            &.blue-btn .icon-circle {
+                background: #2199F8;
+            }
+
+            &.green-btn .icon-circle {
+                background: #07C160;
+            }
+
+            &.orange-btn .icon-circle {
+                background: #FF790B;
+            }
+
+            .btn-label {
+                font-size: 12px;
+                color: #fff;
+            }
+        }
+    }
+
+    .cancel-btn {
+        text-align: center;
+        font-size: 16px;
+        color: #000;
+        cursor: pointer;
+        padding: 8px 0;
+    }
+}
+</style>

+ 33 - 11
src/components/taskItem.vue

@@ -1,9 +1,9 @@
 <template>
-    <div class="farm-item" :class="{'done': status}">
+    <div class="farm-item" :class="{'done': status, 'hall': isHall}">
         <div class="item-top">
             <div class="top-l">
-                <div class="item-name">梢期杀虫</div>
-                <div class="item-time">2025.08.27</div>
+                <div class="item-name">{{ itemData?.farmWorkName }}</div>
+                <div class="item-time">{{ itemData?.executeDate }}</div>
             </div>
             <div class="top-r">{{ status === 0 ? "查看处方" : "查看详情" }}</div>
         </div>
@@ -40,7 +40,7 @@
                 </div>
             </div> -->
 
-            <div class="farm-text">
+            <div class="farm-text" v-if="status === 0">
                 <span class="text-title">农场现状:</span>现状现状现状选咋混给农场现状现状现状现状选咋混给选咋混给选咋混给选咋混<span class="text-more">点击查看照片</span>
             </div>
             <div class="img-text-wrap">
@@ -50,13 +50,13 @@
                     </div>
                     <div class="right-text">
                         <div class="farm-info">
-                            从化荔博园
+                            {{ itemData?.farmName }}
                             <div class="info-tag-wrap">
-                                <div class="tag-item second">200亩</div>
-                                <div class="tag-item primary">桂味</div>
+                                <div class="tag-item second" v-if="itemData?.farmArea">{{ itemData?.farmArea }}亩</div>
+                                <div class="tag-item primary">{{ itemData?.typeName }}</div>
                             </div>
                         </div>
-                        <div class="farm-addr">广东省广州市从化区</div>
+                        <div class="farm-addr">{{ itemData?.address }}</div>
                     </div>
                 </div>
                 <div class="right-wrap">特别关注</div>
@@ -120,9 +120,22 @@
 import { ref } from 'vue';
 import { useRouter } from "vue-router";
 
-const status = ref(0)
+const props = defineProps({
+    status: {
+        type: Number,
+        default: 0
+    },
+    itemData: {
+        type: Object,
+        default: () => ({})
+    },
+    isHall: {
+        type: Boolean,
+        default: false
+    }
+})
 
-const expiredDay = ref(0)
+const expiredDay = ref(0) // 过期天数
 
 const router = useRouter();
 const toPage = () => {
@@ -150,6 +163,16 @@ const toPage = () => {
             color: #000000;
         }
     }
+    &.hall {
+        background: #CFE9FF;
+        .item-top {
+            .item-name {
+                color: #ffffff;
+                border: none;
+                background: linear-gradient(180deg, #7bc5ff, #2199f8);
+            }
+        }
+    }
     .item-top {
         display: flex;
         align-items: center;
@@ -206,7 +229,6 @@ const toPage = () => {
     }
     .img-text-wrap {
         display: flex;
-        align-items: center;
         justify-content: space-between;
         .left-wrap {
             display: flex;

+ 63 - 31
src/views/old_mini/farm_manage/components/demandHall.vue

@@ -55,27 +55,27 @@
             </template>
             <div class="hall-content">
                 <div class="farm-list" ref="cardContentRef" :style="{ height: `${cardContentHeight}px` }">
-                    <div class="task-item" v-for="item in 10" :key="item">
-                        <task-item>
+                    <div class="task-item" v-for="item in taskList" :key="item">
+                        <task-item :item-data="item" :isHall="true">
                             <template #footer>
                                 <div class="item-footer">
-                                    <div class="footer-l">
-                                        <img class="share-icon" src="@/assets/img/home/share-icon.png" alt="" />
-                                        转发
+                                    <div class="footer-l" @click="toDetail(item)">
+                                        查看详情
                                     </div>
                                     <div class="footer-r">
                                         <div class="btn second">
-                                            <el-icon class="btn-icon" size="14" color="#8B8B8B"><ChatDotSquare /></el-icon>
-                                            联系果园
+                                            转发给客户
                                         </div>
-                                        <div class="btn primary">
-                                            <el-icon class="btn-icon" size="14"><Plus /></el-icon>
-                                            加入任务
+                                        <div class="btn primary" @click="toPage(item)">
+                                            生成报价单
                                         </div>
                                     </div>
                                 </div>
-                            </template></task-item>
+                            </template>
+                        </task-item>
                     </div>
+
+                    <div class="no-data" v-if="taskList.length === 0">暂无数据</div>
                 </div>
             </div>
         </floating-panel>
@@ -89,6 +89,7 @@ import { useStore } from "vuex";
 import IndexMap from "../map/index";
 import taskItem from "@/components/taskItem.vue";
 import { Search } from "@element-plus/icons-vue";
+import { useRouter } from "vue-router";
 const props = defineProps({
     isCapital: {
         type: Boolean,
@@ -98,7 +99,7 @@ const props = defineProps({
 
 const store = useStore();
 const tabBarHeight = computed(() => store.state.home.tabBarHeight);
-
+const router = useRouter();
 // const tabBarHeight = ref(localStorage.getItem("tabBarHeight") * 1 || 50);
 
 const anchors = ref([310 + tabBarHeight.value, Math.round(1 * window.innerHeight) - 44]);
@@ -109,12 +110,37 @@ const indexMap = new IndexMap();
 const mapContainer = ref(null);
 
 onMounted(() => {
+    getSimpleList()
     const point = store.state.home.miniUserLocationPoint;
     nextTick(() => {
         indexMap.initMap(point, mapContainer.value, props.isCapital);
     });
 });
 
+const taskList = ref([]);
+function getSimpleList() {
+    const location = store.state.home.miniUserLocationPoint;
+    VE_API.z_farm_work_record.getSimpleList({ role: 2, location, flowStatus: '2,3' }).then(({data}) => {
+        // 假设返回的数据结构是 { list: [], total: 0 } 或者直接是数组
+        if (Array.isArray(data) && data.length > 0) {
+            taskList.value = data;
+            indexMap.initData(taskList.value)
+        } else {
+            taskList.value = [];
+        }
+    }).catch((error) => {
+        console.error('获取任务列表失败:', error);
+        taskList.value = [];
+    });
+}
+
+function toDetail(item) {
+    router.push({
+        path: "/completed_work",
+        query: { id: item.id }
+    });
+}
+
 const cardContentHeight = ref(230);
 const searchValue = ref("");
 const search = () => {
@@ -215,6 +241,12 @@ function toPage() {
         .task-item + .task-item {
             margin-top: 10px;
         }
+        .no-data {
+            text-align: center;
+            font-size: 14px;
+            color: #999999;
+            padding-top: 20px;
+        }
         
     .item-footer {
         margin-top: 10px;
@@ -225,17 +257,19 @@ function toPage() {
         justify-content: space-between;
         font-size: 12px;
         .footer-l {
-            display: inline-flex;
-            align-items: center;
-            border: 1px solid #2199F8;
-            background: rgba(33, 153, 248, 0.1);
-            padding: 0 12px;
-            height: 32px;
-            box-sizing: border-box;
-            display: flex;
-            align-items: center;
-            border-radius: 20px;
-            color: #2199F8;
+            // display: inline-flex;
+            // align-items: center;
+            // border: 1px solid #2199F8;
+            // background: rgba(33, 153, 248, 0.1);
+            // padding: 0 12px;
+            // height: 32px;
+            // box-sizing: border-box;
+            // display: flex;
+            // align-items: center;
+            // border-radius: 20px;
+            // color: #2199F8;
+            color: #8B8B8B;
+            font-size: 12px;
             .share-icon {
                 width: 12px;
                 padding-right: 4px;
@@ -244,6 +278,7 @@ function toPage() {
         .footer-r {
             display: flex;
             align-items: center;
+            gap: 8px;
             .btn {
                 height: 32px;
                 line-height: 32px;
@@ -251,24 +286,21 @@ function toPage() {
                 border-radius: 20px;
                 display: flex;
                 align-items: center;
+                box-sizing: border-box;
                 &.second {
-                    border: 1px solid #8B8B8B;
-                    color: #8B8B8B;
+                    // border: 1px solid #8B8B8B;
+                    // color: #8B8B8B;
+                    color: #2199F8;
+                    background: rgba(33, 153, 248, 0.1);
                 }
                 &.primary {
                     background: #2199F8;
                     color: #fff;
                 }
-                .btn-icon {
-                    padding-right: 4px;
-                }
             }
-            .btn + .btn {
-                margin-left: 8px;
             }
         }
     }
-    }
     
     .select-group {
         display: flex;

+ 284 - 284
src/views/old_mini/farm_manage/map/index.js

@@ -129,7 +129,7 @@ class IndexMap {
     this.kmap.addLayer(this.clickPointLayer.layer);
     this.kmap.addLayer(this.gardenPointLayer.layer);
     if (isCapital) {
-      this.initData()
+      // this.initData()
       const point = ["113.61652616170711,23.58399613872042", "113.61767554789421, 23.590079887444034", "113.62757101477101, 23.590796948574365", "113.62240816252164, 23.59499176519138"]
     } else {
       let point = new Feature(new Point(coordinate))
@@ -137,292 +137,292 @@ class IndexMap {
     }
   }
 
-  initData() {
-    const gardenList = [{
-      "consequenceText": "如果不做本次农事,会导致您的产量、质量下降15%,管理得分降低5分",
-      "id": "274655",
-      "reCheckText": "本次农事复核成效优异,作物产量潜力实现大幅增长,虫害风险控制优异,未发现虫害风险",
-      "farmName": "荔枝博览园",
-      "farmPoint": "POINT(113.61652616170711 23.58399613872042)",
-      "orderId": "745923635683790848",
-      "area": 2.719998598098755,
-      "expert": 91356,
-      "orderStatus": 4,
-      "activeStatus": 0,
-      "farmId": 766,
-      "regionId": 2,
-      "speciesId": "1",
-      "speciesName": "荔枝",
-      "agriculturalId": 24,
-      "farmWorkId": "699343457474318336",
-      "farmWorkLibId": "699343457474318336",
-      "farmWorkLibName": "梢期防虫",
-      "farmWorkName": "梢期防虫",
-      "expertIcon": "https://birdseye-img.sysuimars.com/birdseye-look-vue/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20250411150343.png",
-      "expertName": "韦帮稳",
-      "expertUserIcon": "",
-      "expertUserName": "韦帮稳",
-      "icon": 4,
-      "indexChart": [],
-      "indexName": "",
-      "beforeExecuteDate": "2024-12-03",
-      "checkDate": null,
-      "executeDate": "2025-08-15",
-      "indexJson": "",
-      "code": "BZ-BC-04-SQFC-20",
-      "expertPrescription": "",
-      "condition": "单树嫩叶率大于20.0%",
-      "solarName": "",
-      "reCheck": null,
-      "menu": 1,
-      "isEdit": 0,
-      "isMaster": null,
-      "num": null,
-      "purpose": "",
-      "selfExec": null,
-      "defaultFarmWork": 0,
-      "farmWorkType": 3,
-      "farmWorkTypeName": "病虫",
-      "type": 1,
-      "execute": 4,
-      "updateDate0": "2025-08-20",
-      "updateDate1": null,
-      "updateDate2": null,
-      "updateDate3": null,
-      "updateDate4": null,
-      "updateDate5": null,
-      "usageMode": "叶面施",
-      "serviceMain": "广州泽秾丰农资有限公司",
-      "updateDate6": null,
-      "confirmPicture": [],
-      "executeMain": "广州泽秾丰农资有限公司",
-      "storeShortName": "泽秾丰",
-      "weatherWarningMsg": "",
-      "executeEvidence": [],
-      "userEvaluation": null,
-      "reviewDate": null,
-      "reviewDate2": null,
-      "reviewImage": [],
-      "reviewImage2": [],
-      "serviceRegion": "广州市从化区荔枝博览园",
-      "cost": null,
-    },
-    {
-      "consequenceText": "如果不做本次农事,会导致您的产量、质量下降15%,管理得分降低5分",
-      "id": "274656",
-      "reCheckText": "本次农事复核成效优异,作物产量潜力实现大幅增长,控梢情况优秀,叶芽绿在5%以内",
-      "farmName": "荔枝博览园",
-      "farmPoint": "POINT(113.61767554789421 23.590079887444034)",
-      "orderId": "745923638623997952",
-      "area": 2.719998598098755,
-      "expert": 91356,
-      "orderStatus": 4,
-      "activeStatus": 0,
-      "farmId": 766,
-      "regionId": 2,
-      "speciesId": "1",
-      "speciesName": "荔枝",
-      "agriculturalId": 24,
-      "farmWorkId": "699343457474318337",
-      "farmWorkLibId": "699343457474318337",
-      "farmWorkLibName": "控梢",
-      "farmWorkName": "控梢",
-      "expertIcon": "https://birdseye-img.sysuimars.com/birdseye-look-vue/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20250411150343.png",
-      "expertName": "韦帮稳",
-      "expertUserIcon": "",
-      "expertUserName": "韦帮稳",
-      "icon": 4,
-      "indexChart": [],
-      "indexName": "",
-      "beforeExecuteDate": "2024-12-15",
-      "checkDate": null,
-      "executeDate": "2024-12-03",
-      "indexJson": "",
-      "code": "YJ-TJ-04-KS-14",
-      "expertPrescription": "",
-      "condition": "园区叶芽率大于10.0%",
-      "solarName": "",
-      "reCheck": null,
-      "menu": 1,
-      "isEdit": 0,
-      "isMaster": null,
-      "num": null,
-      "purpose": "",
-      "selfExec": null,
-      "defaultFarmWork": 0,
-      "farmWorkType": 1,
-      "farmWorkTypeName": "调节",
-      "type": 0,
-      "execute": 4,
-      "updateDate0": "2025-08-20",
-      "updateDate1": null,
-      "updateDate2": null,
-      "updateDate3": null,
-      "updateDate4": null,
-      "updateDate5": null,
-      "usageMode": "叶面施",
-      "serviceMain": "广州泽秾丰农资有限公司",
-      "updateDate6": null,
-      "confirmPicture": [],
-      "executeMain": "广州泽秾丰农资有限公司",
-      "storeShortName": "泽秾丰",
-      "weatherWarningMsg": "",
-      "executeEvidence": [],
-      "userEvaluation": null,
-      "reviewDate": null,
-      "reviewDate2": null,
-      "reviewImage": [],
-      "reviewImage2": [],
-      "serviceRegion": "广州市从化区荔枝博览园",
-      "cost": null,
-    },
-    {
-      "consequenceText": "如果不做本次农事,会导致您的产量、质量下降50%,管理得分降低15分",
-      "id": "274657",
-      "reCheckText": "本次农事复核成效优异,作物产量潜力实现大幅增长,树体营养较充足,土壤肥力增加",
-      "farmName": "荔枝博览园",
-      "farmPoint": "POINT(113.62757101477101 23.590796948574365)",
-      "orderId": "745923641274798080",
-      "area": 2.719998598098755,
-      "expert": 91356,
-      "orderStatus": 4,
-      "activeStatus": 0,
-      "farmId": 766,
-      "regionId": 2,
-      "speciesId": "1",
-      "speciesName": "荔枝",
-      "agriculturalId": 24,
-      "farmWorkId": "699343457474318338",
-      "farmWorkLibId": "699343457474318338",
-      "farmWorkLibName": "基肥",
-      "farmWorkName": "基肥",
-      "expertIcon": "https://birdseye-img.sysuimars.com/birdseye-look-vue/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20250411150343.png",
-      "expertName": "韦帮稳",
-      "expertUserIcon": "",
-      "expertUserName": "韦帮稳",
-      "icon": 4,
-      "indexChart": [],
-      "indexName": "",
-      "beforeExecuteDate": "2024-12-15",
-      "checkDate": null,
-      "executeDate": "2024-12-15",
-      "indexJson": "",
-      "code": "BZ-YY-04-JF-300",
-      "expertPrescription": "",
-      "condition": "基肥日期大于1215",
-      "solarName": "",
-      "reCheck": null,
-      "menu": 1,
-      "isEdit": 0,
-      "isMaster": null,
-      "num": null,
-      "purpose": "",
-      "selfExec": null,
-      "defaultFarmWork": 0,
-      "farmWorkType": 2,
-      "farmWorkTypeName": "营养",
-      "type": 1,
-      "execute": 4,
-      "updateDate0": "2025-08-20",
-      "updateDate1": null,
-      "updateDate2": null,
-      "updateDate3": null,
-      "updateDate4": null,
-      "updateDate5": null,
-      "usageMode": "根部施",
-      "serviceMain": "广州泽秾丰农资有限公司",
-      "updateDate6": null,
-      "confirmPicture": [],
-      "executeMain": "广州泽秾丰农资有限公司",
-      "storeShortName": "泽秾丰",
-      "weatherWarningMsg": "",
-      "executeEvidence": [],
-      "userEvaluation": null,
-      "reviewDate": null,
-      "reviewDate2": null,
-      "reviewImage": [],
-      "reviewImage2": [],
-      "serviceRegion": "广州市从化区荔枝博览园",
-      "cost": null,
-    },
-    {
-      "consequenceText": "如果不做本次农事,会导致您的产量、质量下降10%,管理得分降低3分",
-      "id": "274658",
-      "reCheckText": "本次农事复核成效优异,作物产量潜力实现大幅增长,病虫害基数得到大幅下降,未发现病虫害风险",
-      "farmName": "荔枝博览园",
-      "farmPoint": "POINT(113.62240816252164 23.59499176519138)",
-      "orderId": "745923644080787456",
-      "area": 2.719998598098755,
-      "expert": 91356,
-      "orderStatus": 4,
-      "activeStatus": 0,
-      "farmId": 766,
-      "regionId": 2,
-      "speciesId": "1",
-      "speciesName": "荔枝",
-      "agriculturalId": 24,
-      "farmWorkId": "699343457474318339",
-      "farmWorkLibId": "699343457474318339",
-      "farmWorkLibName": "清园",
-      "farmWorkName": "清园",
-      "expertIcon": "https://birdseye-img.sysuimars.com/birdseye-look-vue/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20250411150343.png",
-      "expertName": "韦帮稳",
-      "expertUserIcon": "",
-      "expertUserName": "韦帮稳",
-      "icon": 4,
-      "indexChart": [],
-      "indexName": "",
-      "beforeExecuteDate": "2024-12-27",
-      "checkDate": null,
-      "executeDate": "2024-12-15",
-      "indexJson": "",
-      "code": "BZ-BC-04-QY-100",
-      "expertPrescription": "",
-      "condition": "清园日期大于1215",
-      "solarName": "",
-      "reCheck": null,
-      "menu": 1,
-      "isEdit": 0,
-      "isMaster": null,
-      "num": null,
-      "purpose": "",
-      "selfExec": null,
-      "defaultFarmWork": 0,
-      "farmWorkType": 3,
-      "farmWorkTypeName": "病虫",
-      "type": 1,
-      "execute": 4,
-      "updateDate0": "2025-08-20",
-      "updateDate1": null,
-      "updateDate2": null,
-      "updateDate3": null,
-      "updateDate4": null,
-      "updateDate5": null,
-      "usageMode": "叶面施",
-      "serviceMain": "广州泽秾丰农资有限公司",
-      "updateDate6": null,
-      "confirmPicture": [],
-      "executeMain": "广州泽秾丰农资有限公司",
-      "storeShortName": "泽秾丰",
-      "weatherWarningMsg": "",
-      "executeEvidence": [],
-      "userEvaluation": null,
-      "reviewDate": null,
-      "reviewDate2": null,
-      "reviewImage": [],
-      "reviewImage2": [],
-      "serviceRegion": "广州市从化区荔枝博览园",
-      "cost": null,
-    }]
-    for (let item of gardenList) {
+  initData(taskList) {
+    // const gardenList = [{
+    //   "consequenceText": "如果不做本次农事,会导致您的产量、质量下降15%,管理得分降低5分",
+    //   "id": "274655",
+    //   "reCheckText": "本次农事复核成效优异,作物产量潜力实现大幅增长,虫害风险控制优异,未发现虫害风险",
+    //   "farmName": "荔枝博览园",
+    //   "farmPoint": "POINT(113.61652616170711 23.58399613872042)",
+    //   "orderId": "745923635683790848",
+    //   "area": 2.719998598098755,
+    //   "expert": 91356,
+    //   "orderStatus": 4,
+    //   "activeStatus": 0,
+    //   "farmId": 766,
+    //   "regionId": 2,
+    //   "speciesId": "1",
+    //   "speciesName": "荔枝",
+    //   "agriculturalId": 24,
+    //   "farmWorkId": "699343457474318336",
+    //   "farmWorkLibId": "699343457474318336",
+    //   "farmWorkLibName": "梢期防虫",
+    //   "farmWorkName": "梢期防虫",
+    //   "expertIcon": "https://birdseye-img.sysuimars.com/birdseye-look-vue/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20250411150343.png",
+    //   "expertName": "韦帮稳",
+    //   "expertUserIcon": "",
+    //   "expertUserName": "韦帮稳",
+    //   "icon": 4,
+    //   "indexChart": [],
+    //   "indexName": "",
+    //   "beforeExecuteDate": "2024-12-03",
+    //   "checkDate": null,
+    //   "executeDate": "2025-08-15",
+    //   "indexJson": "",
+    //   "code": "BZ-BC-04-SQFC-20",
+    //   "expertPrescription": "",
+    //   "condition": "单树嫩叶率大于20.0%",
+    //   "solarName": "",
+    //   "reCheck": null,
+    //   "menu": 1,
+    //   "isEdit": 0,
+    //   "isMaster": null,
+    //   "num": null,
+    //   "purpose": "",
+    //   "selfExec": null,
+    //   "defaultFarmWork": 0,
+    //   "farmWorkType": 3,
+    //   "farmWorkTypeName": "病虫",
+    //   "type": 1,
+    //   "execute": 4,
+    //   "updateDate0": "2025-08-20",
+    //   "updateDate1": null,
+    //   "updateDate2": null,
+    //   "updateDate3": null,
+    //   "updateDate4": null,
+    //   "updateDate5": null,
+    //   "usageMode": "叶面施",
+    //   "serviceMain": "广州泽秾丰农资有限公司",
+    //   "updateDate6": null,
+    //   "confirmPicture": [],
+    //   "executeMain": "广州泽秾丰农资有限公司",
+    //   "storeShortName": "泽秾丰",
+    //   "weatherWarningMsg": "",
+    //   "executeEvidence": [],
+    //   "userEvaluation": null,
+    //   "reviewDate": null,
+    //   "reviewDate2": null,
+    //   "reviewImage": [],
+    //   "reviewImage2": [],
+    //   "serviceRegion": "广州市从化区荔枝博览园",
+    //   "cost": null,
+    // },
+    // {
+    //   "consequenceText": "如果不做本次农事,会导致您的产量、质量下降15%,管理得分降低5分",
+    //   "id": "274656",
+    //   "reCheckText": "本次农事复核成效优异,作物产量潜力实现大幅增长,控梢情况优秀,叶芽绿在5%以内",
+    //   "farmName": "荔枝博览园",
+    //   "farmPoint": "POINT(113.61767554789421 23.590079887444034)",
+    //   "orderId": "745923638623997952",
+    //   "area": 2.719998598098755,
+    //   "expert": 91356,
+    //   "orderStatus": 4,
+    //   "activeStatus": 0,
+    //   "farmId": 766,
+    //   "regionId": 2,
+    //   "speciesId": "1",
+    //   "speciesName": "荔枝",
+    //   "agriculturalId": 24,
+    //   "farmWorkId": "699343457474318337",
+    //   "farmWorkLibId": "699343457474318337",
+    //   "farmWorkLibName": "控梢",
+    //   "farmWorkName": "控梢",
+    //   "expertIcon": "https://birdseye-img.sysuimars.com/birdseye-look-vue/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20250411150343.png",
+    //   "expertName": "韦帮稳",
+    //   "expertUserIcon": "",
+    //   "expertUserName": "韦帮稳",
+    //   "icon": 4,
+    //   "indexChart": [],
+    //   "indexName": "",
+    //   "beforeExecuteDate": "2024-12-15",
+    //   "checkDate": null,
+    //   "executeDate": "2024-12-03",
+    //   "indexJson": "",
+    //   "code": "YJ-TJ-04-KS-14",
+    //   "expertPrescription": "",
+    //   "condition": "园区叶芽率大于10.0%",
+    //   "solarName": "",
+    //   "reCheck": null,
+    //   "menu": 1,
+    //   "isEdit": 0,
+    //   "isMaster": null,
+    //   "num": null,
+    //   "purpose": "",
+    //   "selfExec": null,
+    //   "defaultFarmWork": 0,
+    //   "farmWorkType": 1,
+    //   "farmWorkTypeName": "调节",
+    //   "type": 0,
+    //   "execute": 4,
+    //   "updateDate0": "2025-08-20",
+    //   "updateDate1": null,
+    //   "updateDate2": null,
+    //   "updateDate3": null,
+    //   "updateDate4": null,
+    //   "updateDate5": null,
+    //   "usageMode": "叶面施",
+    //   "serviceMain": "广州泽秾丰农资有限公司",
+    //   "updateDate6": null,
+    //   "confirmPicture": [],
+    //   "executeMain": "广州泽秾丰农资有限公司",
+    //   "storeShortName": "泽秾丰",
+    //   "weatherWarningMsg": "",
+    //   "executeEvidence": [],
+    //   "userEvaluation": null,
+    //   "reviewDate": null,
+    //   "reviewDate2": null,
+    //   "reviewImage": [],
+    //   "reviewImage2": [],
+    //   "serviceRegion": "广州市从化区荔枝博览园",
+    //   "cost": null,
+    // },
+    // {
+    //   "consequenceText": "如果不做本次农事,会导致您的产量、质量下降50%,管理得分降低15分",
+    //   "id": "274657",
+    //   "reCheckText": "本次农事复核成效优异,作物产量潜力实现大幅增长,树体营养较充足,土壤肥力增加",
+    //   "farmName": "荔枝博览园",
+    //   "farmPoint": "POINT(113.62757101477101 23.590796948574365)",
+    //   "orderId": "745923641274798080",
+    //   "area": 2.719998598098755,
+    //   "expert": 91356,
+    //   "orderStatus": 4,
+    //   "activeStatus": 0,
+    //   "farmId": 766,
+    //   "regionId": 2,
+    //   "speciesId": "1",
+    //   "speciesName": "荔枝",
+    //   "agriculturalId": 24,
+    //   "farmWorkId": "699343457474318338",
+    //   "farmWorkLibId": "699343457474318338",
+    //   "farmWorkLibName": "基肥",
+    //   "farmWorkName": "基肥",
+    //   "expertIcon": "https://birdseye-img.sysuimars.com/birdseye-look-vue/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20250411150343.png",
+    //   "expertName": "韦帮稳",
+    //   "expertUserIcon": "",
+    //   "expertUserName": "韦帮稳",
+    //   "icon": 4,
+    //   "indexChart": [],
+    //   "indexName": "",
+    //   "beforeExecuteDate": "2024-12-15",
+    //   "checkDate": null,
+    //   "executeDate": "2024-12-15",
+    //   "indexJson": "",
+    //   "code": "BZ-YY-04-JF-300",
+    //   "expertPrescription": "",
+    //   "condition": "基肥日期大于1215",
+    //   "solarName": "",
+    //   "reCheck": null,
+    //   "menu": 1,
+    //   "isEdit": 0,
+    //   "isMaster": null,
+    //   "num": null,
+    //   "purpose": "",
+    //   "selfExec": null,
+    //   "defaultFarmWork": 0,
+    //   "farmWorkType": 2,
+    //   "farmWorkTypeName": "营养",
+    //   "type": 1,
+    //   "execute": 4,
+    //   "updateDate0": "2025-08-20",
+    //   "updateDate1": null,
+    //   "updateDate2": null,
+    //   "updateDate3": null,
+    //   "updateDate4": null,
+    //   "updateDate5": null,
+    //   "usageMode": "根部施",
+    //   "serviceMain": "广州泽秾丰农资有限公司",
+    //   "updateDate6": null,
+    //   "confirmPicture": [],
+    //   "executeMain": "广州泽秾丰农资有限公司",
+    //   "storeShortName": "泽秾丰",
+    //   "weatherWarningMsg": "",
+    //   "executeEvidence": [],
+    //   "userEvaluation": null,
+    //   "reviewDate": null,
+    //   "reviewDate2": null,
+    //   "reviewImage": [],
+    //   "reviewImage2": [],
+    //   "serviceRegion": "广州市从化区荔枝博览园",
+    //   "cost": null,
+    // },
+    // {
+    //   "consequenceText": "如果不做本次农事,会导致您的产量、质量下降10%,管理得分降低3分",
+    //   "id": "274658",
+    //   "reCheckText": "本次农事复核成效优异,作物产量潜力实现大幅增长,病虫害基数得到大幅下降,未发现病虫害风险",
+    //   "farmName": "荔枝博览园",
+    //   "farmPoint": "POINT(113.62240816252164 23.59499176519138)",
+    //   "orderId": "745923644080787456",
+    //   "area": 2.719998598098755,
+    //   "expert": 91356,
+    //   "orderStatus": 4,
+    //   "activeStatus": 0,
+    //   "farmId": 766,
+    //   "regionId": 2,
+    //   "speciesId": "1",
+    //   "speciesName": "荔枝",
+    //   "agriculturalId": 24,
+    //   "farmWorkId": "699343457474318339",
+    //   "farmWorkLibId": "699343457474318339",
+    //   "farmWorkLibName": "清园",
+    //   "farmWorkName": "清园",
+    //   "expertIcon": "https://birdseye-img.sysuimars.com/birdseye-look-vue/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20250411150343.png",
+    //   "expertName": "韦帮稳",
+    //   "expertUserIcon": "",
+    //   "expertUserName": "韦帮稳",
+    //   "icon": 4,
+    //   "indexChart": [],
+    //   "indexName": "",
+    //   "beforeExecuteDate": "2024-12-27",
+    //   "checkDate": null,
+    //   "executeDate": "2024-12-15",
+    //   "indexJson": "",
+    //   "code": "BZ-BC-04-QY-100",
+    //   "expertPrescription": "",
+    //   "condition": "清园日期大于1215",
+    //   "solarName": "",
+    //   "reCheck": null,
+    //   "menu": 1,
+    //   "isEdit": 0,
+    //   "isMaster": null,
+    //   "num": null,
+    //   "purpose": "",
+    //   "selfExec": null,
+    //   "defaultFarmWork": 0,
+    //   "farmWorkType": 3,
+    //   "farmWorkTypeName": "病虫",
+    //   "type": 1,
+    //   "execute": 4,
+    //   "updateDate0": "2025-08-20",
+    //   "updateDate1": null,
+    //   "updateDate2": null,
+    //   "updateDate3": null,
+    //   "updateDate4": null,
+    //   "updateDate5": null,
+    //   "usageMode": "叶面施",
+    //   "serviceMain": "广州泽秾丰农资有限公司",
+    //   "updateDate6": null,
+    //   "confirmPicture": [],
+    //   "executeMain": "广州泽秾丰农资有限公司",
+    //   "storeShortName": "泽秾丰",
+    //   "weatherWarningMsg": "",
+    //   "executeEvidence": [],
+    //   "userEvaluation": null,
+    //   "reviewDate": null,
+    //   "reviewDate2": null,
+    //   "reviewImage": [],
+    //   "reviewImage2": [],
+    //   "serviceRegion": "广州市从化区荔枝博览园",
+    //   "cost": null,
+    // }]
+    for (let item of taskList) {
       item.mapInfo = item.executeDate?.replace(/^\d{4}-(\d{2})-(\d{2})$/, '$1.$2') + '  ' + item.farmWorkName
-      this.gardenPointLayer.source.addFeature(newPoint(item, "farmPoint", "myGarden"))
+      this.gardenPointLayer.source.addFeature(newPoint(item, "point", "myGarden"))
     }
     this.kmap.getView().fit(this.gardenPointLayer.source.getExtent(), { padding: [20, 2, 20, 2] });
-    // const finalZoom = this.kmap.getView().getZoom();
-    // if (finalZoom > 18) {
-    //   this.kmap.getView().setZoom(18);
-    // }
+    const finalZoom = this.kmap.getView().getZoom();
+    if (finalZoom > 18) {
+      this.kmap.getView().setZoom(18);
+    }
   }
 }
 

+ 54 - 53
src/views/old_mini/modify_work/completedWork.vue

@@ -29,7 +29,7 @@
                     <div class="status-r" v-if="curRole == 2">{{ status === 0 ? "提醒执行" : "提醒复核" }}</div>
                 </template>
             </div>
-            <div class="work-wrap">
+            <div class="work-wrap" v-if="detailData?.orderStatus === 4 || detailData?.orderStatus === 5">
                 <div class="box-wrap executor-info" v-if="query.status === 'warning' || curRole == 1 || curRole == 2">
                     <!-- <div class="executor-title">执行人</div> -->
                     <div class="executor-content">
@@ -86,7 +86,7 @@
                     </div>
                 </div>
             </div>
-            <div class="work-wrap">
+            <div class="work-wrap info-wrap">
                 <div class="box-wrap farm-photo farm-info" v-if="(curRole == 2 && currentStep == 2) || (currentStep == 1 && curRole == 1)">
                     <div class="info-title">
                         <div class="card-title">执行照片</div>
@@ -132,32 +132,32 @@
 
                 <div class="box-wrap farm-data">
                     <div class="card-title">
-                        <div>秋梢防虫<span class="type-tag">标准农事</span></div>
-                        <div class="point-wrap">
+                        <div>{{ detailData?.farmWorkName }}<span class="type-tag">标准农事</span></div>
+                        <!-- <div class="point-wrap">
                             <div class="point"></div>
                             <span>2区</span>
-                        </div>
+                        </div> -->
                     </div>
                     <div class="data-content">
                         <div class="form-item">
                             <div class="item-name">农事编号</div>
-                            <div class="item-text">BZ-YY-04-SQYY-20</div>
+                            <div class="item-text">{{ detailData?.code }}</div>
                         </div>
                         <div class="form-item">
                             <div class="item-name">服务亩数</div>
-                            <div class="item-text">100亩</div>
+                            <div class="item-text">{{ detailData?.area ? detailData?.area + '亩' : '--' }}</div>
                         </div>
                         <div class="form-item">
                             <div class="item-name">服务区域</div>
-                            <div class="item-text">广州市从化区荔枝博览园</div>
+                            <div class="item-text">{{ detailData?.serviceRegion }}</div>
                         </div>
                         <div class="form-item">
                             <div class="item-name">触发条件</div>
-                            <div class="item-text">单数花带叶40%</div>
+                            <div class="item-text">{{ detailData?.condition }}</div>
                         </div>
                         <div class="form-item">
                             <div class="item-name">执行时间</div>
-                            <div class="item-text">2025.02.18</div>
+                            <div class="item-text">{{ detailData?.executeDate }}</div>
                         </div>
                     </div>
                 </div>
@@ -166,8 +166,8 @@
                     <div class="card-title">药物处方</div>
                     <div class="table-item">
                         <div class="form-item">
-                            <div class="item-name">农事编号</div>
-                            <div class="item-text">BZ-YY-04-SQYY-20</div>
+                            <div class="item-name">施用方式</div>
+                            <div class="item-text">{{ detailData?.usageMode }}</div>
                         </div>
                     </div>
                     <div class="new-wrap">
@@ -180,7 +180,7 @@
                         </div>
                         <div
                             class="new-table-wrap"
-                            v-for="(prescriptionItem, prescriptionI) in prescriptioData.prescriptionList"
+                            v-for="(prescriptionItem, prescriptionI) in detailData?.prescriptionList"
                             :key="prescriptionI"
                         >
                             <div
@@ -195,19 +195,19 @@
                                     </div>
                                     <div
                                         class="line-r"
-                                        :class="{ 'has-border': prescriptioData.usageMode === '叶面施' }"
+                                        :class="{ 'has-border': detailData?.usageMode === '叶面施' }"
                                     >
                                         <div class="line-3">
                                             <div
                                                 class="sub-line title-3"
-                                                :class="{ 'execute-line': prescriptioData.usageMode === '叶面施' }"
+                                                :class="{ 'execute-line': detailData?.usageMode === '叶面施' }"
                                             >
                                                 人工
                                             </div>
                                             <div class="sub-line title-4">{{ subP.ratio }}ML</div>
                                             <div class="sub-line title-5">{{ subP.muUsage }}{{ subP.unit }}</div>
                                         </div>
-                                        <div class="line-4" v-if="prescriptioData.usageMode === '叶面施'">
+                                        <div class="line-4" v-if="detailData?.usageMode === '叶面施'">
                                             <div class="sub-line title-3 execute-line">无人机</div>
                                             <div class="sub-line title-4">
                                                 {{ subP.ratio2 ? subP.ratio2 + subP.unit : "---" }}
@@ -224,12 +224,12 @@
                     </div>
                 </div>
 
-                <div class="work-map">
+                <!-- <div class="work-map">
                     <div class="card-title">执行农事区域</div>
                     <div class="map-content">
                         <div class="map-dom" ref="areaRef"></div>
                     </div>
-                </div>
+                </div> -->
             </div>
             <div
                 class="fixed-btn-wrap"
@@ -249,23 +249,26 @@
                 v-if="curRole == 2 && currentStep == 1"
             >
                 <div class="fixed-btn second">转发给客户</div>
-                <div class="fixed-btn" @click="handleOk">生成报价单</div>
+                <div class="fixed-btn" @click="showPriceSheetPopup">生成报价单</div>
             </div>
         </div>
     </div>
     <!-- 报价弹窗 -->
     <offer-popup :showPopup="showPopup" :executionData="executionData"></offer-popup>
+    <!-- 服务报价单 -->
+    <price-sheet-popup ref="priceSheetPopupRef"></price-sheet-popup>
 </template>
 
 <script setup>
 import customHeader from "@/components/customHeader.vue";
 import { onMounted, ref } from "vue";
-import NewFarmMap from "./newFarmMap";
+// import NewFarmMap from "./newFarmMap";
 import { useStore } from "vuex";
 import offerPopup from "@/components/popup/offerPopup.vue";
 import { useRouter, useRoute } from "vue-router";
 import farmSteps from "@/components/farmSteps.vue";
 import priceTable from "../agri_work/components/priceTable.vue";
+import priceSheetPopup from "@/components/popup/priceSheetPopup.vue";
 
 const router = useRouter();
 const store = useStore();
@@ -296,43 +299,38 @@ const handleDemand = () => {
     router.push("/share_page");
 };
 
-const prescriptioData = ref({
-    prescriptionList: [
-        {
-            name: "营养",
-            pesticideFertilizerList: [
-                {
-                    key: 1,
-                    typeName: "营养",
-                    defaultName: "乙烯利",
-                    muUsage: "50",
-                    muUsage2: "500",
-                    ratio: "400",
-                    ratio2: "400",
-                    unit: "ml",
-                    remark: "这是是用药注意事项的备注,这是是用药注意事项的备注",
-                },
-            ],
-        },
-    ],
-    usageMode: "叶面施",
-});
+const priceSheetPopupRef = ref(null);
+const showPriceSheetPopup = () => {
+    priceSheetPopupRef.value.handleShowPopup();
+};
 
 // 地图
-const areaRef = ref(null);
-let newFarmMap = new NewFarmMap();
+// const areaRef = ref(null);
+// let newFarmMap = new NewFarmMap();
 onMounted(() => {
-    const point = store.state.home.miniUserLocationPoint;
-    if (areaRef.value) {
-        newFarmMap.initMap(point, areaRef.value, false);
-    
-        getAreaList(() => {
-            console.log("areaList.value", areaList.value);
-            newFarmMap.initArea(areaList.value);
-        });
+    const id = query.id;
+    if (id) {
+        getDetail(id);
     }
+    // const point = store.state.home.miniUserLocationPoint;
+    // if (areaRef.value) {
+    //     newFarmMap.initMap(point, areaRef.value, false);
+    
+    //     getAreaList(() => {
+    //         console.log("areaList.value", areaList.value);
+    //         newFarmMap.initArea(areaList.value);
+    //     });
+    // }
 });
 
+const detailData = ref({});
+const getDetail = (id) => {
+    VE_API.z_farm_work_record.getDetail({ id }).then(({ data }) => {
+        const res = data[0];
+        detailData.value = res;
+    });
+};
+
 // 农场分区列表
 const areaList = ref([]);
 const regionId = ref(null);
@@ -449,10 +447,10 @@ const getAreaList = (callback) => {
 // 切换分区
 const gardenId = ref(null);
 const changeRegion = (e) => {
-    newFarmMap.getBlueRegion({ gardenId: gardenId.value, regionId: e }, () => {
+    // newFarmMap.getBlueRegion({ gardenId: gardenId.value, regionId: e }, () => {
         // newFarmMap.setBlueRegion([{id: "ws0y1me7h94u"}, {id: "ws0y1me545tg"}])
         // serveArea.value = "3.72亩"
-    });
+    // });
 };
 </script>
 
@@ -470,6 +468,9 @@ const changeRegion = (e) => {
         &.hasBottom {
             padding-bottom: 60px;
         }
+        .info-wrap {
+            margin-bottom: 80px;
+        }
         .work-wrap {
             position: relative;
             z-index: 3;

+ 157 - 131
src/views/old_mini/modify_work/index.vue

@@ -36,26 +36,27 @@
                 class="demo-dynamic"
             >
                 <div class="farm-card" v-if="!isAdd">
-                    <div class="card-title">秋梢防虫<span class="type-tag">标准农事</span></div>
+                    <div class="card-title">{{ detailData?.farmWorkName }}<span class="type-tag">标准农事</span></div>
                     <div class="info-content">
                         <el-form-item label-width="70px" class="form-item text-item" label="农事编号">
                             <div class="info-text">
-                                BZ-YY-04-SQYY-20
+                                {{ detailData?.code }}
                             </div>
                         </el-form-item>
-                        <el-form-item label-width="70px" class="form-item text-item" label="服务亩">
+                        <el-form-item label-width="70px" class="form-item text-item" label="服务亩">
                             <div class="info-text">
-                                100亩
+                                {{ detailData?.area ? detailData?.area + '亩' : '--' }}
                             </div>
                         </el-form-item>
                         <el-form-item label-width="70px" class="form-item text-item" label="服务区域">
                             <div class="info-text">
-                                广州市从化区荔枝博览园
+                                {{ detailData?.serviceRegion }}
                             </div>
                         </el-form-item>
                         <el-form-item label-width="70px" class="form-item" prop="conditionRate" label="触发条件">
                             <div class="condition-wrap">
-                                <el-select v-model="dynamicValidateForm.condition" placeholder="请选择触发条件" style="width: 58%">
+                                {{ detailData?.condition }}
+                                <!-- <el-select v-model="dynamicValidateForm.condition" placeholder="请选择触发条件" style="width: 58%">
                                     <el-option v-for="(item, index) in farmWorkIndexNameList" :key="index" :value="item" :label="item" />
                                 </el-select>
                                 <span class="symbol"></span>
@@ -67,7 +68,7 @@
                                     <el-option :value="40" label="40%" />
                                     <el-option :value="60" label="60%" />
                                     <el-option :value="80" label="80%" />
-                                </el-select>
+                                </el-select> -->
                             </div>
                         </el-form-item>
                         <el-form-item label-width="70px" class="form-item" prop="executeDate" label="执行时间">
@@ -94,8 +95,8 @@
                     <div class="farm-card" v-if="farmProgress === 0">
                         <div class="card-title">基本信息</div>
                         <div class="info-content">
-                                <el-form-item label-width="82px" class="form-item" prop="name" label="农事名称">
-                                    <el-select v-model="dynamicValidateForm.name" placeholder="请选择农事名称" style="width: 100%">
+                                <el-form-item label-width="82px" class="form-item" prop="farmWorkName" label="农事名称">
+                                    <el-select v-model="dynamicValidateForm.farmWorkName" placeholder="请选择农事名称" style="width: 100%">
                                         <el-option v-for="(item, index) in farmWorkNameList" :key="index" :value="item" :label="item" />
                                     </el-select>
                                 </el-form-item>
@@ -367,7 +368,7 @@
                     <div class="btn" @click.prevent="submitForm(formRef)">保存报价</div>
                 </div>
                 <div class="submit-btn" v-if="!isAdd && !isEdit">
-                    <div class="btn second">忽略</div>
+                    <div class="btn second" @click="handleIgnore">忽略</div>
                     <div class="btn" @click.prevent="submitForm(formRef)">下发农事</div>
                 </div>
                 <div class="submit-btn" v-if="isAdd && farmProgress === 0">
@@ -380,6 +381,20 @@
             </el-form>
         </div>
     </div>
+
+    <popup v-model:show="showTaskPopup" round class="task-tips-popup">
+        <template v-if="taskPopupType === 'warning'">
+            <img  class="create-farm-icon" src="@/assets/img/home/create-farm-icon.png" alt="" />
+            <div class="create-farm-text">
+                <div>您确认忽略 <span class="main-text">{{ detailData?.farmName }}</span> 的 <span class="main-text">{{ detailData?.farmWorkName }}</span> 农事吗</div>
+            </div>
+        </template>
+        <template v-else>
+            <img class="farm-check-icon" src="@/assets/img/home/right.png" alt="">
+            <div class="create-farm-text success-text">农事已下发成功</div>
+        </template>
+        <div class="create-farm-btn" @click="handlePopupBtn">{{ taskPopupType === 'warning' ? '确认忽略' : '我知道了' }}</div>
+    </popup>
 </template>
 
 <script setup>
@@ -389,6 +404,7 @@ import { ElMessage ,ElMessageBox} from "element-plus";
 import customHeader from "@/components/customHeader.vue";
 import NewFarmMap from "./newFarmMap";
 import { useStore } from "vuex";
+import { Popup } from "vant";
 import farmSteps from "@/components/farmSteps.vue";
 import dayjs from "dayjs";
 const store = useStore();
@@ -402,10 +418,18 @@ const curRole = 0
 const gardenId = ref(null);
 const actionType = ref([]);
 const isAdd = ref(false)
+
+const showTaskPopup = ref(false);
+const taskPopupType = ref('warning');
+
 const isEdit = ref(false)
 isAdd.value = route.query.isAdd ? true : false
 isEdit.value = route.query.isEdit ? true : false
 onMounted(() => {
+    const id = route.query.id;
+    if (id) {
+        getDetail(id);
+    }
     window.scrollTo(0, 0);
     getFarmWorkNameList();
     getFarmWorkIndexNameList();
@@ -446,6 +470,36 @@ onDeactivated(() => {
     resetForm(formRef.value);
 });
 
+const detailData = ref({});
+const getDetail = (id) => {
+    VE_API.z_farm_work_record.getDetail({ id }).then(({ data }) => {
+        const res = data[0];
+        detailData.value = res;
+        dynamicValidateForm.executeDate = res.executeDate;
+        dynamicValidateForm.usageMode = res.usageMode;
+
+        res.prescriptionList.forEach(item => {
+            item.pesticideFertilizerList.forEach(pesticide => {
+                pesticide.typeName = item.name;
+            });
+        });
+
+        dynamicValidateForm.prescriptionList = res.prescriptionList;
+    });
+};
+
+function handleIgnore() {
+    taskPopupType.value = 'warning';
+    showTaskPopup.value = true;
+}
+
+function handlePopupBtn() {
+    showTaskPopup.value = false;
+    if (taskPopupType.value === 'warning') {
+        // 确认忽略
+    }
+}
+
 const resetForm = (formEl) => {
     if (!formEl) return;
     formEl.resetFields();
@@ -470,7 +524,7 @@ const cancelEdit = () => {
 // 表单
 const formRef = ref();
 const dynamicValidateForm = reactive({
-    name: "",
+    farmWorkName: "",
     conditionRate: "",
     purpose: "",
     executeDate: dayjs().format("YYYY-MM-DD"),
@@ -495,7 +549,7 @@ const dynamicValidateForm = reactive({
 });
 
 const rules = {
-    name: [
+    farmWorkName: [
         {
             required: true,
             message: "请输入农事名称",
@@ -591,9 +645,9 @@ let pesticideFertilizersOptions = ref([
         usageModeList: ["叶面施"],
     },
 ]);
-// VE_API.order.pesticideFertilizers().then(({ data }) => {
-//     pesticideFertilizersOptions.value = data;
-// });
+VE_API.z_farm_work_order.pesticideFertilizersList().then(({ data }) => {
+    pesticideFertilizersOptions.value = data;
+});
 
 const allUsageMode = ref(null);
 const allUsageModeList = ["叶面施", "根部施", "人工农事"];
@@ -684,13 +738,17 @@ const submitForm = (formEl) => {
     if (!formEl) return;
     formEl.validate((valid) => {
         if (valid) {
-            router.push({
-                path: "/completed_work",
-                query: {
-                    id: 1,
-                    status: 1,
-                },
-            });
+
+            taskPopupType.value = 'success';
+            showTaskPopup.value = true;
+
+            // router.push({
+            //     path: "/completed_work",
+            //     query: {
+            //         id: 1,
+            //         status: 1,
+            //     },
+            // });
             // submit();
         } else {
             console.log("error submit!");
@@ -800,115 +858,6 @@ const serveArea = ref(null);
 // 农场分区列表
 const areaList = ref([]);
 const regionId = ref(null);
-const getAreaList = (callback) => {
-    const data = [
-        {
-            "farmCode": "LBY",
-            "farmId": "766",
-            "id": 2,
-            "isGenerateReport": 1,
-            "name": "分区2",
-            "pointCount": 131,
-            "pointWkt": "POINT (113.6142086995688 23.585836479509055)",
-            "regionCode": "LBY-MR-2",
-            "wkt": "MULTIPOLYGON (((113.61348988377155 23.58617369800422, 113.61395837633405 23.58622555407246, 113.61414076654707 23.58622555407246, 113.61436964832843 23.5862774101407, 113.61478628474084 23.586468741036786, 113.61491681896747 23.58652417337007, 113.61512424307672 23.586449071517652, 113.61491503077356 23.585742756367924, 113.61479880177082 23.585596129050916, 113.61473800497858 23.585451289764112, 113.61438931780664 23.585286780835393, 113.61410858003889 23.585299297865365, 113.61385645239149 23.585249229909184, 113.61378135053907 23.585288569029306, 113.61357571446003 23.585283204611276, 113.61347200232355 23.585342213209604, 113.61338080721704 23.585506721974614, 113.61335934954492 23.585665866485304, 113.61342193444922 23.58616296916816, 113.61348988377155 23.58617369800422)))"
-        },
-        {
-            "farmCode": "LBY",
-            "farmId": "766",
-            "id": 9,
-            "isGenerateReport": 1,
-            "name": "分区9",
-            "pointCount": 63,
-            "pointWkt": "POINT (113.61725048541882 23.585262743588892)",
-            "regionCode": "LBY-MR-9",
-            "wkt": "MULTIPOLYGON (((113.61697301904715 23.585749021838886, 113.617320420354 23.585742359348075, 113.61752600578478 23.585708095109652, 113.61772112158744 23.5856785897931, 113.61789720170187 23.58559102562808, 113.61787340709186 23.585330236701996, 113.61793812843106 23.58526932250014, 113.61795526055036 23.585167481569073, 113.61793146594025 23.585022810339957, 113.61790671954574 23.58491525870246, 113.61779345720193 23.58473346788171, 113.61779821612386 23.584601169849783, 113.61771921801855 23.584509798547092, 113.61763260563801 23.584517412822354, 113.61755741467023 23.584640193010298, 113.61736515422085 23.584823887399946, 113.61726902399624 23.58487623554194, 113.61709484745067 23.584864814129187, 113.61707105284067 23.584962847922696, 113.61699586187265 23.585023762124397, 113.61689877986377 23.585071351344393, 113.61675981934107 23.58515796372515, 113.61663132844662 23.585192227963518, 113.61646000725422 23.58524076896813, 113.61634484134152 23.585320718857897, 113.61628392713976 23.585360693802862, 113.6162163504473 23.585397813394497, 113.61601552393823 23.585480618637533, 113.61596127222741 23.585499654325552, 113.61597174185577 23.585538677485918, 113.61598125969975 23.585561520311693, 113.61608690776846 23.585591025628073, 113.61610689524092 23.585611013100582, 113.61619350762157 23.58557960421532, 113.6162886860618 23.58552820785755, 113.61632104673151 23.585492040050294, 113.61638196093314 23.585453968674216, 113.61646095903859 23.585480618637543, 113.6164771393734 23.585505365031985, 113.61649617506146 23.585564375664962, 113.61648760900198 23.58561006131614, 113.61645048941011 23.58567192730245, 113.61649807863034 23.585676686224392, 113.61662466595578 23.585595784550236, 113.61671698904298 23.585495847187836, 113.61676553004737 23.585587218490588, 113.61681787818966 23.585559616742817, 113.61689211737293 23.5854558722431, 113.61695588692798 23.585499654325556, 113.61697301904715 23.585749021838886)))"
-        },
-        {
-            "farmCode": "LBY",
-            "farmId": "766",
-            "id": 29,
-            "isGenerateReport": 1,
-            "name": "分区8",
-            "pointCount": 40,
-            "pointWkt": "POINT (113.61587084394066 23.58618878122994)",
-            "regionCode": "LBY-MR-8",
-            "wkt": "MULTIPOLYGON (((113.61516876894466 23.58617727723074, 113.6153952936325 23.58616014511155, 113.61551426668275 23.586215348606817, 113.61564275757719 23.586290539574595, 113.61565798612749 23.58640951262483, 113.61577695917796 23.58637905552401, 113.61584168051715 23.586392380505654, 113.615912112563 23.58637048946448, 113.61613483011318 23.586200120056528, 113.6162547549478 23.586365730542376, 113.61623762282863 23.586448535785365, 113.61615196223237 23.586476137533136, 113.61634435485792 23.586946782901485, 113.61654695275945 23.586932042261843, 113.61651364030526 23.58667220511998, 113.61648127963554 23.586552280285296, 113.61640894402115 23.58641903046899, 113.61636135480092 23.586292443143435, 113.6163308977001 23.586121121951034, 113.61631471736528 23.58605735239606, 113.61618622647107 23.586071629162152, 113.61612911940675 23.58603260600161, 113.61610342122786 23.58595265611185, 113.61601109814079 23.585864140162432, 113.61585310193013 23.585803225960632, 113.61557898802205 23.585730890346124, 113.6153714990225 23.585723276070855, 113.61520493675204 23.585882224066058, 113.61516591359151 23.586056400611785, 113.61516876894466 23.58617727723074)))"
-        },
-        {
-            "farmCode": "LBY",
-            "farmId": "766",
-            "id": 12828,
-            "isGenerateReport": 1,
-            "name": "分区5",
-            "pointCount": 45,
-            "pointWkt": "POINT (113.61692837797158 23.58435388968608)",
-            "regionCode": "LBY-MR-5",
-            "wkt": "MULTIPOLYGON (((113.61726902399624 23.584875938109313, 113.61732981922493 23.584649032707855, 113.61741785928217 23.58458954618279, 113.6176284415812 23.584287354634938, 113.61761892373723 23.584146966435544, 113.61762249292879 23.584041080420736, 113.61758442155264 23.584010147427676, 113.61752374529698 23.583939953328095, 113.6174499820059 23.583857861923292, 113.61723702024568 23.5839113997961, 113.61706331959229 23.583947091711153, 113.61689794705232 23.583967317129648, 113.61673019505157 23.58399468093132, 113.61659218631306 23.584025613924393, 113.61641848565968 23.584054167456387, 113.61624716446725 23.584093428562902, 113.61621623147425 23.584286164904498, 113.61622218012678 23.584531249388036, 113.6162186109351 23.58466211974327, 113.61629713314835 23.584684724622857, 113.6166052733487 23.58470970896351, 113.61669926205845 23.584731124112597, 113.61678016373266 23.584778713332653, 113.61680276861217 23.584819164169826, 113.61683846052725 23.58481916416982, 113.61689080866942 23.584775144141148, 113.61697884872665 23.58482035390024, 113.61709484745067 23.584864516696555, 113.61726902399624 23.584875938109313)))"
-        },
-        {
-            "farmCode": "LBY",
-            "farmId": "766",
-            "id": 126202,
-            "isGenerateReport": 1,
-            "name": "LBY-MR-SG1",
-            "pointCount": null,
-            "pointWkt": "POINT (113.67786773078139 23.512815571668426)",
-            "regionCode": "LBY-MR-SG1",
-            "wkt": "POLYGON ((113.67643632076339 23.512862037149922, 113.67909107058698 23.51321600379307, 113.67909107058698 23.512673254940246, 113.67661330408497 23.512472673842463, 113.67643632076339 23.512862037149922))"
-        },
-        {
-            "farmCode": "LBY",
-            "farmId": "766",
-            "id": 172047,
-            "isGenerateReport": 1,
-            "name": "认养分区",
-            "pointCount": null,
-            "pointWkt": "POINT (113.61573550741103 23.586606696698798)",
-            "regionCode": "LBY认养分区",
-            "wkt": "MULTIPOLYGON (((113.61553138381385 23.586555391814727, 113.61578836560238 23.586770495089638, 113.61593018147823 23.586692924660838, 113.61571507820327 23.5864349910878, 113.61553138381385 23.586555391814727)))"
-        },
-        {
-            "farmCode": "LBY",
-            "farmId": "766",
-            "id": 175094,
-            "isGenerateReport": 1,
-            "name": "12",
-            "pointCount": null,
-            "pointWkt": "POINT (113.61860504330416 23.583859757151316)",
-            "regionCode": "LBY-MR-12",
-            "wkt": "MULTIPOLYGON (((113.61790764544605 23.58437349638575, 113.61810434755591 23.58448136528483, 113.61834039008784 23.58457781277093, 113.61887973458238 23.58461715319288, 113.61901298439875 23.584476289101246, 113.61925029597637 23.584407760624345, 113.61937973865497 23.58437349638575, 113.61932390063691 23.584164103817216, 113.61923506742585 23.5838836446801, 113.61920587937084 23.583660292607078, 113.61927060071025 23.58345216908441, 113.61940004338908 23.5832846550295, 113.6191449651692 23.58325927411221, 113.61896095351813 23.583223740827805, 113.61884166320624 23.58314759807564, 113.61873379430745 23.58305115058954, 113.6185180565094 23.583087952919755, 113.61840257333529 23.58318947658927, 113.61825028783096 23.583260543158076, 113.61815510939073 23.583216126552543, 113.61807262140928 23.583183131360045, 113.61779216227194 23.583299883580025, 113.61792541208831 23.58360953077215, 113.61817668317042 23.583615876001545, 113.61831374012445 23.583843035212283, 113.61829216634476 23.583925523193727, 113.61821348550086 23.5839014113223, 113.6179825191524 23.583770699597665, 113.6178530764738 23.583793542423393, 113.61783784792328 23.583905218459847, 113.617946985868 23.58400166594589, 113.61795713823494 23.584085422973374, 113.61786703597829 23.58419963710162, 113.61785815265716 23.58428847031246, 113.61790764544605 23.58437349638575)))"
-        },
-        {
-            "farmCode": "LBY",
-            "farmId": "766",
-            "id": 175095,
-            "isGenerateReport": 1,
-            "name": "13",
-            "pointCount": null,
-            "pointWkt": "POINT (113.61907779775447 23.582774628335315)",
-            "regionCode": "LBY-MR-13",
-            "wkt": "MULTIPOLYGON (((113.6185180565094 23.583087952919755, 113.61873379430756 23.58305115058954, 113.61884166320624 23.58314759807564, 113.61896095351813 23.583223740827805, 113.6191449651692 23.58325927411221, 113.61940004338908 23.5832846550295, 113.61952853428329 23.58303148037845, 113.61974554112703 23.582682175502953, 113.61942574156774 23.58233191884284, 113.61909737594897 23.58227005285653, 113.61872713181651 23.58242614549863, 113.61843207865172 23.58267265765886, 113.61843112686734 23.583051467850964, 113.6185180565094 23.583087952919755)))"
-        },
-        {
-            "farmCode": "LBY",
-            "farmId": "766",
-            "id": 175096,
-            "isGenerateReport": 1,
-            "name": "15",
-            "pointCount": null,
-            "pointWkt": "POINT (113.61729343325402 23.581078231145653)",
-            "regionCode": "LBY-MR-15",
-            "wkt": "MULTIPOLYGON (((113.61579634969576 23.580895993441118, 113.61623258421344 23.58139885286704, 113.61657522659812 23.581547965756727, 113.61743341886756 23.5818731587608, 113.61737155288142 23.58216345300349, 113.61798704012836 23.582252286214498, 113.61852479831566 23.58088806190449, 113.61799973058703 23.58035347633188, 113.61769991850042 23.580115530231183, 113.61644039047451 23.580399479244647, 113.61574558786083 23.580797642386187, 113.61579634969576 23.580895993441118)))"
-        }
-    ]
-    areaList.value = data;
-    // regionId.value = (data && data.length && data[0].id) || "";
-    changeRegion(regionId.value);
-    callback && callback();
-    // VE_API.region.list({ farmId: gardenId.value }).then(({ data, code }) => {
-    // });
-};
 
 const farmProgress = ref(0)
 
@@ -974,6 +923,41 @@ const handleExpertDiagnosis = () => {
         padding: 4px 12px 8px 12px;
         width: 100%;
         box-sizing: border-box;
+        
+        // ::v-deep {
+        //     .el-select__input {
+        //         color: #2199F8;
+        //     }
+        //     .el-select__wrapper {
+        //         color: #2199F8;
+        //         min-height: 30px;
+        //         line-height: 28px;
+        //         box-shadow: 0 0 0 1px rgba(33, 153, 248, 0.3) inset;
+        //     }
+        //     .el-select__caret {
+        //         color: #2199F8;
+        //     }
+        //     .el-select__placeholder {
+        //         color: #2199F8;
+        //     }
+        //     .el-radio {
+        //         margin-right: 16px;
+        //     }
+        //     .el-input__wrapper {
+        //         box-shadow: 0 0 0 1px rgba(33, 153, 248, 0.3) inset;
+        //     }
+        //     .el-input__prefix {
+        //         color: #2199F8;
+        //     }
+        //     .el-input__inner {
+        //         color: #2199F8;
+        //         --el-input-placeholder-color: rgba(33, 153, 248, 0.43);
+        //     }
+        //     .el-tag.el-tag--info {
+        //         --el-tag-text-color: #2199F8;
+        //         --el-tag-bg-color: rgba(33, 153, 248, 0.1);
+        //     }
+        // }
         .farm-info {
             color: rgba(0, 0, 0, 0.6);
             font-size: 14px;
@@ -1415,4 +1399,46 @@ const handleExpertDiagnosis = () => {
         margin: 30px auto 0;
     }
 }
+.task-tips-popup {
+    width: 75%;
+    padding: 28px 28px 20px;
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    justify-content: center;
+    .create-farm-icon{
+        width: 40px;
+        height: 40px;
+        margin-bottom: 12px;
+    }
+    .farm-check-icon{
+        width: 68px;
+        height: 68px;
+        margin-bottom: 12px;
+    }
+    .create-farm-text{
+        font-size: 20px;
+        font-weight: 500;
+        line-height: 40px;
+        margin-bottom: 32px;
+        text-align: center;
+        &.success-text{
+            font-size: 23px;
+            font-weight: 400;
+        }
+    }
+    .main-text {
+        color: #2199F8;
+    }
+    .create-farm-btn{
+        width: 100%;
+        box-sizing: border-box;
+        padding: 8px;
+        border-radius: 25px;
+        font-size: 16px;
+        background: #2199F8;
+        color: #fff;
+        text-align: center;
+    }
+}
 </style>

+ 78 - 13
src/views/old_mini/task_condition/components/calendar.vue

@@ -4,7 +4,7 @@
             <div class="header-l">
                 <div class="top-l">
                     <el-icon class="icon icon-l" color="#999999" size="11" @click="prevPeriod"><ArrowLeftBold /></el-icon>
-                    <span class="top-tag red">3过期</span>
+                    <span class="top-tag red">{{ expiredCounts }}过期</span>
                 </div>
                 <div class="top-c">
                     <span class="header-text">
@@ -12,7 +12,7 @@
                     </span>
                 </div>
                 <div class="top-r">
-                    <span class="top-tag orange">5待完成</span>
+                    <span class="top-tag orange">{{ completedCounts }}待完成</span>
                     <el-icon class="icon icon-r" color="#999999" size="11" @click="nextPeriod"><ArrowRightBold /></el-icon>
                 </div>
 
@@ -35,7 +35,7 @@
                     <span class="days-one">{{ day.day }}</span>
                 </div>
                 <div v-if="day.solarTerm" class="solar-term">{{ day.solarTerm }}</div>
-                <div v-if="day.typeName" class="type-num">{{ day.typeName.farmWorkName.length }}</div>
+                <div v-if="day.typeName" class="type-num">{{ day.typeName.lengthVal }}</div>
                 <!-- <div v-if="day.isHeatWarning" class="heat-warning"></div>
                 <div v-if="day.typeName" class="type-name">
                     <div class="type-text">{{ day.typeName.farmWorkName }}</div>
@@ -47,6 +47,7 @@
 
 <script setup>
 import { ref, computed, onDeactivated, onMounted } from "vue";
+import solarLunar from "solarlunar";
 // const props = defineProps({
 //     calendarWorkList: {
 //         type: Array,
@@ -60,6 +61,8 @@ const startDate = ref(new Date(today));
 // 定义星期几的名称
 const weekdays = ["周一", "周二", "周三", "周四", "周五", "周六", "周日"];
 const weekdaysShort = ["一", "二", "三", "四", "五", "六", "日"];
+// 存储任务列表数据
+const taskListData = ref([]);
 
 const days = computed(() => {
     return Array.from({ length: 7 }, (_, i) => {
@@ -77,27 +80,74 @@ const calendarDays = computed(() => {
         // 调整显示:周一显示为"一",周二显示为"二",...,周日显示为"日"
         const displayDayOfWeek = dayOfWeek === 0 ? "日" : weekdaysShort[dayOfWeek - 1];
 
+        // 获取该日期的节气
+        const solarTerm = getSolarTerm(date);
+        // 获取该日期的农事数据
+        const typeName = getTaskByDate(formatDate(date));
+
         daysList.push({
             day: date.getDate(),
             date: formatDate(date),
             isToday: formatDate(date) === formatDate(today),
             dayOfWeek: displayDayOfWeek,
-            // 模拟数据 - 在实际应用中可以从props中获取
-            solarTerm: i === 3 ? "白露" : null,
+            solarTerm: solarTerm, // 使用真实计算的节气数据
             isHeatWarning: i === 5,
-            typeName:
-                i === 2
-                    ? { farmWorkType: 2, farmWorkName: "播种" }
-                    : i === 4
-                    ? { farmWorkType: 1, farmWorkName: "施肥" }
-                    : i === 6
-                    ? { farmWorkType: 3, farmWorkName: "收割" }
-                    : null,
+            typeName: typeName, // 使用传入的任务数据
         });
     }
     return daysList;
 });
 
+// 根据日期获取农事数据
+function getTaskByDate(dateStr) {
+    if (!taskListData.value || taskListData.value.length === 0) {
+        return null;
+    }
+    // 查找匹配日期的农事
+    const matchedTasks = taskListData.value.filter(task => {
+        if (!task.executeDate) return false;
+        // 格式化日期字符串进行比较(确保格式一致)
+        const taskDate = formatDate(new Date(task.executeDate));
+        return taskDate === dateStr;
+    });
+
+    if (matchedTasks.length === 0) {
+        return null;
+    }
+
+    // const farmWorkNames = matchedTasks.map(task => task.farmWorkName || '').filter(Boolean);
+    return {
+        lengthVal: matchedTasks.length,
+        // farmWorkName: farmWorkNames.length > 1 ? farmWorkNames.join('、') : farmWorkNames[0] || ''
+    };
+}
+
+function setSolarTerm(taskList) {
+    // 存储任务列表数据
+    taskListData.value = taskList || [];
+    // 为每个任务计算节气
+    for (let item of taskListData.value) {
+        if (item.executeDate) {
+            item.solarTerm = getSolarTerm(new Date(item.executeDate));
+        }
+    }
+}
+
+const expiredCounts = ref(0);
+const completedCounts = ref(0);
+function setCounts(index, counts) {
+    if (index === 1) {
+        completedCounts.value = counts;
+    } else if (index === 2) {
+        expiredCounts.value = counts;
+    }
+}
+
+defineExpose({
+    setSolarTerm,
+    setCounts
+});
+
 const dateRange = computed(() => {
     let start = calendarDays.value[0].date;
     start = start.replace(/-/g, ".");
@@ -121,6 +171,21 @@ function formatDate(date) {
     )}`;
 }
 
+// 获取指定日期的节气
+function getSolarTerm(date) {
+    try {
+        const year = date.getFullYear();
+        const month = date.getMonth() + 1; // getMonth() 返回 0-11,需要加1
+        const day = date.getDate();
+        const lunar = solarLunar.solar2lunar(year, month, day);
+        // lunar.term 返回节气名称,如果没有节气则返回空字符串
+        return lunar.term || null;
+    } catch (error) {
+        console.error("获取节气失败:", error);
+        return null;
+    }
+}
+
 function prevPeriod() {
     startDate.value.setDate(startDate.value.getDate() - 7);
     startDate.value = new Date(startDate.value);

+ 216 - 18
src/views/old_mini/task_condition/components/task.vue

@@ -3,19 +3,19 @@
         <div class="task-top">
             <div class="map-container" ref="mapContainer"></div>
             <div class="calendar-wrap">
-                <calendar></calendar>
+                <calendar ref="calendarRef"></calendar>
             </div>
         </div>
         <div class="task-list">
             <div class="list-filter">
                 <div class="filter-item" :class="{ active: activeIndex === 0 }" @click="handleActiveFilter(0)">
-                    待确认(9)
+                    待确认({{ taskCounts[0] || 0 }})
                 </div>
                 <div class="filter-item" :class="{ active: activeIndex === 1 }" @click="handleActiveFilter(1)">
-                    待完成(4)
+                    待完成({{ taskCounts[1] || 0 }})
                 </div>
                 <div class="filter-item" :class="{ active: activeIndex === 2 }" @click="handleActiveFilter(2)">
-                    已完成(8)
+                    已完成({{ taskCounts[2] || 0 }})
                 </div>
             </div>
             <div class="select-group">
@@ -29,26 +29,28 @@
                     <el-option v-for="item in areaOptions1" :key="item.value" :label="item.label" :value="item.value" />
                 </el-select>
             </div>
-            <div class="task-content">
-                <div class="task-item" v-for="item in 10" :key="item">
-                    <task-item>
+            <!-- <div class="task-content-loading" v-if="loading && noData" v-loading="loading">
+            </div> -->
+            <div class="task-content" v-loading="loading">
+                <div class="task-item" v-for="item in taskList" :key="item.id || item.workRecordId">
+                    <task-item :status="activeIndex === 2 ? 1 : 0" :item-data="item">
                         <template #footer>
                             <div class="item-footer" v-if="activeIndex === 0 || activeIndex === 1">
-                                <div class="footer-l" @click="toDetail">
+                                <div class="footer-l" @click="toDetail(item)">
                                     查看详情
                                 </div>
                                 <div class="footer-r">
-                                    <div class="btn second">
+                                    <div class="btn second" @click="handleAction(item)">
                                         {{ activeIndex === 0 ? "忽略" : "转发给客户" }}
                                     </div>
-                                    <div class="btn primary" @click="toPage">
+                                    <div class="btn primary" @click="toPage(item)">
                                         {{ activeIndex === 0 ? "下发农事" : "请求确认" }}
                                     </div>
                                 </div>
                             </div>
                             <div class="item-footer" v-else>
                                 <div class="footer-l farm-name-text">
-                                    来自<span class="name-text">从化荔博园</span>
+                                    来自<span class="name-text">{{ item.farmName || '未知农场' }}</span>
                                 </div>
                                 <div class="footer-r">
                                     <!-- <div class="btn warning">
@@ -62,15 +64,31 @@
                         </template>
                     </task-item>
                 </div>
+                <div class="empty-data" v-if="noData">暂无数据</div>
             </div>
         </div>
     </div>
     <upload-execute ref="uploadExecuteRef" />
+
+    <popup v-model:show="showTaskPopup" round class="task-tips-popup">
+        <template v-if="taskPopupType === 'warning'">
+            <img  class="create-farm-icon" src="@/assets/img/home/create-farm-icon.png" alt="" />
+            <div class="create-farm-text">
+                <div>您确认忽略 <span class="main-text">{{ currentTask?.farmName }}</span> 的 <span class="main-text">{{ currentTask?.farmWorkName }}</span> 农事吗</div>
+            </div>
+        </template>
+        <template v-else>
+            <img class="farm-check-icon" src="@/assets/img/home/right.png" alt="">
+            <div class="create-farm-text success-text">农事已下发成功</div>
+        </template>
+        <div class="create-farm-btn" @click="handlePopupBtn">{{ taskPopupType === 'warning' ? '确认忽略' : '我知道了' }}</div>
+    </popup>
 </template>
 
 <script setup>
-import { computed, nextTick, onMounted, ref } from "vue";
+import { computed, nextTick, onMounted, ref, watch } from "vue";
 import { useStore } from "vuex";
+import { Popup } from "vant";
 import IndexMap from "../../farm_manage/map/index";
 import taskItem from "@/components/taskItem.vue";
 import calendar from "./calendar.vue"
@@ -83,6 +101,7 @@ const mapContainer = ref(null);
 const tabBarHeight = computed(() => store.state.home.tabBarHeight);
 const uploadExecuteRef = ref(null);
 const dateValue = ref("1");
+const calendarRef = ref(null);
 const dateOptions = [
     { value: "1", label: "农事类型" },
     { value: "2", label: "2" },
@@ -101,31 +120,146 @@ const areaOptions1 = [
     { value: "3", label: "3" },
 ];
 
+// 任务列表数据
+const taskList = ref([]);
+// 各状态任务数量
+const taskCounts = ref([0, 0, 0]);
+// 当前选中的筛选索引
+const activeIndex = ref(0);
+const noData = ref(false);
+const loading = ref(false);
+
+const showTaskPopup = ref(false);
+const taskPopupType = ref('warning');
+
+// 根据 activeIndex 计算 startFlowStatus
+const getStartFlowStatus = (index) => {
+    const statusMap = {
+        0: 0, // 待确认
+        1: 4, // 待完成
+        2: 5  // 已完成
+    };
+    return statusMap[index] ?? 0;
+};
+
+// 获取单个状态的任务数量
+function getTaskCount(flowStatus, index) {
+    const location = store.state.home.miniUserLocationPoint;
+    return VE_API.z_farm_work_record.getSimpleList({ role: 2, location, flowStatus }).then(({data}) => {
+        if (Array.isArray(data)) {
+            taskCounts.value[index] = data.length;
+        } else if (data?.total !== undefined) {
+            taskCounts.value[index] = data.total;
+        } else {
+            taskCounts.value[index] = 0;
+        }
+    }).catch((error) => {
+        console.error(`获取状态${index}任务数量失败:`, error);
+        taskCounts.value[index] = 0;
+    });
+}
+
+// 初始化时获取所有状态的任务数量
+function initTaskCounts() {
+    const location = store.state.home.miniUserLocationPoint;
+    // 并行请求三个状态的数量
+    Promise.all([
+        getTaskCount(0, 0),  // 待确认
+        getTaskCount(4, 1),  // 待完成
+        getTaskCount(5, 2)   // 已完成
+    ]);
+}
+
 onMounted(() => {
+    // 初始化时获取所有状态的数量
+    initTaskCounts();
+    // 加载当前选中状态的数据列表
+    getSimpleList();
     const point = store.state.home.miniUserLocationPoint;
     nextTick(() => {
         indexMap.initMap(point, mapContainer.value, true);
     });
 });
 
-const activeIndex = ref(0);
+// 监听 activeIndex 变化,重新加载数据
+watch(activeIndex, () => {
+    getSimpleList();
+});
+
+function getSimpleList() {
+    loading.value = true;
+    noData.value = false;
+    const location = store.state.home.miniUserLocationPoint;
+    const startFlowStatus = getStartFlowStatus(activeIndex.value);
+    VE_API.z_farm_work_record.getSimpleList({ role: 2, location, flowStatus: startFlowStatus }).then(({data}) => {
+        loading.value = false;
+        // 假设返回的数据结构是 { list: [], total: 0 } 或者直接是数组
+        if (Array.isArray(data) && data.length > 0) {
+            taskList.value = data;
+            // 更新当前状态的数量
+            taskCounts.value[activeIndex.value] = data.length;
+            calendarRef.value && calendarRef.value.setCounts(activeIndex.value, taskCounts.value[activeIndex.value])
+            if (activeIndex.value === 0) {
+                calendarRef.value && calendarRef.value.setSolarTerm(taskList.value)
+                indexMap.initData(taskList.value)
+            }
+        } else {
+            taskList.value = [];
+            taskCounts.value[activeIndex.value] = 0;
+            noData.value = true;
+        }
+    }).catch((error) => {
+        console.error('获取任务列表失败:', error);
+        loading.value = false;
+        taskList.value = [];
+        noData.value = true;
+    });
+}
+
 function handleActiveFilter(i) {
     activeIndex.value = i;
 }
 
-function toPage() {
+function toPage(item) {
     // router.push("/servicZes_agri")
     if (activeIndex.value === 1) {
         uploadExecuteRef.value.showPopup();
     } else {
+        // 下发农事请求
+        taskPopupType.value = 'success';
+        showTaskPopup.value = true;
         // router.push("/service_agri");
     }
 }
 
-function toDetail() {
-    router.push({
-        path: "/modify_work",
-    });
+function toDetail(item) {
+    if (activeIndex.value === 0) {
+        router.push({
+            path: "/modify_work",
+            query: { id: item.id }
+        });
+    } else {
+        router.push({
+            path: "/completed_work",
+            query: { id: item.id }
+        });
+    }
+}
+
+const currentTask = ref(null);
+function handleAction(item) {
+    if (activeIndex.value === 0) {
+        taskPopupType.value = 'warning';
+        showTaskPopup.value = true;
+        currentTask.value = item;
+    }
+}
+
+function handlePopupBtn() {
+    showTaskPopup.value = false;
+    if (taskPopupType.value === 'warning') {
+        // 确认忽略
+    }
 }
 </script>
 
@@ -180,7 +314,27 @@ function toDetail() {
         padding: 10px 12px;
     }
 
+    .task-content-loading {
+        height: 80px;
+        border-radius: 8px;
+        position: absolute;
+        top: 60px;
+        left: 0;
+        width: 100%;
+    }
+
+    .task-content {
+        min-height: 80px;
+    }
+
+    .empty-data {
+        text-align: center;
+        font-size: 14px;
+        color: #6F7274;
+        padding: 20px 0;
+    }
     .task-list {
+        position: relative;
         background: #fff;
         padding: 8px 12px;
     }
@@ -282,4 +436,48 @@ function toDetail() {
         }
     }
 }
+
+
+.task-tips-popup {
+    width: 75%;
+    padding: 28px 28px 20px;
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    justify-content: center;
+    .create-farm-icon{
+        width: 40px;
+        height: 40px;
+        margin-bottom: 12px;
+    }
+    .farm-check-icon{
+        width: 68px;
+        height: 68px;
+        margin-bottom: 12px;
+    }
+    .create-farm-text{
+        font-size: 20px;
+        font-weight: 500;
+        line-height: 40px;
+        margin-bottom: 32px;
+        text-align: center;
+        &.success-text{
+            font-size: 23px;
+            font-weight: 400;
+        }
+    }
+    .main-text {
+        color: #2199F8;
+    }
+    .create-farm-btn{
+        width: 100%;
+        box-sizing: border-box;
+        padding: 8px;
+        border-radius: 25px;
+        font-size: 16px;
+        background: #2199F8;
+        color: #fff;
+        text-align: center;
+    }
+}
 </style>

+ 5 - 0
yarn.lock

@@ -10092,6 +10092,11 @@ socks@^2.8.6:
     ip-address "^10.0.1"
     smart-buffer "^4.2.0"
 
+solarlunar@^2.0.7:
+  version "2.0.7"
+  resolved "https://registry.npmjs.org/solarlunar/-/solarlunar-2.0.7.tgz"
+  integrity sha512-2SfuCCgAAxFU5MTMYuKGbRgRLcPTJQf3azMEw/GmBpHXA7N2eAQJStSqktZJjnq4qRCboBPnqEB866+PCregag==
+
 sort-asc@^0.1.0:
   version "0.1.0"
   resolved "https://registry.npmjs.org/sort-asc/-/sort-asc-0.1.0.tgz"