Bläddra i källkod

feat:添加农资选择方案流程和对接农事服务需求大厅接口

wangsisi 2 veckor sedan
förälder
incheckning
98874490d1

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

@@ -52,5 +52,10 @@ module.exports = {
     listBySchemeId:{
         url: config.base_dev_url + "z_farm_work_lib/listBySchemeId",
         type: "get",
+    },
+    //选择方案
+    selectSchemes:{
+        url: config.base_dev_url + "container_farm_work_scheme/selectSchemes",
+        type: "get",
     }
 }

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

@@ -27,9 +27,24 @@ module.exports = {
         url: url + "/addExecuteImg",
         type: "post",
     },
+    //按区县统计服务亩数
+    statisticsAreaByDistrict: {
+        url: url + "/statisticsAreaByDistrict",
+        type: "get",
+    },
     // 获取触发照片
     getTriggerImg: {
         url: config.base_dev_url + "farm-work-manual-trigger/getImagesByRecordId",
         type: "get",
     },
+    //农事类型列表
+    getFarmWorkTypeList: {
+        url: config.base_dev_url + "z_farm_work_type/list",
+        type: "get",
+    },
+    //需求大厅接单简单农事记录列表
+    getOrderReceivingSimpleList:{
+        url: url + "/getOrderReceivingSimpleList",
+        type: "get",
+    }
 }

+ 2 - 2
src/components/pageComponents/FarmInfoCard.vue

@@ -5,7 +5,7 @@
                 <img class="map-img" :src="data.mapImage || '/map.png'" alt="地图" />
                 <div class="item-info">
                     <div class="item-header">
-                        <div class="farm-name van-ellipsis" :style="{ maxWidth: data.maxWidth || 'calc(100% - 100px)' }">{{ data.farmName }}</div>
+                        <div class="farm-name van-ellipsis" :style="{ maxWidth: data.maxWidth || 'calc(100% - 90px)' }">{{ data.farmName }}</div>
                         <div class="tags">
                             <span class="tag tag-area">{{ data.area }}</span>
                             <span class="tag tag-variety">{{ data.variety }}</span>
@@ -151,7 +151,7 @@ const handleRemind = () => {
                 .farm-name {
                     font-weight: 600;
                     color: #000;
-                    max-width: calc(100% - 100px);
+                    max-width: calc(100% - 90px);
                     // max-width: 100px;
                 }
                 .tags {

+ 1 - 15
src/components/pageComponents/PlanList.vue

@@ -85,13 +85,6 @@ const curRole = localStorage.getItem("SET_USER_CUR_ROLE")
 const menuData = ref([]);
 const containerRef = ref(null);
 
-function getPlanWorkList() {
-    VE_API.monitor
-        .listByFarmId({ farmId: props.farmId })
-        .then(({ data }) => {
-            menuData.value = data;
-        });
-}
 
 const getFarmTypeText = (type) => {
     const value = typeof type === "string" ? type.trim() : type;
@@ -102,8 +95,7 @@ const getFarmTypeText = (type) => {
 };
 
 const handleEdit = (sub) => {
-    if(curRole == 2){
-        // router.push(`/edit_plan?data=${encodeURIComponent(JSON.stringify(sub))}`);
+    if(curRole == 2 && props.isEdit){
         router.push({
             path: "/edit_plan",
             query: { data: JSON.stringify(sub) }
@@ -111,12 +103,6 @@ const handleEdit = (sub) => {
     }
 };
 
-onMounted(() => {
-    if(props.farmId){
-        getPlanWorkList();
-    }
-});
-
 watch(() => (props.schemeId || props.containerId), (newVal) => {
     if(newVal){
         getListBySchemeId();

+ 10 - 2
src/components/popup/tipPopup.vue

@@ -5,6 +5,7 @@
         class="tip-popup"
         :overlay-style="overlayStyle"
         :close-on-click-overlay="closeOnClickOverlay"
+        @click-overlay="handleClickOverlay"
     >
         <template v-if="type === 'create'">
             <img class="tip-icon create-icon" src="@/assets/img/home/create-farm-icon.png" alt="" />
@@ -16,7 +17,7 @@
             <img class="tip-icon success-icon" src="@/assets/img/home/right.png" alt="" />
             <div class="tip-text success-text">{{ text }}</div>
         </template>
-        <div class="tip-btn" @click="handleBtnClick">
+        <div class="tip-btn" @click.stop="handleBtnClick">
             {{ buttonText || (type === "create" ? "去创建农场" : "我知道了") }}
         </div>
     </popup>
@@ -60,7 +61,7 @@ const props = defineProps({
     },
 });
 
-const emit = defineEmits(["update:show", "confirm"]);
+const emit = defineEmits(["update:show", "confirm", "handleClickOverlay"]);
 
 // 处理v-model双向绑定
 const showValue = computed({
@@ -81,6 +82,13 @@ const textLines = computed(() => {
 
 const handleBtnClick = () => {
     emit("confirm");
+    if(props.buttonText !== "分享微信"){
+        emit("update:show", false);
+    }
+};
+
+const handleClickOverlay = () => {
+    emit("handleClickOverlay");
     emit("update:show", false);
 };
 </script>

+ 10 - 2
src/components/taskItem.vue

@@ -60,7 +60,10 @@
                         <div class="farm-addr">{{ itemData?.address }}</div>
                     </div>
                 </div>
-                <!-- <div class="right-wrap">特别关注</div> -->
+                <div class="right-wrap" v-if="isHall">
+                    <el-icon><Plus /></el-icon>
+                    <span>关注</span>
+                </div>
             </div>
             <slot name="footer"></slot>
         </div>
@@ -142,7 +145,9 @@
     </div>
     
     <!-- 处方卡片 -->
-    <detail-dialog ref="detailDialogRef" />
+    <Teleport to="body">
+        <detail-dialog ref="detailDialogRef" />
+    </Teleport>
 
     <!-- 分享农事成效弹窗 -->
     <review-popup ref="reviewPopupRef" />
@@ -460,6 +465,7 @@ const toDetail = (status, id, farmWorkId) => {
     }
     .img-text-wrap {
         display: flex;
+        align-items: flex-start;
         justify-content: space-between;
         .left-wrap {
             display: flex;
@@ -511,6 +517,8 @@ const toDetail = (status, id, farmWorkId) => {
             }
         }
         .right-wrap {
+            display: flex;
+            align-items: center;
             color: #FF953D;
             font-size: 12px;
         }

+ 1 - 0
src/router/globalRoutes.js

@@ -276,6 +276,7 @@ export default [
     {
         path: "/agricultural_plan",
         name: "AgriculturalPlan",
+        meta: { keepAlive: true },
         component: () => import("@/views/old_mini/plan/index.vue"),
     },
     // 农事管理

+ 3 - 5
src/views/old_mini/create_farm/editMap.vue

@@ -93,7 +93,7 @@ const goBack = () => {
     // 不需要做任何处理,直接返回即可
     
     if (type.value !== 'edit') {
-        router.replace("/create_farm")
+        router.replace(`/create_farm?from=${route.query.from}&type=${route.query.type}`)
     }else{
         router.back()
     }
@@ -105,7 +105,7 @@ function backgToCreate() {
     // 保持 store 中的数据不变
     
     if (type.value !== 'edit') {
-        router.replace("/create_farm")
+        router.replace(`/create_farm?from=${route.query.from}&type=${route.query.type}`)
     }else{
         router.back()
     }
@@ -130,16 +130,14 @@ const deletePolygon = () => {
 const confirm = () => {
     // getAreaGeometry
     const polygonData = editMap.getAreaGeometry()
-    console.log('编辑地图确认,获取的数据:', polygonData);
     
     // 标记为已确认,表示从编辑页面确认返回
     polygonData.isConfirmed = true;
-    console.log('设置确认标记后的数据:', polygonData);
     
     store.commit("home/SET_FARM_POLYGON", polygonData);
     
     if (type.value !== 'edit') {
-        router.replace("/create_farm")
+        router.replace(`/create_farm?from=${route.query.from}&type=${route.query.type}`)
     }else{
         router.back()
     }

+ 21 - 22
src/views/old_mini/create_farm/index.vue

@@ -128,7 +128,7 @@
                                             @input="handleFarmNameInput"
                                         />
                                     </el-form-item>
-                                    <checkbox v-if="paramsType !== 'client'" class="checkbox" icon-size="18px" shape="square" v-model="ruleForm.defaultFarm">是否勾选为默认农场</checkbox>
+                                    <Checkbox v-if="paramsType !== 'client'" class="checkbox" icon-size="18px" shape="square" v-model="ruleForm.defaultFarm">是否勾选为默认农场</Checkbox>
                                 </el-form>
                             </div>
                             <div class="create-btn">
@@ -465,16 +465,6 @@ const rules = reactive({
 const curRole = localStorage.getItem('SET_USER_CUR_ROLE');
 
 const submitForm = (formEl) => {
-    // if(route.query.type === 'client'){
-    //     router.push({
-    //         path: "/prescription",
-    //         query: {
-    //             farmId: 766,
-    //             containerId: 3,
-    //         },
-    //     });
-    //     return;
-    // }
     if (!formEl) return;
     formEl.validate((valid) => {
         if (valid) {
@@ -495,16 +485,25 @@ const submitForm = (formEl) => {
                 params.farmId = route.query.farmId;
             }
 
-            // if(route.query.type === 'client'){
-            //     router.push({
-            //         path: "/prescription",
-            //         query: {
-            //             farmId: params.farmId,
-            //             containerId: params.containerId,
-            //         },
-            //     });
-            //     return;
-            // }
+            if(route.query.type === 'client'){
+                // 处理 geom 参数,如果是数组需要序列化
+                const queryParams = {
+                    ...params,
+                    ...route.query,
+                };
+
+                // 如果 geom 是数组,需要序列化为 JSON 字符串
+                if (Array.isArray(queryParams.geom)) {
+                    queryParams.geom = JSON.stringify(queryParams.geom);
+                }
+                queryParams.speciesName = ruleForm.speciesItem?.name;
+
+                router.push({
+                    path: "/prescription",
+                    query: queryParams,
+                });
+                return;
+            }
             
             const apiCall = route.query.type === 'edit' 
                 ? VE_API.farm.updateFarm(params)
@@ -602,7 +601,7 @@ function toSubPage() {
     }
     
     router.push(
-        `/edit_map?mapCenter=${centerPoint.value}&pointName=${ruleForm.address}&pointAddress=${pointAddress.value}`
+        `/edit_map?mapCenter=${centerPoint.value}&pointName=${ruleForm.address}&pointAddress=${pointAddress.value}&from=${route.query.from}&type=client`
     );
 }
 

+ 49 - 124
src/views/old_mini/farm_manage/components/demandHall.vue

@@ -23,20 +23,12 @@
             <template #header>
                 <div class="header-bar"></div>
                 <div class="select-group">
-                    <el-select class="select-item" v-model="dateValue" placeholder="Select">
+                    <el-select class="select-item" v-model="selectParma.farmWorkTypeId" placeholder="农事类型" @change="getSimpleList">
                         <el-option
-                            v-for="item in dateOptions"
-                            :key="item.value"
-                            :label="item.label"
-                            :value="item.value"
-                        />
-                    </el-select>
-                    <el-select class="select-item" v-model="areaValue" placeholder="Select">
-                        <el-option
-                            v-for="item in areaOptions"
-                            :key="item.value"
-                            :label="item.label"
-                            :value="item.value"
+                            v-for="item in farmWorkTypeList"
+                            :key="item.id"
+                            :label="item.name"
+                            :value="item.id"
                         />
                     </el-select>
                     <el-select class="select-item" v-model="areaValue1" placeholder="Select">
@@ -63,9 +55,9 @@
                                         查看详情
                                     </div>
                                     <div class="footer-r">
-                                        <div class="btn second">
+                                        <!-- <div class="btn second">
                                             转发给客户
-                                        </div>
+                                        </div> -->
                                         <div class="btn primary" @click="showPriceSheetPopup(item)">
                                             生成报价单
                                         </div>
@@ -86,7 +78,7 @@
 
 <script setup>
 import { FloatingPanel } from "vant";
-import { computed, nextTick, onActivated, onMounted, ref } from "vue";
+import { computed, nextTick, onMounted, ref } from "vue";
 import { useStore } from "vuex";
 import IndexMap from "../map/index";
 import taskItem from "@/components/taskItem.vue";
@@ -112,112 +104,56 @@ const height = ref(anchors.value[0]);
 const indexMap = new IndexMap();
 const mapContainer = ref(null);
 
-onActivated(() => {
-});
-
 onMounted(() => {
     const point = store.state.home.miniUserLocationPoint;
+    getFarmWorkTypeList();
+    getSimpleList()
     nextTick(() => {
         indexMap.initMap(point, mapContainer.value, props.isCapital);
-        getSimpleList()
+        getStatisticsAreaByDistrict()
     });
 })
 
+defineExpose({
+    getSimpleList
+})
+
+const farmWorkTypeList = ref([]);
+function getFarmWorkTypeList() {
+    VE_API.z_farm_work_record.getFarmWorkTypeList().then(({data}) => {
+        farmWorkTypeList.value = data;
+    });
+}
+const selectParma = ref({
+    farmWorkTypeId: null,
+    areaValue1: null
+});
 const taskList = ref([]);
 function getSimpleList() {
     const location = store.state.home.miniUserLocationPoint;
-    const data = [{
-            "address": "博罗县伴永康农业基地",
-            "executeDate": "2025-11-07",
-            "executeEvidence": "",
-            "farmArea": "166",
-            "farmId": 93569,
-            "farmMiniUserId": 81881,
-            "farmMiniUserName": "飞鸟种植助手",
-            "addressName": "博罗县",
-            "farmName": "伴永康",
-            "farmWorkLibId": "2220003",
-            "farmWorkName": "分蘖营养",
-            "id": "275579",
-            "orderId": "774675844139323392",
-            "point": "POINT(113.49 23.03)",
-            "quoteCount": "0",
-            "typeId": "60828",
-            "typeName": "籼稻"
-        }, 
-        {
-            "address": "东源县万绿智慧水稻基地",
-            "executeDate": "2025-11-09",
-            "executeEvidence": "",
-            "farmArea": "186",
-            "farmId": 935469,
-            "farmMiniUserId": 81881,
-            "farmMiniUserName": "飞鸟种植助手",
-            "addressName": "东源县",
-            "farmName": "万绿智慧水稻基地",
-            "farmWorkLibId": "2220003",
-            "farmWorkName": "追肥",
-            "id": "275679",
-            "orderId": "774675844139323392",
-            "point": "POINT(114.190083 23.22143)",
-            "quoteCount": "0",
-            "typeId": "60828",
-            "typeName": "籼稻"
-        }, 
-        {
-            "address": "新丰县巨禾育基地",
-            "executeDate": "2025-11-07",
-            "executeEvidence": "",
-            "farmArea": "125",
-            "farmId": 93544469,
-            "farmMiniUserId": 81881,
-            "farmMiniUserName": "飞鸟种植助手",
-            "addressName": "新丰县",
-            "farmName": "巨禾育",
-            "farmWorkLibId": "2220003",
-            "farmWorkName": "追肥",
-            "id": "275215679",
-            "orderId": "774675844139323392",
-            "point": "POINT(114.2014 24.0624)",
-            "quoteCount": "0",
-            "typeId": "60828",
-            "typeName": "籼稻"
-        }, 
-        {
-            "address": "平远县禾子稻农业种植基地",
-            "executeDate": "2025-11-07",
-            "executeEvidence": "",
-            "farmArea": "178",
-            "farmId": 4277,
-            "farmMiniUserId": 81881,
-            "farmMiniUserName": "飞鸟种植助手",
-            "addressName": "平远县",
-            "farmName": "禾子稻",
-            "farmWorkLibId": "2220003",
-            "farmWorkName": "分蘖营养",
-            "id": "90677",
-            "orderId": "774675844139323392",
-            // "point": "POINT(115.889 24.5635)",
-            "point": "POINT(115.8888983 24.65535)",
-            "quoteCount": "0",
-            "typeId": "60828",
-            "typeName": "籼稻"
-        }]
-    taskList.value = data;
-    indexMap.initDataHall(data)
-    // VE_API.z_farm_work_record.getSimpleList({ role: 2, location, flowStatus: '2,3' }).then(({data}) => {
-    //     // 假设返回的数据结构是 { list: [], total: 0 } 或者直接是数组
-    //     console.log('dataaaaaaa', data)
-    //     if (Array.isArray(data) && data.length > 0) {
-    //         taskList.value = data;
-    //         indexMap.initData(taskList.value)
-    //     } else {
-    //         taskList.value = [];
-    //     }
-    // }).catch((error) => {
-    //     console.error('获取任务列表失败:', error);
-    //     taskList.value = [];
-    // });
+    const params = {
+        ...selectParma.value,
+        location,
+    }
+    VE_API.z_farm_work_record.getOrderReceivingSimpleList(params).then(({data}) => {
+        if (Array.isArray(data) && data.length > 0) {
+            taskList.value = data || [];
+        }
+    }).catch((error) => {
+        taskList.value = [];
+    });
+}
+
+const toPage = () => {
+    router.push("/create_farm?type=client&isReload=true&from=task_condition");
+}
+
+function getStatisticsAreaByDistrict() {
+    VE_API.z_farm_work_record.statisticsAreaByDistrict({flowStatus:'1,2,3'}).then(({data}) => {
+        if(data && data.length > 0) {
+            indexMap.initDataHall(data)
+        }
+    });
 }
 
 function toDetail(item) {
@@ -232,18 +168,7 @@ const searchValue = ref("");
 const search = () => {
     console.log(searchValue.value);
 };
-const dateValue = ref("1");
-const dateOptions = [
-    { value: "1", label: "农事类型" },
-    { value: "2", label: "2" },
-    { value: "3", label: "3" },
-];
-const areaValue = ref("1");
-const areaOptions = [
-    { value: "1", label: "距离" },
-    { value: "2", label: "2" },
-    { value: "3", label: "3" },
-];
+
 const areaValue1 = ref("1");
 const areaOptions1 = [
     { value: "1", label: "区域筛选" },

+ 3 - 281
src/views/old_mini/farm_manage/map/index.js

@@ -133,8 +133,7 @@ class IndexMap {
         });
         let style3 = new Style({
           text: new Text({
-            // text: '2.18 农事1',
-            text: feature.get('farmArea') + '亩',
+            text: feature.get('totalArea') ? feature.get('totalArea').toFixed(2) + '亩' : '--',
             offsetX: 0,
             offsetY: -30,
             font: "bold 12px sans-serif",
@@ -143,8 +142,7 @@ class IndexMap {
         });
         let style4 = new Style({
           text: new Text({
-            // text: '2.18 农事1',
-            text: feature.get('addressName'),
+            text: feature.get('districtName'),
             offsetX: 0,
             offsetY: -6,
             font: "bold 14px sans-serif",
@@ -215,282 +213,6 @@ class IndexMap {
   }
 
   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,
-    // }]
     this.gardenPointLayer.source.clear();
     if (taskList.length > 0) {  // 如果任务列表不为空,则添加任务点
       for (let item of taskList) {
@@ -509,7 +231,7 @@ class IndexMap {
     this.gardenHallLayer.source.clear();
     if (taskList.length > 0) {  // 如果任务列表不为空,则添加任务点
       for (let item of taskList) {
-        this.gardenHallLayer.source.addFeature(newPoint(item, "point", "hallGarden"))
+        this.gardenHallLayer.source.addFeature(newPoint(item, "centerPoint", "hallGarden"))
       }
       this.kmap.getView().fit(this.gardenHallLayer.source.getExtent(), { padding: [60, 40, 30, 40] });
       const finalZoom = this.kmap.getView().getZoom();

+ 220 - 139
src/views/old_mini/home/subPages/prescriptionPage.vue

@@ -3,35 +3,27 @@
         <div class="prescription-title">
             <img @click="goBack" src="@/assets/img/home/back.png" alt="" />
             <div class="title-name">农事处方维护单</div>
-            <div class="title-desc">请确定您的果园设施以及内容</div>
+            <div class="title-desc">请认真核对一下内容</div>
         </div>
         <div class="prescription-box">
             <div class="box-title">
                 <img src="@/assets/img/home/label-icon.png" />
-                农场设施
-            </div>
-            <div class="box-content">
-                <div class="box-item" v-for="(group, i) in prescriptionList" :key="i">
-                    <div class="item-name">{{group.name}}</div>
-                    <div class="item-checkbox">
-                        <el-radio-group v-model="group.checked">
-                            <el-radio-button v-for="(item, index) in group.items" :key="index" :label="item.name" :value="item.name" />
-                        </el-radio-group>
-                    </div>
-                </div>
-            </div>
-        </div>
-        <div class="prescription-box">
-            <div class="box-title">
-                <img src="@/assets/img/home/label-icon.png" />
-                生产基础
+                农场情况
             </div>
             <div class="box-content">
                 <div class="box-item" v-for="(group, i) in productList" :key="i">
-                    <div class="item-name">{{group.name}}</div>
+                    <div class="item-name">
+                        <span class="required-icon">*</span>
+                        <span>{{ group.name }}</span>
+                    </div>
                     <div class="item-checkbox">
                         <el-radio-group v-model="group.checked">
-                            <el-radio-button v-for="(item, index) in group.items" :key="index" :label="item.name" :value="item.name" />
+                            <el-radio-button
+                                v-for="(item, index) in group.items"
+                                :key="index"
+                                :label="item.name"
+                                :value="item.name"
+                            />
                         </el-radio-group>
                     </div>
                 </div>
@@ -40,153 +32,242 @@
         <div class="prescription-box">
             <div class="box-title">
                 <img src="@/assets/img/home/label-icon.png" />
-                投入产出
+                过往出现过的灾害 (多选)
             </div>
             <div class="box-content">
-                <div class="box-item" v-for="(group, i) in outputList" :key="i">
-                    <div class="item-name">{{group.name}}</div>
+                <div class="box-item" style="padding-top: 0">
                     <div class="item-checkbox">
-                        <el-radio-group v-model="group.checked">
-                            <el-radio-button v-for="(item, index) in group.items" :key="index" :label="item.name" :value="item.name" />
-                        </el-radio-group>
+                        <el-checkbox-group v-model="outputVal">
+                            <el-checkbox-button v-for="(item, index) in outputList" :key="index" :value="item.name">
+                                {{ item.name }}
+                            </el-checkbox-button>
+                        </el-checkbox-group>
                     </div>
                 </div>
             </div>
+            <div class="disaster-desc-box">
+                <span>其它异常</span>
+                <el-input
+                    v-model="disasterDesc"
+                    :autosize="{ minRows: 2, maxRows: 4 }"
+                    type="textarea"
+                    placeholder="请简单描述一下异常情况"
+                />
+            </div>
         </div>
 
         <!-- 按钮 -->
-        <div class="submit-btn">生成处方</div>
+        <div class="custom-bottom-fixed-btns">
+            <div class="bottom-btn secondary-btn" @click="handlePage">跳过</div>
+            <div class="bottom-btn primary-btn" @click="handlePage">生成处方</div>
+        </div>
     </div>
 </template>
 
 <script setup>
-import { ref } from "vue";
-import { useRouter } from "vue-router";
+import { ref, onActivated } from "vue";
+import { useRouter, useRoute } from "vue-router";
 const router = useRouter();
-const prescriptionList = ref([
-    {name: "喷药方式", items: [{name: "植保机"}, {name: "人工"}, {name: "喷药车"}]},
-    {name: "肥水设施", items: [{name: "漫灌"}, {name: "滴灌"}, {name: "喷灌"}, {name: "无"}]},
-    {name: "除草方式", items: [{name: "人工"}, {name: "除草机"}]},
-    {name: "生长调节", items: [{name: "人工"}, {name: "药物"}]},
-])
+const route = useRoute();
 const productList = ref([
-    {name: "土壤类型", items: [{name: "砂质土"}, {name: "黏质土"}, {name: "壤土"}]},
-    {name: "土壤改善", items: [{name: "结果树需要"}, {name: "全需要"}]},
-    {name: "除草方式", items: [{name: "结果树需要"}, {name: "全需要"}]},
-])
+    { name: "请选择您的果园土壤类型", items: [{ name: "砂质土" }, { name: "黏质土" }, { name: "壤土" }] },
+    { name: "请选择您的灌溉方式", items: [{ name: "砂质土" }, { name: "黏质土" }, { name: "壤土" }] },
+    { name: "是否需要改良土壤", items: [{ name: "需要" }, { name: "不需要" }] },
+]);
 const outputList = ref([
-    {name: "品质要求", items: [{name: "品质优先"}, {name: "质量优先"}]},
-    {name: "农残要求", items: [{name: "出口"}, {name: "商超"}, {name: "量贩"}]},
-])
+    { name: "灾害1" },
+    { name: "灾害2" },
+    { name: "灾害3" },
+    { name: "灾害4" },
+    { name: "灾害5" },
+    { name: "灾害6" },
+]);
+// 默认选中前两项
+const outputVal = ref(outputList.value.length >= 2
+        ? [outputList.value[0].name, outputList.value[1].name]
+        : outputList.value.length === 1
+        ? [outputList.value[0].name]
+        : []);
+const disasterDesc = ref("");
+// 初始化默认选中第一项
+onActivated(() => {
+    // 为 productList 的每个 group 设置默认选中第一项
+    productList.value.forEach((group) => {
+        if (group.items && group.items.length > 0 && !group.checked) {
+            group.checked = group.items[0].name;
+        }
+    });
+    // outputVal.value = outputList.value.length >= 2
+    //     ? [outputList.value[0].name, outputList.value[1].name]
+    //     : outputList.value.length === 1
+    //     ? [outputList.value[0].name]
+    //     : []
+});
 
 const goBack = () => {
-    router.go(-1)
-}
+    // router.go(-1);
+    router.replace(`/create_farm?from=${route.query.from}&type=${route.query.type}`)
+};
+
+const handlePage = () => {
+    // 获取所有需要传递的参数,包括 from 参数
+    const queryParams = {
+        containerId: route.query.containerId,
+    };
+    
+    // 如果存在 from 参数,继续传递
+    if (route.query.from) {
+        queryParams.from = route.query.from;
+    }
+    
+    // 传递所有农场相关的参数,以便在 agricultural_plan 页面创建农场
+    const farmParams = ['wkt', 'speciesId', 'containerId', 'agriculturalCreate', 'geom', 'address', 'mu', 'name', 'fzr', 'tel', 'defaultFarm', 'typeId', 'speciesName'];
+    farmParams.forEach(key => {
+        if (route.query[key] !== undefined) {
+            queryParams[key] = route.query[key];
+        }
+    });
+    router.push({
+        path: '/agricultural_plan',
+        query: queryParams
+    });
+};
 </script>
 
 <style lang="scss" scoped>
 .prescription-page {
-  position: relative;
-  width: 100%;
-  height: 100vh;
-  overflow: auto;
-  box-sizing: border-box;
-  background: linear-gradient(to left, #E6F2FF, #8Fc5FE);
-  .prescription-title {
-    padding: 16px 14px;
-    background: url('@/assets/img/home/page-bg.png') no-repeat bottom right /149px 116px;
-    background-position-y: 30px;
-    img {
-        width: 24px;
-    }
-    .title-name {
-        font-size: 22px;
-        color: #2E2E2E;
-        text-shadow: 0px 1px 1px rgba(0,0,0,0.05);
-        font-weight: 800;
-        padding: 21px 0 4px 6px;
-    }
-    .title-desc {
-        font-size: 14px;
-        color: rgba(49,49,49,0.56);
-        padding-left: 6px;
-    }
-  }
-  .prescription-box {
-      background: #FFFFFF;
-      box-shadow: 0 2px 2px 0 rgba(0,0,0,0.1);
-      border-radius: 10px;
-      margin: 0 10px 10px;
-      box-sizing: border-box;
-      padding-bottom: 10px;
-      .box-title {
-        margin: 0 10px;
-        box-sizing: border-box;
-        border-bottom: 1px solid rgba(0,0,0,0.17);
-        font-weight: 800;
-        font-size: 18px;
-        color: #222222;
-        padding: 15px 0 10px;
+    position: relative;
+    width: 100%;
+    height: calc(100vh - 62px);
+    overflow: auto;
+    box-sizing: border-box;
+    background: linear-gradient(to left, #e6f2ff, #8fc5fe);
+    .prescription-title {
+        padding: 16px 14px;
+        background: url("@/assets/img/home/page-bg.png") no-repeat bottom right / 149px 116px;
+        background-position-y: 30px;
         img {
-            width: 14px;
-            height: 9px;
+            width: 24px;
+        }
+        .title-name {
+            font-size: 22px;
+            color: #2e2e2e;
+            text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.05);
+            font-weight: 800;
+            padding: 21px 0 4px 6px;
         }
-      }
-      .box-content {
-        padding: 0 10px;
-        .box-item {
-            padding-top: 10px;
-            .item-name {
-                font-size: 15px;
-                color: rgba(0,0,0,0.9);
+        .title-desc {
+            font-size: 14px;
+            color: rgba(49, 49, 49, 0.56);
+            padding-left: 6px;
+        }
+    }
+    .prescription-box {
+        background: #ffffff;
+        box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.1);
+        border-radius: 10px;
+        margin: 0 10px 10px;
+        box-sizing: border-box;
+        padding-bottom: 10px;
+        .box-title {
+            margin: 0 10px;
+            box-sizing: border-box;
+            border-bottom: 1px solid rgba(0, 0, 0, 0.15);
+            font-weight: 800;
+            font-size: 18px;
+            color: #222222;
+            padding: 15px 0 10px;
+            img {
+                width: 14px;
+                height: 9px;
             }
-            .item-checkbox {
-                ::v-deep {
-                    .el-radio-button {
-                        margin: 10px 7px 0 0;
-                      .el-radio-button__inner {
-                        border: none;
-                        background: #F1F1F1;
-                        border-radius: 8px;
-                        padding: 18px 30px;
-                        border: 2px solid rgba(255, 255, 255, 0);
-                        color: #000000;
-                        font-size: 15px;
-                      }
-                      &.is-active {
-                        &::after {
-                            content: "";
-                            position: absolute;
-                            z-index: 9;
-                            bottom: 0;
-                            right: 0;
-                            width: 18px;
-                            height: 16px;
-                            background: url('@/assets/img/home/checked-bg.png') no-repeat bottom right / 18px 16px;
+        }
+        .box-content {
+            padding: 0 10px;
+            .box-item {
+                padding-top: 10px;
+                .item-name {
+                    display: flex;
+                    align-items: center;
+                    font-size: 15px;
+                    color: rgba(0, 0, 0, 0.9);
+                    .required-icon {
+                        color: #ff0000;
+                        font-size: 16px;
+                        margin-right: 4px;
+                    }
+                }
+                .item-checkbox {
+                    ::v-deep {
+                        .el-radio-button,
+                        .el-checkbox-button {
+                            margin: 10px 7px 0 0;
+                            .el-radio-button__inner,
+                            .el-checkbox-button__inner {
+                                border: none;
+                                background: #f1f1f1;
+                                border-radius: 8px;
+                                padding: 13px 30px;
+                                border: 1px solid rgba(255, 255, 255, 0);
+                                color: #000000;
+                                font-size: 15px;
+                                font-weight: 400;
+                            }
+                            &.is-active,
+                            &.is-checked {
+                                &::after {
+                                    content: "";
+                                    position: absolute;
+                                    z-index: 9;
+                                    bottom: 0;
+                                    right: 0;
+                                    width: 18px;
+                                    height: 16px;
+                                    background: url("@/assets/img/home/checked-bg.png") no-repeat bottom right / 18px
+                                        16px;
+                                }
+                                .el-radio-button__inner,
+                                .el-checkbox-button__inner {
+                                    background: rgba(33, 153, 248, 0.1) !important;
+                                    color: #2199f8 !important;
+                                    border: 1px solid #2199f8 !important;
+                                    box-shadow: none;
+                                    font-weight: 500;
+                                }
+                            }
+                            &.is-active {
+                                .el-radio-button__original-radio:not(:disabled) + .el-radio-button__inner {
+                                    background: rgba(33, 153, 248, 0.1) !important;
+                                    color: #2199f8 !important;
+                                    border: 1px solid #2199f8 !important;
+                                    box-shadow: none;
+                                    font-weight: 500;
+                                }
+                            }
+                            &.is-checked {
+                                .el-checkbox-button__original-checkbox:not(:disabled) + .el-checkbox-button__inner {
+                                    background: rgba(33, 153, 248, 0.1) !important;
+                                    color: #2199f8 !important;
+                                    border: 1px solid #2199f8 !important;
+                                    box-shadow: none;
+                                    font-weight: 500;
+                                }
+                            }
                         }
-                        .el-radio-button__original-radio:not(:disabled)+.el-radio-button__inner {
-                            background: #FFFFFF;
-                            color: #2199F8;
-                            border: 2px solid #2199F8;
-                            box-shadow: none;
-                        }  
-                      }
                     }
                 }
             }
         }
-      }
-  }
-  .submit-btn {
-      height: 55px;
-      line-height: 55px;
-      background: #2199F8;
-      box-shadow: 0 2px 2px 0 rgba(0,0,0,0.1);
-      border-radius: 10px;
-      color: #FFFFFF;
-      font-size: 18px;
-      text-align: center;
-      margin: 0 10px 45px 10px;
-  }
+    }
+    .disaster-desc-box {
+        padding: 10px;
+        display: flex;
+        align-items: center;
+        span {
+            font-size: 14px;
+            color: rgba(0, 0, 0, 0.9);
+            width: 80px;
+        }
+    }
 }
-</style>
+</style>

+ 160 - 10
src/views/old_mini/plan/index.vue

@@ -1,7 +1,7 @@
 <template>
     <div class="farm-card-page">
         <custom-header name="农事方案"></custom-header>
-        <Tabs v-model:active="activeTab" class="tabs-wrap">
+        <Tabs v-model:active="activeTab" class="tabs-wrap" v-if="!route.query.containerId">
             <Tab title="专家方案">
                 <expert-list :isShowHeader="true"></expert-list>
             </Tab>
@@ -15,47 +15,92 @@
                         @change="handleTabChange"
                         class="tabs-list"
                     />
-                    <plan-list :farm-id="route.query.farmId" :schemeId="active" :containerId="containerId" isEdit> </plan-list>
+                    <plan-list :schemeId="active" :containerId="containerId" :isEdit="isEditVal"> </plan-list>
                 </div>
             </Tab>
         </Tabs>
+        <div v-else class="system-generated">
+            <div class="tip-box">
+                <el-icon size="18"><CircleCheckFilled /></el-icon>
+                <span>系统已生成多套方案,请选择最佳方案</span>
+            </div>
+            <tab-list
+                v-if="curRole == 2"
+                type="light"
+                v-model="active"
+                :tabs="tabs"
+                @change="handleTabChange"
+                class="tabs-list"
+            />
+            <plan-list :schemeId="active" :containerId="containerId" :isEdit="isEditVal"> </plan-list>
+        </div>
     </div>
+    <div v-if="route.query.containerId" class="custom-bottom-fixed-btns">
+        <div class="bottom-btn primary-btn" @click="handleConfirmPlan">确认方案</div>
+    </div>
+
+    <tip-popup
+        v-model:show="showFarmPopup"
+        type="success"
+        text="农场创建成功"
+        buttonText="分享微信"
+        @confirm="handleShareFarm"
+        @handleClickOverlay="handleClickOverlay"
+    />
 </template>
 
 <script setup>
 import customHeader from "@/components/customHeader.vue";
-import { onMounted, ref } from "vue";
-import { useRoute } from "vue-router";
+import { onActivated, ref,onDeactivated } from "vue";
+import { useRoute, useRouter } from "vue-router";
 import { Tab, Tabs } from "vant";
+import wx from "weixin-js-sdk";
 import expertList from "@/views/old_mini/home/subPages/expertList.vue";
 import tabList from "@/components/pageComponents/TabList.vue";
 import PlanList from "@/components/pageComponents/PlanList.vue";
+import tipPopup from "@/components/popup/tipPopup.vue";
+import { ElMessage } from "element-plus";
 
 const activeTab = ref(1);
-
+const router = useRouter();
 const route = useRoute();
+
 const curRole = localStorage.getItem("SET_USER_CUR_ROLE");
 
 const tabs = ref([]);
 const active = ref(null);
 const containerId = ref(null);
-const handleTabChange = (id,item) => {
+const handleTabChange = (id, item) => {
     containerId.value = item.containerId;
     active.value = id;
+    isEditVal.value = id ? true : false;
 };
 
-onMounted(() => {
-    if (curRole == 2) {
+onActivated(() => {
+    if (route.query.containerId || curRole == 2) {
         getListMySchemes();
     }
 });
 
+onDeactivated(() => {
+    active.value = null;
+    containerId.value = null;
+});
+
+const isEditVal = ref(false);
+
 const getListMySchemes = () => {
     VE_API.home.listMySchemes().then(({ data }) => {
         if (data.length) {
             tabs.value = data || [];
-            active.value = data[0].id;
-            containerId.value = data[0].containerId;
+            if (route.query.containerId) {
+                const index = data.findIndex((item) => item.containerId == 9);
+                active.value = data[index].id;
+                containerId.value = 9;
+            } else {
+                active.value = data[0].id;
+                containerId.value = data[0].containerId;
+            }
         } else {
             getSchemes();
         }
@@ -69,6 +114,85 @@ const getSchemes = () => {
         }
     });
 };
+
+const showFarmPopup = ref(false);
+const shareData = ref({});
+const handleConfirmPlan = () => {
+    // 从路由参数中获取农场数据
+    let geomValue = route.query.geom;
+    
+    // 处理 geom 参数,可能是 JSON 字符串或数组
+    if (typeof geomValue === 'string') {
+        try {
+            // 尝试解析 JSON 字符串
+            const parsed = JSON.parse(geomValue);
+            if (Array.isArray(parsed)) {
+                geomValue = parsed;
+            }
+        } catch (e) {
+            // 如果不是 JSON 字符串,保持原值
+            console.warn('geom 参数解析失败,使用原值:', e);
+        }
+    }
+    
+    const farmParams = {
+        ...route.query,
+        containerId: containerId.value,
+        geom: geomValue,
+        defaultFarm: Boolean(route.query.defaultFarm),
+        agriculturalCreate: route.query.agriculturalCreate * 1,
+    };
+    
+    // 验证必填字段
+    if (!farmParams.wkt || !farmParams.speciesId || !farmParams.containerId || !farmParams.address || !farmParams.mu || !farmParams.name || !farmParams.fzr || !farmParams.tel) {
+        ElMessage.error('农场信息不完整,请返回重新填写');
+        return;
+    }
+    
+    delete farmParams.from;
+    // 调用创建农场接口
+    VE_API.farm.saveFarm(farmParams).then((res) => {
+        if (res.code === 0) {
+            shareData.value = res.data;
+            //选择方案
+            VE_API.home.selectSchemes({ schemeId: active.value ,farmId:res.data.id}).then(({code}) => {
+                if (code === 0) {
+                    showFarmPopup.value = true;
+                } else {
+                    ElMessage.error(res.msg || '创建失败');
+                }
+            });
+        } else {
+            ElMessage.error(res.msg || '创建失败');
+        }
+    }).catch((err) => {
+        console.error('创建农场失败:', err);
+        ElMessage.error('创建失败,请稍后重试');
+    });
+};
+
+const handleShareFarm = () => {
+    const query = {
+        agriculturalStoreId: shareData.value.agriculturalStoreId,
+        farmId: shareData.value.id,
+        speciesName: route.query.speciesName,
+        containerId: shareData.value.containerId,
+    };
+    wx.miniProgram.navigateTo({
+        url: `/pages/subPages/share_page/index?pageParams=${JSON.stringify(query)}&type=shareFarm`,
+    });
+};
+
+const handleClickOverlay = () => {
+    // 根据 from 参数跳转回原页面
+    const fromPage = route.query.from;
+    if (fromPage) {
+        router.replace(`/${fromPage}`);
+    } else {
+        // 如果没有 from 参数,默认跳转到首页
+        router.replace('/home');
+    }
+};
 </script>
 
 <style scoped lang="scss">
@@ -76,6 +200,26 @@ const getSchemes = () => {
     width: 100%;
     height: 100vh;
     background: #f5f7fb;
+    .system-generated{
+        padding: 17px 10px 10px;
+        height: calc(100vh - 150px);
+        .tip-box {
+            display: flex;
+            align-items: center;
+            justify-content: center;
+            padding: 10px;
+            background: rgba(33, 153, 248, 0.1);
+            border-radius: 8px;
+            color: #2199f8;
+            box-sizing: border-box;
+            span {
+                margin-left: 5px;
+            }
+        }
+        .tabs-list{
+            margin: 10px 0;
+        }
+    }
     .tabs-wrap {
         ::v-deep {
             .van-tabs__line {
@@ -100,4 +244,10 @@ const getSchemes = () => {
         }
     }
 }
+.custom-bottom-fixed-btns{
+    justify-content: center;
+    .bottom-btn{
+        padding: 10px 40px;
+    }
+}
 </style>

+ 8 - 2
src/views/old_mini/task_condition/index.vue

@@ -1,11 +1,11 @@
 <template>
     <div class="farm-manage">
-        <tabs v-model:active="active" class="tabs">
+        <tabs v-model:active="active" class="tabs" @change="handleTabChange">
             <tab title="我的任务">
                 <task></task>
             </tab>
             <tab title="需求大厅">
-                <demand-hall :isCapital="true" />
+                <demand-hall :isCapital="true" ref="demandHallRef" />
             </tab>
         </tabs>
         <system-reminder />
@@ -19,6 +19,12 @@ import demandHall from "../farm_manage/components/demandHall.vue";
 import systemReminder from "../farm_manage/components/systemReminder.vue";
 import task from "./components/task.vue"
 const active = ref(0);
+const demandHallRef = ref(null);
+const handleTabChange = (index) => {
+    if (index === 1) {
+        demandHallRef.value && demandHallRef.value.getSimpleList();
+    }
+}
 </script>
 
 <style lang="scss" scoped>