Commit b05c3cff by 黑潮

update: 添加组件

parent 6e34305c
import '@/assets/styles/reset.less';
import '@/assets/styles/general.scss';
import '@/assets/styles/index.scss';
import ElementUI, { Message } from 'element-ui';
import { Message } from 'element-ui';
import axios from 'axios';
import Vue from 'vue';
import App from './App.vue';
......@@ -17,7 +17,7 @@ import itemCode from '@/utils/item-code.js';
import { itemPerm, permission } from '@/utils/permission.js';
import { _throttle } from '@/utils/index';
Vue.use(ElementUI);
// Vue.use(ElementUI);
axios.defaults.withCredentials = true;
Vue.prototype.axios = axios;
Vue.config.productionTip = false;
......@@ -63,4 +63,4 @@ permission({
render: h => h(App)
}).$mount('#app');
}
});
\ No newline at end of file
});
......@@ -100,11 +100,12 @@
<span class="state-point state-point-default" v-if="scope.row.useStatus == 3">未生效</span>
</template>
</el-table-column>
<el-table-column label="操作" align="left" width="180px" fixed="right">
<el-table-column label="操作" align="left" width="240px" fixed="right">
<template slot-scope="scope">
<dm-perm-button type="text" v-if="scope.row.useStatus != 2 && scope.row.edit == 1" @click="$router.push(`/card-package/edit?id=${scope.row.couponPackageId}`)">编辑</dm-perm-button>
<dm-dropdown :scope-data="scope.row" :configs="operationButtons"/>
<!-- <dm-perm-button type="text" v-if="scope.row.useStatus != 2 && scope.row.edit == 1" @click="$router.push(`/card-package/edit?id=${scope.row.couponPackageId}`)">编辑</dm-perm-button> -->
<!-- statusFlag 1正常(生效状态),0卡券张数不正常(失效状态) -->
<el-button v-if="!(scope.row.useStatus == 2 && scope.row.statusFlag == 0)" type="text" @click="$router.push(`/card-package/send-list?id=${scope.row.couponPackageId}`)">发放记录</el-button>
<!-- <el-button v-if="!(scope.row.useStatus == 2 && scope.row.statusFlag == 0)" type="text" @click="$router.push(`/card-package/send-list?id=${scope.row.couponPackageId}`)">发放记录</el-button>
<el-popover popper-class="option-dropdown" trigger="hover">
<ul>
<li v-if="!(scope.row.useStatus == 2 && scope.row.statusFlag == 0)">
......@@ -115,7 +116,7 @@
</li>
</ul>
<el-button :class="{'ml20': !(scope.row.useStatus == 2 && scope.row.statusFlag == 0)}" type="text" slot="reference"><i class="el-icon-more"></i></el-button>
</el-popover>
</el-popover> -->
</template>
</el-table-column>
</el-table>
......@@ -194,6 +195,47 @@ export default {
tableCardPackage: [], // 调整卡券包库存展示的slot table list
isOpen: false,
cardType,
operationButtons: [
{
text: '编辑',
visible(row) {
return row.useStatus != 2 && row.edit == 1;
},
handler: (row) =>{
this.$router.push(`/card-package/edit?id=${row.couponPackageId}`);
},
},
{
text: '发放记录',
visible(row) {
return !(row.useStatus == 2 && row.statusFlag == 0);
},
handler: (row) =>{
this.$router.push(`/card-package/send-list?id=${row.couponPackageId}`);
},
},
{
text: '库存记录',
visible(row) {
return !(row.useStatus == 2 && row.statusFlag == 0);
},
handler: (row) =>{
this.$router.push(`/card-package/stock-list?id=${row.couponPackageId}`);
}
},
{
text: '删除',
visible(row) {
return row.edit == 1;
},
disabled: (row) => {
return this.$itemPerm(this.$itemCode.gicDeletePackage);
},
handler: (row) =>{
this.delOne(row);
}
},
]
};
},
created() {
......
......@@ -117,9 +117,10 @@
</template>
<span slot-scope="scope" v-html="renderStatus(scope.row)"></span>
</el-table-column>
<el-table-column label="操作" align="left" width="180px" fixed="right">
<el-table-column label="操作" align="left" min-width="180px" fixed="right">
<template slot-scope="scope">
<mk-button :option="{ perm: $itemPerm($itemCode.gicCardFormCopy), deleteFlag: scope.row.deleteFlag, deleteRemark: scope.row.remark }" type="text" @click="handler(6, scope.row)">复制</mk-button>
<dm-dropdown :scope-data="scope.row" :configs="operationButtons"/>
<!-- <mk-button :option="{ perm: $itemPerm($itemCode.gicCardFormCopy), deleteFlag: scope.row.deleteFlag, deleteRemark: scope.row.remark }" type="text" @click="handler(6, scope.row)">复制</mk-button>
<mk-button :option="{ perm: $itemPerm($itemCode.gicCardGroupBtn), deleteFlag: scope.row.deleteFlag, deleteRemark: scope.row.remark }" type="text" @click="handler(8, scope.row)" class="mr20">领取记录</mk-button>
<el-popover popper-class="option-dropdown" trigger="hover">
<ul>
......@@ -140,7 +141,7 @@
</li>
</ul>
<el-button type="text" slot="reference"><i class="el-icon-more"></i></el-button>
</el-popover>
</el-popover> -->
</template>
</el-table-column>
</el-table>
......@@ -208,6 +209,79 @@ export default {
{ name: '抵金券', text: '例:满100元减20元<br/>便于合理控制活动成本', type: 0 },
{ name: '折扣券', text: '例:满100元打9折<br/>提高店铺销量和客单价', type: 1 },
{ name: '兑换券', text: '用于兑换指定商品<br/>吸引顾客消费', type: 2 },
],
operationButtons: [
{
text: '复制',
disabled: (row) => {
console.log(this.$itemPerm(this.$itemCode.gicCardFormCopy));
return this.$itemPerm(this.$itemCode.gicCardFormCopy);
},
handler: (row) =>{
console.log(1);
this.handler(6, row);
},
},
{
text: '领取记录',
disabled: (row) => {
return this.$itemPerm(this.$itemCode.gicCardGroupBtn);
},
handler: (row) =>{
this.handler(8, row);
},
},
{
text: '库存记录',
visible(row) {
return [ 1, 2 ].includes(row._status);
},
handler: (row) =>{
this.handler(9, row);
}
},
{
text: '编辑',
visible(row) {
return [ 1, 2 ].includes(row._status) && row.edit == 1;
},
disabled: (row) => {
return this.$itemPerm(this.$itemCode.gicCardFormEdit);
},
handler: (row) =>{
this.handler(3, row);
}
},
{
text: '详情',
disabled: (row) => {
return this.$itemPerm(this.$itemCode.gicCardFormInfo);
},
handler: (row) =>{
this.handler(5, row);
}
},
{
text: '禁用',
visible(row) {
return row._status == 2 && row.edit == 1;
},
handler: (row) =>{
this.handler(10, row);
}
},
{
text: '删除',
visible(row) {
return row.edit == 1;
},
disabled: (row) => {
return this.$itemPerm(this.$itemCode.gicCardFormDel);
},
handler: (row) =>{
this.handler(4, row);
}
},
]
};
},
......
......@@ -159,16 +159,17 @@
</el-table-column>
<el-table-column label="操作" min-width="170px" fixed="right">
<template slot-scope="scope">
<div style="font-size:0px">
<dm-dropdown :scope-data="scope.row" :configs="operationButtons"/>
<!-- <div style="font-size:0px">
<el-button type="text" @click="edit(scope.row, 2)" v-if="scope.row.edit==1">编辑</el-button>
<el-button type="text" @click="$router.push('/gift-manage/real-stock-list?id=' + scope.row.giftId)">库存记录</el-button>
<el-button type="text" @click="$router.push('/gift-manage/real-stock-list?id=' + scope.row.giftId)">库存记录</el-button> -->
<!-- <dm-perm-button type="text" @click="edit(scope.row, 2)">编辑</dm-perm-button>
<dm-perm-button type="text" @click="$router.push('/gift-manage/real-stock-list?id=' + scope.row.giftId)">库存记录</dm-perm-button> -->
<dm-delete v-if="scope.row.statusFlag === 0 && scope.row.edit==1" @confirm="changeStatus(scope.row)" tips="是否启用?">
<!-- <dm-delete v-if="scope.row.statusFlag === 0 && scope.row.edit==1" @confirm="changeStatus(scope.row)" tips="是否启用?">
<el-button type="text">启用</el-button>
</dm-delete>
<el-button type="text" v-if="scope.row.statusFlag === 1 && scope.row.edit==1" @click="changeStatus(scope.row)">禁用</el-button>
</div>
</div> -->
</template>
</el-table-column>
</el-table>
......@@ -258,7 +259,44 @@ export default {
placeholderText: '请输入礼品名称',
isShow: false,
timeValue: '',
changeName: ''
changeName: '',
operationButtons: [
{
text: '编辑',
visible(row) {
return row.edit == 1;
},
handler: (row) =>{
this.edit(row, 2);
},
},
{
text: '库存记录',
handler: (row) =>{
this.$router.push('/gift-manage/real-stock-list?id=' + row.giftId);
},
},
{
text: '启用',
visible(row) {
return row.statusFlag === 0 && row.edit == 1;
},
handler: (row) =>{
this.$confirm('是否启用?').then(() => {
this.changeStatus(row);
});
}
},
{
text: '禁用',
visible(row) {
return row.statusFlag === 1 && row.edit == 1;
},
handler: (row) =>{
this.changeStatus(row);
}
},
]
};
},
created() {
......
......@@ -165,12 +165,13 @@
</el-table-column>
<el-table-column label="操作" min-width="210px" fixed="right">
<template slot-scope="scope">
<div style="font-size:0px">
<dm-dropdown :scope-data="scope.row" :configs="operationButtons"/>
<!-- <div style="font-size:0px">
<el-button type="text" v-if="scope.row.edit === 1" @click="edit(scope.row, 2)">编辑</el-button>
<el-button type="text" @click="$router.push('/gift-manage/virtual-stock-list?id=' + scope.row.giftId)">库存记录</el-button>
<el-button type="text" @click="$router.push('/gift-manage/virtual-stock-list?id=' + scope.row.giftId)">库存记录</el-button> -->
<!-- <dm-perm-button type="text" @click="edit(scope.row, 2)">编辑</dm-perm-button>
<dm-perm-button type="text" @click="$router.push('/gift-manage/virtual-stock-list?id=' + scope.row.giftId)">库存记录</dm-perm-button> -->
<el-dropdown style="margin-left:20px;" @command="command => handleCommand(command, scope.row)" placement="bottom-start">
<!-- <el-dropdown style="margin-left:20px;" @command="command => handleCommand(command, scope.row)" placement="bottom-start">
<span class="el-dropdown-link" style="color:#2f54ed;cursor: pointer;"> <i class="el-icon-more"></i> </span>
<el-dropdown-menu slot="dropdown" style="width:110px;">
<el-dropdown-item command="1">查看内容</el-dropdown-item>
......@@ -178,7 +179,7 @@
<el-dropdown-item command="3" v-if="scope.row.statusFlag === 1 && scope.row.edit === 1">禁用</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</div> -->
</template>
</el-table-column>
</el-table>
......@@ -288,7 +289,69 @@ export default {
dialogId: '',
forbiddenDialog: false,
forbiddenTitle: '禁用',
changeName: ''
changeName: '',
operationButtons: [
{
text: '编辑',
visible(row) {
return row.edit == 1;
},
handler: (row) =>{
this.edit(row, 2);
},
},
{
text: '库存记录',
handler: (row) =>{
this.$router.push('/gift-manage/virtual-stock-list?id=' + row.giftId);
},
},
{
text: '查看内容',
handler: (row) =>{
this.dialogVisible = true;
this.dialogId = row.giftId;
}
},
{
text: '启用',
visible(row) {
return row.statusFlag === 0 && row.edit == 1;
},
handler: (row) =>{
let params = {
giftIdList: [ row.giftId ],
type: 3
};
this.$confirm('确认启用?', '', {
confirmButtonText: '启用',
}).then(() =>{
this.batchRequest(params);
}).catch(() => {
return;
});
}
},
{
text: '禁用',
visible(row) {
return row.statusFlag === 1 && row.edit == 1;
},
handler: (row) =>{
let params = {
giftIdList: [ row.giftId ],
type: 2
};
this.$confirm('已添加被禁用礼品的活动将会失效,确认禁用?', '', {
confirmButtonText: '禁用',
}).then(() =>{
this.batchRequest(params);
}).catch(() => {
return;
});
}
},
]
};
},
created() {
......
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