编辑商品的问题
This commit is contained in:
parent
87d2f8a7bb
commit
4ab685fac3
|
|
@ -2,7 +2,7 @@
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="140px" label-position="left">
|
<el-form ref="formRef" :model="form" :rules="rules" label-width="140px" label-position="left">
|
||||||
<el-form-item label="商品类型" prop="typeEnum">
|
<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="shop_type_box" :class="{ disabled: form.id }"> -->
|
||||||
<div class="item" v-for="(item, index) in shopTypes" :key="index"
|
<div class="item" v-for="(item, index) in shopTypes" :key="index"
|
||||||
:class="{ active: shopTypesActive == index }" @click="changeTypeEnum(index)">
|
:class="{ active: shopTypesActive == index }" @click="changeTypeEnum(index)">
|
||||||
|
|
@ -217,6 +217,7 @@
|
||||||
<uploadImg type="text" :limit="1" @success="res => (scope.row.coverImg = res[0])"
|
<uploadImg type="text" :limit="1" @success="res => (scope.row.coverImg = res[0])"
|
||||||
v-if="!scope.row.coverImg" />
|
v-if="!scope.row.coverImg" />
|
||||||
<el-image style="width:30px;height:30px;" :src="scope.row.coverImg" v-else />
|
<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>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="售价" prop="salePrice">
|
<el-table-column label="售价" prop="salePrice">
|
||||||
|
|
@ -601,6 +602,7 @@ export default {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
deleteEvent(d) {
|
deleteEvent(d) {
|
||||||
let index = this.imgList.findIndex(ele => ele.url == d.url)
|
let index = this.imgList.findIndex(ele => ele.url == d.url)
|
||||||
this.imgList.splice(index, 1);
|
this.imgList.splice(index, 1);
|
||||||
|
|
@ -653,7 +655,6 @@ export default {
|
||||||
);
|
);
|
||||||
this.specTableHeaders = JSON.parse(res.specTableHeaders);
|
this.specTableHeaders = JSON.parse(res.specTableHeaders);
|
||||||
this.selectSpec = JSON.parse(res.selectSpec);
|
this.selectSpec = JSON.parse(res.selectSpec);
|
||||||
console.log(res, '调试11111')
|
|
||||||
// 初始化上传图片
|
// 初始化上传图片
|
||||||
// this.$refs.uploadImg.fileList = res.images.map(item => {
|
// this.$refs.uploadImg.fileList = res.images.map(item => {
|
||||||
// return {
|
// return {
|
||||||
|
|
@ -691,11 +692,15 @@ export default {
|
||||||
},
|
},
|
||||||
// 提交
|
// 提交
|
||||||
submitHandle() {
|
submitHandle() {
|
||||||
console.log("form", this.form);
|
let arr = []
|
||||||
|
this.imgList.forEach(ele => {
|
||||||
|
arr.push(ele.url)
|
||||||
|
})
|
||||||
this.$refs.formRef.validate(async faild => {
|
this.$refs.formRef.validate(async faild => {
|
||||||
try {
|
try {
|
||||||
if (faild) {
|
if (faild) {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
this.form.images = arr
|
||||||
this.form.lowPrice = this.form.skuList[0].salePrice;
|
this.form.lowPrice = this.form.skuList[0].salePrice;
|
||||||
this.form.coverImg = this.form.images[0];
|
this.form.coverImg = this.form.images[0];
|
||||||
this.form.selectSpec = JSON.stringify(this.selectSpec);
|
this.form.selectSpec = JSON.stringify(this.selectSpec);
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
<imageComponent @onSelectImage="onSelectImage" @getList="getList" :activedata="activedata"
|
<imageComponent @onSelectImage="onSelectImage" @getList="getList" :activedata="activedata"
|
||||||
:list='dataImages'>
|
:list='dataImages'>
|
||||||
</imageComponent>
|
</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">
|
@current-change="handleCurrentChange">
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
</el-main>
|
</el-main>
|
||||||
|
|
@ -95,6 +95,7 @@ export default {
|
||||||
showUpload: false,
|
showUpload: false,
|
||||||
page: 1,
|
page: 1,
|
||||||
total: 0,
|
total: 0,
|
||||||
|
pageSize:18,
|
||||||
activedata: '681'
|
activedata: '681'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -106,11 +107,12 @@ export default {
|
||||||
this.activedata = -1
|
this.activedata = -1
|
||||||
this.page = 1
|
this.page = 1
|
||||||
this.dataImages = []
|
this.dataImages = []
|
||||||
this.total = 0
|
this.pageSize= 17
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
changeEvent(id) {
|
changeEvent(id) {
|
||||||
this.page = 1
|
this.page = 1
|
||||||
|
this.pageSize= 18
|
||||||
this.activedata = id
|
this.activedata = id
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue