Commit 1fdd4e09 by zhangquan

修改门店列表

1 parent 5b227c61
......@@ -66,7 +66,8 @@ const getconfigMerchant = params => {
}
// 分页查询频道主题(内容)列表
const getChannelTopicList = params => {
params.method = `scrm.api.shopmall.discover.channel.topic.page`
params.method = params.apiType == 5 ? `scrm.api.shopmall.goods.configuration.page` : `scrm.api.shopmall.discover.channel.topic.page`
if(params.apiType == 5) params.pageNum = params.currentPage
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
......
......@@ -269,6 +269,7 @@ export default {
// this.getCategory()
const urlParam = this.$route.params
this.routeInfo = JSON.parse(decodeURIComponent(urlParam.id))
console.log(this.routeInfo)
const { id, type } = this.routeInfo
if(id){
this.disabled = type == 1
......@@ -385,9 +386,9 @@ export default {
const params = {
id: this.routeInfo.id
}
if(this.routeInfo.merchantId) params.merchantId= this.routeInfo.merchantId
this.$apis.goods.getGoodsDetail(params).then(res => {
if(res) {
console.log(res, 12355)
for(const key in this.formObj){
const formatAttr = ['depositPrice', 'minSellPrice', 'retailPrice']
if(formatAttr.includes(key)){
......
......@@ -298,14 +298,12 @@
this.$refs.channelRef.data.length ? (this.$refs.channelRef.tableHeightValues = '') : this.$refs.channelRef.setTableHeightFun()
},
handleAdd(row={},type){
const params = {
id: row.id
}
const params = {}
let title = '新增商品'
if(type){
params.id = row.id
params.type = type
title = type == 1 ? '新增' : '查看'
title = type == 1 ? '查看商品' : '编辑商品'
}
const queryStr = encodeURIComponent(JSON.stringify(params))
......
......@@ -16,6 +16,34 @@
</div>
</div>
<GLTable ref="editRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :beforeSearchFn="beforeSearchFn" :tableParams="tableParams" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun">
<div slot="imageSlot" class="table-image" slot-scope="scope">
<el-popover placement="top" width="160" trigger="hover" popper-class="table-popover-block">
<img class="table-popover-img" :src="scope.scope.goodsImage" />
<img class="img-36 pointer" slot="reference" :src="scope.scope.goodsImage" />
</el-popover>
</div>
<div slot="statusSlot" slot-scope="scope">
<span :class="['status', scope.scope.goodsStatus==1 ? 'success-status': 'error-status']"></span>
<span>{{scope.scope.goodsStatus==1 ? '上架' : '下架' }}</span>
</div>
<div slot="merchantPriceSlot" slot-scope="scope">
<template v-if="scope.scope.merchantList && scope.scope.merchantList.length > 1">
<span>{{ filterData(scope.scope).slice(0, 1).join('、') }}</span>
<el-popover
placement="top"
width="400"
trigger="hover">
<div v-for="(item,index) in filterData(scope.scope)" :key="index">
{{item}}
</div>
<span class="more-info" slot="reference">...[{{ scope.scope.merchantList.length }}]</span>
</el-popover>
</template>
<template v-else>
<span v-if="!scope.scope.merchantList || !scope.scope.merchantList.length">--</span>
<span v-else>{{ filterData(scope.scope).join('、') }}</span>
</template>
</div>
<template slot="activityLink" slot-scope="scope">
<span class="relink">{{ scope.scope.activityName }}</span>
</template>
......@@ -26,17 +54,20 @@
<el-switch v-model="scope.scope.isOpen" @change="updateState(scope.scope)"></el-switch>
</template>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<template v-if="scope.scope.confType != 1">
<el-button type="text" v-if="scope.scope.contentType == 1" @click="handleConfig(scope.scope)">{{ scope.scope.status == 0 ? '待配置' : '编辑' }}</el-button>
<template v-else>
<el-button type="text" v-if="scope.scope.status == 1 && scope.scope.topStatus == 0" @click="handleTop(scope.scope)">置顶</el-button>
<el-button type="text" @click="handleAddContent(scope.scope)">编辑</el-button>
<el-button type="text" v-if="scope.scope.status == 1" @click="handleOut(scope.scope, '下架')">下架</el-button>
<el-button type="text" v-if="scope.scope.status == 2" @click="handleOut(scope.scope, '上架')">上架</el-button>
<el-button type="text" v-if="scope.scope.status == 2" @click="handleDelect(scope.scope)">删除</el-button>
<template v-if="activeName==5"> <el-button type="text" @click="viewGoods(scope.scope, 1)">查看</el-button></template>
<template v-else>
<template v-if="scope.scope.confType != 1">
<el-button type="text" v-if="scope.scope.contentType == 1" @click="handleConfig(scope.scope)">{{ scope.scope.status == 0 ? '待配置' : '编辑' }}</el-button>
<template v-else>
<el-button type="text" v-if="scope.scope.status == 1 && scope.scope.topStatus == 0" @click="handleTop(scope.scope)">置顶</el-button>
<el-button type="text" @click="handleAddContent(scope.scope)">编辑</el-button>
<el-button type="text" v-if="scope.scope.status == 1" @click="handleOut(scope.scope, '下架')">下架</el-button>
<el-button type="text" v-if="scope.scope.status == 2" @click="handleOut(scope.scope, '上架')">上架</el-button>
<el-button type="text" v-if="scope.scope.status == 2" @click="handleDelect(scope.scope)">删除</el-button>
</template>
</template>
<span v-else>--</span>
</template>
<span v-else>--</span>
</div>
</GLTable>
</div>
......@@ -95,13 +126,31 @@ export default {
filter: '2'
},
{
label: '商品名称',
name: 'goodsName',
type: 'input',
filter: '5'
},
{
label: '创建日期',
name: 'createdDate',
type: 'date',
addHtml: 'createdDate',
isClear: true,
filter: '1,2,3,4'
}
filter: '1,2,3,4,5'
},
{
label: '商户名称',
name: 'merchantName',
type: 'input',
filter: '5'
},
{
label: '商品分类',
name: 'channelName',
type: 'input',
filter: '5'
},
],
getListApi: this.$apis.store.getChannelTopicList,
tableParams: {
......@@ -175,7 +224,48 @@ export default {
},
filter: '3,4'
},
{
label: '商品名称',
prop: 'goodsName',
filter: '5'
},
{
label: '缩略图',
addHtml: 'imageSlot',
filter: '5'
},
{
label: '收款方式',
formatter: cellValue => {
return cellValue.paymentType==1 ? '全款' : '定金+尾款'
},
filter: '5'
},
{
label: '定金(元)',
formatter: cellValue => {
return cellValue.depositPrice ? Number((Number(cellValue.depositPrice)/100).toFixed(2)) : '--'
},
filter: '5'
},
{
label: '门店活动价(元)',
width: 200,
addHtml: 'merchantPriceSlot',
filter: '5'
},
{
label: '分类',
formatter: cellValue => {
return `${cellValue.associationClassifyFirstName||''}-${cellValue.associationClassifySecondName||''}`
},
filter: '5'
},
{
label: '状态',
addHtml: 'statusSlot',
filter: '5'
},
{
label: '状态',
prop: 'status',
......@@ -187,14 +277,14 @@ export default {
{
label: '创建日期',
prop: 'createdDate',
filter: '1,2,3,4',
filter: '1,2,3,4,5',
minWidth: 180
},
{
label: '更新日期',
prop: 'updatedDate',
minWidth: 180,
filter: '1,2,3,4'
filter: '1,2,3,4,5'
},
{
label: '操作人',
......@@ -202,6 +292,11 @@ export default {
filter: '1,2,3,4'
},
{
label: '操作人',
prop: 'operator',
filter: '5'
},
{
label: '操作',
addHtml: 'auth-button',
width: 220,
......@@ -242,6 +337,12 @@ export default {
SET_CHANNEL_STYLE: 'channel/SET_CHANNEL_STYLE',
SET_CHANNEL_TYPE: 'channel/SET_CHANNEL_TYPE'
}),
filterData({merchantList: list}){
return list?.map(item => {
let activityPrice = item.activityPrice ? Number((Number(item.activityPrice)/100).toFixed(2)) : 0
return `${item.merchantName || '--'}:${activityPrice || '0'}`
}) || []
},
getParams() {
var params = JSON.parse(JSON.stringify(this.tableSearchForm))
// if (this.tableSearchForm.createDate.length) {
......@@ -255,6 +356,10 @@ export default {
beforeSearchFn() {
return new Promise(resolve => {
this.searchForm = this.getParams()
if(this.activeName == 5){
this.searchForm.apiType = 5
this.searchForm.merchantId =this.merchantId
}
// delete this.searchForm.createDate
resolve()
})
......@@ -319,6 +424,18 @@ export default {
handleConfig(val) {
this.$router.push(`/store/content?topicId=${val.topicId}&channelType=-1&$title=新增配置`)
},
viewGoods(row={},type){
const params = {}
let title = '新增商品'
if(type){
params.id = row.id
params.type = type
params.merchantId = this.merchantId
title = type == 1 ? '查看商品' : '编辑商品'
}
const queryStr = encodeURIComponent(JSON.stringify(params))
this.$router.push({ path: `/goods/add/`+queryStr,query: { $title: title }})
},
handleClick() {
this.SET_CHANNEL_TYPE({ channelType: this.activeName })
this.tabPaneList.forEach(item => {
......@@ -414,5 +531,24 @@ export default {
color: #333333;
}
}
.status{
width: 6px;
height: 6px;
border-radius: 50%;
display: inline-block;
vertical-align: middle;
margin-right: 8px;
}
.success-status{
background-color: #37C67F;
}
.error-status{
background-color: #999999;
}
.more-info{
white-space: nowrap;
color: #5850FF;
cursor: pointer;
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!