فهرست منبع

feat: 修改

linwenxin 1 سال پیش
والد
کامیت
4c2bac819b
1فایلهای تغییر یافته به همراه8 افزوده شده و 12 حذف شده
  1. 8 12
      src/views/auxiliaryFittings/salesManagement/components/auxiliarySalesOrderDetail.vue

+ 8 - 12
src/views/auxiliaryFittings/salesManagement/components/auxiliarySalesOrderDetail.vue

@@ -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(){