فهرست منبع

用户管理左侧映射

zhangh 2 سال پیش
والد
کامیت
892aa67273
2فایلهای تغییر یافته به همراه17 افزوده شده و 19 حذف شده
  1. 14 17
      src/views/system/user.vue
  2. 3 2
      vue.config.js

+ 14 - 17
src/views/system/user.vue

@@ -888,12 +888,7 @@ export default {
       this.fromss.contractId = ''
       this.fromss.roleIds = ''  //合同段Id
       this.contractData = []       //合同段枚举
-      // this.addData
       this.$refs.crud.rowAdd()
-      if (this.addData.tenantId) {
-        // this.form.push(...this.addData)
-      }
-
     },
     addProject (type) {//确定添加参建项目
       if (type == 'add') {
@@ -1085,8 +1080,8 @@ export default {
     //#region 甘云杰
     nodeClick (data) {
       this.addData = {
-        tenantId: data.id,
-        deptId: data.tenantId
+        tenantId: data.tenantId,
+        deptId: data.id
       }
       this.treeDeptId = data.id;
       this.page.currentPage = 1;
@@ -1123,9 +1118,8 @@ export default {
     },
     rowSave (row, done, loading) { //新增保存
       row.deptId = row.deptId.join(",");
-      // row.roleId = row.roleId.join(",");
-      // row.postId = row.postId.join(",");
-      console.log(row);
+      row.roleId = row.roleId.join(",");
+      row.postId = row.postId.join(",");
       add({ ...row, projectAndUserList: this.fromss.projectAndUserList }).then(() => {
         this.initFlag = false;
         this.onLoad(this.page);
@@ -1138,14 +1132,13 @@ export default {
         loading();
       });
     },
+
+
     rowUpdate (row, index, done, loading) {//修改按钮
-      let form = JSON.parse(JSON.stringify(row));
-      form.deptId = form.deptId.join(",");
-      // form.roleId = form.roleId.join(",");
-      form.postId = form.postId.join(",");
-      delete form.roleId;
-      delete form.projectAndUserList;
-      update({ ...form /*, projectAndUserList: this.fromss.projectAndUserList*/ }).then(() => {
+      row.deptId = row.deptId.join(",");
+      row.roleId = row.roleId.join(",");
+      row.postId = row.postId.join(",");
+      update({ ...row, projectAndUserList: this.fromss.projectAndUserList }).then(() => {
         this.initFlag = false;
         this.onLoad(this.page);
         this.$message({
@@ -1313,7 +1306,11 @@ export default {
             this.form.postId = this.form.postId.split(",");
           }
         });
+      } else {
+        this.form.tenantId = this.addData.tenantId
+        this.form.deptId = this.addData.deptId
       }
+
       this.initFlag = true;
       done();
     },

+ 3 - 2
vue.config.js

@@ -26,7 +26,8 @@ module.exports = {
         proxy: {
             '/api': {
                 //本地服务接口地址
-                target: 'http://localhost',
+                // target: 'http://localhost',
+                target: 'http://192.168.3.76',
                 //远程演示服务地址,可用于直接启动项目
                 //target: 'https://saber.bladex.vip/api',
                 ws: true,
@@ -36,4 +37,4 @@ module.exports = {
             }
         }
     }
-};
+};