Просмотр исходного кода

解决制作没有增加库存

shish 4 лет назад
Родитель
Сommit
cf8030ba52
2 измененных файлов с 8 добавлено и 13 удалено
  1. 5 10
      hdApp/src/admin/goodsManage/list.vue
  2. 3 3
      hdApp/src/mixins/globalMixins.js

+ 5 - 10
hdApp/src/admin/goodsManage/list.vue

@@ -90,9 +90,7 @@ export default {
       height: 0,
       currentTab: 0,
       scrollTop: 0,
-      form: {
-        catId: ""
-      },
+      catId: "",
       delModal: false,
       operateData: {},
       operateShow: false,
@@ -106,7 +104,7 @@ export default {
   computed: {
   },
   onLoad: function() {
-
+    this.getCategoryData();
   },
   methods: {
     selectFlowerNumFn(){
@@ -139,20 +137,17 @@ export default {
     edit(id){
         this.$util.pageTo({ url: "/admin/goodsManage/detail", query: { id: id } })
     },
-    init() {
-      this.getCategoryData();
-    },
     getCategoryData() {
       categoryListB().then(res => {
         this.tabbar = res.data;
         if(this.tabbar && this.tabbar[0] && this.tabbar[0].id){
-          this.form.catId = this.tabbar[0].id
+          this.catId = this.tabbar[0].id
           this.getGoodsList()
         }
       });
     },
     getGoodsList() {
-      return getCategoryGoodsB({ status:'', page: this.list.page, ...this.form,flowerNum:this.flowerNum }).then(res => {
+      return getCategoryGoodsB({ status:'', page: this.list.page, catId:this.catId,flowerNum:this.flowerNum }).then(res => {
         this.completes(res)
       })
     },
@@ -162,7 +157,7 @@ export default {
         return false;
       } else {
         this.currentTab = cur;
-        this.form.catId = item.id;
+        this.catId = item.id;
         this.resetList();
         this.getGoodsList();
       }

+ 3 - 3
hdApp/src/mixins/globalMixins.js

@@ -81,9 +81,9 @@ export default {
 		}
 	},
 	onShow(){
-    if (this.init) {
-      this.init()
-    }
+		if (this.init) {
+			this.init()
+		}
 	},
 	methods: {
     ...mapActions(['setUserShopAll'])