Przeglądaj źródła

fix: 农资编辑方案,需求大厅数据

刘秀芳 1 dzień temu
rodzic
commit
7621aa9405

BIN
src/assets/img/map/hall.png


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

@@ -99,7 +99,11 @@ const getFarmTypeText = (type) => {
 
 const handleEdit = (sub) => {
     if(curRole == 2){
-        router.push(`/edit_plan?id=${sub.id}`);
+        // router.push(`/edit_plan?data=${encodeURIComponent(JSON.stringify(sub))}`);
+        router.push({
+            path: "/edit_plan",
+            query: { data: JSON.stringify(sub) }
+        });
     }
 };
 

+ 1 - 1
src/components/recordItem.vue

@@ -4,7 +4,7 @@
             <!-- 内置标题模板 -->
             <div v-if="titleMode === 'default'" class="box-title">
                 <div class="title-l">
-                    {{ recordItemData.farmWorkName }}
+                    {{ recordItemData.farmWorkName || recordItemData.name }}
                     <span class="parent-text" v-if="recordItemData.type || recordItemData.farmWorkType"> {{ getFarmTypeText(recordItemData.type || recordItemData.farmWorkType) }} </span>
                 </div>
                 <!-- 按钮样式 -->

+ 1 - 1
src/components/taskItem.vue

@@ -40,7 +40,7 @@
                 </div>
             </div> -->
 
-            <div class="farm-text" v-if="status === 0">
+            <div class="farm-text" v-if="status === 0 && !isHall">
                 <span class="text-title">农场现状:</span>水稻移栽后返青成活(新根萌发、心叶展开),进入分蘖始期
                 <!-- <span class="text-more">点击查看照片</span> -->
             </div>

+ 6 - 0
src/router/globalRoutes.js

@@ -318,6 +318,12 @@ export default [
         name: "EditPlan",
         component: () => import("@/views/old_mini/plan/editPlan.vue"),
     },
+    // 编辑农事方案
+    {
+        path: "/modify_plan",
+        name: "ModifyPlan",
+        component: () => import("@/views/old_mini/plan/components/modifyPlan.vue"),
+    },
     // 农场列表
     {
         path: "/farm_list",

+ 17 - 29
src/views/old_mini/agri_work/components/prescriptionTable.vue

@@ -4,7 +4,7 @@
         <div class="table-item">
             <div class="form-item">
                 <div class="item-name">施用方式</div>
-                <div class="item-text">叶面施</div>
+                <div class="item-text">{{ usageMode }}</div>
             </div>
         </div>
         <div class="new-wrap">
@@ -17,7 +17,7 @@
             </div>
             <div
                 class="new-table-wrap"
-                v-for="(prescriptionItem, prescriptionI) in prescriptioData.prescriptionList"
+                v-for="(prescriptionItem, prescriptionI) in prescriptionList"
                 :key="prescriptionI"
             >
                 <div
@@ -28,20 +28,20 @@
                     <div class="new-table">
                         <div class="line-l">
                             <div class="line-1 title-1">{{ subP.typeName }}</div>
-                            <div class="line-2">{{ subP.defaultName }}</div>
+                            <div class="line-2">{{ subP.name }}</div>
                         </div>
-                        <div class="line-r" :class="{ 'has-border': prescriptioData.usageMode === '叶面施' }">
+                        <div class="line-r" :class="{ 'has-border': usageMode === '叶面施' }">
                             <div class="line-3">
                                 <div
                                     class="sub-line title-3"
-                                    :class="{ 'execute-line': prescriptioData.usageMode === '叶面施' }"
+                                    :class="{ 'execute-line': usageMode === '叶面施' }"
                                 >
                                     人工
                                 </div>
-                                <div class="sub-line title-4">{{ subP.ratio }}ML</div>
-                                <div class="sub-line title-5">{{ subP.muUsage }}{{ subP.unit }}</div>
+                                <div class="sub-line title-4">{{ subP.ratio }}{{ subP.unit || 'kg' }}</div>
+                                <div class="sub-line title-5">{{ subP.dosage }}{{ subP.unit || 'kg' }}</div>
                             </div>
-                            <div class="line-4" v-if="prescriptioData.usageMode === '叶面施'">
+                            <div class="line-4" v-if="usageMode === '叶面施'">
                                 <div class="sub-line title-3 execute-line">无人机</div>
                                 <div class="sub-line title-4">
                                     {{ subP.ratio2 ? subP.ratio2 + subP.unit : "---" }}
@@ -61,27 +61,15 @@
 
 <script setup>
 import { ref } from 'vue';
-
-const prescriptioData = ref({
-    prescriptionList: [
-        {
-            name: "营养",
-            pesticideFertilizerList: [
-                {
-                    key: 1,
-                    typeName: "营养",
-                    defaultName: "乙烯利",
-                    muUsage: "50",
-                    muUsage2: "500",
-                    ratio: "400",
-                    ratio2: "400",
-                    unit: "ml",
-                    remark: "这是是用药注意事项的备注,这是是用药注意事项的备注",
-                },
-            ],
-        },
-    ],
-    usageMode: "叶面施",
+const props = defineProps({
+    prescriptionList: {
+        type: Array,
+        default: () => [],
+    },
+    usageMode: {
+        type: String,
+        default: "",
+    },
 });
 
 </script>

+ 93 - 14
src/views/old_mini/farm_manage/components/demandHall.vue

@@ -113,32 +113,111 @@ const indexMap = new IndexMap();
 const mapContainer = ref(null);
 
 onActivated(() => {
-    getSimpleList()
 });
 
 onMounted(() => {
     const point = store.state.home.miniUserLocationPoint;
     nextTick(() => {
         indexMap.initMap(point, mapContainer.value, props.isCapital);
+        getSimpleList()
     });
 })
 
 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 } 或者直接是数组
-        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 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 = [];
+    // });
 }
 
 function toDetail(item) {

+ 101 - 10
src/views/old_mini/farm_manage/map/index.js

@@ -6,7 +6,7 @@ import Feature from "ol/Feature";
 import Style from "ol/style/Style";
 import Photo from "ol-ext/style/Photo";
 import { Fill, Text, Icon, Stroke } from "ol/style.js";
-import { newPoint} from "@/utils/map";
+import { newPoint } from "@/utils/map";
 
 /**
  * @description 地图层对象
@@ -118,16 +118,93 @@ class IndexMap {
         return [style1, style2, newStyle, style3];
       },
     });
+
+    this.gardenHallLayer = new KMap.VectorLayer("gardenHallLayer", 99, {
+      minZoom: 6,
+      maxZoom: 22,
+      style: (feature) => {
+        let style2 = new Style({
+          image: new Icon({
+            src: require("@/assets/img/map/hall.png"),
+            scale: 0.4,
+            anchor: [0.5, 1],
+            displacement: [0, -36],
+          }),
+        });
+        let style3 = new Style({
+          text: new Text({
+            // text: '2.18 农事1',
+            text: feature.get('farmArea') + '亩',
+            offsetX: 0,
+            offsetY: -30,
+            font: "bold 12px sans-serif",
+            fill: new Fill({ color: "#fff" }), // 字体颜色
+          }),
+        });
+        let style4 = new Style({
+          text: new Text({
+            // text: '2.18 农事1',
+            text: feature.get('addressName'),
+            offsetX: 0,
+            offsetY: -6,
+            font: "bold 14px sans-serif",
+            fill: new Fill({ color: "#2199F8" }), // 字体颜色
+          }),
+        });
+
+        const canvas = document.createElement('canvas');
+        const ctx = canvas.getContext('2d');
+
+        // 矩形的参数
+        const x = 150; // 矩形中心点的x坐标
+        const y = 100; // 矩形中心点的y坐标
+        const width = 58; // 矩形的宽度
+        const height = 20; // 矩形的高度
+        const cornerRadius = 4; // 圆角半径
+
+        // 创建渐变
+        const gradient = ctx.createLinearGradient(x - width / 2, y, x + width / 2, y);
+        gradient.addColorStop(0, '#2199F8');   // 渐变起始颜色
+        gradient.addColorStop(1, '#2199F8');  // 渐变结束颜色
+
+        // 绘制圆角矩形
+        ctx.beginPath();
+        ctx.moveTo(x - width / 2 + cornerRadius, y - height / 2); // 左上角
+        ctx.lineTo(x + width / 2 - cornerRadius, y - height / 2); // 上边
+        ctx.arc(x + width / 2 - cornerRadius, y - height / 2 + cornerRadius, cornerRadius, -Math.PI / 2, 0); // 右上角
+        ctx.lineTo(x + width / 2, y + height / 2 - cornerRadius); // 右边
+        ctx.arc(x + width / 2 - cornerRadius, y + height / 2 - cornerRadius, cornerRadius, 0, Math.PI / 2); // 右下角
+        ctx.lineTo(x - width / 2 + cornerRadius, y + height / 2); // 下边
+        ctx.arc(x - width / 2 + cornerRadius, y + height / 2 - cornerRadius, cornerRadius, Math.PI / 2, Math.PI); // 左下角
+        ctx.lineTo(x - width / 2, y - height / 2 + cornerRadius); // 左边
+        ctx.arc(x - width / 2 + cornerRadius, y - height / 2 + cornerRadius, cornerRadius, Math.PI, -Math.PI / 2); // 左上角
+        ctx.closePath();
+
+        // 填充颜色
+        ctx.fillStyle = gradient;
+        ctx.fill();
+        const newStyle = new Style({
+          image: new Icon({
+            src: canvas.toDataURL(),
+            displacement: [0, 56],
+          }),
+        });
+
+
+        return [style2, newStyle, style3, style4];
+      },
+    });
   }
 
   initMap(location, target, isCapital) {
     let level = 16;
     let coordinate = util.wktCastGeom(location).getFirstCoordinate();
-    this.kmap = new KMap.Map(target, level, coordinate[0], coordinate[1], null, 8, 22, isCapital ? "img" : "vec");
+    this.kmap = new KMap.Map(target, level, coordinate[0], coordinate[1], null, 6, 22, isCapital ? "img" : "vec");
     let xyz2 = config.base_img_url3 + "map/lby/{z}/{x}/{y}.png";
-    this.kmap.addXYZLayer(xyz2, { minZoom: 8, maxZoom: 22 }, 2);
+    this.kmap.addXYZLayer(xyz2, { minZoom: 6, maxZoom: 22 }, 2);
     this.kmap.addLayer(this.clickPointLayer.layer);
     this.kmap.addLayer(this.gardenPointLayer.layer);
+    this.kmap.addLayer(this.gardenHallLayer.layer);
     if (isCapital) {
       // this.initData()
       const point = ["113.61652616170711,23.58399613872042", "113.61767554789421, 23.590079887444034", "113.62757101477101, 23.590796948574365", "113.62240816252164, 23.59499176519138"]
@@ -418,13 +495,27 @@ class IndexMap {
     if (taskList.length > 0) {  // 如果任务列表不为空,则添加任务点
       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, "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);
-        }
+        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);
+      }
+    }
+  }
+
+  initDataHall(taskList) {
+    this.gardenHallLayer.source.clear();
+    if (taskList.length > 0) {  // 如果任务列表不为空,则添加任务点
+      for (let item of taskList) {
+        this.gardenHallLayer.source.addFeature(newPoint(item, "point", "hallGarden"))
+      }
+      this.kmap.getView().fit(this.gardenHallLayer.source.getExtent(), { padding: [60, 40, 30, 40] });
+      const finalZoom = this.kmap.getView().getZoom();
+      if (finalZoom > 18) {
+        this.kmap.getView().setZoom(18);
+      }
     }
   }
 }

+ 2 - 2
src/views/old_mini/modify_work/index.vue

@@ -1,6 +1,6 @@
 <template>
     <div class="new-farming-page">
-        <custom-header :name="isAdd ? '新增农事' : isEdit ? '编辑报价' : '农事详情'"></custom-header>
+        <custom-header :name="isAdd ? '新增农事' : isEdit ? '编辑方案' : '农事详情'"></custom-header>
         <div class="new-farming-content">
             <div v-if="!isAdd && !isEdit">
                 <div class="step-wrap">
@@ -382,7 +382,7 @@
 
                 <div class="submit-btn" v-if="isEdit">
                     <div class="btn second" @click.prevent="cancelEdit">取消编辑</div>
-                    <div class="btn" @click.prevent="submitForm(formRef)">保存报价</div>
+                    <div class="btn" @click.prevent="submitForm(formRef)">保存方案</div>
                 </div>
                 <div class="submit-btn" v-if="!isAdd && !isEdit">
                     <div class="btn second" @click="handleIgnore">忽略</div>

+ 1392 - 0
src/views/old_mini/plan/components/modifyPlan.vue

@@ -0,0 +1,1392 @@
+<template>
+    <div class="new-farming-page">
+        <custom-header name="编辑方案"></custom-header>
+        <div class="new-farming-content">
+            <el-form
+                ref="formRef"
+                style="max-width: 600px"
+                label-position="left"
+                :rules="rules"
+                :model="dynamicValidateForm"
+                class="demo-dynamic"
+            >
+                <div class="farm-card" v-if="!isAdd">
+                    <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">
+                                {{ detailData?.code }}
+                            </div>
+                        </el-form-item>
+                        <el-form-item label-width="70px" class="form-item" prop="conditionRate" label="触发条件">
+                            <div class="condition-wrap">
+                                {{ 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>
+                                <el-select v-model="dynamicValidateForm.conditionRate" placeholder="" style="width: 38%">
+                                    <el-option :value="0" label="0%" />
+                                    <el-option :value="5" label="5%" />
+                                    <el-option :value="10" label="10%" />
+                                    <el-option :value="20" label="20%" />
+                                    <el-option :value="40" label="40%" />
+                                    <el-option :value="60" label="60%" />
+                                    <el-option :value="80" label="80%" />
+                                </el-select> -->
+                            </div>
+                        </el-form-item>
+                        <el-form-item label-width="70px" class="form-item" prop="executeDate" label="执行时间">
+                            <el-date-picker
+                                class="item-input"
+                                style="width: 100%"
+                                value-format="YYYY-MM-DD"
+                                v-model="dynamicValidateForm.executeDate"
+                                type="date"
+                                :clearable="false"
+                                placeholder="选择日期"
+                            />
+                        </el-form-item>
+                    </div>
+                </div>
+                <template v-else>
+                    <div class="farm-card progress">
+                        <span class="progress-title">农事进度</span>
+                        <el-radio-group v-model="farmProgress">
+                            <el-radio :value="0">已做</el-radio>
+                            <el-radio :value="1">未做</el-radio>
+                        </el-radio-group>
+                    </div>
+                    <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="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>
+                                <el-form-item label-width="82px" class="form-item" prop="name" label="农事目的">
+                                    <el-input
+                                        v-model="dynamicValidateForm.purpose"
+                                        style="width: 100%"
+                                        :rows="2"
+                                        type="textarea"
+                                        placeholder="请输入农事目的"
+                                    />
+                                </el-form-item>
+                                <el-form-item label-width="82px" class="form-item" prop="conditionRate" label="执行时间">
+                                    <el-date-picker
+                                        v-model="dynamicValidateForm.checkDay"
+                                        value-format="YYYY-MM-DD"
+                                        type="date"
+                                        placeholder="请选择执行时间"
+                                        style="width: 100%"
+                                    />
+                                </el-form-item>
+                                <!-- <el-form-item label-width="82px" class="form-item" prop="conditionRate" label="触发条件">
+                                    <div class="condition-wrap">
+                                        <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>
+                                        <el-select v-model="dynamicValidateForm.conditionRate" placeholder="请选择" style="width: 38%">
+                                            <el-option :value="0" label="0%" />
+                                            <el-option :value="5" label="5%" />
+                                            <el-option :value="10" label="10%" />
+                                            <el-option :value="20" label="20%" />
+                                            <el-option :value="40" label="40%" />
+                                            <el-option :value="60" label="60%" />
+                                            <el-option :value="80" label="80%" />
+                                        </el-select>
+                                    </div>
+                                </el-form-item> -->
+                        </div>
+                    </div>
+                </template>
+                <div class="farm-card prescription-content" v-if="farmProgress === 0">
+                    <div class="card-title pb-12">药物处方</div>
+                    <el-form-item label-width="82px" class="form-item" prop="usageMode" label="施用方式">
+                        <el-select v-model="dynamicValidateForm.usageMode" placeholder="请选择施用方式" style="width: 100%">
+                            <el-option
+                                v-for="(usage, uId) in allUsageModeList"
+                                :key="uId"
+                                :label="usage"
+                                :value="usage"
+                            />
+                        </el-select>
+                    </el-form-item>
+                    <div v-if="dynamicValidateForm.usageMode !== '人工农事'">
+                        <el-form-item
+                            v-for="(prescriptionItem, prescriptionI) in dynamicValidateForm.prescriptionList"
+                            :key="prescriptionI"
+                            :prop="'prescriptions.' + prescriptionI + '.value'"
+                            class="prescription-item"
+                        >
+                            <div class="recipe-item">
+                                <div class="sub-title">
+                                    <div>{{ prescriptionItem.name }}处方</div>
+                                    <div class="add-tag" @click="addDomain(prescriptionI)">
+                                        <el-icon color="#2199F8"><Plus /></el-icon>新增药物
+                                    </div>
+                                </div>
+                                <div class="recipe-form">
+                                    <el-form-item
+                                        v-for="(domain, index) in prescriptionItem.pesticideFertilizerList"
+                                        :key="domain.key"
+                                        :prop="'pesticideFertilizerList.' + index + '.value'"
+                                    >
+                                        <div class="form-box">
+                                            <div class="form-index">{{ formatIndex(index) }}</div>
+                                            <div class="box-item" v-if="domain.typeName">
+                                                <div class="form-l">使用功效</div>
+                                                <div class="form-r r-text">
+                                                    {{ domain.typeName }}
+                                                    <!-- <el-select
+                                                    v-model="domain.typeName"
+                                                    placeholder="请选择"
+                                                    style="width: 100%"
+                                                    >
+                                                        <el-option :label="domain.typeName" :value="domain.typeName" />
+                                                </el-select> -->
+                                                </div>
+                                            </div>
+                                            <div class="box-item">
+                                                <div class="form-l">肥药名称</div>
+                                                <div class="form-r">
+                                                    <el-select
+                                                        filterable
+                                                        @change="handlePesticideFertilizerChange(prescriptionI, index)"
+                                                        v-model="domain.pesticideFertilizerCode"
+                                                        placeholder="请选择"
+                                                        style="width: 100%"
+                                                    >
+                                                        <el-option
+                                                            v-for="item in pesticideFertilizersOptions"
+                                                            :key="item.pesticideFertilizerCode"
+                                                            :label="item.defaultName"
+                                                            :value="item.pesticideFertilizerCode"
+                                                        />
+                                                    </el-select>
+                                                </div>
+                                            </div>
+                                            <div class="form-title">人工方式</div>
+                                            <div class="box-item sub-item">
+                                                <div class="form-l has-sub">
+                                                    <div class="main-name">亩兑水量</div>
+                                                    <div class="sub-name">(药剂:兑水量)</div>
+                                                </div>
+                                                <div class="form-r input-box text-center input-unit">
+                                                    <!-- <el-input
+                                                        v-model="domain.ratio"
+                                                        style="width: 100%"
+                                                        placeholder="请输入"
+                                                    /> -->
+
+                                                    <el-input v-model.number="domain.ratio" placeholder="请输入">
+                                                        <template #append>{{ domain.unit || 'kg' }}</template>
+                                                    </el-input>
+                                                </div>
+                                            </div>
+                                            <!-- <div class="box-item sub-item">
+                                                <div class="form-l">施用方式</div>
+                                                <div class="form-r">
+                                                    <el-select
+                                                        v-model="domain.usageMode"
+                                                        placeholder="请选择"
+                                                        style="width: 100%"
+                                                    >
+                                                        <el-option
+                                                            v-for="(usage, uId) in domain.usageModeList"
+                                                            :key="uId"
+                                                            :label="usage"
+                                                            :value="usage"
+                                                        />
+                                                    </el-select>
+                                                </div>
+                                            </div> -->
+                                            <div class="box-item sub-item">
+                                                <div class="form-l has-sub">
+                                                    <div class="main-name">单亩用量</div>
+                                                    <div class="sub-name">(亩数:药剂)</div>
+                                                </div>
+                                                <div class="form-r input-box text-center">
+                                                    <!-- <el-input
+                                                        v-model="domain.muUsage"
+                                                        style="width: 100%"
+                                                        placeholder="请输入"
+                                                    /> -->
+                                                    <el-input v-model.number="domain.dosage" placeholder="请输入">
+                                                        <template #append>{{ domain.unit || 'kg' }}</template>
+                                                    </el-input>
+                                                </div>
+                                            </div>
+                                            <div v-if="dynamicValidateForm.usageMode === '叶面施'">
+                                                <div class="form-title">无人机</div>
+                                                <div class="box-item sub-item">
+                                                    <div class="form-l has-sub">
+                                                        <div class="main-name">亩兑水量</div>
+                                                        <div class="sub-name">(药剂:兑水量)</div>
+                                                    </div>
+                                                    <div class="form-r input-box text-center">
+                                                        <!-- <el-input
+                                                            v-model="domain.ratio2"
+                                                            style="width: 100%"
+                                                            placeholder="请输入"
+                                                        /> -->
+                                                        <el-input v-model.number="domain.ratio2" placeholder="请输入">
+                                                            <template #append>{{ domain.unit || 'kg' }}</template>
+                                                        </el-input>
+                                                    </div>
+                                                </div>
+                                                <div class="box-item sub-item">
+                                                    <div class="form-l has-sub">
+                                                        <div class="main-name">单亩用量</div>
+                                                        <div class="sub-name">(亩数:药剂)</div>
+                                                    </div>
+                                                    <div class="form-r input-box text-center">
+                                                        <!-- <el-input
+                                                            v-model="domain.muUsage2"
+                                                            style="width: 100%"
+                                                            placeholder="请输入"
+                                                        /> -->
+                                                        <el-input v-model.number="domain.dosage2" placeholder="请输入">
+                                                            <template #append>{{ domain.unit || 'kg' }}</template>
+                                                        </el-input>
+                                                    </div>
+                                                </div>
+                                            </div>
+                                            <div class="input-box mark-box">
+                                                <el-input
+                                                    v-model="domain.remark"
+                                                    style="width: 100%"
+                                                    placeholder="备注:用药注意事项"
+                                                />
+                                            </div>
+                                            <div class="action-btn">
+                                                <el-button
+                                                    class="btn delete-btn"
+                                                    @click.prevent="removeDomain(prescriptionI, domain)"
+                                                >
+                                                    删除
+                                                </el-button>
+                                                <el-button
+                                                    type="default"
+                                                    class="btn"
+                                                    @click.prevent="resetItemForm(prescriptionI, index)"
+                                                >
+                                                    重置
+                                                </el-button>
+                                            </div>
+                                        </div>
+                                    </el-form-item>
+                                </div>
+                            </div>
+                        </el-form-item>
+                    </div>
+                </div>
+                <div class="farm-card progress" v-else>
+                    <div class="situation-description">
+                        <div class="description-title">状况描述</div>
+                        <div class="description-content">
+                            <el-input
+                                v-model="situationDescription"
+                                type="textarea"
+                                :rows="3"
+                                placeholder="请输入目前农场状况"
+                                class="description-textarea"
+                            />
+                            <div class="upload-section">
+                                <el-button class="upload-btn" @click="handleUploadImage">
+                                    <el-icon><Upload /></el-icon>
+                                    上传图片
+                                </el-button>
+                                <div class="upload-tip">上传图片,专家诊断更清晰</div>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+                
+
+                <div class="submit-btn" v-if="isEdit">
+                    <div class="btn second" @click.prevent="cancelEdit">取消编辑</div>
+                    <div class="btn" @click.prevent="submitForm(formRef)">保存方案</div>
+                </div>
+                <div class="submit-btn" v-if="!isAdd && !isEdit">
+                    <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">
+                    <div class="btn second">取消</div>
+                    <div class="btn" @click.prevent="submitForm(formRef)">确定新增</div>
+                </div>
+                <div v-if="isAdd && farmProgress === 1">
+                    <div class="expert-diagnosis-btn" @click="handleExpertDiagnosis">邀请专家诊断</div>
+                </div>
+            </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>
+import { onActivated, ref, reactive, onDeactivated, onBeforeUnmount, computed, onMounted } from "vue";
+import { useRouter, useRoute } from "vue-router";
+import { ElMessage ,ElMessageBox} from "element-plus";
+import customHeader from "@/components/customHeader.vue";
+import { useStore } from "vuex";
+import { Popup } from "vant";
+import farmSteps from "@/components/farmSteps.vue";
+import { base_img_url2 } from "@/api/config";
+import { formatArea } from "@/common/commonFun";
+import dayjs from "dayjs";
+const store = useStore();
+const router = useRouter();
+const route = useRoute();
+
+// 角色
+// const curRole = store.state.app.curRole
+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();
+    if (route.query.data) {
+        actionType.value = JSON.parse(route.query.data);
+    } else {
+        actionType.value = ["生长异常"];
+    }
+    const planData = JSON.parse(route.query.planData);
+    detailData.value = planData;
+    console.log('planData', planData);
+    dynamicValidateForm.farmWorkName = planData.name;
+    dynamicValidateForm.executeDate = planData.executeDate;
+    dynamicValidateForm.usageMode = planData.prescription.usageMode;
+    planData.prescription.pesticideFertilizerList.forEach(item => {
+        item.defaultName = item.name;
+        item.pesticideFertilizerCode = item.code;
+    });
+    dynamicValidateForm.prescriptionList = [planData.prescription];
+    console.log('dynamicValidateForm.prescriptionList', dynamicValidateForm.prescriptionList);
+    // dynamicValidateForm.prescriptionList = actionType.value.map((name) => ({
+    //     name,
+    //     pesticideFertilizerList: [
+    //         {
+    //             key: 1,
+    //             typeName: "",
+    //             muUsage: "",
+    //             muUsage2: "",
+    //             ratio: "",
+    //             ratio2: "",
+    //             remark: "",
+    //         },
+    //     ],
+    // }));
+});
+
+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') {
+        // 确认忽略
+    } else {
+        router.back();
+    }
+}
+
+const resetForm = (formEl) => {
+    if (!formEl) return;
+    formEl.resetFields();
+    serveArea.value = null;
+    regionId.value = null;
+};
+
+// 清空所有数据
+const clearData = () => {
+    // 清空表单
+    resetForm(formRef.value);
+    
+    // 清空详情数据
+    detailData.value = {};
+    
+    // 清空表单数据
+    dynamicValidateForm.farmWorkName = "";
+    dynamicValidateForm.conditionRate = "";
+    dynamicValidateForm.purpose = "";
+    dynamicValidateForm.executeDate = dayjs().format("YYYY-MM-DD");
+    dynamicValidateForm.checkDay = "";
+    dynamicValidateForm.usageMode = "";
+    dynamicValidateForm.prescriptionList = [{
+        name: "",
+        pesticideFertilizerList: [{
+            key: 1,
+            typeName: "",
+            muUsage: "",
+            muUsage2: "",
+            ratio: "",
+            ratio2: "",
+            remark: "",
+        }],
+    }];
+    
+    // 清空其他数据
+    serveArea.value = null;
+    regionId.value = null;
+    areaList.value = [];
+    farmProgress.value = 0;
+    situationDescription.value = '';
+    checkedArea.value = false;
+    actionType.value = [];
+    gardenId.value = null;
+    showTaskPopup.value = false;
+    taskPopupType.value = 'warning';
+};
+
+onDeactivated(() => {
+    // areaRef.value && newFarmMap.destroyMap();
+    clearData();
+});
+
+onBeforeUnmount(() => {
+    clearData();
+});
+
+const cancelEdit = () => {
+    ElMessageBox.confirm("确认要取消编辑吗?", "提示", {
+        confirmButtonText: "确认",
+        cancelButtonText: "取消",
+        type: "warning",
+    })
+        .then(() => {
+            router.back();
+        })
+        .catch(() => {
+            console.log("取消编辑");
+        });
+};
+
+// 表单
+const formRef = ref();
+const dynamicValidateForm = reactive({
+    farmWorkName: "",
+    conditionRate: "",
+    purpose: "",
+    executeDate: dayjs().format("YYYY-MM-DD"),
+    checkDay: "",
+    usageMode: "",
+    prescriptionList: [
+        {
+            name: "",
+            pesticideFertilizerList: [
+                {
+                    key: 1,
+                    typeName: "",
+                    muUsage: "",
+                    muUsage2: "",
+                    ratio: "",
+                    ratio2: "",
+                    remark: "",
+                },
+            ],
+        },
+    ],
+});
+
+const rules = {
+    farmWorkName: [
+        {
+            required: true,
+            message: "请输入农事名称",
+            trigger: "blur",
+        },
+    ],
+    conditionRate: [
+        {
+            required: false,
+            message: "请输入触发条件",
+            trigger: "blur",
+        },
+    ],
+    executeDate: [
+        {
+            required: false,
+            message: "请选择执行时间",
+            trigger: "blur",
+        },
+    ],
+    checkDay: [
+        {
+            required: true,
+            message: "请选择复核时间",
+            trigger: "blur",
+        },
+    ],
+};
+
+const formatIndex = (index) => {
+    return String(index + 1).padStart(2, "0");
+};
+
+const addDomain = (parentIndex) => {
+    dynamicValidateForm.prescriptionList[parentIndex].pesticideFertilizerList.unshift({
+        key: Date.now(),
+        muUsage: "",
+        muUsage2: "",
+        ratio: "",
+        ratio2: "",
+        remark: "",
+    });
+};
+
+let pesticideFertilizersOptions = ref([]);
+VE_API.z_farm_work_order.pesticideFertilizersList().then(({ data }) => {
+    pesticideFertilizersOptions.value = data;
+});
+
+const allUsageMode = ref(null);
+const allUsageModeList = ["叶面施", "根部施", "人工农事"];
+
+// 农事名称列表
+const farmWorkIndexNameList = ref([
+        "片区拔节率",
+        "园区花蕾率",
+        "单树花蕾率",
+        "片区雄穗抽出率",
+        "园区花量大率",
+        "单树花量大率",
+        "片区分蘖率",
+    ]);
+function getFarmWorkIndexNameList() {
+    farmWorkIndexNameList.value = [
+        "片区拔节率",
+        "园区花蕾率",
+        "单树花蕾率",
+        "片区雄穗抽出率",
+        "园区花量大率",
+        "单树花量大率",
+        "片区分蘖率",
+    ];
+    // VE_API.farm.fetchFarmWorkIndexNameList().then(({data}) => {
+    //     farmWorkIndexNameList.value = data
+    // })
+}
+// 触发指标列表
+const farmWorkNameList = ref([]);
+function getFarmWorkNameList() {
+    // VE_API.farm.fetchFarmWorkNameList().then(({data}) => {
+    //     farmWorkNameList.value = data
+    // })
+}
+
+
+/**
+ * 选择药肥的时候修改订单中药肥pesticideFertilizerId 以外其他数据
+ * @param index
+ */
+const handlePesticideFertilizerChange = (parentIndex, index) => {
+    let obj = pesticideFertilizersOptions.value.filter(
+        (item) =>
+            dynamicValidateForm.prescriptionList[parentIndex].pesticideFertilizerList[index].pesticideFertilizerId ===
+            item.id
+    )[0];
+    dynamicValidateForm.prescriptionList[parentIndex].pesticideFertilizerList[index] = {
+        ...dynamicValidateForm.prescriptionList[parentIndex].pesticideFertilizerList[index],
+        typeName: obj.typeName,
+        unit: obj.unit,
+        defaultRatio: obj.defaultRatio,
+        usageModeList: obj.usageModeList,
+        ratio: obj.defaultRatio,
+        defaultName: obj.defaultName,
+        pesticideFertilizerName: obj.name,
+        pesticideFertilizerCode: obj.pesticideFertilizerCode,
+    };
+};
+
+const removeDomain = (parentIndex, item) => {
+    const index = dynamicValidateForm.prescriptionList[parentIndex].pesticideFertilizerList.indexOf(item);
+    if (index !== -1) {
+        dynamicValidateForm.prescriptionList[parentIndex].pesticideFertilizerList.splice(index, 1);
+    }
+};
+
+const resetItemForm = (parentIndex, index) => {
+    dynamicValidateForm.prescriptionList[parentIndex].pesticideFertilizerList[index] = {
+        typeName: "",
+        muUsage: "",
+        muUsage2: "",
+        ratio: "",
+        ratio2: "",
+        remark: "",
+    };
+};
+
+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;
+            // submit();
+        } else {
+            console.log("error submit!");
+        }
+    });
+};
+
+const submit = () => {
+    // let executeBlueZones = null
+    // if (!(curRole==1 && isAdd.value)) {
+    //     executeBlueZones = newFarmMap.getSelectedBlueRegion();
+    // }
+    // if (!executeBlueZones || !executeBlueZones.length) {
+    //     ElMessage({
+    //         message: "请选择执行区域",
+    //         type: "warning",
+    //     });
+    //     return false
+    // }
+
+    // 检查药物所有项是否都包含特定的字段
+    // const hasRequiredFields = dynamicValidateForm.prescriptionList.every(item => {
+    //     return item.pesticideFertilizerList.every(domain  => {
+    //         const hasPesticideFertilizerCode  = 'pesticideFertilizerCode' in domain
+    //         const hasMuUsage = 'muUsage' in domain;
+    //         const hasRatio = 'ratio' in domain;
+
+    //         const isMuUsageValid = domain.muUsage !== '';
+    //         const isRatioValid = domain.ratio ? true : false;
+
+    //         return hasPesticideFertilizerCode && hasMuUsage && hasRatio && isMuUsageValid && isRatioValid
+    //     });
+    // })
+    // if (!hasRequiredFields) {
+    //     ElMessage({
+    //         message: "请完善药物信息",
+    //         type: "warning",
+    //     });
+    //     return false
+    // }
+
+    // const flattenedDomains = flattenDomains(dynamicValidateForm.prescription)
+    const data = {
+        id: route.query.id,
+        ...dynamicValidateForm,
+    };
+    VE_API.z_farm_work_record.issueFarmWorkRecord(data).then((res) => {
+        if (res.code === 0) {
+            taskPopupType.value = 'success';
+            showTaskPopup.value = true;
+        }
+    })
+    // 新增农事
+    // VE_API.farm.saveFarmWork(data).then(({ code }) => {
+    //     if (code === 0) {
+    //         ElMessage({
+    //             message: "保存成功",
+    //             type: "success",
+    //         });
+    //         setTimeout(() => {
+    //             // router.go(-1);
+    //             router.replace("/expert_album?reload=true");
+    //         }, 500);
+    //     }
+    // });
+    // const data = {
+    //     orderId: props.prescriptioData.orderId,
+    //     orderStatus: 1,
+    //     pesticideFertilizers: dynamicValidateForm.domains,
+    // };
+    // VE_API.order.confirm(data).then(({ code }) => {
+    //     if (code == 0) {
+    //         console.log('专家下发处方成功');
+    //         eventBus.emit('discover:submitForm')
+    //         window.location.reload()
+    //     }
+    // });
+};
+
+const farmWorkTypeVal = computed(() => {
+    const valueMap = {
+        生长异常: 1,
+        病虫异常: 3,
+        营养农事: 2,
+    };
+
+    if (actionType.value.length === 1) {
+        return valueMap[actionType.value[0]] || null; // 如果只有一个元素,返回对应的值,否则返回 null
+    } else {
+        return 1;
+    }
+});
+
+function flattenDomains(data) {
+    return data.reduce((acc, item) => {
+        return acc.concat(item.pesticideFertilizerList);
+    }, []);
+}
+
+const serveArea = ref(null);
+// 农场分区列表
+const areaList = ref([]);
+const regionId = ref(null);
+
+const farmProgress = ref(0)
+
+// 状况描述相关数据
+const situationDescription = ref('')
+const checkedArea = ref(false);
+// 处理上传图片
+const handleUploadImage = () => {
+    // 这里可以添加上传图片的逻辑
+    console.log('上传图片');
+};
+
+// 处理邀请专家诊断
+const handleExpertDiagnosis = () => {
+    // 这里可以添加邀请专家诊断的逻辑
+    console.log('邀请专家诊断');
+};
+</script>
+
+<style lang="scss" scoped>
+.new-farming-page {
+    height: 100vh;
+    position: relative;
+    overflow: auto;
+    font-size: 14px;
+    background: #f2f3f5;
+    ::v-deep {
+        .custom-header {
+            position: fixed;
+            top: 0;
+            padding-bottom: 1px;
+        }
+    }
+    .step-wrap {
+        padding: 12px 0;
+    }
+    .box-wrap {
+        background: #fff;
+        padding: 10px;
+        border-radius: 8px;
+    }
+    .new-farming-content {
+        margin: 41px 0 62px 0;
+        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;
+            margin-top: 14px;
+            .info-title {
+                display: flex;
+                align-items: center;
+                justify-content: space-between;
+                color: rgba(41, 41, 41, 0.3);
+                .info-more {
+                    display: flex;
+                    align-items: center;
+                }
+            }
+        }
+        .farm-photo {
+            margin-top: 10px;
+            .photo-list {
+                display: flex;
+                align-items: center;
+                width: 100%;
+                overflow: auto;
+                padding-bottom: 10px;
+                .photo-item {
+                    width: 92px;
+                    height: 92px;
+                    border-radius: 8px;
+                    object-fit: cover;
+                }
+                .img-item {
+                    img {
+                        width: 92px;
+                        height: 92px;
+                        border-radius: 8px;
+                        object-fit: cover;
+                        margin-right: 12px;
+                    }
+                }
+            }
+            .list-text {
+                text-align: center;
+                color: rgba(0, 0, 0, 0.5);
+                padding-top: 2px;
+            }
+        }
+        .submit-btn {
+            z-index: 10;
+            position: fixed;
+            bottom: 0px;
+            left: 0;
+            width: 100%;
+            display: flex;
+            align-items: center;
+            justify-content: space-between;
+            padding: 12px;
+            background: #fff;
+            box-sizing: border-box;
+            box-shadow: 0 4px 4px rgba(0, 0, 0, 0.4);
+            border-top: 1px solid rgba(0, 0, 0, 0.1);
+            .btn {
+                height: 40px;
+                border-radius: 25px;
+                line-height: 40px;
+                width: 110px;
+                text-align: center;
+                background: linear-gradient(180deg, #70BFFE, #2199F8);
+                color: #FFFFFF;
+                font-size: 14px;
+                &.second {
+                    background: #FFFFFF;
+                    border: 1px solid rgba(153, 153, 153, 0.5);
+                    color: #666666;
+                }
+            }
+            .btn + .btn {
+                margin-left: 12px;
+            }
+        }
+    }
+    .card-title {
+        font-size: 16px;
+        font-weight: bold;
+        color: #000;
+        display: flex;
+        align-items: center;
+        // justify-content: space-between;
+        .add-tag {
+            font-size: 12px;
+            color: #2199f8;
+            padding: 4px 8px;
+            background: rgba(33, 153, 248, 0.16);
+            border-radius: 20px;
+            font-weight: normal;
+            height: 25px;
+            line-height: 25px;
+        }
+        .type-tag {
+            margin-left: 5px;
+            font-size: 12px;
+            color: #000000;
+            padding: 0 10px;
+            background: rgba(119, 119, 119, 0.1);
+            border-radius: 20px;
+            font-weight: normal;
+            height: 26px;
+            line-height: 26px;
+        }
+    }
+    .pb-12 {
+        padding-bottom: 12px;
+    }
+    .farm-card {
+        background: #ffffff;
+        border-radius: 8px;
+        padding: 12px 12px 0 12px;
+        width: 100%;
+        box-sizing: border-box;
+        margin-top: 10px;
+        color: rgba(0, 0, 0, 0.4);
+        &.progress{
+            display: flex;
+            align-items: center;
+            padding: 12px;
+            .progress-title{
+                margin-right: 12px;
+            }
+            ::v-deep{
+                .el-radio{
+                    margin-right: 10px;
+                }
+            }
+        }
+        &.map-content {
+            margin-top: 12px;
+        }
+        &.prescription-content {
+            padding: 12px;
+        }
+    }
+
+    .usage-mode-wrap {
+        padding: 0 12px;
+        margin-top: 12px;
+        .info-content {
+            padding-top: 14px;
+            padding-bottom: 1px;
+        }
+
+        .el-form-item--default {
+            margin-bottom: 0;
+        }
+    }
+
+    ::v-deep {
+        .el-form-item__label {
+            height: 30px;
+            line-height: 30px;
+            color: rgba(0, 0, 0, 0.4);
+        }
+        .el-form-item.is-required:not(.is-no-asterisk).asterisk-left>.el-form-item__label:before {
+            display: none;
+        }
+    }
+    .info-content {
+        padding: 10px 0;
+        position: relative;
+
+        .condition-wrap {
+            display: flex;
+            align-items: center;
+            width: 100%;
+            .symbol {
+                width: 10px;
+                // text-align: center;
+                // padding: 0 4px;
+            }
+        }
+        .item-input {
+            // width: 60%;
+            min-width: 140px;
+            max-width: 240px;
+        }
+        .recheck-text {
+            padding-left: 6px;
+        }
+        .info-item {
+            display: flex;
+            justify-content: space-between;
+            align-items: center;
+            width: 100%;
+        }
+        .info-item + .info-item {
+            margin-top: 12px;
+        }
+
+        .bottom-map {
+            width: 100%;
+            height: 250px;
+            clip-path: inset(0px round 8px);
+        }
+        .check-btn {
+            position: absolute;
+            bottom: 16px;
+            right: 6px;
+            background: rgba(0, 0, 0, 0.6);
+            padding: 0 8px;
+            border-radius: 8px;
+
+            ::v-deep {
+                .el-checkbox {
+                    color: #fff;
+                }
+            }
+        }
+        .area-select {
+            padding-bottom: 12px;
+            .block {
+                width: 12px;
+                display: inline-block;
+            }
+        }
+    }
+
+    ::v-deep {
+        .el-form-item--default {
+            margin-bottom: 8px;
+            &.text-item {
+                margin-bottom: 2px;
+                .el-form-item__content {
+                    line-height: 24px;
+                }
+                .el-form-item__label {
+                    height: 24px;
+                    line-height: 24px;
+                }
+            }
+        }
+    }
+    .sub-title {
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        color: rgba(0, 0, 0, 0.6);
+        font-size: 14px;
+        .add-tag {
+            font-size: 12px;
+            color: #2199f8;
+            padding: 0 8px;
+            border: 1px solid #2199F8;
+            border-radius: 5px;
+            font-weight: normal;
+            height: 28px;
+            line-height: 28px;
+        }
+    }
+    .recipe-item {
+        width: 100%;
+        .recipe-form {
+            padding-top: 8px;
+            ::v-deep {
+                .el-form-item {
+                    &:last-child {
+                        margin-bottom: 0;
+                    }
+                }
+            }
+        }
+
+        .box-item {
+            display: flex;
+            align-items: center;
+            justify-content: space-between;
+            color: rgba(0, 0, 0, 0.4);
+            .r-text {
+                width: 140px;
+                text-align: center;
+            }
+            .form-r {
+                width: 60%;
+                min-width: 140px;
+                max-width: 240px;
+            }
+        }
+        .form-box {
+            border: 1px solid rgba(33, 153, 248, 0.8);
+            border-radius: 8px;
+            padding: 20px 10px;
+            width: 100%;
+            position: relative;
+            // background: rgb(209, 235, 255, 0.3);
+            // margin-bottom: 12px;
+            .form-index {
+                position: absolute;
+                left: 0;
+                top: 0;
+                padding: 0 6px;
+                background: #2199F8;
+                border-radius: 4px 0 4px 0;
+                height: 18px;
+                line-height: 18px;
+                font-size: 12px;
+                color: #fff;
+            }
+            .input-box {
+                &.mark-box {
+                    padding: 8px 0 12px 0;
+                }
+            }
+
+            
+            // .input-unit {
+            //     ::v-deep {
+            //         .el-input {
+            //             border: 1px solid #dcdfe6;
+            //             border-radius: 5px;
+            //             height: 32px;
+            //             box-sizing: border-box;
+            //         }
+            //         .el-input__wrapper {
+            //             padding: 0 2px 0 10px;
+            //             height: 30px;
+            //             line-height: 30px;
+            //             min-height: 30px;
+            //             box-shadow: none;
+            //         }
+            //         .el-input__inner {
+            //             --el-input-inner-height: 30px;
+            //             height: 30px;
+            //             line-height: 30px;
+            //             min-height: 30px;
+            //             color: #606266;
+            //             --el-input-placeholder-color: #a8abb2;
+            //         }
+            //         .el-input-group__append {
+            //             box-shadow: none;
+            //             border: none;
+            //             background: none;
+            //         }
+            //     }
+            // }
+            .text-center {
+                ::v-deep {
+                    .el-input__inner {
+                        text-align: center;
+                    }
+                }
+            }
+            .action-btn {
+                display: flex;
+                justify-content: flex-end;
+                .btn {
+                    color: #8F8F8F;
+                    border-radius: 25px;
+                    padding: 5px 30px;
+                }
+                .delete-btn {
+                    color: rgba(255, 89, 89, 0.9);
+                    background: #fff;
+                    border: 1px solid rgba(255, 89, 89, 0.9);
+                }
+            }
+            .btn-group {
+                padding-top: 12px;
+            }
+            .sub-item {
+                padding-left: 10px;
+                .has-sub {
+                    display: flex;
+                    flex-direction: column;
+                    align-items: center;
+                    .main-name {
+                        line-height: 20px;
+                    }
+                    .sub-name {
+                        font-size: 10px;
+                        color: rgba(129, 129, 129, 0.5);
+                        line-height: 14px;
+                    }
+                }
+                .colunm-sub {
+                    display: flex;
+                    align-items: center;
+                    .sub-name {
+                        font-size: 10px;
+                        color: rgba(129, 129, 129, 0.5);
+                    }
+                }
+                .r-text {
+                    width: 132px;
+                    text-align: center;
+                    font-size: 14px;
+                    color: #474747;
+                }
+                .price {
+                    ::v-deep {
+                        .el-input__wrapper {
+                            box-shadow: 0 0 0 1px rgba(33, 153, 248, 0.3) inset;
+                        }
+                        .el-input__inner {
+                            color: #2199f8;
+                        }
+                    }
+                }
+            }
+            .form-title {
+                font-size: 14px;
+                padding-top: 6px;
+                color: #000;
+                font-weight: 600;
+            }
+            .box-item + .box-item {
+                margin-top: 8px;
+            }
+        }
+        .form-box + .form-box {
+            margin-top: 8px;
+        }
+        .usageMode-wrap {
+            padding-top: 8px;
+        }
+    }
+    
+    // 状况描述样式
+    .situation-description {
+        width: 100%;
+        .description-title {
+            font-size: 16px;
+            font-weight: bold;
+            color: #000;
+            margin-bottom: 12px;
+        }
+        
+        .description-content {
+            .description-textarea {
+                margin-bottom: 10px;
+                width: 100%;
+            }
+            
+            .upload-section {
+                .upload-btn {
+                    width: 112px;
+                    height: 32px;
+                    border-radius: 3px;
+                    border: 1px solid #e0e0e0;
+                    background: #fff;
+                    color: #000;
+                    font-size: 14px;
+                    display: flex;
+                    align-items: center;
+                    justify-content: center;
+                    margin-bottom: 8px;
+                    
+                    .el-icon {
+                        margin-right: 6px;
+                    }
+                }
+                
+                .upload-tip {
+                    font-size: 12px;
+                    color: #999;
+                    line-height: 1.4;
+                }
+            }
+        }
+    }
+    
+    // 专家诊断按钮样式
+    .expert-diagnosis-btn {
+        width: 180px;
+        height: 40px;
+        border-radius: 24px;
+        background: linear-gradient(180deg, #70BFFE 0%, #2199F8 100%);
+        color: #FFFFFF;
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        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: 24px;
+            font-weight: 500;
+        }
+    }
+    .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>

+ 19 - 99
src/views/old_mini/plan/editPlan.vue

@@ -1,17 +1,17 @@
 <template>
     <div class="edit-plan">
         <custom-header name="查看详情"></custom-header>
-        <div class="edit-plan-content">
+        <div class="edit-plan-content" v-if="contentData && Object.keys(contentData).length > 0">
             <record-item :record-item-data="contentData" title-mode="default" class="recipe-item" />
             <prescription-table 
-                :prescription-list="contentData.prescriptionList"
-                :usage-mode="contentData.usageMode"
-                :attention="contentData.attention"
+                :prescription-list="[contentData?.prescription]"
+                :usage-mode="contentData?.prescription?.usageMode"
+                :attention="contentData?.attention"
             ></prescription-table>
         </div>
         <div class="custom-bottom-fixed-btns">
-            <div class="bottom-btn secondary-btn" @click="deletePrescription">删除方</div>
-            <div class="bottom-btn primary-btn" @click="editPrice">编辑报价</div>
+            <div class="bottom-btn secondary-btn" @click="deletePrescription">删除方</div>
+            <div class="bottom-btn primary-btn" @click="editPrice">编辑方案</div>
         </div>
     </div>
 </template>
@@ -20,11 +20,18 @@
 import customHeader from "@/components/customHeader.vue";
 import recordItem from "@/components/recordItem.vue";
 import prescriptionTable from "@/views/old_mini/agri_work/components/prescriptionTable.vue";
-import { ref } from "vue";
+import { ref, onMounted } from "vue";
 import { ElMessageBox } from "element-plus";
-import { useRouter } from "vue-router";
+import { useRouter, useRoute } from "vue-router";
 
 const router = useRouter();
+const route = useRoute();
+onMounted(() => {
+    const data = JSON.parse(route.query.data);
+    console.log('data', data);
+    contentData.value = data;
+});
+
 const deletePrescription = () => {
     ElMessageBox.confirm("确认要删除该处方吗?", "提示", {
         confirmButtonText: "确认",
@@ -40,100 +47,13 @@ const deletePrescription = () => {
 };
 const editPrice = () => {
     router.push({
-        path: "/modify_work",
-        query: { data: JSON.stringify(["生长异常"]), gardenId: 766, isEdit: true },
+        path: "/modify_plan",
+        query: { planData: JSON.stringify(contentData.value), isEdit: true },
     });
 };
 
-const contentData = ref({
-    title: "巡园农事",
-    parentTitle: "秋梢期",
-    reCheckText: "通过精准农业技术的应用,作物产量实现了两位数的增长,病虫害的发生率大幅下降,土壤肥力的提升",
-    beforeImage: "https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png",
-    afterImage: "https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png",
-    expert: 91356,
-    orderStatus: 3,
-    activeStatus: 0,
-    regionId: 2,
-    speciesId: "1",
-    speciesName: "荔枝",
-    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: "韦帮稳",
-    attention: "daskdjakjd",
-    beforeExecuteDate: "2025-08-01",
-    executeDate: "2025-08-15",
-    code: "BZ-BC-04-SQFC-20",
-    expertPrescription: "",
-    condition: "单树嫩叶率大于20.0%",
-    defaultFarmWork: 0,
-    farmWorkType: 3,
-    farmWorkTypeName: "病虫",
-    usageMode: "叶面施",
-    serviceMain: "广州泽秾丰农资有限公司",
-    updateDate6: null,
-    confirmPicture: [],
-    executeMain: "广州泽秾丰农资有限公司",
-    storeShortName: "泽秾丰",
-    serviceRegion: "广州市从化区荔枝博览园",
-    prescriptionList: [
-        {
-            name: "营养",
-            pesticideFertilizerList: [
-                {
-                    defaultDroneRatio: null,
-                    defaultName: "尿素",
-                    defaultRatio: 0,
-                    id: null,
-                    muPrice: null,
-                    muUsage: 15000.0,
-                    muUsage2: 15000.0,
-                    ratio: 0,
-                    ratio2: 0,
-                    remark: "",
-                    usageMode: "",
-                    usageModeList: ["叶面施、根部施"],
-                    orderId: null,
-                    pesticideFertilizerCode: "1001",
-                    pesticideFertilizerId: "1",
-                    pesticideFertilizerName: "尿素",
-                    brand: "山东联盟",
-                    typeName: "营养",
-                    price: 132,
-                    unit: "g",
-                    executeStyle: null,
-                },
-                {
-                    defaultDroneRatio: null,
-                    defaultName: "15-15-15复合肥",
-                    defaultRatio: 0,
-                    id: null,
-                    muPrice: null,
-                    muUsage: 45000.0,
-                    muUsage2: 45000.0,
-                    ratio: 0,
-                    ratio2: 0,
-                    remark: "",
-                    usageMode: "",
-                    usageModeList: ["根部施"],
-                    orderId: null,
-                    pesticideFertilizerCode: "1002",
-                    pesticideFertilizerId: "2",
-                    pesticideFertilizerName: "15-15-15复合肥",
-                    brand: "金正大",
-                    typeName: "营养",
-                    price: 220,
-                    unit: "g",
-                    executeStyle: null,
-                },
-            ],
-        },
-    ],
-});
+const contentData = ref({});
+
 </script>
 
 <style scoped lang="scss">

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

@@ -18,7 +18,7 @@ import { Tab, Tabs } from "vant";
 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 active = ref(1);
 </script>
 
 <style lang="scss" scoped>