Parcourir la source

deptId 修改

tangning il y a 3 ans
Parent
commit
0b6f4975b7
1 fichiers modifiés avec 6 ajouts et 1 suppressions
  1. 6 1
      src/view/user/index.vue

+ 6 - 1
src/view/user/index.vue

@@ -125,7 +125,8 @@
         <el-form-item label="所属架构:"  v-if="user.roleKey !== 'admin-ordinary'">
           <el-cascader
             style="width: 100%"
-            v-model="newData.deptId"
+            v-model="deptIdList"
+            @change="changeDeptId"
             :options="treedata"
             :props="{ checkStrictly: true, label: 'name', value: 'id' }"
           ></el-cascader>
@@ -225,6 +226,7 @@ export default {
     const data = reactive({
       newShow: false,
       editName:'',//修改编辑用户名称
+      deptIdList:[],
       treedata:[],
       newData:{
         userName: "",
@@ -253,6 +255,9 @@ export default {
     };
   },
   methods: {
+    changeDeptId(val){
+      this.newData.deptId = val && val[val.length - 1];
+    },
     async newSubmit(){
       console.log('newSubmit',this.user,this.newData);
       if (!this.newData.nickName) {