|
@@ -214,7 +214,7 @@ export default {
|
|
|
},
|
|
|
|
|
|
editParentId: null,
|
|
|
- addParentFormType: 'add',
|
|
|
+ addParentFormType: 'add1',
|
|
|
addParentFormVisible: false,
|
|
|
addParentForm: {
|
|
|
oneClassify: '',
|
|
@@ -320,7 +320,7 @@ export default {
|
|
|
this.formVisible = true
|
|
|
this.addParentFormType = type;
|
|
|
this.addParentFormVisible = true;
|
|
|
- if(type == 'edit'){
|
|
|
+ if(type == 'edit1'){
|
|
|
this.editParentId = cid;
|
|
|
getClassifyDetail({categoryId: cid}).then(res => {
|
|
|
this.addParentForm = {
|
|
@@ -345,7 +345,7 @@ export default {
|
|
|
// 取消 新增编辑 一级分类
|
|
|
cancelAddParentForm(){
|
|
|
this.addParentFormVisible = false;
|
|
|
- this.$refs.addParentForm.resetFields();
|
|
|
+ this.$refs?.addParentForm?.resetFields();
|
|
|
},
|
|
|
|
|
|
// 提交 一级分类
|
|
@@ -360,17 +360,17 @@ export default {
|
|
|
status: this.addParentForm.status,
|
|
|
sortNum: this.addParentForm.sort,
|
|
|
}
|
|
|
- if(this.addParentFormType == 'edit') {
|
|
|
+ if(this.addParentFormType == 'edit1') {
|
|
|
params.categoryId = this.editParentId;
|
|
|
editClassify(params).then(res => {
|
|
|
- cancel('list')
|
|
|
+ cancel('list')
|
|
|
this.cancelAddParentForm();
|
|
|
this.getList();
|
|
|
this.$successMsg('编辑成功');
|
|
|
})
|
|
|
}else {
|
|
|
addClassify(params).then(res => {
|
|
|
- cancel('list')
|
|
|
+ cancel('list')
|
|
|
this.cancelAddParentForm();
|
|
|
this.getList();
|
|
|
this.$successMsg('添加成功');
|
|
@@ -417,13 +417,13 @@ export default {
|
|
|
getClassifyList({name: ''}).then(res => {
|
|
|
this.classifyList = res.data;
|
|
|
})
|
|
|
- if(type == 'add') {
|
|
|
+ if(type == 'add2') {
|
|
|
this.addChildForm.oneClassify = cid;
|
|
|
let item = this.dataList[this.$findElem(this.dataList, 'categoryId', cid)];
|
|
|
this.addChildForm.taxNumber = item.taxNumber;
|
|
|
this.addChildForm.taxPercent = item.taxPercent;
|
|
|
}
|
|
|
- if(type == 'edit'){
|
|
|
+ if(type == 'edit2'){
|
|
|
this.editChildId = cid;
|
|
|
getClassifyDetail({categoryId: cid}).then(res => {
|
|
|
console.log(this.orderMainType,'获取大类')
|
|
@@ -459,7 +459,7 @@ export default {
|
|
|
// 取消 新增编辑 二级分类
|
|
|
cancelAddChildForm(){
|
|
|
this.addChildFormVisible = false;
|
|
|
- this.$refs.addChildForm.resetFields();
|
|
|
+ this.$refs?.addChildForm?.resetFields();
|
|
|
},
|
|
|
|
|
|
// 提交 二级分类
|
|
@@ -473,7 +473,7 @@ export default {
|
|
|
// let smallName = index2 >= 0 ? this.orderSmallType[index2].name : '';
|
|
|
|
|
|
let params = {}
|
|
|
- if(this.addChildFormType == 'edit') {
|
|
|
+ if(this.addChildFormType == 'edit2') {
|
|
|
params = {
|
|
|
categoryId: this.editChildId,
|
|
|
name: this.addChildForm.twoClassify,
|