Browse Source

分类管理

pengyh 1 year ago
parent
commit
63583b9eb1
1 changed files with 17 additions and 15 deletions
  1. 17 15
      src/views/mallManagement/goods/classify_index/index.vue

+ 17 - 15
src/views/mallManagement/goods/classify_index/index.vue

@@ -243,6 +243,7 @@ export default {
   },
   created() {
     this.getList();
+	this.getMainList()
   },
   methods: {
 
@@ -359,26 +360,27 @@ export default {
 
       if(type == 'edit') {
         this.editChildId = cid;
-        getClassifyDetail({categoryId: cid}).then(res => {
+		getClassifyDetail({categoryId: cid}).then(res => {
+			console.log(this.orderMainType,'获取大类')
 			this.orderMainType.forEach(item =>{
 				if(item.categoryId == res.data.mainNumber){
 					this.orderSmallType = item.children
 				}
 			})
-          this.addChildForm = {
-            oneClassify: res.data.parentId,
-            twoClassify: res.data.name,
-            main: {name: res.data.mainName,categoryId: res.data.mainNumber},
-			small: {name: res.data.smallName,categoryId: res.data.smallNumber},
-            workOrderType: res.data.workOrderType,
-            imgUrl: res.data.imgUrl,
-            taxNumber: res.data.taxNumber,
-            taxPercent: res.data.taxPercent,
-            status: res.data.status,
-            sort: res.data.sortNum
-          }
-          // this.getSmallType();
-        })
+			this.addChildForm = {
+				oneClassify: res.data.parentId,
+				twoClassify: res.data.name,
+				main: {name: res.data.mainName,categoryId: res.data.mainNumber},
+				small: {name: res.data.smallName,categoryId: res.data.smallNumber},
+				workOrderType: res.data.workOrderType,
+				imgUrl: res.data.imgUrl,
+				taxNumber: res.data.taxNumber,
+				taxPercent: res.data.taxPercent,
+				status: res.data.status,
+				sort: res.data.sortNum
+			}
+			// this.getSmallType();
+		})
       }
     },