| | |
| | | if (id && parseInt(id) !== 0) { |
| | | _this.formLoading = true |
| | | departmentApi.select(id).then(re => { |
| | | re.response.parentId = re.response.parentIds |
| | | _this.form = re.response |
| | | _this.formLoading = false |
| | | }) |
| | |
| | | // let obj = { |
| | | // name: this.form.name |
| | | // } |
| | | _this.form.parentId = _this.form.parentId[0] |
| | | if (_this.form.parentId) { |
| | | _this.form.parentId = _this.form.parentId[_this.form.parentId.length - 1]; |
| | | } |
| | | if (_this.fig === 1) { |
| | | departmentApi.addData(this.form.name).then(res => { |
| | | departmentApi.addData(this.form).then(res => { |
| | | console.log(res) |
| | | if (res.code === 1) { |
| | | _this.$message.success(res.message) |
| | |
| | | id: null, |
| | | name: '', |
| | | level: 1, |
| | | parentId: null, |
| | | levelName: '' |
| | | } |
| | | this.form.id = lastId |