2 Commits 62cb0bc5dd ... 052e8c02f6

Author SHA1 Message Date
  lxf 052e8c02f6 Merge branch 'farmer' of http://www.sysuimars.cn:3000/feiniao/feiniao-farm-h5 into farmer 2 days ago
  lxf da1d4351f7 fix: 溯源弹窗 2 days ago

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

@@ -45,7 +45,6 @@
         </div>
     </popup>
 
-    <tipPopup v-model:show="showTipPopupValue" type="success" text="您已成功上传照片" hideBtn />
 </template>
 
 <script setup>
@@ -56,7 +55,6 @@ 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;
@@ -71,7 +69,6 @@ const props = defineProps({
 
 const showValue = ref(false);
 const failImgs = ref(false);
-const showTipPopupValue = ref(false);
 const fileList = ref([]);
 const fileArr = ref([]);
 const executeTime = ref("");
@@ -119,19 +116,11 @@ function closeTask() {
     }
     VE_API.report.addExecuteImgAndComplete(params).then((res) => {
         if (res.code === 0) {
-            if (isShare.value) {
-                showValue.value = false;
-                showTipPopupValue.value = true;
-                setTimeout(() => {
-                    emit('executeSuccess');
-                }, 800)
-            } else {
-                ElMessage.success('上传成功')
-                setTimeout(() => {
-                    showValue.value = false;
-                    router.replace('/agri_record')
-                }, 800)
-            }
+            ElMessage.success('上传成功')
+            showValue.value = false;
+            setTimeout(() => {
+                emit('executeSuccess');
+            }, 800)
         } else {
             ElMessage.error(res.msg)
         }
@@ -162,11 +151,9 @@ function handleRemind() {
 }
 
 const recordId = ref(null);
-const isShare = ref(false);
-function openPopup(id, isHideDraw) {
+function openPopup(id) {
     showValue.value = true;
     recordId.value = id;
-    isShare.value = isHideDraw;
 }
 
 defineExpose({

+ 13 - 3
src/views/old_mini/work_detail/index.vue

@@ -135,8 +135,8 @@
                     </div>
                 </div>
 
-                <div class="fixed-btn-wrap execute-action" v-if="info?.appType === 1 && detail?.flowStatus === 3">
-                    <div class="action-item second" @click="handleConvert">转发农事</div>
+                <div class="fixed-btn-wrap execute-action" :class="{ 'no-share': miniJson?.hideDraw }" v-if="info?.appType === 1 && detail?.flowStatus === 3">
+                    <div class="action-item second" v-if="!miniJson?.hideDraw" @click="handleConvert">转发农事</div>
                     <div class="action-item primary" @click="handleExecute">溯源认证</div>
                 </div>
             </div>
@@ -152,6 +152,7 @@
 </template>
 
 <script setup>
+import { ElMessage } from "element-plus";
 import wx from "weixin-js-sdk";
 import customHeader from "@/components/customHeader.vue";
 import { ref, computed, onMounted, onActivated } from "vue";
@@ -337,7 +338,13 @@ const handleTagType = (tagType) => {
 }
 
 const handleExecute = () => {
-    executePopupRef.value.openPopup(miniJson.value.recordId, miniJson.value.hideDraw);
+    const today = new Date();
+    const executeDate = new Date(detail.value.executeDate);
+    if (executeDate.getTime() > today.getTime()) {
+        ElMessage.warning('未到农事执行时间,无法溯源认证');
+        return;
+    }
+    executePopupRef.value.openPopup(miniJson.value.recordId);
 };
 
 
@@ -781,6 +788,9 @@ const changeExecutionMethod = (stageIndex, value) => {
             color: #ffffff;
         }
     }
+    &.no-share {
+        justify-content: center;
+    }
 }
 
 .fixed-btn-wrap {