商品编辑和添加表格隐藏原价和成本价

This commit is contained in:
duan 2024-09-03 16:02:58 +08:00
parent 3805882787
commit 299a38f3f9
1 changed files with 9 additions and 4 deletions

View File

@ -115,19 +115,19 @@
controls-position="right"></el-input-number>
</template>
</el-table-column>
<el-table-column label="成本价" prop="costPrice">
<!-- <el-table-column label="成本价" prop="costPrice">
<template v-slot="scope">
<el-input-number @change="priceFormat(scope.row, 'costPrice')" @blur="priceFormat(scope.row, 'costPrice')"
v-model="scope.row.costPrice" controls-position="right"></el-input-number>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="原价" prop="originPrice">
<template v-slot="scope">
<el-input-number @change="priceFormat(scope.row, 'originPrice')"
@blur="priceFormat(scope.row, 'originPrice')" v-model="scope.row.originPrice"
controls-position="right"></el-input-number>
</template>
</el-table-column>
</el-table-column>-->
<el-table-column label="起售数量" prop="suit">
<template slot-scope="scope">
<el-input-number @change="priceFormat(scope.row, 'suit')" @blur="priceFormat(scope.row, 'suit')" :min="1"
@ -215,7 +215,8 @@
</el-table-column>
<el-table-column label="图片" prop="coverImg" width="80">
<template v-slot="scope">
<uploadImg v-if="!scope.row.coverImg" type="text" :limit="1" @success="res => (scope.row.coverImg = res[0])" />
<uploadImg v-if="!scope.row.coverImg" type="text" :limit="1"
@success="res => (scope.row.coverImg = res[0])" />
<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 = ''" />
</template>
@ -694,6 +695,8 @@ export default {
//
submitHandle() {
console.log(this.form.skuList)
// return
const hasUndefined = this.form.skuList.some(obj => {
for (const key in obj) {
if (obj[key] === undefined) {
@ -728,6 +731,8 @@ export default {
this.form.selectSpec = JSON.stringify(this.selectSpec);
this.form.specTableHeaders = JSON.stringify(this.specTableHeaders);
this.form.specInfo = JSON.stringify(this.form.skuList);
this.form.costPrice = 0
this.form.originPrice = this.form.salePrice
if (this.form.id) {
await tbProductPut(this.form);
} else {