Kaynağa Gözat

Merge branch 'master' of http://www.sysuimars.cn:3000/feiniao/feiniao-farm-h5

wangsisi 3 hafta önce
ebeveyn
işleme
9bd1986cfe

+ 2 - 2
src/components/popup/priceSheetPopup.vue

@@ -222,11 +222,11 @@ const handleShare = () => {
         ElMessage.warning('请补全报价数据')
         return;
     }
-    const userId = quotationData.value.users[0]?.userId;
+    const userId = quotationData.value.farmMiniUserId;
     const parmasPage = {
         farmWorkOrderId:quotationData.value.orderId,
         farmMiniUserId:userId,
-        farmMiniUserName:quotationData.value.expertUserName,
+        farmMiniUserName:quotationData.value.farmMiniUserName,
         farmId:quotationData.value.farmId,
         farmWorkName:quotationData.value.farmWorkName,
         id:quotationData.value.id,

+ 235 - 157
src/views/old_mini/modify_work/completedWork.vue

@@ -42,11 +42,14 @@
                             </div>
                             <div class="executor-details">
                                 <div class="org-name">
-                                    <span class="name">{{ quotationData.agriculturalStoreName || '--' }}</span>
-                                    <span class="rating">{{ quotationData.score ? (quotationData.score + '分') : '--' }}</span>
+                                    <span class="name">{{ quotationData.agriculturalStoreName || "--" }}</span>
+                                    <span class="rating">{{
+                                        quotationData.score ? quotationData.score + "分" : "--"
+                                    }}</span>
                                 </div>
                                 <div class="service-info">
-                                    <div class="service-item">服务品种:
+                                    <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>
@@ -69,7 +72,9 @@
                         <div class="farm-info">
                             <div class="info-title-wrap">
                                 <div class="sub-title">肥药费用</div>
-                                <div class="info-more">{{ quotationData.pesticideFertilizerCost || '--' }}<span class="unit-text">元</span></div>
+                                <div class="info-more">
+                                    {{ quotationData.pesticideFertilizerCost || "--" }}<span class="unit-text">元</span>
+                                </div>
                             </div>
                             <div class="info-content-wrap">
                                 <price-table :prescriptionData="quotationData.prescriptionList">
@@ -77,15 +82,45 @@
                                         <div class="price-bottom">
                                             <div class="info-title-wrap">
                                                 <div class="sub-title">服务费用</div>
-                                                <div class="info-more">{{ quotationData?.farmWorkServiceCost ? getServiceCost(quotationData.farmWorkServiceCost, quotationData.area) : '--' }}<span class="unit-text">元</span></div>
+                                                <div class="info-more">
+                                                    {{
+                                                        quotationData?.farmWorkServiceCost
+                                                            ? getServiceCost(
+                                                                  quotationData.farmWorkServiceCost,
+                                                                  quotationData.area
+                                                              )
+                                                            : "--"
+                                                    }}<span class="unit-text">元</span>
+                                                </div>
                                             </div>
                                             <div class="price-info">
-                                                <div class="info-l">执行方式<span class="main-text">{{ quotationData.executionMethodName || '--' }}</span></div>
-                                                <div class="info-c">亩单价<span class="main-text">{{ quotationData.farmWorkServiceCost ? (quotationData.farmWorkServiceCost + '元/亩') : '--' }}</span></div>
-                                                <div class="info-r">亩数<span class="main-text">{{ quotationData.area ? formatArea(quotationData.area) + '亩' : '--' }}</span></div>
+                                                <div class="info-l">
+                                                    执行方式<span class="main-text">{{
+                                                        quotationData.executionMethodName || "--"
+                                                    }}</span>
+                                                </div>
+                                                <div class="info-c">
+                                                    亩单价<span class="main-text">{{
+                                                        quotationData.farmWorkServiceCost
+                                                            ? quotationData.farmWorkServiceCost + "元/亩"
+                                                            : "--"
+                                                    }}</span>
+                                                </div>
+                                                <div class="info-r">
+                                                    亩数<span class="main-text">{{
+                                                        quotationData.area
+                                                            ? formatArea(quotationData.area) + "亩"
+                                                            : "--"
+                                                    }}</span>
+                                                </div>
                                             </div>
                                             <div class="price-total">
-                                                报价合计:<span class="main-val">{{ quotationData?.totalCost ? formatArea(quotationData.totalCost) : '--' }}</span>元
+                                                报价合计:<span class="main-val">{{
+                                                    quotationData?.totalCost
+                                                        ? formatArea(quotationData.totalCost)
+                                                        : "--"
+                                                }}</span
+                                                >元
                                             </div>
                                         </div>
                                     </template>
@@ -100,7 +135,13 @@
                 </div>
             </div>
             <div class="work-wrap info-wrap">
-                <div class="box-wrap farm-photo farm-info" v-if="(curRole == 2 && currentStep == 2 && detailData?.executeEvidence?.length) || (curRole == 0 && detailData?.flowStatus === 4 && detailData?.executeEvidence?.length)">
+                <div
+                    class="box-wrap farm-photo farm-info"
+                    v-if="
+                        (curRole == 2 && currentStep == 2 && detailData?.executeEvidence?.length) ||
+                        (curRole == 0 && detailData?.flowStatus === 4 && detailData?.executeEvidence?.length)
+                    "
+                >
                     <div class="info-title">
                         <div class="card-title">执行照片</div>
                         <!-- <div class="info-more">
@@ -118,11 +159,16 @@
                         </div> -->
 
                         <photo-provider :photo-closable="true">
-                                <photo-consumer v-for="src in detailData.executeEvidence" intro="执行照片" :key="src" :src="base_img_url2 + src">
-                                    <div class="img-item">
-                                        <img :src="base_img_url2 + src" class="view-box">
-                                    </div>
-                                </photo-consumer>
+                            <photo-consumer
+                                v-for="src in detailData.executeEvidence"
+                                intro="执行照片"
+                                :key="src"
+                                :src="base_img_url2 + src"
+                            >
+                                <div class="img-item">
+                                    <img :src="base_img_url2 + src" class="view-box" />
+                                </div>
+                            </photo-consumer>
                         </photo-provider>
                     </div>
                 </div>
@@ -134,18 +180,21 @@
                             <el-icon><ArrowRight /></el-icon>
                         </div> -->
                     </div>
-                    <div class="info-content">
-                        水稻移栽后返青成活(新根萌发、心叶展开),进入分蘖始期
-                    </div>
+                    <div class="info-content">水稻移栽后返青成活(新根萌发、心叶展开),进入分蘖始期</div>
                 </div>
                 <div class="box-wrap farm-photo" v-if="triggerImg.length">
                     <div class="photo-list">
                         <photo-provider :photo-closable="true">
-                                <photo-consumer v-for="src in triggerImg" intro="触发照片" :key="src" :src="base_img_url2 + src.cloudFilename">
-                                    <div class="img-item">
-                                        <img :src="base_img_url2 + src.cloudFilename" class="view-box">
-                                    </div>
-                                </photo-consumer>
+                            <photo-consumer
+                                v-for="src in triggerImg"
+                                intro="触发照片"
+                                :key="src"
+                                :src="base_img_url2 + src.cloudFilename"
+                            >
+                                <div class="img-item">
+                                    <img :src="base_img_url2 + src.cloudFilename" class="view-box" />
+                                </div>
+                            </photo-consumer>
                         </photo-provider>
                     </div>
                     <!-- <div class="list-text">点击查看更多</div> -->
@@ -166,7 +215,9 @@
                         </div>
                         <div class="form-item">
                             <div class="item-name">服务亩数</div>
-                            <div class="item-text">{{ detailData?.area ? formatArea(detailData?.area) + '亩' : '--' }}</div>
+                            <div class="item-text">
+                                {{ detailData?.area ? formatArea(detailData?.area) + "亩" : "--" }}
+                            </div>
                         </div>
                         <div class="form-item">
                             <div class="item-name">服务区域</div>
@@ -214,10 +265,7 @@
                                         <div class="line-1 title-1">{{ prescriptionItem.name }}</div>
                                         <div class="line-2">{{ subP.defaultName || subP.pesticideFertilizerName }}</div>
                                     </div>
-                                    <div
-                                        class="line-r"
-                                        :class="{ 'has-border': detailData?.usageMode === '叶面施' }"
-                                    >
+                                    <div class="line-r" :class="{ 'has-border': detailData?.usageMode === '叶面施' }">
                                         <div class="line-3">
                                             <div
                                                 class="sub-line title-3"
@@ -254,39 +302,73 @@
             </div>
             <div
                 class="fixed-btn-wrap"
-                :class="{ center: currentStep == 0 || (detailData?.flowStatus == 3 && curRole == 0) || (detailData?.flowStatus == 4 && curRole == 2) || (detailData?.flowStatus == 2 && curRole == 0) || (detailData?.flowStatus == 4 && curRole == 0)}"
+                :class="{
+                    center:
+                        currentStep == 0 ||
+                        (detailData?.flowStatus == 3 && curRole == 0) ||
+                        (detailData?.flowStatus == 4 && curRole == 2) ||
+                        (detailData?.flowStatus == 2 && curRole == 0) ||
+                        (detailData?.flowStatus == 4 && curRole == 0),
+                }"
                 v-if="query.status !== 'warning'"
             >
                 <!-- <div class="fixed-btn expert">提醒农事确认</div> -->
-                
-                <div class="fixed-btn expert" v-if="detailData?.flowStatus == 4 && curRole == 0 && detailData?.executeEvidence?.length" @click="handleConfirmComplete">确认对方完成</div>
-                <div class="fixed-btn expert" v-if="detailData?.flowStatus == 4 && curRole == 0 && !detailData?.executeEvidence?.length" @click="handleRemindExecute">提醒对方执行</div>
-                <div class="fixed-btn orange" v-if="detailData?.flowStatus == 1 && curRole == 0 && !query?.isAssign" @click="handleDemand">发起需求</div>
-                <div class="fixed-btn orange" v-if="detailData?.flowStatus == 2 && !(query?.farmWorkOrderId) && curRole == 0" @click="cancelDemand">取消发起</div>
-                <div class="fixed-btn" v-if="detailData?.flowStatus == 1 && curRole == 0 && !query?.isAssign" @click="handleOk">我已完成</div>
+
+                <div
+                    class="fixed-btn expert"
+                    v-if="detailData?.flowStatus == 4 && curRole == 0 && detailData?.executeEvidence?.length"
+                    @click="handleConfirmComplete"
+                >
+                    确认对方完成
+                </div>
+                <div
+                    class="fixed-btn expert"
+                    v-if="detailData?.flowStatus == 4 && curRole == 0 && !detailData?.executeEvidence?.length"
+                    @click="handleRemindExecute"
+                >
+                    提醒对方执行
+                </div>
+                <div
+                    class="fixed-btn orange"
+                    v-if="detailData?.flowStatus == 1 && curRole == 0 && !query?.isAssign"
+                    @click="handleDemand"
+                >
+                    发起需求
+                </div>
+                <div
+                    class="fixed-btn orange"
+                    v-if="detailData?.flowStatus == 2 && !query?.farmWorkOrderId && curRole == 0"
+                    @click="cancelDemand"
+                >
+                    取消发起
+                </div>
+                <div
+                    class="fixed-btn"
+                    v-if="detailData?.flowStatus == 1 && curRole == 0 && !query?.isAssign"
+                    @click="handleOk"
+                >
+                    我已完成
+                </div>
             </div>
 
             <!-- 农户,步骤:农资已生成报价,农户要确认对方执行 -->
             <div
                 class="fixed-btn-wrap center"
-                v-if="(detailData?.flowStatus == 2 && query?.farmWorkOrderId && curRole == 0) || (query?.isAssign && curRole == 0 && detailData?.flowStatus < 4)"
+                v-if="
+                    (detailData?.flowStatus == 2 && query?.farmWorkOrderId && curRole == 0) ||
+                    (query?.isAssign && curRole == 0 && detailData?.flowStatus < 4)
+                "
             >
-            <div class="fixed-btn expert excute" @click="handleConfirmExecute">确认对方执行</div>
+                <div class="fixed-btn expert excute" @click="handleConfirmExecute">确认对方执行</div>
             </div>
 
             <!-- 农资,步骤:农事已确认 -->
-            <div
-                class="fixed-btn-wrap"
-                v-if="curRole == 2 && currentStep == 1"
-            >
+            <div class="fixed-btn-wrap" v-if="curRole == 2 && currentStep == 1">
                 <div class="fixed-btn second" @click="handleForward">转发给客户</div>
                 <div class="fixed-btn" @click="showPriceSheetPopup">生成报价单</div>
             </div>
             <!-- 农资,步骤:农资已执行,请求确认 -->
-            <div
-                class="fixed-btn-wrap"
-                v-if="curRole == 2 && currentStep == 2"
-            >
+            <div class="fixed-btn-wrap" v-if="curRole == 2 && currentStep == 2">
                 <div class="fixed-btn second" @click="handleShare">转发给客户</div>
                 <div class="fixed-btn" @click="showUploadExecutePopup">请求确认</div>
             </div>
@@ -299,16 +381,18 @@
     <!-- 需求发送成功 -->
     <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="" />
+            <img class="create-farm-icon" src="@/assets/img/home/create-farm-icon.png" alt="" />
             <div class="create-farm-text">
                 <div>您确认取消已发起的农事需求吗</div>
             </div>
         </template>
         <template v-else>
-            <img class="farm-check-icon" src="@/assets/img/home/right.png" alt="">
+            <img class="farm-check-icon" src="@/assets/img/home/right.png" alt="" />
             <div class="create-farm-text success-text">{{ successText }}</div>
         </template>
-        <div class="create-farm-btn" @click="handlePopupBtn">{{ taskPopupType === 'warning' ? '确认' : '我知道了' }}</div>
+        <div class="create-farm-btn" @click="handlePopupBtn">
+            {{ taskPopupType === "warning" ? "确认" : "我知道了" }}
+        </div>
     </popup>
 
     <!-- 上传执行照片 -->
@@ -358,51 +442,51 @@ const handleOk = () => {
     }
 };
 
-const successText = ref('');
+const successText = ref("");
 const taskPopupActionType = ref(0);
 const handleDemand = () => {
     // router.push("/share_page");
     VE_API.z_farm_work_record.updateFlowStatus({ id: query.value.id, targetFlowStatus: 2 }).then((res) => {
         if (res.code === 0) {
-            taskPopupType.value = 'success';
-            successText.value = '需求已发送成功';
+            taskPopupType.value = "success";
+            successText.value = "需求已发送成功";
             taskPopupActionType.value = 0;
             showTaskPopup.value = true;
         }
-    })
+    });
 };
 
 const showTaskPopup = ref(false);
-const taskPopupType = ref('');
+const taskPopupType = ref("");
 const handlePopupBtn = () => {
     showTaskPopup.value = false;
-    if (taskPopupType.value === 'warning') {
+    if (taskPopupType.value === "warning") {
         // 确认忽略
         VE_API.z_farm_work_record.updateFlowStatus({ id: query.value.id, targetFlowStatus: 1 }).then((res) => {
             if (res.code === 0) {
                 getDetail(query.value.id);
-                currentStep.value = 1
+                currentStep.value = 1;
             }
-        })
+        });
     } else {
         if (taskPopupActionType.value === 0) {
             getDetail(query.value.id);
-            currentStep.value = 2
+            currentStep.value = 2;
         } else {
             router.replace({
                 path: "/review_work",
                 query: {
-                    json: JSON.stringify({ id: query.value.id })
+                    json: JSON.stringify({ id: query.value.id }),
                 },
             });
         }
     }
-}
+};
 
 const cancelDemand = () => {
-    taskPopupType.value = 'warning';
+    taskPopupType.value = "warning";
     showTaskPopup.value = true;
-}
+};
 
 const priceSheetPopupRef = ref(null);
 const showPriceSheetPopup = () => {
@@ -410,46 +494,47 @@ const showPriceSheetPopup = () => {
 };
 
 const handleConfirmExecute = () => {
-    VE_API.z_farm_work_record_cost.selectQuote({ farmWorkRecordId: query.value.id, agriculturalId: quotationData.value.agriculturalId }).then((res) => {
-    if (res.code === 0) {
-        taskPopupType.value = 'success';
-        successText.value = '农事已锁单成功';
-        taskPopupActionType.value = 0;
-        showTaskPopup.value = true;
-    }
-})
+    VE_API.z_farm_work_record_cost
+        .selectQuote({ farmWorkRecordId: query.value.id, agriculturalId: quotationData.value.agriculturalId })
+        .then((res) => {
+            if (res.code === 0) {
+                taskPopupType.value = "success";
+                successText.value = "农事已锁单成功";
+                taskPopupActionType.value = 0;
+                showTaskPopup.value = true;
+            }
+        });
 };
 
 const handleConfirmComplete = () => {
     VE_API.z_farm_work_record.updateFlowStatus({ id: query.value.id, targetFlowStatus: 5 }).then((res) => {
         if (res.code === 0) {
-            taskPopupType.value = 'success';
-            successText.value = '农事已经执行结束,请按照时间复核';
+            taskPopupType.value = "success";
+            successText.value = "农事已经执行结束,请按照时间复核";
             taskPopupActionType.value = 1;
             showTaskPopup.value = true;
         }
-    })
+    });
 };
 
 const handleRemindExecute = () => {
     onlyShare.value = true;
     setTimeout(() => {
-        uploadExecuteRef.value.showPopup({...parmasPage.value, type:'remindExecute'});
+        uploadExecuteRef.value.showPopup({ ...parmasPage.value, type: "remindExecute" });
     }, 10);
-}
+};
 
 const handleForward = () => {
-    console.log('quotationData.value',quotationData.value)
-    if(quotationData.value.itemsList && quotationData.value.itemsList.length > 0) {
+    if (quotationData.value.itemsList && quotationData.value.itemsList.length > 0) {
         onlyShare.value = true;
         setTimeout(() => {
-            uploadExecuteRef.value.showPopup({...parmasPage.value, type:'quotation'});
+            uploadExecuteRef.value.showPopup({ ...parmasPage.value, type: "quotation" });
         }, 10);
     } else {
-        ElMessage.warning('暂无报价数据,无法分享')
+        ElMessage.warning("暂无报价数据,无法分享");
         return;
     }
-}
+};
 
 const onlyShare = ref(false);
 const handleShare = () => {
@@ -467,7 +552,6 @@ const showUploadExecutePopup = () => {
     setTimeout(() => {
         uploadExecuteRef.value.showPopup(parmasPage.value);
     }, 10);
-   
 };
 // 地图
 // const areaRef = ref(null);
@@ -485,140 +569,135 @@ onActivated(async () => {
     const id = query.value?.id;
     if (id) {
         await getDetail(id);
-        getTriggerImg(id)
+        getTriggerImg(id);
     }
     parmasPage.value = {
-        farmMiniUserId:detailData.value.users[0]?.userId,
-        farmMiniUserName:detailData.value.expertUserName,
-        farmWorkOrderId:detailData.value.orderId,
-        farmId:detailData.value.farmId,
-        executeEvidence:JSON.stringify(detailData.value.executeEvidence),
-        farmWorkName:detailData.value.farmWorkName,
-        id:detailData.value.id,
-    }
+        farmMiniUserId: curRole.value == 2 ? detailData.value.farmMiniUserId : detailData.value.users[0]?.userId,
+        farmMiniUserName: curRole.value == 2 ? detailData.value.farmMiniUserName : detailData.value.expertUserName,
+        farmWorkOrderId: detailData.value.orderId,
+        farmId: detailData.value.farmId,
+        executeEvidence: JSON.stringify(detailData.value.executeEvidence),
+        farmWorkName: detailData.value.farmWorkName,
+        id: detailData.value.id,
+    };
     if (query.value?.farmWorkOrderId || detailData.value?.flowStatus === 4) {
         const farmWorkOrderId = query.value?.farmWorkOrderId || detailData.value.orderId;
-        let priceDataObj = {}
+        let priceDataObj = {};
         if (curRole.value == 2) {
-            const {data} = await VE_API.z_farm_work_record_cost.getByRecordId({ farmWorkRecordId: detailData.value.id });
+            const { data } = await VE_API.z_farm_work_record_cost.getByRecordId({
+                farmWorkRecordId: detailData.value.id,
+            });
             priceDataObj = data;
         } else {
-            const {data} = await VE_API.z_farm_work_record_cost.listByOrderId({ farmWorkOrderId });
+            const { data } = await VE_API.z_farm_work_record_cost.listByOrderId({ farmWorkOrderId });
             priceDataObj = data[0];
         }
-        console.log('priceD3333ataObj',priceDataObj)
         if (priceDataObj && Object.keys(priceDataObj).length > 0) {
-            
             // 合并外层字段
             quotationData.value = {
                 ...detailData.value,
                 ...priceDataObj,
                 agriculturalId: priceDataObj.agriculturalId,
             };
-            
+
             // 根据 itemsList 的 pesticideFertilizerId 匹配并赋值品牌和价格
             if (priceDataObj.itemsList && Array.isArray(priceDataObj.itemsList) && detailData.value.prescriptionList) {
                 // 创建价格映射表
                 const priceMap = new Map();
-                priceDataObj.itemsList.forEach(item => {
+                priceDataObj.itemsList.forEach((item) => {
                     priceMap.set(String(item.pesticideFertilizerId), {
-                        brand: item.brand || '',
+                        brand: item.brand || "",
                         price: item.price || 0,
-                        totalPrice: item.totalPrice || null
+                        totalPrice: item.totalPrice || null,
                     });
                 });
-                
+
                 // 遍历处方列表,赋值品牌和价格,并计算格式化字段供 price-table 使用
-                quotationData.value.prescriptionList = detailData.value.prescriptionList.map(prescription => {
+                quotationData.value.prescriptionList = detailData.value.prescriptionList.map((prescription) => {
                     return {
                         ...prescription,
-                        pesticideFertilizerList: prescription.pesticideFertilizerList.map(pesticide => {
-                            const pesticideId = String(pesticide.pesticideFertilizerId || '');
+                        pesticideFertilizerList: prescription.pesticideFertilizerList.map((pesticide) => {
+                            const pesticideId = String(pesticide.pesticideFertilizerId || "");
                             const priceInfo = priceMap.get(pesticideId);
-                            
+
                             if (priceInfo) {
                                 const price = priceInfo.price || 0;
                                 const muUsage = pesticide.muUsage || 0;
-                                const unit = pesticide.unit || '';
+                                const unit = pesticide.unit || "";
                                 const area = detailData.value.area || 0;
-                                
+
                                 // 计算总价:优先使用 totalPrice,否则计算 price * muUsage * area
-                                const total = priceInfo.totalPrice 
-                                    ? priceInfo.totalPrice 
-                                    : (price * muUsage * area);
-                                
+                                const total = priceInfo.totalPrice ? priceInfo.totalPrice : price * muUsage * area;
+
                                 return {
                                     ...pesticide,
-                                    brand: priceInfo.brand || '--',
+                                    brand: priceInfo.brand || "--",
                                     totalPrice: priceInfo.totalPrice,
                                     // 格式化字段供 price-table 组件使用
-                                    price: price > 0 ? `${price}元/${unit}` : '--', // 格式化单价显示
-                                    dosage: muUsage > 0 ? `${muUsage}${unit}` : '--', // 格式化用量显示
-                                    total: total > 0 ? total.toFixed(2) : '--' // 格式化总价显示
+                                    price: price > 0 ? `${price}元/${unit}` : "--", // 格式化单价显示
+                                    dosage: muUsage > 0 ? `${muUsage}${unit}` : "--", // 格式化用量显示
+                                    total: total > 0 ? total.toFixed(2) : "--", // 格式化总价显示
                                 };
                             }
                             return pesticide;
-                        })
+                        }),
                     };
                 });
             }
         }
     } else if (curRole.value == 2) {
-        let priceDataObj = {}
-        const {data} = await VE_API.z_farm_work_record_cost.getByRecordId({ farmWorkRecordId: detailData.value.id });
+        let priceDataObj = {};
+        const { data } = await VE_API.z_farm_work_record_cost.getByRecordId({ farmWorkRecordId: detailData.value.id });
         priceDataObj = data;
         if (priceDataObj && Object.keys(priceDataObj).length > 0) {
-            
             // 合并外层字段
             quotationData.value = {
                 ...detailData.value,
                 ...priceDataObj,
                 agriculturalId: priceDataObj.agriculturalId,
             };
-            
+
             // 根据 itemsList 的 pesticideFertilizerId 匹配并赋值品牌和价格
             if (priceDataObj.itemsList && Array.isArray(priceDataObj.itemsList) && detailData.value.prescriptionList) {
                 // 创建价格映射表
                 const priceMap = new Map();
-                priceDataObj.itemsList.forEach(item => {
+                priceDataObj.itemsList.forEach((item) => {
                     priceMap.set(String(item.pesticideFertilizerId), {
-                        brand: item.brand || '',
+                        brand: item.brand || "",
                         price: item.price || 0,
-                        totalPrice: item.totalPrice || null
+                        totalPrice: item.totalPrice || null,
                     });
                 });
-                
+
                 // 遍历处方列表,赋值品牌和价格,并计算格式化字段供 price-table 使用
-                quotationData.value.prescriptionList = detailData.value.prescriptionList.map(prescription => {
+                quotationData.value.prescriptionList = detailData.value.prescriptionList.map((prescription) => {
                     return {
                         ...prescription,
-                        pesticideFertilizerList: prescription.pesticideFertilizerList.map(pesticide => {
-                            const pesticideId = String(pesticide.pesticideFertilizerId || '');
+                        pesticideFertilizerList: prescription.pesticideFertilizerList.map((pesticide) => {
+                            const pesticideId = String(pesticide.pesticideFertilizerId || "");
                             const priceInfo = priceMap.get(pesticideId);
-                            
+
                             if (priceInfo) {
                                 const price = priceInfo.price || 0;
                                 const muUsage = pesticide.muUsage || 0;
-                                const unit = pesticide.unit || '';
+                                const unit = pesticide.unit || "";
                                 const area = detailData.value.area || 0;
-                                
+
                                 // 计算总价:优先使用 totalPrice,否则计算 price * muUsage * area
-                                const total = priceInfo.totalPrice 
-                                    ? priceInfo.totalPrice 
-                                    : (price * muUsage * area);
-                                
+                                const total = priceInfo.totalPrice ? priceInfo.totalPrice : price * muUsage * area;
+
                                 return {
                                     ...pesticide,
-                                    brand: priceInfo.brand || '--',
+                                    brand: priceInfo.brand || "--",
                                     totalPrice: priceInfo.totalPrice,
                                     // 格式化字段供 price-table 组件使用
-                                    price: price > 0 ? `${price}元/${unit}` : '--', // 格式化单价显示
-                                    dosage: muUsage > 0 ? `${muUsage}${unit}` : '--', // 格式化用量显示
-                                    total: total > 0 ? total.toFixed(2) : '--' // 格式化总价显示
+                                    price: price > 0 ? `${price}元/${unit}` : "--", // 格式化单价显示
+                                    dosage: muUsage > 0 ? `${muUsage}${unit}` : "--", // 格式化用量显示
+                                    total: total > 0 ? total.toFixed(2) : "--", // 格式化总价显示
                                 };
                             }
                             return pesticide;
-                        })
+                        }),
                     };
                 });
             }
@@ -627,7 +706,7 @@ onActivated(async () => {
     // const point = store.state.home.miniUserLocationPoint;
     // if (areaRef.value) {
     //     newFarmMap.initMap(point, areaRef.value, false);
-    
+
     //     getAreaList(() => {
     //         console.log("areaList.value", areaList.value);
     //         newFarmMap.initArea(areaList.value);
@@ -636,7 +715,7 @@ onActivated(async () => {
 });
 
 function getServiceCost(cost, area) {
-    if (!cost || !area) return '--';
+    if (!cost || !area) return "--";
     return (parseFloat(cost) * parseFloat(area)).toFixed(2);
 }
 
@@ -644,7 +723,7 @@ const triggerImg = ref([]);
 const getTriggerImg = async (id) => {
     const { data } = await VE_API.z_farm_work_record.getTriggerImg({ farmWorkRecordId: id });
     triggerImg.value = data || [];
-}
+};
 const detailData = ref({});
 const getDetail = async (id) => {
     const { data } = await VE_API.z_farm_work_record.getDetail({ id });
@@ -659,7 +738,7 @@ function getCurrentStep(flowStatus) {
         return 1;
     } else if (flowStatus === 4) {
         return 2;
-    } else if (flowStatus ===5) {
+    } else if (flowStatus === 5) {
         return 3;
     } else {
         return 0;
@@ -783,8 +862,8 @@ const getAreaList = (callback) => {
 const gardenId = ref(null);
 const changeRegion = (e) => {
     // newFarmMap.getBlueRegion({ gardenId: gardenId.value, regionId: e }, () => {
-        // newFarmMap.setBlueRegion([{id: "ws0y1me7h94u"}, {id: "ws0y1me545tg"}])
-        // serveArea.value = "3.72亩"
+    // newFarmMap.setBlueRegion([{id: "ws0y1me7h94u"}, {id: "ws0y1me545tg"}])
+    // serveArea.value = "3.72亩"
     // });
 };
 </script>
@@ -850,10 +929,10 @@ const changeRegion = (e) => {
                     background: #fff;
                 }
                 &.excute {
-                    background: linear-gradient(180deg, #FFD887, #ED9E1E);
+                    background: linear-gradient(180deg, #ffd887, #ed9e1e);
                 }
                 &.second {
-                    background: #FFFFFF;
+                    background: #ffffff;
                     border: 1px solid rgba(153, 153, 153, 0.5);
                     color: #666666;
                 }
@@ -964,15 +1043,15 @@ const changeRegion = (e) => {
             padding: 10px 0;
             position: relative;
         }
-        .info-title-wrap{
+        .info-title-wrap {
             display: flex;
             align-items: center;
             justify-content: space-between;
             color: #000;
-            .info-more{
+            .info-more {
                 font-size: 18px;
             }
-            .unit-text{
+            .unit-text {
                 font-size: 12px;
             }
         }
@@ -1113,7 +1192,7 @@ const changeRegion = (e) => {
                     border-radius: 8px;
                     object-fit: cover;
                 }
-                
+
                 .img-item {
                     img {
                         width: 92px;
@@ -1274,7 +1353,6 @@ const changeRegion = (e) => {
     }
 }
 
-
 .task-tips-popup {
     width: 75%;
     padding: 28px 28px 20px;
@@ -1282,37 +1360,37 @@ const changeRegion = (e) => {
     flex-direction: column;
     align-items: center;
     justify-content: center;
-    .create-farm-icon{
+    .create-farm-icon {
         width: 40px;
         height: 40px;
         margin-bottom: 12px;
     }
-    .farm-check-icon{
+    .farm-check-icon {
         width: 68px;
         height: 68px;
         margin-bottom: 12px;
     }
-    .create-farm-text{
+    .create-farm-text {
         font-size: 20px;
         font-weight: 500;
         line-height: 40px;
         margin-bottom: 32px;
         text-align: center;
-        &.success-text{
+        &.success-text {
             font-size: 23px;
             font-weight: 400;
         }
     }
     .main-text {
-        color: #2199F8;
+        color: #2199f8;
     }
-    .create-farm-btn{
+    .create-farm-btn {
         width: 100%;
         box-sizing: border-box;
         padding: 8px;
         border-radius: 25px;
         font-size: 16px;
-        background: #2199F8;
+        background: #2199f8;
         color: #fff;
         text-align: center;
     }

+ 11 - 2
src/views/old_mini/offer_price/component/fertilizerPrice.vue

@@ -167,14 +167,23 @@ const currentPage = ref(1);
 const pageSize = ref(10);
 const getFertilizerList = (page = 1, isLoadMore = false) => {
     loading.value = true;
+    // 首次加载或切换筛选时,需要重置 finished
+    if (!isLoadMore && page === 1) {
+        finished.value = false;
+    }
     VE_API.z_farm_work_pesticide_fertilizer.fertilizerList({
         page: page,
         limit: pageSize.value,
     }).then(({ data }) => {
+        const list = Array.isArray(data) ? data : (data?.list || []);
         if (isLoadMore) {
-            priceList.value = [...priceList.value, ...data];
+            priceList.value = [...priceList.value, ...list];
         } else {
-            priceList.value = data;
+            priceList.value = list;
+        }
+        // 如果返回为空数组或少于分页大小,标记为已加载完成,避免继续触发请求
+        if (!Array.isArray(list) || list.length === 0 || list.length < pageSize.value) {
+            finished.value = true;
         }
         loading.value = false;
     })

+ 3 - 0
src/views/old_mini/price_detail/index.vue

@@ -158,6 +158,9 @@ onActivated(() => {
     query = useRoute().query;
     detailData.value = JSON.parse(query.data);
     executeDate.value = detailData.value.executeDate;
+    if (detailData.value.usageMode === "根部施") {
+        executionMethod.value = 2;
+    }
     priceData.value = JSON.parse(query?.priceData || '{}');
     
     // 从 priceData 中匹配价格和品牌到对应的药肥

+ 2 - 2
src/views/old_mini/task_condition/components/reviewPopup.vue

@@ -111,11 +111,11 @@ async function getDetail() {
 }
 
 const handleShare = () => {
-    const userId = quotationData.value.users[0]?.userId;
+    const userId = quotationData.value.farmMiniUserId;
     const parmasPage = {
         farmWorkOrderId: quotationData.value.orderId,
         farmMiniUserId: userId,
-        farmMiniUserName: quotationData.value.expertUserName,
+        farmMiniUserName: quotationData.value.farmMiniUserName,
         farmId: quotationData.value.farmId,
         farmWorkName: quotationData.value.farmWorkName,
         id: quotationData.value.id,

+ 2 - 2
src/views/old_mini/task_condition/components/uploadExecute.vue

@@ -69,8 +69,8 @@ function handleConfirm() {
             VE_API.z_farm_work_record.getDetail({ id: farmData.value.id }).then(({ data }) => {
                 const dataItem = data[0];
                 farmData.value = {
-                    farmMiniUserId: dataItem.users && dataItem.users.length > 0 ? dataItem.users[0]?.userId : null,
-                    farmMiniUserName: dataItem.expertUserName,
+                    farmMiniUserId: dataItem.farmMiniUserId || (dataItem.users && dataItem.users.length > 0 ? dataItem.users[0]?.userId : null),
+                    farmMiniUserName: dataItem.farmMiniUserName || dataItem.expertUserName,
                     farmWorkOrderId: dataItem.orderId,
                     farmId: dataItem.farmId,
                     executeEvidence:JSON.stringify(dataItem.executeEvidence),