商品编辑和添加表格隐藏原价和成本价
This commit is contained in:
@@ -115,19 +115,19 @@
|
|||||||
controls-position="right"></el-input-number>
|
controls-position="right"></el-input-number>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="成本价" prop="costPrice">
|
<!-- <el-table-column label="成本价" prop="costPrice">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-input-number @change="priceFormat(scope.row, 'costPrice')" @blur="priceFormat(scope.row, 'costPrice')"
|
<el-input-number @change="priceFormat(scope.row, 'costPrice')" @blur="priceFormat(scope.row, 'costPrice')"
|
||||||
v-model="scope.row.costPrice" controls-position="right"></el-input-number>
|
v-model="scope.row.costPrice" controls-position="right"></el-input-number>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="原价" prop="originPrice">
|
<el-table-column label="原价" prop="originPrice">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-input-number @change="priceFormat(scope.row, 'originPrice')"
|
<el-input-number @change="priceFormat(scope.row, 'originPrice')"
|
||||||
@blur="priceFormat(scope.row, 'originPrice')" v-model="scope.row.originPrice"
|
@blur="priceFormat(scope.row, 'originPrice')" v-model="scope.row.originPrice"
|
||||||
controls-position="right"></el-input-number>
|
controls-position="right"></el-input-number>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>-->
|
||||||
<el-table-column label="起售数量" prop="suit">
|
<el-table-column label="起售数量" prop="suit">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input-number @change="priceFormat(scope.row, 'suit')" @blur="priceFormat(scope.row, 'suit')" :min="1"
|
<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>
|
||||||
<el-table-column label="图片" prop="coverImg" width="80">
|
<el-table-column label="图片" prop="coverImg" width="80">
|
||||||
<template v-slot="scope">
|
<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 />
|
<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 class="el-icon-error " v-if="scope.row.coverImg" @click="scope.row.coverImg = ''" />
|
||||||
</template>
|
</template>
|
||||||
@@ -694,6 +695,8 @@ export default {
|
|||||||
// 提交
|
// 提交
|
||||||
submitHandle() {
|
submitHandle() {
|
||||||
console.log(this.form.skuList)
|
console.log(this.form.skuList)
|
||||||
|
|
||||||
|
// return
|
||||||
const hasUndefined = this.form.skuList.some(obj => {
|
const hasUndefined = this.form.skuList.some(obj => {
|
||||||
for (const key in obj) {
|
for (const key in obj) {
|
||||||
if (obj[key] === undefined) {
|
if (obj[key] === undefined) {
|
||||||
@@ -728,6 +731,8 @@ export default {
|
|||||||
this.form.selectSpec = JSON.stringify(this.selectSpec);
|
this.form.selectSpec = JSON.stringify(this.selectSpec);
|
||||||
this.form.specTableHeaders = JSON.stringify(this.specTableHeaders);
|
this.form.specTableHeaders = JSON.stringify(this.specTableHeaders);
|
||||||
this.form.specInfo = JSON.stringify(this.form.skuList);
|
this.form.specInfo = JSON.stringify(this.form.skuList);
|
||||||
|
this.form.costPrice = 0
|
||||||
|
this.form.originPrice = this.form.salePrice
|
||||||
if (this.form.id) {
|
if (this.form.id) {
|
||||||
await tbProductPut(this.form);
|
await tbProductPut(this.form);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user