| | |
| | | fatherName: null, |
| | | sonName: null |
| | | } |
| | | |
| | | if (_that.addTreeForm.type != null && _that.addTreeForm.type[0] != 0) { |
| | | data.fatherName = _that.addTreeForm.type[0] |
| | | data.fatherName = _that.addTreeFormClassTree.filter(item => { |
| | | return item.value == _that.addTreeForm.type[0] |
| | | })[0].label |
| | | data.sonName = _that.addTreeForm.name |
| | | } else { |
| | | data.fatherName = _that.addTreeForm.name |
| | | } |
| | | } // return; |
| | | let add = await addClassify(data); |
| | | switch (add.message.split('-$')[0]) { |
| | | case '1': |
| | |
| | | _that.resetTreeForm('addTreeForm') |
| | | break; |
| | | case '2': |
| | | this.$message({ |
| | | message: '已存在该分类', |
| | | type: 'warning' |
| | | }); |
| | | this.$message({ |
| | | message: '已存在该分类', |
| | | type: 'warning' |
| | | }); |
| | | break; |
| | | case '0': |
| | | this.$message.error('添加失败!请联系管理员'); |
| | | this.$message.error('添加失败!请联系管理员'); |
| | | break; |
| | | } |
| | | |