|
@ -5,12 +5,7 @@ |
|
|
<div> |
|
|
<div> |
|
|
<i class="el-icon-search" /> |
|
|
<i class="el-icon-search" /> |
|
|
<span>筛选搜索</span> |
|
|
<span>筛选搜索</span> |
|
|
<el-button |
|
|
<el-button style="float: right" type="primary" size="small" @click="searchBrandList()"> |
|
|
style="float: right" |
|
|
|
|
|
type="primary" |
|
|
|
|
|
size="small" |
|
|
|
|
|
@click="searchBrandList()" |
|
|
|
|
|
> |
|
|
|
|
|
查询结果 |
|
|
查询结果 |
|
|
</el-button> |
|
|
</el-button> |
|
|
</div> |
|
|
</div> |
|
@ -25,23 +20,13 @@ |
|
|
<el-card class="operate-container" shadow="never"> |
|
|
<el-card class="operate-container" shadow="never"> |
|
|
<i class="el-icon-tickets" /> |
|
|
<i class="el-icon-tickets" /> |
|
|
<span>数据列表</span> |
|
|
<span>数据列表</span> |
|
|
<el-button |
|
|
<el-button class="btn-add" size="mini" @click="addBrand()"> |
|
|
class="btn-add" |
|
|
|
|
|
size="mini" |
|
|
|
|
|
@click="addBrand()" |
|
|
|
|
|
> |
|
|
|
|
|
添加 |
|
|
添加 |
|
|
</el-button> |
|
|
</el-button> |
|
|
</el-card> |
|
|
</el-card> |
|
|
<div class="table-container"> |
|
|
<div class="table-container"> |
|
|
<el-table |
|
|
<el-table ref="brandTable" v-loading="listLoading" :data="list" style="width: 100%" border |
|
|
ref="brandTable" |
|
|
@selection-change="handleSelectionChange"> |
|
|
v-loading="listLoading" |
|
|
|
|
|
:data="list" |
|
|
|
|
|
style="width: 100%" |
|
|
|
|
|
border |
|
|
|
|
|
@selection-change="handleSelectionChange" |
|
|
|
|
|
> |
|
|
|
|
|
<el-table-column type="selection" width="60" align="center" /> |
|
|
<el-table-column type="selection" width="60" align="center" /> |
|
|
<el-table-column label="编号" width="100" align="center"> |
|
|
<el-table-column label="编号" width="100" align="center"> |
|
|
<template slot-scope="scope">{{ scope.row.id }}</template> |
|
|
<template slot-scope="scope">{{ scope.row.id }}</template> |
|
@ -49,107 +34,77 @@ |
|
|
<el-table-column label="品牌名称" align="center"> |
|
|
<el-table-column label="品牌名称" align="center"> |
|
|
<template slot-scope="scope">{{ scope.row.name }}</template> |
|
|
<template slot-scope="scope">{{ scope.row.name }}</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column label="品牌首字母" width="100" align="center"> |
|
|
<el-table-column label="品牌首字母" width="150" align="center"> |
|
|
<template slot-scope="scope">{{ scope.row.firstLetter }}</template> |
|
|
<template slot-scope="scope">{{ scope.row.firstLetter }}</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column label="排序" width="100" align="center"> |
|
|
<el-table-column label="排序" width="100" align="center"> |
|
|
<template slot-scope="scope">{{ scope.row.sort }}</template> |
|
|
<template slot-scope="scope">{{ scope.row.sort }}</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column label="品牌制造商" width="100" align="center"> |
|
|
<el-table-column label="是否配送" width="180" align="center"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
<el-switch |
|
|
<el-switch v-model="scope.row.delivery" active-text="配送" inactive-text="不配送" |
|
|
v-model="scope.row.factoryStatus" |
|
|
:active-value="'1'" :inactive-value="'0'" |
|
|
:active-value="1" |
|
|
@change="handleDeliveryChange(scope.$index, scope.row)" /> |
|
|
:inactive-value="0" |
|
|
|
|
|
@change="handleFactoryStatusChange(scope.$index, scope.row)" |
|
|
|
|
|
/> |
|
|
|
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
|
|
|
<!-- <el-table-column label="品牌制造商" width="150" align="center"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<el-switch v-model="scope.row.factoryStatus" :active-value="1" :inactive-value="0" |
|
|
|
|
|
@change="handleFactoryStatusChange(scope.$index, scope.row)" /> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> --> |
|
|
<el-table-column label="是否显示" width="100" align="center"> |
|
|
<el-table-column label="是否显示" width="100" align="center"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
<el-switch |
|
|
<el-switch v-model="scope.row.showStatus" :active-value="1" :inactive-value="0" |
|
|
v-model="scope.row.showStatus" |
|
|
@change="handleShowStatusChange(scope.$index, scope.row)" /> |
|
|
:active-value="1" |
|
|
|
|
|
:inactive-value="0" |
|
|
|
|
|
@change="handleShowStatusChange(scope.$index, scope.row)" |
|
|
|
|
|
/> |
|
|
|
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column label="相关" width="220" align="center"> |
|
|
<el-table-column label="相关" width="220" align="center"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
<span>商品:</span> |
|
|
<span>商品:</span> |
|
|
<el-button |
|
|
<el-button size="mini" type="text" @click="getProductList(scope.$index, scope.row)">100 |
|
|
size="mini" |
|
|
|
|
|
type="text" |
|
|
|
|
|
@click="getProductList(scope.$index, scope.row)" |
|
|
|
|
|
>100 |
|
|
|
|
|
</el-button> |
|
|
</el-button> |
|
|
<span>评价:</span> |
|
|
<span>评价:</span> |
|
|
<el-button |
|
|
<el-button size="mini" type="text" |
|
|
size="mini" |
|
|
@click="getProductCommentList(scope.$index, scope.row)">1000 |
|
|
type="text" |
|
|
|
|
|
@click="getProductCommentList(scope.$index, scope.row)" |
|
|
|
|
|
>1000 |
|
|
|
|
|
</el-button> |
|
|
</el-button> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column label="操作" width="200" align="center"> |
|
|
<el-table-column label="操作" width="200" align="center"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
<el-button |
|
|
<el-button size="mini" @click="handleUpdate(scope.$index, scope.row)">编辑 |
|
|
size="mini" |
|
|
|
|
|
@click="handleUpdate(scope.$index, scope.row)" |
|
|
|
|
|
>编辑 |
|
|
|
|
|
</el-button> |
|
|
</el-button> |
|
|
<el-button |
|
|
<el-button size="mini" type="danger" @click="handleDelete(scope.$index, scope.row)">删除 |
|
|
size="mini" |
|
|
|
|
|
type="danger" |
|
|
|
|
|
@click="handleDelete(scope.$index, scope.row)" |
|
|
|
|
|
>删除 |
|
|
|
|
|
</el-button> |
|
|
</el-button> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
</el-table> |
|
|
</el-table> |
|
|
</div> |
|
|
</div> |
|
|
<div class="batch-operate-container"> |
|
|
<!-- <div class="batch-operate-container"> |
|
|
<el-select |
|
|
<el-select v-model="operateType" size="small" placeholder="批量操作"> |
|
|
v-model="operateType" |
|
|
<el-option v-for="item in operates" :key="item.value" :label="item.label" :value="item.value" /> |
|
|
size="small" |
|
|
|
|
|
placeholder="批量操作" |
|
|
|
|
|
> |
|
|
|
|
|
<el-option |
|
|
|
|
|
v-for="item in operates" |
|
|
|
|
|
:key="item.value" |
|
|
|
|
|
:label="item.label" |
|
|
|
|
|
:value="item.value" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-select> |
|
|
</el-select> |
|
|
<el-button |
|
|
<el-button style="margin-left: 20px" class="search-button" type="primary" size="small" |
|
|
style="margin-left: 20px" |
|
|
@click="handleBatchOperate()"> |
|
|
class="search-button" |
|
|
|
|
|
type="primary" |
|
|
|
|
|
size="small" |
|
|
|
|
|
@click="handleBatchOperate()" |
|
|
|
|
|
> |
|
|
|
|
|
确定 |
|
|
确定 |
|
|
</el-button> |
|
|
</el-button> |
|
|
</div> |
|
|
</div> --> |
|
|
<div class="pagination-container"> |
|
|
<div class="pagination-container"> |
|
|
<el-pagination |
|
|
<el-pagination background layout="total, sizes,prev, pager, next,jumper" :page-size="listQuery.pageSize" |
|
|
background |
|
|
:page-sizes="[5,10,15]" :current-page.sync="listQuery.pageNum" :total="total" |
|
|
layout="total, sizes,prev, pager, next,jumper" |
|
|
@size-change="handleSizeChange" @current-change="handleCurrentChange" /> |
|
|
:page-size="listQuery.pageSize" |
|
|
|
|
|
:page-sizes="[5,10,15]" |
|
|
|
|
|
:current-page.sync="listQuery.pageNum" |
|
|
|
|
|
:total="total" |
|
|
|
|
|
@size-change="handleSizeChange" |
|
|
|
|
|
@current-change="handleCurrentChange" |
|
|
|
|
|
/> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
<script> |
|
|
<script> |
|
|
import { fetchList, updateShowStatus, updateFactoryStatus, deleteBrand } from '@/api/brand' |
|
|
import { |
|
|
|
|
|
fetchList, |
|
|
|
|
|
updateDelivery, |
|
|
|
|
|
updateShowStatus, |
|
|
|
|
|
updateFactoryStatus, |
|
|
|
|
|
deleteBrand |
|
|
|
|
|
} from '@/api/brand' |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
name: 'BrandList', |
|
|
name: 'BrandList', |
|
@ -188,7 +143,12 @@ |
|
|
this.multipleSelection = val |
|
|
this.multipleSelection = val |
|
|
}, |
|
|
}, |
|
|
handleUpdate(index, row) { |
|
|
handleUpdate(index, row) { |
|
|
this.$router.push({ path: '/pms/updateBrand', query: { id: row.id }}) |
|
|
this.$router.push({ |
|
|
|
|
|
path: '/pms/updateBrand', |
|
|
|
|
|
query: { |
|
|
|
|
|
id: row.id |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
}, |
|
|
}, |
|
|
handleDelete(index, row) { |
|
|
handleDelete(index, row) { |
|
|
this.$confirm('是否要删除该品牌', '提示', { |
|
|
this.$confirm('是否要删除该品牌', '提示', { |
|
@ -212,6 +172,24 @@ |
|
|
getProductCommentList(index, row) { |
|
|
getProductCommentList(index, row) { |
|
|
console.log(index, row) |
|
|
console.log(index, row) |
|
|
}, |
|
|
}, |
|
|
|
|
|
handleDeliveryChange(index, row) { |
|
|
|
|
|
var data = new URLSearchParams() |
|
|
|
|
|
data.append('ids', row.id) |
|
|
|
|
|
data.append('delivery', row.delivery) |
|
|
|
|
|
updateDelivery(data).then(response => { |
|
|
|
|
|
this.$message({ |
|
|
|
|
|
message: '修改成功', |
|
|
|
|
|
type: 'success', |
|
|
|
|
|
duration: 1000 |
|
|
|
|
|
}) |
|
|
|
|
|
}).catch(error => { |
|
|
|
|
|
if (row.delivery === 0) { |
|
|
|
|
|
row.delivery = 1 |
|
|
|
|
|
} else { |
|
|
|
|
|
row.delivery = 0 |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
handleFactoryStatusChange(index, row) { |
|
|
handleFactoryStatusChange(index, row) { |
|
|
var data = new URLSearchParams() |
|
|
var data = new URLSearchParams() |
|
|
data.append('ids', row.id) |
|
|
data.append('ids', row.id) |
|
@ -302,7 +280,9 @@ |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
addBrand() { |
|
|
addBrand() { |
|
|
this.$router.push({ path: '/pms/addBrand' }) |
|
|
this.$router.push({ |
|
|
|
|
|
path: '/pms/addBrand' |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -310,4 +290,3 @@ |
|
|
<style rel="stylesheet/scss" lang="scss" scoped> |
|
|
<style rel="stylesheet/scss" lang="scss" scoped> |
|
|
|
|
|
|
|
|
</style> |
|
|
</style> |
|
|
|
|
|
|
|
|