Browse Source

fix: 农资流程

刘秀芳 2 tuần trước cách đây
mục cha
commit
557b8d5ad5

+ 16 - 3
src/views/old_mini/modify_work/index.vue

@@ -388,7 +388,7 @@
                 </div>
                 <div class="submit-btn" v-if="!isAdd && !isEdit">
                     <div class="btn second" @click="handleIgnore">忽略</div>
-                    <div class="btn" @click.prevent="submitForm(formRef)">下发农事</div>
+                    <div class="btn" @click.prevent="submitForm(formRef)">确认并报价</div>
                 </div>
                 <div class="submit-btn" v-if="isAdd && farmProgress === 0">
                     <div class="btn second">取消</div>
@@ -414,6 +414,10 @@
         </template>
         <div class="create-farm-btn" @click="handlePopupBtn">{{ taskPopupType === 'warning' ? '确认忽略' : '我知道了' }}</div>
     </popup>
+
+    
+    <!-- 服务报价单 -->
+    <price-sheet-popup ref="priceSheetPopupRef"></price-sheet-popup>
 </template>
 
 <script setup>
@@ -427,6 +431,7 @@ import { Popup } from "vant";
 import farmSteps from "@/components/farmSteps.vue";
 import { base_img_url2 } from "@/api/config";
 import { formatArea } from "@/common/commonFun";
+import priceSheetPopup from "@/components/popup/priceSheetPopup.vue";
 import dayjs from "dayjs";
 const store = useStore();
 const router = useRouter();
@@ -493,6 +498,12 @@ const getTriggerImg = async (id) => {
     triggerImg.value = data || [];
 }
 
+
+const priceSheetPopupRef = ref(null);
+const showPriceSheetPopup = () => {
+    priceSheetPopupRef.value.handleShowPopup(detailData.value);
+};
+
 const detailData = ref({});
 const getDetail = (id) => {
     VE_API.z_farm_work_record.getDetail({ id }).then(({ data }) => {
@@ -886,8 +897,10 @@ const submit = () => {
     };
     VE_API.z_farm_work_record.issueFarmWorkRecord(data).then((res) => {
         if (res.code === 0) {
-            taskPopupType.value = 'success';
-            showTaskPopup.value = true;
+            // taskPopupType.value = 'success';
+            // showTaskPopup.value = true;
+            
+            showPriceSheetPopup()
         }
     })
     // 新增农事

+ 18 - 27
src/views/old_mini/task_condition/components/task.vue

@@ -11,9 +11,9 @@
                 <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)">
+                <!-- <div class="filter-item" :class="{ active: activeIndex === 1 }" @click="handleActiveFilter(1)">
                     已确认({{ taskCounts[1] || 0 }})
-                </div>
+                </div> -->
                 <div class="filter-item" :class="{ active: activeIndex === 2 }" @click="handleActiveFilter(2)">
                     待完成({{ taskCounts[2] || 0 }})
                 </div>
@@ -58,8 +58,8 @@
                                     <div v-if="activeIndex === 0" class="btn second" @click="handleAction(item)">
                                         忽略
                                     </div>
-                                    <div class="btn primary" @click="toPage(item)">
-                                        {{ activeIndex === 0 ? "下发农事" : "请求确认" }}
+                                    <div class="btn primary" @click="showPriceSheetPopup(item)">
+                                        {{ activeIndex === 0 ? "确认并报价" : "请求确认" }}
                                     </div>
                                 </div>
                             </div>
@@ -387,29 +387,20 @@ function handleActiveFilter(i) {
 
 function toPage(item) {
     // router.push("/servicZes_agri")
-    if (activeIndex.value === 2) {
-        if (item?.executeEvidence?.length) {
-            onlyShare.value = true;
-        } else {
-            onlyShare.value = false;
-        }
-        setTimeout(() => {
-            uploadExecuteRef.value.showPopup({ ...item, type: "confirmExecute" }, "share-sheet");
-        }, 10);
-    } 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();
-            }
-        });
-        // router.push("/service_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();
+    //         }
+    //     });
+    // }
 }
 
 function toDetail(item) {