Bladeren bron

fix:修改链接发给客户操作失败问题

wangsisi 2 dagen geleden
bovenliggende
commit
7c5cf5e31d
1 gewijzigde bestanden met toevoegingen van 13 en 17 verwijderingen
  1. 13 17
      src/views/old_mini/modify_work/completedWork.vue

+ 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);