lxf 1 неделя назад
Родитель
Сommit
6976cba5f7

+ 7 - 7
src/components/pageComponents/AgriculturalInteractionCard.vue

@@ -14,10 +14,10 @@
                 </div>
                 <div class="text">
                     预计报价<span class="price">{{ timelineItem.estimatedCost }}元</span>
-                    <!-- <span class="action-detail" @click="toDetail(timelineItem, item)"
+                    <span class="action-detail" @click="toDetail(timelineItem, item)"
                         >查看详情</span
-                    > -->
-                    <span class="action-detail" @click="showPriceSheetPopup(timelineItem.farmWorkId, item)">查看报价单</span>
+                    >
+                    <!-- <span class="action-detail" @click="showPriceSheetPopup(timelineItem.farmWorkId, item)">查看报价单</span> -->
                 </div>
             </div>
             <div class="timeline-action" @click="handleTimelineAction(timelineItem, item.farmId)">转入农事任务</div>
@@ -113,10 +113,10 @@ const handleUploadSuccess = async () => {
 
 const toDetail = (timelineItem, item) => {
     console.log(timelineItem, item);
-    // router.push({
-    //     path: "/completed_work",
-    //     query: { miniJson: JSON.stringify({ id: item.id }) },
-    // });
+    router.push({
+        path: "/detail_work",
+        query: { miniJson: JSON.stringify({ id: timelineItem.farmWorkId, farmId: item.farmId, }), },
+    });
 };
 
 // 忽略农事库

+ 11 - 5
src/components/popup/activeUploadPopup.vue

@@ -73,7 +73,7 @@
             <div class="header" v-if="needReview">
                 <div class="title">
                     <span class="required">*</span>
-                    请选择复核时间
+                    请选择农事执行后复核时间
                 </div>
                 <div class="date-input review-day-input">
                     <el-input size="large" v-model="reviewDay" type="number" step="0.01">
@@ -82,7 +82,7 @@
                 </div>
             </div>
         </div>
-        <div class="tips-text img-desc" v-if="imgDesc"><span class="required">*</span>{{ imgDesc }}</div>
+        <div class="tips-text img-desc" v-if="imgDesc"><span class="required" v-if="userInfoObj?.agriculturalRole !== 1">*</span>{{ imgDesc }}</div>
         <div class="tips-text" v-else>上传照片,诊断更准确哦~</div>
         <upload :textShow="true" class="upload-wrap" exampleImg>
             <img class="example" src="@/assets/img/home/example-4.png" alt="" />
@@ -127,6 +127,9 @@ onMounted(() => {
     eventBus.on("activeUpload:success", handleSuccess);
 });
 
+const userInfo = localStorage.getItem("localUserInfo");
+const userInfoObj = userInfo ? JSON.parse(userInfo) : {};
+
 function uploadChange(arr) {
     images.value = arr;
 }
@@ -184,8 +187,11 @@ function handleShow({
     // 如果没有报价信息,则跳转去完善报价信息
     VE_API.monitor.validatePesticideFertilizerQuotes({ id: farmWorkIdVal, schemeId: schemeIdVal }).then((res) => {
         if (res.code === 0) {
-            if (res.data.length === 0) {
-                router.push(`/modify?farmWorkId=${farmWorkIdVal}&schemeId=${schemeIdVal}&onlyPrice=true`);
+            if (res.data === false) {
+                ElMessage.warning("请先完善报价信息");
+                setTimeout(() => {
+                    router.push(`/modify?farmWorkId=${farmWorkIdVal}&schemeId=${schemeIdVal}&farmId=${gardenIdVal}&onlyPrice=true&isEdit=true`);
+                }, 1000);
             }
         }
     });
@@ -201,7 +207,7 @@ const handleUpload = () => {
     // 如果正在上传中,直接返回,防止重复调用
     if (isUploading.value) return;
 
-    if (images.value.length === 0) return ElMessage.warning("请上传图片");
+    if (userInfoObj?.agriculturalRole !== 1 && images.value.length === 0) return ElMessage.warning("请上传图片");
     let paramsObj = {
         farmId: gardenId.value,
         arrangeId: arrangeId.value,

+ 11 - 6
src/components/popup/priceSheetPopup.vue

@@ -143,7 +143,9 @@ const quotationData = ref({});
 const priceData = ref({});
 
 onActivated(() => {
-    getDetail()
+    if (ids.value?.id) {
+        getDetail();
+    }
 })
 
 const getTotal = (item) => {
@@ -181,10 +183,10 @@ const totalCost = computed(() => {
 
 
 const ids = ref({});
-const handleShowPopup = ({id, farmId, agriculturalId}) => {
+const handleShowPopup = ({id, farmId}) => {
     if (id) {
         loading.value = true;
-        ids.value = {id, farmId, agriculturalId};
+        ids.value = {id, farmId};
         getDetail();
     }
     showPopup.value = true;
@@ -202,12 +204,15 @@ function fetchPriceData(id) {
     // });
 }
 
+const userInfoStr = localStorage.getItem("localUserInfo");
+const userInfo = userInfoStr ? JSON.parse(userInfoStr) : {};
+
 const getDetail = async () => {
-    const { id, farmId, agriculturalId } = ids.value;
-    const { data, code } = await VE_API.farm.getFarmWorkLib({ id, farmId, agriculturalId });
+    const { id, farmId } = ids.value;
+    const { data, code } = await VE_API.farm.getFarmWorkLib({ id, farmId, agriculturalId: userInfo?.agriculturalId });
     if(code === 0) {
         priceData.value = data;
-        const pesticideFertilizerCodes = data.prescription.pesticideFertilizerList.map(item => item.code);
+        const pesticideFertilizerCodes = data?.prescription?.pesticideFertilizerList.map(item => item.code);
         getPriceList(data.schemeId, pesticideFertilizerCodes);
         loading.value = false;
     }

+ 7 - 0
src/router/globalRoutes.js

@@ -114,6 +114,13 @@ export default [
         meta: { keepAlive: true },
         component: () => import("@/views/old_mini/modify_work/completedWork.vue"),
     },
+    // 农事详情
+    {
+        path: "/detail_work",
+        name: "DetailWork",
+        meta: { keepAlive: true },
+        component: () => import("@/views/old_mini/modify_work/detailWork.vue"),
+    },
     // 团队管理
     {
         path: "/team_manage",

+ 25 - 27
src/views/old_mini/modify_work/addWork.vue

@@ -11,11 +11,23 @@
                 class="demo-dynamic"
             >
                 <div class="farm-card">
-                    <div class="card-title">基本信息</div>
+                    <div class="card-title between">
+                        基本信息
+                        <div>
+                            <el-select size="small" v-model="tagName" placeholder="标记为" style="width: 94px">
+                                <el-option
+                                v-for="item in tagList"
+                                :key="item.value"
+                                :label="item.label"
+                                :value="item.value"
+                                />
+                            </el-select>
+                        </div>
+                    </div>
                     <div class="info-content">
-                        <el-form-item label-width="82px" class="form-item" prop="farmWorkName" label="农事名称"> 
+                        <el-form-item label-width="82px" class="form-item name-item" prop="name" label="农事名称"> 
                             <el-input
-                                v-model="dynamicValidateForm.farmWorkName"
+                                v-model="dynamicValidateForm.name"
                                 style="width: 100%"
                                 placeholder="请输入农事名称"
                             />
@@ -405,11 +417,9 @@ const clearData = () => {
     detailData.value = {};
 
     // 清空表单数据
-    dynamicValidateForm.farmWorkName = "";
-    dynamicValidateForm.conditionRate = "";
+    dynamicValidateForm.name = "";
     dynamicValidateForm.purpose = "";
     dynamicValidateForm.executeDate = dayjs().format("YYYY-MM-DD");
-    dynamicValidateForm.checkDay = "";
     dynamicValidateForm.usageMode = "";
     dynamicValidateForm.prescription = {
         id: "",
@@ -462,11 +472,8 @@ const handleExecutionMethodChange = (index, val) => {
 // 表单
 const formRef = ref();
 const dynamicValidateForm = reactive({
-    farmWorkName: "",
-    conditionRate: "",
-    purpose: "",
+    name: "",
     executeDate: dayjs().format("YYYY-MM-DD"),
-    checkDay: "",
     usageMode: "",
     executeStyle: 2,
     executionMethod: 2,
@@ -495,20 +502,13 @@ const dynamicValidateForm = reactive({
 });
 
 const rules = {
-    farmWorkName: [
+    name: [
         {
             required: true,
             message: "请输入农事名称",
             trigger: "blur",
         },
     ],
-    conditionRate: [
-        {
-            required: false,
-            message: "请输入触发条件",
-            trigger: "blur",
-        },
-    ],
     executeDate: [
         {
             required: false,
@@ -516,13 +516,6 @@ const rules = {
             trigger: "blur",
         },
     ],
-    checkDay: [
-        {
-            required: true,
-            message: "请选择复核时间",
-            trigger: "blur",
-        },
-    ],
 };
 
 const addDomain = () => {
@@ -740,7 +733,7 @@ const submit = async () => {
     });
 
     // 切换标记
-    VE_API.container_farm_work_arrange.toggleFollow({ id: route.query.farmWorkId, isFollow: tagName.value });
+    VE_API.container_farm_work_arrange.toggleFollow({ id: data.id, isFollow: tagName.value });
 };
 
 // 获取物候期列表
@@ -807,7 +800,8 @@ const validateInteractForm = () => {
 // 保存互动设置
 const handleSaveInteract = async (id) => {
     const paramsObj = {
-        id: id,
+        farmWorkId: id,
+        schemeId: route.query.schemeId,
         ...interactFormData.value,
         interactionTime: formatInteractDate(interactFormData.value.interactionTime),
     };
@@ -1557,6 +1551,10 @@ const handleDeleteInteract = () => {
     ::v-deep {
         .el-form-item--default {
             margin-bottom: 8px;
+            
+            &.name-item {
+                margin-bottom: 14px;
+            }
             &.text-item {
                 margin-bottom: 2px;
                 .el-form-item__content {

+ 1001 - 0
src/views/old_mini/modify_work/detailWork.vue

@@ -0,0 +1,1001 @@
+<template>
+    <div class="completed-work">
+        <custom-header name="农事详情" :isClose="query?.hideBack ? true : false" :showClose="false"></custom-header>
+        <div class="work-content">
+            <div
+                class="content-status"
+            >
+                <div class="status-l">
+                    <div class="stauts-text">待触发</div>
+                    <div class="stauts-sub-text" v-if="detailData?.executeDeadlineDate">
+                        截止到 <span class="time-text">{{ detailData?.executeDeadlineDate }}</span>
+                    </div>
+                </div>
+                <!-- <template v-if="query.status !== 'warning'">
+                    <div class="status-r" v-if="curRole == 0">{{ status === 0 ? "设置提醒" : "去评价" }}</div>
+                    <div class="status-r" v-if="curRole == 1">{{ status === 0 ? "提醒执行" : "提醒复核" }}</div>
+                    <div class="status-r" v-if="curRole == 2">{{ status === 0 ? "提醒执行" : "提醒复核" }}</div>
+                </template> -->
+            </div>
+            <div class="work-wrap">
+                <div class="box-wrap executor-info">
+                    <!-- <div class="executor-title">执行人</div> -->
+                    <div class="executor-content">
+                        <div class="executor-info mt-0">
+                            <div class="executor-avatar">
+                                <img
+                                    src="https://birdseye-img-ali-cdn.sysuimars.com/16926861-1e20-4cbd-8bf2-90208db5a2d0/806080da-1a30-4b5b-b64b-b22e722c6cb6/DJI_202509010800_001_806080da-1a30-4b5b-b64b-b22e722c6cb6/DJI_20250901080536_0045_V_code-ws0fsmge97gh.jpeg?x-oss-process=image/resize,w_500"
+                                    alt="执行人"
+                                />
+                            </div>
+                            <div class="executor-details">
+                                <div class="org-name">
+                                    <span class="name">{{ detailData?.agriculturalName || "--" }}</span>
+                                    <span class="rating">{{
+                                        detailData.score ? detailData.score + "分" : ""
+                                    }}</span>
+                                </div>
+                                <div class="service-info">
+                                    <div class="service-item">
+                                        服务品种:
+                                        <span v-if="speciesList.length">
+                                            <span v-for="(sp, sIdx) in speciesList" :key="sIdx">
+                                                {{ sp }}<template v-if="sIdx < speciesList.length - 1">、</template>
+                                            </span>
+                                        </span>
+                                        <span v-else>--</span>
+                                    </div>
+                                    <div class="service-item">
+                                        服务设备:
+                                        <span v-if="equipmentList.length">
+                                            <span v-for="(eq, eIdx) in equipmentList" :key="eIdx">
+                                                {{ eq }}<template v-if="eIdx < equipmentList.length - 1">、</template>
+                                            </span>
+                                        </span>
+                                        <span v-else>--</span>
+                                    </div>
+                                </div>
+                            </div>
+                        </div>
+                        <div class="farm-info">
+                            <div class="info-title-wrap">
+                                <div class="sub-title">肥药费用</div>
+                                <div class="info-more">
+                                    {{ pesticideCostTotal ? formatArea(pesticideCostTotal) : "--" }}<span class="unit-text">元</span>
+                                </div>
+                            </div>
+                            <div class="info-content-wrap">
+                                <price-table :prescriptionData="detailData?.prescription" :area="detailData?.farm?.mianji">
+                                    <template #bottomContent>
+                                        <div class="price-bottom">
+                                            <div class="info-title-wrap">
+                                                <div class="sub-title">服务费用</div>
+                                                <div class="info-more">
+                                                    {{ detailData?.serviceMuPrice ? serviceCostTotal : '--' }}<span class="unit-text">元</span>
+                                                </div>
+                                            </div>
+                                            <div class="price-info">
+                                                
+                                                <div class="info-l">
+                                                    单亩价格<span class="main-text">{{
+                                                        detailData?.serviceMuPrice
+                                                            ? detailData?.serviceMuPrice + "元/亩"
+                                                            : "--"
+                                                    }}</span>
+                                                </div>
+                                                <!-- <div class="info-l">
+                                                    执行方式<span class="main-text">{{
+                                                        detailData?.executionMethodName || "人工"
+                                                    }}</span>
+                                                </div>
+                                                <div class="info-c">
+                                                    亩单价<span class="main-text">{{
+                                                        detailData?.serviceMuPrice
+                                                            ? detailData?.serviceMuPrice + "元/亩"
+                                                            : "--"
+                                                    }}</span>
+                                                </div>
+                                                <div class="info-r">
+                                                    亩数<span class="main-text">{{
+                                                        detailData?.farm?.mianji
+                                                            ? formatArea(detailData?.farm?.mianji) + "亩"
+                                                            : "--"
+                                                    }}</span>
+                                                </div> -->
+                                            </div>
+                                            <div class="price-total">
+                                                报价合计:<span class="main-val">
+                                                    {{ totalCost ? formatArea(totalCost) : "--" }}</span
+                                                >元
+                                            </div>
+                                        </div>
+                                    </template>
+                                </price-table>
+                            </div>
+                        </div>
+                        <!-- <div class="contact-buttons">
+                            <button class="contact-btn">电话联系</button>
+                            <button class="contact-btn">在线联系</button>
+                        </div> -->
+                    </div>
+                </div>
+            </div>
+            <div class="work-wrap info-wrap">
+
+                <div class="box-wrap farm-data">
+                    <div class="card-title">
+                        <div>{{ detailData?.name }}<span class="type-tag">标准农事</span></div>
+                        <!-- <div class="point-wrap">
+                            <div class="point"></div>
+                            <span>2区</span>
+                        </div> -->
+                        <div class="tag-text" v-if="detailData?.isFollow">{{ statusMap[detailData?.isFollow] }}</div>
+                    </div>
+                    <div class="data-content">
+                        <div class="form-item">
+                            <div class="item-name">农事编号</div>
+                            <div class="item-text">{{ detailData?.code }}</div>
+                        </div>
+                        <div class="form-item">
+                            <div class="item-name">服务亩数</div>
+                            <div class="item-text">
+                                {{ detailData?.farm?.mianji ? formatArea(detailData?.farm?.mianji) + "亩" : "--" }}
+                            </div>
+                        </div>
+                        <div class="form-item">
+                            <div class="item-name">服务区域</div>
+                            <div class="item-text">{{ detailData?.farm?.district }}</div>
+                        </div>
+                        <!-- <div class="form-item">
+                            <div class="item-name">触发条件</div>
+                            <div class="item-text">{{ detailData?.condition }}</div>
+                        </div> -->
+                        <div class="form-item">
+                            <div class="item-name">执行日期</div>
+                            <div class="item-text">{{ detailData?.executeDate || detailData?.expectedExecuteDate || detailData?.executeDate }}</div>
+                        </div>
+                    </div>
+                </div>
+
+                <div class="box-wrap farm-table">
+                    <div class="card-title">药物处方</div>
+                    <div class="table-item">
+                        <div class="form-item">
+                            <div class="item-name">施用方式</div>
+                            <div class="item-text">{{ detailData?.prescription?.usageMode }}</div>
+                        </div>
+                        <div class="form-item">
+                            <div class="item-name">执行方式</div>
+                            <div class="item-text">{{ detailData?.prescription?.pesticideFertilizerList[0]?.executeStyle === 1 ? '无人机' : '人工' }}</div>
+                        </div>
+                    </div>
+                    <div class="new-wrap">
+                        <div class="new-title">
+                            <div class="title-1"><div class="table-name">使用功效</div></div>
+                            <div class="title-2"><div class="table-name">药肥名称</div></div>
+                            <div class="title-4"><div class="table-name">亩兑水量</div></div>
+                            <div class="title-5"><div class="table-name">单亩用量</div></div>
+                        </div>
+                        <div
+                            class="new-table-wrap"
+                        >
+                            <div
+                                class="new-prescription"
+                                v-for="(subP, subI) in detailData?.prescription?.pesticideFertilizerList"
+                                :key="subI"
+                            >
+                                <div class="new-table">
+                                    <div class="line-l">
+                                        <div class="line-1 title-1">{{ subP.typeName }}</div>
+                                        <div class="line-2">{{ subP.name }}</div>
+                                    </div>
+                                    <div class="line-r">
+                                        <div class="line-3">
+                                            <div class="sub-line title-4">{{ subP.ratio }}ML</div>
+                                            <div class="sub-line title-5">{{ subP.dosage }}{{ subP.unit }}</div>
+                                        </div>
+                                    </div>
+                                </div>
+                                <div class="note-text" v-if="subP.remark">{{ subP.remark }}</div>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+
+                <!-- <div class="work-map">
+                    <div class="card-title">执行农事区域</div>
+                    <div class="map-content">
+                        <div class="map-dom" ref="areaRef"></div>
+                    </div>
+                </div> -->
+            </div>
+
+
+            <!-- 农资,步骤:农事已确认 -->
+            <div class="fixed-btn-wrap">
+                <div class="fixed-btn second" @click="showPriceSheetPopup">生成报价单</div>
+                <div class="fixed-btn" @click="handleTimelineAction">转入农事任务</div>
+            </div>
+        </div>
+    </div>
+    <!-- 报价弹窗 -->
+    <!-- <offer-popup :showPopup="showPopup" :executionData="executionData"></offer-popup> -->
+    <!-- 服务报价单 -->
+    <price-sheet-popup ref="priceSheetPopupRef"></price-sheet-popup>
+ 
+    <!-- 新增:激活上传弹窗 -->
+    <active-upload-popup ref="activeUploadPopupRef" @handleUploadSuccess="handleUploadSuccess"></active-upload-popup>
+</template>
+
+<script setup>
+import customHeader from "@/components/customHeader.vue";
+import { ref, computed, onActivated, onDeactivated, onMounted } from "vue";
+// import NewFarmMap from "./newFarmMap";
+import { useStore } from "vuex";
+import { Popup, Calendar } from "vant";
+import offerPopup from "@/components/popup/offerPopup.vue";
+import { useRouter, useRoute } from "vue-router";
+import farmSteps from "@/components/farmSteps.vue";
+import priceTable from "../agri_work/components/priceTable.vue";
+import priceSheetPopup from "@/components/popup/priceSheetPopup.vue";
+import uploadExecute from "@/views/old_mini/task_condition/components/uploadExecute.vue";
+import { base_img_url2 } from "@/api/config";
+import { ElMessage } from "element-plus";
+import { formatArea, formatDate } from "@/common/commonFun";
+import wx from "weixin-js-sdk";
+import reviewUploadPopup from "@/components/popup/reviewUploadPopup.vue";
+import FnShareSheet from "@/components/pageComponents/FnShareSheet.vue";
+import activeUploadPopup from "@/components/popup/activeUploadPopup.vue";
+import eventBus from "@/api/eventBus";
+
+const router = useRouter();
+const store = useStore();
+const query = ref({});
+// 角色
+// const curRole = store.state.app.curRole
+const curRole = ref(localStorage.getItem("SET_USER_CUR_ROLE"));
+// const curRole = 2;
+
+// 农资待生成报价单--currentStep:1;curRole:2
+// 农资已执行,有执行照片,请求确认--currentStep:2;curRole:2
+
+// 0:执行, 1: 复核
+const status = ref(0);
+const uploadExecuteRef = ref(null);
+
+const showUpload = ref(false);
+const sectionId = ref(null);
+// 上传照片处理函数
+const handleUploadPhoto = ({ id }) => {
+    showUpload.value = true;
+    sectionId.value = id;
+};
+
+onDeactivated(() => {
+    showUpload.value = false;
+    sectionId.value = null;
+});
+
+const handleSelfDone = () => {
+    VE_API.z_farm_work_record.updateFlowStatus({ id: query.value.id, targetFlowStatus: 5 }).then((res) => {
+        if (res.code === 0) {
+            showUpload.value = false;
+            sectionId.value = null;
+            setTimeout(() => {
+                router.replace({
+                    path: "/review_work",
+                    query: {
+                        miniJson: JSON.stringify({ id: query.value.id, goBack: true }),
+                    },
+                });
+            }, 500)
+        }
+    });
+};
+
+
+const priceSheetPopupRef = ref(null);
+const showPriceSheetPopup = () => {
+    priceSheetPopupRef.value.handleShowPopup({ id: detailData.value.id, farmId: query.value.farmId });
+};
+
+const userInfoStr = localStorage.getItem("localUserInfo");
+const userInfo = userInfoStr ? JSON.parse(userInfoStr) : {};
+
+const executorList = ref([])
+
+// 检查是否有"转入农事"权限
+const hasPlanPermission = computed(() => {
+    try {
+        const userInfoStr = localStorage.getItem("localUserInfo");
+        if (!userInfoStr) return false;
+        const userInfo = JSON.parse(userInfoStr);
+        const permissions = userInfo.agriculturalPermissions || [];
+        return permissions.includes("转入农事");
+    } catch (error) {
+        console.error("解析用户信息失败:", error);
+        return false;
+    }
+});
+
+onMounted(() => {
+    getManagerList();
+});
+
+// 查询当前农资店的成员列表(只保留有"任务接单"权限的成员)
+const getManagerList = async () => {
+    const { data } = await VE_API.mine.listManagerList({ onlyExecutor: true });
+    if (data && data.length > 0) {
+        // 过滤 permissionList 中包含"任务接单"的成员,并过滤掉超管(role为1)
+        executorList.value = data.filter((item) => item.role !== 1);
+    }
+};
+
+const activeUploadPopupRef = ref(null);
+const handleTimelineAction = (item) => {
+    if (hasPlanPermission.value) {
+        activeUploadPopupRef.value.showPopup({
+            gardenIdVal: query.value.farmId,
+            needExecutorVal: true,
+            problemTitleVal: "请选择 " + detailData.value.name + " 执行截止时间",
+            imgDescVal: "请上传凭证(转入农事任务凭证)",
+            arrangeIdVal: detailData.value.arrangeId,
+            executorListVal: executorList.value,
+            farmWorkIdVal: query.value.id,
+            schemeIdVal: detailData.value.schemeId,
+        });
+    } else {
+        ElMessage.warning("您暂无权限操作");
+    }
+};
+
+
+const handleUploadSuccess = () => {
+    router.back();
+};
+// 地图
+// const areaRef = ref(null);
+// let newFarmMap = new NewFarmMap();
+const quotationData = ref({});
+const parmasPage = ref({});
+const toList = (val) => {
+    if (!val) return [];
+    return JSON.parse(val);
+};
+
+const speciesList = computed(() => toList(quotationData.value.serviceSpecies));
+const equipmentList = computed(() => toList(quotationData.value.serviceEquipment));
+onActivated(async () => {
+    query.value = useRoute().query?.miniJson ? JSON.parse(useRoute().query?.miniJson) : {};
+    const id = query.value?.id;
+    if (id) {
+        await getDetail();
+    }
+});
+
+function getServiceCost(cost, area) {
+    if (!cost || !area) return "--";
+    return (parseFloat(cost) * parseFloat(area)).toFixed(2);
+}
+
+const detailData = ref({});
+
+// 计算距离执行时间的天数差
+const daysDiff = computed(() => {
+    if (!detailData.value?.executeDate) {
+        return 0;
+    }
+    
+    const executeDate = new Date(detailData.value.executeDate);
+    const today = new Date();
+    
+    // 将时间设置为 00:00:00,只比较日期
+    executeDate.setHours(0, 0, 0, 0);
+    today.setHours(0, 0, 0, 0);
+    
+    // 计算天数差(毫秒转天数)
+    const diffTime = executeDate.getTime() - today.getTime();
+    const diffDays = Math.floor(diffTime / (1000 * 60 * 60 * 24));
+    
+    return diffDays;
+});
+
+// 药肥费用总计:∑(单价 * 单亩用量 * 亩数)
+const pesticideCostTotal = computed(() => {
+    const list = detailData.value?.prescription?.pesticideFertilizerList || [];
+    const area = Number(detailData.value?.farm?.mianji || 0);
+    if (!list.length || !area) return 0;
+
+    const sum = list.reduce((acc, item) => {
+        const price = Number(item?.price || 0);
+        const dosage = Number(item?.dosage || 0);
+        if (!price || !dosage) return acc;
+        return acc + price * dosage * area;
+    }, 0);
+
+    return Number(sum.toFixed(2));
+});
+
+
+// 报价合计 = 药肥费用 + 服务费用
+const totalCost = computed(() => {
+    const pesticide = Number(pesticideCostTotal.value || 0);
+    const service = Number(serviceCostTotal.value || 0);
+    if (!pesticide && !service) return 0;
+    return Number((pesticide + service).toFixed(2));
+});
+
+// 服务费用总计(数值):亩单价 * 亩数
+const serviceCostTotal = computed(() => {
+    const price = Number(detailData.value?.serviceMuPrice || 0);
+    const area = Number(detailData.value?.farm?.mianji || 0);
+    if (!price || !area) return 0;
+    return Number((price * area).toFixed(2));
+});
+
+
+const getDetail = async () => {
+    console.log("query.value", query.value);
+    const { data } = await VE_API.farm.getFarmWorkLib({ id: query.value.id, farmId: query.value.farmId, agriculturalId: userInfo?.agriculturalId });
+    if (data) {
+        detailData.value = data;
+        const pesticideFertilizerCodes = data?.prescription?.pesticideFertilizerList.map(item => item.code);
+        getPriceList(data.schemeId, pesticideFertilizerCodes);
+        console.log("detailData.value", detailData.value.executeDeadlineDate);
+        // maxDate.value = new Date(detailData.value.executeDate);
+        parmasPage.value = {
+            ...detailData.value,
+            farmMiniUserId: curRole.value == 2 ? detailData.value.farmMiniUserId : detailData.value.users[0]?.userId,
+            farmWorkOrderId: detailData.value.orderId,
+            executeEvidence: JSON.stringify(detailData.value.executeEvidence),
+        };
+    }
+};
+
+
+const getPriceList = async (schemeId, pesticideFertilizerCodes) => {
+    const { data } = await VE_API.farm.getPriceList({ schemeId, pesticideFertilizerCodes });
+    if (!data || !Array.isArray(data)) return;
+
+    detailData.value.prescription.pesticideFertilizerList.forEach((item) => {
+        const priceInfo = data.find((p) => p.pesticideFertilizerCode === item.code);
+        if (!priceInfo) return;
+        item.price = priceInfo.price ?? item.price;
+        item.brand = priceInfo.brand ?? item.brand;
+    });
+};
+</script>
+
+<style lang="scss" scoped>
+.completed-work {
+    height: 100vh;
+    position: relative;
+    overflow: auto;
+    font-size: 14px;
+    background: #f2f3f5;
+    .work-content {
+        height: calc(100% - 40px);
+        overflow: auto;
+        box-sizing: border-box;
+        &.hasBottom {
+            padding-bottom: 60px;
+        }
+        .info-wrap {
+            margin-bottom: 80px;
+        }
+        .work-wrap {
+            position: relative;
+            z-index: 3;
+            padding: 0 12px;
+            top: -16px;
+        }
+        .pt-10 {
+            padding-top: 10px;
+        }
+        .fixed-btn-wrap {
+            position: fixed;
+            z-index: 10;
+            bottom: 0;
+            left: 0;
+            width: 100%;
+            padding: 10px 12px 25px;
+            box-sizing: border-box;
+            display: flex;
+            align-items: center;
+            justify-content: space-between;
+            background: #fff;
+            box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.4);
+            &.center {
+                justify-content: center;
+            }
+            .fixed-btn {
+                width: 120px;
+                text-align: center;
+                height: 40px;
+                line-height: 40px;
+                background: linear-gradient(180deg, #70bffe, #2199f8);
+                border-radius: 25px;
+                color: #fff;
+                font-size: 14px;
+                box-sizing: border-box;
+                &.expert {
+                    width: 180px;
+                }
+                &.orange {
+                    color: #ff953d;
+                    border: 1px solid #ff953d;
+                    background: rgba(255, 149, 61, 0.1);
+                }
+                &.excute {
+                    background: linear-gradient(180deg, #ffd887, #ed9e1e);
+                }
+                &.second {
+                    background: #ffffff;
+                    border: 1px solid rgba(153, 153, 153, 0.5);
+                    color: #666666;
+                }
+            }
+        }
+        .card-title {
+            font-size: 16px;
+            font-weight: bold;
+            color: #000;
+            display: flex;
+            align-items: center;
+            justify-content: space-between;
+            .tag-text {
+                color: #2199F8;
+                font-size: 12px;
+                font-weight: normal;
+            }
+            .point-wrap {
+                display: flex;
+                align-items: center;
+                color: #393939;
+                font-size: 12px;
+                font-weight: normal;
+                .point {
+                    width: 6px;
+                    height: 6px;
+                    border-radius: 50%;
+                    background: #393939;
+                    margin-right: 4px;
+                }
+            }
+            .type-tag {
+                margin-left: 5px;
+                font-size: 12px;
+                color: #000000;
+                padding: 4px 10px;
+                background: rgba(119, 119, 119, 0.1);
+                border-radius: 20px;
+                font-weight: normal;
+                height: 26px;
+                line-height: 26px;
+            }
+        }
+        .box-wrap {
+            background: #fff;
+            padding: 10px;
+            border-radius: 8px;
+        }
+
+        .step-wrap {
+            padding: 18px 0;
+        }
+
+        .content-status {
+            position: relative;
+            padding: 26px 12px 20px 12px;
+            color: #fff;
+            z-index: 2;
+            display: flex;
+            justify-content: space-between;
+            align-items: center;
+            &::after {
+                content: "";
+                z-index: -1;
+                position: absolute;
+                left: 0;
+                top: 0;
+                height: 136px;
+                background: #2199f8;
+                width: 100%;
+            }
+            .status-l {
+                .stauts-text {
+                    font-size: 22px;
+                    display: flex;
+                    align-items: center;
+                    .status-icon {
+                        width: 24px;
+                        height: 24px;
+                        background: #ffffff;
+                        border-radius: 50%;
+                        margin-right: 8px;
+                    }
+                }
+                .stauts-sub-text {
+                    // color: rgba(255, 255, 255, 0.51);
+                    font-size: 14px;
+                }
+                .time-text {
+                    color: #ffff;
+                }
+            }
+            &.warning {
+                &::after {
+                    background: #ff953d;
+                }
+                .stauts-sub-text {
+                    color: #fff;
+                }
+            }
+            .status-r {
+                height: 32px;
+                line-height: 32px;
+                padding: 0 16px;
+                color: #2199f8;
+                font-size: 16px;
+                background: #fff;
+                border-radius: 20px;
+            }
+        }
+
+        .info-content {
+            padding: 10px 0;
+            position: relative;
+        }
+        .info-title-wrap {
+            display: flex;
+            align-items: center;
+            justify-content: space-between;
+            color: #000;
+            .info-more {
+                font-size: 18px;
+            }
+            .unit-text {
+                font-size: 12px;
+            }
+        }
+        .info-content-wrap {
+            .price-bottom {
+                padding-top: 8px;
+                .price-info {
+                    padding: 8px 0;
+                    display: flex;
+                    align-items: center;
+                    justify-content: space-between;
+                    color: rgba(0, 0, 0, 0.2);
+                    .main-text {
+                        padding-left: 20px;
+                        color: rgba(0, 0, 0, 0.8);
+                    }
+                    .info-c {
+                        flex: 1;
+                        text-align: center;
+                    }
+                }
+                .price-total {
+                    height: 38px;
+                    display: flex;
+                    align-items: center;
+                    justify-content: center;
+                    border: 1px solid rgba(33, 153, 248, 0.5);
+                    background: rgba(33, 153, 248, 0.1);
+                    color: #000000;
+                    border-radius: 4px;
+                    .main-val {
+                        font-size: 20px;
+                        font-weight: bold;
+                        color: #2199f8;
+                        padding-right: 2px;
+                    }
+                }
+            }
+        }
+        .executor-info {
+            margin-top: 14px;
+            &.mt-0 {
+                margin-top: 0;
+            }
+            .executor-title {
+                font-size: 18px;
+                font-weight: bold;
+                color: #000;
+                margin-bottom: 12px;
+            }
+            .executor-content {
+                .executor-info {
+                    display: flex;
+                    align-items: flex-start;
+                    gap: 12px;
+                }
+                .executor-avatar {
+                    flex-shrink: 0;
+                    img {
+                        width: 60px;
+                        height: 60px;
+                        border-radius: 8px;
+                        object-fit: cover;
+                    }
+                }
+                .executor-details {
+                    flex: 1;
+                    .org-name {
+                        display: flex;
+                        align-items: center;
+                        gap: 8px;
+                        margin-bottom: 3px;
+                        .name {
+                            font-size: 16px;
+                            font-weight: bold;
+                            color: #000;
+                        }
+                        .rating {
+                            font-size: 16px;
+                            color: #ff953d;
+                            font-weight: bold;
+                        }
+                    }
+                    .service-info {
+                        .service-item {
+                            font-size: 12px;
+                            color: #b6b6b6;
+                            line-height: 1.3;
+                            margin-bottom: 2px;
+                            span {
+                                color: #666666;
+                            }
+                        }
+                    }
+                }
+            }
+            .contact-buttons {
+                display: flex;
+                justify-content: flex-end;
+                gap: 8px;
+                margin-top: 16px;
+                .contact-btn {
+                    width: 88px;
+                    height: 32px;
+                    border-radius: 20px;
+                    color: rgba(0, 0, 0, 0.5);
+                    background: #fff;
+                    border: 1px solid rgba(0, 0, 0, 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;
+                    }
+                }
+
+                .view-box {
+                    width: 92px;
+                    height: 92px;
+                    border-radius: 8px;
+                    object-fit: cover;
+                }
+            }
+            .list-text {
+                text-align: center;
+                color: rgba(0, 0, 0, 0.5);
+                padding-top: 2px;
+            }
+        }
+
+        .farm-data {
+            margin-top: 10px;
+            .data-content {
+                margin-top: 8px;
+                border-top: 1px solid #f5f5f5;
+                padding: 8px 0;
+            }
+        }
+
+        .form-item {
+            display: flex;
+            align-items: center;
+            font-size: 14px;
+            color: #767676;
+            height: 24px;
+            .item-name {
+                width: 80px;
+                color: rgba(0, 0, 0, 0.2);
+            }
+        }
+        .form-item + .form-item {
+            padding-top: 2px;
+        }
+
+        .farm-table {
+            margin-top: 10px;
+            .table-item {
+                padding: 10px 0 12px 0;
+            }
+        }
+
+        .new-wrap {
+            border-radius: 5px;
+            text-align: center;
+            border: 1px solid rgba(225, 225, 225, 0.5);
+            .new-title {
+                background: rgba(241, 241, 241, 0.4);
+                border-radius: 5px 5px 0 0;
+                border-bottom: 1px solid rgba(225, 225, 225, 0.5);
+                display: flex;
+                color: #767676;
+                // justify-content: space-around;
+                padding: 2px 6px;
+                font-size: 12px;
+                .table-name {
+                    width: 24px;
+                    font-size: 12px;
+                    margin: 0 auto;
+                }
+            }
+
+            .title-1 {
+                width: 46px;
+            }
+            .title-2 {
+                flex: 1;
+            }
+            .title-3 {
+                width: 52px;
+            }
+            .title-4 {
+                width: 56px;
+            }
+            .title-5 {
+                width: 52px;
+            }
+            .new-table-wrap {
+                padding: 5px;
+                .new-prescription {
+                    .new-table {
+                        display: flex;
+                        align-items: center;
+                        border: 1px solid rgba(225, 225, 225, 0.8);
+                        background: #fff;
+                        border-radius: 5px;
+                        color: rgba(0, 0, 0, 0.6);
+                        font-size: 11px;
+                        .line-l {
+                            display: flex;
+                            flex: 1;
+                            .line-2 {
+                                flex: 1;
+                                padding: 0 2px;
+                            }
+                        }
+                        .line-r {
+                            &.has-border {
+                                border-left: 1px solid rgba(225, 225, 225, 0.8);
+                            }
+                            .line-3 {
+                                display: flex;
+                                align-items: center;
+                            }
+                            .sub-line {
+                                padding: 10px 0;
+                            }
+                            .line-4 {
+                                display: flex;
+                                align-items: center;
+                                border-top: 1px solid rgba(225, 225, 225, 0.8);
+                            }
+                            .execute-line {
+                                border-right: 1px solid rgba(225, 225, 225, 0.8);
+                            }
+                        }
+                    }
+                    .note-text {
+                        margin: 8px 0 4px 0;
+                        color: rgba(0, 0, 0, 0.4);
+                        background: #fff;
+                        padding: 6px 8px;
+                        border-radius: 5px;
+                        text-align: left;
+                        font-size: 11px;
+                    }
+                }
+                .new-prescription + .new-prescription {
+                    padding-top: 8px;
+                }
+            }
+        }
+
+        .work-map {
+            padding: 10px 0;
+            .map-content {
+                padding-top: 8px;
+                .map-dom {
+                    height: 166px;
+                    width: 100%;
+                    clip-path: inset(0px round 8px);
+                }
+            }
+        }
+    }
+}
+
+.task-tips-popup {
+    width: 75%;
+    padding: 28px 28px 20px;
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    justify-content: center;
+    .create-farm-icon {
+        width: 40px;
+        height: 40px;
+        margin-bottom: 12px;
+    }
+    .farm-check-icon {
+        width: 68px;
+        height: 68px;
+        margin-bottom: 12px;
+    }
+    .create-farm-text {
+        font-size: 20px;
+        font-weight: 500;
+        line-height: 40px;
+        margin-bottom: 32px;
+        text-align: center;
+        &.success-text {
+            font-size: 23px;
+            font-weight: 400;
+        }
+    }
+    .main-text {
+        color: #2199f8;
+    }
+    .create-farm-btn {
+        width: 100%;
+        box-sizing: border-box;
+        padding: 8px;
+        border-radius: 25px;
+        font-size: 16px;
+        background: #2199f8;
+        color: #fff;
+        text-align: center;
+    }
+}
+</style>

+ 120 - 91
src/views/old_mini/modify_work/modify.vue

@@ -13,7 +13,7 @@
                 <div class="farm-card">
                     <div class="card-title between common-inputs">
                         <div>{{ detailData?.name }}<span class="type-tag">标准农事</span></div>
-                        <el-select v-if="isEdit && !onlyPrice" size="small" v-model="tagName" placeholder="标记为" style="width: 94px">
+                        <el-select v-if="isEdit" size="small" v-model="tagName" placeholder="标记为" style="width: 94px">
                             <el-option
                             v-for="item in tagList"
                             :key="item.value"
@@ -21,7 +21,7 @@
                             :value="item.value"
                             />
                         </el-select>
-                        <div class="edit-tag tag-text" v-else>{{ statusMap[detailData?.flowStatus] }}</div>
+                        <div class="edit-tag tag-text" v-else>{{ statusMap[tagName] }}</div>
                         <!-- <el-tooltip
                             effect="dark"
                             placement="left"
@@ -133,7 +133,7 @@
                 </div>
 
                 <template v-if="isEdit">
-                    <div class="farm-card prescription-content common-inputs" v-if="!onlyPrice">
+                    <div class="farm-card prescription-content common-inputs">
                         <div class="card-title pb-12 between">
                             药物处方
                             <div class="add-tag" @click="addDomain()">
@@ -155,7 +155,6 @@
                             </el-select>
                         </el-form-item>
                         <el-form-item v-if="dynamicValidateForm.usageMode === '叶面施'" label-width="82px" class="form-item" prop="executeStyle" label="执行方式">
-                            
                             <el-select
                                     class="select-item"
                                     v-model="dynamicValidateForm.executeStyle"
@@ -184,11 +183,6 @@
                             >
                                 <div class="recipe-item">
                                     <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">药肥{{ index + 1 }}</div>
                                                 <div class="box-item" v-if="domain.typeName">
@@ -254,11 +248,48 @@
                                                             </el-input>
                                                         </div>
                                                     </div>
+
+                                                    
+                                                    <div class="box-item">
+                                                        <div class="form-l">药肥品牌</div>
+                                                        <div class="form-r">
+                                                            <el-input
+                                                                v-model="domain.brand"
+                                                                placeholder="药肥品牌"
+                                                                style="width: 150px"
+                                                            />
+                                                        </div>
+                                                    </div>
+                                                    <div class="box-item">
+                                                        <div class="form-l">药肥单价</div>
+                                                        <div class="form-r">
+                                                            <el-input
+                                                                style="width: 150px"
+                                                                v-model="domain.price"
+                                                                type="number"
+                                                                step="0.01"
+                                                                placeholder="单价"
+                                                            >
+                                                                <template #append>元/{{ domain.unit }}</template>
+                                                            </el-input>
+                                                        </div>
+                                                    </div>
+
+                                                    
+
+                                                    <div class="medicine-item">
+                                                        <div class="item-total">总计:</div>
+                                                        <div class="item-price">
+                                                            {{ getPesticideTotal(domain) }}<span class="item-unit">元</span>
+                                                        </div>
+                                                    </div>
                                                 </div>
                                                 <div class="input-box mark-box">
                                                     <el-input
                                                         v-model="domain.remark"
                                                         style="width: 100%"
+                                                        type="textarea"
+                                                        :rows="2"
                                                         placeholder="备注:用药注意事项"
                                                     />
                                                 </div>
@@ -285,7 +316,35 @@
                         </div>
                     </div>
 
-                    <div
+                    <div class="farm-card prescription-content">
+                        <div class="medicine-box">
+                                <div class="form-index">服务报价</div>
+                                <div class="box-wrap">
+                                    <div class="medicine-item mt-8">
+                                        <div class="item-name">单亩价格</div>
+                                        <div class="item-val common-inputs">
+                                            <el-input
+                                                style="width: 150px"
+                                                v-model="servicePricePerMu"
+                                                type="number"
+                                                step="0.01"
+                                                placeholder="服务单价"
+                                            >
+                                                <template #append>元/亩</template>
+                                            </el-input>
+                                        </div>
+                                    </div>
+                                    <div class="medicine-item">
+                                        <div class="item-total">总计:</div>
+                                        <div class="item-price">
+                                            {{ getServiceTotal() }}<span class="item-unit">元</span>
+                                        </div>
+                                    </div>
+                                </div>
+                            </div>
+                    </div>
+
+                    <!-- <div
                         v-if="dynamicValidateForm.usageMode !== '人工农事'"
                         class="farm-card prescription-content common-inputs"
                     >
@@ -346,37 +405,9 @@
                                     </div>
                                 </div>
                             </template>
-                            <div class="medicine-box">
-                                <div class="form-index">服务报价</div>
-                                <div class="box-wrap">
-                                    <div class="medicine-item mt-8">
-                                        <div class="item-name">单亩价格</div>
-                                        <div class="item-val">
-                                            <el-input
-                                                style="width: 150px"
-                                                v-model="servicePricePerMu"
-                                                type="number"
-                                                step="0.01"
-                                                placeholder="服务单价"
-                                            >
-                                                <template #append>元/亩</template>
-                                            </el-input>
-                                        </div>
-                                    </div>
-                                    <div class="medicine-item">
-                                        <div class="item-name">服务亩数</div>
-                                        <div class="item-val">{{ detailData?.farm?.mianji ? formatArea(detailData?.farm?.mianji) + "亩" : "" }}</div>
-                                    </div>
-                                    <div class="medicine-item">
-                                        <div class="item-total">总计:</div>
-                                        <div class="item-price">
-                                            {{ getServiceTotal() }}<span class="item-unit">元</span>
-                                        </div>
-                                    </div>
-                                </div>
-                            </div>
+                            
                         </div>
-                    </div>
+                    </div> -->
 
                     <div class="submit-btn" :class="{ 'center-btn': onlyPrice }">
                         <div v-if="!onlyPrice" class="btn second" @click.prevent="cancelEdit">取消编辑</div>
@@ -606,14 +637,15 @@ const getDetail = async () => {
     if(code === 0) {
         detailData.value = data;
         dynamicValidateForm.executeDate = data.executeDate;
-        dynamicValidateForm.usageMode = data.prescription.usageMode;
+        dynamicValidateForm.usageMode = data?.prescription?.usageMode === '其他' ? '根部施' : data?.prescription?.usageMode;
         // 从 prescription 获取数据
         dynamicValidateForm.prescription = data.prescription || {
             usageMode: "",
             pesticideFertilizerList: [],
         };
+        dynamicValidateForm.executeStyle = data?.prescription?.pesticideFertilizerList[0]?.executeStyle;
         servicePricePerMu.value = detailData.value.serviceMuPrice || null;
-        const pesticideFertilizerCodes = data.prescription.pesticideFertilizerList.map(item => item.code);
+        const pesticideFertilizerCodes = data?.prescription?.pesticideFertilizerList.map(item => item.code);
         getPriceList(data.schemeId, pesticideFertilizerCodes);
         
         // 加载互动表单数据
@@ -692,7 +724,6 @@ const clearData = () => {
     dynamicValidateForm.conditionRate = "";
     dynamicValidateForm.purpose = "";
     dynamicValidateForm.executeDate = dayjs().format("YYYY-MM-DD");
-    dynamicValidateForm.checkDay = "";
     dynamicValidateForm.usageMode = "";
     dynamicValidateForm.prescription = {
         id: "",
@@ -766,7 +797,6 @@ const dynamicValidateForm = reactive({
     conditionRate: "",
     purpose: "",
     executeDate: dayjs().format("YYYY-MM-DD"),
-    checkDay: "",
     usageMode: "",
     executeStyle: 2,
     executionMethod: 2,
@@ -785,6 +815,8 @@ const dynamicValidateForm = reactive({
                 name: "",
                 dosage: "",
                 ratio: "",
+                brand: "",
+                price: "",
                 typeName: "",
                 muPrice: 0,
                 executeStyle: 1,
@@ -816,13 +848,6 @@ const rules = {
             trigger: "blur",
         },
     ],
-    checkDay: [
-        {
-            required: true,
-            message: "请选择复核时间",
-            trigger: "blur",
-        },
-    ],
 };
 
 const addDomain = () => {
@@ -834,10 +859,12 @@ const addDomain = () => {
         name: "",
         dosage: "",
         ratio: "",
+        brand: "",
+        price: "",
         typeName: "",
         muPrice: 0,
         id: "",
-        executeStyle: 1,
+        executeStyle: 2,
         unit: "",
     });
 };
@@ -887,6 +914,8 @@ const resetItemForm = (index) => {
             name: "",
             dosage: "",
             ratio: "",
+            brand: "",
+            price: "",
             typeName: "",
             muPrice: 0,
             executeStyle: 1,
@@ -1038,6 +1067,7 @@ const submit = () => {
             await getDetail();
             ElMessage.success("保存成功");
             if (onlyPrice.value) {
+                // router.push(`/task_condition?noReload=true`);
                 router.back();
                 return;
             }
@@ -1622,8 +1652,45 @@ const handleDeleteInteract = () => {
         }
     }
 
+    .medicine-item {
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        height: 32px;
+        .item-name {
+            color: rgba(0, 0, 0, 0.4);
+        }
+        .item-val {
+            min-width: 142px;
+            text-align: center;
+            color: #302f2f;
+            display: flex;
+            align-items: center;
+            justify-content: center;
+            gap: 4px;
+            .price-unit {
+                font-size: 12px;
+                color: rgba(0, 0, 0, 0.4);
+                white-space: nowrap;
+            }
+        }
+        .item-total {
+            font-size: 16px;
+            color: #000;
+        }
+        .item-price {
+            color: #2199f8;
+            font-size: 20px;
+            font-weight: bold;
+            .item-unit {
+                font-size: 14px;
+                font-weight: normal;
+                padding-left: 2px;
+                color: #474747;
+            }
+        }
+    }
     .medicine-box {
-        margin-top: 12px;
         // padding-top: 10px;
         border: 1px solid rgba(33, 153, 248, 0.8);
         position: relative;
@@ -1635,44 +1702,6 @@ const handleDeleteInteract = () => {
             font-weight: 500;
             padding-bottom: 10px;
         }
-        .medicine-item {
-            display: flex;
-            align-items: center;
-            justify-content: space-between;
-            height: 32px;
-            .item-name {
-                color: rgba(0, 0, 0, 0.4);
-            }
-            .item-val {
-                min-width: 142px;
-                text-align: center;
-                color: #302f2f;
-                display: flex;
-                align-items: center;
-                justify-content: center;
-                gap: 4px;
-                .price-unit {
-                    font-size: 12px;
-                    color: rgba(0, 0, 0, 0.4);
-                    white-space: nowrap;
-                }
-            }
-            .item-total {
-                font-size: 16px;
-                color: #000;
-            }
-            .item-price {
-                color: #2199f8;
-                font-size: 20px;
-                font-weight: bold;
-                .item-unit {
-                    font-size: 14px;
-                    font-weight: normal;
-                    padding-left: 2px;
-                    color: #474747;
-                }
-            }
-        }
         .medicine-item + .medicine-item {
             padding-top: 2px;
         }

+ 6 - 8
src/views/old_mini/monitor/subPages/plan.vue

@@ -113,13 +113,12 @@ import { ElMessage, ElMessageBox } from "element-plus";
 const router = useRouter();
 const route = useRoute();
 
+const userInfoStr = localStorage.getItem("localUserInfo");
+const userInfo = userInfoStr ? JSON.parse(userInfoStr) : {};
 // 检查是否有"农事规划"权限
 const hasPlanPermission = computed(() => {
     try {
-        const userInfoStr = localStorage.getItem("localUserInfo");
-        if (!userInfoStr) return false;
-        const userInfo = JSON.parse(userInfoStr);
-        const permissions = userInfo.agriculturalPermissions || [];
+        const permissions = userInfo?.agriculturalPermissions || [];
         return permissions.includes("农事规划");
     } catch (error) {
         console.error("解析用户信息失败:", error);
@@ -141,9 +140,8 @@ onMounted(() => {
 // 获取品类列表
 const specieValue = ref(null);
 const options = ref([]);
-const userInfo = JSON.parse(localStorage.getItem("localUserInfo"));
 const getSpecieList = () => {
-    VE_API.farm.fetchSpecieList({ agriculturalId: userInfo.agriculturalId }).then(({ data }) => {
+    VE_API.farm.fetchSpecieList({ agriculturalId: userInfo?.agriculturalId }).then(({ data }) => {
         if (data && data.length) {
             options.value = data || [];
             specieValue.value = data[0]?.defaultContainerId;
@@ -189,7 +187,7 @@ const schemeId = ref(null);
 const getPhenologyList = async () => {
     const params = {
         containerSpaceTimeId: containerSpaceTimeId.value,
-        agriculturalId: userInfo.agriculturalId,
+        agriculturalId: userInfo?.agriculturalId,
         farmId: route.query.farmId,
     };
     const res = await VE_API.monitor.listPhenology(params);
@@ -238,7 +236,7 @@ const handlePhenologySetting = () => {
 const handleConfirmPhenologySetting = async () => {
     const params = {
         farmId: route.query.farmId,
-        agriculturalId: userInfo.agriculturalId,
+        agriculturalId: userInfo?.agriculturalId,
         items: mergedReproductiveList.value.map((item) => ({
             phenologyId: item.id,
             startDate: item.startDate,

+ 5 - 0
src/views/old_mini/task_condition/components/interact.vue

@@ -107,6 +107,7 @@
 
 <script setup>
 import { computed, nextTick, onActivated, onMounted, ref, watch } from "vue";
+import { useRoute } from "vue-router";
 import { useStore } from "vuex";
 import { List as VanList } from "vant";
 import IndexMap from "../../farm_manage/map/index";
@@ -119,6 +120,7 @@ import AgriculturalInteractionCard from "@/components/pageComponents/Agricultura
 
 const store = useStore();
 const router = useRouter();
+const route = useRoute();
 const indexMap = new IndexMap();
 const mapContainer = ref(null);
 const tabBarHeight = computed(() => store.state.home.tabBarHeight);
@@ -201,6 +203,9 @@ onMounted(() => {
 });
 
 onActivated(() => {
+    if (route.query.noReload) {
+        return;
+    }
     resetAndLoad();
 });