This commit is contained in:
faiz 2024-07-02 09:58:38 +08:00
parent bc2e2c02fe
commit 4eae526816
1 changed files with 25 additions and 16 deletions

View File

@ -197,6 +197,23 @@
</template>
</el-table>
</el-form-item>
<!-- <el-table
:data="attrList"
style="width: 100%">
<el-table-column
prop="title"
label="规格名称"
width="180">
</el-table-column>
<el-table-column
prop="detail"
label="规格值"
width="180">
<template slot-scope="scope">
<el-input @input="handleModet(scope.row)" v-for="item in scope.row.detail" v-model="item.value"></el-input>
</template>
</el-table-column>
</el-table> -->
<el-form-item>
<el-button :loading="loading1" type="primary" class="submission" @click="handleSubmit('formValidate')">提交</el-button>
</el-form-item>
@ -431,8 +448,8 @@ export default {
],
tableIndex: 0,
attrInfo: {},
fatAttrValue:[],
detailStatus:true,
attrList:[],
oneFormBatch: [
{
image: '',
@ -474,15 +491,10 @@ export default {
},
methods: {
handleMany(row,i,val){
// row.detail[val] = row[i]
// console.log('row',row);
// console.log('i',i);
// console.log(val);
if(row[i]){
this.detailStatus = false
this.fatAttrValue.map((res,key)=>{
console.log(row.detail[val])
if(row.detail[val] == res.detail[val] && key!=0){
this.ManyAttrValue.map((res,key)=>{
if(row.detail[val] == res.detail[val] && res.unique!==row.unique){
//
res[i] = row[i]
// detail
@ -495,7 +507,6 @@ export default {
res['sku'] = skuValue
}
})
this.ManyAttrValue = this.fatAttrValue
row.detail[val] = row[i]
row.detail[val] = row[i]
let skuValue = ''
@ -650,22 +661,21 @@ export default {
watCh(val) {
const tmp = {}
const tmpTab = {}
const temAttr = []
this.formValidate.attr.forEach((o, i) => {
tmp['value' + i] = { title: o.value }
tmpTab['value' + i] = ''
temAttr.push({title:o.value,detail:o.detail.map((v, g) => {
return { value: v }
})})
})
this.attrList = temAttr
this.ManyAttrValue = this.attrFormat(val)
this.fatAttrValue = this.attrFormat(val)
this.ManyAttrValue.forEach((val, index) => {
const key = Object.values(val.detail).sort().join('/')
if (this.attrInfo[key]) this.ManyAttrValue[index] = this.attrInfo[key]
val.image = this.formValidate.image
})
this.fatAttrValue.forEach((val, index) => {
const key = Object.values(val.detail).sort().join('/')
if (this.attrInfo[key]) this.fatAttrValue[index] = this.attrInfo[key]
val.image = this.formValidate.image
})
this.attrInfo = {}
this.ManyAttrValue.forEach((val) => {
if (val.detail !== 'undefined' && val.detail !== null) {
@ -788,7 +798,6 @@ export default {
this.OneattrValue = info.attrValue
} else {
this.ManyAttrValue = info.attrValue
this.fatAttrValue = info.attrValue
this.ManyAttrValue.forEach(val => {
if (val.detail !== 'undefined' && val.detail !== null) {
this.attrInfo[