diff --git a/src/views/product/productAdd/newIndex.vue b/src/views/product/productAdd/newIndex.vue index ad1b86b..9b1f122 100644 --- a/src/views/product/productAdd/newIndex.vue +++ b/src/views/product/productAdd/newIndex.vue @@ -527,8 +527,7 @@ export default { console.log(res, "productAddGetSites") }) }, - inverseAnalysis(data) { - console.log(data,"data") + async inverseAnalysis(data) { let { categoryOneId, categoryTwoId } = data; let categorys = [categoryOneId, categoryTwoId]; this.OilStationSelectionList = data.siteInfos; @@ -538,13 +537,10 @@ export default { }); this.$refs.CustomUpload.fileList = [...this.formValidate.images.filter(item=>item.mainMark=="1")]; this.$refs.CustomLBUpload.fileList = [...this.formValidate.images.filter(item=>item.mainMark!="1")] ; - this.confirm(); - this.$nextTick(()=>{ - setTimeout(() => { - console.log(this.formValidate,"this.formValidate.arr") - }, 1000); + await this.confirm(); + this.$nextTick(()=>{ this.formValidate.attr = this.formValidate.attr.map(item=>{ - let align = this.formValidate.checkedList.find(i=>item.id==i.attributeId); + let align = this.formValidate.checkedList.find(i=>item.id==i.attributeId); if(align){ return { ...item, @@ -556,13 +552,12 @@ export default { }else{ return null } - }).filter(item=>item); + }).filter(item=>item); setTimeout(() => { this.ManyAttrValue.forEach((item,index)=>{ let data = this.formValidate.stockList.find(i=>i.attributeJson==JSON.stringify(item.data)) if(data){ - Object.assign(item,data); - console.log(data,item,"datadatadatadata") + Object.assign(item,data); } }) }, 1000); @@ -776,13 +771,15 @@ export default { if (num) this.productGetRule() }, // 选择属性确认 - async confirm() { + async confirm(is=true) { this.isAttr = true - if (!this.formValidate.attributesTypeId) { + if(is){ + if (!this.formValidate.attributesTypeId) { return this.$message.warning('请选择属性') } await this.productGetRule(); this.formValidate.attr = JSON.parse(JSON.stringify(this.ruleList.find(item => item.id == this.formValidate.attributesTypeId).attributesList)); + } }, // 商品分类; getCategorySelect() {