<template>
|
<div class="dealerMgt">
|
<list-condition-template
|
ref="table"
|
:form="listQuery"
|
:formLabel="formLabel"
|
:tableData="tableData"
|
:total="total"
|
@page-info-change="pageInfoChange"
|
:isExistBtn="true"
|
>
|
<template slot="otherElement">
|
<el-col class="formLayout" :xs='12' :sm='12' :md='12' :lg='6' :offset="0">
|
<el-form-item label="门店城市:" prop="aeraId">
|
<address-component ref="addressComponent" :adressArr.sync='adressArray'></address-component>
|
</el-form-item>
|
</el-col>
|
<el-col :span="24" :offset="0" class="buttonPosition">
|
<el-button size="mini" type="primary" @click="queryData">查询</el-button>
|
<el-button size="mini" @click="resetQuery">重置</el-button>
|
</el-col>
|
</template>
|
<template slot="columns">
|
<el-table-column label="门店名称" prop="shopName" width="180px" show-overflow-tooltip></el-table-column>
|
<el-table-column label="门店电话" width="180px" prop="shopPhone"></el-table-column>
|
<el-table-column label="门店联系人" prop="linkMan" width="120px"></el-table-column>
|
<el-table-column label="联系电话" width="120px" prop="linkPhone"></el-table-column>
|
<el-table-column label="门店地址" min-width="100px" show-overflow-tooltip>
|
<template slot-scope="scope">
|
{{scope.row.province}}{{scope.row.city}}{{scope.row.aera}} {{scope.row.areaMapName}} {{scope.row.shopAddress}}
|
</template>
|
</el-table-column>
|
<el-table-column label="门店状态" prop="isDeleted" :formatter="formatter"></el-table-column>
|
<el-table-column label="关联经销商" prop="ecMarketMerchant.merchantName" width="160px"></el-table-column>
|
<el-table-column label="创建时间" prop="createTime" width="180px"></el-table-column>
|
<el-table-column label="更新时间" prop="updateTime" width="180px">
|
<template slot-scope="scope">
|
{{scope.row.updateTime ? scope.row.updateTime : '暂无更新时间'}}
|
</template>
|
</el-table-column>
|
</template>
|
</list-condition-template>
|
</div>
|
</template>
|
<script>
|
import { ecMarketShopManageGetShopByBiz } from '../../../api/MarketingMgt/dealerMgt'
|
import addressComponent from '@/components/formTemplate/addressComponent.vue'
|
var _this = null
|
export default {
|
components: { addressComponent },
|
data () {
|
return {
|
tableData: [],
|
adressArray: [],
|
total: 0,
|
listQuery: {
|
shopName: null,
|
linkMan: null,
|
startDate: null,
|
endDate: null,
|
isDeleted: null,
|
updateTime: null,
|
aeraId: null
|
},
|
formLabel: [
|
{
|
model: 'startDate',
|
label: '创建时间',
|
type: 'date',
|
pickerOptions: {
|
disabledDate (time) {
|
return _this.listQuery.endDate && time.getTime() >= new Date(_this.listQuery.endDate).getTime() + 86400000
|
}
|
},
|
timeClass: 'start-time-style'
|
},
|
{
|
model: 'endDate',
|
label: '-',
|
customLabel: '创建时间',
|
type: 'date',
|
labelWidth: '20px',
|
pickerOptions: {
|
disabledDate (time) {
|
return _this.listQuery.startDate && time.getTime() <= new Date(_this.listQuery.startDate).getTime() - 86400000
|
}
|
},
|
timeClass: 'end-time-style'
|
},
|
{
|
model: 'shopName',
|
label: '门店名称',
|
type: 'input'
|
},
|
{
|
model: 'linkMan',
|
label: '联系人',
|
type: 'input'
|
},
|
{
|
model: 'isDeleted',
|
label: '门店状态',
|
type: 'select',
|
opts: [
|
{
|
id: '0',
|
name: '启用'
|
},
|
{
|
id: '1',
|
name: '停用'
|
}
|
]
|
},
|
{
|
model: 'updateTime',
|
label: '更新时间',
|
type: 'date'
|
}
|
]
|
}
|
},
|
/**
|
* 数据变化后刷新列表
|
*/
|
mounted () {
|
this.queryList(this.$refs.table.getPageInfo())
|
_this = this
|
},
|
methods: {
|
// 删除
|
delItem (row, index) {},
|
/**
|
* 编辑
|
*/
|
updateItem (row, index) {},
|
/**
|
* '分页信息改变时查询列表
|
*/
|
pageInfoChange (pageInfo) {
|
this.queryList(pageInfo)
|
},
|
formatter (row, column, cellValue, index) {
|
switch (row.isDeleted) {
|
case '0': return '启用'
|
case '1': return '停用'
|
default: return ''
|
}
|
},
|
/**
|
* 重置
|
*/
|
resetQuery () {
|
this.adressArray = []
|
this.listQuery.merchantId = null
|
this.$route.params.merchantId = null
|
this.$refs.table.reloadCurrent()
|
},
|
/**
|
* 点击查询按钮
|
*/
|
queryData () {
|
this.$refs.table.changeCondition()
|
},
|
/**
|
* 查询列表
|
*/
|
queryList (pageInfo = { pageNum: 1, pageSize: 10 }) {
|
const length = this.adressArray.length
|
this.listQuery.aeraId = length ? this.adressArray[length - 1] : null
|
this.listQuery.merchantId = this.$route.params.merchantId ? this.$route.params.merchantId : null
|
ecMarketShopManageGetShopByBiz(Object.assign({ param: this.listQuery }, pageInfo)).then(res => {
|
if (res.data) {
|
this.tableData = res.data.list
|
this.total = res.data.total
|
}
|
})
|
}
|
}
|
}
|
</script>
|
<style scoped lang="scss">
|
.dealerMgt{
|
.formLayout{
|
display: flex;
|
.el-form-item{
|
flex-grow:1;
|
/deep/.el-cascader{
|
width:calc(100% - 82px);
|
}
|
}
|
}
|
}
|
</style>
|