Browse Source

fix: 农事详情

lxf 2 days ago
parent
commit
6eb6239433

+ 10 - 3
src/components/popup/tipPopup.vue

@@ -20,7 +20,7 @@
         <template v-else-if="type === 'success'">
             <img class="tip-icon success-icon" src="@/assets/img/home/right.png" alt="" />
             <slot name="default"></slot>
-            <div class="tip-text success-text" :class="{pmzd:font}">
+            <div class="tip-text success-text" :class="{pmzd:font, 'no-bottom': hideBtn}">
                 {{ text }} <span class="highlight-text">{{ highlightText }}</span>
                 <div class="text2">{{ text2 }}</div>
             </div>
@@ -29,7 +29,7 @@
             <img class="tip-icon success-icon" src="@/assets/img/home/create-farm-icon.png" alt="" />
             <div class="tip-text success-text">{{ text }} <span class="highlight-text">{{ highlightText }}</span> {{ text2 }}</div>
         </template>
-        <div class="tip-btn" @click.stop="handleBtnClick">
+        <div class="tip-btn" v-if="!hideBtn" @click.stop="handleBtnClick">
             {{ buttonText || (type === "create" ? "去创建农场" : "我知道了") }}
         </div>
     </popup>
@@ -93,7 +93,11 @@ const props = defineProps({
     font: {
         type:Boolean,
         default:false
-    }
+    },
+    hideBtn: {
+        type: Boolean,
+        default: false,
+    },
 });
 
 const emit = defineEmits(["update:show", "confirm", "handleClickOverlay", "closedPopup"]);
@@ -159,6 +163,9 @@ const handleClosed = () => {
         font-weight: 500;
         margin-bottom: 32px;
         text-align: center;
+        &.no-bottom {
+            margin-bottom: 6px;
+        }
         &.success-text {
             font-size: 20px;
             font-weight: 400;

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

@@ -141,7 +141,7 @@
             </div>
         </div>
 
-        <tip-popup v-model:show="showBindSuccess" type="success" text="您的农场已绑定成功" />
+        <tip-popup v-model:show="showBindSuccess" type="success" text="您的农场已绑定成功" hideBtn />
 
         <start-interact-popup ref="startInteractPopupRef" />
 

+ 21 - 6
src/views/old_mini/work_detail/components/executePopup.vue

@@ -44,6 +44,8 @@
             </div>
         </div>
     </popup>
+
+    <tipPopup v-model:show="showTipPopupValue" type="success" text="您已成功上传照片" hideBtn />
 </template>
 
 <script setup>
@@ -54,6 +56,7 @@ import { getFileExt } from "@/utils/util";
 import UploadFile from "@/utils/upliadFile";
 import { useStore } from "vuex";
 import { useRouter } from "vue-router";
+import tipPopup from "@/components/popup/tipPopup.vue";
 
 const store = useStore();
 const miniUserId = store.state.home.miniUserId;
@@ -68,13 +71,15 @@ const props = defineProps({
 
 const showValue = ref(false);
 const failImgs = ref(false);
-
+const showTipPopupValue = ref(false);
 const fileList = ref([]);
 const fileArr = ref([]);
 const executeTime = ref("");
 const serviceInput = ref("");
 const uploadFileObj = new UploadFile();
 
+const emit = defineEmits(['executeSuccess']);
+
 const afterRead = (file) => {
     // 处理多张照片的情况:file 可能是数组
     const files = Array.isArray(file) ? file : [file];
@@ -114,11 +119,19 @@ function closeTask() {
     }
     VE_API.report.addExecuteImgAndComplete(params).then((res) => {
         if (res.code === 0) {
-            ElMessage.success('操作成功')
-            setTimeout(() => {
+            if (isShare.value) {
                 showValue.value = false;
-                router.replace('/agri_record')
-            }, 800)
+                showTipPopupValue.value = true;
+                setTimeout(() => {
+                    emit('executeSuccess');
+                }, 800)
+            } else {
+                ElMessage.success('上传成功')
+                setTimeout(() => {
+                    showValue.value = false;
+                    router.replace('/agri_record')
+                }, 800)
+            }
         } else {
             ElMessage.error(res.msg)
         }
@@ -149,9 +162,11 @@ function handleRemind() {
 }
 
 const recordId = ref(null);
-function openPopup(id) {
+const isShare = ref(false);
+function openPopup(id, isHideDraw) {
     showValue.value = true;
     recordId.value = id;
+    isShare.value = isHideDraw;
 }
 
 defineExpose({

+ 10 - 12
src/views/old_mini/work_detail/index.vue

@@ -14,16 +14,16 @@
                         距离执行时间还差 {{ daysDiff }} 天
                     </div>
                     <div class="status-sub" v-if="!detail?.flowStatus || detail?.flowStatus === 0">
-                        预计触发时间 {{ detail?.activateTime ? formatDate(detail.activateTime) : "--" }}
+                        预计触发时间 {{ detail?.executeDate || "--" }}
                     </div>
                 </div>
             </div>
 
-            <div class="work-wrap">
+            <div class="work-wrap" :class="{ 'has-bottom': info?.appType === 2 || (info?.appType === 1 && detail?.flowStatus === 3) }">
                 <!-- 农事组信息 -->
-                <div class="box-wrap group-info group-box" v-if="detail?.executionLimitDays">
+                <div class="box-wrap group-info group-box" v-if="detail?.executionLimitDays && detail?.flowStatus !== 5">
                     <div class="group-name">
-                        该农事为 <span class="light-text">限时溯源农事</span> ,请在 <span class="light-text">{{detail?.executionLimitDays}}天内</span>
+                        该农事为 <span class="light-text">标准防治溯源农事</span> ,请在<span v-if="detail?.flowStatus !== 3">触发后</span> <span class="light-text">{{detail?.executionLimitDays}}天内</span>
                         完成溯源认证上传,如果逾期未认证,该农事将不可溯源认证,且不计入飞鸟有味平台
                     </div>
                 </div>
@@ -114,7 +114,7 @@
                     <!-- 农事凭证 -->
                     <div class="work-info photo-box" v-if="prescription.cropAlbum && prescription.cropAlbum.length">
                         <div class="photo-title">农事凭证</div>
-                        <div class="photo-sub-title" v-if="info?.appType === 1">来自于 某某某农资机构</div>
+                        <div class="photo-sub-title" v-if="info?.appType === 1">来自于 {{ detail?.executorOrganizationName || "--" }}</div>
                         <div class="photo-img-wrap">
                             <photo-provider :photo-closable="true">
                                 <photo-consumer v-for="(src, index) in prescription.cropAlbum" intro="农事凭证" :key="index"
@@ -141,9 +141,7 @@
                 </div>
             </div>
         </div>
-        <ExecutePopup ref="executePopupRef" />
-
-
+        <ExecutePopup ref="executePopupRef" @executeSuccess="getDetail" />
 
         <upload-tips v-model:show="showUploadTipsPopup" />
     </div>
@@ -196,7 +194,6 @@ const detail = ref({
     post: null,
     expertNameFromFarmBasicInfo: "",
     rangeWkt: null,
-    activateTime: null,
 });
 
 /** 凭证图片统一为 { filename } */
@@ -254,7 +251,6 @@ const getDetail = () => {
                 expertNameFromFarmBasicInfo:
                     data?.expertNameFromFarmBasicInfo ?? "",
                 rangeWkt: data?.rangeWkt ?? null,
-                activateTime: data?.activateTime ?? null,
             };
         });
 };
@@ -341,7 +337,7 @@ const handleTagType = (tagType) => {
 }
 
 const handleExecute = () => {
-    executePopupRef.value.openPopup(miniJson.value.recordId);
+    executePopupRef.value.openPopup(miniJson.value.recordId, miniJson.value.hideDraw);
 };
 
 
@@ -481,7 +477,9 @@ const changeExecutionMethod = (stageIndex, value) => {
     top: -16px;
     padding: 0 12px 12px;
     z-index: 2;
-    margin-bottom: 60px;
+    &.has-bottom {
+        margin-bottom: 60px;
+    }
 }
 
 .box-wrap {