Sfoglia il codice sorgente

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

刘秀芳 2 giorni fa
parent
commit
fcb44815bf

+ 5 - 3
src/views/old_mini/home/subPages/warningDetail.vue

@@ -43,7 +43,9 @@
                     </template>
                 </div>
                 <div v-else class="box-bottom" :style="{ justifyContent: !isLink ? 'center' : 'flex-end' }">
-                    <div class="edit-btn" v-if="!isLink" @click="handleEditQuestion">编辑问题</div>
+                    <template v-if="!isLink"> 
+                        <div v-has-permission="'农事规划'" class="edit-btn" @click="handleEditQuestion">编辑问题</div>
+                    </template>
                     <template v-else>
                         <div class="edit-btn" @click="handleAnswerClick(0)">否</div>
                         <div class="edit-btn primary-btn" @click="handleAnswerClick(1)">是</div>
@@ -110,7 +112,7 @@
 
 <script setup>
 import customHeader from "@/components/customHeader.vue";
-import { ref, onActivated } from "vue";
+import { ref, onActivated, computed } from "vue";
 import { base_img_url2, resize_300 } from "@/api/config";
 import FnShareSheet from "@/components/pageComponents/FnShareSheet.vue";
 import activeUploadPopup from "@/components/popup/activeUploadPopup.vue";
@@ -442,7 +444,6 @@ const handleEditQuestion = () => {
                 display: flex;
                 justify-content: flex-end;
                 gap: 10px;
-                margin-top: 10px;
                 .edit-btn {
                     padding: 7px 20px;
                     background: rgba(33, 153, 248, 0.1);
@@ -450,6 +451,7 @@ const handleEditQuestion = () => {
                     border-radius: 25px;
                     font-size: 12px;
                     text-align: center;
+                    margin-top: 10px;
                     &.primary-btn {
                         background: #2199f8;
                         color: #fff;

+ 13 - 17
src/views/old_mini/modify_work/completedWork.vue

@@ -324,7 +324,7 @@ onDeactivated(() => {
 });
 
 const handleSelfDone = () => {
-    VE_API.z_farm_work_record.updateFlowStatus({ id: query.value.id, targetFlowStatus: 5 }).then((res) => {
+    VE_API.z_farm_work_record.updateFlowStatus({ id: queryRecordId.value, targetFlowStatus: 5 }).then((res) => {
         if (res.code === 0) {
             showUpload.value = false;
             sectionId.value = null;
@@ -332,7 +332,7 @@ const handleSelfDone = () => {
                 router.replace({
                     path: "/review_work",
                     query: {
-                        miniJson: JSON.stringify({ id: query.value.id, goBack: true }),
+                        miniJson: JSON.stringify({ id: queryRecordId.value, goBack: true }),
                     },
                 });
             }, 500);
@@ -348,14 +348,14 @@ const handlePopupBtn = () => {
     showTaskPopup.value = false;
     if (taskPopupType.value === "warning") {
         // 取消发起
-        VE_API.z_farm_work_record.updatePublicStatus({ recordId: query.value.id, isPublic: 0 }).then((res) => {
+        VE_API.z_farm_work_record.updatePublicStatus({ recordId: queryRecordId.value, isPublic: 0 }).then((res) => {
             if (res.code === 0) {
-                getDetail(query.value.id);
+                getDetail(queryRecordId.value);
             }
         });
     } else if (taskPopupType.value === "warningIgnore") {
         // 确认忽略
-        VE_API.z_farm_work_record.ignoreFarmWorkRecord({ farmWorkRecordId: query.value.id }).then((res) => {
+        VE_API.z_farm_work_record.ignoreFarmWorkRecord({ farmWorkRecordId: queryRecordId.value }).then((res) => {
             if (res.code === 0) {
                 ElMessage.success("操作成功");
                 router.back();
@@ -363,7 +363,7 @@ const handlePopupBtn = () => {
         });
     } else {
         if (taskPopupActionType.value === 0) {
-            getDetail(query.value.id);
+            getDetail(queryRecordId.value);
         } else {
             showUpload.value = false;
             sectionId.value = null;
@@ -371,7 +371,7 @@ const handlePopupBtn = () => {
                 router.replace({
                     path: "/review_work",
                     query: {
-                        miniJson: JSON.stringify({ id: query.value.id, goBack: true }),
+                        miniJson: JSON.stringify({ id: queryRecordId.value, goBack: true }),
                     },
                 });
             }, 500);
@@ -438,17 +438,11 @@ const handleRemindExecuteTime = () => {
 const onConfirmExecuteTime = (date) => {
     showCalendar.value = false;
     VE_API.z_farm_work_record
-        .updateExpectedExecuteDate({ recordId: query.value.id, expectedExecuteDate: formatDate(date) })
+        .updateExpectedExecuteDate({ recordId: queryRecordId.value, expectedExecuteDate: formatDate(date) })
         .then((res) => {
             if (res.code === 0) {
-                if(showBack.value){
-                    router.replace({
-                        path: "/task_condition",
-                    });
-                }else{
-                    ElMessage.success("操作成功");
-                    getDetail(query.value.id);
-                }
+                ElMessage.success("操作成功");
+                getDetail(queryRecordId.value);
             }
         });
 };
@@ -458,7 +452,7 @@ const handleUploadSuccess = () => {
         isGoBack.value = false;
         router.back();
     } else {
-        getDetail(query.value.id);
+        getDetail(queryRecordId.value);
     }
 };
 
@@ -483,6 +477,7 @@ const equipmentList = computed(() => toList(quotationData.value.serviceEquipment
 const agriculturalRole = ref(null);
 const userId = ref(null);
 const showBack = ref(false);
+const queryRecordId = ref(null);
 onActivated(async () => {
     //
     const userInfo = JSON.parse(localStorage.getItem("localUserInfo"));
@@ -499,6 +494,7 @@ onActivated(async () => {
         id = data?.id;
         showBack.value = true;
     }
+    queryRecordId.value = id;
     if (id) {
         await getDetail(id);
 

+ 1 - 1
src/views/old_mini/monitor/subPages/plan.vue

@@ -260,7 +260,7 @@ const getListMySchemes = (type = "auto") => {
             if (type === "right") {
                 active.value = data[data.length - 1].id;
             } else if (type === "left") {
-                active.value = data[0].id;
+                active.value = data[0]?.id;
             } else {
                 if(currentTab.value) {
                     currentTab.value = data.filter((item) => item.id === currentTab.value?.id)?.[0];