diff --git a/src/views/system/goods/add/index.vue b/src/views/system/goods/add/index.vue index 22c0c8272fee588c51a48244a3004db3a64a1c0c..76f477000e9ba3cc51f2f05c12f1e04841fedbfd 100644 --- a/src/views/system/goods/add/index.vue +++ b/src/views/system/goods/add/index.vue @@ -88,12 +88,12 @@ export default { name: 'Index', - props: { - option: { - type: Number, - required: true - } - }, + // props: { + // option: { + // type: Number, + // required: true + // } + // }, components: { Goodsinfomation, GoodsSpecifications, @@ -156,12 +156,14 @@ }, // 商哿‰€æœ‰æ•°æ® TIMER: null, hehe: 0, + option: 0 } // return end }, created() { // option 商å“çš„id //debugger + this.option = Number(this.$route.query.goods_id) if( this.option && this.option !== 0 ) { let data = { goodsId: this.option}; getGoodsNew(data).then(res => { @@ -342,8 +344,8 @@ NewGetCategoryData(limboNode).then(res => { let result = {}; + result = res.data if (level === 0) { - result = res.data result.forEach(item => { item.value = item.id; item.label = item.label; @@ -370,13 +372,9 @@ if (level === 2) { for(let i = 0; i < res.data.length; i++) { - if( res.data[i].children.length > 0) { - for(let j = 0; j < res.data[i].children.length; j++) { - if( limboNode.id === res.data[i].children[j].id ) { - result = res.data[i].children[j].children; - break; - } - } + if( limboNode.id === res.data[i].id ) { + result = res.data[i].children; + break; } }