1.2.3 后台操作按钮调整及其新增开启拼团功能

This commit is contained in:
hupeng
2019-11-19 13:44:19 +08:00
commit 4faa83dc0c
307 changed files with 23684 additions and 0 deletions

View File

@ -0,0 +1,214 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '开启拼团'" width="900px">
<el-form ref="form" :model="form" :rules="rules" :inline="true" size="small" label-width="140px">
<el-form-item label="拼团名称" >
<el-input v-model="form.title" style="width: 500px;"/>
</el-form-item>
<el-form-item label="拼团简介" >
<el-input v-model="form.info" style="width: 500px;"/>
</el-form-item>
<el-form-item label="单位" >
<el-input v-model="form.unitName" style="width: 500px;"/>
</el-form-item>
<el-form-item label="拼团开始时间" >
<template>
<el-date-picker
v-model="form.startTimeDate"
type="datetime"
placeholder="选择日期时间">
</el-date-picker>
</template>
</el-form-item>
<el-form-item label="拼团结束时间" >
<template>
<el-date-picker
v-model="form.endTimeDate"
type="datetime"
placeholder="选择日期时间">
</el-date-picker>
</template>
</el-form-item>
<el-form-item label="产品主图片" >
<pic-upload v-model="form.image" style="width: 500px;"/>
</el-form-item>
<el-form-item label="产品轮播图" >
<mulpic-upload v-model="form.images" style="width: 500px;"/>
</el-form-item>
<el-form-item label="拼团时效(单位小时)" >
<el-input v-model="form.effectiveTime" style="width: 500px;"/>
</el-form-item>
<el-form-item label="拼团价" >
<el-input v-model="form.price"/>
</el-form-item>
<el-form-item label="拼团人数" >
<el-input v-model="form.people"/>
</el-form-item>
<el-form-item label="库存" >
<el-input v-model="form.stock" />
</el-form-item>
<el-form-item label="销量" >
<el-input v-model="form.sales" />
</el-form-item>
<el-form-item label="排序" >
<el-input v-model="form.sort"/>
</el-form-item>
<el-form-item label="邮费" >
<el-input v-model="form.postage"/>
</el-form-item>
<el-form-item label="是否包邮" >
<el-radio v-model="form.isPostage" :label="1">是</el-radio>
<el-radio v-model="form.isPostage" :label="0" style="width: 110px;">否</el-radio>
</el-form-item>
<el-form-item label="热门推荐" >
<el-radio v-model="form.isHost" :label="1">是</el-radio>
<el-radio v-model="form.isHost" :label="0" style="width: 200px;">否</el-radio>
</el-form-item>
<el-form-item label="活动状态" >
<el-radio v-model="form.isShow" :label="1">开启</el-radio>
<el-radio v-model="form.isShow" :label="0" style="width: 200px;">关闭</el-radio>
</el-form-item>
<el-form-item label="详情" >
<editor v-model="form.description" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/yxStoreCombination'
import editor from '../../components/Editor'
import picUpload from '@/components/pic-upload'
import mulpicUpload from '@/components/mul-pic-upload'
export default {
components: { editor, picUpload, mulpicUpload },
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
productId: '',
merId: '',
image: '',
images: '',
title: '',
attr: '',
people: '',
info: '',
price: '',
sort: '',
sales: '',
stock: '',
addTime: '',
isHost: '',
isShow: '',
isDel: 0,
merUse: '',
isPostage: '',
postage: '',
description: '',
startTime: '',
stopTime: '',
effectiveTime: '',
cost: '',
browse: '',
unitName: '',
combination: 1,
browse: 0,
startTimeDate: '',
endTimeDate: ''
},
rules: {
}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
productId: '',
merId: '',
image: '',
images: '',
title: '',
attr: '',
people: 0,
info: '',
price: 0,
sort: '',
sales: '',
stock: '',
addTime: '',
isHost: '',
isShow: '',
isDel: '',
combination: '',
merUse: '',
isPostage: '',
postage: '',
description: '',
startTimeDate: '',
endTimeDate: '',
effectiveTime: 24,
cost: '',
browse: '',
unitName: ''
}
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,205 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 搜索 -->
<el-input v-model="query.value" clearable placeholder="输入搜索内容" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery"/>
<el-select v-model="query.type" clearable placeholder="类型" class="filter-item" style="width: 130px">
<el-option v-for="item in queryTypeOptions" :key="item.key" :label="item.display_name" :value="item.key"/>
</el-select>
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
<!-- 新增 -->
<div style="display: inline-block;margin: 0px 2px;">
<el-button
v-permission="['ADMIN','YXSTORECOMBINATION_ALL','YXSTORECOMBINATION_CREATE']"
class="filter-item"
size="mini"
type="primary"
icon="el-icon-plus"
@click="add">新增</el-button>
</div>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd"/>
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="id" label="id"/>
<el-table-column prop="productId" label="商品id"/>
<el-table-column prop="image" label="产品主图">
<template slot-scope="scope">
<a :href="scope.row.image" style="color: #42b983" target="_blank"><img :src="scope.row.image" alt="点击打开" class="el-avatar"></a>
</template>
</el-table-column>
<el-table-column prop="title" label="拼团名称"/>
<el-table-column prop="people" label="参团人数"/>
<el-table-column prop="price" label="拼团价"/>
<el-table-column prop="cost" label="原价"/>
<el-table-column prop="stock" label="库存"/>
<el-table-column prop="browse" label="浏览量"/>
<el-table-column prop="countPeopleAll" label="参与人数"/>
<el-table-column prop="countPeoplePink" label="成团数量"/>
<el-table-column prop="countPeopleBrowse" label="访客人数"/>
<el-table-column label="状态" align="center">
<template slot-scope="scope">
<div @click="onSale(scope.row.id,scope.row.isShow)">
<el-tag v-if="scope.row.isShow === 1" style="cursor: pointer" :type="''">已开启</el-tag>
<el-tag style="cursor: pointer" v-else :type=" 'info' ">已关闭</el-tag>
</div>
</template>
</el-table-column>
<el-table-column prop="stopTime" label="结束时间">
<template slot-scope="scope">
<span>{{ formatTimeTwo(scope.row.stopTime) }}</span>
</template>
</el-table-column>
<el-table-column v-if="checkPermission(['ADMIN','YXSTORECOMBINATION_ALL','YXSTORECOMBINATION_EDIT','YXSTORECOMBINATION_DELETE'])" label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-button v-permission="['ADMIN','YXSTORECOMBINATION_ALL','YXSTORECOMBINATION_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)"/>
<el-popover
v-permission="['ADMIN','YXSTORECOMBINATION_ALL','YXSTORECOMBINATION_DELETE']"
:ref="scope.row.id"
placement="top"
width="180">
<p>确定删除本条数据吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
</div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini"/>
</el-popover>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/initData'
import { del, onsale } from '@/api/yxStoreCombination'
import eForm from './form'
import { formatTimeTwo, parseTime } from '@/utils/index'
export default {
components: { eForm },
mixins: [initData],
data() {
return {
delLoading: false,
queryTypeOptions: [
{ key: 'title', display_name: '活动标题' }
]
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
parseTime,
formatTimeTwo,
checkPermission,
beforeInit() {
this.url = 'api/yxStoreCombination'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort }
const query = this.query
const type = query.type
const value = query.value
if (type && value) { this.params[type] = value }
return true
},
subDelete(id) {
this.delLoading = true
del(id).then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
onSale(id, status) {
this.$confirm(`确定进行[${status ? '下架' : '上架'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
onsale(id, { status: status }).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1000,
onClose: () => {
this.init()
}
})
})
})
.catch(() => { })
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
id: data.id,
productId: data.productId,
merId: data.merId,
image: data.image,
images: data.images,
title: data.title,
attr: data.attr,
people: data.people,
info: data.info,
price: data.price,
sort: data.sort,
sales: data.sales,
stock: data.stock,
addTime: data.addTime,
isHost: data.isHost,
isShow: data.isShow,
isDel: data.isDel,
combination: data.combination,
merUse: data.merUse,
isPostage: data.isPostage,
postage: data.postage,
description: data.description,
startTime: data.startTime,
stopTime: data.stopTime,
startTimeDate: new Date(data.startTimeDate),
endTimeDate: new Date(data.endTimeDate),
effectiveTime: data.effectiveTime,
cost: data.cost,
browse: data.browse,
unitName: data.unitName
}
_this.dialog = true
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,159 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="用户id" >
<el-input v-model="form.uid" style="width: 370px;"/>
</el-form-item>
<el-form-item label="订单id 生成" >
<el-input v-model="form.orderId" style="width: 370px;"/>
</el-form-item>
<el-form-item label="订单id 数据库" >
<el-input v-model="form.orderIdKey" style="width: 370px;"/>
</el-form-item>
<el-form-item label="购买商品个数" >
<el-input v-model="form.totalNum" style="width: 370px;"/>
</el-form-item>
<el-form-item label="购买总金额" >
<el-input v-model="form.totalPrice" style="width: 370px;"/>
</el-form-item>
<el-form-item label="拼团产品id" >
<el-input v-model="form.cid" style="width: 370px;"/>
</el-form-item>
<el-form-item label="产品id" >
<el-input v-model="form.pid" style="width: 370px;"/>
</el-form-item>
<el-form-item label="拼图总人数" >
<el-input v-model="form.people" style="width: 370px;"/>
</el-form-item>
<el-form-item label="拼团产品单价" >
<el-input v-model="form.price" style="width: 370px;"/>
</el-form-item>
<el-form-item label="开始时间" >
<el-input v-model="form.addTime" style="width: 370px;"/>
</el-form-item>
<el-form-item label="stopTime" >
<el-input v-model="form.stopTime" style="width: 370px;"/>
</el-form-item>
<el-form-item label="团长id 0为团长" >
<el-input v-model="form.kId" style="width: 370px;"/>
</el-form-item>
<el-form-item label="是否发送模板消息0未发送1已发送" >
<el-input v-model="form.isTpl" style="width: 370px;"/>
</el-form-item>
<el-form-item label="是否退款 0未退款 1已退款" >
<el-input v-model="form.isRefund" style="width: 370px;"/>
</el-form-item>
<el-form-item label="状态1进行中2已完成3未完成" >
<el-input v-model="form.status" style="width: 370px;"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/yxStorePink'
export default {
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
uid: '',
orderId: '',
orderIdKey: '',
totalNum: '',
totalPrice: '',
cid: '',
pid: '',
people: '',
price: '',
addTime: '',
stopTime: '',
kId: '',
isTpl: '',
isRefund: '',
status: ''
},
rules: {
}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
uid: '',
orderId: '',
orderIdKey: '',
totalNum: '',
totalPrice: '',
cid: '',
pid: '',
people: '',
price: '',
addTime: '',
stopTime: '',
kId: '',
isTpl: '',
isRefund: '',
status: ''
}
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,142 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 新增 -->
<div style="display: inline-block;margin: 0px 2px;">
<el-button
v-permission="['ADMIN','YXSTOREPINK_ALL','YXSTOREPINK_CREATE']"
class="filter-item"
size="mini"
type="primary"
icon="el-icon-plus"
@click="add">新增</el-button>
</div>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd"/>
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="id" label="id"/>
<el-table-column prop="uid" label="用户id"/>
<el-table-column prop="orderId" label="订单id 生成"/>
<el-table-column prop="orderIdKey" label="订单id 数据库"/>
<el-table-column prop="totalNum" label="购买商品个数"/>
<el-table-column prop="totalPrice" label="购买总金额"/>
<el-table-column prop="cid" label="拼团产品id"/>
<el-table-column prop="pid" label="产品id"/>
<el-table-column prop="people" label="拼图总人数"/>
<el-table-column prop="price" label="拼团产品单价"/>
<el-table-column prop="addTime" label="开始时间"/>
<el-table-column prop="stopTime" label="stopTime"/>
<el-table-column prop="kId" label="团长id 0为团长"/>
<el-table-column prop="isTpl" label="是否发送模板消息0未发送1已发送"/>
<el-table-column prop="isRefund" label="是否退款 0未退款 1已退款"/>
<el-table-column prop="status" label="状态1进行中2已完成3未完成"/>
<el-table-column v-if="checkPermission(['ADMIN','YXSTOREPINK_ALL','YXSTOREPINK_EDIT','YXSTOREPINK_DELETE'])" label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-button v-permission="['ADMIN','YXSTOREPINK_ALL','YXSTOREPINK_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)"/>
<el-popover
v-permission="['ADMIN','YXSTOREPINK_ALL','YXSTOREPINK_DELETE']"
:ref="scope.row.id"
placement="top"
width="180">
<p>确定删除本条数据吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
</div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini"/>
</el-popover>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/initData'
import { del } from '@/api/yxStorePink'
import eForm from './form'
export default {
components: { eForm },
mixins: [initData],
data() {
return {
delLoading: false,
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
checkPermission,
beforeInit() {
this.url = 'api/yxStorePink'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort }
return true
},
subDelete(id) {
this.delLoading = true
del(id).then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
id: data.id,
uid: data.uid,
orderId: data.orderId,
orderIdKey: data.orderIdKey,
totalNum: data.totalNum,
totalPrice: data.totalPrice,
cid: data.cid,
pid: data.pid,
people: data.people,
price: data.price,
addTime: data.addTime,
stopTime: data.stopTime,
kId: data.kId,
isTpl: data.isTpl,
isRefund: data.isRefund,
status: data.status
}
_this.dialog = true
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,121 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="130px">
<el-form-item label="优惠券名称" >
<el-input v-model="form.title" style="width: 300px;"/>
</el-form-item>
<el-form-item label="优惠券面值" >
<el-input v-model="form.couponPrice" style="width: 300px;"/>
</el-form-item>
<el-form-item label="优惠券最低消费" >
<el-input v-model="form.useMinPrice" style="width: 300px;"/>
</el-form-item>
<el-form-item label="优惠券有效期限(天)" >
<el-input v-model="form.couponTime" style="width: 300px;"/>
</el-form-item>
<el-form-item label="排序" >
<el-input v-model="form.sort" style="width: 300px;"/>
</el-form-item>
<el-form-item label="状态" >
<el-radio v-model="form.status" :label="1">开启</el-radio>
<el-radio v-model="form.status" :label="0">关闭</el-radio>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/yxStoreCoupon'
export default {
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
title: '',
integral: 0,
couponPrice: 0,
useMinPrice: 0,
couponTime: 1,
sort: 0,
status: 1,
addTime: '',
//isDel: 0
},
rules: {
}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
title: '',
integral: '',
couponPrice: '',
useMinPrice: '',
couponTime: '',
sort: '',
status: '',
addTime: '',
isDel: ''
}
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,175 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 新增 -->
<div style="display: inline-block;margin: 0px 2px;">
<el-button
v-permission="['ADMIN','YXSTORECOUPON_ALL','YXSTORECOUPON_CREATE']"
class="filter-item"
size="mini"
type="primary"
icon="el-icon-plus"
@click="add">新增</el-button>
</div>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd"/>
<eIForm ref="form2" :is-add="isAdd"/>
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<!--<el-table-column prop="id" label="ID"/>-->
<el-table-column prop="title" label="优惠券名称"/>
<el-table-column prop="couponPrice" label="优惠券面值"/>
<el-table-column prop="useMinPrice" label="优惠券最低消费"/>
<el-table-column label="优惠券有效期限">
<template slot-scope="scope">
<span>{{ scope.row.couponTime }}</span>
</template>
</el-table-column>
<el-table-column prop="sort" label="排序" width="100" />
<el-table-column label="状态" width="100" align="center">
<template slot-scope="scope">
<div>
<el-tag v-if="scope.row.status === 1" style="cursor: pointer" :type="''">开启</el-tag>
<el-tag v-else :type=" 'info' ">关闭</el-tag>
</div>
</template>
</el-table-column>
<el-table-column prop="addTime" label="创建时间">
<template slot-scope="scope">
<span>{{ formatTime(scope.row.addTime) }}</span>
</template>
</el-table-column>
<el-table-column width="200" v-if="checkPermission(['ADMIN','YXSTORECOUPON_ALL','YXSTORECOUPON_EDIT','YXSTORECOUPON_DELETE'])" label="操作" align="center">
<template slot-scope="scope">
<el-button v-permission="['ADMIN','YXSTORECOUPON_ALL','YXSTORECOUPON_EDIT']" size="mini"
type="primary" @click="edit2(scope.row)">
发布
</el-button>
<el-dropdown size="mini" split-button type="primary" trigger="click">
操作
<el-dropdown-menu slot="dropdown">
<el-dropdown-item>
<el-button v-permission="['ADMIN','YXSTORECOUPON_ALL','YXSTORECOUPON_EDIT']" size="mini"
type="primary" icon="el-icon-edit" @click="edit(scope.row)">编辑</el-button>
</el-dropdown-item>
<el-dropdown-item>
<el-popover
v-permission="['ADMIN','YXSTORECOUPON_ALL','YXSTORECOUPON_DELETE']"
:ref="scope.row.id"
placement="top"
width="180">
<p>确定删除本条数据吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
</div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini">删除</el-button>
</el-popover>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/initData'
import { del } from '@/api/yxStoreCoupon'
import eForm from './form'
import eIForm from '../couponissue/form'
import { formatTime } from '@/utils/index'
export default {
components: { eForm, eIForm },
mixins: [initData],
data() {
return {
delLoading: false,
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
formatTime,
checkPermission,
beforeInit() {
this.url = 'api/yxStoreCoupon'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort, isDel:0 }
return true
},
subDelete(id) {
this.delLoading = true
del(id).then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
id: data.id,
title: data.title,
integral: data.integral,
couponPrice: data.couponPrice,
useMinPrice: data.useMinPrice,
couponTime: data.couponTime,
sort: data.sort,
status: data.status,
addTime: data.addTime,
isDel: data.isDel
}
_this.dialog = true
},
edit2(data) {
this.isAdd = true
const _this = this.$refs.form2
_this.form = {
cid: data.id,
cname: data.title,
isPermanent: 0,
status: 1,
totalCount: 0,
remainCount: 0,
isDel: 0
}
_this.dialog = true
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,138 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '发布优惠券'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="100px">
<el-form-item label="优惠券ID" >
<el-input v-model="form.cid" style="width: 300px;" :disabled="true" />
</el-form-item>
<el-form-item label="优惠券名称" >
<el-input v-model="form.cname" style="width: 300px;" :disabled="true" />
</el-form-item>
<el-form-item label="领取开启时间" >
<template>
<el-date-picker
v-model="form.startTimeDate"
type="datetime"
placeholder="选择日期时间">
</el-date-picker>
</template>
</el-form-item>
<el-form-item label="券领结束时间" >
<template>
<el-date-picker
v-model="form.endTimeDate"
type="datetime"
placeholder="选择日期时间">
</el-date-picker>
</template>
</el-form-item>
<el-form-item label="发布数量" >
<el-input v-model="form.totalCount" style="width: 300px;"/>
</el-form-item>
<el-form-item label="是否不限量" >
<el-radio v-model="form.isPermanent" :label="1">不限量</el-radio>
<el-radio v-model="form.isPermanent" :label="0">限量</el-radio>
</el-form-item>
<el-form-item label="状态" >
<el-radio v-model="form.status" :label="1">开启</el-radio>
<el-radio v-model="form.status" :label="0">关闭</el-radio>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/yxStoreCouponIssue'
export default {
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
cid: '',
cname: '',
startTimeDate: '',
endTimeDate: '',
totalCount: 0,
remainCount: 0,
isPermanent: 0,
status: 1,
isDel: 0,
addTime: ''
},
rules: {
}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
cid: '',
startTime: '',
endTime: '',
totalCount: '',
remainCount: '',
isPermanent: '',
status: '',
isDel: '',
addTime: ''
}
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,108 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '修改状态'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="100px">
<el-form-item label="状态" >
<el-radio v-model="form.status" :label="1">开启</el-radio>
<el-radio v-model="form.status" :label="0">关闭</el-radio>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/yxStoreCouponIssue'
export default {
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
cid: '',
cname: '',
startTimeDate: '',
endTimeDate: '',
totalCount: 0,
remainCount: 0,
isPermanent: 0,
status: 1,
isDel: 0,
addTime: ''
},
rules: {
}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
//console.log(this.form)
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
cid: '',
startTime: '',
endTime: '',
totalCount: '',
remainCount: '',
isPermanent: '',
status: '',
isDel: '',
addTime: ''
}
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,135 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 新增 -->
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd"/>
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="id" label="id"/>
<el-table-column prop="cname" label="优惠券名称"/>
<el-table-column label="领取日期">
<template slot-scope="scope">
<p>{{ formatTimeTwo(scope.row.startTime) }}</p>
<p>{{ formatTimeTwo(scope.row.endTime) }}</p>
</template>
</el-table-column>
<el-table-column label="发布数量">
<template slot-scope="scope">
<p>发布:{{ scope.row.totalCount }}</p>
<o>剩余:{{ scope.row.remainCount }}</o>
</template>
</el-table-column>
<el-table-column label="状态" align="center">
<template slot-scope="scope">
<div>
<el-tag v-if="scope.row.status === 1" style="cursor: pointer" :type="''">开启</el-tag>
<el-tag v-else :type=" 'info' ">关闭</el-tag>
</div>
</template>
</el-table-column>
<el-table-column v-if="checkPermission(['ADMIN','YXSTORECOUPONISSUE_ALL','YXSTORECOUPONISSUE_EDIT','YXSTORECOUPONISSUE_DELETE'])" label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-button v-permission="['ADMIN','YXSTORECOUPONISSUE_ALL','YXSTORECOUPONISSUE_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)"/>
<el-popover
v-permission="['ADMIN','YXSTORECOUPONISSUE_ALL','YXSTORECOUPONISSUE_DELETE']"
:ref="scope.row.id"
placement="top"
width="180">
<p>确定删除本条数据吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
</div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini"/>
</el-popover>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/initData'
import { del } from '@/api/yxStoreCouponIssue'
import eForm from './formt'
import { formatTimeTwo } from '@/utils/index'
export default {
components: { eForm },
mixins: [initData],
data() {
return {
delLoading: false,
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
formatTimeTwo,
checkPermission,
beforeInit() {
this.url = 'api/yxStoreCouponIssue'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort }
return true
},
subDelete(id) {
this.delLoading = true
del(id).then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
id: data.id,
cid: data.cid,
startTime: data.startTime,
endTime: data.endTime,
totalCount: data.totalCount,
remainCount: data.remainCount,
isPermanent: data.isPermanent,
status: data.status,
isDel: data.isDel,
addTime: data.addTime
}
_this.dialog = true
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,99 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="领取优惠券用户ID" >
<el-input v-model="form.uid" style="width: 370px;"/>
</el-form-item>
<el-form-item label="优惠券前台领取ID" >
<el-input v-model="form.issueCouponId" style="width: 370px;"/>
</el-form-item>
<el-form-item label="领取时间" >
<el-input v-model="form.addTime" style="width: 370px;"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/yxStoreCouponIssueUser'
export default {
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
uid: '',
issueCouponId: '',
addTime: ''
},
rules: {
}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
uid: '',
issueCouponId: '',
addTime: ''
}
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,118 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 新增 -->
<div style="display: inline-block;margin: 0px 2px;">
<el-button
v-permission="['ADMIN','YXSTORECOUPONISSUEUSER_ALL','YXSTORECOUPONISSUEUSER_CREATE']"
class="filter-item"
size="mini"
type="primary"
icon="el-icon-plus"
@click="add">新增</el-button>
</div>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd"/>
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="id" label="id"/>
<el-table-column prop="uid" label="领取优惠券用户ID"/>
<el-table-column prop="issueCouponId" label="优惠券前台领取ID"/>
<el-table-column prop="addTime" label="领取时间"/>
<el-table-column v-if="checkPermission(['ADMIN','YXSTORECOUPONISSUEUSER_ALL','YXSTORECOUPONISSUEUSER_EDIT','YXSTORECOUPONISSUEUSER_DELETE'])" label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-button v-permission="['ADMIN','YXSTORECOUPONISSUEUSER_ALL','YXSTORECOUPONISSUEUSER_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)"/>
<el-popover
v-permission="['ADMIN','YXSTORECOUPONISSUEUSER_ALL','YXSTORECOUPONISSUEUSER_DELETE']"
:ref="scope.row.id"
placement="top"
width="180">
<p>确定删除本条数据吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
</div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini"/>
</el-popover>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/initData'
import { del } from '@/api/yxStoreCouponIssueUser'
import eForm from './form'
export default {
components: { eForm },
mixins: [initData],
data() {
return {
delLoading: false,
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
checkPermission,
beforeInit() {
this.url = 'api/yxStoreCouponIssueUser'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort }
return true
},
subDelete(id) {
this.delLoading = true
del(id).then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
id: data.id,
uid: data.uid,
issueCouponId: data.issueCouponId,
addTime: data.addTime
}
_this.dialog = true
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,125 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="姓名" >
<el-input v-model="form.realName" style="width: 370px;"/>
</el-form-item>
<el-form-item label="提现金额" >
<el-input v-model="form.extractPrice" style="width: 370px;"/>
</el-form-item>
<el-form-item label="审核状态" >
<el-radio v-model="form.status" :label="-1">无效</el-radio>
<el-radio v-model="form.status" :label="1">通过</el-radio>
</el-form-item>
<el-form-item label="无效原因" >
<el-input v-model="form.failMsg" style="width: 300px;" rows="5" type="textarea"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/yxUserExtract'
export default {
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
uid: '',
realName: '',
extractType: '',
bankCode: '',
bankAddress: '',
alipayCode: '',
extractPrice: '',
mark: '',
balance: '',
failMsg: '',
failTime: '',
addTime: '',
status: '',
wechat: ''
},
rules: {
}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
uid: '',
realName: '',
extractType: '',
bankCode: '',
bankAddress: '',
alipayCode: '',
extractPrice: '',
mark: '',
balance: '',
failMsg: '',
failTime: '',
addTime: '',
status: '',
wechat: ''
}
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,167 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 搜索 -->
<el-input v-model="query.value" clearable placeholder="输入搜索内容" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery"/>
<el-select v-model="query.type" clearable placeholder="类型" class="filter-item" style="width: 130px">
<el-option v-for="item in queryTypeOptions" :key="item.key" :label="item.display_name" :value="item.key"/>
</el-select>
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
<!-- 新增 -->
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd"/>
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="id" label="id"/>
<el-table-column prop="extractPrice" label="提现金额"/>
<el-table-column prop="extractType" label="提现方式">
<template slot-scope="scope">
<div v-if="scope.row.extractType='weixin'">
姓名:{{ scope.row.realName }}<br>
微信号:{{ scope.row.wechat }}
</div>
<div v-else>
姓名:{{ scope.row.realName }}<br>
支付宝号:{{ scope.row.alipayCode }}
</div>
</template>
</el-table-column>
<el-table-column prop="addTime" label="添加时间">
<template slot-scope="scope">
<span>{{ formatTimeTwo(scope.row.addTime) }}</span>
</template>
</el-table-column>
<el-table-column prop="status" label="审核状态">
<template slot-scope="scope">
<div v-if="scope.row.status==1">
提现通过
</div>
<div v-else-if="scope.row.status==-1">
提现未通过<br/>
未通过原因{{ scope.row.failMsg }}
<br>
未通过时间{{ formatTimeTwo(scope.row.failTime) }}
</div>
<div v-else>
未提现
</div>
</template>
</el-table-column>
<el-table-column v-if="checkPermission(['ADMIN','YXUSEREXTRACT_ALL','YXUSEREXTRACT_EDIT','YXUSEREXTRACT_DELETE'])" label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-button v-permission="['ADMIN','YXUSEREXTRACT_ALL','YXUSEREXTRACT_EDIT']" size="mini" type="primary"
@click="edit(scope.row)">操作</el-button>
<!--<el-popover-->
<!--v-permission="['ADMIN','YXUSEREXTRACT_ALL','YXUSEREXTRACT_DELETE']"-->
<!--:ref="scope.row.id"-->
<!--placement="top"-->
<!--width="180">-->
<!--<p>确定删除本条数据吗</p>-->
<!--<div style="text-align: right; margin: 0">-->
<!--<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>-->
<!--<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>-->
<!--</div>-->
<!--<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini"/>-->
<!--</el-popover>-->
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/initData'
import { del } from '@/api/yxUserExtract'
import eForm from './form'
import { formatTimeTwo } from '@/utils/index'
export default {
components: { eForm },
mixins: [initData],
data() {
return {
delLoading: false,
queryTypeOptions: [
{ key: 'realName', display_name: '名称' }
]
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
formatTimeTwo,
checkPermission,
beforeInit() {
this.url = 'api/yxUserExtract'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort }
const query = this.query
const type = query.type
const value = query.value
if (type && value) { this.params[type] = value }
return true
},
subDelete(id) {
this.delLoading = true
del(id).then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
id: data.id,
uid: data.uid,
realName: data.realName,
extractType: data.extractType,
bankCode: data.bankCode,
bankAddress: data.bankAddress,
alipayCode: data.alipayCode,
extractPrice: data.extractPrice,
mark: data.mark,
balance: data.balance,
failMsg: data.failMsg,
failTime: data.failTime,
addTime: data.addTime,
status: data.status,
wechat: data.wechat
}
_this.dialog = true
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,139 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="兑换的项目id" >
<el-input v-model="form.cid" style="width: 370px;"/>
</el-form-item>
<el-form-item label="优惠券所属用户" >
<el-input v-model="form.uid" style="width: 370px;"/>
</el-form-item>
<el-form-item label="优惠券名称" >
<el-input v-model="form.couponTitle" style="width: 370px;"/>
</el-form-item>
<el-form-item label="优惠券的面值" >
<el-input v-model="form.couponPrice" style="width: 370px;"/>
</el-form-item>
<el-form-item label="最低消费多少金额可用优惠券" >
<el-input v-model="form.useMinPrice" style="width: 370px;"/>
</el-form-item>
<el-form-item label="优惠券创建时间" >
<el-input v-model="form.addTime" style="width: 370px;"/>
</el-form-item>
<el-form-item label="优惠券结束时间" >
<el-input v-model="form.endTime" style="width: 370px;"/>
</el-form-item>
<el-form-item label="使用时间" >
<el-input v-model="form.useTime" style="width: 370px;"/>
</el-form-item>
<el-form-item label="获取方式" >
<el-input v-model="form.type" style="width: 370px;"/>
</el-form-item>
<el-form-item label="状态0未使用1已使用, 2:已过期)" >
<el-input v-model="form.status" style="width: 370px;"/>
</el-form-item>
<el-form-item label="是否有效" >
<el-input v-model="form.isFail" style="width: 370px;"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/yxStoreCouponUser'
export default {
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
cid: '',
uid: '',
couponTitle: '',
couponPrice: '',
useMinPrice: '',
addTime: '',
endTime: '',
useTime: '',
type: '',
status: '',
isFail: ''
},
rules: {
}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
cid: '',
uid: '',
couponTitle: '',
couponPrice: '',
useMinPrice: '',
addTime: '',
endTime: '',
useTime: '',
type: '',
status: '',
isFail: ''
}
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,150 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 搜索 -->
<el-input v-model="query.value" clearable placeholder="输入搜索内容" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery"/>
<el-select v-model="query.type" clearable placeholder="类型" class="filter-item" style="width: 130px">
<el-option v-for="item in queryTypeOptions" :key="item.key" :label="item.display_name" :value="item.key"/>
</el-select>
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
<!-- 新增 -->
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd"/>
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="couponTitle" label="优惠券名称"/>
<el-table-column prop="nickname" label="所属用户"/>
<el-table-column prop="couponPrice" label="优惠券的面值"/>
<el-table-column prop="useMinPrice" label="优惠券最低消费"/>
<el-table-column label="优惠券开始时间">
<template slot-scope="scope">
{{ formatTimeTwo(scope.row.addTime) }}
</template>
</el-table-column>
<el-table-column label="优惠券结束时间">
<template slot-scope="scope">
{{ formatTimeTwo(scope.row.endTime) }}
</template>
</el-table-column>
<el-table-column label="获取方式">
<template slot-scope="scope">
<div>
<el-tag v-if="scope.row.type == 'get'" style="cursor: pointer" :type="''">手动领取</el-tag>
<el-tag v-else :type=" 'info' ">后台发放</el-tag>
</div>
</template>
</el-table-column>
<el-table-column label="是否可用">
<template slot-scope="scope">
<div>
<el-tag v-if="scope.row.status == 0 && scope.row.isFail == 0" style="cursor: pointer" :type="''">可用</el-tag>
<el-tag v-else :type=" 'info' ">不可用</el-tag>
</div>
</template>
</el-table-column>
<el-table-column label="状态">
<template slot-scope="scope">
<div>
<el-tag v-if="scope.row.status == 2" >已过期</el-tag>
<el-tag v-if="scope.row.status == 1" >已使用</el-tag>
<el-tag v-else >未使用</el-tag>
</div>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/initData'
import { del } from '@/api/yxStoreCouponUser'
import eForm from './form'
import { formatTimeTwo } from '@/utils/index'
export default {
components: { eForm },
mixins: [initData],
data() {
return {
delLoading: false,
queryTypeOptions: [
{ key: 'couponTitle', display_name: '优惠券名称' }
]
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
formatTimeTwo,
checkPermission,
beforeInit() {
this.url = 'api/yxStoreCouponUser'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort }
const query = this.query
const type = query.type
const value = query.value
if (type && value) { this.params[type] = value }
return true
},
subDelete(id) {
this.delLoading = true
del(id).then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
id: data.id,
cid: data.cid,
uid: data.uid,
couponTitle: data.couponTitle,
couponPrice: data.couponPrice,
useMinPrice: data.useMinPrice,
addTime: data.addTime,
endTime: data.endTime,
useTime: data.useTime,
type: data.type,
status: data.status,
isFail: data.isFail
}
_this.dialog = true
}
}
}
</script>
<style scoped>
</style>