Commit cdb134f9 by caoyanzhi

update: 卡券营销-按钮权限

parent cf58cf75
......@@ -6,7 +6,7 @@
<el-option v-for="(item, index) in destoryType" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
<el-input v-model="listParams.search" class="w300" placeholder="请输入卡券名称" clearable @change="refresh"><i slot="prefix" class="el-input__icon el-icon-search"></i></el-input>
<el-button class="fr" type="danger" @click="showDialog('add', {})">卡券销毁</el-button>
<el-button class="fr" type="danger" v-if="$getButtonLimit($buttonCode.marketingDestoryCard2)" :limit-code="$buttonCode.marketingDestoryCard2" @click="showDialog('add', {})">卡券销毁</el-button>
</div>
<el-table tooltipEffect="light" :data="tableList" style="width: 100%">
<el-table-column :show-overflow-tooltip="true" min-width="120" align="left" prop="cardName" label="卡券名称">
......@@ -46,7 +46,7 @@
</el-table-column>
<el-table-column label="操作" align="left" width="120px" fixed="right">
<template slot-scope="scope">
<el-button type="text" @click="exportExcel(scope.row)">导出结果</el-button>
<el-button type="text" v-if="$getButtonLimit($buttonCode.marketingDownloadDestoryCard)" :limit-code="$buttonCode.marketingDownloadDestoryCard" @click="exportExcel(scope.row)">导出结果</el-button>
</template>
</el-table-column>
</el-table>
......
......@@ -25,7 +25,7 @@
</ul>
<div class="text-center" v-if="tableList.length === 0">
<img class="block block-center pt100" width="60" height="60" src="../../assets/img/no-data_icon.png" alt="" />
<el-button class="block block-center mt10" type="text" @click="addCard">新增卡券</el-button>
<el-button class="block block-center mt10" type="text" v-if="$getButtonLimit($buttonCode.marketingAddCard)" :limit-code="$buttonCode.marketingAddCard" @click="addCard">新增卡券</el-button>
</div>
<adjust-stock :show.sync="adjustStock" :totalCount="currentCard.couponStock" :coupCardId="currentCard.coupCardId" @refresh="delayRefresh"></adjust-stock>
<dm-pagination v-show="tableList.length" background class="dm-pagination" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="listParams.currentPage" :page-sizes="[20, 40, 60, 80]" :page-size="listParams.pageSize" layout="total, sizes, prev, pager, next" :total="total"></dm-pagination>
......
......@@ -5,7 +5,7 @@
<dm-activity-select class="vertical-middle w150 mr5" width="150" :actId.sync="listParams.marketingActivityId" onlySelect @actUpdate="refresh"></dm-activity-select>
<el-input v-model="listParams.search" class="w300" placeholder="请输入卡券包名称/创建人" clearable @change="refresh"><i slot="prefix" class="el-input__icon el-icon-search"></i></el-input>
<el-checkbox v-if="$store.state.marketing.isShowSelf" class="vertical-middle" v-model="listParams.showSelfFlag" :true-label="1" :false-label="0" label="仅看本人" border @change="refresh" />
<el-button class="fr" type="primary" @click="$router.push('/card/merge/add')">新建卡券包</el-button>
<el-button class="fr" type="primary" v-if="$getButtonLimit($buttonCode.marketingAddCardBag)" :limit-code="$buttonCode.marketingAddCardBag" @click="$router.push('/card/merge/add')">新建卡券包</el-button>
</div>
<el-table tooltipEffect="light" :data="tableList" style="width: 100%">
<el-table-column :show-overflow-tooltip="true" min-width="140" align="left" prop="name" label="卡券包名称"></el-table-column>
......@@ -34,10 +34,10 @@
<el-table-column min-width="100" align="left" prop="creatorName" label="创建人" v-if="$store.state.marketing.openFlag"></el-table-column>
<el-table-column label="操作" align="left" width="200px" fixed="right">
<template slot-scope="scope">
<el-button v-if="scope.row.canEdit" type="text" @click="$router.push(`/card/merge/edit/${scope.row.cardPackageId}`)">修改</el-button>
<el-button v-if="$getButtonLimit($buttonCode.marketingUpdateCardBag) && scope.row.canEdit" :limit-code="$buttonCode.marketingUpdateCardBag" type="text" @click="$router.push(`/card/merge/edit/${scope.row.cardPackageId}`)">修改</el-button>
<el-button v-else type="text" @click="$router.push(`/card/merge/info/${scope.row.cardPackageId}`)">查看</el-button>
<dm-delete v-if="scope.row.canEdit" @confirm="del(scope.row)" tips="是否删除该卡券包?">
<el-button type="text">删除</el-button>
<dm-delete v-if="$getButtonLimit($buttonCode.marketingDelCardBag) && scope.row.canEdit" @confirm="del(scope.row)" tips="是否删除该卡券包?">
<el-button type="text" :limit-code="$buttonCode.marketingDelCardBag">删除</el-button>
</dm-delete>
<el-button v-if="scope.row.canEdit" type="text" @click="$router.push(`/card/merge/record-list?cardPackageId=${scope.row.cardPackageId}&name=${scope.row.name}`)">领取记录</el-button>
</template>
......
......@@ -71,7 +71,7 @@
<div class="card-item_foot clearfix">
<div class="fl" v-if="item.gicCouponType != 3 && item.gicCouponType != 4">
<!-- 由外部api创建 仅展示详情、删除、报表按钮 -->
<span v-if="item.auditingStatus !== -1"
<span v-if="$getButtonLimit($buttonCode.marketingEditCardStock) && item.auditingStatus !== -1" :limit-code="$buttonCode.marketingEditCardStock"
>剩余库存:{{ item.couponStock }} <a title="编辑库存" v-if="!shelfFlag && item.useCustomCode === 0 && item.canEdit !== false && !item.isApiCreate" @click="preAdjustStock(item)"><i class="el-icon-edit"></i></a
></span>
</div>
......
......@@ -9,6 +9,7 @@ export default Vue.component('render-temp', {
}
},
render(h) {
const { $getButtonLimit, $buttonCode } = Vue.prototype;
const canEdit = this.item.canEdit !== false; // 只有canEdit === false 才证明不能使用 没有权限仅可以详情/报表
const isApiCreate = this.item.isApiCreate || false; // 由外部api创建 仅展示详情、删除、报表按钮
const showPutonBtn = this.item.showPutonBtn || false;
......@@ -20,8 +21,8 @@ export default Vue.component('render-temp', {
// 微盟外部券:领取记录、投放、报表
// 通用外部券:领取记录、报表
const bind1 =
(!isApiCreate || isWeimo) && canGroupSend && !isCommon && showPutonBtn ? (
<a title="投放" onClick={this.handler.bind(null, 1)}>
$getButtonLimit($buttonCode.marketingSendCard) && (!isApiCreate || isWeimo) && canGroupSend && !isCommon && showPutonBtn ? (
<a title="投放" limit-code={$buttonCode.marketingSendCard} onClick={this.handler.bind(null, 1)}>
<i class="iconfont icon-daohang-" />
</a>
) : (
......@@ -33,16 +34,16 @@ export default Vue.component('render-temp', {
</a>
);
const bind3 =
!isWeimo && !isCommon && !isApiCreate ? (
<a title="编辑" onClick={this.handler.bind(null, 3)}>
$getButtonLimit($buttonCode.marketingEditCard) && !isWeimo && !isCommon && !isApiCreate ? (
<a title="编辑" limit-code={$buttonCode.marketingEditCard} onClick={this.handler.bind(null, 3)}>
<i class="el-icon-edit" />
</a>
) : (
''
);
const bind4 =
canEdit && !isWeimo && !isCommon ? (
<a title="删除" onClick={this.handler.bind(null, 4)}>
$getButtonLimit($buttonCode.marketingDelCard) && canEdit && !isWeimo && !isCommon ? (
<a title="删除" limit-code={$buttonCode.marketingDelCard} onClick={this.handler.bind(null, 4)}>
<i class="el-icon-delete" />
</a>
) : (
......@@ -54,8 +55,8 @@ export default Vue.component('render-temp', {
</a>
);
const bind6 =
canEdit && !isApiCreate && !isWeimo && !isCommon ? (
<a title="复制" onClick={this.handler.bind(null, 6)}>
$getButtonLimit($buttonCode.marketingCopyCard) && canEdit && !isApiCreate && !isWeimo && !isCommon ? (
<a title="复制" limit-code={$buttonCode.marketingCopyCard} onClick={this.handler.bind(null, 6)}>
<i class="iconfont icon-wxcard-copy" />
</a>
) : (
......
......@@ -5,7 +5,7 @@
<el-input v-model="listParams.cardName" class="w250" placeholder="请输入卡券名称" @change="refresh"><i slot="prefix" class="el-input__icon el-icon-search"></i></el-input>
<el-input v-model="listParams.nickName" class="w250" placeholder="请输入用户昵称" @change="refresh"><i slot="prefix" class="el-input__icon el-icon-search"></i></el-input>
<el-checkbox class="vertical-middle" v-if="$store.state.marketing.isShowSelf" v-model="listParams.showSelfFlag" :true-label="1" :false-label="0" label="仅看本人" border @change="refresh" />
<el-button class="fr" type="primary" icon="iconfont icon-icon_yunxiazai fz14" @click="exportTemplateReceivedExcel"> 导出记录</el-button>
<el-button class="fr" type="primary" icon="iconfont icon-icon_yunxiazai fz14" v-if="$getButtonLimit($buttonCode.marketingGetCardLog)" :limit-code="$buttonCode.marketingGetCardLog" @click="exportTemplateReceivedExcel"> 导出记录</el-button>
</div>
<div class="filter--box">
<el-select class="dm-select pl10" v-model="listParams.cardType" placeholder="选择卡券类型" @change="refresh">
......
......@@ -10,7 +10,7 @@
<span class="gray fz12 ml5" style="display:inline-block;width:220px;line-height:18px;position:relative;top:8px">*查询全部卡券领取记录单次仅支持区间范围7天的查询,速度较慢,请耐心等候</span>
</div>
<div class="fr" style="position:relative;top:8px;">
<el-button type="primary" icon="iconfont icon-icon_yunxiazai fz14" @click="confirm.visible = true"> 导出记录</el-button>
<el-button type="primary" icon="iconfont icon-icon_yunxiazai fz14" v-if="$getButtonLimit($buttonCode.marketingDownloadGetLog)" :limit-code="$buttonCode.marketingDownloadGetLog" @click="confirm.visible = true"> 导出记录</el-button>
</div>
</div>
<div class="filter--box">
......@@ -95,8 +95,8 @@
<template slot-scope="scope">
<!-- 卡券类型为 e袋洗时 列表操作按钮 无手动核销按钮 -->
<template v-if="scope.row.canEdit !== false">
<el-button type="text" v-if="scope.row.status === 4 && Date.now() < scope.row.limitTime + 24 * 60 * 60 * 1000 && scope.row.gicCouponType !== 1" @click="orderData(scope.row)">核销</el-button>
<el-button type="text" v-if="scope.row.status === 4 && Date.now() < scope.row.limitTime + 24 * 60 * 60 * 1000" @click="delData(scope.row)">销毁</el-button>
<el-button type="text" v-if="$getButtonLimit($buttonCode.marketingOrderCard) && scope.row.status === 4 && Date.now() < scope.row.limitTime + 24 * 60 * 60 * 1000 && scope.row.gicCouponType !== 1" :limit-code="$buttonCode.marketingOrderCard" @click="orderData(scope.row)">核销</el-button>
<el-button type="text" v-if="$getButtonLimit($buttonCode.marketingDestoryCard) && scope.row.status === 4 && Date.now() < scope.row.limitTime + 24 * 60 * 60 * 1000" :limit-code="$buttonCode.marketingDestoryCard" @click="delData(scope.row)">销毁</el-button>
</template>
</template>
</el-table-column>
......
......@@ -6,7 +6,7 @@
<el-option label="投放失败" :value="0"></el-option>
</el-select>
<el-input class="w250" v-model="listParams.search" placeholder="输入会员姓名/卡号" @change="refresh"><i slot="prefix" class="el-input__icon el-icon-search"></i></el-input>
<el-button icon="iconfont icon-icon_yunxiazai fz14" class="fr" type="primary" @click="exportRecordSendInfoEvaluate"> 下载Excel</el-button>
<el-button icon="iconfont icon-icon_yunxiazai fz14" class="fr" type="primary" v-if="$getButtonLimit($buttonCode.marketingDownloadSendLog)" :limit-code="$buttonCode.marketingDownloadSendLog" @click="exportRecordSendInfoEvaluate"> 下载Excel</el-button>
</div>
<div class="filter--box pl10" v-show="listParams.putonType === 1">
<el-select class="vertical-middle w150" v-model="listParams.cardStatus" placeholder="投放状态" @change="getTableList">
......
......@@ -48,8 +48,8 @@
<el-button type="text" v-if="scope.row.putonStatus === 2 || scope.row.putonStatus === 3" @click="$router.push('/card/groupinfo/' + scope.row.putonId)">详情</el-button>
<el-button type="text" v-if="scope.row.putonStatus !== 2 && scope.row.putonStatus !== 3 && scope.row.canEdit !== false && scope.row.putonStatus !== 5 && scope.row.putonStatus !== 6" @click="$router.push('/card/groupsend/' + scope.row.putonId)">编辑</el-button>
<el-button type="text" v-if="scope.row.putonTime > nowDate" @click="$router.push('/card/record/sendInfo/' + scope.row.putonId)">记录</el-button>
<dm-delete v-if="scope.row.putonStatus !== 2 && scope.row.canEdit !== false" @confirm="delData(scope.row)" tips="是否删除该投放记录?">
<el-button type="text">删除</el-button>
<dm-delete v-if="$getButtonLimit($buttonCode.marketingDelSendLog) && scope.row.putonStatus !== 2 && scope.row.canEdit !== false" @confirm="delData(scope.row)" tips="是否删除该投放记录?">
<el-button type="text" :limit-code="$buttonCode.marketingDelSendLog">删除</el-button>
</dm-delete>
</template>
</el-table-column>
......
......@@ -3,7 +3,7 @@
<div class="pb22 clearfix">
<el-date-picker class="w250" v-model="dateTime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" @change="refresh"></el-date-picker>
<el-input v-model="listParams.search" class="w300" placeholder="卡券名称/卡券代码/会员信息" clearable @change="refresh"><i slot="prefix" class="el-input__icon el-icon-search"></i></el-input>
<el-button class="fr" type="primary" @click="exportExcel" icon="iconfont icon-icon_yunxiazai fz14"> 下载Excel</el-button>
<el-button class="fr" type="primary" v-if="$getButtonLimit($buttonCode.marketingDownloadRefundLog)" :limit-code="$buttonCode.marketingDownloadRefundLog" @click="exportExcel" icon="iconfont icon-icon_yunxiazai fz14"> 下载Excel</el-button>
</div>
<el-table tooltipEffect="light" :data="tableList" style="width: 100%">
<el-table-column :show-overflow-tooltip="true" width="100" align="left" prop="sendBackTime" label="退券时间">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment