Commit 345210a1 authored by 杨硕's avatar 杨硕

添加页面

parent 7cf0b19f
import request from '@/utils/request'
// 活动列表
export function activitylist(query) {
return request({
url: '/system/activity/selectActivityInfoByPagination',
method: 'get',
params: query
})
}
// 新增活动
export function activityadd(data) {
return request({
url: '/system/activity/add',
method: 'post',
data,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
}
// 编辑活动
export function activityupdate(data) {
return request({
url: '/system/activity/update',
method: 'put',
data,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
}
// 删除活动
export const activitydel = (id) => {
return request({
url: '/system/activity/deleteByIds',
method: 'delete',
params: id,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
}
// 发布活动
export const activitypublish = (data) => {
return request({
url: '/system/activity/pushActivityInfo',
method: 'put',
params: data,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
}
......@@ -127,7 +127,7 @@ export function updateUserPwd(data) {
// 导出用户
export function exportUser(query) {
return request({
url: '/system/user/export',
url: '/sysUserManage/export',
method: 'get',
params: query,
responseType: 'blob'
......@@ -146,7 +146,7 @@ export function uploadAvatar(data) {
// 下载用户导入模板
export function importTemplate(params) {
return request({
url: '/system/user/importTemplate',
url: '/sysUserManage/importTemplate',
method: 'get',
responseType: 'blob',
params
......@@ -155,7 +155,7 @@ export function importTemplate(params) {
// 导入用户信息
export function importExcel(data) {
return request({
url: '/system/user/importExcel',
url: 'sysUserManage/importExcel',
method: 'post',
headers: {
'Content-Type': 'multipart/form-data'
......
......@@ -114,7 +114,7 @@ export const constantRoutes = [
path: '/business/businessadd',
component: (resolve) => require(['@/views/business/businessadd'], resolve),
name: 'Data',
meta: { title: '商家新增', icon: '' }
meta: { title: '商家新增', icon: '', activeMenu: '/business/index' }
}
]
},
......@@ -127,7 +127,46 @@ export const constantRoutes = [
path: '/activity/activityadd',
component: (resolve) => require(['@/views/activity/activityadd'], resolve),
name: 'Data',
meta: { title: '活动新增', icon: '' }
meta: { title: '活动新增', icon: '', activeMenu: '/activity/parkactivities/index' }
}
]
},
{
path: '/voucher',
component: Layout,
hidden: true,
children: [
{
path: '/voucher/coupon/addcoupon',
component: (resolve) => require(['@/views/voucher/coupon/addcoupon'], resolve),
name: 'Data',
meta: { title: '新增优惠券', icon: '', activeMenu: '/voucher/coupon/index' }
}
]
},
{
path: '/announcements',
component: Layout,
hidden: true,
children: [
{
path: '/announcements/annoceaddorupdate',
component: (resolve) => require(['@/views/announcements/annoceaddorupdate'], resolve),
name: 'Data',
meta: { title: '新增公告', icon: '', activeMenu: '/announcements/index' }
}
]
},
{
path: '/announcements',
component: Layout,
hidden: true,
children: [
{
path: '/announcements/detail',
component: (resolve) => require(['@/views/announcements/detail'], resolve),
name: 'Data',
meta: { title: '公告详情', icon: '', activeMenu: '/announcements/index' }
}
]
}
......
......@@ -235,6 +235,16 @@ body .el-table th.gutter{
}
}
// 新增编辑页面标题样式
.add-title{
font-size: 20px;
font-weight: bold;
height: 40px;
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 20px;
}
// 去掉表格 边框
.el-table--group, .el-table--border {
border: none !important;
......
......@@ -135,6 +135,10 @@ export function praseStrEmpty(str) {
}
return str
}
// 手机号校验
export function validMobile(str) {
return /^1[3-9]\d{9}$/.test(str)
}
/**
* 构造树型结构数据
......
......@@ -27,6 +27,7 @@
style="width: 100%"
type="datetime"
placeholder="活动开始时间"
value-format="yyyy-MM-dd HH:mm:ss"
/>
<div class="reach-title"></div>
<el-date-picker
......@@ -34,6 +35,7 @@
style="width: 100%"
type="datetime"
placeholder="活动结束时间"
value-format="yyyy-MM-dd HH:mm:ss"
/>
</div>
</el-form-item>
......@@ -69,7 +71,7 @@
</el-upload>
</el-form-item>
<el-form-item label="活动内容" prop="activityDetails">
<quilleditor v-model="form.activityDetails" />
<quilleditor :value="form.activityDetails" :type="richtexttype" @value="getvalue" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
......@@ -81,6 +83,7 @@
<script>
import quilleditor from '@/components/quilleditor'
import { activityadd, activityupdate } from '@/api/activity'
export default {
name: 'Activityadd',
components: {
......@@ -88,7 +91,7 @@ export default {
},
data() {
const dateprop = (rule, value, callback) => {
if (!this.form.activityDetail) {
if (!this.form.activityBeginDate) {
callback('请选择活动开始时间')
} else if (!this.form.activityEndDate) {
callback('请选择活动结束时间')
......@@ -97,9 +100,10 @@ export default {
}
}
return {
richtexttype: '',
// 表单参数
form: {
activityDetails: '222'
activityDetails: ''
},
numinputdisable: false,
isRestrictions: 0,
......@@ -140,8 +144,10 @@ export default {
console.log(`this.type`, this.type)
if (this.type === 0) {
this.form = {}
this.richtexttype = '0'
} else if (this.type === 1) {
this.form = this.$route.query.data
this.richtexttype = '1'
}
},
methods: {
......@@ -149,6 +155,10 @@ export default {
handleChange(value) {
console.log(value)
},
getvalue(val) {
// this.reset()
this.form.activityDetails = val
},
handleRemove(file, fileList) {
console.log(file, fileList)
},
......@@ -167,13 +177,28 @@ export default {
},
// 提交按钮
submitForm() {
// TODO: clear this log
console.log(`this.form`, JSON.stringify(this.form.activityDetails))
// if (this.routerype === 0) {
// this.$router.push('/activity/parkactivities/index')
// } else if (this.routerype === 1) {
// this.$router.push('/activity/merchantactivity/index')
// }
this.form.style = this.style
this.form.isRestrictions = this.isRestrictions
this.form.activityType = 0
if (this.type === 0) {
activityadd(this.form).then(res => {
if (res.code === 200) {
this.$message.success('新增成功')
this.$router.push('/activity/parkactivities/index')
} else {
this.$message.error(res.message)
}
})
} else if (this.type === 1) {
activityupdate(this.form).then(res => {
if (res.code === 200) {
this.$message.success('编辑成功')
this.$router.push('/activity/parkactivities/index')
} else {
this.$message.error(res.message)
}
})
}
},
// 取消按钮
cancel() {
......
......@@ -40,11 +40,27 @@
/>
</el-select>
</el-form-item>
<el-form-item prop="status">
<el-select
v-model="queryParams.status"
placeholder="审核状态"
clearable
size="small"
style="width: 200px"
>
<el-option
v-for="dict in auditstatus"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-date-picker
v-model="dateRange"
size="small"
style="width: 400px"
style="width: 300px"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
......@@ -86,12 +102,12 @@
</template>
</el-table-column>
<el-table-column prop="contacts" label="联系人" width="65" :show-overflow-tooltip="true" />
<el-table-column label="联系方式" prop="phone" :show-overflow-tooltip="true">
<el-table-column label="联系方式" prop="phone" width="120px" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.phone || '-' }}
</template>
</el-table-column>
<el-table-column label="报名人数" prop="number" :show-overflow-tooltip="true">
<el-table-column label="报名人数" prop="number" width="80px" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.number || '-' }}
</template>
......@@ -120,7 +136,7 @@
<span v-if="scope.row.activityStatus === 2" style="color: #D84848">已通过</span>
</template>
</el-table-column>
<el-table-column label="操作" class-name="small-padding fixed-width" width="240">
<el-table-column label="操作" width="280px">
<template slot-scope="scope">
<el-button
v-hasPermi="['sys:dict:edit']"
......@@ -140,6 +156,12 @@
type="text"
@click="handleDelete(scope.row)"
>删除</el-button>
<el-button
v-hasPermi="['sys:dict:remove']"
size="mini"
type="text"
@click="Audit(scope.row)"
>审核</el-button>
<el-switch
v-model="scope.row.status"
active-color="#D84848;"
......@@ -217,7 +239,7 @@
</el-upload>
</el-form-item>
<el-form-item label="活动内容" prop="activityDetails">
<quilleditor v-model="form.activityDetails"/>
<quilleditor v-model="form.activityDetails" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
......@@ -254,6 +276,29 @@
</el-form-item>
</el-form>
</el-dialog>
<!-- 审核-->
<el-dialog title="审核" :visible.sync="auditopen" width="779px" append-to-body @close="reset">
<el-form ref="form" :model="activityDetail" label-width="140px">
<el-form-item label="审核状态" prop="name">
<el-radio-group v-model="radio" @change="changeaudit">
<el-radio :label="0">通过</el-radio>
<el-radio :label="1">驳回</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-if="auditdisable" label="驳回原因" prop="price">
<el-input
type="textarea"
:rows="5"
placeholder="请输入驳回原因"
:max="200"
/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" :loading="manageLoading" :disabled="manageLoading" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
......@@ -263,7 +308,7 @@ import {
delType,
updateType,
exportType,
clearCache,
clearCache
} from '@/api/system/dict/type'
import Template from '@/views/instance/Template'
import quilleditor from '@/components/quilleditor'
......@@ -285,6 +330,9 @@ export default {
}
}
return {
radio: 0,
auditdisable: false,
auditopen: false,
starttime: '',
endtime: '',
value1: '',
......@@ -458,6 +506,21 @@ export default {
dictLabel: '已结束'
}
],
// 审核状态下拉框数据
auditstatus: [
{
dictValue: '0',
dictLabel: '待审核'
},
{
dictValue: '1',
dictLabel: '已驳回'
},
{
dictValue: '2',
dictLabel: '已通过'
}
],
// 日期范围
dateRange: [],
// 查询参数
......@@ -523,6 +586,18 @@ export default {
handlePreview(file) {
console.log(file)
},
// 单选框点击事件
changeaudit(val) {
if (val === 0) {
this.auditdisable = false
} else if (val === 1) {
this.auditdisable = true
}
},
// 审核按钮
Audit(row) {
this.auditopen = true
},
/** 查询字典类型列表 */
getList() {
listType(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
......@@ -573,6 +648,7 @@ export default {
// 取消按钮
cancel() {
this.open = false
this.auditopen = false
this.reset()
},
// 表单重置
......@@ -631,6 +707,7 @@ export default {
if (valid) {
this.reset()
this.open = false
this.auditopen = false
}
})
},
......
This diff is collapsed.
<template>
<div style="padding: 0 20px">
<div v-if="type === 0" class="add-title">新增活动</div>
<div v-if="type === 1" class="add-title">编辑活动</div>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="公告标题" prop="title">
<el-input v-model.trim="form.title" :maxlength="30" placeholder="请输入公告标题" />
</el-form-item>
<el-form-item label="公告详情" prop="details">
<div>
<quilleditor :value="form.details" :type="richtexttype" @value="getvalue" />
</div>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" :loading="manageLoading" :disabled="manageLoading" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</div>
</template>
<script>
import { announcementadd, announcementupdate } from '@/api/announcement'
import quilleditor from '@/components/quilleditor'
export default {
name: 'Annoceaddorupdate',
components: { quilleditor },
data() {
return {
// 表单参数
form: {},
// 表单校验
rules: {
title: [
{ required: true, message: '请输入公告标题', trigger: 'blur' }
],
details: [
{ required: true, message: '请输入公告详情', trigger: 'blur' }
]
},
manageLoading: false,
richtexttype: '',
type: this.$route.query.type
}
},
created() {
if (this.type === 0) {
this.form = {}
this.richtexttype = '0'
} else if (this.type === 1) {
this.form = this.$route.query.data
this.richtexttype = '1'
}
},
methods: {
/** 提交按钮 */
submitForm() {
this.$refs['form'].validate(valid => {
if (valid) {
this.manageLoading = true
const temp = Object.assign({}, this.form)
// TODO: clear this log
console.log(`temp`, temp)
if (this.type === 1) {
announcementupdate(temp).then(response => {
if (response.code === 200) {
this.$message({
message: '修改成功',
type: 'success'
})
this.$router.push('/announcements/index')
}
this.manageLoading = false
}).catch(() => { this.manageLoading = false })
} else {
announcementadd(temp).then(response => {
if (response.code === 200) {
this.$message({
message: '新增成功',
type: 'success'
})
this.$router.push('/announcements/index')
}
this.manageLoading = false
}).catch(() => { this.manageLoading = false })
}
}
})
},
getvalue(val) {
// this.reset()
this.form.details = val
},
// 取消按钮
cancel() {
// this.open = false
this.detailopen = false
this.reset()
this.$router.push('/announcements/index')
},
// 表单重置
reset() {
this.form = {}
}
}
}
</script>
<style scoped lang="scss">
.dialog-footer{
text-align: center;
}
</style>
<template>
<div class="announce-detail">
<div class="add-title">公告详情</div>
<el-form ref="form" :model="detailform" label-width="100px">
<el-form-item label="公告标题">
<span>{{ detailform.title || '-' }}</span>
</el-form-item>
<el-form-item label="公告发布时间">
<span>{{ detailform.pushTime || '-' }}</span>
</el-form-item>
<!-- <el-form-item label="公告创建者" prop="title">-->
<!-- <span>{{ detailform.createBy || '-' }}</span>-->
<!-- </el-form-item>-->
<el-form-item label="公告详情" prop="details">
<span v-if="detailform.details" class="details" v-html="detailform.details" />
<span v-else>-</span>
</el-form-item>
</el-form>
<div class="footer"><el-button @click="cancel">返回</el-button></div>
</div>
</template>
<script>
export default {
name: 'Detail',
data() {
return {
// 详情表单数据
detailform: this.$route.query.data
}
},
methods: {
cancel() {
this.$router.push('/announcements/index')
}
}
}
</script>
<style scoped lang="scss">
.announce-detail{
padding: 0 20px;
.footer{
padding-bottom: 20px;
margin: 20px 0;
text-align: center;
}
}
</style>
......@@ -144,18 +144,11 @@
<span v-else>-</span>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" :loading="manageLoading" :disabled="manageLoading" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
updateType
} from '@/api/system/dict/type'
import Template from '@/views/instance/Template'
import quilleditor from '@/components/quilleditor'
import {
......@@ -225,7 +218,8 @@ export default {
{ required: true, message: '请输入公告详情', trigger: 'blur' }
]
},
manageLoading: false
manageLoading: false,
dictIds: []
}
},
created() {
......@@ -294,23 +288,42 @@ export default {
},
/** 新增按钮操作 */
handleAdd() {
this.type = '0'
this.reset()
this.open = true
this.title = '新增园区公告'
// this.type = '0'
// this.reset()
// this.open = true
// this.title = '新增园区公告'
this.$router.push({
path: '/announcements/annoceaddorupdate',
query: {
type: 0
}
})
},
/** 详情按钮操作 */
handleDetail(row) {
this.detailform = row
this.detailopen = true
// this.detailform = row
// this.detailopen = true
this.$router.push({
path: '/announcements/detail',
query: {
data: row
}
})
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
this.title = '编辑园区公告'
this.form = row
this.open = true
this.type = '1'
// this.reset()
// this.title = '编辑园区公告'
// this.form = row
// this.open = true
// this.type = '1'
this.$router.push({
path: '/announcements/annoceaddorupdate',
query: {
type: 1,
data: row
}
})
},
/** 提交按钮 */
submitForm() {
......@@ -351,15 +364,16 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const text = row.title
const dictIds = []
const id = {
ids: dictIds.push(row.businessId)
}
this.$confirm('是否确认删除"' + text + '"的数据项?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
const id = {
ids: row.businessId
}
// TODO: clear this log
console.log(`id`, id)
return announcementdel(id)
}).then(() => {
console.log('删除')
......
......@@ -5,7 +5,7 @@
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<div style="display: flex;justify-content: space-between">
<el-form-item label="商家名称" prop="name" style="width: 100%;flex: 1">
<el-input v-model.trim="form.name" :maxlength="30" placeholder="请输入商家名称" />
<el-input v-model.trim="form.name" :maxlength="70" placeholder="请输入商家名称" />
</el-form-item>
<el-form-item label="入驻日期" prop="entryDate" style="flex: 1">
<el-date-picker
......@@ -16,22 +16,22 @@
/>
</el-form-item>
<el-form-item label="商家地址" prop="address" style="flex: 1">
<el-input v-model.trim="form.address" :maxlength="30" placeholder="请输入商家地址" />
<el-input v-model.trim="form.address" :maxlength="300" placeholder="请输入商家地址" />
</el-form-item>
</div>
<div style="display: flex;justify-content: space-between">
<el-form-item label="负责人" prop="head" style="flex: 1">
<el-input v-model.trim="form.head" :maxlength="30" placeholder="请输入负责人" />
<el-input v-model.trim="form.head" :maxlength="70" placeholder="请输入负责人" />
</el-form-item>
<el-form-item label="联系方式" prop="phone" style="flex: 1">
<el-input v-model.trim="form.phone" :maxlength="30" placeholder="请输入联系方式" />
<el-input v-model.trim="form.phone" :maxlength="15" placeholder="请输入联系方式" />
</el-form-item>
<el-form-item label="商家账号" prop="entryAccount" style="flex: 1">
<el-input v-model.trim="form.entryAccount" :maxlength="30" placeholder="请输入商家账号" />
<el-input v-model.trim="form.entryAccount" :maxlength="25" placeholder="请输入商家账号" />
</el-form-item>
</div>
<el-form-item label="商家简介" prop="entryDetails">
<el-input v-model.trim="form.entryDetails" type="textarea" placeholder="请输入商家简介" />
<el-input v-model.trim="form.entryDetails" type="textarea" :maxlength="500" placeholder="请输入商家简介" />
</el-form-item>
<el-form-item label="竖版封面" prop="img">
<el-upload
......@@ -40,6 +40,7 @@
:on-preview="handlePreview"
:on-remove="handleRemove"
:file-list="fileList"
:limit="1"
list-type="picture"
>
<!-- <el-button size="small" type="primary">点击上传</el-button>-->
......@@ -57,6 +58,7 @@
:on-remove="handleRemove"
:file-list="fileList"
list-type="picture"
:limit="1"
>
<!-- <el-button size="small" type="primary">点击上传</el-button>-->
<div class="upload-trademark">
......@@ -74,12 +76,19 @@
</template>
<script>
import { validMobile } from '@/utils/common'
export default {
name: 'Businessadd',
data() {
// 手机号校验
const validateMobile = function(rule, value, callback) {
validMobile(value) ? callback() : callback(new Error('手机号格式不正确'))
}
return {
// 表单数据
form: {},
manageLoading: false,
type: this.$route.query.type,
// 文件列表
fileList: [],
......@@ -102,8 +111,8 @@ export default {
// { validator: verifyNameProp, trigger: 'blur' }
],
phone: [
{ required: true, message: '请输入联系方式', trigger: 'blur' }
// { validator: verifyNameProp, trigger: 'blur' }
{ required: true, message: '请输入联系方式', trigger: 'blur' },
{ validator: validateMobile, trigger: 'blur' }
],
entryAccount: [
{ required: true, message: '请输入商家账号', trigger: 'blur' }
......@@ -112,12 +121,38 @@ export default {
}
}
},
created() {
if (this.type === 0) {
this.form = {}
} else if (this.type === 1) {
this.form = this.$route.query.data
}
},
methods: {
handleRemove(file, fileList) {
console.log(file, fileList)
},
handlePreview(file) {
console.log(file)
},
// 提交按钮
submitForm() {
this.$refs['form'].validate(valid => {
if (valid) {
this.reset()
// this.open = false
this.$router.push('/business/index')
}
})
},
// 取消按钮
cancel() {
this.reset()
this.$router.push('/business/index')
},
// 重置数据
reset() {
this.form = {}
}
}
}
......
This diff is collapsed.
<template>
<div class="equityseting">
<div class="equityseting-title">会员权益设定</div>
<div>
<div style="margin-bottom: 20px;display: flex;justify-content: space-between">
<div>积分兑换</div>
</div>
<div class="form2">
<el-form ref="dynamicValidateForm" :model="dynamicValidateForm" label-width="100px" class="demo-dynamic">
<div style="display: flex;justify-content: space-between">
<div style="width: 100%;flex: 1">
<el-form-item prop="amount" label="消费金额">
<el-input v-model="dynamicValidateForm.amount" placeholder="请输入消费金额" />
</el-form-item>
</div>
<div style="width: 100%;flex: 1">
<el-form-item prop="integral" label="兑换积分">
<el-input v-model="dynamicValidateForm.integral" placeholder="请输入兑换积分" />
</el-form-item>
</div>
<!-- <el-button v-if="dynamicValidateForm.length > 1" style="width: 60px;height:32px;margin-left: 20px" @click.prevent="remove(domain)">删除</el-button>-->
</div>
</el-form>
</div>
</div>
<div class="form1">
<div style="margin-bottom: 20px;display: flex;justify-content: space-between">
<div>会员等级</div>
<el-button type="primary" icon="el-icon-plus" @click="addDomain">新增</el-button>
</div>
<el-table border :data="membershiplevel">
<!-- <el-table-column type="selection" width="55" align="center" />-->
<el-table-column label="序号" type="index" align="center" width="55" />
<el-table-column label="会员名称" prop="name" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ scope.row.name || '' }}</span>
</template>
</el-table-column>
<el-table-column label="会员等级" prop="level" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.level || '-' }}
</template>
</el-table-column>
<el-table-column label="积分条件" prop="integral" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.integral || '-' }}
</template>
</el-table-column>
<el-table-column label="折扣" prop="discount" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.discount || '-' }}
</template>
</el-table-column>
<el-table-column label="操作" class-name="small-padding fixed-width" width="240">
<template slot-scope="scope">
<el-button
v-hasPermi="['sys:dict:remove']"
size="mini"
type="text"
@click="update(scope.row)"
>编辑</el-button>
<el-button
v-hasPermi="['sys:dict:remove']"
size="mini"
type="text"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div style="text-align: center">
<el-button type="primary" @click="submitForm">提交</el-button>
<el-button @click="resetForm">重置</el-button>
</div>
<!--新增会员等级弹窗-->
<el-dialog title="新增会员等级" :visible.sync="open" width="500px" append-to-body @close="reset">
<el-form ref="addForm" :model="form" :rules="rule" label-width="100px" class="demo-dynamic">
<el-form-item prop="name" label="会员名称">
<el-input v-model="form.name" placeholder="请输入会员名称" :maxlength="120"/>
</el-form-item>
<el-form-item prop="level" label="会员等级">
<el-input v-model="form.level" placeholder="请输入会员等级" :maxlength="10"/>
</el-form-item>
<el-form-item prop="integral" label="积分条件">
<el-input v-model="form.integral" placeholder="请输入积分条件" :maxlength="10"/>
</el-form-item>
<el-form-item prop="discount" label="折扣">
<el-input v-model="form.discount" placeholder="请输入折扣" :maxlength="10"/>
</el-form-item>
<div style="text-align: center">
<el-button type="primary" @click="addsubmitForm">提交</el-button>
<el-button @click="resetForm">重置</el-button>
</div>
</el-form>
</el-dialog>
</div>
</template>
<script>
export default {
data() {
return {
form: {
name: '',
level: '',
integral: '',
discount: ''
},
open: false,
rule: {
name: [
{ required: true, message: '请输入会员名称', trigger: 'blur' }
],
level: [
{ required: true, message: '请输入会员等级', trigger: 'blur' }
],
integral: [
{ required: true, message: '请输入积分条件', trigger: 'blur' }
],
discount: [
{ required: true, message: '请输入折扣', trigger: 'blur' }
]
},
membershiplevel: [
{
name: '青铜',
level: '1',
integral: '0',
discount: '0.99'
},
{
name: '白银',
level: '2',
integral: '50',
discount: '0.95'
},
{
name: '黄金',
level: '3',
integral: '100',
discount: '0.9'
},
{
name: '铂金',
level: '4',
integral: '200',
discount: '0.85'
},
{
name: '钻石',
level: '5',
integral: '400',
discount: '0.8'
},
{
name: '至尊',
level: '6',
integral: '800',
discount: '0.75'
}
],
dynamicValidateForm: {
amount: '100',
integral: '10'
}
}
},
methods: {
// 新增会员等级提交按钮
addsubmitForm() {
this.$refs['addForm'].validate((valid) => {
if (valid) {
this.resetForm()
this.open = false
} else {
console.log('error submit!!')
return false
}
})
},
handleDelete() {
},
// 积分兑换提交按钮
submitForm() {
this.$refs['dynamicValidateForm'].validate((valid) => {
if (valid) {
console.log('submit!!')
} else {
console.log('error submit!!')
return false
}
})
},
// 重置表单
resetForm() {
this.form = {}
},
// 会员等级新增方法
addDomain() {
this.resetForm()
this.open = true
},
// 会员等级编辑
update(row) {
this.form = row
this.open = true
}
}
}
</script>
<style scoped lang="scss">
.equityseting{
padding: 20px;
.equityseting-title{
font-size: 20px;
font-weight: bold;
text-align: center;
padding-bottom: 20px;
}
.form1{
margin-bottom: 20px;
}
.form2{
margin-bottom: 20px;
}
}
</style>
This diff is collapsed.
......@@ -43,10 +43,12 @@
<el-date-picker
v-model="dateRange"
size="small"
style="width: 200px"
style="width: 300px"
value-format="yyyy-MM-dd"
type="date"
placeholder="下单时间"
type="daterange"
range-separator="-"
start-placeholder="下单开始时间"
end-placeholder="下单截止时间"
/>
</el-form-item>
<el-form-item>
......@@ -351,7 +353,44 @@ export default {
open: false,
open1: false,
// 状态数据字典
statusOptions: [],
statusOptions: [
{
dictValue: '0',
dictLabel: '待支付'
},
{
dictValue: '1',
dictLabel: '已取消'
},
{
dictValue: '2',
dictLabel: '退款中'
},
{
dictValue: '4',
dictLabel: '后台退款中'
},
{
dictValue: '6',
dictLabel: '退款完成 '
},
{
dictValue: '7',
dictLabel: '后台退款完成'
},
{
dictValue: '8',
dictLabel: '支付中'
},
{
dictValue: '9',
dictLabel: '支付完成'
},
{
dictValue: '10',
dictLabel: '订单关闭'
}
],
// 日期范围
dateRange: [],
// 查询参数
......@@ -401,9 +440,6 @@ export default {
this.queryParams = { ...param }
}
this.getList()
this.getDicts(dictCons['NORMAL_DISABLE']).then(response => {
this.statusOptions = response.data
})
optionselect().then(response => {
this.options = response.data
})
......@@ -455,10 +491,6 @@ export default {
row.flag = row.flag === '0' ? '1' : '0'
})
},
// 字典状态字典翻译
statusFormat(row, column) {
return this.selectDictLabel(this.statusOptions, row.flag)
},
// 取消按钮
cancel() {
this.open = false
......
......@@ -111,13 +111,13 @@
style="color: #49cec9"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
v-hasPermi="['sys:role:update']"
size="mini"
type="text"
icon="el-icon-circle-check"
@click="handleMenu(scope.row)"
>数据权限</el-button>
<!-- <el-button-->
<!-- v-hasPermi="['sys:role:update']"-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-circle-check"-->
<!-- @click="handleMenu(scope.row)"-->
<!-- >数据权限</el-button>-->
<el-button
size="mini"
type="text"
......
This diff is collapsed.
<template>
<div class="coupon-add">
<div v-if="type === 0" class="add-title">新增优惠券</div>
<div v-if="type === 1" class="add-title">编辑优惠券</div>
<el-form ref="form" :model="form" :rules="rules" label-width="120px" class="coupon-form">
<div style="display: flex;justify-content: space-between">
<el-form-item label="优惠券名称" prop="name" style="flex: 1;">
<el-input v-model.trim="form.name" :maxlength="120" placeholder="请输入优惠券名称" style="width: 80%" />
</el-form-item>
<el-form-item label="优惠券类型" prop="type" style="flex: 1">
<el-radio v-model="form.type" :label="0">代金券</el-radio>
<el-radio v-model="form.type" :label="1">折扣券</el-radio>
</el-form-item>
</div>
<div style="display: flex;justify-content: space-between">
<el-form-item v-if="form.type === 0" label="优惠金额" prop="amount" style="flex: 1">
<el-input v-model.trim="form.amount" :maxlength="30" placeholder="请输入优惠金额" style="width: 80%" />
</el-form-item>
<el-form-item v-if="form.type === 1" label="折扣" prop="discount" style="flex: 1">
<el-input v-model.trim="form.discount" :maxlength="30" placeholder="请输入折扣" style="width: 80%" />
</el-form-item>
<el-form-item label="限制金额使用" prop="limitAmount" style="flex: 1">
<el-input v-model.trim="form.limitAmount" :maxlength="30" placeholder="请输入限制金额使用" style="width: 80%" />
</el-form-item>
</div>
<div style="display: flex;justify-content: space-between">
<el-form-item label="使用时间限制" style="flex: 1">
<el-radio v-model="timelimit" label="0" style="display: flex;align-items: center;margin-bottom: 20px">
<div style="display: flex;align-items: center">
<span style="margin-right: 5px">获取后</span>
<el-input v-model.number="timelimitvalue" :disabled="inputdisable" style="width: 100px" />
<span style="margin-left: 5px">天内有效(0为不限时间使用)</span>
</div>
</el-radio>
<el-radio v-model="timelimit" label="1" style="display: flex;align-items: center">
<div style="display: flex;align-items: center">
<span style="margin-right: 20px">时间范围</span>
<el-date-picker
v-model="form.useBeginTime"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:disabled="timedisable"
style="width: 75%"
/>
</div>
</el-radio>
</el-form-item>
<el-form-item label="数量" prop="num" style="flex: 1">
<el-input-number v-model.trim="form.num" controls-position="right" :min="1" :maxlength="30" placeholder="请输入数量" style="width: 80%" @change="handleChange" />
</el-form-item>
</div>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" :loading="manageLoading" :disabled="manageLoading" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</div>
</template>
<script>
export default {
name: 'Addcoupon',
data() {
return {
// 判断是新增还是编辑,0为新增,1为编辑
type: this.$route.query.type,
// 按钮loading
manageLoading: false,
// 表单数据
form: {
type: 0
},
timedisable: true, // 日期选择器是否禁用
inputdisable: false, // 输入框是否禁用
// 校验规则
rules: {
name: [
{ required: true, message: '请输入优惠券名称', trigger: 'blur' }
],
timelimit: [
{ required: true, message: '请选择使用时间限制', trigger: 'change' }
],
type: [
{ required: true, message: '请选择优惠券类型', trigger: 'change' }
],
limitAmount: [
{ required: true, message: '请输入限制金额使用', trigger: 'blur' }
],
limitTime: [
{ required: true, message: '请输入领取后时效天数', trigger: 'blur' }
],
useBeginTime: [
{ required: true, message: '请选择有效期开始时间', trigger: 'blur' }
],
useEndTime: [
{ required: true, message: '请选择有效期结束时间', trigger: 'change' }
],
num: [
{ required: true, message: '请输入数量', trigger: 'blur' }
],
amount: [
{ required: true, message: '请输入优惠金额', trigger: 'blur' }
],
discount: [
{ required: true, message: '请输入折扣', trigger: 'blur' }
]
},
radio: 0,
timelimit: '0', // 使用时间限制
timelimitvalue: 0,
statusOptions: [],
options: []
}
},
watch: {
timelimit(newValue, oldValue) {
if (newValue === '0') {
this.inputdisable = false
this.timedisable = true
} else if (newValue === '1') {
this.inputdisable = true
this.timedisable = false
}
}
},
created() {
if (this.type === 0) {
this.form = {
type: 0
}
} else if (this.type === 1) {
this.form = this.$route.query.data
this.radio = this.form.type
}
},
methods: {
submitForm() {
this.$refs['form'].validate(valid => {
if (valid) {
this.$router.push('/voucher/coupon/index')
}
})
},
cancel() {
this.$router.push('/voucher/coupon/index')
},
handleChange(value) {
console.log(value)
}
}
}
</script>
<style scoped lang="scss">
.coupon-add{
padding: 0 20px;
//padding-top: 0px;
.coupon-form{
}
.dialog-footer{
margin-top: 40px;
text-align: center;
}
}
</style>
This diff is collapsed.
......@@ -68,7 +68,7 @@
/>
</div>
</div>
<div id="main1" style="width: 100%;height: 239px" />
<div id="main1" style="width: 100%;height: 239px" class="main1" />
</div>
<div class="left-botton">
<div class="toptitle">
......@@ -192,7 +192,7 @@ export default {
data: this.opinionData,
smooth: true,
itemStyle: {
color: '#D84848'
color: '#D84848',
}
}
]
......@@ -432,4 +432,7 @@ export default {
}
}
}
.main1{
width: auto;
}
</style>
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