lxf 14 часов назад
Родитель
Сommit
6dde33483e

+ 12 - 1
src/views/old_mini/agri_record/index.vue

@@ -14,7 +14,13 @@
                     <div class="add-variety-btn" v-if="varietyTabs.length > 0" @click="handleAddVariety">
                         <span>分区管理</span>
                     </div>
-                    <el-date-picker style="width: 110px" v-model="date" type="year" placeholder="全部日期" />
+                    <el-date-picker
+                        style="width: 110px"
+                        v-model="date"
+                        type="year"
+                        placeholder="全部日期"
+                        :disabled-date="disabledYearDate"
+                    />
                 </div>
             </div>
             <!-- 品种选择 -->
@@ -157,6 +163,11 @@ const handleGoSelectRegion = () => {
 
 const showFarmPopup = ref(false); // 农场领取成功弹窗
 const date = ref(new Date());
+const disabledYearDate = (time) => {
+    const year = time.getFullYear();
+    const currentYear = new Date().getFullYear();
+    return year !== currentYear && year !== currentYear - 1;
+};
 
 const defaultGardenId = ref(null);
 const isHeaderShow = ref(false);

+ 12 - 1
src/views/old_mini/monitor/index.vue

@@ -14,7 +14,13 @@
                     <div class="add-variety-btn" v-if="varietyTabs.length > 0" @click="handleAddVariety">
                         <span>分区管理</span>
                     </div>
-                    <el-date-picker style="width: 110px" v-model="date" type="year" placeholder="全部日期" />
+                    <el-date-picker
+                        style="width: 110px"
+                        v-model="date"
+                        type="year"
+                        placeholder="全部日期"
+                        :disabled-date="disabledYearDate"
+                    />
                 </div>
             </div>
             <!-- 品种选择 -->
@@ -139,6 +145,11 @@ const handleVarietyClick = (tab, index) => {
 };
 
 const date = ref(new Date());
+const disabledYearDate = (time) => {
+    const year = time.getFullYear();
+    const currentYear = new Date().getFullYear();
+    return year !== currentYear && year !== currentYear - 1;
+};
 
 const showSelectRegionPopup = ref(false);
 

+ 1 - 2
src/views/old_mini/work_detail/components/executePopup.vue

@@ -14,7 +14,7 @@
             <div class="upload-wrap" :class="{ 'upload-cont': fileList.length }">
                 <div class="name">农事凭证</div>
                 <div class="sub-name">请上传农事执行现场照片及所用药肥凭证照片</div>
-                <div class="tips-text" v-if="failImgs">由于系统审核,您照片拍摄位置与农场相差超 3 公里,请在农场现场使用水印相机重新拍摄上传,谢谢配合</div>
+                
                 <uploader class="uploader" v-model="fileList" multiple :max-count="5" :after-read="afterRead"
                     @click="handleClick('rg')">
                     <img class="img" v-show="!fileList.length" src="@/assets/img/home/example-4.png" alt="" />
@@ -68,7 +68,6 @@ const props = defineProps({
 });
 
 const showValue = ref(false);
-const failImgs = ref(false);
 const fileList = ref([]);
 const fileArr = ref([]);
 const executeTime = ref("");

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

@@ -4,13 +4,13 @@
 
         <div class="work-detail-content">
             <!-- 顶部状态 -->
-            <div class="content-status" :class="'status-' + detail?.flowStatus">
+            <div class="content-status" :class="['status-' + detail?.flowStatus, 'audit-' + getAuditStatusPriority(detail?.executeEvidenceAuditStatus)]">
                 <div class="status-l">
                     <div class="status-title">{{ handleTagType(detail?.flowStatus) }}</div>
                     <div class="status-sub" v-if="triggerDateText && (detail?.flowStatus == -1 || detail?.flowStatus == -2)">
                         执行时间已经过去 {{ Math.abs(daysDiff) }} 天了
                     </div>
-                    <div class="status-sub" v-if="detail?.flowStatus === 3">
+                    <div class="status-sub" v-if="detail?.flowStatus === 3 && getAuditStatusPriority(detail?.executeEvidenceAuditStatus) !== 2">
                         <template v-if="daysDiff > 0">
                             距离执行时间还差 {{ Math.abs(daysDiff) }} 天
                         </template>
@@ -122,6 +122,7 @@
                     <!-- 农事凭证 -->
                     <div class="work-info photo-box" v-if="prescription.cropAlbum && prescription.cropAlbum.length">
                         <div class="photo-title">农事凭证</div>
+                        <div class="tips-text" >由于系统审核,您照片拍摄位置与农场相差超 3 公里,请在农场现场使用水印相机重新拍摄上传,谢谢配合</div>
                         <div class="photo-sub-title" v-if="info?.appType === 1">来自于 {{ detail?.executorOrganizationName || "--" }}</div>
                         <div class="photo-img-wrap">
                             <photo-provider :photo-closable="true">
@@ -129,6 +130,10 @@
                                     :src="base_img_url2 + src.filename">
                                     <div class="photo-img">
                                         <img :src="base_img_url2 + src.filename" />
+                                        <div class="fail-icon" v-if="failIndex(index) === 2">
+                                            <el-icon size="24" color="#FF953D"><WarningFilled /></el-icon>
+                                            <div class="fail-icon-text">审核失败</div>
+                                        </div>
                                     </div>
                                 </photo-consumer>
                             </photo-provider>
@@ -367,11 +372,41 @@ const handleTagType = (tagType) => {
     if (tagType == 0) return "待触发";
     if (tagType == -1) return "已过期";
     if (tagType == -2) return "已过期";
-    if (tagType == 3) return "待认证";
-    if (tagType == 5) return "已完成";
+    if (tagType == 3) {
+        const status = getAuditStatusPriority(detail.value?.executeEvidenceAuditStatus);
+        if (status === 2) {
+            return "审核失败";
+        }
+        return "待认证"
+    }
+    if (tagType == 5) {
+        const status = getAuditStatusPriority(detail.value?.executeEvidenceAuditStatus);
+        if (status === 2) {
+            return "审核失败";
+        }
+        if (status === 0) {
+            return "审核中";
+        }
+        return "已完成";
+    }
     return "待触发"
 }
 
+// 审核状态优先级:2 > 0 > 1
+const getAuditStatusPriority = (auditStatusList) => {
+    if (!Array.isArray(auditStatusList) || !auditStatusList.length) return 1;
+    const normalized = auditStatusList.map((x) => Number(x)).filter((x) => [0, 1, 2].includes(x));
+    if (!normalized.length) return 1;
+    if (normalized.includes(2)) return 2;
+    if (normalized.includes(0)) return 0;
+    return 1;
+};
+
+// 审核是否失败
+const failIndex = (index) => {
+    return detail.value?.executeEvidenceAuditStatus[index]
+}
+
 const handleExecute = () => {
     // const today = new Date();
     // const executeDate = new Date(detail.value.executeDate);
@@ -497,12 +532,24 @@ const changeExecutionMethod = (stageIndex, value) => {
         }
     }
 
-    &.status-3 {
+    &.status-5 {
+        padding-top: 30px;
+
+        &::after {
+            background: #2199F8;
+        }
+    }
+
+    &.status-3, &.audit-2, &.audit-0 {
         &::after {
             background: #FF953D;
         }
     }
 
+    &.audit-2 {
+        padding-top: 30px;
+    }
+
     &.status--1 {
         &::after {
             background: #FF4F4F;
@@ -514,14 +561,6 @@ const changeExecutionMethod = (stageIndex, value) => {
         }
     }
 
-    &.status-5 {
-        padding-top: 30px;
-
-        &::after {
-            background: #2199F8;
-        }
-    }
-
     .status-l {
         .status-title {
             font-size: 22px;
@@ -561,6 +600,15 @@ const changeExecutionMethod = (stageIndex, value) => {
         padding: 11px 10px;
         font-size: 14px;
 
+        .tips-text {
+            color: #FA7406;
+            padding: 5px 10px;
+            border: 1px solid #FF953D;
+            border-radius: 5px;
+            margin-bottom: 10px;
+            background: #fff;
+        }
+
         .photo-title {
             color: #000;
             padding-bottom: 9px;
@@ -807,6 +855,25 @@ const changeExecutionMethod = (stageIndex, value) => {
         border-radius: 8px;
         overflow: hidden;
 
+        .fail-icon {
+            position: absolute;
+            top: 0;
+            left: 0;
+            width: 100%;
+            height: 100%;
+            background: rgba(0, 0, 0, 0.6);
+            border-radius: 8px;
+            display: flex;
+            align-items: center;
+            justify-content: center;
+            flex-direction: column;
+            gap: 4px;
+            .fail-icon-text {
+                color: #FF943D;
+                font-size: 12px;
+            }
+        }
+
         img {
             width: 100%;
             height: 100%;