|
|
|
@ -135,22 +135,22 @@ |
|
|
|
|
</div> |
|
|
|
|
<a-button class="fl-l" type="primary" icon="plus" @click="handleCreate()">创建商品</a-button> |
|
|
|
|
<a-button class="fl-l" icon="arrow-up" @click="handleImport()">批量导入</a-button> |
|
|
|
|
<div v-if="selectedRowKeys.length" class="button-group"> |
|
|
|
|
<div class="button-group"> |
|
|
|
|
<a-button-group class="ml-10"> |
|
|
|
|
<a-button |
|
|
|
|
<a-button v-if="selectedRowKeys.length" |
|
|
|
|
icon="arrow-up" |
|
|
|
|
style="background-color: red; color: #fff" |
|
|
|
|
@click="handleUpdateStatus(selectedRowKeys, 1)" |
|
|
|
|
>上架</a-button |
|
|
|
|
> |
|
|
|
|
<a-button |
|
|
|
|
<a-button v-if="selectedRowKeys.length" |
|
|
|
|
icon="arrow-down" |
|
|
|
|
style="background-color: gray; color: #fff" |
|
|
|
|
@click="handleUpdateStatus(selectedRowKeys, 2)" |
|
|
|
|
>移除</a-button |
|
|
|
|
> |
|
|
|
|
<a-button style="background-color: green; color: #fff; border: none" @click="visible = true">归类</a-button> |
|
|
|
|
<a-button style="background-color: blue; color: #fff; border: none" @click="saleVisible = true" |
|
|
|
|
<a-button v-if="selectedRowKeys.length" style="background-color: green; color: #fff; border: none" @click="visible = true">归类</a-button> |
|
|
|
|
<a-button v-if="selectedRowKeys.length" style="background-color: blue; color: #fff; border: none" @click="saleVisible = true" |
|
|
|
|
>停售</a-button |
|
|
|
|
> |
|
|
|
|
<a-button style="background-color: #6370e4; color: #fff; border: none" @click="priceVisible = true" |
|
|
|
@ -161,7 +161,7 @@ |
|
|
|
|
@click="handleExport(selectedRowKeys)" |
|
|
|
|
>导出</a-button |
|
|
|
|
> |
|
|
|
|
<a-button icon="delete" @click="handleDelete(selectedRowKeys)">删除</a-button> |
|
|
|
|
<a-button v-if="selectedRowKeys.length" icon="delete" @click="handleDelete(selectedRowKeys)">删除</a-button> |
|
|
|
|
</a-button-group> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
@ -210,10 +210,9 @@ |
|
|
|
|
<!-- 操作项 --> |
|
|
|
|
<div class="actions" style="width: 140px" slot="action" slot-scope="text, item"> |
|
|
|
|
<router-link :to="{ path: '/goods/update', query: { goodsId: item.goods_id } }">编辑</router-link> |
|
|
|
|
<!-- <router-link :to="{ path: '/goods/copy', query: { goodsId: item.goods_id } }">复制</router-link> --> |
|
|
|
|
<a @click="handleUpdateStatus([item.goods_id], 2)" v-if="item.is_pool == 1">下架</a> |
|
|
|
|
<a @click="handleUpdateStatus([item.goods_id], 1)" v-else>上架</a> |
|
|
|
|
<a @click="handleCopy(item.unicode)">复制</a> |
|
|
|
|
<a @click="handleCopy(item.goods_no)">复制</a> |
|
|
|
|
<a @click="handleDelete([item.goods_id])">删除</a> |
|
|
|
|
</div> |
|
|
|
|
</s-table> |
|
|
|
@ -567,7 +566,7 @@ export default { |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
this.isLoading = true |
|
|
|
|
GoodsApi.addPrice({ goodsIds, categoryIds, rate }) |
|
|
|
|
GoodsApi.addPrice({categoryIds, rate }) |
|
|
|
|
.then((result) => { |
|
|
|
|
this.priceVisible = false |
|
|
|
|
this.$message.success(result.message, 1.5) |
|
|
|
@ -595,27 +594,19 @@ export default { |
|
|
|
|
handleExport() { |
|
|
|
|
const formData = this.searchForm.getFieldsValue() |
|
|
|
|
this.isLoading = true |
|
|
|
|
GoodsApi.exportData(this.queryParam) |
|
|
|
|
.then((result) => { |
|
|
|
|
// this.exportData(result.data.list.data) |
|
|
|
|
this.$message.success(result.message, 1.5) |
|
|
|
|
this.handleRefresh() |
|
|
|
|
}) |
|
|
|
|
.finally((result) => { |
|
|
|
|
this.isLoading = false |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
exportData(itemList) { |
|
|
|
|
const content = itemList.map((item) => `${item.goods_id},${item.channel_name}`).join('\n') |
|
|
|
|
const blob = new Blob(['\ufeff', content], { type: 'text/csv;charset=utf-8;' }) |
|
|
|
|
const url = URL.createObjectURL(blob) |
|
|
|
|
const link = document.createElement('a') |
|
|
|
|
link.href = url |
|
|
|
|
link.setAttribute('download', 'export.csv') |
|
|
|
|
document.body.appendChild(link) |
|
|
|
|
link.click() |
|
|
|
|
document.body.removeChild(link) |
|
|
|
|
window.URL.revokeObjectURL(url) |
|
|
|
|
var index = window.serverConfig.BASE_API.indexOf("?") |
|
|
|
|
var resolve = window.serverConfig.BASE_API.substring(0, index); |
|
|
|
|
let params='&goodsName='+(formData.goodsName||'')+ |
|
|
|
|
'&goodsNo='+(formData.goodsNo||'')+'&goods_price_max='+(formData.goods_price_max || '')+'&goods_price_min='+(formData.goods_price_min || '')+ |
|
|
|
|
'&profit_rate_max='+(formData.profit_rate_max || '')+ |
|
|
|
|
'&profit_rate_min='+(formData.profit_rate_min || '')+ |
|
|
|
|
'&categoryId='+this.queryParam.categoryId+ |
|
|
|
|
'&channel='+this.queryParam.channel+ |
|
|
|
|
'&data_type='+this.queryParam.data_type+ |
|
|
|
|
'&is_pool='+this.queryParam.is_pool+ |
|
|
|
|
'&is_sale='+this.queryParam.is_sale+ |
|
|
|
|
'&is_self='+this.queryParam.is_self |
|
|
|
|
window.open(resolve+'?s=/admin/goods/export'+params) |
|
|
|
|
}, |
|
|
|
|
// 删除记录 |
|
|
|
|
handleDelete(goodsIds) { |
|
|
|
@ -663,10 +654,6 @@ export default { |
|
|
|
|
.tab-list { |
|
|
|
|
margin-right: 20px; |
|
|
|
|
} |
|
|
|
|
/deep/.ant-table-body { |
|
|
|
|
overflow-x: scroll; |
|
|
|
|
max-width: 1350px; |
|
|
|
|
} |
|
|
|
|
// 列表页-操作按钮组 |
|
|
|
|
.row-item-tab { |
|
|
|
|
display: flex; |
|
|
|
|