瀏覽代碼

员工管理修改

1
mo 3 年之前
父節點
當前提交
506405ed43
共有 1 個文件被更改,包括 36 次插入35 次删除
  1. 36 35
      src/views/categroyManager/insideSetting/staffManager.vue

+ 36 - 35
src/views/categroyManager/insideSetting/staffManager.vue

@@ -777,29 +777,29 @@ export default {
         if (valid) {
           const { organIdLists, postDeptIds, deptIds, deptId, ...res } =
             this.form;
-          let tempPost = [];
-          postDeptIds.forEach((post) => {
-            let tempIds = [];
-            post.deptIds.forEach((item) => {
-              tempIds.push(item[item.length - 1]);
-            });
-            tempPost.push({
-              postId: post.postId,
-              // deptIds: tempIds,
-            });
-          });
-          const tempDeptIds = [];
-          deptIds.forEach((ds) => {
-            tempDeptIds.push(ds[ds.length - 1]);
-          });
+          // let tempPost = [];
+          // postDeptIds.forEach((post) => {
+          //   let tempIds = [];
+          //   post.deptIds.forEach((item) => {
+          //     tempIds.push(item[item.length - 1]);
+          //   });
+          //   tempPost.push({
+          //     postId: post.postId,
+          //     deptIds: tempIds,
+          //   });
+          // });
+          // const tempDeptIds = [];
+          // deptIds.forEach((ds) => {
+          //   tempDeptIds.push(ds[ds.length - 1]);
+          // });
 
           const tempDeptId = deptId ? deptId[deptId.length - 1] : "";
 
           let tempForm = {
-            postDeptIds: JSON.stringify(tempPost),
+            postDeptIds: JSON.stringify(postDeptIds),
             organIdList: organIdLists.join(","),
             // deptIds: tempDeptIds,
-            deptId: tempDeptId,
+            // deptId: tempDeptId,
             ...res,
           };
           if (this.formActionTitle == "create") {
@@ -1003,19 +1003,20 @@ export default {
         // 初始化数据
         let postDeptArr = [];
         const postDept = data.postDeptIds ? JSON.parse(data.postDeptIds) : [];
-
         if (postDept.length > 0) {
-          postDept.forEach((dept) => {
-            let deptIds = dept.deptIds || [];
-            let deptArr = [];
-            deptIds.forEach((ds) => {
-              deptArr.push(this.formatParentId(ds, this.deptList));
-            });
-            postDeptArr.push({
-              postId: dept.postId,
-              deptIds: deptArr,
-            });
-          });
+          // postDept.forEach((dept) => {
+          //   let deptIds = dept.deptIds || [];
+          //   let deptArr = [];
+          //   deptIds.forEach((ds) => {
+          //     deptArr.push(this.formatParentId(ds, this.deptList));
+          //   });
+          //   postDeptArr.push({
+          //     postId: dept.postId,
+          //     deptIds: deptArr,
+          //   });
+          // });
+          postDeptArr = [...postDept]
+          // console.log('postDeptArr',postDeptArr)
         } else {
           postDeptArr = [
             {
@@ -1027,12 +1028,12 @@ export default {
 
         const deptIds = data.deptIds ? eval(data.deptIds) : [];
         const tempDeptIds = [];
-        if (deptIds.length > 0) {
-          deptIds.forEach((ds) => {
-            tempDeptIds.push(this.formatParentId(ds, this.deptList));
-          });
-        }
-        this.onDeptChange(tempDeptIds);
+        // if (deptIds.length > 0) {
+        //   deptIds.forEach((ds) => {
+        //     tempDeptIds.push(this.formatParentId(ds, this.deptList));
+        //   });
+        // }
+        // this.onDeptChange(tempDeptIds);
         this.form = {
           id: data.id,
           realName: data.realName,