|
|
@ -12,13 +12,7 @@ |
|
|
|
<a-input v-decorator="['goodsNo']" class="goodsWidth" placeholder="请输入商品编码" /> |
|
|
|
<a-input v-decorator="['goodsNo']" class="goodsWidth" placeholder="请输入商品编码" /> |
|
|
|
</a-form-item> |
|
|
|
</a-form-item> |
|
|
|
<a-form-item label="商品分类"> |
|
|
|
<a-form-item label="商品分类"> |
|
|
|
<a-tree-select |
|
|
|
<a-tree-select class="goodsWidth" :treeData="categoryListTree" :dropdownStyle="{ maxHeight: '500px', overflow: 'auto' }" allowClear v-decorator="['categoryId', { initialValue: 0 }]"></a-tree-select> |
|
|
|
class="goodsWidth" |
|
|
|
|
|
|
|
:treeData="categoryListTree" |
|
|
|
|
|
|
|
:dropdownStyle="{ maxHeight: '500px', overflow: 'auto' }" |
|
|
|
|
|
|
|
allowClear |
|
|
|
|
|
|
|
v-decorator="['categoryId', { initialValue: 0 }]" |
|
|
|
|
|
|
|
></a-tree-select> |
|
|
|
|
|
|
|
</a-form-item> |
|
|
|
</a-form-item> |
|
|
|
<a-form-item label="规格类型"> |
|
|
|
<a-form-item label="规格类型"> |
|
|
|
<a-select @change="onchangeSpecs" placeholder="请选择"> |
|
|
|
<a-select @change="onchangeSpecs" placeholder="请选择"> |
|
|
@ -65,6 +59,14 @@ |
|
|
|
</a-form-item> |
|
|
|
</a-form-item> |
|
|
|
</a-form> |
|
|
|
</a-form> |
|
|
|
</a-row> |
|
|
|
</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-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-modal> |
|
|
|
<!-- 操作板块 --> |
|
|
|
<!-- 操作板块 --> |
|
|
|
<div class="row-item-tab clearfix"> |
|
|
|
<div class="row-item-tab clearfix"> |
|
|
|
<div class="tab-list fl-l"> |
|
|
|
<div class="tab-list fl-l"> |
|
|
@ -78,15 +80,14 @@ |
|
|
|
</a-radio-group> |
|
|
|
</a-radio-group> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<a-button v-if="$auth('/goods/create') && (storeVersion === 0 || (storeVersion === 1 && isSuper === 0))" class="fl-l" type="primary" icon="plus" @click="handleCreate()">创建商品</a-button> |
|
|
|
<a-button v-if="$auth('/goods/create') && (storeVersion === 0 || (storeVersion === 1 && isSuper === 0))" class="fl-l" type="primary" icon="plus" @click="handleCreate()">创建商品</a-button> |
|
|
|
<a-button |
|
|
|
<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> |
|
|
|
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 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 v-if="storeVersion === 0 || (storeVersion === 1 && isSuper === 0)" class="fl-l" style="background-color: #f0baae; border: none" type="primary" @click="handleModify()">批量修改</a-button> |
|
|
|
<div v-if="selectedRowKeys.length" class="button-group"> |
|
|
|
<!-- <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> --> |
|
|
|
|
|
|
|
<div v-if="selectedRowKeys.length" class="button-group" style="margin-top:15px"> |
|
|
|
<a-button-group class="ml-10"> |
|
|
|
<a-button-group class="ml-10"> |
|
|
|
<a-button v-action:status icon="arrow-up" @click="handleUpdateStatus(selectedRowKeys, true)">上架</a-button> |
|
|
|
<a-button v-action:status icon="arrow-up" @click="handleUpdateStatus(selectedRowKeys, true)">上架</a-button> |
|
|
|
<a-button v-action:status icon="arrow-down" @click="handleUpdateStatus(selectedRowKeys, false)">下架</a-button> |
|
|
|
<a-button v-action:status icon="arrow-down" @click="handleUpdateStatus(selectedRowKeys, false)">下架</a-button> |
|
|
@ -97,16 +98,7 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<s-table |
|
|
|
<s-table ref="table" rowKey="goods_id" :loading="isLoading" :columns="columns" :data="loadData" :rowSelection="rowSelection" :pagination="pagination" :scroll="{ x: 1450 }"> |
|
|
|
ref="table" |
|
|
|
|
|
|
|
rowKey="goods_id" |
|
|
|
|
|
|
|
:loading="isLoading" |
|
|
|
|
|
|
|
:columns="columns" |
|
|
|
|
|
|
|
:data="loadData" |
|
|
|
|
|
|
|
:rowSelection="rowSelection" |
|
|
|
|
|
|
|
:pagination="pagination" |
|
|
|
|
|
|
|
:scroll="{ x: 1450 }" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<!-- 商品图片 --> |
|
|
|
<!-- 商品图片 --> |
|
|
|
<span slot="goods_image" slot-scope="text"> |
|
|
|
<span slot="goods_image" slot-scope="text"> |
|
|
|
<a title="点击查看原图" :href="text" target="_blank"> |
|
|
|
<a title="点击查看原图" :href="text" target="_blank"> |
|
|
@ -122,27 +114,17 @@ |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
<!-- 商品状态 --> |
|
|
|
<!-- 商品状态 --> |
|
|
|
<span slot="status" slot-scope="text, item"> |
|
|
|
<span slot="status" slot-scope="text, item"> |
|
|
|
<a-tag |
|
|
|
<a-tag class="cur-p" :color="text == 10 ? 'green' : 'red'" @click="handleUpdateStatus([item.goods_id], text != 10)">{{ text == 10 ? '上架' : '下架' }}</a-tag> |
|
|
|
class="cur-p" |
|
|
|
|
|
|
|
:color="text == 10 ? 'green' : 'red'" |
|
|
|
|
|
|
|
@click="handleUpdateStatus([item.goods_id], text != 10)" |
|
|
|
|
|
|
|
>{{ text == 10 ? '上架' : '下架' }}</a-tag> |
|
|
|
|
|
|
|
</span> |
|
|
|
</span> |
|
|
|
<!-- 京东下架 --> |
|
|
|
<!-- 京东下架 --> |
|
|
|
<span slot="is_jd_remove" slot-scope="text"> |
|
|
|
<span slot="is_jd_remove" slot-scope="text"> |
|
|
|
<p |
|
|
|
<p style="width: 40px;text-align: center;" :style="{ color: text == 1 ? 'red' : 'green'}"> |
|
|
|
style="width: 40px;text-align: center;" |
|
|
|
|
|
|
|
:style="{ color: text == 1 ? 'red' : 'green'}" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
{{ text == 1 ? '是' : '否' }} |
|
|
|
{{ text == 1 ? '是' : '否' }} |
|
|
|
</p> |
|
|
|
</p> |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
<!-- 商品池 --> |
|
|
|
<!-- 商品池 --> |
|
|
|
<span slot="is_pool" slot-scope="text"> |
|
|
|
<span slot="is_pool" slot-scope="text"> |
|
|
|
<p |
|
|
|
<p style="width: 40px" :style="{ color: text == 0 ? 'red' : text == 1 ? 'green' : 'gray' }"> |
|
|
|
style="width: 40px" |
|
|
|
|
|
|
|
:style="{ color: text == 0 ? 'red' : text == 1 ? 'green' : 'gray' }" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
{{ text == 0 ? '待处理' : text == 1 ? '已入池' : '未入池' }} |
|
|
|
{{ text == 0 ? '待处理' : text == 1 ? '已入池' : '未入池' }} |
|
|
|
</p> |
|
|
|
</p> |
|
|
|
</span> |
|
|
|
</span> |
|
|
@ -154,10 +136,7 @@ |
|
|
|
>编辑</router-link |
|
|
|
>编辑</router-link |
|
|
|
> --> |
|
|
|
> --> |
|
|
|
<a @click="handleEdit(item.goods_id)">编辑</a> |
|
|
|
<a @click="handleEdit(item.goods_id)">编辑</a> |
|
|
|
<router-link |
|
|
|
<router-link v-if="$module('goods-copy') && $auth('/goods/copy') && (storeVersion === 0 || (storeVersion === 1 && isSuper === 0))" :to="{ path: '/goods/copy', query: { goodsId: item.goods_id } }">复制</router-link> |
|
|
|
v-if="$module('goods-copy') && $auth('/goods/copy') && (storeVersion === 0 || (storeVersion === 1 && isSuper === 0))" |
|
|
|
|
|
|
|
:to="{ path: '/goods/copy', query: { goodsId: item.goods_id } }" |
|
|
|
|
|
|
|
>复制</router-link> |
|
|
|
|
|
|
|
<!-- <a v-if="storeVersion === 0 || (storeVersion === 1 && isSuper === 0)" v-action:delete @click="handleDelete([item.goods_id])">删除</a> --> |
|
|
|
<!-- <a v-if="storeVersion === 0 || (storeVersion === 1 && isSuper === 0)" v-action:delete @click="handleDelete([item.goods_id])">删除</a> --> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</s-table> |
|
|
|
</s-table> |
|
|
@ -304,8 +283,11 @@ export default { |
|
|
|
spec_type: '', |
|
|
|
spec_type: '', |
|
|
|
channel: '', |
|
|
|
channel: '', |
|
|
|
merchant_id: '', |
|
|
|
merchant_id: '', |
|
|
|
is_jd_remove:'' |
|
|
|
is_jd_remove: '' |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
paihang: '', |
|
|
|
|
|
|
|
setupIndex: 0, |
|
|
|
|
|
|
|
setupValue: 1, |
|
|
|
// 正在加载 |
|
|
|
// 正在加载 |
|
|
|
isLoading: false, |
|
|
|
isLoading: false, |
|
|
|
// 表头 |
|
|
|
// 表头 |
|
|
@ -343,7 +325,8 @@ export default { |
|
|
|
{ name: '否', val: 0 }, |
|
|
|
{ name: '否', val: 0 }, |
|
|
|
], |
|
|
|
], |
|
|
|
checkList: [], |
|
|
|
checkList: [], |
|
|
|
merchantList: [] |
|
|
|
merchantList: [], |
|
|
|
|
|
|
|
batchVisible: false |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
created() { |
|
|
|
created() { |
|
|
@ -371,13 +354,45 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
getGoodsJingDong(val){ |
|
|
|
getGoodsJingDong(val) { |
|
|
|
this.queryParam.is_jd_remove = val |
|
|
|
this.queryParam.is_jd_remove = val |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 批量修改 |
|
|
|
// 批量修改 |
|
|
|
handleModify() { |
|
|
|
handleModify() { |
|
|
|
this.$router.push('/goods/modify') |
|
|
|
this.$router.push('/goods/modify') |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
handleSetup(type) { |
|
|
|
|
|
|
|
this.paihang = ''; |
|
|
|
|
|
|
|
this.setupValue = 1; |
|
|
|
|
|
|
|
this.setupIndex = type |
|
|
|
|
|
|
|
this.batchVisible = true |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 停售 |
|
|
|
|
|
|
|
handleUpdateSetup(goodsIds, val, type) { |
|
|
|
|
|
|
|
this.isLoading = true |
|
|
|
|
|
|
|
let url = '' |
|
|
|
|
|
|
|
if (type == 1) { |
|
|
|
|
|
|
|
url = GoodsApi.setBrand({ goodsIds, is_brand: val }) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (type == 2) { |
|
|
|
|
|
|
|
url = GoodsApi.setNew({ goodsIds, is_new: val }) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (type == 3) { |
|
|
|
|
|
|
|
url = GoodsApi.setInstore({ goodsIds, is_in_store: val }) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (type == 4) { |
|
|
|
|
|
|
|
url = GoodsApi.setRank({ goodsIds, paihang: val }) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
url.then((result) => { |
|
|
|
|
|
|
|
this.batchVisible = false |
|
|
|
|
|
|
|
this.$message.success(result.message, 1.5) |
|
|
|
|
|
|
|
this.handleRefresh() |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.finally((result) => { |
|
|
|
|
|
|
|
this.$message.warning(result.message, 1.5) |
|
|
|
|
|
|
|
this.isLoading = false |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
// 导出 |
|
|
|
// 导出 |
|
|
|
handleExport(goodsIds) { |
|
|
|
handleExport(goodsIds) { |
|
|
|
const formData = this.searchForm.getFieldsValue() |
|
|
|
const formData = this.searchForm.getFieldsValue() |
|
|
|