فهرست منبع

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

刘秀芳 2 روز پیش
والد
کامیت
1c93b96ecc

+ 3 - 1
src/components/chatWindow.vue

@@ -336,6 +336,7 @@ watch(
                     
                     if(params.type === 'quotation') {
                         message.cardType = 'quotation';
+                        message.title = params.farmWorkName + '已生成报价'
                         const jsonParams = {
                             id:params.id,
                             farmWorkOrderId:params.farmWorkOrderId,
@@ -351,11 +352,12 @@ watch(
                         }
                         if(params.type === 'remindExecute') {
                             message.title = '请您尽快执行 ' + params.farmWorkName + ' 农事';
+                            message.linkUrl = `/completed_work?json=${JSON.stringify(jsonParams)}`;
                         } else if(params.type === 'remindUser') {
                             message.title = '请您尽快完成复核';
+                            message.linkUrl = `/review_work?json=${JSON.stringify({id:params.id})}`;
                         }
                         message.cardType = params.type
-                        message.linkUrl = `/completed_work?json=${JSON.stringify(jsonParams)}`;
                     }
 
                     sendMessage(message);

+ 128 - 0
src/components/popup/reviewUploadPopup.vue

@@ -0,0 +1,128 @@
+<template>
+    <popup v-model:show="show" closeable :close-on-click-overlay="false" class="upload-popup" @closed="handleClosed">
+        <div class="upload-content">
+            <div class="upload-tips"><span class="required">*</span>请上传复核照片</div>
+            <upload exampleImg class="upload-wrap" @handleUpload="handleUpload">
+                <img class="example" src="@/assets/img/home/example-4.png" alt="" />
+                <img class="example" src="@/assets/img/home/plus.png" alt="" />
+            </upload>
+            <div class="upload-footer">
+                <div class="btn" @click="handleUploadConfirm">确认上传</div>
+            </div>
+        </div>
+    </popup>
+</template>
+
+<script setup>
+import { ref, watch } from "vue";
+import { Popup } from "vant";
+import upload from "@/components/upload";
+import { ElMessage } from "element-plus";
+import eventBus from "@/api/eventBus";
+
+const props = defineProps({
+    modelValue: {
+        type: Boolean,
+        default: false,
+    },
+    recordId: {
+        type: [String, Number],
+        default: null,
+    },
+});
+
+const emit = defineEmits(["update:modelValue", "success"]);
+
+const show = ref(false);
+const images = ref([]);
+
+watch(
+    () => props.modelValue,
+    (val) => {
+        show.value = val;
+        if (!val) {
+            images.value = [];
+        }
+    }
+);
+
+watch(show, (val) => {
+    emit("update:modelValue", val);
+});
+
+function handleUpload({ imgArr }) {
+    images.value = imgArr;
+}
+
+// 确认上传处理函数
+const handleUploadConfirm = () => {
+    if (images.value.length === 0) {
+        ElMessage.warning("请上传照片");
+        return;
+    }
+    const params = {
+        recordId: props.recordId,
+        executeEvidence: images.value,
+    };
+    VE_API.monitor.addReviewImg(params).then((res) => {
+        if (res.code === 0) {
+            ElMessage.success("上传成功");
+            show.value = false;
+            emit("success");
+        }
+    });
+};
+
+const handleClosed = () => {
+    eventBus.emit("upload:reset");
+};
+</script>
+
+<style lang="scss" scoped>
+.upload-popup {
+    width: 90%;
+    box-sizing: border-box;
+    padding: 20px 18px;
+    background: linear-gradient(0deg, #ffffff 70%, #d1ebff 100%);
+    border-radius: 10px;
+
+    .upload-content {
+        .upload-tips {
+            font-size: 16px;
+            font-weight: 500;
+            color: #000;
+            margin-bottom: 8px;
+            .required {
+                color: #ff4d4f;
+                margin-right: 4px;
+            }
+        }
+        .upload-wrap {
+            margin: 12px 0 24px;
+            .example {
+                width: 80px;
+                height: 80px;
+            }
+            .example + .example {
+                margin-left: 12px;
+            }
+        }
+        .upload-footer {
+            margin-top: 20px;
+            display: flex;
+            justify-content: center;
+
+            .btn {
+                width: 80%;
+                padding: 12px;
+                background: #2199f8;
+                border-radius: 25px;
+                color: #fff;
+                font-size: 16px;
+                text-align: center;
+            }
+        }
+    }
+}
+</style>
+

+ 1 - 1
src/components/recordItem.vue

@@ -5,7 +5,7 @@
             <div v-if="titleMode === 'default'" class="box-title">
                 <div class="title-l">
                     {{ recordItemData.farmWorkName }}
-                    <span class="parent-text"> {{ getFarmTypeText(recordItemData.type || recordItemData.farmWorkType) }} </span>
+                    <span class="parent-text" v-if="recordItemData.type || recordItemData.farmWorkType"> {{ getFarmTypeText(recordItemData.type || recordItemData.farmWorkType) }} </span>
                 </div>
                 <!-- 按钮样式 -->
                 <div v-if="titleRightText && titleRightType !== 'dot'" class="title-r title-r-button">

+ 13 - 1
src/views/old_mini/agri_services/components/farmDynamics.vue

@@ -3,6 +3,13 @@
         <tab-list v-model="activePlanIndex" :tabs="filterType" @change="handlePlanClick" />
         <div class="task-content">
             <div class="expert-content">
+                <empty
+                    v-if="contentData.length === 0"
+                    image="https://birdseye-img.sysuimars.com/birdseye-look-mini/custom-empty-image.png"
+                    image-size="80"
+                    description="暂无数据"
+                    class="empty-state"
+                />
                 <div v-for="(section, index) in contentData" :key="index" class="content-section">
                     <div class="section-id" :id="section.targetId"></div>
                     <record-item
@@ -58,7 +65,7 @@
 import { ref, onMounted } from "vue";
 import recordItem from "@/components/recordItem.vue";
 import tabList from "@/components/pageComponents/TabList.vue";
-import { Popup } from "vant";
+import { Popup ,Empty} from "vant";
 
 const showApplyPopup = ref(false);
 
@@ -122,6 +129,11 @@ const hasUploadedPhotos = (section) => {
             overflow: auto;
             padding: 10px;
             box-sizing: border-box;
+            .empty-state {
+                ::v-deep .van-empty {
+                    padding: 40px 0;
+                }
+            }
             .content-section {
                 position: relative;
                 .section-id {

+ 3 - 8
src/views/old_mini/modify_work/reviewWork.vue

@@ -80,14 +80,6 @@
             <div class="tabs-content-item">
                 <div class="common-card-title">
                     <img class="icon" src="@/assets/img/home/label-icon.png" alt="" />
-                    <span>执行照片</span>
-                </div>
-                <album-carousel class="execute-img" :key="1" labelText="执行照片" :images="workItem.executeEvidence"></album-carousel>
-            </div>
-
-            <div class="tabs-content-item">
-                <div class="common-card-title">
-                    <img class="icon" src="@/assets/img/home/label-icon.png" alt="" />
                     <span>复核成效</span>
                 </div>
                 <div class="info-box bottom-box">
@@ -106,6 +98,9 @@
                             <div class="img-list over-img-box">
                                 <album-carousel :key="1" labelText="农事前" :images="triggerImg"></album-carousel>
                             </div>
+                            <div class="img-list over-img-box">
+                                <album-carousel class="execute-img" :key="1" labelText="执行照片" :images="workItem.executeEvidence"></album-carousel>
+                            </div>
                             <div
                                 class="img-list over-img-box"
                                 v-if="workItem.reviewImage && workItem.reviewImage.length"

+ 20 - 5
src/views/old_mini/monitor/subPages/plan.vue

@@ -179,13 +179,13 @@ const addNewTask = () => {
     });
 };
 
-const triggerFarmWork = () =>{
+const triggerFarmWork = () => {
     eventBus.emit("activeUpload:show", {
         gardenIdVal: route.query.farmId,
         problemTitleVal: curFarmObj.value.farmWorkName,
         arrangeIdVal: curFarmObj.value.id,
     });
-}
+};
 
 const curFarmObj = ref({});
 const handleRowClick = (item) => {
@@ -463,6 +463,23 @@ const getArrangeStatusClass = (fw) => {
                         top: 50%;
                         transform: translateY(-50%);
                         z-index: 3;
+                        display: flex;
+                        flex-wrap: wrap;
+                        flex-direction: row;
+                        align-items: center;
+                        max-width: calc(100vw - 100px);
+                        gap: 16px;
+                        // position: absolute;
+                        // left: 48px;
+                        // top: 0;
+                        // bottom: 0;
+                        // display: flex;
+                        // flex-direction: row;
+                        // max-width: calc(100vw - 48px - 12px);
+                        // gap: 16px;
+                        // z-index: 3;
+                        // flex-wrap: wrap;
+                        // justify-content: center;
                         .arrange-box {
                             width: 36px;
                             height: 36px;
@@ -476,6 +493,7 @@ const getArrangeStatusClass = (fw) => {
                             box-sizing: border-box;
                             position: relative;
                             font-size: 12px;
+                            flex-shrink: 0;
                             .arrange-text {
                                 writing-mode: horizontal-tb;
                                 line-height: 14px;
@@ -501,9 +519,6 @@ const getArrangeStatusClass = (fw) => {
                                 border-right: 4px solid currentColor; /* 与文字/边框颜色一致 */
                             }
                         }
-                        .arrange-box + .arrange-box {
-                            margin-right: 16px;
-                        }
                         .arrange-box.status-warning {
                             border-color: #ff953d;
                             color: #ff953d;

+ 2 - 79
src/views/old_mini/monitor/subPages/reviewResults.vue

@@ -62,18 +62,7 @@
     </popup>
 
     <!-- 上传照片弹窗 -->
-    <popup v-model:show="showUpload" closeable :close-on-click-overlay="false" class="upload-popup">
-        <div class="upload-content">
-            <div class="upload-tips"><span class="required">*</span>请上传复核照片</div>
-            <upload exampleImg class="upload-wrap" @handleUpload="handleUpload">
-                <img class="example" src="@/assets/img/home/example-4.png" alt="" />
-                <img class="example" src="@/assets/img/home/plus.png" alt="" />
-            </upload>
-            <div class="upload-footer">
-                <div class="btn" @click="handleUploadConfirm">确认上传</div>
-            </div>
-        </div>
-    </popup>
+    <review-upload-popup v-model="showUpload" :record-id="sectionId" @success="resetAndLoad" />
 </template>
 <script setup>
 import { ref, onMounted } from "vue";
@@ -81,9 +70,8 @@ import recordItem from "@/components/recordItem.vue";
 import { Popup } from "vant";
 import customHeader from "@/components/customHeader.vue";
 import { useRouter, useRoute } from "vue-router";
-import upload from "@/components/upload";
 import { Empty,List } from "vant";
-import { ElMessage } from "element-plus";
+import reviewUploadPopup from "@/components/popup/reviewUploadPopup.vue";
 
 const showApplyPopup = ref(false);
 const showUpload = ref(false);
@@ -96,26 +84,6 @@ const handleUploadPhoto = ({id}) => {
     sectionId.value = id;
 };
 
-const images = ref([]);
-function handleUpload({imgArr}) {
-    images.value = imgArr;
-}
-
-// 确认上传处理函数
-const handleUploadConfirm = () => {
-    const params = {
-        recordId: sectionId.value,
-        executeEvidence: images.value,
-    };
-    VE_API.monitor.addReviewImg(params).then((res) => {
-        if (res.code === 0) {
-            ElMessage.success('上传成功');
-            showUpload.value = false;
-            resetAndLoad();
-        }
-    });
-};
-
 const handleApply = (section, index) => {
     // // 更新当前项的发起需求状态
     // showApplyPopup.value = true;
@@ -298,49 +266,4 @@ const handleClick = (section, index) => {
     }
 }
 
-.upload-popup {
-    width: 90%;
-    box-sizing: border-box;
-    padding: 20px 18px;
-    background: linear-gradient(0deg, #ffffff 70%, #d1ebff 100%);
-    border-radius: 10px;
-
-    .upload-content {
-        .upload-tips {
-            font-size: 16px;
-            font-weight: 500;
-            color: #000;
-            margin-bottom: 8px;
-            .required {
-                color: #ff4d4f;
-                margin-right: 4px;
-            }
-        }
-        .upload-wrap {
-            margin: 12px 0 24px;
-            .example {
-                width: 80px;
-                height: 80px;
-            }
-            .example + .example {
-                margin-left: 12px;
-            }
-        }
-        .upload-footer {
-            margin-top: 20px;
-            display: flex;
-            justify-content: center;
-
-            .btn {
-                width: 80%;
-                padding: 12px;
-                background: #2199f8;
-                border-radius: 25px;
-                color: #fff;
-                font-size: 16px;
-                text-align: center;
-            }
-        }
-    }
-}
 </style>