Prechádzať zdrojové kódy

feat: 增加农户自己完成流程

lxf 1 týždeň pred
rodič
commit
11dc050998

+ 25 - 5
src/views/old_mini/agri_services/components/farmDynamics.vue

@@ -30,7 +30,7 @@
                                     <div class="action-item warning-item" @click.stop="handleApply(section)">
                                         发起需求
                                     </div>
-                                    <div class="action-item primary-item" @click.stop="handleConfirmComplete(section)">确认并完成</div>
+                                    <div class="action-item primary-item" @click.stop="handleUploadPhoto({ id: section.id, isSelfDone: true, section })">确认并完成</div>
                                 </div>
                                 <div class="action-r" v-else-if="section.farmWorkDetail?.flowStatus === 0 && section.isPublic">
                                     <div
@@ -87,7 +87,7 @@
     <!-- 提醒对方执行弹窗 -->
     <upload-execute ref="uploadExecuteRef" onlyShare />
     <!-- 上传照片弹窗 -->
-    <review-upload-popup v-model="showUpload" :record-id="sectionId" @success="getContentData" />
+    <review-upload-popup v-model="showUpload" :record-id="sectionId" @success="handleImgUpload" />
 </template>
 <script setup>
 import { ref, onActivated ,onMounted} from "vue";
@@ -115,8 +115,25 @@ const props = defineProps({
     },
 });
 
-const handleConfirmComplete = (section) => {
-    ElMessage.warning("该功能正在升级中,敬请期待");
+const handleImgUpload = () => {
+    if(selfDone.value){
+        VE_API.z_farm_work_record.updateFlowStatus({ id: currentSection.value.id, targetFlowStatus: 5 }).then((res) => {
+            if (res.code === 0) {
+                showUpload.value = false;
+                sectionId.value = null;
+                setTimeout(() => {
+                    router.push({
+                    path: "/review_work",
+                    query: {
+                            json: JSON.stringify({ id: currentSection.value.id, goBack: true }),
+                        },
+                    });
+                }, 500)
+            }
+        })
+    }else{
+        getContentData();
+    }
 };
 
 const showApplyPopup = ref(false);
@@ -196,10 +213,13 @@ const handleOperation = (section, type) => {
 
 const showUpload = ref(false);
 const sectionId = ref(null);
+const selfDone = ref(false);
 // 上传照片处理函数
-const handleUploadPhoto = ({ id }) => {
+const handleUploadPhoto = ({ id, isSelfDone = false, section }) => {
+    currentSection.value = section;
     showUpload.value = true;
     sectionId.value = id;
+    selfDone.value = isSelfDone;
 };
 
 const filterType = ref([

+ 4 - 4
src/views/old_mini/agri_services/components/servicesHall.vue

@@ -90,7 +90,7 @@
                                     <span>电话联系</span>
                                 </div> -->
                                 <div class="r-item" @click.stop="handleOnlineChat(item)">
-                                    <Icon name="chat-o" />
+                                    <!-- <Icon name="chat-o" /> -->
                                     <span>线上沟通</span>
                                 </div>
                             </div>
@@ -147,9 +147,9 @@ onMounted(() => {
 });
 
 onActivated(() => {
-    // if(props.active == 1){
-    //     getStoreList();
-    // }
+    if(props.active == 1){
+        getStoreList();
+    }
 });
 
 const handleDetail = (item) => {

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

@@ -116,7 +116,7 @@
                         <div class="item-info">
                             <div class="item-top">
                                 <div class="left-img">
-                                    <img class="img-dom" 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="">
+                                    <img class="img-dom" src="https://birdseye-img-ali-cdn.sysuimars.com/16926861-1e20-4cbd-8bf2-90208db5a2d0/806080da-1a30-4b5b-b64b-b22e722c6cb6/DJI_202509010800_001_806080da-1a30-4b5b-b64b-b22e722c6cb6/DJI_20250901080536_0045_V_code-ws0fsmge97gh.jpeg?x-oss-process=image/resize,w_1000" alt="">
                                 </div>
                                 <div class="left-content">
                                     <div class="content-title">

+ 45 - 18
src/views/old_mini/modify_work/completedWork.vue

@@ -353,7 +353,7 @@
                 <div
                     class="fixed-btn"
                     v-if="detailData?.flowStatus == 0 && curRole == 0 && !query?.isAssign && !detailData?.isPublic"
-                    @click="handleOk"
+                    @click="handleUploadPhoto({ id: detailData.id })"
                 >
                     确认并完成
                 </div>
@@ -383,7 +383,7 @@
         </div>
     </div>
     <!-- 报价弹窗 -->
-    <offer-popup :showPopup="showPopup" :executionData="executionData"></offer-popup>
+    <!-- <offer-popup :showPopup="showPopup" :executionData="executionData"></offer-popup> -->
     <!-- 服务报价单 -->
     <price-sheet-popup ref="priceSheetPopupRef"></price-sheet-popup>
     <!-- 需求发送成功 -->
@@ -416,11 +416,14 @@
     <upload-execute ref="uploadExecuteRef" @uploadSuccess="handleUploadSuccess" :onlyShare="onlyShare" />
     <!-- 发起需求成功弹窗 -->
     <fn-share-sheet v-model:show="showDemandShare" @select="onDemandSelect" :options="demandOptions" />
+    
+    <!-- 上传照片弹窗 -->
+    <review-upload-popup :key="10" v-model="showUpload" :record-id="sectionId" @success="handleSelfDone" />
 </template>
 
 <script setup>
 import customHeader from "@/components/customHeader.vue";
-import { ref, computed, onActivated } from "vue";
+import { ref, computed, onActivated, onDeactivated } from "vue";
 // import NewFarmMap from "./newFarmMap";
 import { useStore } from "vuex";
 import { Popup } from "vant";
@@ -434,6 +437,7 @@ import { base_img_url2 } from "@/api/config";
 import { ElMessage } from "element-plus";
 import { formatArea } from "@/common/commonFun";
 import wx from "weixin-js-sdk";
+import reviewUploadPopup from "@/components/popup/reviewUploadPopup.vue";
 import FnShareSheet from "@/components/pageComponents/FnShareSheet.vue";
 
 const router = useRouter();
@@ -450,17 +454,36 @@ const curRole = ref(localStorage.getItem("SET_USER_CUR_ROLE"));
 
 // 0:执行, 1: 复核
 const status = ref(0);
-const showPopup = ref(false);
-const executionData = ref({});
 const uploadExecuteRef = ref(null);
 
-// 我已完成
-const handleOk = () => {
-    if (status.value === 0) {
-        showPopup.value = !showPopup.value;
-    } else {
-        // 立即复核
-    }
+const showUpload = ref(false);
+const sectionId = ref(null);
+// 上传照片处理函数
+const handleUploadPhoto = ({ id }) => {
+    showUpload.value = true;
+    sectionId.value = id;
+};
+
+onDeactivated(() => {
+    showUpload.value = false;
+    sectionId.value = null;
+});
+
+const handleSelfDone = () => {
+    VE_API.z_farm_work_record.updateFlowStatus({ id: query.value.id, targetFlowStatus: 5 }).then((res) => {
+        if (res.code === 0) {
+            showUpload.value = false;
+            sectionId.value = null;
+            setTimeout(() => {
+                router.replace({
+                    path: "/review_work",
+                    query: {
+                        json: JSON.stringify({ id: query.value.id, goBack: true }),
+                    },
+                });
+            }, 500)
+        }
+    });
 };
 
 const successText = ref("");
@@ -523,12 +546,16 @@ const handlePopupBtn = () => {
             getDetail(query.value.id);
             currentStep.value = 2;
         } else {
-            router.replace({
-                path: "/review_work",
-                query: {
-                    json: JSON.stringify({ id: query.value.id,goBack: true }),
-                },
-            });
+            showUpload.value = false;
+            sectionId.value = null;
+            setTimeout(() => {
+                router.replace({
+                    path: "/review_work",
+                    query: {
+                        json: JSON.stringify({ id: query.value.id,goBack: true }),
+                    },
+                });
+            }, 500)
         }
     }
 };