|
@@ -3,11 +3,11 @@
|
|
<a-card size="small" :bordered="false" class="promotion-wrap searchBoxNormal">
|
|
<a-card size="small" :bordered="false" class="promotion-wrap searchBoxNormal">
|
|
<!-- 搜索条件 -->
|
|
<!-- 搜索条件 -->
|
|
<div ref="tableSearch" class="table-page-search-wrapper">
|
|
<div ref="tableSearch" class="table-page-search-wrapper">
|
|
- <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
|
|
|
|
|
|
+ <a-form layout="inline" id="promotion-form" @keyup.enter.native="$refs.table.refresh(true)">
|
|
<a-row :gutter="15">
|
|
<a-row :gutter="15">
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
<a-form-item label="创建时间">
|
|
<a-form-item label="创建时间">
|
|
- <rangeDate ref="rangeCreateDate" :value="createDate" @change="dateCreateChange" />
|
|
|
|
|
|
+ <rangeDate id="promotion-createDate" ref="rangeCreateDate" :value="createDate" @change="dateCreateChange" />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
@@ -19,8 +19,8 @@
|
|
<a-form-item label="促销状态">
|
|
<a-form-item label="促销状态">
|
|
<v-select
|
|
<v-select
|
|
v-model="queryParam.publishState"
|
|
v-model="queryParam.publishState"
|
|
- ref="saleStatus"
|
|
|
|
- id="promotion-saleStatus"
|
|
|
|
|
|
+ ref="publishState"
|
|
|
|
+ id="promotion-publishState"
|
|
code="PROMO_STATE"
|
|
code="PROMO_STATE"
|
|
placeholder="请选择促销状态"
|
|
placeholder="请选择促销状态"
|
|
allowClear></v-select>
|
|
allowClear></v-select>
|
|
@@ -28,8 +28,8 @@
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
<span class="table-page-search-submitButtons">
|
|
<span class="table-page-search-submitButtons">
|
|
- <a-button type="primary" :disabled="disabled" @click="$refs.table.refresh(true)">查询</a-button>
|
|
|
|
- <a-button style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
|
|
|
|
|
|
+ <a-button type="primary" :disabled="disabled" id="promotion-refresh" @click="$refs.table.refresh(true)">查询</a-button>
|
|
|
|
+ <a-button style="margin-left: 8px" :disabled="disabled" id="promotion-reset" @click="resetSearchForm()">重置</a-button>
|
|
</span>
|
|
</span>
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
@@ -41,7 +41,7 @@
|
|
<a-spin :spinning="spinning" tip="Loading...">
|
|
<a-spin :spinning="spinning" tip="Loading...">
|
|
<!-- 操作按钮 -->
|
|
<!-- 操作按钮 -->
|
|
<div class="table-operator" v-if="$hasPermissions('B_promotionManagementAdd')">
|
|
<div class="table-operator" v-if="$hasPermissions('B_promotionManagementAdd')">
|
|
- <a-button type="primary" @click="openAddModal = true">新增</a-button>
|
|
|
|
|
|
+ <a-button type="primary" id="promotion-add-btn" @click="openAddModal = true">新增</a-button>
|
|
</div>
|
|
</div>
|
|
<s-table
|
|
<s-table
|
|
class="sTable fixPagination"
|
|
class="sTable fixPagination"
|
|
@@ -64,7 +64,7 @@
|
|
</template>
|
|
</template>
|
|
<!-- 参与客户 -->
|
|
<!-- 参与客户 -->
|
|
<template slot="joinCustomers" slot-scope="text, record">
|
|
<template slot="joinCustomers" slot-scope="text, record">
|
|
- <span @click="handleCustomers(record)" v-if="record.dealerSnList&&record.dealerSnList.length>0">共有<span class="link-bule">{{ record.dealerSnList.length }}</span>个客户</span>
|
|
|
|
|
|
+ <span @click="handleCustomers(record)" :id="'promotion-seeDealerInfo-'+record.id" v-if="record.dealerSnList&&record.dealerSnList.length>0">共有<span class="link-bule">{{ record.dealerSnList.length }}</span>个客户</span>
|
|
<span v-else>共有0个客户</span>
|
|
<span v-else>共有0个客户</span>
|
|
</template>
|
|
</template>
|
|
<!-- 促销描述 -->
|
|
<!-- 促销描述 -->
|
|
@@ -73,14 +73,14 @@
|
|
<template slot="title">
|
|
<template slot="title">
|
|
<span>{{ record.description }}</span>
|
|
<span>{{ record.description }}</span>
|
|
</template>
|
|
</template>
|
|
- <div @click="promotionDesc(record)" class="link-bule">{{ record.description }}</div>
|
|
|
|
|
|
+ <div @click="promotionDesc(record)" :id="'promotion-description-'+record.id" class="link-bule">{{ record.description }}</div>
|
|
</a-tooltip>
|
|
</a-tooltip>
|
|
<div v-else-if="!record.description" class="desc">--</div>
|
|
<div v-else-if="!record.description" class="desc">--</div>
|
|
- <div v-else @click="promotionDesc(record)" class="link-bule">{{ record.description }}</div>
|
|
|
|
|
|
+ <div v-else @click="promotionDesc(record)" :id="'promotion-description-'+record.id" class="link-bule">{{ record.description }}</div>
|
|
</template>
|
|
</template>
|
|
<!-- 促销展示 -->
|
|
<!-- 促销展示 -->
|
|
<template slot="salesShow" slot-scope="text, record">
|
|
<template slot="salesShow" slot-scope="text, record">
|
|
- <div @click="handleSaleShow(record)" v-if="record.contentType!='LINK'&&record.imageSet && record.imageSet.length>0">
|
|
|
|
|
|
+ <div @click="handleSaleShow(record)" :id="'promotion-seeImgInfo-'+record.id" v-if="record.contentType!='LINK'&&record.imageSet && record.imageSet.length>0">
|
|
<img :src="record.imageSet[0]" alt="图片走丢啦" width="60" />
|
|
<img :src="record.imageSet[0]" alt="图片走丢啦" width="60" />
|
|
</div>
|
|
</div>
|
|
<div v-else-if="record.contentType=='LINK'&&record.imageSet && record.imageSet.length>0">
|
|
<div v-else-if="record.contentType=='LINK'&&record.imageSet && record.imageSet.length>0">
|
|
@@ -96,37 +96,37 @@
|
|
size="small"
|
|
size="small"
|
|
type="link"
|
|
type="link"
|
|
class="button-warning"
|
|
class="button-warning"
|
|
|
|
+ :id="'promotion-edit-btn-'+record.id"
|
|
@click="promotionEdit(record)"
|
|
@click="promotionEdit(record)"
|
|
- v-if="(record.publishState=='UNPUBLISH' || record.publishState=='CLOSE') && $hasPermissions('B_promotionManagementEdit')"
|
|
|
|
- id="promotion-edit-btn">编辑</a-button>
|
|
|
|
|
|
+ v-if="(record.publishState=='UNPUBLISH' || record.publishState=='CLOSE') && $hasPermissions('B_promotionManagementEdit')">编辑</a-button>
|
|
<a-button
|
|
<a-button
|
|
size="small"
|
|
size="small"
|
|
type="link"
|
|
type="link"
|
|
class="button-warning"
|
|
class="button-warning"
|
|
|
|
+ :id="'promotion-modify-btn-'+record.id"
|
|
@click="handleRelease(record,'edit')"
|
|
@click="handleRelease(record,'edit')"
|
|
- v-if="((record.publishState=='PUBLISH'&&record.content!='/pagesB/promoDetail')||(record.publishState=='PUBLISH'&&record.content==='/pagesB/promoDetail'&&record.dealerEditFlag==='0') || record.publishState=='CLOSE')&&$hasPermissions('B_promotionManagementContent')"
|
|
|
|
- id="promotion-modify-btn">发布修改</a-button>
|
|
|
|
|
|
+ v-if="((record.publishState=='PUBLISH'&&record.content!='/pagesB/promoDetail')||(record.publishState=='PUBLISH'&&record.content==='/pagesB/promoDetail'&&record.dealerEditFlag==='0') || record.publishState=='CLOSE')&&$hasPermissions('B_promotionManagementContent')">发布修改</a-button>
|
|
<a-button
|
|
<a-button
|
|
size="small"
|
|
size="small"
|
|
type="link"
|
|
type="link"
|
|
class="button-success"
|
|
class="button-success"
|
|
@click="handleSee(record)"
|
|
@click="handleSee(record)"
|
|
v-if="(record.publishState=='PUBLISH' || record.publishState=='END')&&$hasPermissions('B_promotionManagementDetail')"
|
|
v-if="(record.publishState=='PUBLISH' || record.publishState=='END')&&$hasPermissions('B_promotionManagementDetail')"
|
|
- id="promotion-modify-btn">查看</a-button>
|
|
|
|
|
|
+ :id="'promotion-seeDetail-btn-'+record.id">查看</a-button>
|
|
<a-button
|
|
<a-button
|
|
size="small"
|
|
size="small"
|
|
type="link"
|
|
type="link"
|
|
class="button-info"
|
|
class="button-info"
|
|
@click="handleRelease(record,'add')"
|
|
@click="handleRelease(record,'add')"
|
|
v-if="record.publishState=='UNPUBLISH'&&$hasPermissions('B_promotionManagementContent')"
|
|
v-if="record.publishState=='UNPUBLISH'&&$hasPermissions('B_promotionManagementContent')"
|
|
- id="promotion-release-btn">发布</a-button>
|
|
|
|
|
|
+ :id="'promotion-release-btn-'+record.id">发布</a-button>
|
|
<a-button
|
|
<a-button
|
|
size="small"
|
|
size="small"
|
|
type="link"
|
|
type="link"
|
|
class="button-error"
|
|
class="button-error"
|
|
v-if="record.publishState=='UNPUBLISH'&&$hasPermissions('B_promotionManagementDel')"
|
|
v-if="record.publishState=='UNPUBLISH'&&$hasPermissions('B_promotionManagementDel')"
|
|
@click="handleDel(record)"
|
|
@click="handleDel(record)"
|
|
- id="promotion-del-btn">删除</a-button>
|
|
|
|
|
|
+ :id="'promotion-del-btn-'+record.id">删除</a-button>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</s-table>
|
|
</s-table>
|
|
@@ -147,6 +147,7 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import { commonMixin } from '@/utils/mixin'
|
|
import { commonMixin } from '@/utils/mixin'
|
|
|
|
+// 组件
|
|
import { STable, VSelect } from '@/components'
|
|
import { STable, VSelect } from '@/components'
|
|
import rangeDate from '@/views/common/rangeDate.vue'
|
|
import rangeDate from '@/views/common/rangeDate.vue'
|
|
import lookUpCustomersModal from './lookUpCustomersModal'
|
|
import lookUpCustomersModal from './lookUpCustomersModal'
|
|
@@ -154,7 +155,7 @@ import promotionDescModal from './promotionDescModal'
|
|
import promotionShowModal from './promotionShowModal'
|
|
import promotionShowModal from './promotionShowModal'
|
|
import addModal from './addModal'
|
|
import addModal from './addModal'
|
|
import detailModal from './detailModal'
|
|
import detailModal from './detailModal'
|
|
-import { updateShowFlag } from '@/api/promoTerminal'
|
|
|
|
|
|
+// 接口
|
|
import { promoActiveList, promoActiveDel } from '@/api/promoActive'
|
|
import { promoActiveList, promoActiveDel } from '@/api/promoActive'
|
|
export default {
|
|
export default {
|
|
name: 'PromotionList',
|
|
name: 'PromotionList',
|
|
@@ -163,25 +164,24 @@ export default {
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
spinning: false,
|
|
spinning: false,
|
|
- tableHeight: 0,
|
|
|
|
|
|
+ tableHeight: 0, // 表格高度
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
- openCustomerModal: false,
|
|
|
|
- openDescModal: false,
|
|
|
|
- openShowModal: false,
|
|
|
|
- openAddModal: false,
|
|
|
|
- openDetailModal: false,
|
|
|
|
|
|
+ openCustomerModal: false, // 打开参与客户弹窗
|
|
|
|
+ openDescModal: false, // 打开促销描述弹窗
|
|
|
|
+ openShowModal: false, // 打开促销展示弹窗
|
|
|
|
+ openAddModal: false, // 打开新增弹窗
|
|
|
|
+ openDetailModal: false, // 打开详情弹窗
|
|
createDate: [], // 创建时间
|
|
createDate: [], // 创建时间
|
|
- itemId: '',
|
|
|
|
|
|
+ itemId: '', // 当前活动sn
|
|
descCon: '', // 描述内容
|
|
descCon: '', // 描述内容
|
|
pageType: '', // 发布类型 add 促销发布 edit 发布修改
|
|
pageType: '', // 发布类型 add 促销发布 edit 发布修改
|
|
- dealerSn: [],
|
|
|
|
|
|
+ dealerSn: [], // 经销商sn
|
|
// 查询参数
|
|
// 查询参数
|
|
queryParam: {
|
|
queryParam: {
|
|
- beginDate: undefined,
|
|
|
|
- endDate: undefined,
|
|
|
|
- name: '',
|
|
|
|
- showFlag: undefined,
|
|
|
|
- publishState: undefined
|
|
|
|
|
|
+ beginDate: undefined, // 促销开始时间
|
|
|
|
+ endDate: undefined, // 促销结束时间
|
|
|
|
+ name: '', // 促销名称
|
|
|
|
+ publishState: undefined// 是否发布
|
|
},
|
|
},
|
|
// 加载数据方法 必须为 Promise 对象
|
|
// 加载数据方法 必须为 Promise 对象
|
|
loadData: parameter => {
|
|
loadData: parameter => {
|
|
@@ -195,7 +195,6 @@ export default {
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
data.list[i].no = no + i + 1
|
|
data.list[i].no = no + i + 1
|
|
- data.list[i].isEnable = data.list[i].showFlag + '' === '1'
|
|
|
|
}
|
|
}
|
|
this.disabled = false
|
|
this.disabled = false
|
|
}
|
|
}
|
|
@@ -203,7 +202,7 @@ export default {
|
|
return data
|
|
return data
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- columns: [
|
|
|
|
|
|
+ columns: [// 表头
|
|
{ title: '序号', dataIndex: 'no', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '序号', dataIndex: 'no', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '创建时间', dataIndex: 'createDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '创建时间', dataIndex: 'createDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '促销名称', dataIndex: 'name', width: '12%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
{ title: '促销名称', dataIndex: 'name', width: '12%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
@@ -242,24 +241,6 @@ export default {
|
|
this.$refs.showModal.pageInit({ type: record.contentType, con: record.content })
|
|
this.$refs.showModal.pageInit({ type: record.contentType, con: record.content })
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- // 修改显示状态
|
|
|
|
- changeFlagHandle (record) {
|
|
|
|
- const _data = {
|
|
|
|
- sn: record.promoActiveSn,
|
|
|
|
- showFlag: record.isEnable ? '1' : '0'
|
|
|
|
- }
|
|
|
|
- this.spinning = true
|
|
|
|
- updateShowFlag(_data).then(res => {
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- this.$message.success(res.message)
|
|
|
|
- this.$refs.table.refresh()
|
|
|
|
- this.spinning = false
|
|
|
|
- } else {
|
|
|
|
- this.$refs.table.refresh()
|
|
|
|
- this.spinning = false
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
// 促销编辑
|
|
// 促销编辑
|
|
promotionEdit (item) {
|
|
promotionEdit (item) {
|
|
this.itemId = item.promoActiveSn
|
|
this.itemId = item.promoActiveSn
|
|
@@ -295,12 +276,12 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ // 重置
|
|
resetSearchForm () {
|
|
resetSearchForm () {
|
|
this.$refs.rangeCreateDate.resetDate(this.createDate)
|
|
this.$refs.rangeCreateDate.resetDate(this.createDate)
|
|
this.queryParam.beginDate = undefined
|
|
this.queryParam.beginDate = undefined
|
|
this.queryParam.endDate = undefined
|
|
this.queryParam.endDate = undefined
|
|
this.queryParam.name = ''
|
|
this.queryParam.name = ''
|
|
- this.queryParam.showFlag = undefined
|
|
|
|
this.queryParam.publishState = undefined
|
|
this.queryParam.publishState = undefined
|
|
this.$refs.table.refresh(true)
|
|
this.$refs.table.refresh(true)
|
|
},
|
|
},
|
|
@@ -319,12 +300,14 @@ export default {
|
|
this.openDetailModal = false
|
|
this.openDetailModal = false
|
|
this.itemId = ''
|
|
this.itemId = ''
|
|
},
|
|
},
|
|
|
|
+ // 初始化
|
|
pageInit () {
|
|
pageInit () {
|
|
const _this = this
|
|
const _this = this
|
|
this.$nextTick(() => { // 页面渲染完成后的回调
|
|
this.$nextTick(() => { // 页面渲染完成后的回调
|
|
_this.setTableH()
|
|
_this.setTableH()
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ // 计算表格高度
|
|
setTableH () {
|
|
setTableH () {
|
|
const tableSearchH = this.$refs.tableSearch.offsetHeight
|
|
const tableSearchH = this.$refs.tableSearch.offsetHeight
|
|
this.tableHeight = window.innerHeight - tableSearchH - 240
|
|
this.tableHeight = window.innerHeight - tableSearchH - 240
|