Răsfoiți Sursa

修改服务人员

xuanyan 4 ani în urmă
părinte
comite
2eafc75195
1 a modificat fișierele cu 10 adăugiri și 2 ștergeri
  1. 10 2
      src/views/smartaccess/form/server.vue

+ 10 - 2
src/views/smartaccess/form/server.vue

@@ -17,6 +17,7 @@
   import {
     update,
     remove,
+    add,
     pushServerFace,
     deleteServerFace
   } from "@/api/estate/serveruser.js";
@@ -278,6 +279,7 @@
         this.dialogShow = true
       },
       showAddForm() {
+        debugger
         this.isAdd = true
         this.dialogShow = true
         this.option.detail = false
@@ -287,8 +289,14 @@
         }, 20)
       },
       async submit(form, done) {
-        let data = deepClone(form)
-        let res = await update(data)
+        //addOrUpdate 1——添加,2——更新
+        let data = form;
+        let res;
+        if (this.isAdd){
+          res = await add(data)
+        }else {
+          res = await update(data)
+        }
         done()
         if (res.data.success) {
           this.dialogShow = false;