Browse Source

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

wangsisi 18 hours ago
parent
commit
1b319e62f6

+ 22 - 6
src/views/old_mini/modify_work/completedWork.vue

@@ -87,7 +87,7 @@
                 </div>
             </div>
             <div class="work-wrap info-wrap">
-                <div class="box-wrap farm-photo farm-info" v-if="(curRole == 2 && currentStep == 2) || (currentStep == 1 && curRole == 1)">
+                <div class="box-wrap farm-photo farm-info" v-if="((curRole == 2 && currentStep == 2) || (curRole == 0 && detailData?.flowStatus === 4)) && detailData?.executeEvidence">
                     <div class="info-title">
                         <div class="card-title">执行照片</div>
                         <div class="info-more">
@@ -96,13 +96,21 @@
                         </div>
                     </div>
                     <div class="photo-list pt-10">
-                        <div class="img-item" v-for="(item, index) in 2" :key="index">
+                        <!-- <div class="img-item" v-for="(item, index) in detailData.executeEvidence" :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"
+                                :src="base_img_url2 + item"
                                 alt=""
                             />
-                        </div>
+                        </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-provider>
                     </div>
                 </div>
                 <div class="box-wrap farm-info">
@@ -298,6 +306,7 @@ import farmSteps from "@/components/farmSteps.vue";
 import priceTable from "../agri_work/components/priceTable.vue";
 import priceSheetPopup from "@/components/popup/priceSheetPopup.vue";
 import uploadExecute from "@/views/old_mini/task_condition/components/uploadExecute.vue";
+import { base_img_url2 } from "@/api/config";
 
 const router = useRouter();
 const store = useStore();
@@ -937,8 +946,15 @@ const changeRegion = (e) => {
                     border-radius: 8px;
                     object-fit: cover;
                 }
-                .img-item + .img-item {
-                    margin-left: 12px;
+                .img-item {
+                    margin-right: 12px;
+                }
+
+                .view-box {
+                    width: 92px;
+                    height: 92px;
+                    border-radius: 8px;
+                    object-fit: cover;
                 }
             }
             .list-text {

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

@@ -159,7 +159,7 @@ onMounted(() => {
     
     // 从 priceData 中匹配价格和品牌到对应的药肥
     if (priceData.value.itemsList && detailData.value.prescriptionList) {
-        // executionMethod.value = priceData.value.executionMethod;
+        executionMethod.value = priceData.value.executionMethod;
         detailData.value.prescriptionList.forEach(prescription => {
             if (prescription.pesticideFertilizerList) {
                 prescription.pesticideFertilizerList.forEach(pesticide => {
@@ -248,7 +248,7 @@ const confirmPrice = () => {
         if (data) {
             ElMessage.success("确认报价成功");
             router.push({
-                path: "/home",
+                path: "/task_condition",
             });
         }
     })

+ 37 - 8
src/views/old_mini/task_condition/components/task.vue

@@ -12,10 +12,13 @@
                     待确认({{ taskCounts[0] || 0 }})
                 </div>
                 <div class="filter-item" :class="{ active: activeIndex === 1 }" @click="handleActiveFilter(1)">
-                    待完成({{ taskCounts[1] || 0 }})
+                    已确认({{ taskCounts[1] || 0 }})
                 </div>
                 <div class="filter-item" :class="{ active: activeIndex === 2 }" @click="handleActiveFilter(2)">
-                    已完成({{ taskCounts[2] || 0 }})
+                    待完成({{ taskCounts[2] || 0 }})
+                </div>
+                <div class="filter-item" :class="{ active: activeIndex === 3 }" @click="handleActiveFilter(3)">
+                    已完成({{ taskCounts[3] || 0 }})
                 </div>
             </div>
             <div class="select-group">
@@ -33,9 +36,9 @@
             </div> -->
             <div class="task-content" v-loading="loading">
                 <div class="task-item" v-for="item in taskList" :key="item.id || item.workRecordId">
-                    <task-item :status="activeIndex === 2 ? 1 : 0" :item-data="item">
+                    <task-item :status="activeIndex === 3 ? 1 : 0" :item-data="item">
                         <template #footer>
-                            <div class="item-footer" v-if="activeIndex === 0 || activeIndex === 1">
+                            <div class="item-footer" v-if="activeIndex === 0 || activeIndex === 2">
                                 <div class="footer-l" @click="toDetail(item)">
                                     查看详情
                                 </div>
@@ -48,6 +51,19 @@
                                     </div>
                                 </div>
                             </div>
+                            <div v-else-if="activeIndex === 1" class="item-footer">
+                                <div class="footer-l" @click="toDetail(item)">
+                                    查看详情
+                                </div>
+                                <div class="footer-r">
+                                    <div class="btn second">
+                                        转发给客户
+                                    </div>
+                                    <div class="btn primary" @click="showPriceSheetPopup(item)">
+                                        生成报价单
+                                    </div>
+                                </div>
+                            </div>
                             <div class="item-footer" v-else>
                                 <div class="footer-l farm-name-text">
                                     来自<span class="name-text">{{ item.farmName || '未知农场' }}</span>
@@ -83,6 +99,8 @@
         </template>
         <div class="create-farm-btn" @click="handlePopupBtn">{{ taskPopupType === 'warning' ? '确认忽略' : '我知道了' }}</div>
     </popup>
+    <!-- 服务报价单 -->
+    <price-sheet-popup ref="priceSheetPopupRef"></price-sheet-popup>
 </template>
 
 <script setup>
@@ -94,6 +112,7 @@ import taskItem from "@/components/taskItem.vue";
 import calendar from "./calendar.vue"
 import { useRouter } from "vue-router";
 import uploadExecute from "./uploadExecute.vue";
+import priceSheetPopup from "@/components/popup/priceSheetPopup.vue";
 const store = useStore();
 const router = useRouter();
 const indexMap = new IndexMap();
@@ -136,8 +155,9 @@ const taskPopupType = ref('warning');
 const getStartFlowStatus = (index) => {
     const statusMap = {
         0: 0, // 待确认
-        1: 4, // 待完成
-        2: 5  // 已完成
+        1: '1,2,3', // 待完成
+        2: 4, // 待完成
+        3: 5  // 已完成
     };
     return statusMap[index] ?? 0;
 };
@@ -165,8 +185,9 @@ function initTaskCounts() {
     // 并行请求三个状态的数量
     Promise.all([
         getTaskCount(0, 0),  // 待确认
-        getTaskCount(4, 1),  // 待完成
-        getTaskCount(5, 2)   // 已完成
+        getTaskCount('1,2,3', 1),  // 待确认
+        getTaskCount(4, 2),  // 待完成
+        getTaskCount(5, 3)   // 已完成
     ]);
 }
 
@@ -259,6 +280,14 @@ function toDetail(item) {
     }
 }
 
+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) {