多规格属性同步改为同步当前行下面所有行

This commit is contained in:
sj
2022-11-10 17:20:58 +08:00
parent 4103c2c107
commit 5f1aa2d11f
2 changed files with 12 additions and 8 deletions
+10 -7
View File
@@ -650,17 +650,20 @@ export default {
}, },
methods: { methods: {
blur(index,row) { blur(index,row) {
//将下一行的内容进行同步 //将当前行后面每行的内容进行同步
// this.manyFormValidate.forEach(item=>{ // console.log('index',index,this.manyFormValidate.length)
console.log('index',index,this.manyFormValidate.length)
if (index+1<this.manyFormValidate.length){ //最后一行没有下一行 if (index+1<this.manyFormValidate.length){ //最后一行没有下一行
for (const ele in row){ this.manyFormValidate.forEach((item,itemIndex)=>{
//图片/售价/成本价/原价/库存/重量/体积/所需积分 if (itemIndex>index){//对比当前行和item的索引
if (ele=="pic"||ele=="price"||ele=="cost"||ele=="ot_price"||ele=="stock"||ele=="weight"||ele=="volume"||ele=="integral"){ for (const ele in row){
this.manyFormValidate[index+1][ele]=row[ele]; //图片/售价/成本价/原价/库存/重量/体积/所需积分
if (ele=="pic"||ele=="price"||ele=="cost"||ele=="ot_price"||ele=="stock"||ele=="weight"||ele=="volume"||ele=="integral"){
item[ele]=row[ele];
}
} }
} }
} }
)}
// }) // })
}, },
handleTabsEdit(targetName, action) { handleTabsEdit(targetName, action) {
+2 -1
View File
@@ -116,7 +116,8 @@ export default {
delLoading: false, delLoading: false,
visible: false, visible: false,
queryTypeOptions: [ queryTypeOptions: [
{ key: 'storeName', display_name: '商品名称' } { key: 'storeName', display_name: '商品名称' },
{ key: 'id', display_name: '商品id' }
], ],
isAttr: false, isAttr: false,
cateId: null, cateId: null,