Ver Fonte

回显问题修改

pengyh há 1 ano atrás
pai
commit
41a440cf09

+ 22 - 4
src/views/auxiliaryFittings/salesManagement/components/attachmentOldReturnDetail.vue

@@ -602,6 +602,13 @@
 						item.goods = {...ress.data,oldPrice:ress.data.price}
 						item.goodsList = ress.data ? [{...ress.data,oldPrice:ress.data.price}] : []
 					}
+					for(var item of res.data.websitPartsRetOldRecordList){
+						var ress = await that.getAttachmentList(res.data.websitId)
+						console.log(ress,'3y123euwia')
+						debugger
+						item.goods = item
+						item.goodsList = ress.data ? ress.data : []
+					}
 					this.dataList = res.data.websitPartsRetItemList
 					this.oldList = res.data.websitPartsRetOldRecordList
 				})
@@ -737,10 +744,21 @@
 				})
 				this.getAttachmentList()
 			},
-			getAttachmentList(){
-				getAttachmentList({pageNum: 1,pageSize: -1,params: [{param: 'a.websit_id',compare: '=',value: this.formData.websitId}]}).then(res => {
-					this.oldList[this.isEdit].goodsList = res.data.records
-				})
+			async getAttachmentList(websit_id){
+				const that = this
+				if(websit_id){
+					return new Promise((resolve, reject) => {
+						getAttachmentList({pageNum: 1,pageSize: -1,params: [{param: 'a.websit_id',compare: '=',value: this.formData.websitId}]}).then(res => {
+							resolve({
+								data: res.data.records
+							})
+						})
+					})
+				}else{
+					getAttachmentList({pageNum: 1,pageSize: -1,params: [{param: 'a.websit_id',compare: '=',value: this.formData.websitId}]}).then(res => {
+						this.oldList[this.isEdit].goodsList = res.data.records
+					})
+				}
 			},
 			async checkForm(){
 				let is_save = true