| | |
| | | <TableLayout :permissions="['business:goods:query']"> |
| | | <!-- 搜索表单 --> |
| | | <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline> |
| | | <!-- <el-tabs v-model="activeName" @tab-click="handleClick"> |
| | | <el-tab-pane label="全部商品" name="first"></el-tab-pane> |
| | | <el-tab-pane label="已售罄商品" name="second"></el-tab-pane> |
| | | <el-tab-pane label="回收站商品" name="third"></el-tab-pane> |
| | | </el-tabs>--> |
| | | <el-form-item label="商品名称" prop="name"> |
| | | <el-input v-model="searchForm.name" placeholder="请输入商品名称" @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | |
| | | <el-form-item label="所属分类" prop="categoryId"> |
| | | <el-select |
| | | v-model="searchForm.categoryId" |
| | | style="width: 150px" |
| | | placeholder="请选择所属分类" |
| | | clearable |
| | | @change="search" |
| | | > |
| | | <el-option |
| | | v-for="item in labels" |
| | |
| | | <el-form-item label="所属品牌" prop="brandId"> |
| | | <el-select |
| | | v-model="searchForm.brandId" |
| | | style="width: 150px" |
| | | placeholder="请选择所属品牌" |
| | | clearable |
| | | @change="search" |
| | | > |
| | | <el-option |
| | | v-for="item in brands" |
| | |
| | | </el-form-item> |
| | | <el-form-item label="上架状态" prop="status"> |
| | | <el-select |
| | | v-model="searchForm.brandId" |
| | | v-model="searchForm.status" |
| | | placeholder="请选择上架状态" |
| | | clearable |
| | | @change="search" |
| | | > |
| | | <el-option :key="0" :value="0" label="上架"></el-option> |
| | | <el-option :key="1" :value="1" label="下架"></el-option> |
| | |
| | | </el-form> |
| | | <!-- 表格和分页 --> |
| | | <template v-slot:table-wrap> |
| | | <ul class="toolbar" v-permissions="['business:goods:create', 'business:goods:delete']"> |
| | | <ul class="toolbar" > |
| | | <li><el-button type="primary" icon="el-icon-plus" @click="$refs.operaGoodsWindow.open('新建商品', null, 0)" v-permissions="['business:goods:create']">新建</el-button></li> |
| | | <li><el-button type="primary" icon="el-icon-edit" @click="issued(0)">上架</el-button></li> |
| | | <li><el-button type="danger" icon="el-icon-edit" @click="issued(1)">下架</el-button></li> |
| | | <li><p class="tip-warn" style="width: 100%;margin-left: 20px;"><i class="el-icon-warning"></i>提示:【供货价设置】只统计启用状态的供销商设置数据,(已定价供销商数/全部供销商数)</p></li> |
| | | </ul> |
| | | <el-table |
| | | v-loading="isWorking.search" |
| | |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table-column type="selection" width="55"></el-table-column> |
| | | <el-table-column prop="imgurl" label="商品信息" min-width="100px"> |
| | | <el-table-column prop="imgurl" label="商品信息" min-width="80px"> |
| | | <template slot-scope="{row}"> |
| | | <el-image style="width: 80px;height: 80px;" v-if="row.imgurl && row.imgurl!=''" :src="row.resourcePath+row.imgurl" :preview-src-list="[row.resourcePath+row.imgurl]"></el-image> |
| | | <el-image style="width: 50px;height: 50px;" v-if="row.imgurl && row.imgurl!=''" :src="row.resourcePath+row.imgurl" :preview-src-list="[row.resourcePath+row.imgurl]"></el-image> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="id" label="商品ID" min-width="150px" ></el-table-column> |
| | |
| | | <el-table-column prop="categoryName" label="所属分类" min-width="120px"></el-table-column> |
| | | <el-table-column prop="brandName" label="所属品牌" min-width="120px"></el-table-column> |
| | | <el-table-column prop="price" label="展示价格" min-width="100px"></el-table-column> |
| | | <el-table-column prop="stockNum" label="剩余库存量" min-width="100px"></el-table-column> |
| | | <el-table-column prop="salesVolume" label="实际销量" min-width="100px"></el-table-column> |
| | | <el-table-column prop="skuPrice" label="零售价(元)" min-width="100px"></el-table-column> |
| | | <el-table-column prop="skuPrice" label="销售价(元)" min-width="100px"></el-table-column> |
| | | <el-table-column prop="shopPrice" label="供货价设置" min-width="100px" align="center"> |
| | | <template slot-scope="{row}" > |
| | | <div @click="goPriceSet(row)" style="cursor:pointer;"><span class="red"> {{row.shopPriceNum||0}}</span> / <span class="green"> {{row.shopNum||0}}</span> </div> |
| | | <div title="针对启用供销商价格设置统计" @click="goPriceSet(row)" style="cursor:pointer;"><span class="red"> {{row.pricedShopNum||0}}</span> / <span class="green"> {{row.shopNum||0}}</span> </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="stockNum" label="剩余库存量" min-width="100px"></el-table-column> |
| | | <el-table-column prop="salesVolume" label="实际销量" min-width="100px"></el-table-column> |
| | | <el-table-column prop="editDate" label="最近更新时间" min-width="100px"></el-table-column> |
| | | <el-table-column prop="status" label="上下架状态" min-width="100px" fixed="right" align="center"> |
| | | <template slot-scope="{row}"> |
| | |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="操作" |
| | | min-width="250" |
| | | min-width="160" |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-button type="text" @click="$refs.operaGoodsWindow.open('编辑商品', row, 0)" v-permissions="['business:goods:update']">编辑</el-button> |
| | | <el-button type="text" @click="goPriceSet(row)">供货价</el-button> |
| | | <el-button type="text" v-if="row.status == 1" @click="$refs.operaGoodsWindow.open('编辑商品', row, 0)" v-permissions="['business:goods:update']">编辑</el-button> |
| | | <el-button type="text" v-permissions="['business:goods:update']" @click="goPriceSet(row)">供货价</el-button> |
| | | <el-button type="text" style="color: red;" @click="deleteById(row)" v-permissions="['business:goods:delete']">删除</el-button> |
| | | <!-- <el-button type="text" @click="$refs.operaGoodsDetailWindow.open('商品详情', row, 0)">查看详情</el-button>--> |
| | | <!-- <el-button type="text" @click="$refs.operaGoodsDetailWindow.open('商品详情', row, 0)">查看详情</el-button>--> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | <OperaGoodsWindow ref="operaGoodsWindow" @success="handlePageChange"/> |
| | | <OperaGoodsDetailWindow ref="operaGoodsDetailWindow"/> |
| | | <OperaPlatformGoodsSkuWindow ref="operaPlatformGoodsSkuWindow"/> |
| | | <OperaShopGoodsWindow ref="OperaShopGoodsWindow" @success="priceSuccess"/> |
| | | </TableLayout> |
| | | </template> |
| | | |
| | |
| | | import OperaGoodsWindow from '@/components/business/OperaGoodsWindow' |
| | | import OperaGoodsDetailWindow from '@/components/business/OperaGoodsDetailWindow' |
| | | import OperaPlatformGoodsSkuWindow from '@/components/business/OperaPlatformGoodsSkuWindow' |
| | | import OperaShopGoodsWindow from '@/components/business/OperaShopGoodsWindow' |
| | | import { findAll as labelList } from '@/api/business/labels' |
| | | export default { |
| | | name: 'Goods', |
| | | extends: BaseTable, |
| | | components: { TableLayout, Pagination, OperaGoodsWindow, OperaGoodsDetailWindow, OperaPlatformGoodsSkuWindow }, |
| | | components: { TableLayout, Pagination, OperaGoodsWindow, OperaGoodsDetailWindow, OperaPlatformGoodsSkuWindow, OperaShopGoodsWindow }, |
| | | data () { |
| | | return { |
| | | activeName: 'first', |
| | | // 搜索 |
| | | searchForm: { |
| | | id: '', |
| | | creator: '', |
| | | createDate: '', |
| | | editor: '', |
| | | editDate: '', |
| | | isdeleted: '', |
| | | remark: '', |
| | | imgurl: '', |
| | | name: '', |
| | | info: '', |
| | | categoryId: '', |
| | | brandId: '', |
| | | price: '', |
| | | salenum: '', |
| | | content: '', |
| | | sortnum: '', |
| | | looknum: '', |
| | | // 类型 0平台商城 1咖豆商城 2咖啡计划商品 |
| | | type: '0', // 平台商品 |
| | | status: '', |
| | | isrec: '', |
| | | styleImg: '', |
| | | labels: '' |
| | | }, |
| | | labels: [], |
| | | serials: [], |
| | | brands: [] |
| | | brands: [], |
| | | serials: [] |
| | | } |
| | | }, |
| | | provide () { |
| | |
| | | }) |
| | | }, |
| | | methods: { |
| | | goPriceSet(row){ |
| | | |
| | | priceSuccess () { |
| | | this.handlePageChange() |
| | | }, |
| | | goPriceSet (row) { |
| | | if (row.skuPrice == null) { |
| | | this.$tip.warning('请先设置商品销售价!') |
| | | return |
| | | } |
| | | this.$refs.OperaShopGoodsWindow.open('设置供货价 - ' + row.name, row) |
| | | }, |
| | | handleClick (val) { |
| | | |
| | | }, |
| | | /** |
| | | * |
| | |
| | | const message = `确认${status === 0 ? '上架' : '下架'}选中的商品么?` |
| | | this.$dialog.messageWaring(message) |
| | | .then(() => { |
| | | var temp = [] |
| | | this.tableData.selectedRows.forEach(item => { |
| | | temp.push({ id: item.id, name: item.name, status: status }) |
| | | }) |
| | | this.statusChangeBiz(temp) |
| | | }) |
| | | }, |
| | | statusChange (row) { |
| | |
| | | statusChangeBiz (rows) { |
| | | this.api.updateStatus(rows) |
| | | .then(() => { |
| | | this.search() |
| | | this.handlePageChange() |
| | | }) |
| | | .catch(e => { |
| | | this.search() |
| | | this.handlePageChange() |
| | | }) |
| | | } |
| | | } |