Browse Source

1.商家端前端商品管理新增平台上架状态业务功能 2.商家端后台新增平台上架业务功能 3.商家端商品新增编辑添加平台上架

master
dy-hu 1 year ago
parent
commit
a19b816b72
  1. 9
      src/api/commodity.js
  2. 9
      src/views/commodity/commoditySystem/addCommodity.vue
  3. 45
      src/views/commodity/commoditySystem/index.vue

9
src/api/commodity.js

@ -80,6 +80,15 @@ export function getClassifyStart(data) {
})
}
// 商品平台上下架
export function getClassifyPlatStart(data) {
return request({
url: '/product/platStart',
method: 'post',
data
})
}
// 商品分类
export function getClassify(data,headers) {
return request({

9
src/views/commodity/commoditySystem/addCommodity.vue

@ -222,6 +222,13 @@
</el-radio-group>
</el-form-item>
<el-form-item :label="$t('product.platshelvestate')" prop="platShelveState">
<el-radio-group v-model="form.platShelveState">
<el-radio :label="1">{{ $t('product.shelveson') }}</el-radio>
<el-radio :label="0">{{ $t('product.shelvesoff') }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item :label="$t('product.iflowprice_tips')" prop="ifLowPrice">
<el-radio-group v-model="form.ifLowPrice">
<el-radio :label="1">{{ $t('common.yes') }}</el-radio>
@ -363,6 +370,7 @@ export default {
brandId: null, // ID
ifLogistics: '', // 1- 0-
shelveState: '', // 1- 0-
platshelvestate: '', // 1- 0-
ifOversold: '', // 1- 0-
ifCredit: '', // 1- 0-
creditLimit: '', // 使
@ -551,6 +559,7 @@ export default {
brandId: null, // ID
ifLogistics: '', // 1- 0-
shelveState: '', // 1- 0-
platShelveState: '', // 1- 0-
ifOversold: '', // 1- 0-
ifCredit: '', // 1- 0-
creditLimit: '', // 使

45
src/views/commodity/commoditySystem/index.vue

@ -69,7 +69,7 @@
</el-table-column>
<el-table-column prop="stockNumber" :label="$t('product.inventory')" show-overflow-tooltip />
<el-table-column prop="volume" :label="$t('product.salesvolume')" show-overflow-tooltip />
<el-table-column prop="volume" :label="$t('product.shelvestate')" show-overflow-tooltip>
<el-table-column :label="$t('product.shelvestate')" show-overflow-tooltip>
<template slot-scope="scope">
<span v-if="scope.row.shelveState==0">{{ $t('product.notlistedyet') }}</span>
<span v-if="scope.row.shelveState==1">{{ $t('product.alreadylisted') }}</span>
@ -77,15 +77,25 @@
<span v-if="scope.row.shelveState==3">{{ $t('product.auditfailure') }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('product.plat_shelve_state')" width="120">
<template slot-scope="scope">
<span v-if="scope.row.platShelveState==0">{{ $t('product.notlistedyet') }}</span>
<span v-if="scope.row.platShelveState==1">{{ $t('product.alreadylisted') }}</span>
<span v-if="scope.row.platShelveState==2">{{ $t('product.tobereviewed') }}</span>
<span v-if="scope.row.platShelveState==3">{{ $t('product.auditfailure') }}</span>
</template>
</el-table-column>
<el-table-column prop="reject" :label="$t('product.causeofrejection')" show-overflow-tooltip />
<el-table-column :formatter="row=>getBrandName(row)" :label="$t('product.brand')" show-overflow-tooltip />
<el-table-column prop="createTime" :label="$t('common.createTime')" width="180" />
<el-table-column :label="$t('common.operate')" width="200">
<el-table-column :label="$t('common.operate')" width="200" fixed="right">
<template slot-scope="scope">
<div class="btnList">
<el-button type="text" @click="edit(scope.row)">{{ $t('common.edit') }}</el-button>
<el-button v-if="scope.row.shelveState==0" type="text" @click="down(scope.row)">{{ $t('product.shelveson') }}</el-button>
<el-button v-if="scope.row.shelveState==1" type="text" @click="down(scope.row)">{{ $t('product.shelvesoff') }}</el-button>
<el-button v-if="scope.row.platShelveState==0" type="text" @click="platDown(scope.row)">{{ $t('product.platshelveson') }}</el-button>
<el-button v-if="scope.row.platShelveState==1" type="text" @click="platDown(scope.row)">{{ $t('product.platshelvesoff') }}</el-button>
<el-button v-if="scope.row.shelveState==1" type="text" @click="setVipPrice(scope.row)">{{ $t('product.setmemberprice') }}</el-button>
<el-button v-if="scope.row.shelveState!=1" type="text" @click="del(scope.row)">{{ $t('common.delete') }}</el-button>
</div>
@ -222,7 +232,7 @@ import {
clearProductMember,
productExport,
getBrandList,
getGroupSelect
getGroupSelect, getClassifyPlatStart
} from '@/api/commodity'
import { storehouseGetAll } from '@/api/shopSys'
export default {
@ -554,6 +564,35 @@ export default {
}
}
},
//
async platDown(row) {
if (row.platShelveState) {
const res = await getClassifyPlatStart({
productId: row.productId,
shelveState: 0
})
if (res.code === '') {
this.$message({
type: 'success',
message: '下架成功!'
})
this.getAll(this.formInline)
}
} else {
const res = await getClassifyPlatStart({
productId: row.productId,
shelveState: 1
})
if (res.code === '') {
this.$message({
type: 'success',
message: '上架成功!'
})
this.getAll(this.formInline)
}
}
},
//
async getAll(formInline) {
this.formInline.classifyId =

Loading…
Cancel
Save