|
@@ -59,12 +59,18 @@
|
|
|
<a-card size="small" :bordered="false">
|
|
|
<!-- 操作按钮 -->
|
|
|
<div class="table-operator">
|
|
|
- <a-button type="primary" id="shoppingProductsList-addProduct-btn" v-if="itemCategorySn" @click="handleChooseProduct">选择产品</a-button>
|
|
|
- <a-button type="primary" v-else id="shoppingProductsList-import-btn" @click="handleAddProduct">产品导入</a-button>
|
|
|
+ <a-button type="primary" id="shoppingProductsList-addProduct-btn" v-if="$hasPermissions('B_category_chooseProduct')&&itemCategorySn" @click="handleChooseProduct">选择产品</a-button>
|
|
|
+ <a-button type="primary" v-if="$hasPermissions('B_shoppingProducts_import')&&!itemCategorySn" id="shoppingProductsList-import-btn" @click="handleAddProduct">产品导入</a-button>
|
|
|
<span v-if="productNum&&productNum*1>0">
|
|
|
- <a-button type="primary" id="shoppingProductsList-grounding-btn" class="button-info" @click="changeStatus('1')">批量上架</a-button>
|
|
|
- <a-button @click="changeStatus('0')" id="shoppingProductsList-off-btn">批量下架</a-button>
|
|
|
- <a-button type="primary" class="button-error" id="shoppingProductsList-delProduct-btn" ghost @click="handleDel()">批量删除</a-button>
|
|
|
+ <a-button type="primary" v-if="$hasPermissions('B_groundingProducts_btn')" id="shoppingProductsList-grounding-btn" class="button-info" @click="changeStatus('1')">批量上架</a-button>
|
|
|
+ <a-button v-if="$hasPermissions('B_offProducts_btn')" @click="changeStatus('0')" id="shoppingProductsList-off-btn">批量下架</a-button>
|
|
|
+ <a-button
|
|
|
+ v-if="$hasPermissions('B_delProducts_btn')"
|
|
|
+ type="primary"
|
|
|
+ class="button-error"
|
|
|
+ id="shoppingProductsList-delProduct-btn"
|
|
|
+ ghost
|
|
|
+ @click="handleDel()">批量删除</a-button>
|
|
|
<span v-if="rowSelectionInfo&&rowSelectionInfo.selectedRowKeys.length>0">已选{{ rowSelectionInfo&&rowSelectionInfo.selectedRowKeys.length }}项</span>
|
|
|
</span>
|
|
|
</div>
|
|
@@ -82,7 +88,7 @@
|
|
|
:pageSize="20"
|
|
|
:row-selection="{ columnWidth: 40}"
|
|
|
@rowSelection="rowSelectionFun"
|
|
|
- :scroll="{ y: itemCategorySn?tableHeight-100:tableHeight }"
|
|
|
+ :scroll="{ y: itemCategorySn?tableHeight-100:tableHeight-20 }"
|
|
|
:defaultLoadData="false"
|
|
|
bordered>
|
|
|
<!-- 产品编码 -->
|
|
@@ -97,7 +103,7 @@
|
|
|
</template>
|
|
|
<!-- 商城类目 -->
|
|
|
<template slot="categoryName" slot-scope="text, record">
|
|
|
- <span v-if="record.categoryName1 || record.categoryName2">{{ record.categoryName1 }} {{ record.categoryName2 ? '>' : '' }} {{ record.categoryName2 }}</span>
|
|
|
+ <span v-if="record.categoryName1 || record.categoryName2">{{ record.categoryName1 }} {{ (record.categoryName1&&record.categoryName2) ? '>' : '' }} {{ record.categoryName2 }}</span>
|
|
|
<span v-else>--</span>
|
|
|
</template>
|
|
|
<!-- 售价类型 -->
|
|
@@ -111,11 +117,11 @@
|
|
|
<span v-else>--</span>
|
|
|
</template>
|
|
|
<!-- 操作 -->
|
|
|
- <!-- v-if="$hasPermissions('B_chooseProductEdit_edit')" -->
|
|
|
<template slot="action" slot-scope="text, record">
|
|
|
<a-button
|
|
|
size="small"
|
|
|
type="link"
|
|
|
+ v-if="$hasPermissions('B_editProducts_btn')"
|
|
|
@click="handleEdit(record)"
|
|
|
class="button-info"
|
|
|
:id="'chooseProductEdit-edit-btn'+record.id">编辑</a-button>
|
|
@@ -124,19 +130,20 @@
|
|
|
type="link"
|
|
|
@click="changeStatus('1',record)"
|
|
|
class="button-info"
|
|
|
- v-if="record.status=='0'"
|
|
|
+ v-if="$hasPermissions('B_groundingProducts_btn')&&record.status=='0'"
|
|
|
:id="'chooseProductEdit-top-btn'+record.id">上架</a-button>
|
|
|
<a-button
|
|
|
size="small"
|
|
|
type="link"
|
|
|
@click="changeStatus('0',record)"
|
|
|
class="button-info"
|
|
|
- v-else
|
|
|
+ v-if="$hasPermissions('B_offProducts_btn')&&record.status!='0'"
|
|
|
:id="'chooseProductEdit-bottom-btn'+record.id">下架</a-button>
|
|
|
<a-button
|
|
|
size="small"
|
|
|
type="link"
|
|
|
class="button-error"
|
|
|
+ v-if="$hasPermissions('B_delProducts_btn')"
|
|
|
@click="handleDel(record)"
|
|
|
:id="'chooseProductEdit-del-btn'+record.id">删除</a-button>
|
|
|
</template>
|
|
@@ -247,16 +254,29 @@ export default {
|
|
|
{ title: '原厂编码', dataIndex: 'productOrigCode', align: 'center', width: '10%', customRender: function (text) { return text || '--' } },
|
|
|
{ title: '品牌', dataIndex: 'productBrandName', align: 'center', width: '10%', customRender: function (text) { return text || '--' } },
|
|
|
{ title: '产品分类', align: 'center', width: '15%', scopedSlots: { customRender: 'productType' } },
|
|
|
- { title: '售价', dataIndex: 'price', width: '7%', align: 'right', customRender: function (text) { return text || text == 0 ? _this.toThousands(text, 2) : '--' } },
|
|
|
+ // { title: '售价', dataIndex: 'price', width: '7%', align: 'right', customRender: function (text) { return text || text == 0 ? _this.toThousands(text, 2) : '--' } },
|
|
|
{ title: '售价类型', dataIndex: 'priceType', scopedSlots: { customRender: 'priceType' }, align: 'center', width: '10%' },
|
|
|
- { title: '终端价', dataIndex: 'terminalPrice', width: '7%', align: 'right', customRender: function (text) { return text || text == 0 ? _this.toThousands(text, 2) : '--' } },
|
|
|
- { title: '车主价', dataIndex: 'carOwnersPrice', width: '7%', align: 'right', customRender: function (text) { return text || text == 0 ? _this.toThousands(text, 2) : '--' } },
|
|
|
+ // { title: '终端价', dataIndex: 'terminalPrice', width: '7%', align: 'right', customRender: function (text) { return text || text == 0 ? _this.toThousands(text, 2) : '--' } },
|
|
|
+ // { title: '车主价', dataIndex: 'carOwnersPrice', width: '7%', align: 'right', customRender: function (text) { return text || text == 0 ? _this.toThousands(text, 2) : '--' } },
|
|
|
{ title: '热销产品', dataIndex: 'hotFlag', scopedSlots: { customRender: 'hotFlag' }, align: 'center', width: '6%' },
|
|
|
- { title: '优先级', dataIndex: 'hotSort', align: 'center', width: '7%', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '优先级', dataIndex: 'hotSort', align: 'center', width: '7%', customRender: function (text) { return (text || text == 0) ? text : '--' } },
|
|
|
{ title: '添加时间', dataIndex: 'createDate', align: 'center', width: '10%', customRender: function (text) { return text || '--' } },
|
|
|
{ title: '产品商城状态', dataIndex: 'statusDictValue', align: 'center', width: '6%', customRender: function (text) { return text || '--' } },
|
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '14%', align: 'center' }
|
|
|
]
|
|
|
+ // 售价
|
|
|
+ if (_this.$hasPermissions('M_shoppingProductsList_salesPrice')) {
|
|
|
+ arr.splice(6, 0, { title: '售价', dataIndex: 'price', width: '7%', align: 'right', customRender: function (text) { return text || text == 0 ? _this.toThousands(text, 2) : '--' } })
|
|
|
+ }
|
|
|
+ // 终端价
|
|
|
+ const pos = _this.$hasPermissions('M_shoppingProductsList_salesPrice') ? 8 : 7
|
|
|
+ if (_this.$hasPermissions('M_shoppingProductsList_salesPrice')) {
|
|
|
+ arr.splice(pos, 0, { title: '终端价', dataIndex: 'terminalPrice', width: '7%', align: 'right', customRender: function (text) { return text || text == 0 ? _this.toThousands(text, 2) : '--' } })
|
|
|
+ }
|
|
|
+ // 车主价
|
|
|
+ if (_this.$hasPermissions('M_shoppingProductsList_carOwnersPrice')) {
|
|
|
+ arr.splice((pos * 1 + 1), 0, { title: '车主价', dataIndex: 'carOwnersPrice', width: '7%', align: 'right', customRender: function (text) { return text || text == 0 ? _this.toThousands(text, 2) : '--' } })
|
|
|
+ }
|
|
|
if (!_this.itemCategorySn) {
|
|
|
arr.splice(6, 0, { title: '商城类目', scopedSlots: { customRender: 'categoryName' }, width: '15%', align: 'center' })
|
|
|
}
|