|
@@ -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,
|