编辑商品的问题

This commit is contained in:
duan 2024-08-08 10:50:33 +08:00
parent 87d2f8a7bb
commit 4ab685fac3
2 changed files with 12 additions and 5 deletions

View File

@ -2,7 +2,7 @@
<div class="app-container">
<el-form ref="formRef" :model="form" :rules="rules" label-width="140px" label-position="left">
<el-form-item label="商品类型" prop="typeEnum">
<div class="shop_type_box" :class="{ }">
<div class="shop_type_box" :class="{}">
<!-- <div class="shop_type_box" :class="{ disabled: form.id }"> -->
<div class="item" v-for="(item, index) in shopTypes" :key="index"
:class="{ active: shopTypesActive == index }" @click="changeTypeEnum(index)">
@ -217,6 +217,7 @@
<uploadImg type="text" :limit="1" @success="res => (scope.row.coverImg = res[0])"
v-if="!scope.row.coverImg" />
<el-image style="width:30px;height:30px;" :src="scope.row.coverImg" v-else />
<i class="el-icon-error " v-if="scope.row.coverImg" @click="scope.row.coverImg = ''"></i>
</template>
</el-table-column>
<el-table-column label="售价" prop="salePrice">
@ -601,6 +602,7 @@ export default {
}
})
},
deleteEvent(d) {
let index = this.imgList.findIndex(ele => ele.url == d.url)
this.imgList.splice(index, 1);
@ -653,7 +655,6 @@ export default {
);
this.specTableHeaders = JSON.parse(res.specTableHeaders);
this.selectSpec = JSON.parse(res.selectSpec);
console.log(res, '调试11111')
//
// this.$refs.uploadImg.fileList = res.images.map(item => {
// return {
@ -691,11 +692,15 @@ export default {
},
//
submitHandle() {
console.log("form", this.form);
let arr = []
this.imgList.forEach(ele => {
arr.push(ele.url)
})
this.$refs.formRef.validate(async faild => {
try {
if (faild) {
this.loading = true;
this.form.images = arr
this.form.lowPrice = this.form.skuList[0].salePrice;
this.form.coverImg = this.form.images[0];
this.form.selectSpec = JSON.stringify(this.selectSpec);

View File

@ -15,7 +15,7 @@
<imageComponent @onSelectImage="onSelectImage" @getList="getList" :activedata="activedata"
:list='dataImages'>
</imageComponent>
<el-pagination layout="prev, pager, next" :total="total" :page-size="20"
<el-pagination layout="prev, pager, next" :total="total" :page-size="pageSize"
@current-change="handleCurrentChange">
</el-pagination>
</el-main>
@ -95,6 +95,7 @@ export default {
showUpload: false,
page: 1,
total: 0,
pageSize:18,
activedata: '681'
}
},
@ -106,11 +107,12 @@ export default {
this.activedata = -1
this.page = 1
this.dataImages = []
this.total = 0
this.pageSize= 17
this.getList()
},
changeEvent(id) {
this.page = 1
this.pageSize= 18
this.activedata = id
this.getList()
},