Ver código fonte

fix: 农事服务页面和组件

lxf 1 semana atrás
pai
commit
eadc4cd01b

+ 21 - 1
src/components/popup/activeUploadPopup.vue

@@ -22,6 +22,17 @@
                 />
             </div>
         </div>
+        <div class="header" v-if="needExecutor">
+            <div class="title">
+                <span class="required">*</span>
+                请确认执行人
+            </div>
+            <div class="date-input">
+                <el-select v-model="executorId" placeholder="请选择执行人">
+                    <el-option v-for="item in executorList" :key="item.id" :label="item.name" :value="item.id"></el-option>
+                </el-select>
+            </div>
+        </div>
         <div class="tips-text">上传照片,诊断更准确哦~</div>
         <upload :textShow="true" class="upload-wrap" exampleImg>
             <img class="example" src="@/assets/img/home/example-4.png" alt="" />
@@ -47,6 +58,12 @@ import { onMounted, onUnmounted, ref } from "vue";
 import upload from "@/components/upload";
 import eventBus from "@/api/eventBus";
 import { ElMessage } from "element-plus";
+const props = defineProps({
+    needExecutor: {
+        type: Boolean,
+        default: false,
+    },
+});
 
 const show = ref(false);
 const gardenId = ref(null);
@@ -75,7 +92,9 @@ function formatDate(date) {
 
 const type = ref(null);
 const arrangeId = ref(null);
-function handleShow({ gardenIdVal, problemTitleVal, typeVal ,arrangeIdVal}) {
+const executorId = ref(null);
+const executorList = ref([]);
+function handleShow({ gardenIdVal, problemTitleVal, typeVal ,arrangeIdVal, executorListVal}) {
     images.value = [];
     gardenId.value = gardenIdVal;
     problemTitle.value = problemTitleVal || "请选择问题";
@@ -83,6 +102,7 @@ function handleShow({ gardenIdVal, problemTitleVal, typeVal ,arrangeIdVal}) {
     show.value = true;
     type.value = typeVal;
     arrangeId.value = arrangeIdVal;
+    executorList.value = executorListVal;
     // 重置上传状态
     isUploading.value = false;
 }

+ 245 - 56
src/components/popup/offerPopup.vue

@@ -4,51 +4,83 @@
             <div class="title">
                 <div class="text">
                     <div>请输入</div>
-                    <div class="blue">农服投入成本</div>
+                    <div class="blue">实际交易金额</div>
                 </div>
                 <img src="@/assets/img/home/offer-icon.png" alt="" />
             </div>
-            <div class="tips">注:本次成本不对外公开,仅作为投入产出比的计算</div>
-            <el-input class="input" type="number" v-model="input" placeholder="请输入数字" size="large">
-                <template #append>元</template>
-            </el-input>
+            <!-- <div class="tips">注:本次成本不对外公开,仅作为投入产出比的计算</div> -->
+            <el-form ref="formRef" :model="formData" :rules="rules" label-width="0">
+                <div class="inputs-wrap">
+                    <div class="input-row">
+                        <el-form-item prop="agriculturalInput" class="input-item">
+                            <div class="input-header">农资投入</div>
+                            <el-input 
+                                class="input-field" 
+                                type="number" 
+                                v-model="formData.agriculturalInput" 
+                                placeholder="请输入数字"
+                            >
+                                <template #suffix>
+                                    <span class="unit">元</span>
+                                </template>
+                            </el-input>
+                        </el-form-item>
+                        <el-form-item prop="serviceInput" class="input-item">
+                            <div class="input-header">农服投入</div>
+                            <el-input 
+                                class="input-field" 
+                                type="number" 
+                                v-model="formData.serviceInput" 
+                                placeholder="请输入数字"
+                            >
+                                <template #suffix>
+                                    <span class="unit">元</span>
+                                </template>
+                            </el-input>
+                        </el-form-item>
+                    </div>
+                    <div class="input-row total-row">
+                        <div class="total-label">总金额</div>
+                        <el-form-item prop="totalAmount" class="total-form-item">
+                            <el-input 
+                                class="input-field total-input" 
+                                type="number" 
+                                v-model="formData.totalAmount" 
+                                placeholder="请输入数字"
+                            >
+                                <template #suffix>
+                                    <span class="unit">元</span>
+                                </template>
+                            </el-input>
+                        </el-form-item>
+                    </div>
+                </div>
+            </el-form>
         </div>
         <div class="step-2" v-else>
-            <div class="title">
-                <div class="text">
-                    <div>请上传执行照片</div>
-                </div>
-            </div>
-            <div class="tips">请选择您的 <span>执行方式</span> 上传图片</div>
-            <div class="upload-wrap" :class="{'upload-cont':fileList.length}" v-show="imgType!=='rg'">
-                <div class="name">无人机执行</div>
-                <uploader class="uploader" v-model="fileList" multiple :max-count="3" :after-read="afterRead" @click="handleClick('wrg')">
-                    <img class="img" v-show="!fileList.length" src="@/assets/img/home/example-1.png" alt="">
-                    <img class="plus" v-show="fileList.length" src="@/assets/img/home/plus.png" alt="">
-                </uploader>
-            </div>
-            <div class="upload-wrap" :class="{'upload-cont':fileList.length}" v-show="imgType!=='wrg'">
-                <div class="name">人工执行</div>
+            <div class="upload-wrap" :class="{'upload-cont':fileList.length}">
+                <div class="name"><span class="required">*</span>请上传执行照片</div>
                 <uploader class="uploader" v-model="fileList" multiple :max-count="3" :after-read="afterRead" @click="handleClick('rg')">
-                    <img class="img" v-show="!fileList.length" src="@/assets/img/home/example-2.png" alt="">
-                    <img class="plus" v-show="fileList.length" src="@/assets/img/home/plus.png" alt="">
+                    <img class="img" v-show="!fileList.length" src="@/assets/img/home/example-4.png" alt="">
+                    <img class="plus" src="@/assets/img/home/plus.png" alt="">
                 </uploader>
             </div>
         </div>
+        <div class="tips-text">注:交易信息保密不公开</div>
         <div class="button-wrap" v-if="stepIndex === 1">
             <div class="button second" @click="handleCancel">取消</div>
-            <div @click="toggleStep(2)" class="button primary" :class="{ 'btn-color': input.length > 0 }">下一步</div>
+            <div @click="handleNextStep" class="button primary" :class="{ 'btn-color': formData.totalAmount && formData.totalAmount.length > 0 }">下一步</div>
         </div>
         <div class="button-wrap" v-if="stepIndex === 2">
             <div class="button second" @click="toggleStep(1)">上一步</div>
-            <div v-if="stepIndex === 2" @click="closeTask" class="button primary btn-color">完成</div>
+            <div v-if="stepIndex === 2" @click="closeTask" class="button primary btn-color">确认上传</div>
         </div>
     </popup>
 </template>
 
 <script setup>
 import { Popup, Uploader } from "vant";
-import { ref, watch } from "vue";
+import { ref, watch, reactive } from "vue";
 import { useStore } from "vuex";
 import { getFileExt } from "@/utils/util";
 import UploadFile from "@/utils/upliadFile";
@@ -68,6 +100,61 @@ const store = useStore();
 const miniUserId = store.state.home.miniUserId;
 const show = ref(false);
 const input = ref("");
+const formRef = ref(null);
+
+const formData = reactive({
+    agriculturalInput: "",
+    serviceInput: "",
+    totalAmount: "",
+});
+
+const rules = {
+    agriculturalInput: [
+        { required: true, message: "请输入农资投入", trigger: "blur" },
+        { 
+            validator: (rule, value, callback) => {
+                if (!value || value.trim() === "") {
+                    callback(new Error("请输入农资投入"));
+                } else if (isNaN(value) || Number(value) < 0) {
+                    callback(new Error("请输入有效的数字"));
+                } else {
+                    callback();
+                }
+            }, 
+            trigger: "blur" 
+        }
+    ],
+    serviceInput: [
+        { required: true, message: "请输入农服投入", trigger: "blur" },
+        { 
+            validator: (rule, value, callback) => {
+                if (!value || value.trim() === "") {
+                    callback(new Error("请输入农服投入"));
+                } else if (isNaN(value) || Number(value) < 0) {
+                    callback(new Error("请输入有效的数字"));
+                } else {
+                    callback();
+                }
+            }, 
+            trigger: "blur" 
+        }
+    ],
+    totalAmount: [
+        { required: true, message: "请输入总金额", trigger: "blur" },
+        { 
+            validator: (rule, value, callback) => {
+                if (!value || value.trim() === "") {
+                    callback(new Error("请输入总金额"));
+                } else if (isNaN(value) || Number(value) < 0) {
+                    callback(new Error("请输入有效的数字"));
+                } else {
+                    callback();
+                }
+            }, 
+            trigger: "blur" 
+        }
+    ],
+};
 
 const stepIndex = ref(1);
 const fileList = ref([]);
@@ -103,6 +190,18 @@ const afterRead = (file) => {
 function toggleStep(val) {
     stepIndex.value = val;
 }
+
+function handleNextStep() {
+    if (!formRef.value) return;
+    
+    formRef.value.validate((valid) => {
+        if (valid) {
+            toggleStep(2);
+        } else {
+            ElMessage.warning("请填写完整的交易金额信息");
+        }
+    });
+}
 function closeTask() {
     // stepIndex.value = 2
     show.value = false
@@ -132,10 +231,18 @@ function closeTask() {
 watch(
     () => props.showPopup,
     (newVal, oldVal) => {
-        fileArr.value = []
-        fileList.value = []
-        imgType.value = ''
-        show.value = true;
+        if (newVal) {
+            fileArr.value = []
+            fileList.value = []
+            // imgType.value = ''
+            show.value = true;
+            // 重置表单验证状态
+            if (formRef.value) {
+                formRef.value.clearValidate();
+            }
+        } else {
+            show.value = false;
+        }
     }
 );
 </script>
@@ -144,7 +251,8 @@ watch(
 .offer-popup {
     width: 90%;
     padding: 10px 12px;
-    border-radius: 5px;
+    border-radius: 8px;
+    background: linear-gradient(360deg, #FFFFFF 74.2%, #D1EBFF 100%);
     ::v-deep{
         .van-popup__close-icon{
             color: #000;
@@ -170,6 +278,7 @@ watch(
             font-size: 30px;
             div {
                 font-family: "PangMenZhengDao";
+                line-height: 38px;
             }
             .blue {
                 color: #2199f8;
@@ -190,37 +299,119 @@ watch(
             --el-input-placeholder-color: rgba(33, 153, 248, 0.43);
         }
     }
+    .inputs-wrap {
+        ::v-deep {
+            .el-form-item {
+                margin-bottom: 0;
+                .el-form-item__error {
+                    position: absolute;
+                    bottom: -18px;
+                    left: 0;
+                    font-size: 12px;
+                    color: #f56c6c;
+                    line-height: 1;
+                    padding-top: 2px;
+                }
+            }
+            .el-input__wrapper {
+                border-radius: 6px;
+                border: 1px solid rgba(162, 213, 253, 0.8);
+                box-shadow: none;
+                padding: 7px 12px;
+                background: #fff;
+                &.is-error {
+                    border-color: #f56c6c;
+                }
+            }
+            .el-input__inner {
+                text-align: left;
+                color: #000000;
+                font-size: 16px;
+            }
+            .el-input__suffix {
+                .unit {
+                    color: rgba(0, 0, 0, 0.2);
+                    font-size: 16px;
+                }
+            }
+        }
+        .input-row {
+            display: flex;
+            gap: 12px;
+            margin-bottom: 20px;
+            position: relative;
+            .input-item {
+                flex: 1;
+                position: relative;
+                .input-header {
+                    background: #2199f8;
+                    color: #fff;
+                    padding: 0 12px;
+                    border-radius: 6px 6px 0 0;
+                    font-size: 16px;
+                    text-align: center;
+                    line-height: 28px;
+                    width: 100%;
+                }
+                .input-field {
+                    ::v-deep {
+                        .el-input__wrapper {
+                            border-radius: 0 0 6px 6px;
+                            border-top: none;
+                        }
+                    }
+                }
+            }
+            &.total-row {
+                align-items: center;
+                margin-bottom: 0;
+                .total-label {
+                    color: #2199f8;
+                    font-size: 16px;
+                    min-width: 60px;
+                }
+                .total-form-item {
+                    flex: 1;
+                    position: relative;
+                }
+                .total-input {
+                    flex: 1;
+                }
+            }
+        }
+    }
+    .tips-text {
+        font-size: 14px;
+        color: #B0B0B0;
+        text-align: center;
+        margin-top: 4px;
+    }
     .button-wrap {
         display: flex;
+        padding: 16px 0 10px 0;
     }
 
     .button {
-        margin: 20px 0 12px 0;
-        border-radius: 4px;
+        border-radius: 20px;
         color: #fff;
-        padding: 6px 0 4px 0;
+        padding: 7px 0;
         text-align: center;
         font-size: 16px;
         &.primary {
             margin-left: 12px;
             flex: 1;
-            background: rgba(33, 153, 248, 0.3);
+            background: #2199F8;
             color: #fff;
             &.btn-color {
                 background: #2199f8;
             }
         }
         &.second {
-            margin: 20px 0 12px 0;
-            background: #dadada;
-            border-radius: 9px;
             color: #666666;
             text-align: center;
             font-size: 16px;
             width: 100px;
-            background: #fff;
             border: 1px solid #bbbbbb;
-            border-radius: 4px;
         }
     }
 }
@@ -272,36 +463,34 @@ watch(
         }
     }
     .upload-wrap{
-        position: relative;
-        border: 1px dashed #2199F8;
+        // position: relative;
+        // border: 1px dashed #2199F8;
+        // background: rgba(33, 153, 248, 0.1);
         border-radius: 10px;
-        padding: 10px;
-        background: rgba(33, 153, 248, 0.1);
+        padding: 14px 0 10px 0;
         &.upload-cont{
             ::v-deep{
                 .van-uploader__wrapper{
                     flex-wrap: nowrap;
-                    margin-top: 30px;
                 }
             }
         }
         .name{
-            position: absolute;
-            top: -1px;
-            left: -1px;
-            border-radius: 10px 0 10px 0;
-            color: #fff;
-            background: linear-gradient(180deg,#9FD5FF,#2199F8);
-            padding: 1px 8px 3px 8px;
-            font-family: "PangMenZhengDao";
-            font-size: 14px;
-            z-index: 2;
+            color: #000000;
+            font-size: 16px;
+            padding-bottom: 12px;
+            .required{
+                color: #FF4D4F;
+                margin-right: 2px;
+            }
         }
         .img{
-            width: 100%;
-            height: 155px;
+            width: 80px;
+            height: 80px;
+            margin-right: 12px;
         }
         .plus{
+            margin-right: 12px;
             width: 80px;
             height: 80px;
         }

+ 14 - 4
src/components/taskItem.vue

@@ -55,10 +55,16 @@
                         <div class="farm-info">
                             {{ itemData?.farmName }}
                             <div class="info-tag-wrap">
-                                <div class="tag-item second" v-if="itemData?.farmArea">
+                                <!-- <div class="tag-item second" v-if="itemData?.farmArea">
                                     {{ formatArea(itemData?.farmArea) }}亩
-                                </div>
+                                </div> -->
                                 <div class="tag-item primary">{{ itemData?.typeName }}</div>
+                                <!-- <div class="tag-item second">
+                                    普通客户
+                                </div> -->
+                                <div class="tag-item warning">
+                                    托管客户
+                                </div>
                             </div>
                         </div>
                         <div class="farm-addr">{{ itemData?.address }}</div>
@@ -556,13 +562,17 @@ const toDetail = (status, id, farmWorkId) => {
                             border-radius: 2px;
                             font-size: 12px;
                             &.second {
-                                color: #1d2129;
-                                background: #f4f4f4;
+                                color: #848282;
+                                background: rgba(148, 148, 148, 0.1);
                             }
                             &.primary {
                                 color: #2199f8;
                                 background: #e8f3ff;
                             }
+                            &.warning {
+                                color: #FF953D;
+                                background: rgba(255, 149, 61, 0.1);
+                            }
                         }
                     }
                 }

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

@@ -0,0 +1,952 @@
+<template>
+    <div class="task-page" :style="{ height: `calc(100vh - ${tabBarHeight}px - 50px)` }">
+        <div class="task-top">
+            <div class="map-container" ref="mapContainer"></div>
+        </div>
+        <div class="task-list">
+            <div class="list-filter">
+                <div class="filter-item" :class="{ active: activeIndex === 0 }" @click="handleActiveFilter(0)">
+                    待确认({{ taskCounts[0] || 0 }})
+                </div>
+                <!-- <div class="filter-item" :class="{ active: activeIndex === 1 }" @click="handleActiveFilter(1)">
+                    已确认({{ taskCounts[1] || 0 }})
+                </div> -->
+                <div class="filter-item" :class="{ active: activeIndex === 2 }" @click="handleActiveFilter(2)">
+                    已确认({{ taskCounts[2] || 0 }})
+                </div>
+                <div class="filter-item" :class="{ active: activeIndex === 3 }" @click="handleActiveFilter(3)">
+                    待提醒({{ taskCounts[3] || 0 }})
+                </div>
+            </div>
+            <div class="select-group">
+                <el-select
+                    class="select-item"
+                    v-model="selectParma.farmWorkTypeId"
+                    placeholder="用户类型"
+                    @change="getSimpleList"
+                >
+                    <el-option v-for="item in farmWorkTypeList" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
+                <el-select
+                    class="select-item"
+                    v-model="selectParma.districtCode"
+                    placeholder="切换作物"
+                    @change="getSimpleList"
+                >
+                    <el-option v-for="item in districtList" :key="item.code" :label="item.name" :value="item.code" />
+                </el-select>
+            </div>
+            <!-- <div class="task-content-loading" v-if="loading && noData" v-loading="loading">
+            </div> -->
+            <div class="task-content" v-loading="loading">
+                <div class="task-item" v-for="(item, index) in taskList" :key="index">
+                    <div class="img-text-wrap">
+                        <div class="left-wrap">
+                            <div class="left-img">
+                                <img src="@/assets/img/home/farm.png" alt="" />
+                            </div>
+                            <div class="right-text">
+                                <div class="farm-info">
+                                    {{ item?.farmName }}
+                                    <div class="info-tag-wrap">
+                                        <div class="tag-item primary">
+                                            {{ item?.typeName }}
+                                        </div>
+                                        <div class="tag-item second">托管客户</div>
+                                    </div>
+                                </div>
+                                <div class="farm-addr">{{ item?.address }}</div>
+                            </div>
+                        </div>
+                        <div class="right-wrap">提醒客户</div>
+                    </div>
+                    <div class="item-bottom">
+                        <div class="bottom-tag">
+                            <div class="tag-card active">
+                                <div class="card-content">
+                                    <div class="card-main-text">花芽分化</div>
+                                    <div class="card-sub-text">
+                                        当前物候期
+                                        <span class="card-icon">
+                                            <el-icon><Edit /></el-icon>
+                                        </span>
+                                    </div>
+                                </div>
+                            </div>
+                            <div class="tag-card">
+                                <div class="card-content">
+                                    <div class="card-main-text">蒂蛀虫</div>
+                                    <div class="card-sub-text">预计风险</div>
+                                </div>
+                            </div>
+                            <div class="tag-card">
+                                <div class="card-content">
+                                    <div class="card-main-text">5天</div>
+                                    <div class="card-sub-text">预计下次物候</div>
+                                </div>
+                            </div>
+                        </div>
+
+                        <div class="timeline">
+                            <div class="timeline-item" v-for="item in timelineList" :key="item.id">
+                                <div class="timeline-left">
+                                    <div class="dot"></div>
+                                    <div class="line"></div>
+                                </div>
+                                <div class="timeline-right">
+                                    <div class="date">预计{{ item.date }}天后触发<span class="work-name">{{ item.workName }}</span></div>
+                                    <div class="text">
+                                        预计报价<span class="price">{{ item.price }}元</span>
+                                        <span class="action-detail">查看报价单</span>
+                                    </div>
+                                </div>
+                                <div class="timeline-action" @click="handleTimelineAction(item)">转入农事任务</div>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+                <div class="empty-data" v-if="noData">暂无数据</div>
+            </div>
+        </div>
+    </div>
+    <upload-execute ref="uploadExecuteRef" :onlyShare="onlyShare" @uploadSuccess="handleUploadSuccess" />
+
+    <popup v-model:show="showTaskPopup" round class="task-tips-popup">
+        <template v-if="taskPopupType === 'warning'">
+            <img class="create-farm-icon" src="@/assets/img/home/create-farm-icon.png" alt="" />
+            <div class="create-farm-text">
+                <div>
+                    您确认忽略 <span class="main-text">{{ currentTask?.farmName }}</span> 的
+                    <span class="main-text">{{ currentTask?.farmWorkName }}</span> 农事吗
+                </div>
+            </div>
+        </template>
+        <template v-else>
+            <img class="farm-check-icon" src="@/assets/img/home/right.png" alt="" />
+            <div class="create-farm-text success-text">农事已下发成功</div>
+        </template>
+        <div class="create-farm-btn" @click="handlePopupBtn">
+            {{ taskPopupType === "warning" ? "确认忽略" : "我知道了" }}
+        </div>
+    </popup>
+    <!-- 服务报价单 -->
+    <price-sheet-popup :key="activeIndex" ref="priceSheetPopupRef"></price-sheet-popup>
+    <!-- 新增:激活上传弹窗 -->
+    <active-upload-popup ref="activeUploadPopupRef" :needExecutor="true" @handleUploadSuccess="handleUploadSuccess"></active-upload-popup>
+    
+    <!-- 报价弹窗 -->
+    <offer-popup :showPopup="showPopup" :executionData="executionData"></offer-popup>
+</template>
+
+<script setup>
+import eventBus from "@/api/eventBus";
+import { computed, nextTick, onMounted, ref, watch } from "vue";
+import { useStore } from "vuex";
+import { Popup } from "vant";
+import IndexMap from "../../farm_manage/map/index";
+import taskItem from "@/components/taskItem.vue";
+import { useRouter } from "vue-router";
+import uploadExecute from "./uploadExecute.vue";
+import priceSheetPopup from "@/components/popup/priceSheetPopup.vue";
+import { ElMessage } from "element-plus";
+import activeUploadPopup from "@/components/popup/activeUploadPopup.vue";
+import offerPopup from "@/components/popup/offerPopup.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 showPopup = ref(false);
+const executionData = ref(null);
+
+const selectParma = ref({
+    farmWorkTypeId: null,
+    districtCode: null,
+});
+
+// 任务列表数据(用于显示,可能被筛选)
+const taskList = ref([]);
+// 各状态任务数量
+const taskCounts = ref([0, 0, 0]);
+// 当前选中的筛选索引
+const activeIndex = ref(0);
+const noData = ref(false);
+const loading = ref(false);
+
+const showTaskPopup = ref(false);
+const taskPopupType = ref("warning");
+
+// 根据 activeIndex 计算 startFlowStatus
+const getStartFlowStatus = (index) => {
+    const statusMap = {
+        0: 0, // 待确认
+        1: "1,2,3", // 待完成
+        2: 4, // 待完成
+        3: 5, // 已完成
+    };
+    return statusMap[index] ?? 0;
+};
+
+const timelineList = ref([
+    {
+        date: "3",
+        workName: "梢期杀虫",
+        price: "1258"
+    },
+    {
+        date: "5",
+        workName: "梢期营养",
+        price: "1758"
+    },
+])
+
+// 获取单个状态的任务数量
+function getTaskCount(flowStatus, index) {
+    const location = store.state.home.miniUserLocationPoint;
+    return VE_API.z_farm_work_record
+        .getSimpleList({ role: 2, location, flowStatus })
+        .then(({ data }) => {
+            data = [
+                ...data,
+                {
+                    address: "深圳世界之窗",
+                    executeDate: "2025-12-29",
+                    executeEvidence: "",
+                    farmArea: "40.100412863459745",
+                    farmId: 93651,
+                    farmMiniUserId: 91344,
+                    farmMiniUserName: "舒浩农资",
+                    farmName: "世界之窗荔枝农场",
+                    farmWorkArrangeId: null,
+                    farmWorkLibId: "756894717878210560",
+                    farmWorkName: "二梢营养",
+                    id: "276563",
+                    isFollow: null,
+                    isIgnored: 0,
+                    isPublic: 0,
+                    orderId: "778920749103583232",
+                    point: "POINT(113.96804666992188 22.537601205078126)",
+                    quoteCount: "0",
+                    typeId: "2",
+                    typeName: "糯米糍",
+                },
+                {
+                    address: "汕尾市海丰县赤坑镇S241妙荔现代农业园",
+                    executeDate: "2025-12-27",
+                    executeEvidence: "",
+                    farmArea: "",
+                    farmId: 43318,
+                    farmMiniUserId: 81818,
+                    farmMiniUserName: "",
+                    farmName: "汕尾妙荔果园",
+                    farmWorkArrangeId: null,
+                    farmWorkLibId: "708734452137725956",
+                    farmWorkName: "杀梢",
+                    id: "277160",
+                    isFollow: null,
+                    isIgnored: 0,
+                    isPublic: 0,
+                    orderId: "781556915820826624",
+                    point: "POINT(115.455766 22.883073)",
+                    quoteCount: "0",
+                    typeId: "4",
+                    typeName: "仙进奉",
+                },
+            ];
+            if (Array.isArray(data)) {
+                taskCounts.value[index] = data.length;
+
+                if (index === 2) {
+                    indexMap.initData(data);
+                }
+            } else if (data?.total !== undefined) {
+                taskCounts.value[index] = data.total;
+            } else {
+                taskCounts.value[index] = 0;
+            }
+        })
+        .catch((error) => {
+            console.error(`获取状态${index}任务数量失败:`, error);
+            taskCounts.value[index] = 0;
+        });
+}
+
+const taskItemRefs = ref([]);
+const setTaskItemRef = (el, index) => {
+    if (el) {
+        taskItemRefs.value[index] = el;
+    }
+};
+
+const handleUploadSuccess = async () => {
+    // 先保存当前需要更新的 item id
+    const currentItemIds = taskList.value.map((item) => item.id || item.workRecordId);
+
+    // 刷新列表
+    await getSimpleList();
+
+    // 等待 DOM 更新完成,refs 被重新收集
+    await nextTick();
+
+    // 更新所有task-item的triggerImg
+    taskItemRefs.value.forEach((ref) => {
+        if (ref && ref.updateTriggerImg) {
+            ref.updateTriggerImg();
+        }
+    });
+};
+
+const cityCode = ref("");
+//根据城市的坐标返回区县列表
+const districtList = ref([]);
+function getDistrictListByCity() {
+    VE_API.z_farm_work_record.getDistrictListByCity({ point: mapPoint.value }).then(({ data }) => {
+        districtList.value = data || [];
+        // cityCode.value = data[0].code.slice(0, -2);
+        cityCode.value = "";
+        districtList.value.unshift({ code: cityCode.value, name: "全部" });
+        selectParma.value.districtCode = cityCode.value;
+        getSimpleList();
+    });
+}
+
+//农事类型列表
+const farmWorkTypeList = ref([]);
+function getFarmWorkTypeList() {
+    VE_API.z_farm_work_record.getFarmWorkTypeList().then(({ data }) => {
+        farmWorkTypeList.value = data;
+        farmWorkTypeList.value.unshift({ id: 0, name: "全部" });
+    });
+}
+
+// 初始化时获取所有状态的任务数量
+function initTaskCounts() {
+    const location = store.state.home.miniUserLocationPoint;
+    // 并行请求三个状态的数量
+    Promise.all([
+        getTaskCount(0, 0), // 待确认
+        getTaskCount("1,2,3", 1), // 待确认
+        getTaskCount(4, 2), // 待完成
+        getTaskCount(5, 3), // 已完成
+    ]);
+}
+const mapPoint = ref(null);
+
+onMounted(() => {
+    mapPoint.value = store.state.home.miniUserLocationPoint;
+
+    // 初始化时获取所有状态的数量
+    initTaskCounts();
+    // 加载当前选中状态的数据列表
+    getSimpleList();
+    getDistrictListByCity();
+    getFarmWorkTypeList();
+    nextTick(() => {
+        indexMap.initMap(mapPoint.value, mapContainer.value, true);
+    });
+});
+
+// 监听 activeIndex 变化,重新加载数据
+watch(activeIndex, () => {
+    getSimpleList();
+});
+
+function getSimpleList() {
+    loading.value = true;
+    noData.value = false;
+    // 清空refs数组,避免索引错乱
+    taskItemRefs.value = [];
+    const startFlowStatus = getStartFlowStatus(activeIndex.value);
+    const params = {
+        ...selectParma.value,
+        role: 2,
+        location: mapPoint.value,
+        flowStatus: startFlowStatus,
+        farmWorkTypeId: selectParma.value.farmWorkTypeId || null,
+    };
+
+    return VE_API.z_farm_work_record
+        .getSimpleList(params)
+        .then(({ data }) => {
+            loading.value = false;
+            // 假设返回的数据结构是 { list: [], total: 0 } 或者直接是数组
+            let filteredData = data;
+
+            // 如果是"待确认"状态,过滤掉 isIgnored 为 1 的数据
+            if (activeIndex.value === 0 && Array.isArray(data)) {
+                filteredData = data.filter((item) => item.isIgnored !== 1);
+            }
+
+            if (Array.isArray(filteredData) && filteredData.length > 0) {
+                taskList.value = filteredData;
+                // 更新当前状态的数量
+                taskCounts.value[activeIndex.value] = filteredData.length;
+                if (activeIndex.value === 2) {
+                    // 地图使用筛选后的数据
+                    indexMap.initData(taskList.value);
+                }
+            } else {
+                noData.value = true;
+                taskList.value = [];
+                taskCounts.value[activeIndex.value] = 0;
+            }
+        })
+        .catch((error) => {
+            console.error("获取任务列表失败:", error);
+            loading.value = false;
+            taskList.value = [];
+            taskCounts.value[activeIndex.value] = 0;
+            if (activeIndex.value === 2) {
+                indexMap.initData(taskList.value);
+            }
+            noData.value = true;
+        });
+}
+
+function handleActiveFilter(i) {
+    activeIndex.value = i;
+    selectParma.value.districtCode = cityCode.value;
+    selectParma.value.farmWorkTypeId = null;
+}
+
+function toPage(item) {
+    // router.push("/servicZes_agri")
+    // if (activeIndex.value === 2) {
+    // } else {
+    //     // 下发农事请求
+    //     const data = {
+    //         id: item.id,
+    //     };
+    //     VE_API.z_farm_work_record.issueFarmWorkRecord(data).then((res) => {
+    //         if (res.code === 0) {
+    //             taskPopupType.value = "success";
+    //             showTaskPopup.value = true;
+    //             getSimpleList();
+    //         }
+    //     });
+    // }
+}
+
+const showUploadExecutePopup = (item) => {
+    if (item?.executeEvidence.length) {
+        onlyShare.value = true;
+    } else {
+        onlyShare.value = false;
+    }
+    setTimeout(() => {
+        uploadExecuteRef.value.showPopup(item);
+    }, 10);
+};
+
+function toDetail(item) {
+    if (activeIndex.value === 0) {
+        router.push({
+            path: "/modify_work",
+            query: { id: item.id },
+        });
+    } else {
+        router.push({
+            path: "/completed_work",
+            query: { miniJson: JSON.stringify({ id: item.id }) },
+        });
+    }
+}
+
+const priceSheetPopupRef = ref(null);
+const showPriceSheetPopup = (item) => {
+    VE_API.z_farm_work_record.getDetail({ id: item.id }).then(({ data }) => {
+        const res = data[0];
+        priceSheetPopupRef.value.handleShowPopup(res);
+    });
+};
+
+const onlyShare = ref(false);
+const currentTask = ref(null);
+function handleAction(item) {
+    if (activeIndex.value === 0) {
+        taskPopupType.value = "warning";
+        showTaskPopup.value = true;
+        currentTask.value = item;
+    } else {
+        onlyShare.value = true;
+        setTimeout(() => {
+            uploadExecuteRef.value.showPopup(item, "share-sheet");
+        }, 10);
+    }
+}
+
+function handlePopupBtn() {
+    showTaskPopup.value = false;
+    if (taskPopupType.value === "warning") {
+        // 确认忽略
+        VE_API.z_farm_work_record.ignoreFarmWorkRecord({ farmWorkRecordId: currentTask.value.id }).then((res) => {
+            if (res.code === 0) {
+                ElMessage.success("操作成功");
+                getSimpleList();
+            }
+        });
+    }
+}
+
+function handleForward(item) {
+    if (item.quoteCount && item.quoteCount != 0) {
+        onlyShare.value = true;
+        setTimeout(() => {
+            uploadExecuteRef.value.showPopup(
+                { ...item, type: "quotation", farmWorkOrderId: item.orderId },
+                "share-sheet"
+            );
+        }, 10);
+    } else {
+        ElMessage.warning("暂无报价数据,无法分享");
+        return;
+    }
+}
+
+const executorList = ref([{
+    id: 1,
+    name: "张三",
+    phone: "13800138000",
+}, {
+    id: 2,
+    name: "李四",
+    phone: "13800138001",
+}])
+
+function handleTimelineAction(item) {
+    // activeUploadPopupRef.value.triggerFarmWork({
+    //     farmId: item.farmId,
+    //     workName: item.workName,
+    // });
+
+    eventBus.emit("activeUpload:show", {
+        gardenIdVal: item.farmId,
+        problemTitleVal: '请选择 ' + item.workName + ' 执行截至时间',
+        arrangeIdVal: item.farmWorkArrangeId,
+        executorListVal: executorList.value,
+    });
+}
+</script>
+
+<style lang="scss" scoped>
+.task-page {
+    width: 100%;
+    height: calc(100vh - 50px - 50px);
+    overflow: auto;
+    box-sizing: border-box;
+    background: #f5f7fb;
+    .map-container {
+        width: 100%;
+        height: 162px;
+        clip-path: inset(0px round 8px);
+    }
+
+    .select-group {
+        display: flex;
+        padding: 8px 12px 0 12px;
+        .select-item {
+            width: 100%;
+            ::v-deep {
+                .el-select__wrapper {
+                    text-align: center;
+                    gap: 2px;
+                    box-shadow: none;
+                    justify-content: center;
+                    background: none;
+                }
+                .el-select__selection {
+                    flex: none;
+                    width: fit-content;
+                }
+                .el-select__placeholder {
+                    position: static;
+                    transform: none;
+                    width: fit-content;
+                    color: rgba(0, 0, 0, 0.2);
+                }
+                .el-select__caret {
+                    color: rgba(0, 0, 0, 0.2);
+                }
+            }
+        }
+    }
+
+    .task-top {
+        padding: 10px 12px 0 12px;
+    }
+
+    .task-content-loading {
+        height: 80px;
+        border-radius: 8px;
+        position: absolute;
+        top: 60px;
+        left: 0;
+        width: 100%;
+    }
+
+    .task-content {
+        min-height: 80px;
+    }
+
+    .empty-data {
+        text-align: center;
+        font-size: 14px;
+        color: #6f7274;
+        padding: 20px 0;
+    }
+    .task-list {
+        position: relative;
+        background: #fff;
+        padding: 12px 12px 8px 12px;
+    }
+    .list-filter {
+        display: flex;
+        align-items: center;
+        justify-content: space-around;
+        .filter-item {
+            padding: 0 12px;
+            height: 28px;
+            color: rgba(0, 0, 0, 0.5);
+            font-size: 14px;
+            line-height: 28px;
+            border-radius: 20px;
+            &.active {
+                color: #2199f8;
+                background: rgba(33, 153, 248, 0.2);
+            }
+        }
+    }
+    .task-item {
+        border-radius: 12px;
+        border: 0.3px solid rgba(0, 0, 0, 0.2);
+        padding: 12px;
+    }
+
+    .task-item + .task-item {
+        margin-top: 10px;
+    }
+
+    .img-text-wrap {
+        display: flex;
+        align-items: flex-start;
+        justify-content: space-between;
+        padding-bottom: 10px;
+        border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
+        .left-wrap {
+            display: flex;
+            align-items: center;
+            .left-img {
+                width: 40px;
+                height: 40px;
+                border-radius: 6px;
+                img {
+                    width: 100%;
+                    height: 100%;
+                    object-fit: contain;
+                }
+            }
+            .right-text {
+                padding-left: 8px;
+                .farm-info {
+                    font-size: 14px;
+                    color: #1d2129;
+                    display: flex;
+                    align-items: center;
+                    .info-tag-wrap {
+                        margin-left: 10px;
+                        display: flex;
+                        align-items: center;
+                        gap: 4px;
+                        .tag-item {
+                            height: 20px;
+                            line-height: 20px;
+                            padding: 0 8px;
+                            border-radius: 2px;
+                            font-size: 12px;
+                            &.second {
+                                color: #ff953d;
+                                background: rgba(255, 149, 61, 0.1);
+                            }
+                            &.primary {
+                                color: #2199f8;
+                                background: #e8f3ff;
+                            }
+                        }
+                    }
+                }
+                .farm-addr {
+                    padding-top: 2px;
+                    font-size: 12px;
+                    color: #86909c;
+                }
+            }
+        }
+        .right-wrap {
+            display: flex;
+            align-items: center;
+            justify-content: center;
+            text-align: center;
+            color: #fff;
+            background: #2199f8;
+            font-size: 12px;
+            flex: none;
+            width: 44px;
+            height: 44px;
+            padding: 8px;
+            border-radius: 5px;
+            box-sizing: border-box;
+            .click-item {
+                display: flex;
+                align-items: center;
+                gap: 2px;
+            }
+            .follow-text {
+                color: #d0d0d0;
+            }
+        }
+    }
+
+    .item-bottom {
+        padding-top: 10px;
+        .bottom-tag {
+            display: flex;
+            gap: 10px;
+            .tag-card {
+                flex: 1;
+                border-radius: 2px;
+                padding: 4px;
+                box-sizing: border-box;
+                border: 0.4px solid rgba(215, 215, 215, 0.5);
+                .card-content {
+                    display: flex;
+                    flex-direction: column;
+                    align-items: center;
+                    justify-content: center;
+                    text-align: center;
+                    .card-main-text {
+                        font-size: 16px;
+                        font-weight: 500;
+                        color: #202020;
+                        margin-bottom: 2px;
+                    }
+                    .card-sub-text {
+                        font-size: 10px;
+                        color: rgba(32, 32, 32, 0.4);
+                        display: flex;
+                        align-items: center;
+                        gap: 4px;
+                        .card-icon {
+                            display: inline-flex;
+                            align-items: center;
+                            justify-content: center;
+                            width: 12px;
+                            height: 12px;
+                            color: #2199f8;
+                        }
+                    }
+                }
+                &.active {
+                    background: rgba(33, 153, 248, 0.1);
+                    border: 0.5px solid #2199f8;
+                    .card-content {
+                        .card-main-text {
+                            color: #2199f8;
+                        }
+                        .card-sub-text {
+                            color: #2199f8;
+                        }
+                    }
+                }
+            }
+        }
+        .timeline {
+                padding-top: 10px;
+                .timeline-item {
+                    display: flex;
+                    align-items: flex-start;
+                    font-size: 14px;
+                    color: #ffffff;
+                    line-height: 22px;
+                    & + .timeline-item {
+                        margin-top: 10px;
+                    }
+                    .timeline-left {
+                        width: 22px;
+                        display: flex;
+                        flex-direction: column;
+                        align-items: center;
+                        .dot {
+                            width: 6px;
+                            height: 6px;
+                            border-radius: 50%;
+                            background: #A2D5FD;
+                            margin-top: 6px;
+                        }
+                        .line {
+                            border-left: 1px dashed #A2D5FD;
+                            margin-top: 4px;
+                            height: 28px;
+                        }
+                    }
+                    .timeline-right {
+                        padding-left: 5px;
+                        flex: 1;
+                        .date {
+                            color: #1D2129;
+                            font-weight: 500;
+                            font-size: 14px;
+                            line-height: 22px;
+                        }
+                        .text {
+                            font-size: 12px;
+                            color: #d7d7d7;
+                            .price {
+                                padding-left: 4px;
+                            }
+                            .action-detail {
+                                padding-left: 6px;
+                                color: #2199F8;
+                            }
+                        }
+                        .work-name {
+                            padding-left: 4px;
+                        }
+                    }
+                    .timeline-action {
+                        align-self: center;
+                        height: 28px;
+                        line-height: 28px;
+                        flex: none;
+                        background: rgba(33, 153, 248, 0.1);
+                        color: #2199F8;
+                        font-size: 12px;
+                        padding: 0px 11px;
+                        border-radius: 20px;
+                    }
+                }
+            }
+    }
+
+    .item-footer {
+        margin-top: 10px;
+        padding-top: 11px;
+        border-top: 1px solid rgba(0, 0, 0, 0.1);
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        font-size: 12px;
+        .footer-l {
+            color: #8b8b8b;
+            font-size: 12px;
+            &.primary-btn {
+                display: inline-flex;
+                align-items: center;
+                border: 1px solid #2199f8;
+                background: rgba(33, 153, 248, 0.1);
+                padding: 0 12px;
+                height: 32px;
+                box-sizing: border-box;
+                display: flex;
+                align-items: center;
+                border-radius: 20px;
+                color: #2199f8;
+                .share-icon {
+                    width: 12px;
+                    padding-right: 4px;
+                }
+            }
+            &.farm-name-text {
+                font-size: 14px;
+                color: #6f7274;
+                .name-text {
+                    padding-left: 4px;
+                }
+            }
+        }
+        .footer-r {
+            display: flex;
+            align-items: center;
+            .btn {
+                height: 32px;
+                line-height: 32px;
+                padding: 0 12px;
+                border-radius: 20px;
+                display: flex;
+                align-items: center;
+                box-sizing: border-box;
+                &.second {
+                    // border: 1px solid #8B8B8B;
+                    // color: #8B8B8B;
+                    color: #2199f8;
+                    background: rgba(33, 153, 248, 0.1);
+                }
+                &.primary {
+                    background: #2199f8;
+                    color: #fff;
+                }
+                .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;
+            }
+        }
+    }
+}
+
+.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>

+ 30 - 131
src/views/old_mini/task_condition/components/task.vue

@@ -8,9 +8,6 @@
         </div>
         <div class="task-list">
             <div class="list-filter">
-                <div class="filter-item" :class="{ active: activeIndex === 0 }" @click="handleActiveFilter(0)">
-                    待确认({{ taskCounts[0] || 0 }})
-                </div>
                 <!-- <div class="filter-item" :class="{ active: activeIndex === 1 }" @click="handleActiveFilter(1)">
                     已确认({{ taskCounts[1] || 0 }})
                 </div> -->
@@ -52,16 +49,10 @@
                         :ref="(el) => setTaskItemRef(el, index)"
                     >
                         <template #footer>
-                            <div class="item-footer" v-if="activeIndex === 0 || activeIndex === 2">
+                            <div class="item-footer" v-if="activeIndex === 2">
                                 <div class="footer-l" @click="toDetail(item)">查看详情</div>
                                 <div class="footer-r">
-                                    <div v-if="activeIndex === 0" class="btn second" @click="handleAction(item)">
-                                        忽略
-                                    </div>
-                                    <div class="btn primary" v-if="activeIndex === 0" @click="showPriceSheetPopup(item)">
-                                        确认并报价
-                                    </div>
-                                    <div v-else class="btn primary" @click="showUploadExecutePopup(item)">
+                                    <div class="btn primary" @click="showUploadExecutePopup(item)">
                                         请求确认
                                     </div>
                                 </div>
@@ -84,26 +75,9 @@
     </div>
     <upload-execute ref="uploadExecuteRef" :onlyShare="onlyShare" @uploadSuccess="handleUploadSuccess" />
 
-    <popup v-model:show="showTaskPopup" round class="task-tips-popup">
-        <template v-if="taskPopupType === 'warning'">
-            <img class="create-farm-icon" src="@/assets/img/home/create-farm-icon.png" alt="" />
-            <div class="create-farm-text">
-                <div>
-                    您确认忽略 <span class="main-text">{{ currentTask?.farmName }}</span> 的
-                    <span class="main-text">{{ currentTask?.farmWorkName }}</span> 农事吗
-                </div>
-            </div>
-        </template>
-        <template v-else>
-            <img class="farm-check-icon" src="@/assets/img/home/right.png" alt="" />
-            <div class="create-farm-text success-text">农事已下发成功</div>
-        </template>
-        <div class="create-farm-btn" @click="handlePopupBtn">
-            {{ taskPopupType === "warning" ? "确认忽略" : "我知道了" }}
-        </div>
-    </popup>
     <!-- 服务报价单 -->
     <price-sheet-popup :key="activeIndex" ref="priceSheetPopupRef"></price-sheet-popup>
+    <offer-popup :showPopup="showPopup" :executionData="executionData"></offer-popup>
 </template>
 
 <script setup>
@@ -117,6 +91,7 @@ import { useRouter } from "vue-router";
 import uploadExecute from "./uploadExecute.vue";
 import priceSheetPopup from "@/components/popup/priceSheetPopup.vue";
 import { ElMessage } from "element-plus";
+import offerPopup from "@/components/popup/offerPopup.vue";
 
 const store = useStore();
 const router = useRouter();
@@ -126,7 +101,8 @@ const tabBarHeight = computed(() => store.state.home.tabBarHeight);
 const uploadExecuteRef = ref(null);
 const dateValue = ref("1");
 const calendarRef = ref(null);
-
+const showPopup = ref(false);
+const executionData = ref(null);
 const selectParma = ref({
     farmWorkTypeId: null,
     districtCode: null,
@@ -139,24 +115,20 @@ const fullTaskList = ref([]);
 // 各状态任务数量
 const taskCounts = ref([0, 0, 0]);
 // 当前选中的筛选索引
-const activeIndex = ref(0);
+const activeIndex = ref(2);
 // 筛选日期(用于按日期筛选)
 const filterDate = ref(null);
 const noData = ref(false);
 const loading = ref(false);
 
-const showTaskPopup = ref(false);
-const taskPopupType = ref("warning");
-
 // 根据 activeIndex 计算 startFlowStatus
 const getStartFlowStatus = (index) => {
     const statusMap = {
-        0: 0, // 待确认
         1: "1,2,3", // 待完成
         2: 4, // 待完成
         3: 5, // 已完成
     };
-    return statusMap[index] ?? 0;
+    return statusMap[index] ?? 4;
 };
 
 // 获取单个状态的任务数量
@@ -236,10 +208,9 @@ function getFarmWorkTypeList() {
 // 初始化时获取所有状态的任务数量
 function initTaskCounts() {
     const location = store.state.home.miniUserLocationPoint;
-    // 并行请求三个状态的数量
+    // 并行请求状态的数量
     Promise.all([
-        getTaskCount(0, 0), // 待确认
-        getTaskCount("1,2,3", 1), // 待确认
+        getTaskCount("1,2,3", 1), // 已确认
         getTaskCount(4, 2), // 待完成
         getTaskCount(5, 3), // 已完成
     ]);
@@ -301,11 +272,6 @@ function getSimpleList() {
             // 假设返回的数据结构是 { list: [], total: 0 } 或者直接是数组
             let filteredData = data
 
-            // 如果是"待确认"状态,过滤掉 isIgnored 为 1 的数据
-            if (activeIndex.value === 0 && Array.isArray(data)) {
-                filteredData = data.filter((item) => item.isIgnored !== 1);
-            }
-
             // 保存完整数据(用于日历显示)
             if (activeIndex.value === 2) {
                 // 如果是"待完成"状态,保存完整数据用于日历
@@ -412,29 +378,24 @@ function toPage(item) {
 }
 
 const showUploadExecutePopup = (item) => {
-    if (item?.executeEvidence.length) {
-        onlyShare.value = true;
-    } else {
-        onlyShare.value = false;
-    }
-    setTimeout(() => {
-        uploadExecuteRef.value.showPopup(item);
-    }, 10);
+    showPopup.value = !showPopup.value;
+    executionData.value = item;
+    // if (item?.executeEvidence.length) {
+    //     onlyShare.value = true;
+    // } else {
+    //     onlyShare.value = false;
+    // }
+    // setTimeout(() => {
+    //     uploadExecuteRef.value.showPopup(item);
+    // }, 10);
 };
 
 
 function toDetail(item) {
-    if (activeIndex.value === 0) {
-        router.push({
-            path: "/modify_work",
-            query: { id: item.id },
-        });
-    } else {
-        router.push({
-            path: "/completed_work",
-            query: { miniJson: JSON.stringify({ id: item.id }) },
-        });
-    }
+    router.push({
+        path: "/completed_work",
+        query: { miniJson: JSON.stringify({ id: item.id }) },
+    });
 }
 
 const priceSheetPopupRef = ref(null);
@@ -446,31 +407,11 @@ const showPriceSheetPopup = (item) => {
 };
 
 const onlyShare = ref(false);
-const currentTask = ref(null);
 function handleAction(item) {
-    if (activeIndex.value === 0) {
-        taskPopupType.value = "warning";
-        showTaskPopup.value = true;
-        currentTask.value = item;
-    } else {
-        onlyShare.value = true;
-        setTimeout(() => {
-            uploadExecuteRef.value.showPopup(item, "share-sheet");
-        }, 10);
-    }
-}
-
-function handlePopupBtn() {
-    showTaskPopup.value = false;
-    if (taskPopupType.value === "warning") {
-        // 确认忽略
-        VE_API.z_farm_work_record.ignoreFarmWorkRecord({ farmWorkRecordId: currentTask.value.id }).then((res) => {
-            if (res.code === 0) {
-                ElMessage.success("操作成功");
-                getSimpleList();
-            }
-        });
-    }
+    onlyShare.value = true;
+    setTimeout(() => {
+        uploadExecuteRef.value.showPopup(item, "share-sheet");
+    }, 10);
 }
 
 function handleForward(item) {
@@ -567,7 +508,8 @@ function handleForward(item) {
     .list-filter {
         display: flex;
         align-items: center;
-        justify-content: space-around;
+        justify-content: center;
+        gap: 20px;
         .filter-item {
             padding: 0 12px;
             height: 28px;
@@ -662,47 +604,4 @@ function handleForward(item) {
         }
     }
 }
-
-.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>

+ 7 - 11
src/views/old_mini/task_condition/index.vue

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