Commit ece1bb6a by crushh

update: 复制

parent a438719a
......@@ -95,7 +95,7 @@
兑换状态下显示
</el-radio>
</el-radio-group>
<div v-if="giftForm.proShowStatus == 1" style="margin-left:20px;">
<div v-if="giftForm.proShowStatus == 1 && !isNew" style="margin-left:20px;">
<el-checkbox v-model="giftForm.isNewGuestVisible" :true-label="1" :false-label="0">
非会员可见
</el-checkbox>
......
......@@ -87,16 +87,33 @@ const router = new Router({
path: '/couponAdd',
name: 'couponAdd',
component: couponDetail,
meta: {
type: 'add',
},
},
{
path: '/couponInfo',
name: 'couponInfo',
component: couponDetail,
meta: {
type: 'info',
},
},
{
path: '/couponDetail',
name: 'couponDetail',
path: '/couponEdit',
name: 'couponEdit',
component: couponDetail,
meta: {
type: 'edit',
},
},
{
path: '/couponCopy',
name: 'couponCopy',
component: couponDetail,
meta: {
type: 'copy',
},
},
{
path: '/soldStatistics',
......
......@@ -364,15 +364,18 @@
</el-button>
<el-button
type="text"
@click="goAdd(scope.row)"
@click="goAdd(scope.row,'couponCopy')"
>
复制
</el-button>
<el-button
type="text"
@click="goAdd(scope.row,'couponEdit')"
v-if="$getButtonLimit($buttonCode.couponEdit)"
:limit-code="$buttonCode.couponEdit"
>
编辑
</el-button>
<!-- <dm-delete @confirm="deleteList(scope.row, 0, scope.$index)" tips="确定删除该商品吗?">
<el-button type="text" v-if="scope.row.canEdit">删除</el-button>
</dm-delete> -->
<el-dropdown
v-if="(scope.row.isDifferentialPricing || scope.row.canEdit)&& ($getButtonLimit($buttonCode.couponTieredPricing)|| $getButtonLimit($buttonCode.couponDelete) || $getButtonLimit($buttonCode.couponDetail) || $getButtonLimit($buttonCode.couponConversion))"
style="margin-left:20px;"
......@@ -654,7 +657,7 @@ export default {
},
handleCommand (command, item, index) {
if (command == 0) {
this.goAdd(item, 'detail');
this.goAdd(item, 'couponInfo');
} else if (command == 1) {
this.goRecord(item);
} else if (command == 2) {
......@@ -899,7 +902,7 @@ export default {
sortColumn: this.sortColumn,
};
window.localStorage.setItem('couponListObj', JSON.stringify(this.couponListObj));
this.$router.push({ name: type === 'detail' ? 'couponDetail' : 'couponInfo', query: { giftId: item.integralMallProId, coupCardId: item.proReferId, canEdit: item.canEdit, isDetail: type === 'detail' ? 1 : 0 } });
this.$router.push({ name: type, query: { giftId: item.integralMallProId, coupCardId: item.proReferId } });
},
// 编辑序号
editNumber (item) {
......
......@@ -11,10 +11,10 @@
<el-breadcrumb-item :to="{ path: '/coupon' }">
优惠券
</el-breadcrumb-item>
<el-breadcrumb-item>{{ mallProId === '-1' ? '新建' : '编辑' }}优惠券</el-breadcrumb-item>
<el-breadcrumb-item>{{ typeVal }}优惠券</el-breadcrumb-item>
</el-breadcrumb>
<h3>
<span>{{ mallProId === '-1' ? '新建' : '编辑' }}优惠券</span>
<span>{{ typeVal }}优惠券</span>
</h3>
</div>
<div class="section" v-loading="submitLoading">
......@@ -90,7 +90,7 @@
</template>
</el-table-column>
<el-table-column label="库存" prop="couponStock" />
<el-table-column label="操作" v-if="mallProId === '-1'">
<el-table-column label="操作" v-show="mallProId === '-1'">
<template slot-scope="scope">
<dm-delete @confirm="deleteCard(scope.$index)" tips="确定删除该卡券吗?">
<el-button type="text">
......@@ -480,7 +480,7 @@
type="primary"
size="small"
@click="submitForm('couponForm')"
:disabled="!canEdit||isDetail==1"
:disabled="isInfo"
>
保存
</el-button>
......@@ -632,7 +632,6 @@ export default {
groupIdDisableList: [],
proNameLen: 0,
// 新版门店卡券选择器
isAdd: true,
memberGrade: '',
isEdit: false,
isCorrect: true, // 校验阶梯价的验证是否可以保存阶梯价
......@@ -643,7 +642,7 @@ export default {
return time.getTime() < Date.now() - 24 * 3600 * 1000;
},
},
isDetail: null,
isInfo: this.$route.meta.type == 'info',
visibleData: {
releaseType: 1, // 上架时间
limitTimeBegin: [], // 上架时间具体
......@@ -663,6 +662,12 @@ export default {
isNew: true, // 编辑旧商品时,是否确认转换为新数据格式
};
},
computed: {
typeVal () {
const obj = { add: '新建', copy: '复制', edit: '编辑', info: '查看' };
return obj[this.$route.meta.type];
},
},
mounted () {
this.getOpenStatus();
this.getUserId();
......@@ -671,13 +676,9 @@ export default {
};
this.mallProId = this.$route.query.giftId;
this.canEdit = Boolean(this.$route.query.canEdit);
this.isDetail = Number(this.$route.query.isDetail);
this.coupCardId = this.$route.query.coupCardId;
if (this.mallProId !== '-1') {
this.getInfo();
this.isAdd = false;
this.isEdit = true;
} else {
this.isNew = true;
......
......@@ -942,6 +942,7 @@ export default {
}
if ((this.giftId == '-1' || this.isCopy) && this.giftType === 0) {
this.getGiftId();
this.editChangeTypeStatus = false;
}
this.$nextTick(function () {
window.addEventListener('scroll', this.onScroll, true);
......
......@@ -356,14 +356,6 @@
<div>
<el-button
type="text"
@click="getLink(scope.row)"
v-if="scope.row.canEdit && $getButtonLimit($buttonCode.giftPromote)"
:limit-code="$buttonCode.giftPromote"
>
推广
</el-button>
<el-button
type="text"
v-if="!scope.row.ruleTitle&& $getButtonLimit($buttonCode.giftRelating)"
@click="relating(scope.row)"
:limit-code="$buttonCode.giftRelating"
......@@ -408,6 +400,9 @@
>
<span class="el-dropdown-link" style="color:#1890ff;cursor: pointer;"> <i class="el-icon-more" /> </span>
<el-dropdown-menu slot="dropdown" style="width:110px;">
<el-dropdown-item command="5" v-if="$getButtonLimit($buttonCode.giftPromote)" :limit-code="$buttonCode.giftPromote">
推广
</el-dropdown-item>
<el-dropdown-item command="0" v-if="$getButtonLimit($buttonCode.giftDetail)" :limit-code="$buttonCode.giftDetail">
查看详情
</el-dropdown-item>
......@@ -685,6 +680,8 @@ export default {
.catch(() => {
});
} else if (command == 5) {
this.getLink(item);
}
},
// 跳转到兑换记录
......
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