Commit ece1bb6a by crushh

update: 复制

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