| | |
| | | </li> |
| | | <!-- <el-button type="primary" :loading="isWorking.export" |
| | | @click="$refs.selectProduct.open('选择平台商品')">选择平台商品</el-button> --> |
| | | <li v-permissions="['business:basegoods:exportExcel']"> |
| | | <li v-permissions="['business:basegoods:exportExcel', 'business:goods:delete']"> |
| | | <ImportButton text="导入" template-name="goods_import_modle.xlsx" |
| | | template-path="/template/goods_import_modle.xlsx" action="/business/baseGoods/importExcel" |
| | | @success="search" /> |
| | | </li> |
| | | <el-button type="primary" :loading="isWorking.export" @click="bulkOperation(0)">批量上架</el-button> |
| | | <el-button type="primary" :loading="isWorking.export" @click="bulkOperation(1)">批量下架</el-button> |
| | | <!-- <li><el-button @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:goods:delete']">删除</el-button></li> --> |
| | | <li> |
| | | <el-button type="primary" :loading="isWorking.export" @click="bulkOperation(0)">批量上架</el-button> |
| | | </li> |
| | | <li> |
| | | <el-button type="primary" :loading="isWorking.export" @click="bulkOperation(1)">批量下架</el-button> |
| | | </li> |
| | | <li v-permissions="['business:goods:delete']"><el-button @click="deleteByIdInBatch" style="color: red;">批量删除</el-button></li> |
| | | </ul> |
| | | <el-table v-loading="isWorking.search" :data="tableData.list" stripe border :header-cell-style="rowStyle" |
| | | :cell-style="rowStyle" @selection-change="handleSelectionChange"> |
| | |
| | | <el-table-column prop="zdPrice" label="指导价(元)" min-width="100px"></el-table-column> |
| | | <el-table-column prop="price" label="采购价(元)" min-width="100px"></el-table-column> |
| | | <el-table-column prop="createDate" label="创建时间" min-width="100px"></el-table-column> |
| | | <el-table-column prop="status" label="状态" min-width="100px"> |
| | | <el-table-column prop="status" v-if="containPermissions(['business:basegoods:update'])" label="状态" min-width="100px"> |
| | | <template slot-scope="{row}"> |
| | | <el-switch v-model="row.status" @change="changeStatus(row)" active-color="#13ce66" inactive-color="#ff4949" |
| | | :active-value="0" :inactive-value="1"> |
| | |
| | | import OperaGoodsWindow from '@/components/business/OperaGoodsWindow' |
| | | import selectProduct from '@/components/business/selectProduct' |
| | | import ImportButton from '@/components/common/ImportButton' |
| | | import { brand, baseCategory, importExcel } from '@/api/system/common.js' |
| | | import { brand, baseCategory } from '@/api/system/common.js' |
| | | import { updateStatus, queryById, exportDoc } from '@/api/business/goods.js' |
| | | export default { |
| | | name: 'Goods', |
| | |
| | | this.getcategory() |
| | | }, |
| | | methods: { |
| | | handleSelectionChange(e) { |
| | | let arr = e.map(item => item.id) |
| | | this.ids = arr.join(',') |
| | | this.idList = arr; |
| | | }, |
| | | // handleSelectionChange(e) { |
| | | // let arr = e.map(item => item.id) |
| | | // this.ids = arr.join(',') |
| | | // this.idList = arr; |
| | | // }, |
| | | // 批量上下架 |
| | | bulkOperation(type) { |
| | | if (!this.ids) { |
| | | this.$message.warning({ message: '至少选择一项内容' }) |
| | | if (this.tableData.selectedRows.length === 0) { |
| | | this.$tip.warning('请至少选择一条数据') |
| | | return |
| | | } |
| | | let idList = this.tableData.selectedRows.map(item => item.id) |
| | | updateStatus({ |
| | | idList: this.idList, |
| | | idList, |
| | | status: type |
| | | }).then(res => { |
| | | this.$tip.apiSuccess('操作成功'); |
| | | // this.$message.success({ message:res.message }) |
| | | this.search() |
| | | this.handlePageChange() |
| | | }) |
| | | }, |
| | | downloadFile() { |
| | |
| | | status: item.status |
| | | }).then(res => { |
| | | this.$tip.apiSuccess('更新成功') |
| | | }).finally(() => { |
| | | // this.search() |
| | | }) |
| | | .catch (err => { |
| | | this.$message.error(err) |
| | | } ) |
| | | .finally(() => { |
| | | this.handlePageChange() |
| | | }) |
| | | }, |
| | | getbrand() { |