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