Parcourir la source

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

lxf il y a 3 jours
Parent
commit
e232b83797

+ 19 - 3
src/views/old_mini/modify_work/completedWork.vue

@@ -1,6 +1,6 @@
 <template>
     <div class="completed-work">
-        <custom-header name="农事详情" :isClose="showBack" :showClose="false"></custom-header>
+        <custom-header name="农事详情" isGoBack @goback="handleClose"></custom-header>
         <div class="work-content">
             <!-- <div class="step-wrap" v-show="query.status !== 'warning'">
                 <farm-steps :currentStep="currentStep" />
@@ -441,7 +441,13 @@ const onConfirmExecuteTime = (date) => {
         .updateExpectedExecuteDate({ recordId: query.value.id, expectedExecuteDate: formatDate(date) })
         .then((res) => {
             if (res.code === 0) {
-                getDetail(query.value.id);
+                if(showBack.value){
+                    router.replace({
+                        path: "/task_condition",
+                    });
+                }else{
+                    getDetail(query.value.id);
+                }
             }
         });
 };
@@ -461,11 +467,21 @@ const toList = (val) => {
     return JSON.parse(val);
 };
 
+const handleClose = () => {
+    if(showBack.value){
+        router.replace({
+            path: "/task_condition",
+        });
+    }else{
+        router.back();
+    }
+};
+
 const speciesList = computed(() => toList(quotationData.value.serviceSpecies));
 const equipmentList = computed(() => toList(quotationData.value.serviceEquipment));
-const showBack = ref(false);
 const agriculturalRole = ref(null);
 const userId = ref(null);
+const showBack = ref(false);
 onActivated(async () => {
     //
     const userInfo = JSON.parse(localStorage.getItem("localUserInfo"));

+ 13 - 1
src/views/old_mini/modify_work/reviewWork.vue

@@ -1,6 +1,6 @@
 <template>
     <div class="work-wrap">
-        <custom-header name="农事详情" :isClose="paramsPage.goBack ? false : true"></custom-header>
+        <custom-header name="农事详情" isGoBack @goback="handleClose"></custom-header>
         <div
             class="work-content recheck-title"
             :class="{ 'no-bottom': curRole == '0' && (!workItem.reviewImage || !workItem.reviewImage.length) }"
@@ -374,6 +374,8 @@ onActivated(() => {
     if(paramsPage.value.paramsPage) {
         const data = JSON.parse(paramsPage.value.paramsPage);
         paramsPage.value.id = data.id;
+        paramsPage.value.goBack = true;
+    }else{
         paramsPage.value.goBack = false;
     }
     getDetail();
@@ -397,6 +399,16 @@ const getDetail = () => {
         });
 };
 
+const handleClose = () => {
+    if(paramsPage.value.goBack){
+        router.replace({
+            path: "/task_condition",
+        });
+    }else{
+        router.back();
+    }
+};
+
 const triggerImg = ref([]);
 const getTriggerImg = (farmWorkRecordId) => {
     VE_API.z_farm_work_record.getTriggerImg({ farmWorkRecordId }).then(({ data }) => {