Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
C
chinafrica
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
zhengfg
chinafrica
Commits
40bbf27b
提交
40bbf27b
authored
11月 28, 2020
作者:
吴德鹏
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
活动管理
上级
e8410255
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
908 行增加
和
0 行删除
+908
-0
ActivityController.java
...main/java/com/platform/controller/ActivityController.java
+109
-0
ActivityDao.java
...orm-admin/src/main/java/com/platform/dao/ActivityDao.java
+13
-0
ActivityEntity.java
...min/src/main/java/com/platform/entity/ActivityEntity.java
+287
-0
ActivityService.java
...n/src/main/java/com/platform/service/ActivityService.java
+71
-0
ActivityServiceImpl.java
...n/java/com/platform/service/impl/ActivityServiceImpl.java
+59
-0
ActivityDao.xml
...admin/src/main/resources/com/platform/dao/ActivityDao.xml
+156
-0
activity.html
...form-admin/src/main/webapp/WEB-INF/page/sys/activity.html
+89
-0
activity.js
platform-admin/src/main/webapp/js/sys/activity.js
+124
-0
没有找到文件。
platform-admin/src/main/java/com/platform/controller/ActivityController.java
0 → 100644
浏览文件 @
40bbf27b
package
com
.
platform
.
controller
;
import
com.platform.entity.ActivityEntity
;
import
com.platform.service.ActivityService
;
import
com.platform.utils.PageUtils
;
import
com.platform.utils.Query
;
import
com.platform.utils.R
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
java.util.List
;
import
java.util.Map
;
/**
* Controller
*
* @author lipengjun
* @date 2020-11-28 16:30:49
*/
@Controller
@RequestMapping
(
"activity"
)
public
class
ActivityController
{
@Autowired
private
ActivityService
activityService
;
/**
* 查看列表
*/
@RequestMapping
(
"/list"
)
@RequiresPermissions
(
"activity:list"
)
@ResponseBody
public
R
list
(
@RequestParam
Map
<
String
,
Object
>
params
)
{
//查询列表数据
Query
query
=
new
Query
(
params
);
List
<
ActivityEntity
>
activityList
=
activityService
.
queryList
(
query
);
int
total
=
activityService
.
queryTotal
(
query
);
PageUtils
pageUtil
=
new
PageUtils
(
activityList
,
total
,
query
.
getLimit
(),
query
.
getPage
());
return
R
.
ok
().
put
(
"page"
,
pageUtil
);
}
/**
* 查看信息
*/
@RequestMapping
(
"/info/{id}"
)
@RequiresPermissions
(
"activity:info"
)
@ResponseBody
public
R
info
(
@PathVariable
(
"id"
)
String
id
)
{
ActivityEntity
activity
=
activityService
.
queryObject
(
id
);
return
R
.
ok
().
put
(
"activity"
,
activity
);
}
/**
* 保存
*/
@RequestMapping
(
"/save"
)
@RequiresPermissions
(
"activity:save"
)
@ResponseBody
public
R
save
(
@RequestBody
ActivityEntity
activity
)
{
activityService
.
save
(
activity
);
return
R
.
ok
();
}
/**
* 修改
*/
@RequestMapping
(
"/update"
)
@RequiresPermissions
(
"activity:update"
)
@ResponseBody
public
R
update
(
@RequestBody
ActivityEntity
activity
)
{
activityService
.
update
(
activity
);
return
R
.
ok
();
}
/**
* 删除
*/
@RequestMapping
(
"/delete"
)
@RequiresPermissions
(
"activity:delete"
)
@ResponseBody
public
R
delete
(
@RequestBody
String
[]
ids
)
{
activityService
.
deleteBatch
(
ids
);
return
R
.
ok
();
}
/**
* 查看所有列表
*/
@RequestMapping
(
"/queryAll"
)
@ResponseBody
public
R
queryAll
(
@RequestParam
Map
<
String
,
Object
>
params
)
{
List
<
ActivityEntity
>
list
=
activityService
.
queryList
(
params
);
return
R
.
ok
().
put
(
"list"
,
list
);
}
}
platform-admin/src/main/java/com/platform/dao/ActivityDao.java
0 → 100644
浏览文件 @
40bbf27b
package
com
.
platform
.
dao
;
import
com.platform.entity.ActivityEntity
;
/**
* Dao
*
* @author lipengjun
* @date 2020-11-28 16:30:49
*/
public
interface
ActivityDao
extends
BaseDao
<
ActivityEntity
>
{
}
platform-admin/src/main/java/com/platform/entity/ActivityEntity.java
0 → 100644
浏览文件 @
40bbf27b
package
com
.
platform
.
entity
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Date
;
/**
* 实体
* 表名 activity
*
* @author lipengjun
* @date 2020-11-28 16:30:49
*/
public
class
ActivityEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 活动ID
*/
private
String
id
;
/**
* 活动名称
*/
private
String
name
;
/**
* 活动类型 1:满减 2:满折 3:满几件打折
*/
private
Integer
type
;
/**
* 使用类型 1:全场 2:分类商品 3:特定商品
*/
private
Integer
useType
;
/**
* 商品分类ID
*/
private
String
categoryId
;
/**
* 活动图片
*/
private
String
picture
;
/**
* 满减金额
*/
private
BigDecimal
fullAmount
;
/**
* 抵扣金额
*/
private
BigDecimal
reducedAmount
;
/**
* 折扣率
*/
private
Double
discountRate
;
/**
* 商品IDS
*/
private
String
itemIds
;
/**
* 活动状态 0:关闭 1:开启
*/
private
Integer
status
;
/**
* 活动开始时间
*/
private
Date
startTime
;
/**
* 活动结束时间
*/
private
Date
endTime
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 更新时间
*/
private
Date
updateTime
;
/**
* 设置:活动ID
*/
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
/**
* 获取:活动ID
*/
public
String
getId
()
{
return
id
;
}
/**
* 设置:活动名称
*/
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
/**
* 获取:活动名称
*/
public
String
getName
()
{
return
name
;
}
/**
* 设置:活动类型 1:满减 2:满折 3:满几件打折
*/
public
void
setType
(
Integer
type
)
{
this
.
type
=
type
;
}
/**
* 获取:活动类型 1:满减 2:满折 3:满几件打折
*/
public
Integer
getType
()
{
return
type
;
}
/**
* 设置:使用类型 1:全场 2:分类商品 3:特定商品
*/
public
void
setUseType
(
Integer
useType
)
{
this
.
useType
=
useType
;
}
/**
* 获取:使用类型 1:全场 2:分类商品 3:特定商品
*/
public
Integer
getUseType
()
{
return
useType
;
}
/**
* 设置:商品分类ID
*/
public
void
setCategoryId
(
String
categoryId
)
{
this
.
categoryId
=
categoryId
;
}
/**
* 获取:商品分类ID
*/
public
String
getCategoryId
()
{
return
categoryId
;
}
/**
* 设置:活动图片
*/
public
void
setPicture
(
String
picture
)
{
this
.
picture
=
picture
;
}
/**
* 获取:活动图片
*/
public
String
getPicture
()
{
return
picture
;
}
/**
* 设置:满减金额
*/
public
void
setFullAmount
(
BigDecimal
fullAmount
)
{
this
.
fullAmount
=
fullAmount
;
}
/**
* 获取:满减金额
*/
public
BigDecimal
getFullAmount
()
{
return
fullAmount
;
}
/**
* 设置:抵扣金额
*/
public
void
setReducedAmount
(
BigDecimal
reducedAmount
)
{
this
.
reducedAmount
=
reducedAmount
;
}
/**
* 获取:抵扣金额
*/
public
BigDecimal
getReducedAmount
()
{
return
reducedAmount
;
}
/**
* 设置:折扣率
*/
public
void
setdiscountRate
(
Double
discountRate
)
{
this
.
discountRate
=
discountRate
;
}
/**
* 获取:折扣率
*/
public
Double
getdiscountRate
()
{
return
discountRate
;
}
/**
* 设置:商品IDS
*/
public
void
setItemIds
(
String
itemIds
)
{
this
.
itemIds
=
itemIds
;
}
/**
* 获取:商品IDS
*/
public
String
getItemIds
()
{
return
itemIds
;
}
/**
* 设置:活动状态 0:关闭 1:开启
*/
public
void
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
}
/**
* 获取:活动状态 0:关闭 1:开启
*/
public
Integer
getStatus
()
{
return
status
;
}
/**
* 设置:活动开始时间
*/
public
void
setStartTime
(
Date
startTime
)
{
this
.
startTime
=
startTime
;
}
/**
* 获取:活动开始时间
*/
public
Date
getStartTime
()
{
return
startTime
;
}
/**
* 设置:活动结束时间
*/
public
void
setEndTime
(
Date
endTime
)
{
this
.
endTime
=
endTime
;
}
/**
* 获取:活动结束时间
*/
public
Date
getEndTime
()
{
return
endTime
;
}
/**
* 设置:创建时间
*/
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
/**
* 获取:创建时间
*/
public
Date
getCreateTime
()
{
return
createTime
;
}
/**
* 设置:更新时间
*/
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
/**
* 获取:更新时间
*/
public
Date
getUpdateTime
()
{
return
updateTime
;
}
}
platform-admin/src/main/java/com/platform/service/ActivityService.java
0 → 100644
浏览文件 @
40bbf27b
package
com
.
platform
.
service
;
import
com.platform.entity.ActivityEntity
;
import
java.util.List
;
import
java.util.Map
;
/**
* Service接口
*
* @author lipengjun
* @date 2020-11-28 16:30:49
*/
public
interface
ActivityService
{
/**
* 根据主键查询实体
*
* @param id 主键
* @return 实体
*/
ActivityEntity
queryObject
(
String
id
);
/**
* 分页查询
*
* @param map 参数
* @return list
*/
List
<
ActivityEntity
>
queryList
(
Map
<
String
,
Object
>
map
);
/**
* 分页统计总数
*
* @param map 参数
* @return 总数
*/
int
queryTotal
(
Map
<
String
,
Object
>
map
);
/**
* 保存实体
*
* @param activity 实体
* @return 保存条数
*/
int
save
(
ActivityEntity
activity
);
/**
* 根据主键更新实体
*
* @param activity 实体
* @return 更新条数
*/
int
update
(
ActivityEntity
activity
);
/**
* 根据主键删除
*
* @param id
* @return 删除条数
*/
int
delete
(
String
id
);
/**
* 根据主键批量删除
*
* @param ids
* @return 删除条数
*/
int
deleteBatch
(
String
[]
ids
);
}
platform-admin/src/main/java/com/platform/service/impl/ActivityServiceImpl.java
0 → 100644
浏览文件 @
40bbf27b
package
com
.
platform
.
service
.
impl
;
import
com.platform.dao.ActivityDao
;
import
com.platform.entity.ActivityEntity
;
import
com.platform.service.ActivityService
;
import
com.platform.utils.IdUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.Map
;
/**
* Service实现类
*
* @author lipengjun
* @date 2020-11-28 16:30:49
*/
@Service
(
"activityService"
)
public
class
ActivityServiceImpl
implements
ActivityService
{
@Autowired
private
ActivityDao
activityDao
;
@Override
public
ActivityEntity
queryObject
(
String
id
)
{
return
activityDao
.
queryObject
(
id
);
}
@Override
public
List
<
ActivityEntity
>
queryList
(
Map
<
String
,
Object
>
map
)
{
return
activityDao
.
queryList
(
map
);
}
@Override
public
int
queryTotal
(
Map
<
String
,
Object
>
map
)
{
return
activityDao
.
queryTotal
(
map
);
}
@Override
public
int
save
(
ActivityEntity
activity
)
{
activity
.
setId
(
IdUtil
.
createIdbyUUID
());
return
activityDao
.
save
(
activity
);
}
@Override
public
int
update
(
ActivityEntity
activity
)
{
return
activityDao
.
update
(
activity
);
}
@Override
public
int
delete
(
String
id
)
{
return
activityDao
.
delete
(
id
);
}
@Override
public
int
deleteBatch
(
String
[]
ids
)
{
return
activityDao
.
deleteBatch
(
ids
);
}
}
platform-admin/src/main/resources/com/platform/dao/ActivityDao.xml
0 → 100644
浏览文件 @
40bbf27b
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.platform.dao.ActivityDao"
>
<resultMap
type=
"com.platform.entity.ActivityEntity"
id=
"activityMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"name"
column=
"name"
/>
<result
property=
"type"
column=
"type"
/>
<result
property=
"useType"
column=
"use_type"
/>
<result
property=
"categoryId"
column=
"category_id"
/>
<result
property=
"picture"
column=
"picture"
/>
<result
property=
"fullAmount"
column=
"full_amount"
/>
<result
property=
"reducedAmount"
column=
"reduced_amount"
/>
<result
property=
"discountRate"
column=
"discount_rate"
/>
<result
property=
"itemIds"
column=
"item_ids"
/>
<result
property=
"status"
column=
"status"
/>
<result
property=
"startTime"
column=
"start_time"
/>
<result
property=
"endTime"
column=
"end_time"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
</resultMap>
<select
id=
"queryObject"
resultType=
"com.platform.entity.ActivityEntity"
>
select
`id`,
`name`,
`type`,
`use_type`,
`category_id`,
`picture`,
`full_amount`,
`reduced_amount`,
`discount_rate`,
`item_ids`,
`status`,
`start_time`,
`end_time`,
`create_time`,
`update_time`
from activity
where id = #{id}
</select>
<select
id=
"queryList"
resultType=
"com.platform.entity.ActivityEntity"
>
select
`id`,
`name`,
`type`,
`use_type`,
`category_id`,
`picture`,
`full_amount`,
`reduced_amount`,
`discount_rate`,
`item_ids`,
`status`,
`start_time`,
`end_time`,
`create_time`,
`update_time`
from activity
WHERE 1=1
<if
test=
"name != null and name.trim() != ''"
>
AND name LIKE concat('%',#{name},'%')
</if>
<choose>
<when
test=
"sidx != null and sidx.trim() != ''"
>
order by ${sidx} ${order}
</when>
<otherwise>
order by id desc
</otherwise>
</choose>
<if
test=
"offset != null and limit != null"
>
limit #{offset}, #{limit}
</if>
</select>
<select
id=
"queryTotal"
resultType=
"int"
>
select count(*) from activity
WHERE 1=1
<if
test=
"name != null and name.trim() != ''"
>
AND name LIKE concat('%',#{name},'%')
</if>
</select>
<insert
id=
"save"
parameterType=
"com.platform.entity.ActivityEntity"
>
insert into activity(
`id`,
`name`,
`type`,
`use_type`,
`category_id`,
`picture`,
`full_amount`,
`reduced_amount`,
`discount_rate`,
`item_ids`,
`status`,
`start_time`,
`end_time`,
`create_time`,
`update_time`)
values(
#{id},
#{name},
#{type},
#{useType},
#{categoryId},
#{picture},
#{fullAmount},
#{reducedAmount},
#{
discountRate},
#{itemIds},
#{status},
#{startTime},
#{endTime},
#{createTime},
#{updateTime})
</insert>
<update
id=
"update"
parameterType=
"com.platform.entity.ActivityEntity"
>
update activity
<set>
<if
test=
"name != null"
>
`name` = #{name},
</if>
<if
test=
"type != null"
>
`type` = #{type},
</if>
<if
test=
"useType != null"
>
`use_type` = #{useType},
</if>
<if
test=
"categoryId != null"
>
`category_id` = #{categoryId},
</if>
<if
test=
"picture != null"
>
`picture` = #{picture},
</if>
<if
test=
"fullAmount != null"
>
`full_amount` = #{fullAmount},
</if>
<if
test=
"reducedAmount != null"
>
`reduced_amount` = #{reducedAmount},
</if>
<if
test=
"discountRate != null"
>
`discount_rate` = #{discountRate},
</if>
<if
test=
"itemIds != null"
>
`item_ids` = #{itemIds},
</if>
<if
test=
"status != null"
>
`status` = #{status},
</if>
<if
test=
"startTime != null"
>
`start_time` = #{startTime},
</if>
<if
test=
"endTime != null"
>
`end_time` = #{endTime},
</if>
<if
test=
"createTime != null"
>
`create_time` = #{createTime},
</if>
<if
test=
"updateTime != null"
>
`update_time` = #{updateTime}
</if>
</set>
where id = #{id}
</update>
<delete
id=
"delete"
>
delete from activity where id = #{value}
</delete>
<delete
id=
"deleteBatch"
>
delete from activity where id in
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</delete>
</mapper>
platform-admin/src/main/webapp/WEB-INF/page/sys/activity.html
0 → 100644
浏览文件 @
40bbf27b
<!DOCTYPE html>
<html>
<head>
<title></title>
#parse("sys/header.html")
</head>
<body>
<div
id=
"rrapp"
v-cloak
style=
"height: calc(100% - 15px);"
>
<div
v-show=
"showList"
style=
"height: 100%;"
>
<Row
:gutter=
"16"
>
<div
class=
"search-group"
>
<i-col
span=
"4"
>
<i-input
v-model=
"q.name"
@
on-enter=
"query"
placeholder=
"名称"
/>
</i-col>
<i-button
@
click=
"query"
>
查询
</i-button>
<i-button
@
click=
"reloadSearch"
>
重置
</i-button>
</div>
<div
class=
"buttons-group"
>
#if($shiro.hasPermission("activity:save"))
<i-button
type=
"info"
@
click=
"add"
><i
class=
"fa fa-plus"
></i>
新增
</i-button>
#end
#if($shiro.hasPermission("activity:update"))
<i-button
type=
"warning"
@
click=
"update"
><i
class=
"fa fa-pencil-square-o"
></i>
修改
</i-button>
#end
#if($shiro.hasPermission("activity:delete"))
<i-button
type=
"error"
@
click=
"del"
><i
class=
"fa fa-trash-o"
></i>
删除
</i-button>
#end
</div>
</Row>
<table
id=
"jqGrid"
></table>
</div>
<Card
v-show=
"!showList"
>
<p
slot=
"title"
>
{{title}}
</p>
<i-form
ref=
"formValidate"
:model=
"activity"
:rules=
"ruleValidate"
:label-width=
"80"
>
<Form-item
label=
"活动名称"
prop=
"name"
>
<i-input
v-model=
"activity.name"
placeholder=
"活动名称"
/>
</Form-item>
<Form-item
label=
"活动类型 1:满减 2:满折 3:满几件打折"
prop=
"type"
>
<i-input
v-model=
"activity.type"
placeholder=
"活动类型 1:满减 2:满折 3:满几件打折"
/>
</Form-item>
<Form-item
label=
"使用类型 1:全场 2:分类商品 3:特定商品"
prop=
"useType"
>
<i-input
v-model=
"activity.useType"
placeholder=
"使用类型 1:全场 2:分类商品 3:特定商品"
/>
</Form-item>
<Form-item
label=
"商品分类ID"
prop=
"categoryId"
>
<i-input
v-model=
"activity.categoryId"
placeholder=
"商品分类ID"
/>
</Form-item>
<Form-item
label=
"活动图片"
prop=
"picture"
>
<i-input
v-model=
"activity.picture"
placeholder=
"活动图片"
/>
</Form-item>
<Form-item
label=
"满减金额"
prop=
"fullAmount"
>
<i-input
v-model=
"activity.fullAmount"
placeholder=
"满减金额"
/>
</Form-item>
<Form-item
label=
"抵扣金额"
prop=
"reducedAmount"
>
<i-input
v-model=
"activity.reducedAmount"
placeholder=
"抵扣金额"
/>
</Form-item>
<Form-item
label=
"折扣率"
prop=
"discountRate"
>
<i-input
v-model=
"activity.discountRate"
placeholder=
"折扣率"
/>
</Form-item>
<Form-item
label=
"商品IDS"
prop=
"itemIds"
>
<i-input
v-model=
"activity.itemIds"
placeholder=
"商品IDS"
/>
</Form-item>
<Form-item
label=
"活动状态 0:关闭 1:开启"
prop=
"status"
>
<i-input
v-model=
"activity.status"
placeholder=
"活动状态 0:关闭 1:开启"
/>
</Form-item>
<Form-item
label=
"活动开始时间"
prop=
"startTime"
>
<i-input
v-model=
"activity.startTime"
placeholder=
"活动开始时间"
/>
</Form-item>
<Form-item
label=
"活动结束时间"
prop=
"endTime"
>
<i-input
v-model=
"activity.endTime"
placeholder=
"活动结束时间"
/>
</Form-item>
<Form-item
label=
"创建时间"
prop=
"createTime"
>
<i-input
v-model=
"activity.createTime"
placeholder=
"创建时间"
/>
</Form-item>
<Form-item
label=
"更新时间"
prop=
"updateTime"
>
<i-input
v-model=
"activity.updateTime"
placeholder=
"更新时间"
/>
</Form-item>
<Form-item>
<i-button
type=
"primary"
@
click=
"handleSubmit('formValidate')"
>
提交
</i-button>
<i-button
type=
"warning"
@
click=
"reload"
style=
"margin-left: 8px"
/>
返回
</i-button>
<i-button
type=
"ghost"
@
click=
"handleReset('formValidate')"
style=
"margin-left: 8px"
>
重置
</i-button>
</Form-item>
</i-form>
</Card>
</div>
<script
src=
"${rc.contextPath}/js/sys/activity.js?_${date.systemTime}"
></script>
</body>
</html>
platform-admin/src/main/webapp/js/sys/activity.js
0 → 100644
浏览文件 @
40bbf27b
$
(
function
()
{
$
(
"#jqGrid"
).
Grid
({
url
:
'../activity/list'
,
colModel
:
[
{
label
:
'id'
,
name
:
'id'
,
index
:
'id'
,
key
:
true
,
hidden
:
true
},
{
label
:
'活动名称'
,
name
:
'name'
,
index
:
'name'
,
width
:
80
},
{
label
:
'活动类型 1:满减 2:满折 3:满几件打折'
,
name
:
'type'
,
index
:
'type'
,
width
:
80
},
{
label
:
'使用类型 1:全场 2:分类商品 3:特定商品'
,
name
:
'useType'
,
index
:
'use_type'
,
width
:
80
},
{
label
:
'商品分类ID'
,
name
:
'categoryId'
,
index
:
'category_id'
,
width
:
80
},
{
label
:
'活动图片'
,
name
:
'picture'
,
index
:
'picture'
,
width
:
80
},
{
label
:
'满减金额'
,
name
:
'fullAmount'
,
index
:
'full_amount'
,
width
:
80
},
{
label
:
'抵扣金额'
,
name
:
'reducedAmount'
,
index
:
'reduced_amount'
,
width
:
80
},
{
label
:
'折扣率'
,
name
:
'discountRate'
,
index
:
'discount_rate'
,
width
:
80
},
{
label
:
'商品IDS'
,
name
:
'itemIds'
,
index
:
'item_ids'
,
width
:
80
},
{
label
:
'活动状态 0:关闭 1:开启'
,
name
:
'status'
,
index
:
'status'
,
width
:
80
},
{
label
:
'活动开始时间'
,
name
:
'startTime'
,
index
:
'start_time'
,
width
:
80
},
{
label
:
'活动结束时间'
,
name
:
'endTime'
,
index
:
'end_time'
,
width
:
80
},
{
label
:
'创建时间'
,
name
:
'createTime'
,
index
:
'create_time'
,
width
:
80
},
{
label
:
'更新时间'
,
name
:
'updateTime'
,
index
:
'update_time'
,
width
:
80
}]
});
});
let
vm
=
new
Vue
({
el
:
'#rrapp'
,
data
:
{
showList
:
true
,
title
:
null
,
activity
:
{},
ruleValidate
:
{
name
:
[
{
required
:
true
,
message
:
'名称不能为空'
,
trigger
:
'blur'
}
]
},
q
:
{
name
:
''
}
},
methods
:
{
query
:
function
()
{
vm
.
reload
();
},
add
:
function
()
{
vm
.
showList
=
false
;
vm
.
title
=
"新增"
;
vm
.
activity
=
{};
},
update
:
function
(
event
)
{
let
id
=
getSelectedRow
(
"#jqGrid"
);
if
(
id
==
null
)
{
return
;
}
vm
.
showList
=
false
;
vm
.
title
=
"修改"
;
vm
.
getInfo
(
id
);
},
saveOrUpdate
:
function
(
event
)
{
let
url
=
vm
.
activity
.
id
==
null
?
"../activity/save"
:
"../activity/update"
;
Ajax
.
request
({
url
:
url
,
params
:
JSON
.
stringify
(
vm
.
activity
),
type
:
"POST"
,
contentType
:
"application/json"
,
successCallback
:
function
(
r
)
{
alert
(
'操作成功'
,
function
(
index
)
{
vm
.
reload
();
});
}
});
},
del
:
function
(
event
)
{
let
ids
=
getSelectedRows
(
"#jqGrid"
);
if
(
ids
==
null
){
return
;
}
confirm
(
'确定要删除选中的记录?'
,
function
()
{
Ajax
.
request
({
url
:
"../activity/delete"
,
params
:
JSON
.
stringify
(
ids
),
type
:
"POST"
,
contentType
:
"application/json"
,
successCallback
:
function
()
{
alert
(
'操作成功'
,
function
(
index
)
{
vm
.
reload
();
});
}
});
});
},
getInfo
:
function
(
id
){
Ajax
.
request
({
url
:
"../activity/info/"
+
id
,
async
:
true
,
successCallback
:
function
(
r
)
{
vm
.
activity
=
r
.
activity
;
}
});
},
reload
:
function
(
event
)
{
vm
.
showList
=
true
;
let
page
=
$
(
"#jqGrid"
).
jqGrid
(
'getGridParam'
,
'page'
);
$
(
"#jqGrid"
).
jqGrid
(
'setGridParam'
,
{
postData
:
{
'name'
:
vm
.
q
.
name
},
page
:
page
}).
trigger
(
"reloadGrid"
);
vm
.
handleReset
(
'formValidate'
);
},
reloadSearch
:
function
()
{
vm
.
q
=
{
name
:
''
};
vm
.
reload
();
},
handleSubmit
:
function
(
name
)
{
handleSubmitValidate
(
this
,
name
,
function
()
{
vm
.
saveOrUpdate
()
});
},
handleReset
:
function
(
name
)
{
handleResetForm
(
this
,
name
);
}
}
});
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论