|
|
|
@ -59,13 +59,18 @@ |
|
|
|
|
</a-form-item> |
|
|
|
|
</a-form> |
|
|
|
|
</a-row> |
|
|
|
|
<a-modal v-model:visible="batchVisible" width="300px" :title="setupIndex==1?'设置是否大牌正品':setupIndex==2?'设置是否新品首发':setupIndex==3?'设置是否店内':'设置所属分类排行'" @ok="handleUpdateSetup(selectedRowKeys,setupIndex!=4?setupValue:paihang,setupIndex)"> |
|
|
|
|
<a-select v-if="setupIndex!=4" v-model="setupValue" style="width: 250px;margin:10px 0" placeholder="请选择"> |
|
|
|
|
<a-modal v-model:visible="batchVisible" width="300px" :title="setupIndex==1?'设置是否大牌正品':setupIndex==2?'设置是否新品首发':setupIndex==3?'设置是否店内':'设置所属分类排行'" @ok="handleUpdateSetup(selectedRowKeys,setupValue,setupIndex)"> |
|
|
|
|
<a-select v-model="setupValue" style="width: 250px;margin:10px 0" placeholder="请选择"> |
|
|
|
|
<a-select-option :value="item.val" v-for="item in isYesNo" :key="item.val"> |
|
|
|
|
{{ item.name }} |
|
|
|
|
</a-select-option> |
|
|
|
|
</a-select> |
|
|
|
|
<a-input v-model="paihang" v-else placeholder="请输入所属分类排行值" style="width: 250px;margin:10px 0" /> |
|
|
|
|
<!-- <a-input v-model="paihang" v-else placeholder="请输入所属分类排行值" style="width: 250px;margin:10px 0" /> --> |
|
|
|
|
</a-modal> |
|
|
|
|
<!-- 操作板块 --> |
|
|
|
|
<a-modal v-model:visible="categoryVisible" width="450px" title="商品分类" @ok="handleUpdateClassify(selectedRowKeys, categoryIds)"> |
|
|
|
|
<a-tree-select style="min-width: 400px" placeholder="请选择商品分类" :dropdownStyle="{ maxHeight: '500px', overflow: 'auto' }" :treeData="categoryListTree" treeCheckable treeCheckStrictly allowClear |
|
|
|
|
@change="onChangeCategory"></a-tree-select> |
|
|
|
|
</a-modal> |
|
|
|
|
<!-- 操作板块 --> |
|
|
|
|
<div class="row-item-tab clearfix"> |
|
|
|
@ -83,10 +88,11 @@ |
|
|
|
|
<a-button v-if="$module('goods-import') && $auth('/goods/import/batch') && (storeVersion === 0 || (storeVersion === 1 && isSuper === 0))" class="fl-l" icon="arrow-up" @click="handleImport()">批量导入</a-button> |
|
|
|
|
<a-button style="background-color: #501212; color: #fff; border: none" @click="handleExport(selectedRowKeys)">导出</a-button> |
|
|
|
|
<a-button v-if="storeVersion === 0 || (storeVersion === 1 && isSuper === 0)" class="fl-l" style="background-color: #f0baae; border: none" type="primary" @click="handleModify()">批量修改</a-button> |
|
|
|
|
<!-- <a-button style="background-color: #9E7AFF; color: #fff; border: none" v-if="selectedRowKeys.length" @click="handleSetup(1)">设置大牌</a-button> |
|
|
|
|
<a-button v-if="selectedRowKeys.length" style="background-color: green; color: #fff; border: none; border-radius: 2px" @click="categoryVisible = true">归类</a-button> |
|
|
|
|
<a-button style="background-color: #9E7AFF; color: #fff; border: none" v-if="selectedRowKeys.length" @click="handleSetup(1)">设置大牌</a-button> |
|
|
|
|
<a-button style="background-color: #FB322A; color: #fff; border: none" v-if="selectedRowKeys.length" @click="handleSetup(2)">设置新品</a-button> |
|
|
|
|
<a-button style="background-color: #1184D2; color: #fff; border: none" v-if="selectedRowKeys.length" @click="handleSetup(3)">设置店内</a-button> |
|
|
|
|
<a-button style="background-color: #EEA507; color: #fff; border: none" v-if="selectedRowKeys.length" @click="handleSetup(4)">设置排行榜</a-button> --> |
|
|
|
|
<a-button style="background-color: #EEA507; color: #fff; border: none" v-if="selectedRowKeys.length" @click="handleSetup(4)">设置排行榜</a-button> |
|
|
|
|
<div v-if="selectedRowKeys.length" class="button-group" style="margin-top:15px"> |
|
|
|
|
<a-button-group class="ml-10"> |
|
|
|
|
<a-button v-action:status icon="arrow-up" @click="handleUpdateStatus(selectedRowKeys, true)">上架</a-button> |
|
|
|
@ -285,7 +291,6 @@ export default { |
|
|
|
|
merchant_id: '', |
|
|
|
|
is_jd_remove: '' |
|
|
|
|
}, |
|
|
|
|
paihang: '', |
|
|
|
|
setupIndex: 0, |
|
|
|
|
setupValue: 1, |
|
|
|
|
// 正在加载 |
|
|
|
@ -326,7 +331,9 @@ export default { |
|
|
|
|
], |
|
|
|
|
checkList: [], |
|
|
|
|
merchantList: [], |
|
|
|
|
batchVisible: false |
|
|
|
|
batchVisible: false, |
|
|
|
|
categoryVisible: false, |
|
|
|
|
categoryIds: [], |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
created() { |
|
|
|
@ -361,8 +368,31 @@ export default { |
|
|
|
|
handleModify() { |
|
|
|
|
this.$router.push('/goods/modify') |
|
|
|
|
}, |
|
|
|
|
// 归类 |
|
|
|
|
onChangeCategory(list) { |
|
|
|
|
this.categoryIds = [] |
|
|
|
|
list.forEach((item) => { |
|
|
|
|
this.categoryIds.push(item.value) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
handleUpdateClassify(goodsIds, categoryIds) { |
|
|
|
|
if (categoryIds.length == 0) { |
|
|
|
|
this.$message.warn('请至少选择1个商品分类', 1.5) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
this.isLoading = true |
|
|
|
|
GoodsApi.category({ goodsIds, categoryIds }) |
|
|
|
|
.then((result) => { |
|
|
|
|
// 显示成功 |
|
|
|
|
this.categoryVisible = false |
|
|
|
|
this.$message.success(result.message, 1.5) |
|
|
|
|
this.handleRefresh() |
|
|
|
|
}) |
|
|
|
|
.finally((result) => { |
|
|
|
|
this.isLoading = false |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
handleSetup(type) { |
|
|
|
|
this.paihang = ''; |
|
|
|
|
this.setupValue = 1; |
|
|
|
|
this.setupIndex = type |
|
|
|
|
this.batchVisible = true |
|
|
|
@ -381,7 +411,7 @@ export default { |
|
|
|
|
url = GoodsApi.setInstore({ goodsIds, is_in_store: val }) |
|
|
|
|
} |
|
|
|
|
if (type == 4) { |
|
|
|
|
url = GoodsApi.setRank({ goodsIds, paihang: val }) |
|
|
|
|
url = GoodsApi.setRank({ goodsIds, is_paihang: val }) |
|
|
|
|
} |
|
|
|
|
url.then((result) => { |
|
|
|
|
this.batchVisible = false |
|
|
|
|