|
@@ -5,17 +5,17 @@
|
|
|
<div ref="tableSearch" class="table-page-search-wrapper">
|
|
|
<a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
|
|
|
<a-row :gutter="15">
|
|
|
- <a-col :md="5" :sm="24">
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
<a-form-item label="创建时间">
|
|
|
<rangeDate ref="rangeDate" @change="dateChange" />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
- <a-col :md="5" :sm="24">
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
<a-form-item label="促销名称/简称">
|
|
|
<a-input id="promotionList-queryWord" v-model.trim="queryParam.queryWord" allowClear placeholder="请输入促销名称/简称"/>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
- <a-col :md="5" :sm="24">
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
<a-form-item label="发布状态">
|
|
|
<v-select
|
|
|
v-model="queryParam.enabledFlag"
|
|
@@ -26,7 +26,7 @@
|
|
|
allowClear></v-select>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
- <a-col :md="5" :sm="24">
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
<a-form-item label="活动状态">
|
|
|
<v-select
|
|
|
v-model="queryParam.state"
|
|
@@ -38,7 +38,12 @@
|
|
|
></v-select>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
- <a-col :md="4" :sm="24">
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="创建人">
|
|
|
+ <creatorList ref="creatorList" id="promotionList-creatorId" @change="creatorChange" />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
<span class="table-page-search-submitButtons">
|
|
|
<a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="promotionList-refresh">查询</a-button>
|
|
|
<a-button style="margin-left: 5px" @click="resetSearchForm()" :disabled="disabled" id="promotionList-reset">重置</a-button>
|
|
@@ -60,8 +65,11 @@
|
|
|
<a-card size="small" :bordered="false">
|
|
|
<a-spin :spinning="spinning" tip="Loading...">
|
|
|
<!-- 操作按钮 -->
|
|
|
- <div class="table-operator" v-if="$hasPermissions('B_dealerPromotionAdd')">
|
|
|
- <a-button id="promotionList-add" type="primary" @click="handleAdd">新增</a-button>
|
|
|
+ <div class="table-operator tableBtnSet" >
|
|
|
+ <a-button v-if="$hasPermissions('B_dealerPromotionAdd')" id="promotionList-add" type="primary" @click="handleAdd">新增</a-button>
|
|
|
+ <a-checkbox @change="handleDealerAudit" v-if="$hasPermissions('B_dealerAudit')" :checked="queryParam.dealerAuditFlag &&queryParam.dealerAuditFlag==1">
|
|
|
+ 待审核(修改参与客户)
|
|
|
+ </a-checkbox>
|
|
|
</div>
|
|
|
<!-- 列表 -->
|
|
|
<s-table
|
|
@@ -86,8 +94,10 @@
|
|
|
</template>
|
|
|
<!-- 参与客户 -->
|
|
|
<template slot="joinCustomers" slot-scope="text, record">
|
|
|
- <div v-if="record.dealerScope ==='ALL_DEALER'">全部客户</div>
|
|
|
- <div class="joinCustomer" v-else @click="handleCustomers(record)">共有<span style="color:#39f;vertical-align:top;">{{ record.dealerSnList?record.dealerSnList.length:0 }}</span>个客户</div>
|
|
|
+ <span class="joinCustomer" v-if="record.dealerScope ==='ALL_DEALER'" @click="handleCustomers(record)">全部客户</span>
|
|
|
+ <span class="joinCustomer" v-else @click="handleCustomers(record)">共有<span style="color:#39f;vertical-align:top;">{{ record.dealerSnList?record.dealerSnList.length:0 }}</span>个客户</span>
|
|
|
+ <a-badge count="审" v-show="record.dealerAuditFlag == 1 &&(record.state==='NOT_START'||record.state==='RUNNING') " :number-style="{ backgroundColor: '#F5222D', zoom:'80%' }" />
|
|
|
+ <!-- dealerAuditFlag 1 是 0否 -->
|
|
|
</template>
|
|
|
<!-- 发布状态 -->
|
|
|
<template slot="releaseStatus" slot-scope="text, record">
|
|
@@ -126,10 +136,10 @@
|
|
|
<a-button
|
|
|
size="small"
|
|
|
type="link"
|
|
|
- v-if="$hasPermissions('B_editTime')&&(record.state == 'NOT_START' || record.state=='RUNNING')"
|
|
|
+ v-if="$hasPermissions('B_editTime')&&(record.state == 'NOT_START' || record.state=='RUNNING' ||record.state == 'IS_OVER')"
|
|
|
@click="handleTime(record)"
|
|
|
class="button-info"
|
|
|
- id="promotionList-edit-btn">促销时间变更</a-button>
|
|
|
+ id="promotionList-edit-btn">时间变更</a-button>
|
|
|
<a-button
|
|
|
size="small"
|
|
|
type="link"
|
|
@@ -144,12 +154,26 @@
|
|
|
@click="handleDel(record)"
|
|
|
class="button-error"
|
|
|
id="promotionList-del-btn">删除</a-button>
|
|
|
- <div v-if="record.state == 'IS_OVER'">--</div>
|
|
|
+ <a-button
|
|
|
+ size="small"
|
|
|
+ type="link"
|
|
|
+ v-if="record.state != 'AUDIT_REJECT' &&$hasPermissions('B_dealerPromotionCopy')"
|
|
|
+ @click="handleCopyModal(record)"
|
|
|
+ class="button-info"
|
|
|
+ id="promotionList-edit-btn">复制</a-button>
|
|
|
</template>
|
|
|
</s-table>
|
|
|
</a-spin>
|
|
|
<!-- 参与客户 -->
|
|
|
- <lookUp-customers-modal ref="lookUpCustomers" :openModal="openCustomerModal" @close="openCustomerModal = false"></lookUp-customers-modal>
|
|
|
+ <lookUp-customers-modal
|
|
|
+ :itemSn="itemPromotionSn"
|
|
|
+ :showType="itemStatusType"
|
|
|
+ ref="lookUpCustomers"
|
|
|
+ :openModal="openCustomerModal"
|
|
|
+ :chooseDealerList="chooseDealerArr"
|
|
|
+ @submitAudit="editCustomerOk"
|
|
|
+ @handleAudit="auditCustomerOk"
|
|
|
+ @close="closeCustomer"></lookUp-customers-modal>
|
|
|
<!-- 新增/编辑弹窗-->
|
|
|
<add-modal v-drag :itemSn="itemSn" :openModal="openModal" @ok="handleOk" @close="openModal=false" />
|
|
|
<!-- 促销时间变更 -->
|
|
@@ -183,6 +207,34 @@
|
|
|
>审核通过</a-button>
|
|
|
</div>
|
|
|
</a-modal>
|
|
|
+ <!-- 复制弹窗 -->
|
|
|
+ <a-modal
|
|
|
+ closable
|
|
|
+ v-model="openCopyModal"
|
|
|
+ :footer="null"
|
|
|
+ width="416px"
|
|
|
+ centered>
|
|
|
+ <div class="copyContent">
|
|
|
+ <p>提示:</p>
|
|
|
+ <p>复制选择的促销活动,将在列表生成一条相同的【待提交】的促销活动,可进行编辑!</p>
|
|
|
+ <p>是否确认生成?</p>
|
|
|
+ <p>附件无法复制,请重新上传</p>
|
|
|
+ </div>
|
|
|
+ <!-- 按钮 -->
|
|
|
+ <div class="copyBtn">
|
|
|
+ <a-button
|
|
|
+ id="copyModal-cancel"
|
|
|
+ class="button-cancel"
|
|
|
+ @click="closeCopyModal"
|
|
|
+ style="margin-right: 15px;">取消</a-button>
|
|
|
+ <a-button
|
|
|
+ type="primary"
|
|
|
+ id="copyModal-save"
|
|
|
+ class="button-primary"
|
|
|
+ @click="handleCopy"
|
|
|
+ >确定</a-button>
|
|
|
+ </div>
|
|
|
+ </a-modal>
|
|
|
</a-card>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -191,16 +243,17 @@
|
|
|
import { commonMixin } from '@/utils/mixin'
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
import addModal from './addModal.vue'
|
|
|
-import lookUpCustomersModal from '../promotionManagement/lookUpCustomersModal'
|
|
|
+import lookUpCustomersModal from './lookUpCustomersModal'
|
|
|
import rangeDate from '@/views/common/rangeDate.vue'
|
|
|
+import creatorList from '@/views/common/creatorList.vue'
|
|
|
import editActiveEndTime from './editActiveEndTime.vue'
|
|
|
import supplier from '@/views/common/supplier.js'
|
|
|
import warehouse from '@/views/common/chooseWarehouse.js'
|
|
|
-import { dealerPromotionList, dealerPromotionDel, modifyEnabledFlag, promotionAudit, promotionIsOver } from '@/api/promotion'
|
|
|
+import { dealerPromotionList, dealerPromotionDel, modifyEnabledFlag, promotionAudit, promotionIsOver, handleCopyData, midwaySubmit, dealerMidwayAudit, updateDealerSnList } from '@/api/promotion'
|
|
|
export default {
|
|
|
name: 'PromotionManagementList',
|
|
|
mixins: [commonMixin],
|
|
|
- components: { STable, supplier, VSelect, rangeDate, warehouse, lookUpCustomersModal, addModal, editActiveEndTime },
|
|
|
+ components: { STable, supplier, VSelect, rangeDate, warehouse, lookUpCustomersModal, addModal, editActiveEndTime, creatorList },
|
|
|
data () {
|
|
|
return {
|
|
|
spinning: false,
|
|
@@ -216,18 +269,21 @@ export default {
|
|
|
endDate: undefined,
|
|
|
queryWord: '',
|
|
|
enabledFlag: undefined, // 发布状态
|
|
|
- state: undefined
|
|
|
+ state: undefined,
|
|
|
+ creatorId: undefined,
|
|
|
+ dealerAuditFlag: undefined
|
|
|
},
|
|
|
columns: [
|
|
|
{ title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
|
|
|
{ title: '创建时间', dataIndex: 'createDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '促销名称', scopedSlots: { customRender: 'promotionName' }, width: '18%', align: 'left' },
|
|
|
- { title: '促销简称', dataIndex: 'description', width: '14%', align: 'left', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '促销名称', scopedSlots: { customRender: 'promotionName' }, width: '16%', align: 'left' },
|
|
|
+ { title: '促销简称', dataIndex: 'description', width: '13%', align: 'left', customRender: function (text) { return text || '--' } },
|
|
|
{ title: '促销时间', scopedSlots: { customRender: 'promotionTime' }, width: '13%', align: 'center' },
|
|
|
- { title: '参与客户', scopedSlots: { customRender: 'joinCustomers' }, width: '7%', align: 'center', ellipsis: true },
|
|
|
+ { title: '参与客户', scopedSlots: { customRender: 'joinCustomers' }, width: '11%', align: 'center', ellipsis: true },
|
|
|
{ title: '促销描述', dataIndex: 'content', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
- { title: '活动状态', dataIndex: 'stateDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '发布状态', scopedSlots: { customRender: 'releaseStatus' }, width: '7%', align: 'center', ellipsis: true },
|
|
|
+ { title: '创建人', dataIndex: 'creatorName', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '活动状态', dataIndex: 'stateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '发布状态', scopedSlots: { customRender: 'releaseStatus' }, width: '6%', align: 'center', ellipsis: true },
|
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
|
|
|
],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
@@ -249,10 +305,18 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
itemSn: null, // 经销商促销活动SN
|
|
|
- openAuditModal: false // 审核弹窗
|
|
|
+ openAuditModal: false, // 审核弹窗,
|
|
|
+ openCopyModal: false, // 复制弹窗
|
|
|
+ itemPromotionSn: '',
|
|
|
+ itemStatusType: '',
|
|
|
+ chooseDealerArr: [] // 所选择经销商列表
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 创建人
|
|
|
+ creatorChange (val) {
|
|
|
+ this.queryParam.creatorId = val.key
|
|
|
+ },
|
|
|
// 详情
|
|
|
handleDetail (row) {
|
|
|
this.$router.push({ name: 'dealerPromotionManagementDetail', query: { sn: row.promotionSn } })
|
|
@@ -269,10 +333,20 @@ export default {
|
|
|
},
|
|
|
// 参与客户
|
|
|
handleCustomers (row) {
|
|
|
+ this.itemPromotionSn = row.promotionSn
|
|
|
+ if ((row.state === 'NOT_START' || row.state === 'RUNNING') && row.dealerAuditFlag && (row.dealerAuditFlag == 0 || row.dealerAuditFlag == 2)) {
|
|
|
+ this.itemStatusType = 'isEdit'
|
|
|
+ } else if ((row.state === 'NOT_START' || row.state === 'RUNNING') && row.dealerAuditFlag && row.dealerAuditFlag == 1) {
|
|
|
+ this.itemStatusType = 'isAudit'
|
|
|
+ } else {
|
|
|
+ this.itemStatusType = 'isClose'
|
|
|
+ }
|
|
|
+ this.getDealerSnList({ promotionSn: row.promotionSn })
|
|
|
+ },
|
|
|
+ async getDealerSnList (ajaxData) {
|
|
|
+ const dealerSnArr = await updateDealerSnList(ajaxData)
|
|
|
+ this.chooseDealerArr = dealerSnArr.data
|
|
|
this.openCustomerModal = true
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.lookUpCustomers.pageInit({ dealerSnList: row.dealerSnList })
|
|
|
- })
|
|
|
},
|
|
|
// 基本信息 保存
|
|
|
handleOk () {
|
|
@@ -306,6 +380,13 @@ export default {
|
|
|
handleSetRules (row) {
|
|
|
this.$router.push({ name: 'dealerPromotionManagementRule', query: { type: 'rule', sn: row.promotionSn } })
|
|
|
},
|
|
|
+ // 审核参与客户
|
|
|
+ handleDealerAudit (val) {
|
|
|
+ this.queryParam.dealerAuditFlag = val.target.checked ? '1' : undefined
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.table.refresh(true)
|
|
|
+ })
|
|
|
+ },
|
|
|
// 审核
|
|
|
handleCheck (row) {
|
|
|
const _this = this
|
|
@@ -331,6 +412,30 @@ export default {
|
|
|
_this.spinning = false
|
|
|
})
|
|
|
},
|
|
|
+ // 复制
|
|
|
+ handleCopyModal (row) {
|
|
|
+ this.itemSn = row.promotionSn
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.openCopyModal = true
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleCopy () {
|
|
|
+ const _this = this
|
|
|
+ _this.spinning = true
|
|
|
+ handleCopyData({ promotionSn: this.itemSn }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ _this.$message.success(res.message)
|
|
|
+ _this.$refs.table.refresh()
|
|
|
+ }
|
|
|
+ _this.itemSn = null
|
|
|
+ _this.openCopyModal = false
|
|
|
+ _this.spinning = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ closeCopyModal () {
|
|
|
+ this.itemSn = null
|
|
|
+ this.openCopyModal = false
|
|
|
+ },
|
|
|
// 促销时间变更
|
|
|
handleTime (row) {
|
|
|
this.editEndModal = true
|
|
@@ -389,18 +494,53 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ // 修改参与客户 参与客户提交审核
|
|
|
+ editCustomerOk () {
|
|
|
+ const _this = this
|
|
|
+ midwaySubmit({ promotionSn: _this.itemPromotionSn }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ _this.$message.success(res.message)
|
|
|
+ _this.$refs.table.refresh()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ auditCustomerOk (con) {
|
|
|
+ const _this = this
|
|
|
+ dealerMidwayAudit({ promotionSn: _this.itemPromotionSn, dealerAuditStatus: con }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ _this.$message.success(res.message)
|
|
|
+ _this.$refs.table.refresh()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ closeCustomer () {
|
|
|
+ this.openCustomerModal = false
|
|
|
+ this.itemPromotionSn = ''
|
|
|
+ this.chooseDealerArr = []
|
|
|
+ },
|
|
|
// 重置
|
|
|
resetSearchForm () {
|
|
|
+ // 获取创建人默认值
|
|
|
+ const creatorObj = this.$store.state.user.info
|
|
|
+ const newObj = {
|
|
|
+ key: creatorObj.userid,
|
|
|
+ name: creatorObj.userNameCN,
|
|
|
+ label: creatorObj.userNameCN
|
|
|
+ }
|
|
|
+ this.$refs.creatorList.setDefaultVal(newObj)
|
|
|
this.queryParam = {
|
|
|
beginDate: undefined,
|
|
|
endDate: undefined,
|
|
|
queryWord: '',
|
|
|
enabledFlag: undefined, // 发布状态
|
|
|
- state: undefined
|
|
|
+ state: undefined,
|
|
|
+ creatorId: creatorObj.userid,
|
|
|
+ dealerAuditFlag: undefined
|
|
|
}
|
|
|
this.$refs.rangeDate.resetDate()
|
|
|
this.$refs.table.refresh(true)
|
|
|
},
|
|
|
+
|
|
|
pageInit () {
|
|
|
const _this = this
|
|
|
this.$nextTick(() => { // 页面渲染完成后的回调
|
|
@@ -409,12 +549,11 @@ export default {
|
|
|
this.openModal = false
|
|
|
this.openDetailModal = false
|
|
|
this.itemSn = null
|
|
|
- this.rowSelectionInfo = null
|
|
|
this.$refs.table.clearTable()
|
|
|
},
|
|
|
setTableH () {
|
|
|
const tableSearchH = this.$refs.tableSearch.offsetHeight
|
|
|
- this.tableHeight = window.innerHeight - tableSearchH - 240
|
|
|
+ this.tableHeight = window.innerHeight - tableSearchH - 235
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
@@ -450,8 +589,33 @@ export default {
|
|
|
.nameBox{
|
|
|
padding:0 5px;
|
|
|
}
|
|
|
- .joinCustomer{
|
|
|
- cursor:pointer;
|
|
|
+ }
|
|
|
+ .joinCustomer{
|
|
|
+ cursor:pointer;
|
|
|
+ }
|
|
|
+ .copyContent{
|
|
|
+ margin:30px 10px 20px;
|
|
|
+ p{
|
|
|
+ margin-bottom:6px !important;
|
|
|
+ font-size:14px;
|
|
|
+ }
|
|
|
+ p:last-child{
|
|
|
+ font-size:12px;
|
|
|
+ color:#666;
|
|
|
+ text-align:right;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .copyBtn{
|
|
|
+ text-align:center;
|
|
|
+ button{
|
|
|
+ width: 45%;
|
|
|
+ height:40px;
|
|
|
+ line-height:40px;
|
|
|
}
|
|
|
}
|
|
|
+ .tableBtnSet{
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ }
|
|
|
</style>
|