Pārlūkot izejas kodu

fix: 农资农事服务各类状态和对应农事待完成页状态

刘秀芳 2 dienas atpakaļ
vecāks
revīzija
6291bef1cf

+ 3 - 3
src/App.vue

@@ -21,7 +21,7 @@
     </router-view>
 
     <Tabbar class="tabbar" route fixed v-show="showTab" active-color="#2199F8" inactive-color="#898989">
-        <tabbar-item replace to="/home" v-if="curRole == 0">
+        <tabbar-item replace to="/home" v-if="curRole == 0 || curRole == 2">
             <span>首页</span>
             <template #icon="props">
                 <img
@@ -47,7 +47,7 @@
             </template>
         </tabbar-item>
         <tabbar-item replace to="/task_condition" v-if="curRole == 2">
-            <span>农情需求</span>
+            <span>农事服务</span>
             <template #icon="props">
                 <img
                     :src="
@@ -138,7 +138,7 @@ const router = useRouter();
 // 首页loading加载完才显示底部导航栏
 const showTab = ref(false);
 // 0: 农户, 1: 专家, 2:农资农服
-const curRole = ref(0);
+const curRole = ref(2);
 
 let tabBarHeight = 0;
 onMounted(() => {

+ 117 - 4
src/components/taskItem.vue

@@ -5,9 +5,9 @@
                 <div class="item-name">梢期杀虫</div>
                 <div class="item-time">2025.08.27</div>
             </div>
-            <div class="top-r" v-if="!status">查看处方</div>
+            <div class="top-r">{{ status === 0 ? "查看处方" : "查看详情" }}</div>
         </div>
-        <div class="item-box">
+        <div class="item-box" v-if="status === 0">
             <!-- <div class="title-wrap">
                 <div class="title-l">
                     <div class="item-title">未命名农场</div>
@@ -63,6 +63,56 @@
             </div>
             <slot name="footer"></slot>
         </div>
+        <div class="item-box" v-else>
+            <div class="item-desc">
+                <div class="desc-info">
+                    <div class="desc-info-item">
+                        <span>药物处方:</span>
+                        <span class="value">1000倍国光乙烯利</span>
+                    </div>
+                </div>
+                <div class="desc-info two-text" v-if="!expiredDay">
+                    <div class="desc-info-item">
+                        <div>复核成效</div>
+                        <span class="value">通过精准农业技术的应用,作物产量实现了两位数的增长,病虫害的发生率大幅下降,土壤肥力的提升</span>
+                    </div>
+                </div>
+                <div class="review-image" v-if="!expiredDay">
+                    <div class="review-image-item">
+                        <div class="review-image-item-title">农事前</div>
+                        <img
+                            src="@/assets/img/monitor/aaa.png"
+                            alt=""
+                        />
+                    </div>
+                    <div class="review-image-item">
+                        <div class="review-image-item-title">农事后</div>
+                        <img
+                            src="@/assets/img/monitor/aaa.png"
+                            alt=""
+                        />
+                    </div>
+                </div>
+
+                <!-- 过期农事 -->
+                 <div v-if="expiredDay">
+                    <div class="desc-info pt-10">
+                        <div class="desc-info-item">
+                            <span>复核时间:</span>
+                            <span class="value">2025.10.27</span>
+                            <span class="expired-day">(已过期1天)</span>
+                        </div>
+                    </div>
+                    <div class="desc-info">
+                        <div class="expired-text">
+                            距离农事执行已 <span class="val-text">15</span>天,提醒用户拍照,增加信誉度!
+                        </div>
+                    </div>
+                 </div>
+            </div>
+            
+            <slot name="footer"></slot>
+        </div>
     </div>
 </template>
 
@@ -72,6 +122,8 @@ import { useRouter } from "vue-router";
 
 const status = ref(0)
 
+const expiredDay = ref(0)
+
 const router = useRouter();
 const toPage = () => {
     router.push("/report_detail")
@@ -86,9 +138,14 @@ const toPage = () => {
         background: #EBEBEB;
         .item-top {
             .item-name {
-                background: #C6C6C6;
+                background: #C5C5C5;
+                border: none;
+                color: #fff;
             }
         }
+        .top-r {
+            color: rgba(0, 0, 0, 0.6);
+        }
         .item-desc .copy-info .copy-text {
             color: #000000;
         }
@@ -125,6 +182,7 @@ const toPage = () => {
     }
 
     .farm-text {
+        margin-bottom: 10px;
         background: rgba(183, 183, 183, 0.1);
         padding: 6px 8px;
         border-radius: 5px;
@@ -228,7 +286,7 @@ const toPage = () => {
         margin: 2px 0 5px 0;
     }
     .item-desc {
-        font-size: 13px;
+        font-size: 14px;
         color: #bbbbbb;
         line-height: 18px;
         .desc-info {
@@ -239,6 +297,61 @@ const toPage = () => {
                     color: #666666;
                 }
             }
+            &.two-text {
+                .value {
+                    font-size: 12px;
+                    padding-top: 4px;
+                }
+            }
+            .expired-day {
+                color: #FF953D;
+            }
+            .expired-text {
+                margin-top: 4px;
+                padding: 6px 8px;
+                background: linear-gradient(90deg,rgba(33, 153, 248, 0.2), rgba(33, 153, 248, 0));
+                border-radius: 4px;
+                color: #2E2E2E;
+                font-size: 12px;
+                width: 100%;
+                .val-text {
+                    color: #2199F8;
+                }
+            }
+        }
+        .desc-info + .desc-info {
+            padding-top: 6px;
+        }
+        .pt-10 {
+            padding-top: 10px;
+        }
+        
+        .review-image {
+            display: flex;
+            align-items: center;
+            gap: 8px;
+            padding-top: 6px;
+            .review-image-item {
+                position: relative;
+                flex: 1;
+                .review-image-item-title {
+                    position: absolute;
+                    top: 0;
+                    left: 0;
+                    background: rgba(54, 52, 52, 0.6);
+                    padding: 4px 10px;
+                    border-radius: 8px 0 8px 0;
+                    backdrop-filter: 4px;
+                    font-size: 12px;
+                    color: #fff;
+                }
+            }
+            img {
+                width: 100%;
+                height: 106px;
+                object-fit: cover;
+                border-radius: 4px;
+            }
         }
         .copy-info {
             margin-top: 4px;

+ 1 - 1
src/views/old_mini/agri_work/servicesIndex.vue

@@ -7,7 +7,7 @@
             </div>
             <div class="content-status">
                 <div class="status-l" v-if="status === 0">
-                    <div class="stauts-text">待执行</div>
+                    <div class="stauts-text">待完成</div>
                     <div class="stauts-sub-text">距离预计执行时间还差 <span class="time-text">3</span> 天</div>
                 </div>
                 <div class="status-l" v-if="status === 1">

+ 58 - 12
src/views/old_mini/modify_work/completedWork.vue

@@ -11,7 +11,7 @@
                 v-if="currentStep !== 0 || query.status === 'warning'"
             >
                 <div class="status-l" v-if="status === 0">
-                    <div class="stauts-text">{{ query.status === "warning" ? "已过期" : "待执行" }}</div>
+                    <div class="stauts-text">{{ query.status === "warning" ? "已过期" : "待完成" }}</div>
                     <div class="stauts-sub-text" v-if="query.status !== 'warning'">
                         距离预计执行时间还差 <span class="time-text">3</span> 天
                     </div>
@@ -26,13 +26,14 @@
                 <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" v-if="query.status === 'warning' || curRole == 1">
-                    <div class="executor-title">执行人</div>
+                <div class="box-wrap executor-info" v-if="query.status === 'warning' || curRole == 1 || curRole == 2">
+                    <!-- <div class="executor-title">执行人</div> -->
                     <div class="executor-content">
-                        <div class="executor-info">
+                        <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"
@@ -86,6 +87,24 @@
                 </div>
             </div>
             <div class="work-wrap">
+                <div class="box-wrap farm-photo farm-info" v-if="(curRole == 2 && currentStep == 2) || (currentStep == 1 && curRole == 1)">
+                    <div class="info-title">
+                        <div class="card-title">执行照片</div>
+                        <div class="info-more">
+                            点击查看更多
+                            <el-icon><ArrowRight /></el-icon>
+                        </div>
+                    </div>
+                    <div class="photo-list pt-10">
+                        <div class="img-item" v-for="(item, index) in 2" :key="index">
+                            <img
+                                class="photo-item"
+                                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"
+                                alt=""
+                            />
+                        </div>
+                    </div>
+                </div>
                 <div class="box-wrap farm-info">
                     <div class="info-title">
                         <div class="card-title">农场现状</div>
@@ -214,14 +233,24 @@
             </div>
             <div
                 class="fixed-btn-wrap"
-                :class="{ center: currentStep == 0 || (currentStep == 1 && curRole == 1) }"
+                :class="{ center: currentStep == 0 || (currentStep == 1 && curRole == 1) || (currentStep == 2 && curRole == 2)}"
                 v-if="query.status !== 'warning'"
             >
                 <div class="fixed-btn expert" v-if="currentStep == 0">提醒农事确认</div>
                 <div class="fixed-btn expert" v-if="currentStep == 1 && curRole == 1">确认对方完成</div>
+                <div class="fixed-btn expert" v-if="currentStep == 2 && curRole == 2">请求确认</div>
                 <div class="fixed-btn orange" v-if="currentStep == 1 && curRole == 0" @click="handleDemand">发起需求</div>
                 <div class="fixed-btn" v-if="currentStep == 1 && curRole == 0" @click="handleOk">我已完成</div>
             </div>
+
+            <!-- 农资,步骤:农事已确认 -->
+            <div
+                class="fixed-btn-wrap"
+                v-if="curRole == 2 && currentStep == 1"
+            >
+                <div class="fixed-btn second">转发给客户</div>
+                <div class="fixed-btn" @click="handleOk">生成报价单</div>
+            </div>
         </div>
     </div>
     <!-- 报价弹窗 -->
@@ -244,7 +273,10 @@ const query = useRoute().query;
 // 角色
 // const curRole = store.state.app.curRole
 const currentStep = ref(1);
-const curRole = 0;
+const curRole = 2;
+
+// 农资待生成报价单--currentStep:1;curRole:2
+// 农资已执行,有执行照片,请求确认--currentStep:2;curRole:2
 
 // 0:执行, 1: 复核
 const status = ref(0);
@@ -291,12 +323,14 @@ const areaRef = ref(null);
 let newFarmMap = new NewFarmMap();
 onMounted(() => {
     const point = store.state.home.miniUserLocationPoint;
-    newFarmMap.initMap(point, areaRef.value, false);
-
-    getAreaList(() => {
-        console.log("areaList.value", areaList.value);
-        newFarmMap.initArea(areaList.value);
-    });
+    if (areaRef.value) {
+        newFarmMap.initMap(point, areaRef.value, false);
+    
+        getAreaList(() => {
+            console.log("areaList.value", areaList.value);
+            newFarmMap.initArea(areaList.value);
+        });
+    }
 });
 
 // 农场分区列表
@@ -442,6 +476,9 @@ const changeRegion = (e) => {
             padding: 0 12px;
             top: -16px;
         }
+        .pt-10 {
+            padding-top: 10px;
+        }
         .fixed-btn-wrap {
             position: fixed;
             z-index: 10;
@@ -454,6 +491,7 @@ const changeRegion = (e) => {
             align-items: center;
             justify-content: space-between;
             background: #fff;
+            box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.4);
             &.center {
                 justify-content: center;
             }
@@ -475,6 +513,11 @@ const changeRegion = (e) => {
                     border: 1px solid #ff953d;
                     background: #fff;
                 }
+                &.second {
+                    background: #FFFFFF;
+                    border: 1px solid rgba(153, 153, 153, 0.5);
+                    color: #666666;
+                }
             }
         }
         .card-title {
@@ -632,6 +675,9 @@ const changeRegion = (e) => {
         }
         .executor-info {
             margin-top: 14px;
+            &.mt-0 {
+                margin-top: 0;
+            }
             .executor-title {
                 font-size: 18px;
                 font-weight: bold;

+ 19 - 6
src/views/old_mini/modify_work/index.vue

@@ -3,6 +3,9 @@
         <custom-header :name="isAdd ? '新增农事' : '农事详情'"></custom-header>
         <div class="new-farming-content">
             <div v-if="!isAdd">
+                <div class="step-wrap">
+                    <farm-steps :currentStep="0" />
+                </div>
                 <div class="box-wrap farm-info">
                     <div class="info-title">
                         <div class="card-title">农场现状</div>
@@ -359,8 +362,8 @@
                     </div>
                 </div>
                 <div class="submit-btn" v-if="!isAdd">
-                    <div class="btn second">驳回</div>
-                    <div class="btn" @click.prevent="submitForm(formRef)">立即下发</div>
+                    <div class="btn second">忽略</div>
+                    <div class="btn" @click.prevent="submitForm(formRef)">下发农事</div>
                 </div>
                 <div class="submit-btn" v-if="isAdd && farmProgress === 0">
                     <div class="btn second">取消</div>
@@ -381,7 +384,7 @@ import { ElMessage } from "element-plus";
 import customHeader from "@/components/customHeader.vue";
 import NewFarmMap from "./newFarmMap";
 import { useStore } from "vuex";
-import eventBus from "@/api/eventBus";
+import farmSteps from "@/components/farmSteps.vue";
 import dayjs from "dayjs";
 const store = useStore();
 const router = useRouter();
@@ -660,7 +663,14 @@ const submitForm = (formEl) => {
     if (!formEl) return;
     formEl.validate((valid) => {
         if (valid) {
-            submit();
+            router.push({
+                path: "/completed_work",
+                query: {
+                    id: 1,
+                    status: 1,
+                },
+            });
+            // submit();
         } else {
             console.log("error submit!");
         }
@@ -930,6 +940,9 @@ const handleExpertDiagnosis = () => {
             padding-bottom: 1px;
         }
     }
+    .step-wrap {
+        padding: 12px 0;
+    }
     .box-wrap {
         background: #fff;
         padding: 10px;
@@ -1004,8 +1017,8 @@ const handleExpertDiagnosis = () => {
                 font-size: 14px;
                 &.second {
                     background: #FFFFFF;
-                    border: 1px solid rgba(0, 0, 0, 0.2);
-                    color: rgba(0, 0, 0, 0.2);
+                    border: 1px solid rgba(153, 153, 153, 0.5);
+                    color: #666666;
                 }
             }
             .btn + .btn {

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

@@ -144,7 +144,7 @@ const getStayCount = () => {
         .then((res) => {
             functionCards.value[0].status = null;
             if (res.data && res.data != 0) {
-                functionCards.value[0].status = res.data + " 待执行";
+                functionCards.value[0].status = res.data + " 待完成";
             }
         });
 };

+ 1 - 1
src/views/old_mini/offer_price/component/fertilizerPrice.vue

@@ -18,7 +18,7 @@
                     <div class="title">乙烯利乙烯利乙烯利</div>
                     <div class="action-btn">
                         <el-icon @click.stop="handleEdit(item)" color="#2199F8" size="18"><Edit /></el-icon>
-                        <el-icon @click.stop="openDelete" color="#E04C4C" size="18"><Delete /></el-icon>
+                        <!-- <el-icon @click.stop="openDelete" color="#E04C4C" size="18"><Delete /></el-icon> -->
                     </div>
                 </div>
                 <div class="info">

+ 6 - 0
src/views/old_mini/offer_price/component/servicePrice.vue

@@ -58,6 +58,12 @@ const isEdit = ref(false);
             margin-bottom: 10px;
         }
         .service-form-value {
+            border: 1px solid rgba(24, 24, 24, 0.1);
+            border-radius: 5px;
+            padding: 0 10px;
+            width: 100%;
+            height: 30px;
+            line-height: 30px;
             .unit {
                 color: rgba(0, 0, 0, 0.3);
                 padding-left: 8px;

+ 4 - 3
src/views/old_mini/task_condition/components/calendar.vue

@@ -12,7 +12,7 @@
                     </span>
                 </div>
                 <div class="top-r">
-                    <span class="top-tag orange">5待执行</span>
+                    <span class="top-tag orange">5待完成</span>
                     <el-icon class="icon icon-r" color="#999999" size="11" @click="nextPeriod"><ArrowRightBold /></el-icon>
                 </div>
 
@@ -273,8 +273,9 @@ const selectedDate = ref(null);
             color: #fff;
             font-size: 10px;
             background: #2199F8;
-            width: 12px;
-            height: 12px;
+            width: 14px;
+            height: 14px;
+            line-height: 16px;
             border-radius: 50%;
         }
         .days-one {

+ 43 - 7
src/views/old_mini/task_condition/components/task.vue

@@ -12,7 +12,7 @@
                     待确认(9)
                 </div>
                 <div class="filter-item" :class="{ active: activeIndex === 1 }" @click="handleActiveFilter(1)">
-                    待执行(4)
+                    待完成(4)
                 </div>
                 <div class="filter-item" :class="{ active: activeIndex === 2 }" @click="handleActiveFilter(2)">
                     已完成(8)
@@ -33,16 +33,29 @@
                 <div class="task-item" v-for="item in 10" :key="item">
                     <task-item>
                         <template #footer>
-                            <div class="item-footer">
+                            <div class="item-footer" v-if="activeIndex === 0 || activeIndex === 1">
                                 <div class="footer-l" @click="toDetail">
                                     查看详情
                                 </div>
                                 <div class="footer-r">
                                     <div class="btn second">
-                                        忽略
+                                        {{ activeIndex === 0 ? "忽略" : "转发给客户" }}
                                     </div>
                                     <div class="btn primary" @click="toPage">
-                                        下发农事
+                                        {{ activeIndex === 0 ? "下发农事" : "请求确认" }}
+                                    </div>
+                                </div>
+                            </div>
+                            <div class="item-footer" v-else>
+                                <div class="footer-l farm-name-text">
+                                    来自<span class="name-text">从化荔博园</span>
+                                </div>
+                                <div class="footer-r">
+                                    <!-- <div class="btn warning">
+                                        分享成果
+                                    </div> -->
+                                    <div class="btn secondary-text">
+                                        提醒用户拍照
                                     </div>
                                 </div>
                             </div>
@@ -52,6 +65,7 @@
             </div>
         </div>
     </div>
+    <upload-execute ref="uploadExecuteRef" />
 </template>
 
 <script setup>
@@ -61,13 +75,13 @@ import IndexMap from "../../farm_manage/map/index";
 import taskItem from "@/components/taskItem.vue";
 import calendar from "./calendar.vue"
 import { useRouter } from "vue-router";
-
+import uploadExecute from "./uploadExecute.vue";
 const store = useStore();
 const router = useRouter();
 const indexMap = new IndexMap();
 const mapContainer = ref(null);
 const tabBarHeight = computed(() => store.state.home.tabBarHeight);
-
+const uploadExecuteRef = ref(null);
 const dateValue = ref("1");
 const dateOptions = [
     { value: "1", label: "农事类型" },
@@ -101,6 +115,11 @@ function handleActiveFilter(i) {
 
 function toPage() {
     // router.push("/servicZes_agri")
+    if (activeIndex.value === 1) {
+        uploadExecuteRef.value.showPopup();
+    } else {
+        // router.push("/service_agri");
+    }
 }
 
 function toDetail() {
@@ -198,7 +217,7 @@ function toDetail() {
         .footer-l {
             color: #8B8B8B;
             font-size: 12px;
-            &.prrmary-btn {
+            &.primary-btn {
                 display: inline-flex;
                 align-items: center;
                 border: 1px solid #2199F8;
@@ -215,6 +234,13 @@ function toDetail() {
                     padding-right: 4px;
                 }
             }
+            &.farm-name-text {
+                font-size: 14px;
+                color: #6F7274;
+                .name-text {
+                    padding-left: 4px;
+                }
+            }
         }
         .footer-r {
             display: flex;
@@ -226,6 +252,7 @@ function toDetail() {
                 border-radius: 20px;
                 display: flex;
                 align-items: center;
+                box-sizing: border-box;
                 &.second {
                     // border: 1px solid #8B8B8B;
                     // color: #8B8B8B;
@@ -239,6 +266,15 @@ function toDetail() {
                 .btn-icon {
                     padding-right: 4px;
                 }
+                &.warning {
+                    color: #FF953D;
+                    background: #fff;
+                    border: 1px solid #FF953D;
+                }
+                &.secondary-text {
+                    color: #2199F8;
+                    border: 1px solid #2199F8;
+                }
             }
             .btn + .btn {
                 margin-left: 8px;

+ 83 - 0
src/views/old_mini/task_condition/components/uploadExecute.vue

@@ -0,0 +1,83 @@
+<template>
+    <popup
+        class="active-upload-popup"
+        v-model:show="show"
+        closeable
+        :close-on-click-overlay="false"
+    >
+        <div class="header">
+            <div class="title">
+                <span class="required">*</span>
+                请上传执行照片
+            </div>
+        </div>
+        <upload :textShow="true" class="upload-wrap"></upload>
+        <div class="btn" @click="handleUpload">请求确认</div>
+    </popup>
+</template>
+
+<script setup>
+import { Popup } from "vant";
+import { onMounted, onUnmounted, ref } from "vue";
+import upload from "@/components/upload";
+import { ElMessage } from "element-plus";
+
+const show = ref(false);
+
+function showPopup() {
+    show.value = true;
+}
+
+function handleUpload() {}
+
+defineExpose({
+    showPopup,
+});
+
+</script>
+
+<style lang="scss" scoped>
+.active-upload-popup {
+    width: 90%;
+    box-sizing: border-box;
+    padding: 24px 18px 20px;
+    background: linear-gradient(0deg, #ffffff 70%, #d1ebff 100%);
+    border-radius: 10px;
+    ::v-deep {
+        .van-popup__close-icon {
+            color: #000;
+        }
+    }
+    .header {
+        .title {
+            font-size: 16px;
+            font-weight: 500;
+            display: flex;
+            align-items: center;
+            .required {
+                color: #ff4d4f;
+                margin-right: 4px;
+            }
+        }
+        .date-input {
+            margin: 12px 0;
+        }
+    }
+    .tips-text {
+        font-weight: 500;
+    }
+    .upload-wrap {
+        margin: 12px 0 24px;
+    }
+}
+
+.btn {
+    padding: 8px;
+    background: #2199f8;
+    border-radius: 25px;
+    color: #fff;
+    font-size: 16px;
+    text-align: center;
+}
+
+</style>