|
|
|
@ -63,7 +63,23 @@
|
|
|
|
|
border
|
|
|
|
|
@on-row-dblclick="showDetail"
|
|
|
|
|
:columns="columns1"
|
|
|
|
|
:data="data"></Table>
|
|
|
|
|
:data="data">
|
|
|
|
|
<template slot-scope="{row}" slot="qrCodeAction">
|
|
|
|
|
<img :src="require('../../../static/img/qrCode-init.png')" @click="navigateCode(row)"
|
|
|
|
|
class="table-img-qr-code"/>
|
|
|
|
|
</template>
|
|
|
|
|
<template slot="action" slot-scope="{row}">
|
|
|
|
|
<i-col span="12">
|
|
|
|
|
<Button ghost class="router-btn"
|
|
|
|
|
@click="() => {stop(row)}">终止</Button>
|
|
|
|
|
</i-col>
|
|
|
|
|
<i-col span="12">
|
|
|
|
|
<Button ghost class="router-btn"
|
|
|
|
|
@click="() => {modify(row)}">修改</Button>
|
|
|
|
|
</i-col>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
</Table>
|
|
|
|
|
<Page :total="totalSize"
|
|
|
|
|
:current="pageNum"
|
|
|
|
|
:page-size="pageSize"
|
|
|
|
@ -86,6 +102,23 @@
|
|
|
|
|
<planDetail v-if="isShowDetail"
|
|
|
|
|
:detail="detail"></planDetail>
|
|
|
|
|
</Modal>
|
|
|
|
|
<!-- 预览二维码 -->
|
|
|
|
|
<Modal
|
|
|
|
|
v-model="isShow"
|
|
|
|
|
:title="showStoreName"
|
|
|
|
|
:footer-hide="true"
|
|
|
|
|
width="230"
|
|
|
|
|
class-name="vertical-center-modal"
|
|
|
|
|
@on-ok="ok">
|
|
|
|
|
<div slot="header">
|
|
|
|
|
<p></p>
|
|
|
|
|
</div>
|
|
|
|
|
<p>{{this.showStoreName}}</p>
|
|
|
|
|
<img :src="qrCodeImage" style="width:200px;height:200px;"/>
|
|
|
|
|
<div style="text-align: center;">
|
|
|
|
|
<Button ghost type="primary" @click="download(rowData)">下载</Button>
|
|
|
|
|
</div>
|
|
|
|
|
</Modal>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
@ -106,6 +139,8 @@ export default {
|
|
|
|
|
data () {
|
|
|
|
|
const _this = this;
|
|
|
|
|
return {
|
|
|
|
|
showStoreName:"",
|
|
|
|
|
isShow: false,
|
|
|
|
|
loading: false,
|
|
|
|
|
isShowDetail: false,
|
|
|
|
|
totalSize: 0,
|
|
|
|
@ -114,11 +149,13 @@ export default {
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
saving: false,
|
|
|
|
|
data: [],
|
|
|
|
|
rowData: {},
|
|
|
|
|
companyList: [],
|
|
|
|
|
customerId: null,
|
|
|
|
|
shopList: [],
|
|
|
|
|
showUse: false,
|
|
|
|
|
activityInstance: {},
|
|
|
|
|
qrCodeImage: '',
|
|
|
|
|
formValidate: {
|
|
|
|
|
date: null,
|
|
|
|
|
organizationId: null,
|
|
|
|
@ -230,17 +267,18 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "活动码",
|
|
|
|
|
key: "activityCode",
|
|
|
|
|
render (h, p) {
|
|
|
|
|
return h(
|
|
|
|
|
"Button",
|
|
|
|
|
{
|
|
|
|
|
props: { type: "primary", size: "small" },
|
|
|
|
|
on: { click: () => _this.navigateCode(p.row) }
|
|
|
|
|
},
|
|
|
|
|
"查看详情"
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
slot: 'qrCodeAction',
|
|
|
|
|
className: 'table-width-80',
|
|
|
|
|
// render (h, p) {
|
|
|
|
|
// return h(
|
|
|
|
|
// "Button",
|
|
|
|
|
// {
|
|
|
|
|
// props: { type: "primary", size: "small" },
|
|
|
|
|
// on: { click: () => _this.navigateCode(p.row) }
|
|
|
|
|
// },
|
|
|
|
|
// "查看详情"
|
|
|
|
|
// );
|
|
|
|
|
// }
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "活动状态",
|
|
|
|
@ -255,35 +293,35 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "操作",
|
|
|
|
|
key: "action",
|
|
|
|
|
slot: 'action',
|
|
|
|
|
width: 200,
|
|
|
|
|
render (h, p) {
|
|
|
|
|
let r = [
|
|
|
|
|
h(
|
|
|
|
|
"Button",
|
|
|
|
|
{
|
|
|
|
|
props: { type: "primary", size: "small" },
|
|
|
|
|
style: { marginRight: "8px" },
|
|
|
|
|
on: {
|
|
|
|
|
click: () => _this.stop(p.row)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"终止"
|
|
|
|
|
),
|
|
|
|
|
h(
|
|
|
|
|
"Button",
|
|
|
|
|
{
|
|
|
|
|
props: { type: "primary", size: "small" },
|
|
|
|
|
on: { click: () => _this.modify(p.row) }
|
|
|
|
|
},
|
|
|
|
|
"修改"
|
|
|
|
|
)
|
|
|
|
|
];
|
|
|
|
|
if (p.row.status > 2) {
|
|
|
|
|
delete r[0];
|
|
|
|
|
}
|
|
|
|
|
return h("div", r);
|
|
|
|
|
}
|
|
|
|
|
// render (h, p) {
|
|
|
|
|
// let r = [
|
|
|
|
|
// h(
|
|
|
|
|
// "Button",
|
|
|
|
|
// {
|
|
|
|
|
// props: { type: "primary", size: "small" },
|
|
|
|
|
// style: { marginRight: "8px" },
|
|
|
|
|
// on: {
|
|
|
|
|
// click: () => _this.stop(p.row)
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
// "终止"
|
|
|
|
|
// ),
|
|
|
|
|
// h(
|
|
|
|
|
// "Button",
|
|
|
|
|
// {
|
|
|
|
|
// props: { type: "primary", size: "small" },
|
|
|
|
|
// on: { click: () => _this.modify(p.row) }
|
|
|
|
|
// },
|
|
|
|
|
// "修改"
|
|
|
|
|
// )
|
|
|
|
|
// ];
|
|
|
|
|
// if (p.row.status > 2) {
|
|
|
|
|
// delete r[0];
|
|
|
|
|
// }
|
|
|
|
|
// return h("div", r);
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
};
|
|
|
|
@ -426,6 +464,46 @@ export default {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
startDateChange: function (e) {
|
|
|
|
|
//设置开始时间
|
|
|
|
|
this.endDateOptions = {
|
|
|
|
|
disabledDate: date => {
|
|
|
|
|
let startTime = this.formValidate.startDate ? new Date(this.formValidate.startDate).valueOf() : '';
|
|
|
|
|
return date && (date.valueOf() < startTime)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
endDateChange: function (e) {
|
|
|
|
|
//设置结束时间
|
|
|
|
|
let endTime = this.formValidate.endDate ? new Date(this.formValidate.endDate).valueOf() - 1 * 24 * 60 * 60 * 1000 : '';
|
|
|
|
|
this.startDateOptions = {
|
|
|
|
|
disabledDate: date => {
|
|
|
|
|
return date && (date.valueOf() > endTime);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
show: function (index) {
|
|
|
|
|
this.isShow = true;
|
|
|
|
|
this.showStoreName = index.name;
|
|
|
|
|
this.qrCodeImage = index.qrCodeAction;
|
|
|
|
|
this.rowData = index;
|
|
|
|
|
},
|
|
|
|
|
hide: function () {
|
|
|
|
|
this.isShow = false;
|
|
|
|
|
},
|
|
|
|
|
// 下载二维码
|
|
|
|
|
download: function (index) {
|
|
|
|
|
debugger
|
|
|
|
|
let fileName = index.name + "-门店码";
|
|
|
|
|
http.downloadImg({
|
|
|
|
|
url: index.qrCodeAction
|
|
|
|
|
}, fileName, function (/*data*/) {
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
ok: function () {
|
|
|
|
|
this.isShow = false;
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
@ -434,4 +512,21 @@ export default {
|
|
|
|
|
.ivu-date-picker .ivu-select-dropdown {
|
|
|
|
|
left: 0 !important;
|
|
|
|
|
}
|
|
|
|
|
.table-width-80 {
|
|
|
|
|
width: 80px !important;
|
|
|
|
|
}
|
|
|
|
|
.router-btn {
|
|
|
|
|
border: none;
|
|
|
|
|
color: #3496EB !important;
|
|
|
|
|
margin-left: -15px;
|
|
|
|
|
}
|
|
|
|
|
.table-img-qr-code {
|
|
|
|
|
margin-left: 5px;
|
|
|
|
|
margin-top: 5px;
|
|
|
|
|
width: 30px;
|
|
|
|
|
height: 30px;
|
|
|
|
|
}
|
|
|
|
|
button:hover {
|
|
|
|
|
background:inherit!important;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|