瀏覽代碼

fix: 农事详情

刘秀芳 1 周之前
父節點
當前提交
0d388f77da

+ 42 - 6
src/components/popup/activeUploadPopup.vue

@@ -14,7 +14,12 @@
                 当前物候期
             </div>
             <div class="date-input">
-                <el-select popper-class="custom-select-dropdown" v-model="currentPhenologyId" size="large" placeholder="请选择当前物候期">
+                <el-select
+                    popper-class="custom-select-dropdown"
+                    v-model="currentPhenologyId"
+                    size="large"
+                    placeholder="请选择当前物候期"
+                >
                     <el-option
                         v-for="item in phenologyList"
                         :key="item.id"
@@ -48,13 +53,23 @@
                     请确认执行人
                 </div>
                 <div class="date-input">
-                    <el-select popper-class="custom-select-dropdown" size="large" v-model="executorId" placeholder="请选择执行人">
+                    <el-select
+                        popper-class="custom-select-dropdown"
+                        size="large"
+                        v-model="executorId"
+                        placeholder="请选择执行人"
+                    >
                         <el-option
                             v-for="(item, index) in executorList"
                             :key="index"
                             :label="item.name"
                             :value="item.miniUserId"
-                        />
+                        >
+                            <span>{{ item.name }}</span>
+                            <span class="role-text" :class="'role-' + item.role">
+                                {{ roleMap[item.role] }}
+                            </span>
+                        </el-option>
                     </el-select>
                 </div>
             </div>
@@ -82,7 +97,9 @@
                 </div>
             </div>
         </div>
-        <div class="tips-text img-desc" v-if="imgDesc"><span class="required" v-if="userInfoObj?.agriculturalRole !== 1">*</span>{{ imgDesc }}</div>
+        <div class="tips-text img-desc" v-if="imgDesc">
+            <span class="required" v-if="userInfoObj?.agriculturalRole !== 1">*</span>{{ imgDesc }}
+        </div>
         <div class="tips-text" v-else>上传照片,诊断更准确哦~</div>
         <upload :textShow="true" class="upload-wrap" exampleImg>
             <img class="example" src="@/assets/img/home/example-4.png" alt="" />
@@ -163,6 +180,11 @@ const executorList = ref([]);
 const executorId = ref(null);
 const needReview = ref(false);
 const reviewDay = ref(null);
+const roleMap = ref({
+    0: "超级管理员",
+    1: "项目莞荔园",
+    2: "普通成员",
+});
 // 选择当前物候期
 const currentPhenologyId = ref(null);
 const phenologyList = ref([]);
@@ -197,7 +219,7 @@ function handleShow({
     phenologyList.value = phenologyListVal;
     // 重置上传状态
     isUploading.value = false;
-    if(typeVal !== "question"){
+    if (typeVal !== "question") {
         // 如果没有报价信息,则跳转去完善报价信息
         VE_API.monitor.validatePesticideFertilizerQuotes({ id: farmWorkIdVal, schemeId: schemeIdVal }).then((res) => {
             if (res.data === false) {
@@ -215,7 +237,9 @@ function handleShow({
 
 const ids = ref({});
 function handleBtn() {
-    router.push(`/modify?farmWorkId=${ids.value.farmWorkId}&schemeId=${ids.value.schemeId}&farmId=${ids.value.farmId}&id=${ids.value.id}&onlyPrice=true&isEdit=true`);
+    router.push(
+        `/modify?farmWorkId=${ids.value.farmWorkId}&schemeId=${ids.value.schemeId}&farmId=${ids.value.farmId}&id=${ids.value.id}&onlyPrice=true&isEdit=true`
+    );
     showTipPopup.value = false;
 }
 
@@ -349,6 +373,18 @@ onUnmounted(() => {
                 }
             }
         }
+        .role-text {
+            color: #2199f8;
+            background-color: rgba(33, 153, 248, 0.1);
+            padding: 0 6px;
+            font-size: 13px;
+            margin-left: 6px;
+            border-radius: 3px;
+            &.role-3 {
+                color: #7d7d7d;
+                background: rgba(243, 243, 243, 0.5);
+            }
+        }
         .review-day-input {
             border: 1px solid #dcdcdc;
             border-radius: 3px;

+ 1 - 1
src/components/popup/tipPopup.vue

@@ -42,7 +42,7 @@ const props = defineProps({
     type: {
         type: String,
         default: "create",
-        validator: (value) => ["create", "success"].includes(value),
+        // validator: (value) => ["create", "success"].includes(value),
     },
     // 提示文字内容
     text: {

+ 1 - 1
src/views/old_mini/home/components/AgriculturalDynamics.vue

@@ -123,7 +123,7 @@ const updateAllData = () => {
 //农情互动的农场列表接口(分页)
 const getTaskList = async () => {
     const res = await VE_API.z_farm_work_record.getSimpleList({ role: 2, flowStatus: 4 });
-    taskList.value = res.data || [];
+    taskList.value = (res.data || []).slice(0, 2);
 };
 
 const unansweredList = ref([]);

+ 15 - 4
src/views/old_mini/modify_work/completedWork.vue

@@ -7,10 +7,21 @@
             </div> -->
             <div class="content-status">
                 <div class="status-l">
-                    <div class="stauts-text">{{ query.status === "warning" ? "已过期" : "待完成" }}</div>
-                    <div class="stauts-sub-text" v-if="detailData?.executeDeadlineDate">
+                    <div class="stauts-text">待完成</div>
+                    <div class="stauts-sub-text" v-if="detailData?.executeDeadlineDate && !detailData?.expectedExecuteDate">
                         截止到 <span class="time-text">{{ detailData?.executeDeadlineDate }}</span>
                     </div>
+                    <div class="stauts-sub-text" v-if="detailData?.expectedExecuteDate">
+                        <template v-if="daysDiff > 0">
+                            距离执行时间还剩 <span class="time-text">{{ daysDiff }} 天</span>
+                        </template>
+                        <template v-else-if="daysDiff === 0">
+                            触发时间为今天
+                        </template>
+                        <template v-else>
+                            触发时间已过
+                        </template>
+                    </div>
                 </div>
                 <!-- <template v-if="query.status !== 'warning'">
                     <div class="status-r" v-if="curRole == 0">{{ status === 0 ? "设置提醒" : "去评价" }}</div>
@@ -485,11 +496,11 @@ const detailData = ref({});
 
 // 计算距离执行时间的天数差
 const daysDiff = computed(() => {
-    if (!detailData.value?.executeDate) {
+    if (!detailData.value?.expectedExecuteDate) {
         return 0;
     }
 
-    const executeDate = new Date(detailData.value.executeDate);
+    const executeDate = new Date(detailData.value.expectedExecuteDate);
     const today = new Date();
 
     // 将时间设置为 00:00:00,只比较日期

+ 12 - 4
src/views/old_mini/modify_work/detailWork.vue

@@ -7,8 +7,16 @@
             >
                 <div class="status-l">
                     <div class="stauts-text">待触发</div>
-                    <div class="stauts-sub-text" v-if="detailData?.executeDeadlineDate">
-                        截止到 <span class="time-text">{{ detailData?.executeDeadlineDate }}</span>
+                    <div class="stauts-sub-text" v-if="arrangeDetail?.interactionTime">
+                        <template v-if="daysDiff > 0">
+                            距离触发还剩 <span class="time-text">{{ daysDiff }} 天</span>
+                        </template>
+                        <template v-else-if="daysDiff === 0">
+                            触发时间为今天
+                        </template>
+                        <template v-else>
+                            触发时间已过
+                        </template>
                     </div>
                 </div>
                 <!-- <template v-if="query.status !== 'warning'">
@@ -382,11 +390,11 @@ const detailData = ref({});
 
 // 计算距离执行时间的天数差
 const daysDiff = computed(() => {
-    if (!detailData.value?.executeDate) {
+    if (!arrangeDetail.value?.interactionTime) {
         return 0;
     }
     
-    const executeDate = new Date(detailData.value.executeDate);
+    const executeDate = new Date(arrangeDetail.value.interactionTime);
     const today = new Date();
     
     // 将时间设置为 00:00:00,只比较日期

+ 2 - 1
src/views/old_mini/user/farmDetails.vue

@@ -49,7 +49,7 @@
                                         <div class="timeline-line"></div>
                                     </div>
                                     <div class="timeline-right">
-                                        <div class="farm-work-card" :class="['card-' + getRecordTypeText(item.speakTitleName)]">
+                                        <div class="farm-work-card" :class="['card-' + getRecordTypeText(item.speakTitleName), , {'is-future': item.isFuture}]">
                                             <div class="type-box">{{ item.speakTitleName }}</div>
                                             <div class="farm-work-date" v-html="item.content.renderedContent"></div>
                                             <!-- <div class="farm-work-desc">
@@ -621,6 +621,7 @@ const onSelect = () => {
                             }
                         }
                         &.is-future {
+                            padding: 0 12px;
                             // opacity: 0.5;
                             background: rgba(246, 250, 255, 0.5);
                             .type-box {

+ 1 - 6
src/views/old_mini/user/index.vue

@@ -125,12 +125,7 @@ const dataList = ref([
 const getUserList = async () => {
     const { data } = await VE_API.farm.userFarmSelectOption({ agriculturalQuery: true });
     if (data.length) {
-        // 地图使用筛选后的数据
-        const wktArr = ["POINT (113.10930176274309 22.574540836684672)", "POINT (113.407189 23.032344)"]
-        data.map((item, index) => {
-            item.farmPoint = wktArr[Math.floor(Math.random() * wktArr.length)]
-        });
-        indexMap.initData(data, 'name','farmPoint');
+        indexMap.initData(data, 'name','point');
         // 清空现有的子项
         dataList.value[0].children = [];
         dataList.value[1].children = data || [];