|
@@ -292,7 +292,7 @@
|
|
|
},
|
|
|
async getDetail(){
|
|
|
const that = this
|
|
|
- getDetail({salesId: this.id}).then(res => {
|
|
|
+ getDetail({salesId: this.id}).then( async res => {
|
|
|
this.formData.flag = res.data.flag
|
|
|
this.formData.websit = {websitId: res.data.websitId,name: res.data.websitName}
|
|
|
this.formData.websitId = res.data.websitId
|
|
@@ -313,18 +313,14 @@
|
|
|
this.formData.payType = res.data.payType
|
|
|
this.getCategory(res.data.websitId)
|
|
|
this.formData.remark = res.data.remark
|
|
|
- res.data.items.forEach(item=>{
|
|
|
- item.parentCategory = {categoryId: item.parentCategoryId,categoryName: item.parentCategoryName,items: [{categoryId: item.goodsCategoryId,categoryName: item.goodsCategoryName}]}
|
|
|
+ for(var item of res.data.items){
|
|
|
+ item.parentCategory = {categoryId: item.parentCategoryId,categoryName: item.parentCategoryName, items: [{categoryId: item.goodsCategoryId,categoryName: item.goodsCategoryName}]}
|
|
|
item.goodsCategory = {categoryId: item.goodsCategoryId,categoryName: item.goodsCategoryName}
|
|
|
- that.getGoods(item.goodsCategoryId,item.goodsName,1).then(ress => {
|
|
|
- item.goods = ress.data
|
|
|
- item.goodsList = [ress.data]
|
|
|
- })
|
|
|
- })
|
|
|
- setTimeout(()=>{
|
|
|
- this.dataList = res.data.items
|
|
|
- console.log(this.dataList)
|
|
|
- },200)
|
|
|
+ var ress = await that.getGoods(item.goodsCategoryId,item.goodsName, 1)
|
|
|
+ item.goods = ress.data
|
|
|
+ item.goodsList = ress.data ? [ress.data] : []
|
|
|
+ }
|
|
|
+ this.dataList = res.data.items
|
|
|
})
|
|
|
},
|
|
|
getWebsit(){
|