From 0947adf188a83eecf0a6a545cea25c97f7ce17f0 Mon Sep 17 00:00:00 2001
From: feige <791364011@qq.com>
Date: 星期一, 04 三月 2024 16:55:30 +0800
Subject: [PATCH] 修改了备忘录等内容

---
 ruoyi-ui/src/views/device/memo.vue |   81 ++++++++++++++++++++++++++--------------
 1 files changed, 52 insertions(+), 29 deletions(-)

diff --git a/ruoyi-ui/src/views/device/memo.vue b/ruoyi-ui/src/views/device/memo.vue
index 55e5714..d8081c5 100644
--- a/ruoyi-ui/src/views/device/memo.vue
+++ b/ruoyi-ui/src/views/device/memo.vue
@@ -86,7 +86,7 @@
 
 
 //鍦╯ystem/note/index.js涓鍏ユ帴鍙e嚱鏁�  --鎺ュソ浜�
-import {addNote,listNote,enload,delNote, uploadPic} from "@/api/allmemo/index";
+import {addNote,updateNote, listNote,enload,delNote, uploadPic} from "@/api/allmemo/index";
 import { TimeSelect } from "element-ui";
 
 export default {
@@ -94,7 +94,8 @@
   dicts: ['sys_normal_disable'],
   data() {
     return {
-      // 閬僵灞�
+      // 閬僵灞俰sEdit1:false,isEdit1:false,
+	  isEdit1:false,
       disabled: false,
       loading: true,
       formData:[],
@@ -309,14 +310,14 @@
     /** 淇敼鎸夐挳鎿嶄綔 */
     handleUpdate(row) {
       const id = row.id;
-      let jd = true
+  
 
-      this.$router.push({
-        path:"/self/travel/travelInfo/" + id,
-        query:{
-          detail:jd
-        }
-      });
+     this.isEdit1 = true;
+     this.formDat.cid = row.cid;
+     this.formDat.id = row.id;
+     this.formDat.happenTime = row.happenTime;
+     this.formDat.content = row.content;
+     this.open = true;
     },
 
 
@@ -328,31 +329,53 @@
     submitDataScope: function() {
       const cid = this.$route.params && this.$route.params.id;
       const fid =2017;
-      let ul = this.fileList.map(function (elem){
-        return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"")
-      }).join(",")
-      let uls = this.fileListOther.map(function (elem){
-        return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"")
-      }).join(",")
+      // let ul = this.fileList.map(function (elem){
+      //   return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"")
+      // }).join(",")
+      // let uls = this.fileListOther.map(function (elem){
+      //   return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"")
+      // }).join(",")
       this.formDat.fid = 2017;
       this.formDat.cid = cid ;
-      this.formDat.url = ul+","+uls
+      // this.formDat.url = ul+","+uls
 		let _this = this
       this.$refs["elForm"].validate(valid => {
         if (valid) {
-
-          addNote(this.formDat).then(response => {
-            this.$modal.msgSuccess("鏂板鎴愬姛");
-            this.open = false;
-            // this.queryParams.cid = cid
-     
-            this.getList(_this.formDat.fid,_this.formDat.cid);
-   //娓呯┖formDat瀵硅薄鐨勬暟鎹�
-      Object.keys(this.formDat).forEach(key => {
-        this.formDat[key] = '';
-      });
-            resetQuery();
-          });
+          if (this.isEdit1) {
+			  // 鎵ц淇敼鎿嶄綔
+			  updateNote(this.formDat).then(response => {
+			    console.log("1")
+			    this.$modal.msgSuccess("淇敼鎴愬姛");
+			    this.open = false;
+			    //娓呯┖formDat瀵硅薄鐨勬暟鎹�
+			    Object.keys(this.formDat).forEach(key => {
+			      this.formDat[key] = '';
+			    });
+			    this.isEdit1 = false;
+			    this.getList(2017,cid);
+			  }).catch(error => {
+			    console.log(error);
+			    this.isEdit1 = false;
+			    this.open = false;
+			  });
+			  
+			  
+  
+		  }
+		  else{
+			  addNote(this.formDat).then(response => {
+			           this.$modal.msgSuccess("鏂板鎴愬姛");
+			           this.open = false;
+			           // this.queryParams.cid = cid
+			    
+			           this.getList(_this.formDat.fid,_this.formDat.cid);
+			  //娓呯┖formDat瀵硅薄鐨勬暟鎹�
+			     Object.keys(this.formDat).forEach(key => {
+			       this.formDat[key] = '';
+			     });
+			      //     resetQuery();
+			         });
+		  }
         }
       });
    

--
Gitblit v1.9.1