pull/6/head^2
dt_2916866708 10 months ago
parent 38a04d24b4
commit 3f76c2bf9a
  1. 23
      src/views/product/productAdd/newIndex.vue

@ -527,8 +527,7 @@ export default {
console.log(res, "productAddGetSites") console.log(res, "productAddGetSites")
}) })
}, },
inverseAnalysis(data) { async inverseAnalysis(data) {
console.log(data,"data")
let { categoryOneId, categoryTwoId } = data; let { categoryOneId, categoryTwoId } = data;
let categorys = [categoryOneId, categoryTwoId]; let categorys = [categoryOneId, categoryTwoId];
this.OilStationSelectionList = data.siteInfos; this.OilStationSelectionList = data.siteInfos;
@ -538,13 +537,10 @@ export default {
}); });
this.$refs.CustomUpload.fileList = [...this.formValidate.images.filter(item=>item.mainMark=="1")]; 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.$refs.CustomLBUpload.fileList = [...this.formValidate.images.filter(item=>item.mainMark!="1")] ;
this.confirm(); await this.confirm();
this.$nextTick(()=>{ this.$nextTick(()=>{
setTimeout(() => {
console.log(this.formValidate,"this.formValidate.arr")
}, 1000);
this.formValidate.attr = this.formValidate.attr.map(item=>{ 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){ if(align){
return { return {
...item, ...item,
@ -556,13 +552,12 @@ export default {
}else{ }else{
return null return null
} }
}).filter(item=>item); }).filter(item=>item);
setTimeout(() => { setTimeout(() => {
this.ManyAttrValue.forEach((item,index)=>{ this.ManyAttrValue.forEach((item,index)=>{
let data = this.formValidate.stockList.find(i=>i.attributeJson==JSON.stringify(item.data)) let data = this.formValidate.stockList.find(i=>i.attributeJson==JSON.stringify(item.data))
if(data){ if(data){
Object.assign(item,data); Object.assign(item,data);
console.log(data,item,"datadatadatadata")
} }
}) })
}, 1000); }, 1000);
@ -776,13 +771,15 @@ export default {
if (num) this.productGetRule() if (num) this.productGetRule()
}, },
// //
async confirm() { async confirm(is=true) {
this.isAttr = true this.isAttr = true
if (!this.formValidate.attributesTypeId) { if(is){
if (!this.formValidate.attributesTypeId) {
return this.$message.warning('请选择属性') return this.$message.warning('请选择属性')
} }
await this.productGetRule(); await this.productGetRule();
this.formValidate.attr = JSON.parse(JSON.stringify(this.ruleList.find(item => item.id == this.formValidate.attributesTypeId).attributesList)); this.formValidate.attr = JSON.parse(JSON.stringify(this.ruleList.find(item => item.id == this.formValidate.attributesTypeId).attributesList));
}
}, },
// //
getCategorySelect() { getCategorySelect() {

Loading…
Cancel
Save