feige
2024-03-04 0947adf188a83eecf0a6a545cea25c97f7ce17f0
ruoyi-ui/src/views/device/memo.vue
@@ -86,7 +86,7 @@
//在system/note/index.js中导入接口函数  --接好了
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 {
      // 遮罩层
      // 遮罩层isEdit1: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();
                  });
        }
        }
      });